Browse Source

bug修改

mengy 3 years ago
parent
commit
964c1da8ee
1 changed files with 29 additions and 10 deletions
  1. 29 10
      shanXiPlatform/src/layout/components/RightSettings/index.vue

+ 29 - 10
shanXiPlatform/src/layout/components/RightSettings/index.vue

@@ -43,21 +43,40 @@ export default {
43
     listenDepotId() {
43
     listenDepotId() {
44
       return this.$store.state.depotId
44
       return this.$store.state.depotId
45
     },
45
     },
46
+    listenRelation() {
47
+      return this.$store.state.relation
48
+    },
46
   },
49
   },
47
   watch: {
50
   watch: {
48
     listenHouseId: function (val) {
51
     listenHouseId: function (val) {
49
-      if(this.$store.state.relation && this.$store.state.relation == 'house'){
50
-        this.$refs.userManageTree.setCurrentKey(this.$store.state.houseId)
51
-      }else if(this.$store.state.relation && this.$store.state.relation == 'library'){
52
-        this.$refs.userManageTree.setCurrentKey(this.$store.state.depotId)
53
-      }
52
+      let that = this
53
+      setTimeout(function () {
54
+          if(that.$store.state.relation && that.$store.state.relation == 'house'){
55
+            that.$refs.userManageTree.setCurrentKey(that.$store.state.houseId)
56
+          }else if(that.$store.state.relation && that.$store.state.relation == 'library'){
57
+            that.$refs.userManageTree.setCurrentKey(that.$store.state.depotId)
58
+          }
59
+      }, 1000);
54
     },
60
     },
55
     listenDepotId: function (val) {
61
     listenDepotId: function (val) {
56
-      if(this.$store.state.relation && this.$store.state.relation == 'house'){
57
-        this.$refs.userManageTree.setCurrentKey(this.$store.state.houseId)
58
-      }else if(this.$store.state.relation && this.$store.state.relation == 'library'){
59
-        this.$refs.userManageTree.setCurrentKey(this.$store.state.depotId)
60
-      }
62
+      let that = this
63
+      setTimeout(function () {
64
+          if(that.$store.state.relation && that.$store.state.relation == 'house'){
65
+            that.$refs.userManageTree.setCurrentKey(that.$store.state.houseId)
66
+          }else if(that.$store.state.relation && that.$store.state.relation == 'library'){
67
+            that.$refs.userManageTree.setCurrentKey(that.$store.state.depotId)
68
+          }
69
+      }, 1000);
70
+    },
71
+    listenRelation: function (val) {
72
+      let that = this
73
+      setTimeout(function () {
74
+          if(that.$store.state.relation && that.$store.state.relation == 'house'){
75
+            that.$refs.userManageTree.setCurrentKey(that.$store.state.houseId)
76
+          }else if(that.$store.state.relation && that.$store.state.relation == 'library'){
77
+            that.$refs.userManageTree.setCurrentKey(that.$store.state.depotId)
78
+          }
79
+      }, 1000);
61
     },
80
     },
62
   },
81
   },
63
   created() {},
82
   created() {},