|
@@ -1,45 +1,112 @@
|
|
|
<template>
|
|
|
- <span v-if="subTitle && subTitle.length">
|
|
|
- <span v-for="(item, index) in subTitle" :key="item.id" @click="displayDefects(item, index)">{{ item.value }}</span>
|
|
|
+ <span>
|
|
|
+ <span v-for="(item, index) in reportTextList" :key="index">
|
|
|
+ <span class="query-bug" @click="query(item, index)">{{ item.label }}</span>
|
|
|
+ </span>
|
|
|
+ <div @click.stop>
|
|
|
+ <drawer-all v-if="openDrawer" :drawer="openDrawer" :data="requireList" @clone="openDrawer = false" />
|
|
|
+ </div>
|
|
|
</span>
|
|
|
</template>
|
|
|
<script>
|
|
|
+import drawerAll from '@/views/quality/components/drawerAll'
|
|
|
export default {
|
|
|
name: 'SubTitle',
|
|
|
+ components: { drawerAll },
|
|
|
props: {
|
|
|
- /**
|
|
|
- * subTitle: [
|
|
|
- * 。。。。。
|
|
|
- * {
|
|
|
- * id: 1,
|
|
|
- * value: '标题'
|
|
|
- * }
|
|
|
- * 。。。。。
|
|
|
- * ]
|
|
|
- */
|
|
|
subTitle: {
|
|
|
type: Array,
|
|
|
required: false,
|
|
|
default: () => []
|
|
|
}
|
|
|
},
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ reportTextList: [],
|
|
|
+ openDrawer: false,
|
|
|
+ requireList: {},
|
|
|
+ bugPriority: ['全部', 'P0&P1', 'P1以上'],
|
|
|
+ bugHour: ['24小时内修复', '全部修复', '24小时未修复']
|
|
|
+ }
|
|
|
+ },
|
|
|
+ watch: {
|
|
|
+ subTitle: {
|
|
|
+ handler(newV) {
|
|
|
+ this.getReportList(newV)
|
|
|
+ },
|
|
|
+ immediate: true
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
methods: {
|
|
|
- /**
|
|
|
- * 显示缺陷
|
|
|
- * 默认只有6条数据
|
|
|
- * 0 ---> 新增缺陷:全部
|
|
|
- * 1 ---> 新增缺陷:P0&P1
|
|
|
- * 2 ---> 修复缺陷时长:全部
|
|
|
- * 3 ---> 修复缺陷时长:P0&P1
|
|
|
- * // 下面是2条进度条
|
|
|
- * 4 ---> 缺陷24小时修复:全部
|
|
|
- * 5 ---> 缺陷24小时修复:P0&P1
|
|
|
- * @param item
|
|
|
- */
|
|
|
- displayDefects(item) {
|
|
|
- console.log(item)
|
|
|
+ getReportList(list) {
|
|
|
+ list.map(item => {
|
|
|
+ this.reportTextList = [...this.reportTextList, { label: item.label, option: item.reportBugs }]
|
|
|
+ })
|
|
|
+ },
|
|
|
+ query(data, index) {
|
|
|
+ const [q, w, e] = [[], [], []]
|
|
|
+ if (index <= 3) {
|
|
|
+ if (data.option[0]) {
|
|
|
+ data.option.map(item => {
|
|
|
+ q.push(item.id) // 全部
|
|
|
+ if (item.priority < 2) { w.push(item.id) } // P0&P1
|
|
|
+ if (item.priority > 1) { e.push(item.id) } // P1以上
|
|
|
+ })
|
|
|
+ }
|
|
|
+ let title = '新增缺陷'
|
|
|
+ if (index === 2 || index === 3) {
|
|
|
+ title = '缺陷修复时长'
|
|
|
+ index === 2 ? index = 0 : ''
|
|
|
+ index === 3 ? index = 1 : ''
|
|
|
+ }
|
|
|
+ const yaxis = [q, w, e]
|
|
|
+ this.requireList = { toType: '缺陷', xaxis: this.bugPriority, title: title, yaxis: yaxis, dataIndex: index }
|
|
|
+ } else if (index > 3) {
|
|
|
+ let [one, tow, three] = [[], [], []]
|
|
|
+ if (data.option[0]) {
|
|
|
+ data.option.map(item => {
|
|
|
+ if (item.isRepaired && item.repairTime < 24) { // 24小时内修复
|
|
|
+ this.setOption(item, one)
|
|
|
+ q.push(item.id)
|
|
|
+ if (item.priority < 2) { w.push(item.id) }
|
|
|
+ if (item.priority > 1) { e.push(item.id) }
|
|
|
+ one = [q, w, e]
|
|
|
+ } else if (item.isRepaired) { // 全不修复
|
|
|
+ q.push(item.id)
|
|
|
+ if (item.priority < 2) { w.push(item.id) }
|
|
|
+ if (item.priority > 1) { e.push(item.id) }
|
|
|
+ tow = [q, w, e]
|
|
|
+ } else if (!item.isRepaired && item.repairTime > 24) { // 24小时内未修复
|
|
|
+ q.push(item.id)
|
|
|
+ if (item.priority < 2) { w.push(item.id) }
|
|
|
+ if (item.priority > 1) { e.push(item.id) }
|
|
|
+ three = [q, w, e]
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ if (index === 4 || index === 5) {
|
|
|
+ index === 4 ? index = 0 : ''
|
|
|
+ index === 5 ? index = 1 : ''
|
|
|
+ }
|
|
|
+ const yaxis = [one, tow, three]
|
|
|
+ this.requireList = { toType: '缺陷', xaxis: this.bugHour, towTimeLine: this.bugPriority, title: '缺陷24小时修复', yaxis: yaxis, dataIndex: index }
|
|
|
+ }
|
|
|
+ this.openDrawer = true
|
|
|
+ },
|
|
|
+ setOption(item, data) {
|
|
|
+ const [q, w, e] = [[], [], []]
|
|
|
+ q.push(item.id)
|
|
|
+ if (item.priority < 2) { w.push(item.id) }
|
|
|
+ if (item.priority > 1) { e.push(item.id) }
|
|
|
+ data = [q, w, e]
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
</script>
|
|
|
-<style scoped lang="less"></style>
|
|
|
+<style scoped lang="less">
|
|
|
+.query-bug:hover {
|
|
|
+ color: #409eff;
|
|
|
+ cursor: pointer;
|
|
|
+}
|
|
|
+</style>
|