deepsea 1 year ago
parent
commit
0d07ee86a4

+ 3 - 0
src/store/modules/plan/actions.js

@@ -29,5 +29,8 @@ export default {
     } catch (err) {
       console.log("error", "服务异常", 1000);
     }
+  },
+  clearPlanList({commit}) {
+    commit('clearPlanList')
   }
 };

+ 8 - 0
src/store/modules/plan/mutations.js

@@ -89,4 +89,12 @@ export default {
       }
     });
   },
+  clearPlanList(state) {
+    while(state.autoPlanList.length) {
+      state.autoPlanList.pop()
+    }
+    while(state.planList.length) {
+      state.planList.pop()
+    }
+  }
 };

+ 3 - 0
src/store/modules/task/actions.js

@@ -10,4 +10,7 @@ export default {
       console.log("error", "服务异常", 1000);
     }
   },
+  clearTaskList({ commit }) {
+    commit('clearTaskList')
+  }
 };

+ 5 - 0
src/store/modules/task/mutations.js

@@ -19,4 +19,9 @@ export default {
     //  }
     //});
   },
+  clearTaskList(state) {
+    while(state.taskList.length) {
+      state.taskList.pop()
+    }
+  }
 };

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

@@ -835,6 +835,7 @@ export default {
     window.bmMapItemUnSelect = this.bmMapItemUnSelect.bind(this);
     window.handleClickIssue = this.handleClickIssue.bind(this);
     window.selectBench = this.selectBench.bind(this);
+    that.$store.dispatch("taskList/clearTaskList")
     that.$store.dispatch("taskList/fetchTaskList", {
       page_num: 1,
       page_size: 1000,
@@ -1139,6 +1140,7 @@ export default {
       this.$store.commit("planList/setPlanList", manualList);
       that.taskName = task.name;
       this.$nextTick(() => {
+        that.$store.dispatch("planList/clearPlanList")
         that.$store.dispatch("planList/fetchPlanList", {
           page_num: 1,
           page_size: 10000,

+ 1 - 0
src/views/task1/list.vue

@@ -96,6 +96,7 @@
             })
         },
         created() {
+            that.$store.dispatch("planList/clearPlanList")
             this.$store.dispatch('planList/fetchPlanList', {
                 page_num: 1,
                 page_size: 100