Browse Source

月报2.0改造(2.1)

洪海涛 4 years ago
parent
commit
dad9967f6f

+ 8 - 6
src/store/modules/monthlyReport/edit/index.js

@@ -922,9 +922,9 @@ export default {
             res.data.content[0].tableHeaders
             res.data.content[0].tableHeaders
           )
           )
         }
         }
-        if (title.search(/上月问题跟进|发布&回滚|线上问题|延期|提测打回\/准出不通过/) > -1) {
-          const contentIndex = title === '线上问题' ? 0 : 0
-          console.log(res.data.content, 926)
+        if (title.search(/上月问题跟进|发布&回滚|线上问题|延期|提测打回\/发版撤回|提测打回\/准出不通过/) > -1) {
+          const contentIndex = title === '线上问题' ? 1 : 0
+          // console.log(res.data.content, 926)
           setTableHeader(res.data.content[contentIndex].tableHeaders)
           setTableHeader(res.data.content[contentIndex].tableHeaders)
           res.data.content[contentIndex].tableRows = arrToObj(
           res.data.content[contentIndex].tableRows = arrToObj(
             res.data.content[contentIndex].tableRows,
             res.data.content[contentIndex].tableRows,
@@ -945,10 +945,12 @@ export default {
                 elm.subTitles = _.cloneDeep(res.data.subTitles)
                 elm.subTitles = _.cloneDeep(res.data.subTitles)
                 elm.content = _.cloneDeep(res.data.content)
                 elm.content = _.cloneDeep(res.data.content)
                 // elm.subTitles = [...res.data.subTitles]
                 // elm.subTitles = [...res.data.subTitles]
-                // elm.content[1] = { ...res.data.content[0] }
+                elm.content[1] = { ...res.data.content[1] }
               } else if (title.search(/线下缺陷/) > -1) {
               } else if (title.search(/线下缺陷/) > -1) {
                 // elm = _.cloneDeep(res.data)
                 // elm = _.cloneDeep(res.data)
-                elm.content = [{ ...res.data.content[0] }]
+                elm.content = [...res.data.content]
+                // console.log(952, elm)
+                // console.log(953, res)
                 elm.subTitles = [...res.data.subTitles]
                 elm.subTitles = [...res.data.subTitles]
               } else if (title.search(/发布&回滚/) > -1) {
               } else if (title.search(/发布&回滚/) > -1) {
                 const value = `${elm.content[0].value || ''}`
                 const value = `${elm.content[0].value || ''}`
@@ -960,7 +962,7 @@ export default {
             }
             }
             if (elm.content && elm.content.length) {
             if (elm.content && elm.content.length) {
               elm.content.forEach((item) => {
               elm.content.forEach((item) => {
-                if (title.search(/上月问题跟进|发布&回滚|线上问题|项目延期提测|项目提测打回/) > -1) {
+                if (title.search(/上月问题跟进|发布&回滚|线上问题|项目延期提测|项目提测打回|提测打回\/准出不通过|提测打回\/发版撤回/) > -1) {
                   item.content = [...res.data.content]
                   item.content = [...res.data.content]
                 } else {
                 } else {
                   item.content = [{ ...res.data }]
                   item.content = [{ ...res.data }]

+ 3 - 3
src/store/modules/monthlyReport/edit/utils.js

@@ -135,7 +135,7 @@ export function arrToObj(arr, headerList) {
   newArr.forEach((elm) => {
   newArr.forEach((elm) => {
     const obj = {}
     const obj = {}
     headerList.forEach((helm, index) => {
     headerList.forEach((helm, index) => {
-      const { headerKey, displayType, name, itemInfo, selectType } = helm
+      const { headerKey, displayType, itemInfo, selectType } = helm
       const item = elm.tableItems[index]
       const item = elm.tableItems[index]
       if (item) {
       if (item) {
         obj[headerKey] = item.value
         obj[headerKey] = item.value
@@ -149,7 +149,7 @@ export function arrToObj(arr, headerList) {
             // console.log({ peopleList })
             // console.log({ peopleList })
           }
           }
         }
         }
-        if (name === '问题') {
+        if (item.operationTarget) {
           obj.operationTarget = item.operationTarget
           obj.operationTarget = item.operationTarget
         }
         }
         if (!itemInfo) {
         if (!itemInfo) {
@@ -225,7 +225,7 @@ export function objToArr(obj, tableHeaders) {
             param.value = JSON.stringify(param.value)
             param.value = JSON.stringify(param.value)
           }
           }
         }
         }
-        if (item.name === '问题' && elm.operationTarget) {
+        if (elm.operationTarget) {
           param.operationTarget = elm.operationTarget
           param.operationTarget = elm.operationTarget
         }
         }
         if (!elms.tableItems) {
         if (!elms.tableItems) {

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

@@ -2,6 +2,7 @@
   <div v-loading="paging.loading" class="table-wrapper">
   <div v-loading="paging.loading" class="table-wrapper">
     <div v-if="isExpand && analyticFeedback" style="padding-top: 10px;" v-html="analyticFeedback" />
     <div v-if="isExpand && analyticFeedback" style="padding-top: 10px;" v-html="analyticFeedback" />
     <span @click.stop>
     <span @click.stop>
+      <!-- :data="[...paging.tableData].splice(0,2)" -->
       <el-table
       <el-table
         :data="tableData"
         :data="tableData"
         border
         border
@@ -230,10 +231,10 @@
                 <div
                 <div
                   v-else-if="item.displayType === 'Texterea'"
                   v-else-if="item.displayType === 'Texterea'"
                   :style="{
                   :style="{
-                    cursor: item.name === '问题' && scope.row.operationTarget ? 'pointer' : 'auto',
-                    color: item.name === '问题' && scope.row.operationTarget ? '#1890ff':'#666'
+                    cursor: item.name.search(/需求名称|问题/) > -1 && scope.row.operationTarget ? 'pointer' : 'auto',
+                    color: item.name.search(/需求名称|问题/) > -1 && scope.row.operationTarget ? '#1890ff':'#666'
                   }"
                   }"
-                  @click.stop="item.name === '问题' && pageType.search(/edit/) < 0 && goto(scope.row.operationTarget) || editLine(scope.row, index)"
+                  @click.stop="item.name.search(/需求名称|问题/) > -1 && pageType.search(/edit/) < 0 && goto(scope.row.operationTarget) || editLine(scope.row, index)"
                 >
                 >
                   <TextInfo :text-align="item.name" :text="scope.row[item.headerKey]" />
                   <TextInfo :text-align="item.name" :text="scope.row[item.headerKey]" />
                 </div>
                 </div>

+ 76 - 60
src/views/monthlyReport/childrenPage/editReport/components/ReadOnlyTable.vue

@@ -38,7 +38,10 @@
                 P0:<span class="p0" @click.stop="query({row: scope.row, column: {property: otherColumns.p0.headerKey}}, 2)">{{ scope.row[otherColumns.p0.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>
                 P1:<span class="p1" @click.stop="query({row: scope.row, column: {property: otherColumns.p1.headerKey}}, 3)">{{ scope.row[otherColumns.p1.headerKey].value }}</span>
               </span>
               </span>
-              <span v-else class="edit-cell" @click.stop="query(scope, itemIndex + 3)" v-html="scope.row[item.headerKey].value" />
+              <span v-else class="edit-cell" :class="{'query-colors':item.name === 'P0&P1 过夜率' && scope.row[item.headerKey].value > 30}" @click.stop="query(scope, itemIndex + 2)" v-html="scope.row[item.headerKey].value" />
+              <span v-if="item.name === 'P0&P1 过夜率' && scope.row[item.headerKey].value > 0">
+                <span>%</span>
+              </span>
             </div>
             </div>
           </template>
           </template>
         </el-table-column>
         </el-table-column>
@@ -205,6 +208,9 @@ export default {
         if (elm.name === '新增缺陷总数') {
         if (elm.name === '新增缺陷总数') {
           elm.name = '新增缺陷:总数|P0|P1'
           elm.name = '新增缺陷:总数|P0|P1'
         }
         }
+        if (elm.name === 'P0&P1 24小时过夜率') {
+          elm.name = 'P0&P1 过夜率'
+        }
         if (elm.name === '新增P0缺陷' || elm.name === '新增P1缺陷') {
         if (elm.name === '新增P0缺陷' || elm.name === '新增P1缺陷') {
           return false
           return false
         }
         }
@@ -274,70 +280,73 @@ export default {
       const index = lIndex - 1 || 0
       const index = lIndex - 1 || 0
       console.log(row, column, index, row[column.property])
       console.log(row, column, index, row[column.property])
       const data = row[column.property]
       const data = row[column.property]
-      // return
-      if (index <= 2) {
-        const yaxis = this.setList(data, index)
-        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: 0 }
-      } else if (index === 5) {
-        const yaxis = data.reportBugs.map(item => {
-          return item.id
-        })
-        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] = [[], [], [], [], [], [], [], [], []]
-        if (data.reportBugs[0]) {
-          data.reportBugs.map(item => {
-            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以上
-              one = [f, g, h]
-            }
-            if (item.isRepaired && item.repairTime > 24) { // 修复时常超过24小时
-              a.push(item.id)
+      console.log(data)
+      if (true) {
+        // return
+        if (index <= 2) {
+          const yaxis = this.setList(data, index)
+          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: 0 }
+        } else if (index === 5) {
+          const yaxis = data.reportBugs.map(item => {
+            return item.id
+          })
+          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] = [[], [], [], [], [], [], [], [], []]
+          if (data.reportBugs[0]) {
+            data.reportBugs.map(item => {
+              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以上
+                one = [f, g, h]
+              }
+              if (item.isRepaired && item.repairTime > 24) { // 修复时常超过24小时
+                a.push(item.id)
+                if (item.priority < 2) {
+                  s.push(item.id)
+                }
+                if (item.priority > 1) {
+                  d.push(item.id)
+                }
+                three = [a, s, d]
+              }
+              if (item.status === 0) { // 未修复
+                z.push(item.id)
+                if (item.priority < 2) { x.push(item.id) }
+                if (item.priority > 1) { c.push(item.id) }
+                four = [z, x, c]
+              }
+              j.push(item.id)
               if (item.priority < 2) {
               if (item.priority < 2) {
-                s.push(item.id)
+                k.push(item.id)
               }
               }
               if (item.priority > 1) {
               if (item.priority > 1) {
-                d.push(item.id)
+                l.push(item.id)
               }
               }
-              three = [a, s, d]
-            }
-            if (item.status === 0) { // 未修复
-              z.push(item.id)
-              if (item.priority < 2) { x.push(item.id) }
-              if (item.priority > 1) { c.push(item.id) }
-              four = [z, x, c]
-            }
-            j.push(item.id)
-            if (item.priority < 2) {
-              k.push(item.id)
-            }
-            if (item.priority > 1) {
-              l.push(item.id)
-            }
-            tow = [j, k, l]
-          })
-        }
-        const yaxis = [tow, one, three, four]
-        this.requireList = {
-          toType: '缺陷',
-          xaxis: this.bugHour,
-          towTimeLine: this.bugPrioritys,
-          title: '缺陷24小时修复',
-          yaxis: yaxis,
-          dataIndex: 1
+              tow = [j, k, l]
+            })
+          }
+          const yaxis = [tow, one, three, four]
+          this.requireList = {
+            toType: '缺陷',
+            xaxis: this.bugHour,
+            towTimeLine: this.bugPrioritys,
+            title: '缺陷24小时修复',
+            yaxis: yaxis,
+            dataIndex: 1
+          }
         }
         }
+        this.openDrawer = true
       }
       }
-      this.openDrawer = true
     },
     },
     /* S 分页 */
     /* S 分页 */
     handleSizeChange(value) {
     handleSizeChange(value) {
@@ -360,7 +369,7 @@ export default {
     },
     },
     /* E 分页 */
     /* E 分页 */
     setList(data, index) {
     setList(data, index) {
-      if (data.reportBugs[0]) {
+      if (data.reportBugs.length) {
         const [q, w, e, r, t] = [[], [], [], [], []]
         const [q, w, e, r, t] = [[], [], [], [], []]
         data.reportBugs.forEach(item => {
         data.reportBugs.forEach(item => {
           q.push(item.id) // 全部
           q.push(item.id) // 全部
@@ -412,5 +421,12 @@ export default {
     min-height: 23px;
     min-height: 23px;
     width: 100%;
     width: 100%;
   }
   }
+  .fontWeight {
+    color: #333;
+    font-weight: 600;
+  }
+  .query-colors {
+    color: red;
+  }
 }
 }
 </style>
 </style>

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

@@ -14,6 +14,7 @@
         此操作会将现有的数据覆盖,确认重新拉取?
         此操作会将现有的数据覆盖,确认重新拉取?
       </div>
       </div>
     </normal-dialog>
     </normal-dialog>
+<!--    title: {{ title }}-->
     <span v-if="title && pullDataAgainTitle.indexOf(title) > -1">
     <span v-if="title && pullDataAgainTitle.indexOf(title) > -1">
       <el-tooltip
       <el-tooltip
         class="item"
         class="item"
@@ -59,7 +60,7 @@ export default {
     return {
     return {
       animateClass: '',
       animateClass: '',
       dialogTitle: '重新拉取数据',
       dialogTitle: '重新拉取数据',
-      pullDataAgainTitle: ['上月问题跟进', '线上问题', '线下缺陷', '发布&回滚', '延期 - 项目延期提测{param}次,延期发布{param}次', '提测打回/准出不通过 - 项目提测打回{param}次,准出不通过{param}次']
+      pullDataAgainTitle: ['上月问题跟进', '线上问题', '线下缺陷', '发布&回滚', '延期 - 项目延期提测{param}次,延期发布{param}次', '提测打回/准出不通过 - 项目提测打回{param}次,准出不通过{param}次', '提测打回/发版撤回 - 项目提测打回{param}次,发版撤回{param}次']
     }
     }
   },
   },
   computed: {
   computed: {
@@ -85,6 +86,9 @@ export default {
       if (this.title === '提测打回/准出不通过 - 项目提测打回{param}次,准出不通过{param}次') {
       if (this.title === '提测打回/准出不通过 - 项目提测打回{param}次,准出不通过{param}次') {
         title = '提测打回/准出不通过'
         title = '提测打回/准出不通过'
       }
       }
+      if (this.title === '提测打回/发版撤回 - 项目提测打回{param}次,发版撤回{param}次') {
+        title = '提测打回/发版撤回'
+      }
       this.$store.dispatch('monthlyReportEdit/refreshReport', {
       this.$store.dispatch('monthlyReportEdit/refreshReport', {
         domKey: this.domKey,
         domKey: this.domKey,
         title: title,
         title: title,

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

@@ -87,9 +87,9 @@
         <div v-else class="no-data" style="padding-left: 20px">暂无数据!</div>
         <div v-else class="no-data" style="padding-left: 20px">暂无数据!</div>
       </div>
       </div>
       <div v-else>
       <div v-else>
-        <div>item.name{{ item.name }}</div>
-        <div>item.type{{ item.type }}</div>
-        <div>item.domKey{{ item.domKey }}</div>
+        <div>item.name{{ item }}</div>
+<!--        <div>item.type{{ item.type }}</div>-->
+<!--        <div>item.domKey{{ item.domKey }}</div>-->
 <!--        <fixedText-->
 <!--        <fixedText-->
 <!--          v-model="item.value"-->
 <!--          v-model="item.value"-->
 <!--          :title="item.title"-->
 <!--          :title="item.title"-->