Explorar el Código

Merge branch 'http_test' of git.xiaojukeji.com:pu_qa_tool/thoth-frontend into http_test

qinzhipeng_v@didiglobal.com hace 4 años
padre
commit
f2b44075e6

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

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

+ 2 - 2
src/views/monthlyReport/childrenPage/editReport/components/MrTable/index.vue

@@ -75,8 +75,8 @@
                       </el-dropdown-menu>
                     </el-dropdown>
                   </span>
-    <!--链接-->
-        <span v-else-if="btnItem.value === '链接' && isShowButton(scope.row, item)" @click.stop>
+                  <!--链接-->
+                  <span v-else-if="btnItem.value === '链接' && isShowButton(scope.row, item)" @click.stop>
                     <el-popover
                       v-if="scope.row.operationTarget"
                       placement="bottom-start"

+ 11 - 6
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 v-if="pageData" :value="tabsActive" @tab-click="tabClick">
         <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() {
@@ -75,7 +80,7 @@ export default {
 /deep/ .el-tabs__nav-wrap::after {
   display: none;
 }
-/deep/.el-tabs__item{
+/deep/.el-tabs__item {
   padding: 0 5px;
 }
 </style>

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

@@ -1,9 +1,6 @@
 <template>
   <div>
-    <headTitle
-      style="margin-top: 40px; margin-bottom: 10px;"
-      :title="title"
-    />
+    <headTitle style="margin-top: 40px; margin-bottom: 10px" :title="title" />
     <div class="OverallOverviewOfTheClient">
       <onlineQuestion />
       <qualityProcess />
@@ -13,13 +10,13 @@
 <script>
 import headTitle from '@/components/headTitle'
 import onlineQuestion from './onlineQuestion'
-import qualityProcess from './qualityProcess'
+// import qualityProcess from './qualityProcess'
 
 export default {
   components: {
     headTitle,
-    onlineQuestion,
-    qualityProcess
+    onlineQuestion
+    // qualityProcess
   },
   props: {
     title: {
@@ -77,10 +74,10 @@ export default {
     }
   }
 }
-/deep/.el-tabs__active-bar{
+/deep/.el-tabs__active-bar {
   display: none;
 }
-/deep/.el-tabs__nav-wrap::after{
+/deep/.el-tabs__nav-wrap::after {
   display: none;
 }
 </style>

+ 148 - 6
src/views/monthlyReport/childrenPage/editReport/components/OverallOverviewOfTheClient/onlineQuestion.vue

@@ -1,11 +1,47 @@
 <template>
-	<div>
-		<boxCom title="线上问题" @change="tabChange">
-			<div>线上问题:{{ active }}</div>
-		</boxCom>
-	</div>
+  <div>
+    <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 = ''">{{ tabData.total }}</span>
+          </div>
+          <div
+            id="a_tylo_oo_2ppmn_ayghs"
+            class="pir"
+            style="width: 100%; height: 160px"
+          />
+        </div>
+        <div v-if="tabData" class="detail-wrapper">
+          <div class="fontWeight" style="margin-bottom: 10px">{{ tabData.title }}</div>
+          <div
+            v-for="item in tabData.onlineProblemCopywriters.filter((elm) =>
+              reportBizName ? elm.reportBizName === reportBizName : true
+            )"
+            :key="item.reportBizName"
+          >
+            <div>{{ item.reportBizName }}:{{ item.priorityStr }}</div>
+            <div v-for="(pitem, pIndex) in item.problemDetails" :key="pIndex">
+              <div class="fontWeight">{{ pitem.subClientType }}</div>
+              <div v-for="(dItem, dIndex) in pitem.details" :key="dIndex">
+                <div>
+                  <span class="fontWeight">{{ dIndex + 1 }}、</span
+                  ><span class="fontWeight">{{ dItem.priority }}问题:</span
+                  >{{ dItem.problem }}
+                </div>
+                <div v-html="dItem.reason" />
+              </div>
+            </div>
+          </div>
+        </div>
+      </div>
+    </boxCom>
+  </div>
 </template>
 <script type="text/javascript">
+import { getOnlineProblemPieChart } from '@/api/qualityMonthlyReport/edit'
+import echarts from 'echarts'
 import boxCom from './box'
 export default {
   name: 'OnlineQuestion',
@@ -14,13 +50,119 @@ export default {
   },
   data() {
     return {
-      active: 'APP'
+      active: 'APP',
+      myChart: null,
+      pageData: null,
+      tabData: null,
+      reportBizName: null,
+      pieData: []
     }
   },
+  mounted() {
+    this.init()
+    // this.echartsInit()
+  },
   methods: {
+    async init() {
+      const res = await getOnlineProblemPieChart(this.$route.query.reportId)
+      this.pageData = res.data.map((elm) => {
+        return {
+          ...elm,
+          onlineProblemCopywriters: elm.onlineProblemCopywriters.map((item) => {
+            return {
+              ...item,
+              value: item.total,
+              name: item.reportBizName
+            }
+          })
+        }
+      })
+      this.active = this.pageData[0].clientType
+      this.tabData = this.pageData[0]
+      this.$nextTick(() => {
+        this.echartsInit()
+      })
+    },
+    echartsInit() {
+      const option = {
+        color: [
+          '#5470c6',
+          '#91cc75',
+          '#fac858',
+          '#ee6666',
+          '#73c0de',
+          '#3ba272',
+          '#fc8452',
+          '#9a60b4',
+          '#ea7ccc'
+        ],
+        tooltip: {
+          trigger: 'item'
+        },
+        series: [
+          {
+            // name: '访问来源',
+            type: 'pie',
+            radius: '80%',
+            data: this.tabData.onlineProblemCopywriters,
+            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_tylo_oo_2ppmn_ayghs')
+      )
+      // 绘制图表
+      this.myChart.setOption(option)
+      this.myChart.on('click', (params) => {
+        this.reportBizName = params.data.name
+      })
+    },
     tabChange(value) {
       this.active = value
+      this.reportBizName = ''
+      this.tabData = this.pageData.filter(
+        (elm) => elm.clientType === this.active
+      )[0]
     }
   }
 }
 </script>
+
+<style scoped lang="less">
+.echarts-wrapper {
+  margin-top: -10px;
+  .fontWeight {
+    font-weight: 500;
+  }
+  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>

+ 248 - 6
src/views/monthlyReport/childrenPage/editReport/components/OverallOverviewOfTheClient/qualityProcess.vue

@@ -1,12 +1,76 @@
 <template>
-	<div>
-		<boxCom title="质量流程&研发效率" @change="tabChange">
-			<div>质量流程&研发效率:{{ active }}</div>
-		</boxCom>
-	</div>
+  <div>
+    <boxCom title="质量流程&研发效率" :page-data="pageData" @change="tabChange">
+      <!-- <div>质量流程&研发效率:{{ active }}</div> -->
+      <div v-if="tabData" class="echarts-wrapper">
+        <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, itemIndex ) in tabData.qualityProcessAndRdEfficiencyCopywriters" :key="itemIndex">
+              <span>{{ item.type }}</span>
+              <span :class="{ fontWeight: true, red: item.total > 0 }">{{ item.total }}次</span>
+              <span>{{ tabData.qualityProcessAndRdEfficiencyCopywriters.length - 1 > itemIndex ? ',': '。' }}</span>
+            </span>
+          </div>
+        </div>
+        <div class="detail-wrapper">
+          <div
+            v-for="(
+              item, itemIndex
+            ) in tabData.qualityProcessAndRdEfficiencyCopywriters.filter(
+              (elm) => (reportBizName ? elm.name === reportBizName : true)
+            )"
+            :key="itemIndex"
+            style="margin-bottom: 20px"
+          >
+            <div class="fontWeight" style="margin-bottom: 10px">
+              {{ item.type }}数据
+            </div>
+            <div>本月{{ item.type }}{{ item.total }}次</div>
+            <div
+              v-for="(elm, elmIndex) in item.subClientDetails"
+              :key="elmIndex"
+              style="margin-bottom: 10px"
+            >
+              <div class="fontWeight">
+                {{ elm.subClientType }}{{ item.type }}{{ elm.total }}次
+              </div>
+              <div
+                v-for="(subItem, subindex) in elm.details"
+                :key="'sub_' + subindex"
+                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 +78,191 @@ 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

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

@@ -6,8 +6,8 @@
         <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&P124小时修复率{{ item.label }}%;</span>
-        <span v-if="index === 5">reopen {{ 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次。 -->
     </span>
@@ -70,7 +70,7 @@ export default {
         this.requireList = { toType: '缺陷', xaxis: this.bugPriority, title: '新增缺陷', yaxis: yaxis, dataIndex: index }
       } else if (index === 3) {
         const yaxis = this.setList(data, index)
-        this.requireList = { toType: '缺陷', xaxis: this.bugPrioritys, title: '缺陷修复时长', yaxis: yaxis, dataIndex: 1 }
+        this.requireList = { toType: '缺陷', xaxis: this.bugPrioritys, title: '缺陷修复时长', yaxis: yaxis, dataIndex: 0 }
       } else if (index === 5) {
         const yaxis = data.reportBugs.map(item => { return item.id })
         this.requireList = { toType: '缺陷', title: '累计reopen', yaxis: yaxis, idList: yaxis }
@@ -79,7 +79,7 @@ export default {
         const [a, s, d, f, g, h, j, k, l] = [[], [], [], [], [], [], [], [], []]
         if (data.reportBugs[0]) {
           data.reportBugs.map(item => {
-            if (item.isRepaired && Number(item.repairTime) < 24) { // 24小时内修复
+            if (item.isRepaired && item.repairTime < 24) { // 24小时内修复
               f.push(item.id) // 全部
               if (item.priority < 2) { g.push(item.id) } // P0&P1
               if (item.priority > 1) { h.push(item.id) } // P1以上

+ 2 - 2
src/views/monthlyReport/childrenPage/editReport/index.vue

@@ -59,7 +59,7 @@
       <div class="body-wrapper">
         <div class="left-wrapper">
           <OverallOverviewOfTheServer v-if="pageType.search(/readAll/) > -1 && tabsActive.search(/服务端/) > -1" />
-          <OverallOverviewOfTheClient v-if="pageType === 'hhhhh' && pageType.search(/readAll/) > -1 && tabsActive.search(/客户端/) > -1" />
+          <OverallOverviewOfTheClient v-if="pageType.search(/readAll/) > -1 && tabsActive.search(/客户端/) > -1" />
           <div v-if="tabPageShow">
             <Core v-for="(item, index) in tabPageData.children" :key="item.domKey" :dom-index="index" :base-data="item" />
           </div>
@@ -417,7 +417,7 @@ export default {
             this.$store.commit('monthlyReportEdit/SET_LOADING', false)
             // this.$store.commit('monthlyReportEdit/SET_LOADING', false)
             this.$router.push({ path: '/monthlyReport/index' })
-          }, 500)
+          }, 2000)
         }
       })
       // this.$store.commit('monthlyReportEdit/SET_LOADING', true)