|
@@ -2,33 +2,16 @@
|
|
|
<el-drawer :title="Statistics.title" :visible.sync="drawer_" :direction="direction" :modal="false" :class="{'drawer-box': showClass}" size="100%" :before-close="handleClose">
|
|
|
<div>
|
|
|
<div class="qz-drawer-header">
|
|
|
- <timeline :data="list" :num="defaultKey" @update="getTimeLine" />
|
|
|
- <!-- <timeline :data="list" @update="getTimeLine" /> -->
|
|
|
- </div>
|
|
|
- <div style="height: calc(100vh - 295px); overflow: scroll; overflow-x: hidden;">
|
|
|
- <div class="qz-drawer-H">需求等级为p1的需求</div>
|
|
|
- <el-table :data="tableData" style="width: 100%;" :header-cell-style="{ 'color':'rgba(74,74,74,1)','font-size':'14px','font-weight':'500' }" class="integration-num">
|
|
|
- <el-table-column label="优先级" min-width="100">
|
|
|
- <template slot-scope="scope">
|
|
|
- <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="需求名称" min-width="250">
|
|
|
- <template slot-scope="scope">
|
|
|
- <div class="drawer-id">{{ scope.row.requirementDisplayId }}</div>
|
|
|
- <el-tooltip v-if="scope.row.name.length >= 15" class="item" effect="dark" :content="scope.row.name" placement="top">
|
|
|
- <div class="drawer-name" @click="jumper(scope.row)">{{ scope.row.name | ellipsis }}</div>
|
|
|
- </el-tooltip>
|
|
|
- <div v-else class="drawer-name" @click="jumper(scope.row)">{{ scope.row.name | ellipsis }}</div>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column label="状态" min-width="100">
|
|
|
- <template slot-scope="scope">
|
|
|
- <div>{{ scope.row.statusName }}</div>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- </el-table>
|
|
|
+ <div class="qz-drawer-scll">
|
|
|
+ <timeline :data="list" :num="defaultKey" :bgmargin="bgMargin" @update="getvalue" />
|
|
|
+ </div>
|
|
|
+ <div v-if="Statistics.towTimeLine" class="qz-drawer-scll">
|
|
|
+ <timeline :data="Statistics.towTimeLine" :num="defaultKey2" :bgmargin="bgMargin" @update="getvalueTow" />
|
|
|
+ </div>
|
|
|
</div>
|
|
|
+ <div v-if="Statistics.title === '需求分布图数据'" class="qz-drawer-H">{{ status }}为{{ type }}的需求</div>
|
|
|
+ <div v-if="Statistics.title === '状态停留分布图数据'" class="qz-drawer-H">在{{ type }}状态停留时长为{{ typeTow }}的需求</div>
|
|
|
+ <qzTable :data="tableData" :title="Statistics.title" />
|
|
|
</div>
|
|
|
<el-pagination
|
|
|
style="text-align: center;"
|
|
@@ -43,36 +26,36 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import { EncryptId } from '@/utils/crypto-js.js'
|
|
|
import { getRequirement } from '@/api/requirement.js'
|
|
|
// import { taskList } from '@/api/taskIndex'
|
|
|
-// import { bugList, bugGetEnum } from '@/api/defectManage'
|
|
|
+import { bugList } from '@/api/defectManage'
|
|
|
import timeline from '@/components/timeline'
|
|
|
+import qzTable from './tables'
|
|
|
export default {
|
|
|
components: {
|
|
|
- timeline
|
|
|
- },
|
|
|
- filters: {
|
|
|
- ellipsis(value) {
|
|
|
- if (!value) return ''
|
|
|
- if (value.length > 15) {
|
|
|
- return value.slice(0, 15) + '...'
|
|
|
- }
|
|
|
- return value
|
|
|
- }
|
|
|
+ timeline,
|
|
|
+ qzTable
|
|
|
},
|
|
|
props: {
|
|
|
data: { type: Object, required: true },
|
|
|
- drawer: { type: Boolean, default: false }
|
|
|
+ drawer: { type: Boolean, default: false },
|
|
|
+ status: { type: String, default: '' }
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
- list: [{ value: 0, name: '全部' }, { value: 1, name: 'P0' }, { value: 2, name: 'P1' }, { value: 3, name: 'P2' }, { value: 4, name: 'P3' }],
|
|
|
- priorityColors: ['#F56C6C', '#FF8952', '#F5E300', '#7ED321', '#61D3B8', '#69B3FF', '#BDBDBD'],
|
|
|
+ list: [],
|
|
|
+ bgMargin: false,
|
|
|
+ dataList: [],
|
|
|
Statistics: {}, // title
|
|
|
direction: 'rtl',
|
|
|
showClass: false,
|
|
|
+ defaultKey2: 0,
|
|
|
+ defaultKey: 0,
|
|
|
bugList: [],
|
|
|
+ type: '',
|
|
|
+ typeTow: '',
|
|
|
+ towVal: '',
|
|
|
+ oneVal: '',
|
|
|
currentPage: 1,
|
|
|
total: 0,
|
|
|
paging: {
|
|
@@ -85,98 +68,118 @@ export default {
|
|
|
computed: {
|
|
|
drawer_: {
|
|
|
get() { return this.drawer },
|
|
|
- set(v) {
|
|
|
- this.$emit('clone', v)
|
|
|
- }
|
|
|
+ set(v) { this.$emit('clone', v) }
|
|
|
}
|
|
|
},
|
|
|
watch: {
|
|
|
data: {
|
|
|
handler(newV, oldV) {
|
|
|
- this.Statistics = newV
|
|
|
- this.list = newV.xaxis
|
|
|
- this.defaultKey = newV.dataIndex
|
|
|
- this.currentPage = 1
|
|
|
- this.paging = {
|
|
|
- curIndex: 1, // 分页
|
|
|
- pageSize: 10 // 分页
|
|
|
+ if (newV) {
|
|
|
+ console.log(newV, this.drawer, '刚进来')
|
|
|
+ this.Statistics = newV
|
|
|
+ this.list = newV.xaxis
|
|
|
+ this.type = newV.name
|
|
|
+ this.bgMargin = false
|
|
|
+ this.currentPage = 1
|
|
|
+ this.paging = { curIndex: 1, pageSize: 10 }
|
|
|
+ this.setDrawerDate()
|
|
|
}
|
|
|
- this.getTableData(this.Statistics.yaxis[0].idList[this.defaultKey],)
|
|
|
},
|
|
|
immediate: true
|
|
|
}
|
|
|
},
|
|
|
- // created() {
|
|
|
- // this.bugGetEnum()
|
|
|
- // },
|
|
|
mounted() {
|
|
|
this.$nextTick(() => {
|
|
|
this.showClass = true
|
|
|
})
|
|
|
},
|
|
|
methods: {
|
|
|
+ setDrawerDate() {
|
|
|
+ if (this.Statistics.title === '需求分布图数据') {
|
|
|
+ this.defaultKey = this.Statistics.dataIndex
|
|
|
+ this.dataList = this.Statistics.yaxis[0].idList[this.defaultKey]
|
|
|
+ this.getTableData(this.dataList)
|
|
|
+ } else if (this.Statistics.title === '缺陷统计数据') {
|
|
|
+ const key = this.Statistics.xaxis.indexOf(this.Statistics.label)
|
|
|
+ this.defaultKey = key === -1 ? 0 : key
|
|
|
+ this.dataList = this.Statistics.idList
|
|
|
+ this.getTableData(this.dataList)
|
|
|
+ } else if (this.Statistics.title === '状态停留分布图数据') {
|
|
|
+ this.bgMargin = true
|
|
|
+ this.typeTow = this.Statistics.seriesName // 停留时长
|
|
|
+ this.defaultKey = this.Statistics.dataIndex
|
|
|
+ this.defaultKey2 = Number(this.Statistics.seriesIndex)
|
|
|
+ this.dataList = this.Statistics.statusList.yaxis[this.defaultKey2].idList[this.defaultKey]
|
|
|
+ this.getTableData(this.dataList)
|
|
|
+ }
|
|
|
+ },
|
|
|
handleClick(row) {
|
|
|
console.log(row)
|
|
|
},
|
|
|
- getTimeLine(val) {
|
|
|
- console.log(val, 'vfvdv')
|
|
|
- const data = this.Statistics.yaxis[0].idList[val.value]
|
|
|
- if (data[0]) {
|
|
|
- this.getTableData(this.Statistics.yaxis[0].idList[val.value])
|
|
|
- } else {
|
|
|
+ getvalue(e) {
|
|
|
+ this.oneVal = e
|
|
|
+ this.type = e.name
|
|
|
+ this.defaultKey = e.value
|
|
|
+ this.getTimeLine()
|
|
|
+ },
|
|
|
+ getvalueTow(e) {
|
|
|
+ this.towVal = e
|
|
|
+ this.typeTow = e.name
|
|
|
+ this.defaultKey2 = e.value
|
|
|
+ this.getTimeLine()
|
|
|
+ },
|
|
|
+ getTimeLine() { // 数据筛选
|
|
|
+ this.dataList = []
|
|
|
+ this.currentPage = 1
|
|
|
+ this.paging = { curIndex: 1, pageSize: 10 }
|
|
|
+ if (this.Statistics.title === '需求分布图数据') {
|
|
|
+ this.dataList = this.Statistics.yaxis[0].idList[this.oneVal.value]
|
|
|
+ } else if (this.Statistics.title === '缺陷统计数据') {
|
|
|
+ this.dataList = this.Statistics.yaxis[this.oneVal.value].idList
|
|
|
+ } else if (this.Statistics.title === '状态停留分布图数据') {
|
|
|
+ this.dataList = this.Statistics.statusList.yaxis[this.defaultKey2].idList[this.defaultKey]
|
|
|
+ }
|
|
|
+ if (this.dataList[0]) { // 判断idList有没有数据
|
|
|
+ this.getTableData(this.dataList)
|
|
|
+ } else { // 没有数据初始化table
|
|
|
this.tableData = []
|
|
|
+ this.total = 0
|
|
|
}
|
|
|
},
|
|
|
async getTableData(taskIdList) {
|
|
|
- const data = {
|
|
|
- ids: taskIdList,
|
|
|
- ...this.paging
|
|
|
- }
|
|
|
- // if (this.Statistics.idList !== undefined && this.Statistics.idList.length > 0) {
|
|
|
- // this.paging.ids = this.Statistics.idList
|
|
|
- // if (this.Statistics.typeStr === '需求') {
|
|
|
- const res = await getRequirement(data)
|
|
|
- if (res.code === 200) {
|
|
|
- console.log(res, '农村科技大厦')
|
|
|
- this.tableData = res.data.list
|
|
|
- // this.total = res.data.total
|
|
|
- }
|
|
|
+ const data = { ids: taskIdList, ...this.paging }
|
|
|
+ if (this.Statistics.title === '需求分布图数据' || this.Statistics.title === '状态停留分布图数据') {
|
|
|
+ const res = await getRequirement(data)
|
|
|
+ if (res.code === 200) {
|
|
|
+ console.log(res, '农村科技大厦')
|
|
|
+ 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 if (this.Statistics.title === '缺陷统计数据') {
|
|
|
+ const res = await bugList(data)
|
|
|
+ if (res.code === 200) {
|
|
|
+ this.tableData = res.data
|
|
|
+ this.total = res.total
|
|
|
+ }
|
|
|
+ }
|
|
|
// } else {
|
|
|
// this.tableData = []
|
|
|
// }
|
|
|
},
|
|
|
- jumper(val) {
|
|
|
- const bizId_id = EncryptId(`${val.bizId}_${val.id}`)
|
|
|
- const newTab = this.$router.resolve({ name: this.Statistics.typeStr + '详情', query: { bizId_id: bizId_id }})
|
|
|
- window.open(newTab.href, '_blank')
|
|
|
- },
|
|
|
- // async bugGetEnum() {
|
|
|
- // const res = await bugGetEnum()
|
|
|
- // if (res.code === 200) {
|
|
|
- // this.bugList = res.data.bugEnumList
|
|
|
- // this.showClass = true
|
|
|
- // }
|
|
|
- // },
|
|
|
handleSizeChange(val) {
|
|
|
this.paging.pageSize = val
|
|
|
- this.getTableData()
|
|
|
+ this.getTableData(this.dataList)
|
|
|
},
|
|
|
handleCurrentChange(val) {
|
|
|
this.paging.curIndex = val
|
|
|
- this.getTableData()
|
|
|
+ this.getTableData(this.dataList)
|
|
|
},
|
|
|
handleClose(done) {
|
|
|
this.$emit('clone')
|
|
@@ -194,8 +197,11 @@ export default {
|
|
|
margin: 20px 30px;
|
|
|
padding: 1px 0;
|
|
|
overflow: hidden;
|
|
|
+}
|
|
|
+.qz-drawer-scll {
|
|
|
overflow-x: auto;
|
|
|
}
|
|
|
+.qz-drawer-scll::-webkit-scrollbar { width: 0 !important; height: 0 !important }
|
|
|
.qz-drawer-H {
|
|
|
font-size: 16px;
|
|
|
font-weight: 500;
|
|
@@ -204,12 +210,7 @@ export default {
|
|
|
}
|
|
|
>>> :focus{outline:0;}
|
|
|
.integration-num {
|
|
|
- margin: 20px 30px;
|
|
|
-}
|
|
|
-
|
|
|
-.drawer-name:hover {
|
|
|
- color: #409eff;
|
|
|
- cursor: pointer;
|
|
|
+ margin: 5px 30px;
|
|
|
}
|
|
|
|
|
|
.div_priority {
|
|
@@ -219,10 +220,6 @@ export default {
|
|
|
border-radius: 4px;
|
|
|
margin-left: 4px;
|
|
|
}
|
|
|
-.drawer-id {
|
|
|
- color: rgb(167, 174, 188);
|
|
|
- font-size: 10px;
|
|
|
-}
|
|
|
>>>.el-drawer__header {
|
|
|
color: #444;
|
|
|
font-size: 20px;
|