Selaa lähdekoodia

月报2.0改造(1.4)

洪海涛 4 vuotta sitten
vanhempi
sitoutus
02cc0cdea1

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

@@ -24,6 +24,7 @@ import {
   setTabActive,
   setDeptArch,
   setIndexTitle,
+  readOnlyTableArrToObj,
   arrToObj,
   objToArr,
   setTableHeader
@@ -169,7 +170,7 @@ export default {
       )
       state.tabPageData = newObj
       state.domKeys = domKeys
-      console.log(peopleLists, 171)
+      // console.log(peopleLists, 171)
       state.peopleLists = peopleLists
     },
     // 切换页面之后数据维护
@@ -903,7 +904,8 @@ export default {
        * 线上问题、
        */
       const res = await pullDataAgain(params)
-      if (title !== '上月问题跟进' && title !== '线下缺陷' && title !== '线上问题') {
+      console.log(res)
+      if (title !== '上月问题跟进' && title !== '线上问题') {
         if (res.data.type.search(/Table|TableAndRichText/) > -1) {
           setTableHeader(res.data.tableHeaders)
           res.data.tableRows = arrToObj(
@@ -912,13 +914,22 @@ export default {
           )
         }
       }
-      if (title.search(/上月问题跟进|发布&回滚|线上问题/) > -1) {
+      if (title.search(/线下缺陷/) > -1) {
         setTableHeader(res.data.content[0].tableHeaders)
-        res.data.content[0].tableRows = arrToObj(
+        res.data.content[0].tableRows = readOnlyTableArrToObj(
           res.data.content[0].tableRows,
           res.data.content[0].tableHeaders
         )
       }
+      if (title.search(/上月问题跟进|发布&回滚|线上问题/) > -1) {
+        const contentIndex = title === '线上问题' ? 1 : 0
+        setTableHeader(res.data.content[contentIndex].tableHeaders)
+        res.data.content[contentIndex].tableRows = arrToObj(
+          res.data.content[contentIndex].tableRows,
+          res.data.content[contentIndex].tableHeaders
+        ).newObj
+        // console.log(res.data.content[contentIndex].tableRows, 923)
+      }
       const setDomData = (arr) => {
         arr &&
           arr.length &&
@@ -928,16 +939,23 @@ export default {
               if (title.search(/上月问题跟进/) > -1) {
                 elm.content = [{ ...res.data.content[0] }]
               } else if (title.search(/线上问题/) > -1) {
-                const value = `${elm.content[0].value}`
+                const value = `${elm.content[0].value || ''}`
                 // console.log(elm.content, 904)
                 // elm.content[0].tableRows = res.data.content[0].tableRows
-                elm.content = [{ ...res.data.content[0], value }]
+                res.data.content[0].value = value
+                console.log(res.data.content, 937)
+                console.log(elm.content, 938)
+                elm.subTitles = [...res.data.subTitles]
+                elm.content = [...res.data.content]
                 // console.log(elm.content, res.data.content[0], 907)
                 // elm.content = [{
                 //   ...elm.content[0],
                 //   tableRows: res.data.content[0].tableRows
                 // }]
-              } else if (title.search(/线下缺陷|发布&回滚/) > -1) {
+              } else if (title.search(/线下缺陷/) > -1) {
+                elm.content = [...res.data.content]
+                elm.subTitles = [...res.data.subTitles]
+              } else if (title.search(/发布&回滚/) > -1) {
                 const value = `${elm.content[0].value || ''}`
                 elm.content = [{ ...res.data.content[0], value }]
                 elm.subTitles = [...res.data.subTitles]
@@ -948,7 +966,9 @@ export default {
             if (elm.content && elm.content.length) {
               elm.content.forEach((item) => {
                 if (title.search(/上月问题跟进|发布&回滚|线上问题/) > -1) {
-                  item.content = [{ ...res.data.content[0] }]
+                  item.content = [...res.data.content]
+                  // console.log(item, 957)
+                  // console.log(res.data, [...res.data.content], 958)
                 } else {
                   item.content = [{ ...res.data }]
                 }

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

@@ -146,7 +146,7 @@ export function arrToObj(arr, headerList) {
           if (selectType && selectType === 'MultiplePeople') {
             obj[headerKey] = strToArr(obj[headerKey])
             peopleList = Array.from(new Set([...peopleList, ...obj[headerKey]]))
-            console.log({ peopleList })
+            // console.log({ peopleList })
           }
         }
         if (name === '问题') {

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

@@ -419,6 +419,10 @@ export default {
         width = 300
       }
 
+      if (item.name.search(/改进项/) > -1) {
+        width = 200
+      }
+
       if (this.pageType.search(/read/) > -1) {
         if (item.name.search(/标签|影响/) > -1) {
           width = 150

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

@@ -35,16 +35,16 @@ export default {
     }
   },
   watch: {
-    teamData() {
-      console.log(39)
-      // this.init(this.isInit)
-    },
+    // teamData() {
+    //   console.log(39)
+    //   // this.init(this.isInit)
+    // },
     userNames(newVal, oldVal) {
       this.initPeople()
     }
   },
   mounted() {
-    console.log(58)
+    // console.log(58)
     // setTimeout(() => {
     // this.init(true)
     // }, 700)
@@ -78,7 +78,7 @@ export default {
             this.$store.dispatch('monthlyReportEdit/initPeople')
           }
         }
-        console.log(this.teamData, 65)
+        // console.log(this.teamData, 65)
         this.isInit = false
       }
     },

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

@@ -189,7 +189,7 @@ export default {
   },
   data() {
     return {
-      fontWeightFont: ['两轮车', '代驾', '货运', '硬件', '中台'],
+      fontWeightFont: ['两轮车', '代驾', '货运', '硬件', '中台', '安全服务生态', '司机生态', 'prado'],
       pullDataAgainTitle: ['上月问题跟进', '线上问题', '线下缺陷', '发布&回滚'],
       activeName: '',
       loading: false,