Răsfoiți Sursa

Merge branch 'monthly_report_daily_0.0.8' into http_test

洪海涛 4 ani în urmă
părinte
comite
f72481e435

+ 3 - 1
src/store/modules/monthlyReport/edit/index.js

@@ -942,10 +942,12 @@ export default {
               } else if (title.search(/线上问题/) > -1) {
                 // console.log(res, 937)
                 // console.log(elm.content, 938)
+                const value = `${elm.content[0].value || ''}`
                 elm.subTitles = _.cloneDeep(res.data.subTitles)
                 elm.content = _.cloneDeep(res.data.content)
+                elm.content[0].value = value
                 // elm.subTitles = [...res.data.subTitles]
-                elm.content[1] = { ...res.data.content[1] }
+                // elm.content[1].tableRows = [...res.data.content[1].tableRows]
               } else if (title.search(/线下缺陷/) > -1) {
                 // elm = _.cloneDeep(res.data)
                 elm.content[0] = _.cloneDeep(res.data.content[0])

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

@@ -400,13 +400,13 @@ export default {
       return this.$store.state.monthlyReportEdit.editKeys
     }
   },
-  watch: {
-    tableData() {
-      if (this.tableData.length) {
-        this.init()
-      }
-    }
-  },
+  // watch: {
+  //   tableData() {
+  //     if (this.tableData.length) {
+  //       this.init()
+  //     }
+  //   }
+  // },
   mounted() {
     this.$nextTick(() => {
       this.setExpandRowKeys()
@@ -447,7 +447,7 @@ export default {
       }
 
       if (item.name === '原因') {
-        width = 200
+        width = 150
       }
 
       if (item.name === '影响') {

+ 11 - 0
src/views/monthlyReport/childrenPage/editReport/components/OnlineQuestion.vue

@@ -77,6 +77,17 @@ export default {
           return ';'
         }
       }
+      if (label.search(/未定级故障数/) > -1) {
+        let newSymbol = ';'
+        for (let i = 0; i < this.subTitle.length; i++) {
+          const elm = this.subTitle[i]
+          if (elm.copywriter === '故障率') {
+            newSymbol = ','
+            return newSymbol
+          }
+        }
+        return newSymbol
+      }
       return ','
     }
   }

+ 20 - 5
src/views/monthlyReport/childrenPage/editReport/components/ReadOnlyTable.vue

@@ -34,11 +34,11 @@
             </div>
             <div v-else class="edit-wrapper">
               <span v-if="item.name === '新增缺陷:总数|P0|P1' && otherColumns.all && otherColumns.all.headerKey" class="other-item-wrapper" @click="print(scope.row, itemIndex)">
-                <span class="all" @click.stop="query({row: scope.row, column: {property: otherColumns.all.headerKey}}, 1)">{{ scope.row[otherColumns.all.headerKey].value }}</span>/
-                P0:<span class="p0" @click.stop="query({row: scope.row, column: {property: otherColumns.p0.headerKey}}, 2)">{{ scope.row[otherColumns.p0.headerKey].value }}</span>
-                P1:<span class="p1" @click.stop="query({row: scope.row, column: {property: otherColumns.p1.headerKey}}, 3)">{{ scope.row[otherColumns.p1.headerKey].value }}</span>
+                <span class="all" @click.stop="query({row: scope.row, column: {property: otherColumns.all.headerKey}}, 1)">{{ setOtherValue(scope.row, 'all' ) }}</span>/
+                P0:<span class="p0" @click.stop="query({row: scope.row, column: {property: otherColumns.p0.headerKey}}, 2)">{{ setOtherValue(scope.row, 'p0' ) }}</span>
+                P1:<span class="p1" @click.stop="query({row: scope.row, column: {property: otherColumns.p1.headerKey}}, 3)">{{ setOtherValue(scope.row, 'p1' ) }}</span>
               </span>
-              <span v-else class="edit-cell" :class="{'query-colors':item.name.search(/过夜率/) > -1 && scope.row[item.headerKey].value > 30}" @click.stop="query(scope, itemIndex + 2)" v-html="scope.row[item.headerKey].value" />
+              <span v-else class="edit-cell" :class="{'query-colors':item.name.search(/过夜率/) > -1 && scope.row[item.headerKey].value > 30}" @click.stop="query(scope, itemIndex + 2)" v-html="scope.row[item.headerKey].value || ''" />
               <!-- <span v-if="item.name.search(/过夜率/) > -1 && scope.row[item.headerKey].value !== '&#45;&#45;'"> -->
               <!--  <span>%</span> -->
               <!-- </span> -->
@@ -150,6 +150,13 @@ export default {
       return this.$store.state.monthlyReportEdit.pageDate
     }
   },
+  watch: {
+    tableData() {
+      this.$nextTick(() => {
+        this.init()
+      })
+    }
+  },
   mounted() {
     this.$nextTick(() => {
       this.init()
@@ -264,6 +271,14 @@ export default {
       }
       return `${width}px`
     },
+    //
+    setOtherValue(row, key) {
+      const headerKey = this.otherColumns[key].headerKey
+      return row[headerKey] && row[headerKey].value ? row[headerKey].value : ''
+    },
+    // otherQuery(row, key) {
+    //   this.query()
+    // },
     // 设置列的对齐方式
     isFixed(item, index, columns) {
       if (item.name === '操作') return 'right'
@@ -287,7 +302,7 @@ export default {
         this.requireList = { toType: '缺陷', title: '累计reopen', yaxis: yaxis, idList: yaxis }
       } else if (index === 4) {
         let [one, tow, three, four] = [[], [], [], []]
-        const [a, s, d, f, g, h, j, k, l, z, x, c] = [[], [], [], [], [], [], [], [], []]
+        const [a, s, d, f, g, h, j, k, l, z, x, c] = [[], [], [], [], [], [], [], [], [], [], [], []]
         if (data.reportBugs[0]) {
           data.reportBugs.map(item => {
             if (item.isRepaired && item.repairTime < 24) { // 24小时内修复

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

@@ -22,7 +22,7 @@
         content="重新拉取数据"
         placement="top"
       >
-        <div :class="animateClass" style="display: inline-block" @click.stop="refreshData"> <i class="el-icon-refresh refresh" /></div>
+        <div :class="animateClass" style="display: inline-block;" @click.stop="refreshData"> <i class="el-icon-refresh refresh" /></div>
       </el-tooltip>
     </span>
   </span>

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

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

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

@@ -73,11 +73,11 @@
         slot="refresh"
         :title="baseData.title"
         :dom-key="baseData.domKey"
-        :style="{marginLeft: baseData.title.search(/线上问题/) > -1 ? '5px' : '0'}" />
+        :style="{marginLeft: baseData.title.search(/线上问题/) > -1 ? '5px' : '5px'}" />
       <span><el-button
         v-if="headerTitle.indexOf('线下缺陷') > -1 && pageDate.status < 20"
         type="text"
-        style="margin-left: 5px;font-weight: 400;"
+        style="margin-left: 15px;font-weight: 400;"
         @click.stop="marking">标记</el-button></span>
     </div>
     <div

+ 45 - 16
src/views/monthlyReport/childrenPage/setReport/components/general.vue

@@ -65,12 +65,12 @@
     </el-row>
     <!-- 技术模块 -->
     <normal-dialog ref="succes" is-succes :show-dialog="showSModules" :title="'技术模块'" :width="'40%'" @succes="updateModule" @cancel="showSModules = false">
-      <el-radio-group v-model="radio">
-        <el-radio :label="3" style="margin: 0 0 15px;">全部</el-radio><br>
-        <el-radio :label="6">部分</el-radio>
-      </el-radio-group>
-      <div v-if="radio === 6" class="report-selectModule">请选择模块</div>
-      <el-form v-if="bizModules.length > 0 && radio === 6" label-position="left" :model="numberValidateForm" label-width="160px" class="report-from">
+<!--      <el-radio-group v-model="radio">-->
+<!--        <el-radio :label="3" style="margin: 0 0 15px;">全部</el-radio><br>-->
+<!--        <el-radio :label="6">部分</el-radio>-->
+<!--      </el-radio-group>-->
+<!--      <div class="report-selectModule">请选择模块</div>-->
+      <el-form v-if="bizModules.length > 0" label-position="left" :model="numberValidateForm" label-width="160px" class="report-from">
         <div v-for="(item) in bizModules" :key="item.id">
           <el-form-item :label="item.bizName">
             <el-cascader v-model="item.moduleIds" :options="item.data" :props="props" clearable style="width: 90%;" />
@@ -154,19 +154,48 @@ export default {
         this.$message({ type: 'warning', message: '月报发起人不能为空' })
       }
     },
-    updateModule(cancel) {
-      if (this.radio === 3) {
-        this.updatabizSetting({ id: this.moduleId, isAll: true })
-      } else if (this.radio === 6) {
-        this.bool = true
-        this.bizModules.map(item => {
-          if (!item.moduleIds[0]) {
-            this.bool = false
-            this.$message({ message: '模块不能为空', type: 'warning' })
+    // 设置moduleIds
+    setModuleIds(source) {
+      const list = []
+      const run = (arr, child) => {
+        arr && arr.length && arr.forEach(elm => {
+          const childrens = [...child]
+          childrens.push(elm.id)
+          elm.childModules && elm.childModules.length && run(elm.childModules, childrens)
+          if (!elm.childModules) {
+            list.push(childrens)
           }
         })
-        this.bool && this.updatabizSetting({ id: this.moduleId, isAll: false, bizModules: this.bizModules })
       }
+      run(source, [])
+      return list
+    },
+    updateModule(cancel) {
+      // if (this.radio === 3) {
+      //   this.updatabizSetting({ id: this.moduleId, isAll: true })
+      // } else if (this.radio === 6) {
+      //   this.bool = true
+      //   this.bizModules.map(item => {
+      //     if (!item.moduleIds[0]) {
+      //       this.bool = false
+      //       this.$message({ message: '模块不能为空', type: 'warning' })
+      //     }
+      //   })
+      //   this.bool && this.updatabizSetting({ id: this.moduleId, isAll: false, bizModules: this.bizModules })
+      // }
+      let isAll = true
+      this.bizModules.forEach(item => {
+        // const item = { ...elm }
+        item.allModule = item.moduleIds.length === 0
+        if (isAll && !item.allModule) {
+          isAll = item.allModule
+        }
+        if (item.allModule) {
+          item.moduleIds = this.setModuleIds(item.data)
+        }
+        return item
+      })
+      this.updatabizSetting({ id: this.moduleId, isAll: isAll, bizModules: this.bizModules })
     },
     async updatabizSetting(val) { // 更新业务线设置
       const res = await monthlyReportUpdatSetting(val)