Browse Source

fix bug systemtype in system

haojianlong 5 years ago
parent
commit
c13542b7bb
2 changed files with 28 additions and 26 deletions
  1. 1 1
      src/components/ledger/handsontables/system.vue
  2. 27 25
      src/views/ledger/system/index.vue

+ 1 - 1
src/components/ledger/handsontables/system.vue

@@ -766,7 +766,6 @@ export default {
           param.data.criterias.push({ id: params[i].id })
         }
         this.removeSys(param)
-        this.getMain()
 
       }).catch(() => {
         this.$message({
@@ -780,6 +779,7 @@ export default {
       await delBatchList(param, res => {
         this.$emit('close','')
         this.$message.success("删除成功")
+        this.getMain()
       })
     },
 

+ 27 - 25
src/views/ledger/system/index.vue

@@ -21,13 +21,13 @@ import myCascader from "@/components/ledger/lib/system";
 import hansonTable from "@/components/ledger/handsontables/system";
 import tableTransfers from "@/components/ledger/tableTransfers";
 import {
-    mapGetters,
-    mapActions
+  mapGetters,
+  mapActions
 } from "vuex";
 import { getAllbusiness, getFamilyList, getSpaceName } from "@/api/scan/request"
 import Handsontable from "handsontable-pro"
-    import 'handsontable-pro/dist/handsontable.full.css'
-    import zhCN from 'handsontable-pro/languages/zh-CN';
+import 'handsontable-pro/dist/handsontable.full.css'
+import zhCN from 'handsontable-pro/languages/zh-CN';
 
 export default {
   components: {
@@ -58,22 +58,22 @@ export default {
     };
   },
   computed: {
-        ...mapGetters("layout", [
-            "projectId",
-            "secret",
-            "userId"
-        ])
-    },
+    ...mapGetters("layout", [
+      "projectId",
+      "secret",
+      "userId"
+    ])
+  },
   created() {
-      this.param.ProjId = this.projectId
-      this.param.secret = this.secret
+    this.param.ProjId = this.projectId
+    this.param.secret = this.secret
     this.getProjName()
   },
-    watch: {
+  watch: {
     projectId() {
-        this.param.ProjId = this.projectId
-        this.param.secret = this.secret
-        this.getProjName()
+      this.param.ProjId = this.projectId
+      this.param.secret = this.secret
+      this.getProjName()
     }
   },
   methods: {
@@ -102,15 +102,17 @@ export default {
       }
       getFamilyList(param, res => {
         if (this.$refs.cascader) {
-              this.$refs.cascader.pushData(res.Content)
-          }
+          this.$refs.cascader.pushData(res.Content)
+        }
       })
     },
     close(val) {
       this.getProjName()
       if (!!val && !!val.code) {
-          if(this.$refs.cascader)
-        this.$refs.cascader.changeVal([val.code])
+        if (this.$refs.cascader) {
+          this.$refs.cascader.setValue([val.code])
+          this.$refs.cascader.getData()
+        }
       }
     },
 
@@ -147,8 +149,8 @@ export default {
         this.param.floorId = null
       }
       if (!!this.param.deviceId) {
-          if(this.$refs.tableMain)
-        this.$refs.tableMain.getHeaderData(this.param);
+        if (this.$refs.tableMain)
+          this.$refs.tableMain.getHeaderData(this.param);
       } else {
         return;
       }
@@ -158,8 +160,8 @@ export default {
     changeDevice(value) {
       this.param.deviceId = value.code
       if (!!value) {
-          if(this.$refs.tableMain)
-        this.$refs.tableMain.getHeaderData(this.param);
+        if (this.$refs.tableMain)
+          this.$refs.tableMain.getHeaderData(this.param);
       } else {
         return;
       }
@@ -186,7 +188,7 @@ export default {
   }
   .search-header {
     overflow: hidden;
-    padding:0 10px 10px 10px;
+    padding: 0 10px 10px 10px;
     border-bottom: 1px solid #bcbcbc;
   }
 }