Bladeren bron

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

qinzhipeng_v@didiglobal.com 4 jaren geleden
bovenliggende
commit
4f54b2807f

+ 11 - 1
src/api/qualityMonthlyReport/edit.js

@@ -1,6 +1,6 @@
 // 质量月报
 import request from '@/utils/request'
-import { projectManagementUrl } from '@/apiConfig/api'
+import { projectManagementUrl, ldapServer } from '@/apiConfig/api'
 
 // 获取月报
 export function getMonthlyReport(reportId) {
@@ -80,6 +80,16 @@ export function getReportDependence(params) {
   })
 }
 
+// 获取部门数据 v2
+// /api/department/getDeptArch
+export function getDeptArch() {
+  return request({
+    url: ldapServer + '/api/department/getDeptArch?deptId=100001',
+    method: 'get',
+    timeout: '100000'
+  })
+}
+
 // 月报发送确认
 export function sendConfirm(data) {
   return request({

+ 23 - 10
src/store/modules/monthlyReport/edit/index.js

@@ -5,7 +5,8 @@ import {
   delMonthlyReport,
   getAllSubReportCatalog,
   getSubReport,
-  getReportDependence,
+  // getReportDependence,
+  getDeptArch,
   sendConfirm,
   returnReport,
   sendSubConfirm,
@@ -93,8 +94,8 @@ export default {
       // state.subTitle = state.pageDate.reportName
       const subReports = [...params.subReports]
       // 设置部门数据
-      state.selectEnum = [...params.dependence.deptArch.children]
-      setDeptArch(state.selectEnum)
+      // state.selectEnum = [...params.dependence.deptArch.children]
+      // setDeptArch(state.selectEnum)
       // 设置端数据
       if (params.dependence.clientType) {
         state.clientTypeList = [...params.dependence.clientType]
@@ -404,8 +405,10 @@ export default {
     },
     // 获取部门数据
     SET_SELECT_ENUM(state, params) {
+      console.log(params)
       state.selectEnum = params
-      setDeptArch(state.selectEnum)
+      console.log(state.selectEnum)
+      // setDeptArch(state.selectEnum)
     },
     // 标记为本月重点问题
     MARK_ISSUES(state, { cascaderValue, normalAreaName, multiplePeople }) {
@@ -649,9 +652,14 @@ export default {
         // 单个月报与完整月报数据梳理
         if (pageType === 'read' || pageType === 'edit') {
           commit('SET_CLIENT_TYPE_LIST', res.data.dependence.clientType)
-          commit('SET_SELECT_ENUM', res.data.dependence.deptArch.children)
+          // commit('SET_SELECT_ENUM', res.data.dependence.deptArch.children)
           commit('SET_PAGE_DATA', res.data)
         }
+        console.log(res)
+        if (pageType === 'readAll' && params.catalogTitle.search(/服务端详情|客户端详情/) > -1) {
+          res.data.splice(0, 0, { depth: 1, fromUser: false, hiddenAncestor: null, isVisible: true, subTitles: null, title: '整体概览', type: 'Head1', content: [{ type: 'overallOverviewo' }] })
+          console.log(params)
+        }
         commit('SET_TAB_PAGE_DATA', {
           data:
             pageType === 'readAll' ? res.data : res.data.reportCatalog.children,
@@ -715,11 +723,16 @@ export default {
     },
     // 获取部门数据
     async setSelectEnum({ commit }, reportId) {
-      const res = await getReportDependence({
-        reportId
-      })
-      if (res.code === 200) {
-        commit('SET_SELECT_ENUM', res.data.deptArch.children)
+      const depth = JSON.parse(window.localStorage.getItem('depth'))
+      console.log(depth)
+      if (!depth) {
+        const res = await getDeptArch({ reportId })
+        if (res.code === 200) {
+          window.localStorage.setItem('depth', JSON.stringify(res.data.children))
+          commit('SET_SELECT_ENUM', res.data.children)
+        }
+      } else {
+        commit('SET_SELECT_ENUM', depth)
       }
     },
     // 删除月报

+ 12 - 2
src/views/monthlyReport/childrenPage/editReport/components/CascaderInfo.vue

@@ -54,14 +54,24 @@ export default {
   },
   methods: {
     init() {
-      if (this.teamData && this.teamData.length) {
+      // console.log(this.selectEnum);
+      // console.log(this.teamData);
+      if (this.teamData && this.teamData.length && this.selectEnum) {
         const itemName = []
         const onlyId = []
         this.teamData.forEach((elm) => {
           if (onlyId.indexOf(elm) < 0) {
             const item = this.find(elm)
+            // console.log(item);
+            // console.log({
+            //   label: item.label,
+            //   deptPath: item.deptPath
+            // })
             onlyId.push(elm)
-            itemName.push(item)
+            itemName.push({
+              label: item.label,
+              deptPath: item.deptPath
+            })
           }
         })
         // 数组去重

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

@@ -159,7 +159,7 @@
           {{ scope.row[item.headerKey] }}
         </div>
       </div>
-      <div v-else-if="item.displayType === 'Texterea'" :style="{cursor: item.name === '问题' && scope.row.operationTarget ? 'pointer' : 'auto'}" @click.stop="item.name === '问题' && goto(scope.row.operationTarget)">
+      <div v-else-if="item.displayType === 'Texterea'" :style="{cursor: item.name === '问题' && scope.row.operationTarget ? 'pointer' : 'auto'}" @click.stop="item.name === '问题' && pageType.search(/edit/) < 0 && goto(scope.row.operationTarget) || editLine(scope.row, index)">
         <TextInfo :text="scope.row[item.headerKey]" />
       </div>
       <div v-else>

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

@@ -1,6 +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 />
@@ -8,15 +8,15 @@
   </div>
 </template>
 <script>
-import headTitle from '@/components/headTitle'
+// import headTitle from '@/components/headTitle'
 import onlineQuestion from './onlineQuestion'
-// import qualityProcess from './qualityProcess'
+import qualityProcess from './qualityProcess'
 
 export default {
   components: {
-    headTitle,
-    onlineQuestion
-    // qualityProcess
+    // headTitle,
+    onlineQuestion,
+    qualityProcess
   },
   props: {
     title: {

+ 19 - 11
src/views/monthlyReport/childrenPage/editReport/components/OverallOverviewOfTheClient/onlineQuestion.vue

@@ -14,7 +14,7 @@
           />
         </div>
         <div v-if="tabData" class="detail-wrapper">
-          <div class="fontWeight" style="margin-bottom: 10px">{{ tabData.title }}</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
@@ -23,9 +23,9 @@
           >
             <div>{{ item.reportBizName }}:{{ item.priorityStr }}</div>
             <div v-for="(pitem, pIndex) in item.problemDetails" :key="pIndex">
-              <div class="fontWeight">{{ pitem.subClientType }}</div>
+              <div class="fontWeight" style="color: #ED8F41;margin-top: 10px;">{{ pitem.subClientType }}</div>
               <div v-for="(dItem, dIndex) in pitem.details" :key="dIndex">
-                <div>
+                <div style="margin-top: 5px;">
                   <span class="fontWeight">{{ dIndex + 1 }}、</span
                   ><span class="fontWeight">{{ dItem.priority }}问题:</span
                   >{{ dItem.problem }}
@@ -55,6 +55,7 @@ export default {
       pageData: null,
       tabData: null,
       reportBizName: null,
+      option: null,
       pieData: []
     }
   },
@@ -84,7 +85,7 @@ export default {
       })
     },
     echartsInit() {
-      const option = {
+      this.option = {
         color: [
           '#5470c6',
           '#91cc75',
@@ -104,7 +105,7 @@ export default {
             // name: '访问来源',
             type: 'pie',
             radius: '80%',
-            data: this.tabData.onlineProblemCopywriters,
+            data: this.tabData.onlineProblemCopywriters.filter(elm => elm.total),
             emphasis: {
               itemStyle: {
                 shadowBlur: 0,
@@ -121,7 +122,7 @@ export default {
         document.getElementById('a_tylo_oo_2ppmn_ayghs')
       )
       // 绘制图表
-      this.myChart.setOption(option)
+      this.myChart.setOption(this.option)
       this.myChart.on('click', (params) => {
         this.reportBizName = params.data.name
       })
@@ -132,6 +133,10 @@ export default {
       this.tabData = this.pageData.filter(
         (elm) => elm.clientType === this.active
       )[0]
+      console.log(this.tabData);
+      console.log(this.tabData.onlineProblemCopywriters);
+      this.option.series[0].data = this.tabData.onlineProblemCopywriters.filter(elm => elm.total)
+      this.myChart.setOption(this.option)
     }
   }
 }
@@ -140,9 +145,7 @@ export default {
 <style scoped lang="less">
 .echarts-wrapper {
   margin-top: -10px;
-  .fontWeight {
-    font-weight: 500;
-  }
+
   display: flex;
   color: #333;
   font-size: 14px;
@@ -150,7 +153,7 @@ export default {
     width: 50%;
     .total-wrapper {
       color: #666;
-
+      margin-top: 10px;
       .total {
         color: #409eff;
         font-size: 18px;
@@ -161,8 +164,13 @@ export default {
   .detail-wrapper {
     width: 50%;
     padding: 10px;
-    height: 200px;
+    height: 270px;
+    margin-bottom: 10px;
     overflow-y: scroll;
   }
+  .fontWeight {
+    color: #333;
+    font-weight: 500;
+  }
 }
 </style>

+ 39 - 32
src/views/monthlyReport/childrenPage/editReport/components/OverallOverviewOfTheClient/qualityProcess.vue

@@ -5,17 +5,17 @@
       <div v-if="tabData" class="echarts-wrapper">
         <div class="pie-wrapper">
           <div class="total-wrapper">
-            总数:<span class="total" @click.stop="reportBizName = ''">{{
+<!--             总数:<span class="total" @click.stop="reportBizName = ''">{{
               tabData.total
-            }}</span>
+            }}</span> -->
           </div>
           <div
             id="a_oiew_mkds_ppmn_aygs"
             class="pir"
-            style="width: 100%; height: 130px"
+            style="width: 100%; height: 170px"
           />
-          <div v-if="tabData">
-            本月&nbsp;&nbsp;{{ active }}&nbsp;&nbsp;类:
+          <div v-if="tabData" style="width: 205px">
+            本月{{ active }}类:
             <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>
@@ -31,18 +31,18 @@
               (elm) => (reportBizName ? elm.name === reportBizName : true)
             )"
             :key="itemIndex"
-            style="margin-bottom: 20px"
+            style="margin-bottom: 10px"
           >
-            <div class="fontWeight" style="margin-bottom: 10px">
+            <div class="fontWeight" style="margin-bottom: 0px">
               {{ item.type }}数据
             </div>
-            <div>本月{{ item.type }}{{ item.total }}次</div>
+            <div style="margin-top: 5px;">本月{{ item.type }}{{ item.total }}次</div>
             <div
               v-for="(elm, elmIndex) in item.subClientDetails"
               :key="elmIndex"
               style="margin-bottom: 10px"
             >
-              <div class="fontWeight">
+              <div class="fontWeight" style="margin-top: 10px">
                 {{ elm.subClientType }}{{ item.type }}{{ elm.total }}次
               </div>
               <div
@@ -50,7 +50,7 @@
                 :key="'sub_' + subindex"
                 style="margin-bottom: 5px"
               >
-                <div v-if="subItem.name">
+                <div v-if="subItem.name" style="margin-top: 5px">
                   <span class="fontWeight">{{ subindex + 1 }}、</span
                   >{{ subItem.name
                   }}<span
@@ -120,7 +120,6 @@ export default {
       })
       this.active = this.pageData[0].clientType
       this.tabData = this.pageData[0]
-      console.log(this.tabData)
       // this.subIndex = 0
       this.$nextTick(() => {
         this.echartsInit()
@@ -176,9 +175,11 @@ export default {
           {
             // name: '访问来源',
             type: 'pie',
-            radius: ['61%', '80%'],
+            radius: ['61%', '75%'],
             // data: this.subIndex > -1 && this.tabData.qualityProcessAndRdEfficiencyCopywriters[this.subIndex].subReportDetails,
-            data: this.subReportDetails,
+            data: this.tabData.qualityProcessAndRdEfficiencyCopywriters.map(elm => {
+              return elm.subReportDetails
+            }).reduce((a, b) => a.concat(b)).filter(elm=>elm.total),
             emphasis: {
               itemStyle: {
                 shadowBlur: 0,
@@ -198,22 +199,20 @@ export default {
       // 绘制图表
       this.myChart.setOption(this.option)
       this.myChart.on('click', (params) => {
-        // console.log(params.data);
-        // console.log();
         const list = this.tabData.qualityProcessAndRdEfficiencyCopywriters
-        console.log(list)
+        // 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)
+            // console.log(params.data.name)
             this.subIndex = i
-            this.subReportDetails = list[i].subReportDetails
+            // 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.option.series[1].data = this.subReportDetails
+            // this.myChart.setOption(this.option)
             this.$forceUpdate()
           }
         }
@@ -222,12 +221,13 @@ export default {
     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.option.series[0].data = this.tabData.qualityProcessAndRdEfficiencyCopywriters
+      this.option.series[1].data = this.tabData.qualityProcessAndRdEfficiencyCopywriters.map(elm => {
+        return elm.subReportDetails
+      }).reduce((a, b) => a.concat(b)).filter(elm=>elm.total)
       this.myChart.setOption(this.option)
     }
   }
@@ -236,20 +236,16 @@ export default {
 
 <style scoped lang="less">
 .echarts-wrapper {
-  margin-top: -10px;
-  .fontWeight {
-    font-weight: 500;
-  }
-  .red {
-    color: red;
-  }
+  margin-top: 0px;
+
   display: flex;
-  color: #333;
+  color: #666;
   font-size: 14px;
   .pie-wrapper {
     width: 50%;
     .total-wrapper {
       color: #666;
+      margin-top: 10px;
 
       .total {
         color: #409eff;
@@ -261,8 +257,19 @@ export default {
   .detail-wrapper {
     width: 50%;
     padding: 10px;
-    height: 200px;
+    height: 270px;
     overflow-y: scroll;
   }
+    .fontWeight {
+    font-weight: 500;
+    color: #333;
+  }
+  .red {
+    color: red;
+  }
+  .p10{
+    display: inline-block;
+    padding-left: 10px;
+  }
 }
 </style>

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

@@ -1,8 +1,8 @@
 <template>
   <div class="OverallOverviewOfTheServer">
-    <div>
+<!--     <div>
       <headTitle style="margin-top: 40px; margin-bottom: 10px;" title="整体概览" />
-    </div>
+    </div> -->
     <table>
       <tr>
         <td class="first" colspan="1" rowspan="2">
@@ -15,7 +15,7 @@
         </td>
         <td colspan="3" class="color_1">线上质量</td>
         <td colspan="5" class="color_2">发布</td>
-        <td colspan="6" class="color_3">线下质量及研究效率</td>
+        <td colspan="8" class="color_3">线下质量及研究效率</td>
       </tr>
       <tr>
         <td class="col color_1_sub">P5+</td>
@@ -50,13 +50,13 @@
 </template>
 <script>
 import { getOverallOverview } from '@/api/qualityMonthlyReport/edit'
-import headTitle from '@/components/headTitle'
+// import headTitle from '@/components/headTitle'
 
 export default {
   name: 'OverallOverviewOfTheServer',
-  components: {
-    headTitle
-  },
+  // components: {
+  //   headTitle
+  // },
   data() {
     return {
       tableList: null

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

@@ -60,7 +60,7 @@ export default {
     return {
       animateClass: '',
       dialogTitle: '重新拉取数据',
-      pullDataAgainTitle: ['上月问题跟进', '线上问题', '线下缺陷', '发布&回滚']
+      pullDataAgainTitle: ['上月', '线上问题', '线下缺陷', '发布&回滚']
     }
   },
   computed: {

+ 9 - 0
src/views/monthlyReport/childrenPage/editReport/components/content.vue

@@ -21,6 +21,11 @@
         <div v-else-if="title.search(/重点问题/) > -1" style="margin-top: 10px;color: #666">本月无重点问题!</div>
         <div v-else-if="title.search(/两轮车|代驾|货运|硬件|中台/) > -1" style="margin-top: 10px;color: #666">{{ setNoDataTitle(title) }}</div>
       </div>
+      <div v-else-if="item.type === 'overallOverviewo'">
+         <OverallOverviewOfTheServer v-if="pageType.search(/readAll/) > -1 && tabsActive.search(/服务端/) > -1" />
+        <OverallOverviewOfTheClient v-if="pageType.search(/readAll/) > -1 && tabsActive.search(/客户端/) > -1" />
+    <!-- <markingIssues ref="markingIssues" /> -->
+      </div>
       <!--   表格和富文本:TableAndRichText   -->
       <div v-else-if="item.type === 'TableAndRichText'">
         <mrTable
@@ -88,12 +93,16 @@
 import mrTable from './MrTable/index'
 import RichText from './RichText'
 import VarText from './VarText'
+import OverallOverviewOfTheServer from './OverallOverviewOfTheServer'
+import OverallOverviewOfTheClient from './OverallOverviewOfTheClient/index'
 
 export default {
   name: 'Content',
   components: {
     mrTable,
     RichText,
+    OverallOverviewOfTheServer,
+    OverallOverviewOfTheClient,
     VarText
   },
   props: {

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

@@ -8,7 +8,6 @@
       >
       <Refresh v-if="pageDate && pageDate.status < 20" slot="refresh" :title="baseData.title" :tab-key="tabKey" :active-name="activeName" :dom-key="baseData.domKey" />
       </headTitle>
-
     </div>
     <div
       v-if="baseData.type.search(/Head2|Head3/) > -1"

+ 12 - 16
src/views/monthlyReport/childrenPage/editReport/index.vue

@@ -58,8 +58,6 @@
       </el-tabs>
       <div class="body-wrapper">
         <div class="left-wrapper">
-          <OverallOverviewOfTheServer v-if="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>
@@ -114,8 +112,6 @@ import Affix from '@/components/affix/affix'
 import Anchor from './components/anchor'
 import Menu from './components/menu'
 import Core from './components/core'
-import OverallOverviewOfTheServer from './components/OverallOverviewOfTheServer'
-import OverallOverviewOfTheClient from './components/OverallOverviewOfTheClient/index'
 import Clickoutside from 'element-ui/src/utils/clickoutside'
 import normalDialog from '@/components/dialog/normalDialog'
 
@@ -127,8 +123,6 @@ export default {
     Anchor,
     Menu,
     Core,
-    OverallOverviewOfTheServer,
-    OverallOverviewOfTheClient,
     normalDialog
   },
   directives: { Clickoutside },
@@ -201,12 +195,14 @@ export default {
     }
   },
   created() {
+    this.$store.commit('monthlyReportEdit/INIT_STATE_DATA')
     this.indexShow = true
     // 默认获取用户权限
     this.$store.dispatch('monthlyReportEdit/getUserPermission')
+    // 获取部门数据
+    this.$store.dispatch('monthlyReportEdit/setSelectEnum')
   },
   mounted() {
-    this.$store.commit('monthlyReportEdit/INIT_STATE_DATA')
     /*
      * read: 查看子月报
      * readAll:查看完整月报
@@ -220,15 +216,15 @@ export default {
       )
     }
     // 获取部门数据;只有查看但业务线时,才需要单独获取部门数据
-    if (
-      this.$route.query.pageType === 'readAll' &&
-      this.$route.query.reportId
-    ) {
-      this.$store.dispatch(
-        'monthlyReportEdit/setSelectEnum',
-        this.$route.query.reportId
-      )
-    }
+    // if (
+    //   this.$route.query.pageType === 'readAll' &&
+    //   this.$route.query.reportId
+    // ) {
+    //   this.$store.dispatch(
+    //     'monthlyReportEdit/setSelectEnum',
+    //     this.$route.query.reportId
+    //   )
+    // }
     // 查看
     if (this.$route.query.pageType === 'readAll') {
       this.$store.commit('monthlyReportEdit/SET_SUB_TITLE', '查看完整月报')

+ 2 - 0
src/views/monthlyReport/index.vue

@@ -126,6 +126,8 @@ export default {
     }
   },
   created() {
+    // 获取部门数据
+    this.$store.dispatch('monthlyReportEdit/setSelectEnum')
     this.getAvaliableInfo()
   },
   methods: {