Browse Source

modify device and noshow filternoshow text

haojianlong 5 years ago
parent
commit
5a88c8b830

+ 17 - 7
src/components/ledger/handsontables/device.vue

@@ -64,7 +64,7 @@
         <my-cascader ref="cascader" @change="changeAddType"></my-cascader>
       </el-row>
       <span slot="footer" class="dialog-footer">
-        <el-button type="primary" @click="addDevice">下 一 步</el-button>
+        <el-button type="primary" @click="toAddDevice">下 一 步</el-button>
       </span>
     </el-dialog>
   </div>
@@ -194,6 +194,7 @@ export default {
       deviceType: {}, //族3位编码及名称
       floorData: [],
       curDevice:'',//当前点击的设备id
+      addData:{}, //添加设备选择的设备类型
     };
   },
   created() { },
@@ -350,19 +351,26 @@ export default {
     },
     //添加设备
     addDevice() {
+      this.myDialog.addDevice = true
       if (this.mess.deviceId) {
+        this.$nextTick(()=>{
+          this.$refs.cascader.setValue([this.mess.deviceId])
+        })
+      } 
+    },
+    //下一步
+    toAddDevice(){
+      if (this.addData.deviceId) {
         this.$router.push({
           path: "/ledger/addevice",
-          query: this.mess
+          query: this.addData
         });
-      } else {
-        this.myDialog.addDevice = true
-      }
+      } 
     },
     //选择设备类型-添加设备
     changeAddType(val) {
-      this.mess.deviceId = val.code;
-      this.mess.name = val.facility;
+      this.addData.deviceId = val.code;
+      this.addData.name = val.facility;
     },
     //下载
     download() {
@@ -583,6 +591,8 @@ export default {
       let val = this.hot.colToProp(row.col);
       this.row = row.row;
       this.messKey = val;
+      console.log(val)
+      return
       switch (val) {
         //操作
         case 'caozuo':

+ 7 - 1
src/utils/handsontable/fillterField.js

@@ -1,7 +1,13 @@
 const data = {
   equipment: { //设备
     onlyRead: [],
-    edit: []
+    edit: [
+      "EquipID",
+      "EquipName",
+      "EquipQRCode",
+      "BIMID",
+      "BIMLocation"
+    ]
   },
   tenant: { //租户
     onlyRead: [],

+ 1 - 1
src/utils/handsontable/notShow.js

@@ -1136,7 +1136,7 @@ const showTools = {
             })
             return falg
         } else {
-            data.onlyRead.map(item => {
+            data.edit.map(item => {
                 if (item == code) {
                     falg = false
                 }