Explorar o código

质量流程&研发效率数据汇总饼图

洪海涛 %!s(int64=4) %!d(string=hai) anos
pai
achega
fea396dc7f

+ 9 - 0
src/api/qualityMonthlyReport/edit.js

@@ -161,3 +161,12 @@ export function getOnlineProblemPieChart(reportId) {
   })
 }
 
+// 获取线上问题饼图数据
+export function getQualityProcessAndRdEfficiencyPieData(reportId) {
+  return request({
+    url: projectManagementUrl + '/monthlyReport/getQualityProcessAndRdEfficiencyPieData?reportId=' + reportId,
+    timeout: '100000',
+    method: 'get'
+  })
+}
+

+ 10 - 5
src/views/monthlyReport/childrenPage/editReport/components/OverallOverviewOfTheClient/box.vue

@@ -5,12 +5,12 @@
       <span class="report-title-text">{{ title }}</span>
     </div>
     <div>
-      <el-tabs :value="tabsActive" @tab-click="tabClick">
+      <el-tabs :value="tabsActive" @tab-click="tabClick" v-if="pageData">
         <el-tab-pane
-          v-for="item in tabsList"
-          :key="item"
-          :label="item"
-          :name="item"
+          v-for="item in pageData"
+          :key="item.clientType"
+          :label="item.clientType"
+          :name="item.clientType"
         />
       </el-tabs>
       <slot />
@@ -24,6 +24,11 @@ export default {
       type: String,
       required: false,
       default: '线上问题'
+    },
+    pageData: {
+      type: Array,
+      required: false,
+      default: null
     }
   },
   data() {

+ 1 - 1
src/views/monthlyReport/childrenPage/editReport/components/OverallOverviewOfTheClient/index.vue

@@ -3,7 +3,7 @@
     <headTitle style="margin-top: 40px; margin-bottom: 10px" :title="title" />
     <div class="OverallOverviewOfTheClient">
       <onlineQuestion />
-      <!-- <qualityProcess /> -->
+      <qualityProcess />
     </div>
   </div>
 </template>

+ 9 - 14
src/views/monthlyReport/childrenPage/editReport/components/OverallOverviewOfTheClient/onlineQuestion.vue

@@ -1,11 +1,11 @@
 <template>
   <div>
-    <boxCom v-if="pageData" title="线上问题" page-data @change="tabChange">
+    <boxCom v-if="pageData" title="线上问题" :page-data="pageData" @change="tabChange">
       <!-- <div>线上问题:{{ active }}</div> -->
       <div class="echarts-wrapper">
         <div class="pie-wrapper">
           <div class="total-wrapper">
-            总数:<span class="total" @click.stop="reportBizName = ''">8</span>
+            总数:<span class="total" @click.stop="reportBizName = ''">{{tabData.total}}</span>
           </div>
           <div
             id="a_tylo_oo_2ppmn_ayghs"
@@ -14,7 +14,7 @@
           />
         </div>
         <div v-if="tabData" class="detail-wrapper">
-          <div>{{ tabData.priorityStr }}</div>
+          <div class="fontWeight" style="margin-bottom: 10px">{{ tabData.title }}</div>
           <div
             v-for="item in tabData.onlineProblemCopywriters.filter((elm) =>
               reportBizName ? elm.reportBizName === reportBizName : true
@@ -65,9 +65,6 @@ export default {
   methods: {
     async init() {
       const res = await getOnlineProblemPieChart(this.$route.query.reportId)
-
-      console.log(res)
-
       this.pageData = res.data.map((elm) => {
         return {
           ...elm,
@@ -80,10 +77,8 @@ export default {
           })
         }
       })
-
-      this.tabData = this.pageData.filter(
-        (elm) => elm.clientType === this.active
-      )[0]
+      this.active = this.pageData[0].clientType
+      this.tabData = this.pageData[0]
       this.$nextTick(() => {
         this.echartsInit()
       })
@@ -106,9 +101,9 @@ export default {
         },
         series: [
           {
-            name: '访问来源',
+            // name: '访问来源',
             type: 'pie',
-            radius: '50%',
+            radius: '80%',
             data: this.tabData.onlineProblemCopywriters,
             emphasis: {
               itemStyle: {
@@ -120,7 +115,7 @@ export default {
           }
         ]
       }
-      console.log(this.tabData)
+      // console.log(this.tabData)
       // 基于准备好的dom,初始化echarts实例
       this.myChart = echarts.init(
         document.getElementById('a_tylo_oo_2ppmn_ayghs')
@@ -137,7 +132,6 @@ export default {
       this.tabData = this.pageData.filter(
         (elm) => elm.clientType === this.active
       )[0]
-      console.log(this.tabData)
     }
   }
 }
@@ -145,6 +139,7 @@ export default {
 
 <style scoped lang="less">
 .echarts-wrapper {
+  margin-top: -10px;
   .fontWeight {
     font-weight: 500;
   }

+ 214 - 3
src/views/monthlyReport/childrenPage/editReport/components/OverallOverviewOfTheClient/qualityProcess.vue

@@ -1,12 +1,48 @@
 <template>
   <div>
-    <boxCom title="质量流程&研发效率" @change="tabChange">
-      <div>质量流程&研发效率:{{ active }}</div>
+    <boxCom title="质量流程&研发效率" @change="tabChange" :page-data="pageData">
+      <!-- <div>质量流程&研发效率:{{ active }}</div> -->
+      <div class="echarts-wrapper" v-if="tabData">
+        <div class="pie-wrapper">
+          <div class="total-wrapper">
+            总数:<span class="total" @click.stop="reportBizName = ''">{{tabData.total}}</span>
+          </div>
+          <div
+            id="a_oiew_mkds_ppmn_aygs"
+            class="pir"
+            style="width: 100%; height: 130px"
+          />
+          <div v-if="tabData">本月&nbsp;&nbsp;{{active}}&nbsp;&nbsp;类:<span v-for="(item, index) in tabData.qualityProcessAndRdEfficiencyCopywriters" :key="index">
+            <span>{{item.type}}</span><span :class="{'fontWeight': true,'red': item.total > 0}">{{item.total}}次</span><span>{{index < tabData.qualityProcessAndRdEfficiencyCopywriters.length - 1 ? ',' : '。'}}</span>
+          </span> </div>
+        </div>
+        <div class="detail-wrapper">
+          <div v-for="item in tabData.qualityProcessAndRdEfficiencyCopywriters.filter((elm) =>
+              reportBizName ? elm.name === reportBizName : true
+            )" style="margin-bottom: 20px">
+            <div class="fontWeight" style="margin-bottom: 10px">{{item.type}}数据</div>
+            <div>本月{{item.type}}{{item.total}}次</div>
+            <div v-for="elm in item.subClientDetails" style="margin-bottom: 10px">
+              <div class="fontWeight">
+                {{elm.subClientType}}{{item.type}}{{elm.total}}次
+              </div>
+              <div v-for="(subItem, subIndex) in elm.details" style="margin-bottom: 5px">
+                <div v-if="subItem.name">
+                  <span class="fontWeight">{{subIndex + 1}}、</span>{{subItem.name}}<span v-if="subItem.description">({{subItem.description}})</span>
+                </div>
+              </div>
+            </div>
+          </div>
+        </div>
+      </div>
     </boxCom>
   </div>
 </template>
 <script type="text/javascript">
 import boxCom from './box'
+import echarts from 'echarts'
+import {getQualityProcessAndRdEfficiencyPieData} from '@/api/qualityMonthlyReport/edit'
+
 export default {
   name: 'OnlineQuestion',
   components: {
@@ -14,13 +50,188 @@ export default {
   },
   data() {
     return {
-      active: 'APP'
+      active: 'APP',
+      myChart: null,
+      pageData: null,
+      tabData: null,
+      reportBizName: null,
+      subIndex: -1,
+      option: null,
+      subReportDetails: null,
+      pieData: []
     }
   },
+  mounted(){
+    this.init();
+  },
   methods: {
+   async init(){
+      const res = await getQualityProcessAndRdEfficiencyPieData(this.$route.query.reportId)
+      this.pageData = res.data.map((elm) => {
+        return {
+          ...elm,
+          qualityProcessAndRdEfficiencyCopywriters: elm.qualityProcessAndRdEfficiencyCopywriters.map((item) => {
+            return {
+              ...item,
+              subReportDetails: item.subReportDetails.map(subItem => {
+                return {
+                  ...subItem,
+                  value: subItem.total,
+                  name: subItem.subReportName
+                }
+              }),
+              value: item.total,
+              name: item.type
+            }
+          })
+        }
+      })
+      this.active = this.pageData[0].clientType
+      this.tabData = this.pageData[0]
+      console.log(this.tabData);
+      // this.subIndex = 0
+      this.$nextTick(() => {
+        this.echartsInit()
+      })
+    },
+    echartsInit() {
+      this.option = {
+        color: [
+          '#5470c6',
+          '#91cc75',
+          '#fac858',
+          '#ee6666',
+          '#73c0de',
+          '#3ba272',
+          '#fc8452',
+          '#9a60b4',
+          '#ea7ccc'
+        ],
+        // legend: {
+        //     type: 'scroll',
+        //     orient: 'vertical',
+        //     left: 0,
+        //     top: 20,
+        //     bottom: 20,
+        //     width: 30,
+        //     data: this.tabData.qualityProcessAndRdEfficiencyCopywriters.map(elm => elm.name)
+        // },
+        tooltip: {
+          trigger: 'item'
+        },
+        series: [
+          {
+            // name: '访问来源',
+            type: 'pie',
+            radius: [0, '60%'],
+            data: this.tabData.qualityProcessAndRdEfficiencyCopywriters,
+            labelLine: {
+                show: false
+            },
+            label: {
+                position: 'inner',
+                fontSize: 10,
+                show: false
+            },
+            emphasis: {
+              itemStyle: {
+                shadowBlur: 0,
+                shadowOffsetX: 0,
+                shadowColor: 'rgba(0, 0, 0, 0.5)'
+              }
+            }
+          },
+          {
+            // name: '访问来源',
+            type: 'pie',
+            radius: ['61%', '80%'],
+            // data: this.subIndex > -1 && this.tabData.qualityProcessAndRdEfficiencyCopywriters[this.subIndex].subReportDetails,
+            data: this.subReportDetails,
+            emphasis: {
+              itemStyle: {
+                shadowBlur: 0,
+                shadowOffsetX: 0,
+                shadowColor: 'rgba(0, 0, 0, 0.5)'
+              }
+            }
+          }
+        ]
+      }
+      // console.log(this.tabData)
+      // 基于准备好的dom,初始化echarts实例
+      this.myChart = echarts.init(
+        document.getElementById('a_oiew_mkds_ppmn_aygs')
+      )
+
+      // 绘制图表
+      this.myChart.setOption(this.option)
+      this.myChart.on('click', (params) => {
+        // console.log(params.data);
+        // console.log();
+        const list = this.tabData.qualityProcessAndRdEfficiencyCopywriters
+        console.log(list);
+        for (var i = list.length - 1; i >= 0; i--) {
+          if(list[i].name === params.data.name){
+            this.reportBizName = params.data.name
+            console.log(params.data.name);
+            this.subIndex = i
+            this.subReportDetails = list[i].subReportDetails
+//             this.myChart.setOption({...option,
+//               series:[
+// option.series
+//               ]})
+            this.option.series[1].data = this.subReportDetails
+            this.myChart.setOption(this.option)
+            this.$forceUpdate()
+          }
+        }
+
+      })
+    },
     tabChange(value) {
       this.active = value
+      this.reportBizName = ''
+      console.log(this.myChart);
+
+      this.tabData = this.pageData.filter(
+        (elm) => elm.clientType === this.active
+      )[0]
+      this.option.series[1].data = null
+      this.myChart.setOption(this.option)
     }
   }
 }
 </script>
+
+<style scoped lang="less">
+.echarts-wrapper {
+  margin-top: -10px;
+  .fontWeight {
+    font-weight: 500;
+  }
+  .red {
+    color: red
+  }
+  display: flex;
+  color: #333;
+  font-size: 14px;
+  .pie-wrapper {
+    width: 50%;
+    .total-wrapper {
+      color: #666;
+
+      .total {
+        color: #409eff;
+        font-size: 18px;
+        cursor: pointer;
+      }
+    }
+  }
+  .detail-wrapper {
+    width: 50%;
+    padding: 10px;
+    height: 200px;
+    overflow-y: scroll;
+  }
+}
+</style>

+ 3 - 1
src/views/monthlyReport/childrenPage/editReport/components/OverallOverviewOfTheServer.vue

@@ -30,6 +30,8 @@
         <td class="col color_3_sub">P1问题</td>
         <td class="col color_3_sub">P0&P1平均修复时长</td>
         <td class="col color_3_sub">Reopen次数</td>
+        <td class="col color_3_sub">提测打回</td>
+        <td class="col color_3_sub">准出不通过</td>
         <td class="col color_3_sub">提测延期</td>
         <td class="col color_3_sub">发布延期</td>
       </tr>
@@ -83,7 +85,7 @@ export default {
       ctx.stroke()
     },
     isShowColor(index, value) {
-      if (index === 0 || index === 3 || index === 8 || index === 11 || index === 12 || index === 13) {
+      if (index === 0 || index === 3 || index === 8 || index === 11 || index === 12 || index === 13 || index === 14 || index === 15) {
         return value > 0
       }
       return false

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

@@ -6,7 +6,7 @@
         <span v-if="index === 1">其中P0 bug数<span :class="[item.label !== '0' ? 'query-colors' : '' ]">{{ item.label }}</span>个,</span>
         <span v-if="index === 2">P1 bug数{{ item.label }}个;</span>
         <span v-if="index === 3">P0&P1平均修复时长{{ item.label }}H;</span>
-        <span v-if="index === 4">P0&P1 24小时修复率{{ item.label }}%;</span>
+        <span v-if="index === 4">过夜率{{ item.label }}%;</span>
         <span v-if="index === 5">Reopen {{ item.label }}次。</span>
       </span>
       <!-- 新增bug 78个,其中P0 bug数XX(标红)个,P1 bug数XX个;P0&P1平均修复时长 23.8H;P0&P1 24小时修复率70.0%;reopen XX次。 -->