洪海涛 4 жил өмнө
parent
commit
767331276d

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

@@ -74,7 +74,8 @@ export default {
     loading: false,
     clientTypeList: [],
     // 单业务线编辑时,数据迁移
-    saveAsTargetList: []
+    saveAsTargetList: [],
+    isLoading: [] // 是否显示刷新组件
     // saveAsData: {
     //   tableRow: '',
     //   targetSubReportId: ''
@@ -385,6 +386,7 @@ export default {
       state.clientTypeList = []
       // 单业务线编辑时,数据迁移
       state.saveAsTargetList = []
+      state.isLoading = [] // 是否显示刷新组件
     },
     // tabPageData
     SET_TAB_PAGE_DATA(state, { data, id, tabsActive }) {
@@ -935,41 +937,28 @@ export default {
           arr &&
           arr.length &&
           arr.forEach((elm) => {
+            const newDomKey = uuid10(4)
             if (elm.domKey === domKey) {
-              // console.log(elm, res.data)
               if (title.search(/上月问题跟进/) > -1) {
-                elm.content = [{ ...res.data.content[0] }]
+                elm.content = [{ ...res.data.content[0], domKey: newDomKey }]
               } 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].tableRows = [...res.data.content[1].tableRows]
+                elm.content[1].domKey = newDomKey
               } else if (title.search(/线下缺陷/) > -1) {
-                // elm = _.cloneDeep(res.data)
                 elm.content[0] = _.cloneDeep(res.data.content[0])
-                // console.log(952, elm)
-                // console.log(953, res)
+                elm.content[0].domKey = newDomKey
                 elm.subTitles = [...res.data.subTitles]
               } else if (title.search(/发布&回滚/) > -1) {
                 const value = `${elm.content[0].value || ''}`
-                elm.content = [{ ...res.data.content[0], value }]
+                elm.content = [{ ...res.data.content[0], value, domKey: newDomKey }]
                 elm.subTitles = [...res.data.subTitles]
               } else {
-                elm.content = [{ ...res.data.content[0] }]
+                elm.content = [{ ...res.data.content[0], domKey: newDomKey }]
               }
-            }
-            if (elm.content && elm.content.length) {
-              elm.content.forEach((item) => {
-                if (title.search(/上月问题跟进|发布&回滚|线上问题|项目延期提测|项目提测打回|提测打回\/准出不通过|提测打回\/发版撤回/) > -1) {
-                  item.content = [...res.data.content]
-                } else {
-                  item.content = [{ ...res.data }]
-                }
-              })
+              state.isLoading = [newDomKey]
             }
             if (elm.children && elm.children.length) {
               setDomData(elm.children)

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

@@ -1,10 +1,12 @@
 <template>
   <div v-loading="paging.loading" class="table-wrapper">
+    domKey: {{ domKey }}
     <div v-if="isExpand && analyticFeedback" style="padding-top: 10px;" v-html="analyticFeedback" />
     <span @click.stop>
       <!-- :data="[...paging.tableData].splice(0,2)" -->
+      <!--  :data="tableData" -->
       <el-table
-        :data="tableData"
+        :data="[...paging.tableData].splice(0,2)"
         border
         style="width: 100%; margin-top: 10px"
         highlight-current-row
@@ -398,6 +400,9 @@ export default {
     },
     editKeys() {
       return this.$store.state.monthlyReportEdit.editKeys
+    },
+    isLoading() {
+      return this.$store.state.monthlyReportEdit.isLoading
     }
   },
   // watch: {
@@ -424,7 +429,8 @@ export default {
     init() {
       this.paging.curIndex = 1
       this.paging.pageSize = 10
-      this.paging.loading = true
+      console.log(this.isLoading, this.domKey)
+      this.paging.loading = this.isLoading.indexOf(this.domKey) > -1
       this.paging.tableData = [...this.tableData].splice((this.paging.curIndex - 1 || 0) * this.paging.pageSize, this.paging.pageSize)
       this.paging.pageTotal = this.tableData.length
       // console.log('init', this.paging)

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

@@ -148,6 +148,9 @@ export default {
     },
     pageDate() {
       return this.$store.state.monthlyReportEdit.pageDate
+    },
+    isLoading() {
+      return this.$store.state.monthlyReportEdit.isLoading
     }
   },
   watch: {
@@ -165,7 +168,7 @@ export default {
   methods: {
     init() {
       [this.otherColumns.all, this.otherColumns.p0, this.otherColumns.p1] = this.columns.map(elm => elm).splice(1, 3)
-      this.paging.loading = true
+      this.paging.loading = this.isLoading.indexOf(this.domKey) > -1
       this.paging.curIndex = 1
       this.paging.pageSize = 10
       this.paging.tableData = [...this.tableData].splice((this.paging.curIndex - 1 || 0) * this.paging.pageSize, this.paging.pageSize)

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

@@ -3,6 +3,8 @@
     <div v-for="item in baseData" :key="item.domKey">
       <!--   表格:Table   -->
       <div v-if="item.type === 'Table'">
+
+        <span @click.stop="testPrint(item)">item.domKey: {{ item.domKey }}-{{ baseDataDomKey }}</span>
         <!-- 是否查看页面 -->
         <mrTable
           v-if="pageType.search(/edit/) > -1 || item.tableRows.length"
@@ -135,6 +137,11 @@ export default {
       required: false,
       default: () => ''
     },
+    baseDataDomKey: {
+      type: String,
+      required: false,
+      default: () => ''
+    },
     baseData: {
       type: Array,
       required: false,
@@ -157,6 +164,9 @@ export default {
       if (this.tabsActive.search(/重点问题/) > -1) {
         return '本月无重点问题!'
       }
+    },
+    testPrint(item) {
+      console.log(item)
     }
   }
 }

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

@@ -86,6 +86,7 @@
     >
       <contentDom
         v-if="isSHowContent()"
+        :base-data-dom-key="baseData.domKey"
         :header-title-type="baseData.type"
         :base-data="baseData.content"
         :title="baseData.title"