qinzhipeng_v@didiglobal.com 4 年之前
父節點
當前提交
7efc535c38

+ 9 - 0
src/api/reportTemplate.js

@@ -354,3 +354,12 @@ export function reportdelivertestGetByTaskId(data) {
   })
 }
 
+// 获取全类型报告列表
+export function getReportList(data) {
+  return request({
+    url: Presentation + `/task/getReportList`,
+    method: 'post',
+    data
+  })
+}
+

+ 4 - 1
src/components/chart/normalEchart.vue

@@ -42,9 +42,12 @@ export default {
       const myChart = echarts.init(document.getElementById(this.chartId))
       myChart.setOption(this.option)
       myChart.off('click')// 在渲染点击事件之前先清除点击事件
-      myChart.on('click', params => {
+      myChart.on('click', params => { // 点击事件
         this.$emit('onClick', params)
       })
+      myChart.getZr().on('click', params => { // (统计页面)柱子外关闭抽屉
+        this.$emit('clone')
+      })
     }
   }
 }

+ 2 - 2
src/components/timeline/index.vue

@@ -69,12 +69,12 @@ export default {
 <style lang="scss" scoped>
 .qz-timeline-bgOne {
   min-width: max-content;
-  margin: 5px 30px 20px;
+  margin: 0 30px 18px;
   text-align: center;
 }
 .qz-timeline-bg {
   min-width: max-content;
-  margin: 20px 30px 40px;
+  margin: 29px 30px 30px;
   text-align: center;
 }
 .qz-timeline-layout {

+ 2 - 2
src/views/quality/components/distributionChart.vue

@@ -20,8 +20,8 @@
         </el-col>
       </el-row>
     </div>
-    <div class="chart-contain">
-      <normal-echart v-if="echartsOption" :chart-id="id" :option="echartsOption" @onClick="getCode" />
+    <div class="chart-contain" @click.stop>
+      <normal-echart v-if="echartsOption" :chart-id="id" :option="echartsOption" @onClick="getCode" @clone="$emit('clone')" />
     </div>
   </section>
 </template>

+ 87 - 42
src/views/quality/components/drawerAll.vue

@@ -2,7 +2,7 @@
   <el-drawer :title="Statistics.title" :visible.sync="drawer_" :direction="direction" :modal="false" :class="{'drawer-box': showClass}" size="100%" :before-close="handleClose">
     <div v-if="Statistics.title === '任务分布图数据'" class="qz-drawer-grade">按任务等级分布</div>
     <div>
-      <div class="qz-drawer-header">
+      <div v-if="Statistics.title !== '模块分布数据'" :class="[Statistics.towTimeLine ? 'qz-drawer-padding' : 'qz-drawer-padding-s', 'qz-drawer-header']">
         <div class="qz-drawer-scll">
           <timeline :data="list" :num="defaultKey" :bgmargin="bgMargin" @update="getvalue" />
         </div>
@@ -10,9 +10,19 @@
           <timeline :data="Statistics.towTimeLine" :num="defaultKey2" :bgmargin="bgMargin" @update="getvalueTow" />
         </div>
       </div>
-      <div v-if="Statistics.title === '需求分布图数据' || Statistics.title === '任务分布图数据'" class="qz-drawer-H">{{ status }}为{{ type }}的{{ Statistics.toType }}</div>
-      <div v-if="Statistics.title === '状态停留分布图数据'" class="qz-drawer-H">在{{ type }}状态停留时长为{{ typeTow }}的{{ Statistics.toType }}</div>
-      <qzTable :data="tableData" :title="Statistics.title" />
+      <div v-if="Statistics.title === '需求分布图数据' || Statistics.title === '任务分布图数据'" class="qz-drawer-H">
+        <span class="fontSize">{{ status }}</span>为<span class="fontSize">{{ type }}</span>的{{ Statistics.toType }}
+      </div>
+      <div v-if="Statistics.title === '状态停留分布图数据'" class="qz-drawer-H">
+        在<span class="fontSize">{{ type }}</span>状态停留时长为<span class="fontSize">{{ typeTow }}</span>的{{ Statistics.toType }}
+      </div>
+      <div v-if="Statistics.title === '模块分布数据'" class="qz-drawer-H" style="margin: 20px 30px 10px;">
+        模块<span class="fontSize">{{ Statistics.name }}</span>的缺陷
+      </div>
+      <div v-if="Statistics.title === `${Statistics.qz_holiday}的修复时长区间数据`" class="qz-drawer-H" style="margin: 20px 30px 10px;">
+        {{ Statistics.qz_holiday }}修复时间区间为<span class="fontSize">{{ type }}</span>的<span class="fontSize">{{ typeTow }}</span>级缺陷
+      </div>
+      <qzTable :data="tableData" :title="Statistics.title" :type="Statistics.toType" />
     </div>
     <el-pagination
       style="text-align: right; margin-right: 30px;"
@@ -30,13 +40,11 @@
 import { getRequirement } from '@/api/requirement.js'
 import { taskList } from '@/api/taskIndex'
 import { bugList } from '@/api/defectManage'
+import { getReportList } from '@/api/reportTemplate'
 import timeline from '@/components/timeline'
 import qzTable from './tables'
 export default {
-  components: {
-    timeline,
-    qzTable
-  },
+  components: { timeline, qzTable },
   props: {
     data: { type: Object, required: true },
     drawer: { type: Boolean, default: false },
@@ -59,6 +67,7 @@ export default {
       oneVal: '',
       currentPage: 1,
       total: 0,
+      reportData: {},
       paging: {
         curIndex: 1, // 分页
         pageSize: 10 // 分页
@@ -96,11 +105,11 @@ export default {
   },
   methods: {
     setDrawerDate() {
-      if (this.Statistics.title === '需求分布图数据' || this.Statistics.title === '任务分布图数据') {
+      if (this.Statistics.title === '需求分布图数据' || this.Statistics.title === '任务分布图数据' || 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 === '缺陷统计数据') {
+      } else if (this.Statistics.title === '缺陷统计数据' || this.Statistics.title === '去除节假日的修复时长数据') {
         const key = this.Statistics.xaxis.indexOf(this.Statistics.label)
         this.defaultKey = key === -1 ? 0 : key
         this.dataList = this.Statistics.idList
@@ -112,22 +121,31 @@ export default {
         this.defaultKey2 = Number(this.Statistics.seriesIndex)
         this.dataList = this.Statistics.statusList.yaxis[this.defaultKey2].idList[this.defaultKey]
         this.getTableData(this.dataList)
-      } else if (this.Statistics.title === '报告统计数据') { // 等接口
+      } else if (this.Statistics.title === '报告统计数据') {
+        const key = this.Statistics.xaxis.indexOf(this.Statistics.label)
+        this.defaultKey = key === -1 ? 0 : key
+        this.Statistics.label === '总数' ? this.getIdList({ deliverTestReportIdList: this.Statistics.subCountList[0].idList, dailyReportIdList: this.Statistics.subCountList[1].idList, releaseReportIdList: this.Statistics.subCountList[2].idList }) : ''
+        key === 1 ? this.getIdList({ deliverTestReportIdList: this.Statistics.subCountList[0].idList }) : '' // 提测
+        key === 2 ? this.getIdList({ dailyReportIdList: this.Statistics.subCountList[0].idList }) : '' // 日报
+        key === 3 ? this.getIdList({ releaseReportIdList: this.Statistics.subCountList[0].idList }) : '' // 准出
+      } else if (this.Statistics.title === '模块分布数据') {
+        this.getTableData(this.Statistics.newData.idList)
+      } else if (this.Statistics.title === `${this.Statistics.qz_holiday}的修复时长区间数据`) {
+        this.bgMargin = true
+        this.typeTow = this.Statistics.seriesName
         this.defaultKey = this.Statistics.dataIndex
-        this.dataList = this.Statistics.statusList.yaxis[this.defaultKey2].idList[this.defaultKey]
-        // this.getTableData(this.dataList)
+        this.defaultKey2 = Number(this.Statistics.seriesIndex)
+        this.dataList = this.Statistics.series[this.defaultKey2].idList[this.defaultKey]
+        this.getTableData(this.dataList)
       }
     },
-    handleClick(row) {
-      console.log(row)
-    },
-    getvalue(e) {
+    getvalue(e) { // 时间轴one
       this.oneVal = e
       this.type = e.name
       this.defaultKey = e.value
       this.getTimeLine()
     },
-    getvalueTow(e) {
+    getvalueTow(e) { // 时间轴tow
       this.towVal = e
       this.typeTow = e.name
       this.defaultKey2 = e.value
@@ -137,14 +155,22 @@ export default {
       this.dataList = []
       this.currentPage = 1
       this.paging = { curIndex: 1, pageSize: 10 }
-      if (this.Statistics.title === '需求分布图数据' || this.Statistics.title === '任务分布图数据') {
+      if (this.Statistics.title === '需求分布图数据' || this.Statistics.title === '任务分布图数据' || 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]
-      } else if (this.Statistics.title === '报告统计数据') { // 等接口
-        this.dataList = this.Statistics.statusList.yaxis[this.defaultKey2].idList[this.defaultKey]
+      } else if (this.Statistics.title === '报告统计数据') {
+        this.defaultKey === 0 ? this.getIdList({ deliverTestReportIdList: this.Statistics.subCountList[0].idList, dailyReportIdList: this.Statistics.subCountList[1].idList, releaseReportIdList: this.Statistics.subCountList[2].idList }) : ''
+        this.defaultKey === 1 ? this.getIdList({ deliverTestReportIdList: this.Statistics.subCountList[0].idList }) : '' // 提测
+        this.defaultKey === 2 ? this.getIdList({ dailyReportIdList: this.Statistics.subCountList[0].idList }) : '' // 日报
+        this.defaultKey === 3 ? this.getIdList({ releaseReportIdList: this.Statistics.subCountList[0].idList }) : '' // 准出
+        return
+      } else if (this.Statistics.title === '去除节假日的修复时长数据') {
+        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]
       }
       if (this.dataList[0]) { // 判断idList有没有数据
         this.getTableData(this.dataList)
@@ -153,41 +179,48 @@ export default {
         this.total = 0
       }
     },
-    async getTableData(taskIdList) {
+    async getTableData(taskIdList) { // 获取需求、任务、缺陷表格数据
       const data = { ids: taskIdList, ...this.paging }
-      if (this.Statistics.title === '需求分布图数据' || this.Statistics.title === '状态停留分布图数据') {
+      if (this.Statistics.title === '需求分布图数据' || this.Statistics.title === '状态停留分布图数据' && this.Statistics.toType === '需求') {
         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.title === '任务分布图数据') {
+      } else if (this.Statistics.title === '任务分布图数据' || this.Statistics.title === '状态停留分布图数据' && this.Statistics.toType === '任务') {
         const res = await taskList(data)
         if (res.code === 200) {
           this.tableData = res.data
           this.total = res.total
         }
-      } else if (this.Statistics.title === '缺陷统计数据') {
+      } else if (this.Statistics.title === '缺陷统计数据' || this.Statistics.title === '分布图数据' || this.Statistics.title === '去除节假日的修复时长数据' || this.Statistics.title === '模块分布数据' || this.Statistics.title === `${this.Statistics.qz_holiday}的修复时长区间数据`) {
         const res = await bugList(data)
         if (res.code === 200) {
           this.tableData = res.data
           this.total = res.total
         }
       }
-      // } else {
-      //   this.tableData = []
-      // }
+    },
+    async getIdList(value) {
+      console.log(value, '你经常看电视吧')
+      this.reportData = value
+      const data = { ...value, ...this.paging }
+      console.log(data, '你经cdslkcmd常看电视吧')
+      const res = await getReportList(data)
+      if (res.code === 200) {
+        this.tableData = res.data
+        this.total = res.total
+      }
     },
     handleSizeChange(val) {
       this.paging.pageSize = val
-      this.getTableData(this.dataList)
+      this.Statistics.title === '报告统计数据' ? this.getIdList(this.reportData) : this.getTableData(this.dataList)
     },
     handleCurrentChange(val) {
       this.paging.curIndex = val
-      this.getTableData(this.dataList)
+      this.Statistics.title === '报告统计数据' ? this.getIdList(this.reportData) : this.getTableData(this.dataList)
     },
-    handleClose(done) {
+    handleClose(done) { // 关闭
       this.$emit('clone')
     }
   }
@@ -197,31 +230,44 @@ export default {
 <style lang="scss" scoped>
 .qz-drawer-header {
   text-align: center;
-  background: rgb(252, 252, 252);
+  background: #F7F7F7;
   border-radius: 4px;
   min-height: 120px;
   margin: 20px 30px;
-  padding: 1px 0;
   overflow: hidden;
 }
+.qz-drawer-padding {
+  padding: 20px 0;
+}
+.qz-drawer-padding-s {
+  padding: 1px 0;
+}
 .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;
   margin: 0 30px;
-  color: #333333;
+  color: #444444;
 }
 .qz-drawer-grade {
-    position: absolute;
-    top: 28px;
-    left: 185px;
+  color: #444;
+  font-size: 14px;
+  position: absolute;
+  top: 28px;
+  left: 185px;
+}
+.fontSize {
+  color: #333333;
+  font-weight: 500;
 }
 >>> :focus{outline:0;}
-.integration-num {
-  margin: 5px 30px;
+>>>.el-table::before {
+    left: 0;
+    bottom: 0;
+    width: 100%;
+    height: 0px;
 }
 
 .div_priority {
@@ -251,7 +297,6 @@ export default {
     left: 50%;
     overflow: hidden;
     margin: 0;
-    // box-shadow: 0 2px 4px rgba(0, 0, 0, .12), 0 0 6px rgba(0, 0, 0, .04);
 }
 >>>.el-drawer__container {
     left: 0;

+ 2 - 2
src/views/quality/components/statusStayChart.vue

@@ -1,7 +1,7 @@
 <template>
   <section>
-    <div class="chart-contain">
-      <normal-echart v-if="echartsOption" :chart-id="id" :option="echartsOption" @onClick="getCode" />
+    <div class="chart-contain" @click.stop>
+      <normal-echart v-if="echartsOption" :chart-id="id" :option="echartsOption" @onClick="getCode" @clone="$emit('clone')" />
     </div>
   </section>
 </template>

+ 55 - 42
src/views/quality/components/tables/index.vue

@@ -1,89 +1,90 @@
 <template>
   <div style="margin: 0 30px;">
-    <el-table v-if="title === '需求分布图数据'" :data="data" style="width: 100%;" height="calc(100vh - 318px)" :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" align="center">
+    <el-table v-if="title === '状态停留分布图数据' || title === '需求分布图数据' || title === '任务分布图数据'" :data="data" style="width: 100%;" :height="title === '状态停留分布图数据' ? 'calc(100vh - 363px)': 'calc(100vh - 318px)'" :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]}">{{ 'P'+scope.row.priority }}</span>
         </template>
       </el-table-column>
-      <el-table-column label="需求名称" min-width="360" align="left" show-overflow-tooltip>
+      <el-table-column :label="`${type}名称`" min-width="360" align="left" show-overflow-tooltip>
         <template slot-scope="scope">
-          <div class="drawer-id">{{ scope.row.requirementDisplayId }}</div>
-          <div class="drawer-name" @click="jumper(scope.row, '需求')">{{ scope.row.name }}</div>
+          <div v-if="type === '需求'" class="drawer-id">{{ scope.row.requirementDisplayId }}</div>
+          <div v-if="type === '任务'" class="drawer-id">{{ scope.row.taskIdSting }}</div>
+          <div class="drawer-name" @click="jumper(scope.row, type)">{{ scope.row.name }}</div>
         </template>
       </el-table-column>
-      <el-table-column prop="typeName" label="需求类型" min-width="110" align="center" />
-      <el-table-column label="PM" min-width="100" show-overflow-tooltip align="center">
+      <el-table-column v-if="type === '需求'" prop="typeName" label="需求类型" min-width="110" align="center" />
+      <el-table-column v-if="type === '需求'" label="PM" min-width="100" show-overflow-tooltip align="center">
         <template v-if="scope.row.pmMemberInfoResponse" slot-scope="scope">
           <span>{{ scope.row.pmMemberInfoResponse.name }}</span>
         </template>
       </el-table-column>
-      <el-table-column label="状态" min-width="100" align="center">
-        <template slot-scope="scope">
-          {{ scope.row.statusName }}
-        </template>
-      </el-table-column>
+      <el-table-column v-if="type === '需求'" label="状态" prop="statusName" min-width="100" align="center" />
+      <el-table-column v-if="type === '任务'" label="状态" prop="statusString" min-width="100" align="center" />
     </el-table>
 
-    <el-table v-if="title === '缺陷统计数据'" :data="data" style="width: auto;" height="calc(100vh - 318px)" :header-cell-style="{ 'color':'rgba(74,74,74,1)','font-size':'14px','font-weight':'500' }" class="integration-num">
-      <el-table-column label="优先级" prop="priorityCode" min-width="100" align="center">
+    <el-table v-if="title === '去除节假日的修复时长区间数据' || title === '不去除节假日的修复时长区间数据'" :data="data" style="width: auto;" height="calc(100vh - 355px)" :header-cell-style="{ 'color':'rgba(74,74,74,1)','font-size':'14px','font-weight':'500' }">
+      <el-table-column label="优先级" prop="priorityCode" min-width="80" align="left">
         <template slot-scope="scope" style="text-align: center;">
           <span class="div_priority" :class="[{'priority_color': scope.row.priorityLevel === 'High'},{'priority_color1': scope.row.priorityLevel === 'Medium'},{'priority_color3': scope.row.priorityLevel === 'Low'}]">
             {{ scope.row.priorityLevel.substring(0, 1) }}
           </span>
         </template>
       </el-table-column>
-      <el-table-column prop="bugName" label="缺陷标题" min-width="360" align="left" show-overflow-tooltip>
+      <el-table-column prop="bugName" label="缺陷标题" min-width="200" align="left" show-overflow-tooltip>
         <template slot-scope="scope">
           <div class="drawer-id">{{ 'BUG-' + scope.row.id }}</div>
           <span class="drawer-name" @click.stop="jumper(scope.row, '缺陷')">{{ scope.row.bugName }}</span>
         </template>
       </el-table-column>
-      <el-table-column prop="fixTimePurgeNH" label="缺陷修复时长" min-width="110" align="center" />
-      <!-- <el-table-column prop="priorityName" label="缺陷等级" align="center" /> -->
-      <el-table-column prop="bugStatusName" label="状态" min-width="110" align="center">
+      <el-table-column prop="devFixTimePurgeNH" label="缺陷修复时长" min-width="110" align="center">
         <template slot-scope="scope">
-          <statusChange :status-code="Number(scope.row.status)" :bug-data="scope.row" :status-obj="statusObj" />
+          {{ scope.row.devFixTimePurgeNH/(1000 * 3600) | numFilter }}H
         </template>
       </el-table-column>
     </el-table>
 
-    <el-table v-if="title === '状态停留分布图数据'" :data="data" style="width: 100%;" height="calc(100vh - 318px)" :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" align="center">
+    <el-table v-if="title === '分布图数据' || title === '去除节假日的修复时长数据' || title === '模块分布数据' || title === '缺陷统计数据'" :data="data" style="width: auto;" :height="title === '模块分布数据' ? 'calc(100vh - 175px)': 'calc(100vh - 318px)'" :header-cell-style="{ 'color':'rgba(74,74,74,1)','font-size':'14px','font-weight':'500' }">
+      <el-table-column label="优先级" prop="priorityCode" 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]}">{{ 'P'+scope.row.priority }}</span>
+          <span class="div_priority" :class="[{'priority_color': scope.row.priorityLevel === 'High'},{'priority_color1': scope.row.priorityLevel === 'Medium'},{'priority_color3': scope.row.priorityLevel === 'Low'}]">
+            {{ scope.row.priorityLevelShortName }}
+          </span>
         </template>
       </el-table-column>
-      <el-table-column label="需求名称" min-width="360" align="left" show-overflow-tooltip>
+      <el-table-column prop="bugName" label="缺陷标题" min-width="200" align="left" show-overflow-tooltip>
         <template slot-scope="scope">
-          <div class="drawer-id">{{ scope.row.requirementDisplayId }}</div>
-          <div class="drawer-name" @click="jumper(scope.row, '需求')">{{ scope.row.name }}</div>
+          <div class="drawer-id">{{ 'BUG-' + scope.row.id }}</div>
+          <span class="drawer-name" @click.stop="jumper(scope.row, '缺陷')">{{ scope.row.bugName }}</span>
         </template>
       </el-table-column>
-      <el-table-column label="状态" min-width="100" align="center">
+      <el-table-column prop="fixTimePurgeNH" label="缺陷修复时长" min-width="110" align="center">
         <template slot-scope="scope">
-          {{ scope.row.statusName }}
+          {{ scope.row.devFixTimePurgeNH/(1000 * 3600) | numFilter }}H
         </template>
       </el-table-column>
-    </el-table>
-
-    <el-table v-if="title === '任务分布图数据'" :data="data" style="width: 100%;" height="calc(100vh - 318px)" :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" align="center">
-        <template slot-scope="scope" style="text-align: center;">
-          <span class="div_priority" :style="{background: priorityColors[scope.row.priority % priorityColors.length]}">{{ 'P'+scope.row.priority }}</span>
+      <!-- <el-table-column prop="priorityName" label="缺陷等级" align="center" /> -->
+      <el-table-column prop="bugStatusName" label="状态" min-width="100" align="center">
+        <template slot-scope="scope">
+          <statusChange :status-code="Number(scope.row.status)" :bug-data="scope.row" :status-obj="statusObj" />
         </template>
       </el-table-column>
-      <el-table-column label="任务名称" min-width="360" align="left" show-overflow-tooltip>
+    </el-table>
+
+    <el-table v-if="title === '报告统计数据'" :data="data" style="width: auto;" height="calc(100vh - 318px)" :header-cell-style="{ 'color':'rgba(74,74,74,1)','font-size':'14px','font-weight':'500' }">
+      <el-table-column label="报告名称" min-width="200" show-overflow-tooltip>
         <template slot-scope="scope">
-          <div class="drawer-id">{{ scope.row.taskIdSting }}</div>
-          <div class="drawer-name" @click="jumper(scope.row, '任务')">{{ scope.row.name }}</div>
+          <div class="drawer-id">{{ scope.row.id }}</div>
+          <span class="drawer-name" @click.stop="jumper(scope.row, '报告')">{{ scope.row.reportName || '' }}</span>
         </template>
       </el-table-column>
-      <el-table-column label="状态" min-width="100" align="center">
+      <el-table-column prop="statusString" label="状态" min-width="110" />
+      <el-table-column label="报告人" min-width="110">
         <template slot-scope="scope">
-          {{ scope.row.statusString }}
+          {{ scope.row.creatorObject.name || '' }}
         </template>
       </el-table-column>
+      <el-table-column prop="typeString" label="类型" min-width="110" />
     </el-table>
   </div>
 </template>
@@ -97,9 +98,21 @@ export default {
   components: {
     statusChange
   },
+  filters: {
+    numFilter(value) {
+      let realVal = ''
+      if (!isNaN(value) && value !== '') {
+        realVal = parseFloat(value).toFixed(1) // 截取当前数据到小数点后两位
+      } else {
+        realVal = '--'
+      }
+      return realVal
+    }
+  },
   props: {
     data: { type: Array, default: null },
-    title: { type: String, required: true }
+    title: { type: String, required: true },
+    type: { type: String, default: null }
   },
   data() {
     return {
@@ -111,7 +124,7 @@ export default {
     this.bugGetEnum()
   },
   methods: {
-    async bugGetEnum() {
+    async bugGetEnum() { // 缺陷修改状态
       const res = await bugGetEnum()
       if (res.code === 200) {
         this.statusObj = {
@@ -136,9 +149,9 @@ export default {
       bfs(arr)
       return arr
     },
-    jumper(val, name) {
+    jumper(val, name) { // 需求、任务、缺陷跳转
       const bizId_id = EncryptId(`${val.bizId}_${val.id}`)
-      const newTab = this.$router.resolve({ name: this.Statistics.typeStr + '详情', query: { bizId_id: bizId_id }})
+      const newTab = this.$router.resolve({ name: name + '详情', query: { bizId_id: bizId_id }})
       window.open(newTab.href, '_blank')
     }
   }

+ 43 - 10
src/views/quality/defectStatistics.vue

@@ -1,5 +1,5 @@
 <template>
-  <div @click="drawer = false">
+  <div @click="openDrawer = false, drawer = false">
     <el-container class="defect-container">
       <el-header class="defect-main" style="height: auto;">
         <el-form :model="defectForm" class="demo-form-inline" :inline="true">
@@ -133,7 +133,7 @@
           </el-row>
           <el-row type="flex" align="middle">
             <el-col :span="24">
-              <div class="chart-contain">
+              <div class="chart-contain" @click.stop>
                 <child-chart :show.sync="showChild" :chart-type="barOrPie" :params="childParams" />
                 <normal-echart v-if="echartsOption1" :chart-id="'chartFirst'" :option="echartsOption1" @onClick="echartClick" />
               </div>
@@ -160,7 +160,9 @@
               <div v-for="(item, index) in repairTimeListNoHoliday" :key="'time'+index" class="repair-item" :class="[Number(item.relativeRatio)<0?'repair-slow':'repair-rise']">
                 <div class="repair-item-point" :class="['point'+index]" />
                 <span>{{ item.label }}</span>
-                <div class="repair-time">{{ item.total }}</div>
+                <div @click.stop>
+                  <div class="repair-time chart-cur" @click="cilckRepairTimeListNoHoliday(item, repairTimeListNoHoliday)">{{ item.total }}</div>
+                </div>
                 <div v-show="Number(item.relativeRatio)>=0" class="repair-up">环比:<i class="el-icon-caret-top" /><span>{{ item.relativeRatio }}%</span></div>
                 <div v-show="Number(item.relativeRatio)<0" class="repair-down">环比:<i class="el-icon-caret-bottom" /><span>{{ item.relativeRatio.substring(1,item.relativeRatio.length) }}%</span></div>
                 <div v-show="item.relativeRatio === '--'" class="repair-up">环比:<span>{{ item.relativeRatio }}%</span></div>
@@ -169,8 +171,8 @@
           </el-row>
           <el-row type="flex" align="middle">
             <el-col :span="4" class="col-flex-start">
-              <div class="off-holiday" :class="[offOnholiday==='off'?'selected':'']" @click="changeHoliday('off')">去除节假日</div>
-              <div class="on-holiday" :class="[offOnholiday==='on'?'selected':'']" @click="changeHoliday('on')">不去除节假日</div>
+              <div class="off-holiday" :class="[offOnholiday==='off'?'selected':'']" @click="changeHoliday('off'), holiday = '去除节假日'">去除节假日</div>
+              <div class="on-holiday" :class="[offOnholiday==='on'?'selected':'']" @click="changeHoliday('on'), holiday = '不去除节假日'">不去除节假日</div>
             </el-col>
             <el-col :span="4" :offset="16" class="col-flex-end">
               <div class="bar-line" :class="[barOrLine==='line'?'active':'']" @click="changeBarOrLine('line')">折线图</div>
@@ -179,8 +181,8 @@
           </el-row>
           <el-row type="flex" align="middle">
             <el-col :span="24">
-              <div class="chart-contain">
-                <normal-echart v-if="echartsOption2" :chart-id="'chartSecond'" :option="echartsOption2" />
+              <div class="chart-contain" @click.stop>
+                <normal-echart v-if="echartsOption2" :chart-id="'chartSecond'" :option="echartsOption2" @onClick="getHoliday" @clone="clone" />
               </div>
             </el-col>
           </el-row>
@@ -201,7 +203,7 @@
             <el-table-column prop="name" label="模块" />
             <el-table-column v-if="activeTab=== 1" prop="newData" label="新增" sortable="custom" show-overflow-tooltip>
               <template slot-scope="scope">
-                <span class="table-repair-item1 repair-span">{{ scope.row.newData.total }}</span>
+                <span @click.stop><span class="table-repair-item1 repair-span" style="cursor: pointer;" @click="getModuleData(scope.row)">{{ scope.row.newData.total }}</span></span>
                 <span class="repair-span">{{ scope.row.newData.detail[0].label }}:{{ scope.row.newData.detail[0].total }}</span>
                 <span class="repair-span">{{ scope.row.newData.detail[1].label }}:{{ scope.row.newData.detail[1].total }}</span>
               </template>
@@ -336,6 +338,8 @@ export default {
     return {
       drawer: false,
       requireList: {},
+      reqStatus: '',
+      openDrawer: false,
       echartsOption1: null,
       echartsOption2: null,
       echartsOption3: null, // 趋势图
@@ -346,6 +350,7 @@ export default {
       dateType: 'week', // 时间选择类型
       moduleList: [], // 模块列表
       activeName: 'first',
+      holiday: '去除节假日',
       activeTab: 1,
       defectStatus: 1, // 缺陷状态
       barOrPie: 'bar', // 柱状图or饼图
@@ -509,6 +514,7 @@ export default {
       }
     },
     async defectStatusChange() { // 分布图状态变动
+      this.openDrawer = false
       const moduleIds = this.defectForm.moduleIds
       const params = {
         startTime: this.stratAndEnd[0] || null,
@@ -594,10 +600,32 @@ export default {
       }
     },
     clickCodeData(value) {
+      console.log(value, this.chart1Data, '点击的柱子')
       value.title = '分布图数据'
-      this.requireList = { ...value, ...this.distributeData }
+      this.requireList = { ...value, ...this.chart1Data }
+      this.openDrawer = true
+    },
+    cilckRepairTimeListNoHoliday(value, data) {
+      value.title = '去除节假日的修复时长数据'
+      value.xaxis = ['全部', 'P0', 'P1', 'P2', 'P3']
+      this.requireList = { ...value, ...data }
+      this.openDrawer = true
+    },
+    getModuleData(value) {
+      console.log(value, ' 那就肯定是')
+      value.title = '模块分布数据'
+      value.xaxis = ['全部', 'P0', 'P1', 'P2', 'P3']
+      this.requireList = { ...value }
+      this.openDrawer = true
+    },
+    getHoliday(value) {
+      console.log(value, this.echartsOption2, ' 那就肯定是')
+      value.title = `${this.holiday}的修复时长区间数据`
+      value.qz_holiday = this.holiday
+      value.xaxis = this.echartsOption2.xAxis.data
+      value.towTimeLine = this.echartsOption2.legend.data
+      this.requireList = { ...value, ...this.echartsOption2 }
       this.openDrawer = true
-      console.log(this.requireList, 'cdscdmckcdscsldmcl')
     },
     async getSumData() { // 头部数据
       const moduleIds = this.defectForm.moduleIds
@@ -763,6 +791,7 @@ export default {
     },
     clone(v) {
       this.drawer = v
+      this.openDrawer = false
     }
   }
 }
@@ -1030,6 +1059,10 @@ export default {
     }
   }
 }
+.chart-cur:hover {
+  color: #4089FF;
+  cursor: pointer;
+}
 .tab-item {
   padding: 0 20px;
 }

+ 4 - 3
src/views/quality/requireStatistics.vue

@@ -155,7 +155,7 @@
             @change="getDevelopeopleData()"
           />
         </div>
-        <div class="chart-item" @click.stop>
+        <div class="chart-item">
           <h3>需求分布图</h3>
           <distribution-chart
             :chart-data="distributeData"
@@ -165,11 +165,12 @@
             @change="getDistributeData()"
             @code="clickCodeData"
             @state="getStatusType"
+            @clone="openDrawer = false"
           />
         </div>
-        <div class="chart-item" @click.stop>
+        <div class="chart-item">
           <h3>状态停留分布图</h3>
-          <status-stay-chart :chart-data="statusStayData" @code="statusStayChart" />
+          <status-stay-chart :chart-data="statusStayData" @code="statusStayChart" @clone="openDrawer = false" />
         </div>
         <div class="chart-item">
           <h3>需求方向分布图</h3>

+ 7 - 12
src/views/quality/taskStatistics.vue

@@ -153,7 +153,7 @@
             @change="getManpowerDistributedData()"
           />
         </div>
-        <div class="chart-item" @click.stop>
+        <div class="chart-item">
           <h3>任务分布图</h3>
           <distribution-chart
             :chart-data="distributeData"
@@ -163,11 +163,12 @@
             @change="getDistributeData()"
             @code="getTaskDat"
             @state="getStatusType"
+            @clone="openDrawer = false"
           />
         </div>
-        <div class="chart-item" @click.stop>
+        <div class="chart-item">
           <h3>状态停留分布图</h3>
-          <status-stay-chart :chart-data="statusStayData" @code="statusStayChart" />
+          <status-stay-chart :chart-data="statusStayData" @code="statusStayChart" @clone="openDrawer = false" />
         </div>
         <div class="chart-item">
           <h3>模块分布图</h3>
@@ -551,18 +552,12 @@ export default {
       }
     },
     async getReportSummary() { // 报告统计
-      const params = {
-        ...this.globalParams,
-        type: Number(this.activeTab)
-      }
+      const params = { ...this.globalParams, type: Number(this.activeTab) }
       const res = await getReportSummary(params)
       if (res.code === 200) this.reportSummaryData = res.data
     },
     async getBugStatisticData() { // 缺陷统计
-      const params = {
-        ...this.globalParams,
-        type: Number(this.activeTab)
-      }
+      const params = { ...this.globalParams, type: Number(this.activeTab) }
       const res = await getBugStatisticData(params)
       if (res.code === 200) this.bugListData = res.data
     },
@@ -584,7 +579,7 @@ export default {
     clickCount(value, data) {
       console.log(value, data, 'cdscsdcds')
       value.title = '报告统计数据'
-      value.xaxis = ['全部', '测报告', '测试日报', '准出报告']
+      value.xaxis = ['全部', '测报告', '测试日报', '准出报告']
       this.requireList = { ...value, reportData: data }
       this.openDrawer = true
     },