Explorar o código

添加分布图

qinzhipeng_v@didiglobal.com %!s(int64=4) %!d(string=hai) anos
pai
achega
8a5c6e0ec9

+ 6 - 2
src/views/quality/components/cycleStatistic.vue

@@ -42,8 +42,8 @@
             </template>
           </span>
           <div v-if="item.countStr" class="repair-time">{{ item.countStr }}<span> 天</span></div>
-          <div v-if="item.total || item.total === 0" class="repair-time">
-            {{ item.total }}<span class="unit"> 个</span>
+          <div v-if="item.total || item.total === 0" class="repair-time" @click.stop>
+            <span class="repaircur" style="    color: #303133; font-size: 18px; margin: 25px 0;" @click="$emit('clickCount', item, chartData)">{{ item.total }}</span><span class="unit"> 个</span>
             <span v-if="item.count > 0">
               /<span class="reject">打回{{ item.count }}个</span>
             </span>
@@ -182,6 +182,10 @@ export default {
     color:#9FFF39
   }
 }
+.repaircur {
+  cursor: pointer;
+  color: #1890FF;
+}
 </style>
 <style>
 .cycleStatistic-tips {

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

@@ -86,7 +86,7 @@ export default {
   },
   mounted() {
     this.changeBarOrPie(this.barOrPie)
-    this.getLabel('需求状态')
+    this.getLabel(this.statusList[0].label)
   },
   methods: {
     statusChange(e) {

+ 24 - 13
src/views/quality/components/drawerAll.vue

@@ -1,5 +1,6 @@
 <template>
   <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 class="qz-drawer-scll">
@@ -9,12 +10,12 @@
           <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>
+      <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>
     <el-pagination
-      style="text-align: center;"
+      style="text-align: right; margin-right: 30px;"
       :current-page.sync="currentPage"
       :page-size="10"
       layout="total, prev, pager, next, jumper"
@@ -27,7 +28,7 @@
 
 <script>
 import { getRequirement } from '@/api/requirement.js'
-// import { taskList } from '@/api/taskIndex'
+import { taskList } from '@/api/taskIndex'
 import { bugList } from '@/api/defectManage'
 import timeline from '@/components/timeline'
 import qzTable from './tables'
@@ -95,7 +96,7 @@ export default {
   },
   methods: {
     setDrawerDate() {
-      if (this.Statistics.title === '需求分布图数据') {
+      if (this.Statistics.title === '需求分布图数据' || this.Statistics.title === '任务分布图数据') {
         this.defaultKey = this.Statistics.dataIndex
         this.dataList = this.Statistics.yaxis[0].idList[this.defaultKey]
         this.getTableData(this.dataList)
@@ -111,6 +112,10 @@ 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 === '报告统计数据') { // 等接口
+        this.defaultKey = this.Statistics.dataIndex
+        this.dataList = this.Statistics.statusList.yaxis[this.defaultKey2].idList[this.defaultKey]
+        // this.getTableData(this.dataList)
       }
     },
     handleClick(row) {
@@ -132,12 +137,14 @@ export default {
       this.dataList = []
       this.currentPage = 1
       this.paging = { curIndex: 1, pageSize: 10 }
-      if (this.Statistics.title === '需求分布图数据') {
+      if (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]
       }
       if (this.dataList[0]) { // 判断idList有没有数据
         this.getTableData(this.dataList)
@@ -155,13 +162,12 @@ export default {
           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.title === '任务分布图数据') {
+        const res = await taskList(data)
+        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) {
@@ -208,6 +214,11 @@ export default {
   margin: 0 30px;
   color: #333333;
 }
+.qz-drawer-grade {
+    position: absolute;
+    top: 28px;
+    left: 185px;
+}
 >>> :focus{outline:0;}
 .integration-num {
   margin: 5px 30px;

+ 27 - 1
src/views/quality/components/tables/index.vue

@@ -12,6 +12,12 @@
           <div class="drawer-name" @click="jumper(scope.row, '需求')">{{ 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">
+        <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 }}
@@ -33,7 +39,8 @@
           <span class="drawer-name" @click.stop="jumper(scope.row, '缺陷')">{{ scope.row.bugName }}</span>
         </template>
       </el-table-column>
-      <el-table-column prop="priorityName" label="缺陷等级" align="center" />
+      <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">
         <template slot-scope="scope">
           <statusChange :status-code="Number(scope.row.status)" :bug-data="scope.row" :status-obj="statusObj" />
@@ -59,6 +66,25 @@
         </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>
+        </template>
+      </el-table-column>
+      <el-table-column label="任务名称" min-width="360" align="left" 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>
+        </template>
+      </el-table-column>
+      <el-table-column label="状态" min-width="100" align="center">
+        <template slot-scope="scope">
+          {{ scope.row.statusString }}
+        </template>
+      </el-table-column>
+    </el-table>
   </div>
 </template>
 

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

@@ -304,6 +304,7 @@
       </el-main>
       <div @click.stop>
         <require-drawer v-if="drawer" :drawer="drawer" :data="requireList" @clone="clone" />
+        <drawer-all v-if="openDrawer" :drawer="openDrawer" :data="requireList" :status="reqStatus" @clone="clone" />
       </div>
     </el-container>
   </div>
@@ -328,8 +329,9 @@ import {
 } from '@/api/defectStatistics'
 import normalEchart from '@/components/chart/normalEchart'
 import childChart from './components/childCharts'
+import drawerAll from './components/drawerAll'
 export default {
-  components: { normalEchart, childChart, requireDrawer },
+  components: { normalEchart, childChart, requireDrawer, drawerAll },
   data() {
     return {
       drawer: false,
@@ -576,6 +578,7 @@ export default {
       }
     },
     echartClick(params) { // 图表1点击事件
+      this.clickCodeData(params)
       if (this.defectStatus !== 7 || this.barOrPie === 'pie') return // 只有状态是缺陷类型的时候才显示二级
       this.showChild = true
       const moduleIds = this.defectForm.moduleIds
@@ -590,6 +593,12 @@ export default {
         bugTypeName: params.name
       }
     },
+    clickCodeData(value) {
+      value.title = '分布图数据'
+      this.requireList = { ...value, ...this.distributeData }
+      this.openDrawer = true
+      console.log(this.requireList, 'cdscdmckcdscsldmcl')
+    },
     async getSumData() { // 头部数据
       const moduleIds = this.defectForm.moduleIds
       const params = {

+ 2 - 0
src/views/quality/requireStatistics.vue

@@ -565,12 +565,14 @@ export default {
     },
     clickCodeData(value) {
       value.title = '需求分布图数据'
+      value.toType = '需求'
       this.requireList = { ...value, ...this.distributeData }
       this.openDrawer = true
       console.log(this.requireList, 'cdscdmckcdscsldmcl')
     },
     statusStayChart(value, list, data) {
       value.title = '状态停留分布图数据'
+      value.toType = '需求'
       value.towTimeLine = list
       value.statusList = data
       this.requireList = { ...value, xaxis: data.xaxis }

+ 49 - 7
src/views/quality/taskStatistics.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="chartForm" class="demo-form-inline" :inline="true">
@@ -153,7 +153,7 @@
             @change="getManpowerDistributedData()"
           />
         </div>
-        <div class="chart-item">
+        <div class="chart-item" @click.stop>
           <h3>任务分布图</h3>
           <distribution-chart
             :chart-data="distributeData"
@@ -161,11 +161,13 @@
             :status.sync="distributeStatus"
             :active-tab="activeTab"
             @change="getDistributeData()"
+            @code="getTaskDat"
+            @state="getStatusType"
           />
         </div>
-        <div class="chart-item">
+        <div class="chart-item" @click.stop>
           <h3>状态停留分布图</h3>
-          <status-stay-chart :chart-data="statusStayData" />
+          <status-stay-chart :chart-data="statusStayData" @code="statusStayChart" />
         </div>
         <div class="chart-item">
           <h3>模块分布图</h3>
@@ -177,15 +179,16 @@
         </div>
         <div class="chart-item">
           <h3>报告统计</h3>
-          <cycle-statistic :chart-data="reportSummaryData" child-data="relativeRatio" :show-tips="false" />
+          <cycle-statistic :chart-data="reportSummaryData" child-data="relativeRatio" :show-tips="false" @clickCount="clickCount" />
         </div>
         <div class="chart-item">
           <h3>缺陷统计</h3>
-          <bug-list :chart-data="bugListData" />
+          <bug-list :chart-data="bugListData" @requireBug="clickCountStr" />
         </div>
       </el-main>
       <div @click.stop>
         <require-drawer v-if="drawer" :drawer="drawer" :data="requireList" @clone="clone" />
+        <drawer-all v-if="openDrawer" :drawer="openDrawer" :data="requireList" :status="reqStatus" @clone="clone" />
       </div>
     </el-container>
   </div>
@@ -223,6 +226,7 @@ import statusStayChart from './components/statusStayChart'
 import belongChart from './components/belongChart'
 import changeRequireChart from './components/changeRequireChart'
 import bugList from './components/bugList'
+import drawerAll from './components/drawerAll'
 export default {
   components: {
     statusChart,
@@ -235,18 +239,21 @@ export default {
     belongChart,
     changeRequireChart,
     bugList,
-    requireDrawer
+    requireDrawer,
+    drawerAll
   },
   data() {
     return {
       drawer: false,
       requireList: {},
+      reqStatus: '',
       bugCountTimeType: 1, // 获取趋缺陷势图数据接口入参:1本周 2本月 3本年
       timeTypeList: [ // 日期选择
         { code: 1, label: '周' },
         { code: 2, label: '月' },
         { code: 3, label: '年' }
       ],
+      openDrawer: false,
       teamOptions: [], // 团队列表
       chartForm: {}, // 筛选表单
       stratAndEnd: [], // 开始结束日期
@@ -492,6 +499,7 @@ export default {
       }
     },
     async getDistributeData() { // 获取任务分布图
+      this.openDrawer = false
       const params = {
         ...this.globalParams,
         type: Number(this.activeTab),
@@ -558,13 +566,47 @@ export default {
       const res = await getBugStatisticData(params)
       if (res.code === 200) this.bugListData = res.data
     },
+    getStatusType(e) {
+      this.reqStatus = e
+    },
     getRequiredNum(value) {
       this.drawer = true
       value.typeStr = '任务'
       this.requireList = value
     },
+    clickCountStr(value) { // 需求bug 浮层数据
+      console.log(value)
+      value.title = '缺陷统计数据'
+      value.xaxis = ['全部', 'P0', 'P1', 'P2', 'P3']
+      this.requireList = value
+      this.openDrawer = true
+    },
+    clickCount(value, data) {
+      console.log(value, data, 'cdscsdcds')
+      value.title = '报告统计数据'
+      value.xaxis = ['全部', '测试报告', '测试日报', '准出报告']
+      this.requireList = { ...value, reportData: data }
+      this.openDrawer = true
+    },
+    getTaskDat(value) {
+      value.title = '任务分布图数据'
+      value.toType = '任务'
+      this.requireList = { ...value, ...this.distributeData }
+      this.openDrawer = true
+      console.log(this.requireList, 'cdscdmckcdscsldmcl')
+    },
+    statusStayChart(value, list, data) {
+      value.title = '状态停留分布图数据'
+      value.toType = '任务'
+      value.towTimeLine = list
+      value.statusList = data
+      this.requireList = { ...value, xaxis: data.xaxis }
+      this.openDrawer = true
+      console.log(this.requireList, 'cdscdmckcdscsldmc2')
+    },
     clone(v) {
       this.drawer = v
+      this.openDrawer = false
     }
   }
 }