duy há 1 mês atrás
pai
commit
903a706589
1 ficheiros alterados com 14 adições e 0 exclusões
  1. 14 0
      src/views/codeRule/ruleManage.vue

+ 14 - 0
src/views/codeRule/ruleManage.vue

@@ -602,11 +602,25 @@ import { getStore, setStore } from "@/util/store";
         this.defaultExpandedKeys = getStore({ name: this.expandName });
         this.curreenttid= getStore({ name:'curreenttid' });
         this.treePid = getStore({ name:'treePid' });
+        console.log(this.curreenttid,'this.curreenttid');
+        
         if (this.curreenttid) {
           this.treeId = this.curreenttid;
           this.getRuleItemOptions();
         } 
     },
+     watch: {
+    projectid(newVal, oldVal) {
+      if (newVal !== oldVal) {
+        this.curreenttid = '';
+        setStore({
+          name: 'curreenttid',
+          content: this.curreenttid,
+          type: true, // sessionStorage
+        });
+      }
+    }
+  },
     methods: {
       //获取符号字典
       getFqOptions(){