|
@@ -1,17 +1,43 @@
|
|
|
<template>
|
|
|
- <el-drawer :title="Statistics.label" :visible.sync="drawer_" :direction="direction" :modal="false" :before-close="handleClose">
|
|
|
- <div class="integration-num">{{ Statistics.total }}</div>
|
|
|
+ <el-drawer :title="Statistics.label" :visible.sync="drawer_" :direction="direction" :modal="false" size="50%" :before-close="handleClose">
|
|
|
+ <div class=" _font">{{ Statistics.total }}</div>
|
|
|
<el-table :data="tableData" style="width: 100%" class="integration-num">
|
|
|
- <el-table-column prop="date" label="日期" min-width="180">
|
|
|
+ <el-table-column label="优先级" min-width="180">
|
|
|
<template slot-scope="scope">
|
|
|
- {{ scope.row.date }}
|
|
|
+ <div class="div_priority" :style="{background: priorityColors[scope.row.priority % priorityColors.length]}">{{ 'P'+scope.row.priority }}</div>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column :label="Statistics.typeStr + '名称'" min-width="250">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <div v-if="Statistics.typeStr === '需求' || Statistics.typeStr === '任务'">{{ scope.row.name }}</div>
|
|
|
+ <div v-if="Statistics.typeStr === '缺陷'">{{ scope.row.bugName }}</div>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="状态" min-width="180">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <div v-if="Statistics.typeStr === '需求'">{{ scope.row.statusName }}</div>
|
|
|
+ <div v-if="Statistics.typeStr === '任务'">{{ scope.row.statusString }}</div>
|
|
|
+ <div v-if="Statistics.typeStr === '缺陷'">{{ querySatus(scope.row.status) }}</div>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
|
+ <el-pagination
|
|
|
+ style="text-align: center;"
|
|
|
+ :current-page="currentPage"
|
|
|
+ :page-sizes="[10, 20, 30, 40]"
|
|
|
+ :page-size="10"
|
|
|
+ layout="total, sizes, prev, pager, next, jumper"
|
|
|
+ :total="total"
|
|
|
+ @size-change="handleSizeChange"
|
|
|
+ @current-change="handleCurrentChange"
|
|
|
+ />
|
|
|
</el-drawer>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
+import { getRequirement } from '@/api/requirement.js'
|
|
|
+import { taskList } from '@/api/taskIndex'
|
|
|
+import { bugList, bugGetEnum } from '@/api/defectManage'
|
|
|
export default {
|
|
|
props: {
|
|
|
data: { type: Object, required: true },
|
|
@@ -19,8 +45,16 @@ export default {
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
+ priorityColors: ['#F56C6C', '#FF8952', '#F5E300', '#7ED321', '#61D3B8', '#69B3FF', '#BDBDBD'],
|
|
|
Statistics: {}, // title
|
|
|
direction: 'rtl',
|
|
|
+ bugList: [],
|
|
|
+ currentPage: 1,
|
|
|
+ total: 0,
|
|
|
+ paging: {
|
|
|
+ curIndex: 1, // 分页
|
|
|
+ pageSize: 15 // 分页
|
|
|
+ },
|
|
|
tableData: [{
|
|
|
date: '2016-05-02',
|
|
|
name: '王小虎',
|
|
@@ -41,13 +75,65 @@ export default {
|
|
|
data: {
|
|
|
handler(newV, oldV) {
|
|
|
this.Statistics = newV
|
|
|
+ this.getTableData()
|
|
|
},
|
|
|
immediate: true
|
|
|
}
|
|
|
},
|
|
|
+ created() {
|
|
|
+ this.bugGetEnum()
|
|
|
+ },
|
|
|
methods: {
|
|
|
+ async getTableData() {
|
|
|
+ if (this.Statistics.idList !== undefined && this.Statistics.idList.length > 0) {
|
|
|
+ this.paging.ids = this.Statistics.idList
|
|
|
+ if (this.Statistics.typeStr === '需求') {
|
|
|
+ const res = await getRequirement(this.paging)
|
|
|
+ if (res.code === 200) {
|
|
|
+ this.tableData = res.data.list
|
|
|
+ this.total = res.data.total
|
|
|
+ }
|
|
|
+ } else if (this.Statistics.typeStr === '任务') {
|
|
|
+ const res = await taskList(this.paging)
|
|
|
+ if (res.code === 200) {
|
|
|
+ this.tableData = res.data
|
|
|
+ this.total = res.total
|
|
|
+ }
|
|
|
+ } else if (this.Statistics.typeStr === '缺陷') {
|
|
|
+ const res = await bugList(this.paging)
|
|
|
+ if (res.code === 200) {
|
|
|
+ this.tableData = res.data
|
|
|
+ this.total = res.total
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ this.tableData = []
|
|
|
+ }
|
|
|
+ },
|
|
|
+ querySatus(val) {
|
|
|
+ let data = ''
|
|
|
+ this.bugList.map(item => {
|
|
|
+ if (val === item.code) {
|
|
|
+ data = item.name
|
|
|
+ }
|
|
|
+ })
|
|
|
+ return data
|
|
|
+ },
|
|
|
+ async bugGetEnum() {
|
|
|
+ const res = await bugGetEnum()
|
|
|
+ if (res.code === 200) {
|
|
|
+ this.bugList = res.data.bugEnumList
|
|
|
+ }
|
|
|
+ },
|
|
|
+ handleSizeChange(val) {
|
|
|
+ this.paging.pageSize = val
|
|
|
+ this.getTableData()
|
|
|
+ },
|
|
|
+ handleCurrentChange(val) {
|
|
|
+ this.paging.curIndex = val
|
|
|
+ this.getTableData()
|
|
|
+ },
|
|
|
handleClose(done) {
|
|
|
- this.drawer = false
|
|
|
this.$emit('clone')
|
|
|
}
|
|
|
}
|
|
@@ -56,6 +142,22 @@ export default {
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
.integration-num {
|
|
|
- margin: 0 20px;
|
|
|
+ margin: 20px;
|
|
|
+}
|
|
|
+.div_priority {
|
|
|
+ color: #ffffff;
|
|
|
+ width:fit-content;
|
|
|
+ padding: 0 12px;
|
|
|
+ border-radius: 4px;
|
|
|
+ margin-left: 4px;
|
|
|
+}
|
|
|
+._font {
|
|
|
+ font-size: 16px;
|
|
|
+ color: #409eff;
|
|
|
+}
|
|
|
+>>>.el-drawer__header {
|
|
|
+ color: #444;
|
|
|
+ font-size: 20px;
|
|
|
+ font-weight: 500;
|
|
|
}
|
|
|
</style>
|