Browse Source

Merge branch 'master' of http://121.42.8.157:13000/zengminguo/D-MAP

hao lei 1 year ago
parent
commit
652296119b

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

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

+ 2 - 1
src/store/modules/plan/index.js

@@ -6,7 +6,8 @@ export default {
   state() {
     return {
       planList: [],
-      autoPlanList: []
+      autoPlanList: [],
+      tempPlanList: []
     };
   },
   mutations,

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

@@ -1,5 +1,11 @@
 export default {
   setPlanList(state, planList) {
+    while(state.planList.length) {
+      state.planList.pop()
+    }
+    while(state.tempPlanList.length) {
+      state.tempPlanList.pop()
+    }
     planList.forEach((planId) => {
       if(!state.planList.some(p => p.id == planId)) {
         let plan = {};
@@ -25,9 +31,35 @@ export default {
         state.planList.push(plan)
       }
     });
+    planList.forEach((planId) => {
+      if(!state.tempPlanList.some(p => p.id == planId)) {
+        let plan = {};
+        plan.id = planId;
+        plan.checked = false;
+        plan.carline = [];
+        plan.case_list = [109, 110, 111, 112, 113]
+        plan.cluster = 1
+        plan.create_time = ""
+        plan.creator = ""
+        plan.delete_flag = 0
+        plan.description = ""
+        plan.function = [1, 2]
+        plan.language = [1, 2]
+        plan.level = [1, 2]
+        plan.market = [1, 2]
+        plan.name = ""
+        plan.platform = [1, 2]
+        plan.project = [1, 2]
+        plan.sub_function = [1, 2]
+        plan.update_time = ""
+        plan.uuid = ""
+        state.tempPlanList.push(plan)
+      }
+    });
   },
   setMaualPlanList(state, planList) {
     let maualPlanList = state.planList;
+    console.log('=======1111111')
     maualPlanList.forEach(p => {
       let plan = planList.find(s => s.id == p.id);
       if (plan) {
@@ -39,6 +71,9 @@ export default {
     })
   },
   setAutoPlanList(state, planList) {
+    while(state.autoPlanList.length) {
+      state.autoPlanList.pop()
+    }
     planList.forEach((planId) => {
       if(!state.autoPlanList.some(p => p.id == planId)) {
         let plan = {}
@@ -89,4 +124,19 @@ export default {
       }
     });
   },
+  clearPlanList(state) {
+    console.log('=======2222222')
+    while(state.planList.length) {
+      state.planList.pop()
+    }
+    let len = state.tempPlanList.length;
+    for(let i = 0; i < len; i++) {
+      let plan = state.tempPlanList[i];
+      let t = {}
+      for(let key in plan) {
+        t[key] = plan[key]
+      }
+      state.planList.push(t)
+    }
+  }
 };

+ 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,
@@ -1143,6 +1144,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