qinzhipeng_v@didiglobal.com 4 年 前
コミット
1e0c50e3c0

+ 94 - 27
src/views/monthlyReport/childrenPage/editReport/components/SubTitle.vue

@@ -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>

+ 6 - 8
src/views/monthlyReport/components/monthlyEards.vue

@@ -12,7 +12,7 @@
       <div class="div_ellipsis" style="color: #FAAD14;">
         待反馈:
         <el-tooltip class="item" effect="dark" :content="data.feedback" placement="top-start">
-          {{ data.feedback }}
+          <span style="color: #FAAD14;">{{ data.feedback }}</span>
         </el-tooltip>
       </div>
       <div style="margin-bottom: 10px; color: #FAAD14;">
@@ -39,14 +39,12 @@
       <svg-icon class="report-icon-title" icon-class="icon-yellow" />上月改进
     </div>
     <section class="report-content-data" style="margin-bottom: 10px; height: 100px; overflow-y: auto;">
-      <div v-for="(item, index) in data.lastMonthImprovment.improve" :key="index">
-        {{ data.lastMonthImprovment.projectName || '少时诵诗书' }}
-        负责人:
-        <span>{{ item.charge }}</span>,
-        进展:
-        <span>{{ item.process }}</span>
+      <div v-if="!data.lastMonthImprovment.improve[0]">暂无数据</div>
+      <div v-for="(item, index) in data.lastMonthImprovment.improve" :key="index" class="Layout-flex">
+        <span style="flex: 1;">{{ item.name }}</span>
+        <div style="flex: 1;">负责人:<span>{{ item.charge }}</span></div>
+        <div style="flex: 1;">进展:<span>{{ item.process }}%</span></div>
       </div>
-      <div v-if="!data.lastMonthImprovment.improve">暂无数据</div>
     </section>
   </el-card>
 </template>

+ 19 - 1
src/views/quality/components/drawerAll.vue

@@ -98,6 +98,7 @@ export default {
   watch: {
     data: {
       handler(newV, oldV) {
+        console.log(newV, '刚进来')
         if (newV) {
           this.Statistics = newV
           this.list = newV.xaxis
@@ -175,6 +176,18 @@ export default {
         this.show = false
         this.dataList = this.Statistics.idList
         this.getTableData(this.dataList)
+      } else if (this.Statistics.title === '新增缺陷' || this.Statistics.title === '缺陷修复时长') {
+        this.defaultKey = this.Statistics.dataIndex
+        this.dataList = this.Statistics.yaxis[this.defaultKey]
+        this.getTableData(this.dataList)
+      } else if (this.Statistics.title === '缺陷24小时修复') {
+        this.bgMargin = true
+        this.defaultKey = this.Statistics.dataIndex
+        this.defaultKey2 = 0
+        this.defaultKey = this.Statistics.dataIndex
+        const listData = this.Statistics.yaxis[this.defaultKey]
+        this.dataList = listData[this.defaultKey2]
+        this.getTableData(this.dataList)
       }
       this.$nextTick(() => { // 时间轴定位
         const dateId = document.getElementById('index')
@@ -223,6 +236,11 @@ export default {
         this.dataList = this.Statistics[this.defaultKey].idList
       } else if (this.Statistics.title === `${this.Statistics.qz_holiday}的修复时长区间数据`) {
         this.dataList = this.Statistics.series[this.defaultKey2].idList[this.defaultKey]
+      } else if (this.Statistics.title === '新增缺陷' || this.Statistics.title === '缺陷修复时长') {
+        this.dataList = this.Statistics.yaxis[this.defaultKey]
+      } else if (this.Statistics.title === '缺陷24小时修复') {
+        const listData = this.Statistics.yaxis[this.defaultKey]
+        this.dataList = listData[this.defaultKey2]
       }
       if (this.dataList[0]) { // 判断idList有没有数据
         this.getTableData(this.dataList)
@@ -252,7 +270,7 @@ export default {
           this.tableData = res.data
           this.total = res.total
         }
-      } else if (this.Statistics.title === '缺陷统计数据' || this.Statistics.title === '分布图数据' || this.Statistics.title === `责任人分布数据` || this.Statistics.title === '去除节假日的修复时长数据' || this.Statistics.title === '模块分布数据' || this.Statistics.title === `${this.Statistics.qz_holiday}的修复时长区间数据` || this.Statistics.title === '平均修复时长数据' || this.Statistics.title === '趋势图数据' || this.Statistics.title === '累计修复' && this.Statistics.toType === '缺陷' || this.Statistics.title === '累计reopen' && this.Statistics.toType === '缺陷' || this.Statistics.title === '累计新增' && this.Statistics.toType === '缺陷') {
+      } else if (this.Statistics.title === '缺陷24小时修复' || this.Statistics.title === '新增缺陷' || this.Statistics.title === '缺陷修复时长' || this.Statistics.title === '缺陷统计数据' || this.Statistics.title === '分布图数据' || this.Statistics.title === `责任人分布数据` || this.Statistics.title === '去除节假日的修复时长数据' || this.Statistics.title === '模块分布数据' || this.Statistics.title === `${this.Statistics.qz_holiday}的修复时长区间数据` || this.Statistics.title === '平均修复时长数据' || this.Statistics.title === '趋势图数据' || this.Statistics.title === '累计修复' && this.Statistics.toType === '缺陷' || this.Statistics.title === '累计reopen' && this.Statistics.toType === '缺陷' || this.Statistics.title === '累计新增' && this.Statistics.toType === '缺陷') {
         const res = await bugList(data)
         if (res.code === 200) {
           this.tableData = res.data

+ 2 - 2
src/views/quality/components/tables/index.vue

@@ -99,7 +99,7 @@
       </el-table-column>
     </el-table>
 
-    <el-table v-if="title === '分布图数据' || title === '去除节假日的修复时长数据' || title === '模块分布数据' || title === '缺陷统计数据' || title === '责任人分布数据' || title === '平均修复时长数据' || title === '趋势图数据' || title === '累计修复' && type === '缺陷' || title === '累计reopen' && type === '缺陷' || title === '累计新增' && type === '缺陷'" :data="data" style="width: auto;" :height="setTitleHeight()" :header-cell-style="{ 'color':'rgba(74,74,74,1)','font-size':'14px','font-weight':'500' }">
+    <el-table v-if="title === '缺陷24小时修复' || title === '缺陷修复时长' || title === '新增缺陷' || title === '分布图数据' || title === '去除节假日的修复时长数据' || title === '模块分布数据' || title === '缺陷统计数据' || title === '责任人分布数据' || title === '平均修复时长数据' || title === '趋势图数据' || title === '累计修复' && type === '缺陷' || title === '累计reopen' && type === '缺陷' || title === '累计新增' && type === '缺陷'" :data="data" style="width: auto;" :height="setTitleHeight()" :header-cell-style="{ 'color':'rgba(74,74,74,1)','font-size':'14px','font-weight':'500' }">
       <el-table-column label="缺陷等级" min-width="80" align="left">
         <template slot-scope="scope" style="text-align: center;">
           <span class="div_priority" :style="{background: priorityColors[scope.row.priority % priorityColors.length]}">{{ scope.row.priorityName }}</span>
@@ -111,7 +111,7 @@
           <span class="drawer-name" @click.stop="jumper(scope.row, '缺陷')">{{ scope.row.bugName }}</span>
         </template>
       </el-table-column>
-      <el-table-column v-if="title === '模块分布数据' || title === '缺陷统计数据' || title === '责任人分布数据' || title === '平均修复时长数据'" prop="devFixTime" label="缺陷修复时长" min-width="110" align="center">
+      <el-table-column v-if=" title === '缺陷24小时修复' || title === '缺陷修复时长' || title === '模块分布数据' || title === '缺陷统计数据' || title === '责任人分布数据' || title === '平均修复时长数据'" prop="devFixTime" label="缺陷修复时长" min-width="110" align="center">
         <template slot-scope="scope">
           {{ scope.row.devFixTime/(1000 * 3600) | numFilter }}
         </template>