Browse Source

业务表格接口替换(缺添加接口,添加逻辑需看旧代码)

zhangyu 5 years ago
parent
commit
4eeb44c461

+ 147 - 277
src/components/business_space/business/handsontable.vue

@@ -1,10 +1,16 @@
 <template>
   <div id="handsontable" v-loading="isLoading">
-    <div style="overflow:hidden;margin-bottom:10px;margin-right:20px;height:50px;">
-      <el-button @click="undo" style="float:right;margin-top:5px;margin-left:10px;">撤回</el-button>
-      <el-button @click="reset" style="float:right;margin-top:5px;">刷新</el-button>
-      <el-button @click="addSp" style="float:right;margin-top:5px;">添加</el-button>
-    </div>
+		<el-row class="left">
+      <el-select v-model="onlyRead" @change="getData(false)" style="width:100px;margin-right:20px;vertical-align:bottom;">
+        <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value"></el-option>
+      </el-select>
+      <el-select v-model="showType" @change="initHot" style="width:100px;margin-right:10px;vertical-align:bottom;">
+        <el-option v-for="item in showTypes" :key="item.value" :label="item.label" :value="item.value"></el-option>
+      </el-select>
+      <el-button v-show="!onlyRead" @click="addSp">添加</el-button>
+			<el-button @click="reset">刷新</el-button>
+			<el-button v-show="!onlyRead" @click="undo">撤销</el-button>
+    </el-row>
     <div v-show="main &&main.length" :id="id"></div>
     <div class="center" v-show="!main || !main.length" style="height: 400px;padding-top:140px;box-sizing:border-box;">
       <i class="iconwushuju iconfont"></i>
@@ -30,18 +36,21 @@ import "@/assets/js/handsontable-chosen-editor";
 import myPagination from "@/components/common/myPagination";
 import addBusiness from "@/components/business_space/dialogs/addDialog/businessDialog"
 import showTools from "@/utils/handsontable/notShow"
+import handsonUtils from "@/utils/hasontableUtils"
 import Handsontable from "handsontable-pro"
 import 'handsontable-pro/dist/handsontable.full.css'
 import zhCN from 'handsontable-pro/languages/zh-CN';
 import qrcode from "@/components/ledger/lib/qrcode";
-console.log(Handsontable, "Handsontable")
-import { updateBusiness, queryZone, createBusiness, createBusinessList, delManySpace, isSpaceBuss } from "@/api/scan/request";
+import { updateBusiness, queryZone, updateZone, deleteZone, createBusiness, createBusinessList, delManySpace, isSpaceBuss } from "@/api/scan/request";
 import { mapGetters, mapActions } from "vuex";
 export default {
   props: {
     id: {
       type: String
-    }
+		},
+		zoneObj: {
+			type: Object
+		}
   },
   components: {
     qrcode, //二维码页面
@@ -49,7 +58,12 @@ export default {
     addBusiness
   },
   computed: {
-    ...mapGetters("layout", ["projectId", "secret", "userId"])
+		...mapGetters("layout", ["projectId", "secret", "userId"]),
+		showTypes () {
+      return this.onlyRead?
+        [{value: "Visible", label: '只看采集信息'}, {value: "all", label: '全部'}]: 
+        [{value: "partInfo", label: '隐藏信息点'}, {value: "Visible", label: '只看采集信息'}, {value: "all", label: '全部'} ]
+    }
   },
   data() {
     return {
@@ -59,17 +73,18 @@ export default {
       },
       qrcodeUrl: "",//二维码图片地址
       headers: null,
-      main: null,
+      main: [],
       hot: null,
-      tableData: [],
       isLoading: true,
-      allData: null,
-      // page: {
-      //   size: 50,
-      //   sizes: [10, 30, 50, 100, 150, 200],
-      //   total: 2,
-      //   currentPage: 1
-      // },
+			options: [{
+        value: true,
+        label: '只读模式'
+      }, {
+        value: false,
+        label: '编辑模式'
+      }],
+			onlyRead: true,
+			showType: "",
       page: {
         pageSize: 50,
         pageSizes: [10, 20, 50, 100],
@@ -83,7 +98,7 @@ export default {
       },
       buildMess: null,
       filtersArr: [], //表格数据被过滤后的下标
-      copyMain: null, //深拷贝数组
+      copyMain: [], //深拷贝数组
       activeType: {}
     };
   },
@@ -104,46 +119,35 @@ export default {
     },
     getData(buildMess) {
       if (buildMess) {
-        this.buildMess = buildMess;
+        this.buildMess = buildMess
 			}
-			// debugger
-      // let params = {
-      //   Filters: this.cenoteId ? `ProjectId='${this.projectId}';structureInfo.ShaftFuncType='${this.cenoteId}'` : `ProjectId='${this.projectId}'`,
-      //   Orders: "createTime desc, RoomID asc",
-      //   PageNumber: this.page.pageNumber,
-      //   PageSize: this.page.pageSize
-      // }
-      let param = {
-        id: this.buildMess.code,
-        type: ["Sp"],
-        data: {
-          customInfo: true,
-          criteria: {
-            floor: this.buildMess.code, // 必填, 指定楼层id
-            business_type: this.activeType.code, // 必填, 楼层下某个类型的业务空间PowerSupplyZone, 默认是空字符串
-            rel_type: this.activeType.rel_type, // 必填, 指定业务类型的关系类型(参考数据平台),
-            // 数字型字符串, 例如: 通用是99
-          }
-        },
-        ProjId: this.param.ProjId,
-        secret: this.param.secret
-      };
-      isSpaceBuss(param).then(res => {
-        if (res.data.Result == "success") {
-          this.allData = res.data.Content;
-          this.page.total = res.data.Count;
-          this.getMain(this.allData);
-        } else {
-          this.$message.error("请求错误");
-        }
-      });
+      let params = {
+				zone: this.zoneObj.code,
+				data: {
+					Filters: ``,
+					Orders: "createTime desc, RoomID asc",
+					PageNumber: this.page.pageNumber,
+					PageSize: this.page.pageSize
+				}
+			}
+			if (this.buildMess.selectd && this.buildMess.selectd[0] && this.buildMess.selectd[1]) {
+				params.data.Filters = `BuildingId='${this.buildMess.selectd[0]}';FloorId='${this.buildMess.selectd[1]}'`
+			} else if (this.buildMess.selectd && this.buildMess.selectd[0] && !this.buildMess.selectd[1]) {
+				params.data.Filters = `BuildingId='${this.buildMess.selectd[0]}'`
+			} else {
+				params.data.Filters = `BuildingId='';FloorId=''`
+			}
+			queryZone(params, res => {
+				this.page.total = res.Total
+				this.main = res.Content
+				if (this.main && this.main.length && this.main[0].RoomID) {
+					this.copyMain = tools.deepCopy(this.main);
+				}
+				this.getMain()
+			})
     },
     //获取表格主体内容
-    getMain(main) {
-      this.main = main;
-      if (this.main && this.main.length && this.main[0].id) {
-        this.copyMain = tools.deepCopy(this.main);
-      }
+    getMain() {
       this.isLoading = true;
       if (!!this.hot) {
         this.hot.destroy();
@@ -156,7 +160,6 @@ export default {
     //初始化handsontable组件
     initHot() {
       let id = this.id
-      console.log(id)
       var container = document.getElementById(this.id);
       let winHeight = document.documentElement.clientHeight;
       this.hot = new Handsontable(container, {
@@ -188,7 +191,7 @@ export default {
         // 事件
         afterChange: this.tdChange, //修改后
         afterFilter: this.trimmedRows, //排序前
-        beforeRemoveRow: this.romoveFm, //右键删除
+        afterRemoveRow: this.romoveFm, //右键删除
         afterOnCellMouseDown: this.eventClick //鼠标点击
       });
       let pro = document.getElementById("hot-display-license-info");
@@ -227,8 +230,8 @@ export default {
       let val = this.hot.colToProp(row.col);
       if (val == "point") {
         this.$emit("lookEqu", infos);
-      } else if (val == "infos.RoomQRCode") {
-        this.qrcodeUrl = this.main[row.row].infos.RoomQRCode
+      } else if (val == "RoomQRCode") {
+        this.qrcodeUrl = this.main[row.row].RoomQRCode
         if (!!this.qrcodeUrl) {
           this.dialog.qrcode = true;
         } else {
@@ -240,68 +243,52 @@ export default {
     },
     //表格发生更改
     tdChange(changeData, source) {
-      let filter = this.filtersArr;
-      if (changeData) {
-        let param = this.getParam(changeData, source);
-        let data = [];
-        for (let i = 0; i < param.length; i++) {
-          if (!!param[i].id) {
+			if (!this.onlyRead) {
+        if (changeData) {
+          let trimmedArr = this.trimmedRows();
+          let param = handsonUtils.getParam(changeData, source, this.hot, trimmedArr);
+          let data = []
+          for (let i = 0; i < param.length; i++) {
             data.push(param[i]);
-          } else {
-            this.createSq(param[i], changeData);
           }
-        }
-        if (data && data.length) {
-          this.updateBusiness(data, changeData);
+          //如果data中包含/且data长度为1,将其转换成.
+          if (changeData.length == 1 && changeData[0][1].indexOf("/") > 0) {
+            changeData[0][1] = changeData[0][1].split("/").join(".")
+          }
+
+          // 存在data进行修改请求
+          if (data && data.length) {
+            this.updateBusiness(data, changeData)
+          }
         }
       }
     },
     //右键删除
-    romoveFm(index, amout, physicalRows, source) {
-      if (physicalRows && physicalRows.length) {
-        let items = [],
-          text = null;
-        physicalRows.map(item => {
-          text = text ?
-            this.copyMain[item].infos.RoomName + "、" + text :
-            this.copyMain[item].infos.RoomName;
-          items.push(this.copyMain[item].id);
-        });
-        this.$confirm("您正在删除" + text + ", 是否继续?", "提示", {
-          confirmButtonText: "确定",
-          cancelButtonText: "取消",
-          type: "warning"
-        })
-          .then(() => {
-            this.delBusiness(items);
-          })
-          .catch(() => {
-            this.hot.loadData(tools.deepCopy(this.copyMain));
-          });
+    romoveFm() {
+			let params = tools.differenceArr(this.main, this.copyMain)
+      if (params.length < 1 || this.main > this.copyMain) {
+        return
       }
-    },
-    delBusiness(items) {
       let param = {
-        ProjId: this.param.ProjId,
-        secret: this.param.secret,
-        data: {
-          criteria: {
-            ids: items
-          }
-        }
-      };
-      delManySpace(param)
-        .then(res => {
-          if (res.data.Result == "success") {
-            this.$message.success("删除成功");
-            this.getData();
-          } else {
-            this.$message.error("删除失败");
-          }
-        })
-        .catch(() => {
-          this.$message.error("请求发生错误");
-        });
+				data: [],
+				zone: this.zoneObj.code
+			}
+      params.map(item => {
+        param.data.push({RoomID: item.RoomID})
+      })
+      this.$confirm("此操作将删除业务空间,是否继续?", "提示", {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(() => {
+        deleteZone(param, res => {
+					this.$message.success("删除成功!")
+        	this.getData()
+				})
+      }).catch(() => {
+        this.getData()
+        this.$message("取消删除")
+      })
     },
     // 新建
     createSq(param, change) {
@@ -321,28 +308,28 @@ export default {
     },
     // 修改
     updateBusiness(data, change) {
-      let param = {
-        ProjId: this.param.ProjId,
-        secret: this.param.secret,
-        data: {
-          criterias: []
-        }
+			let param = {
+				data: {
+					Content: [],
+        	Projection: []
+				},
+        zone: this.zoneObj.code
       };
+      //生成要修改字段列表
+      change.map((item) => {
+        if(item[1] && param.data.Projection.indexOf(item[1]) == -1) {
+          param.data.Projection.push(item[1])
+        }
+      })
+      //生成对应修改数据
       data.map((item, index) => {
-        console.log(change[index][1]);
-        let arr = change[index][1].split(".");
-        let info = {};
-        info[arr[1]] = [{
-          value: change[index][3] != "" ? change[index][3] : null
-        }];
-        param.data.criterias.push({
-          id: item.id,
-          infos: info
-        });
-      });
-      updateBusiness(param).then(res => {
-        console.log(res);
-      });
+        param.data.Projection.map(value => {
+          let itemData = tools.dataForKey(item, value)
+          tools.setDataForKey(item, value, itemData == "" ? null : itemData)
+        })
+        param.data.Content.push(item);
+			})
+			updateZone(param, (res) => {})
     },
     /**    请求部分 ------------------------------------ */
     createSpace(data) {
@@ -370,43 +357,6 @@ export default {
         }
       });
     },
-    /**
-     * 获取被排序后的数组
-     *
-     * @param changeData 发生改变的数据
-     * @param source     数组
-     *
-     * @return array     经过排序后或者经过搜索后的数组
-     */
-    getParam(changeData, source) {
-      let param = "";
-      //被筛选过后的数组
-      let trimmedArr = this.trimmedRows();
-      //是否启用了排序
-      let isSort = this.hot.getPlugin("columnSorting").isSorted();
-      if (trimmedArr.length && isSort) {
-        //排序后的数组
-        let sortArr = this.hot.getPlugin("columnSorting").rowsMapper.__arrayMap;
-        param = changeData.map(item => {
-          return this.hot.getSourceDataAtRow(trimmedArr[sortArr[item[0]]]);
-        });
-      } else if (isSort) {
-        //排序后的数组
-        let sortArr = this.hot.getPlugin("columnSorting").rowsMapper.__arrayMap;
-        param = changeData.map(item => {
-          return this.hot.getSourceDataAtRow(sortArr[item[0]]);
-        });
-      } else if (trimmedArr.length) {
-        param = changeData.map(item => {
-          return this.hot.getSourceDataAtRow(trimmedArr[item[0]]);
-        });
-      } else {
-        param = changeData.map(item => {
-          return this.hot.getSourceDataAtRow(item[0]);
-        });
-      }
-      return param;
-    },
     //获取被筛选掉的行号
     trimmedRows() {
       // var plugin = hot.getPlugin('trimRows').trimmedRows;//获取被筛选掉的行号
@@ -449,15 +399,8 @@ export default {
      */
     delHeader(list) {
       let arr = tools.copyArr(list)
-      // 如果不是只读状态,添加四大厂商选择
-      let readArr = ["A1", "A2", "B1", "C5", "D1", "D2", "X", "L", "L1", "L2", "F1", "F2", "M"]
-      if (!this.onlyRead) {
-        arr = showTools.arrToArr(arr)
-        readArr.push("Own")
-      }
-      let data = showTools.changeHeader(arr, readArr, false, false, true, false, true)
+      let data = showTools.headerTextFilter(arr, "space", this.onlyRead, this.showType)
       data.unshift("是否关联平面图", "与空间相关联的设备");
-      console.log("header", data)
       return data;
     },
     /**
@@ -467,19 +410,17 @@ export default {
      * @return 处理好的数据格式
      */
     getType(list) {
-      let arr = tools.copyArr(list)
-      let data = showTools.showTypes(arr, false, false, true, false)
+			let arr = tools.copyArr(list)
+			let data = showTools.headerTypeFilter(arr, "space", this.onlyRead, this.showType)
       data.unshift({
         data: "hasSi",
         renderer: this.myRenderer,
         readOnly: true
       }, {
-          data: "point",
-          renderer: this.facilityRender,
-          readOnly: true
-        });
-      data = data.filter(item => item);
-      console.log(data)
+				data: "point",
+				renderer: this.facilityRender,
+				readOnly: true
+			});
       return data;
     },
     myRenderer(instance, td, row, col, prop, value, cellProperties) {
@@ -496,97 +437,22 @@ export default {
       td.innerHTML = "点击查看";
       return td;
     },
-    //下拉插件修改
-    // customDropdownRenderer(
-    //   instance,
-    //   td,
-    //   row,
-    //   col,
-    //   prop,
-    //   value,
-    //   cellProperties
-    // ) {
-    //   var selectedId;
-    //   var optionsList = cellProperties.chosenOptions.data;
-    //   if (
-    //     typeof optionsList === "undefined" ||
-    //     typeof optionsList.length === "undefined" ||
-    //     !optionsList.length
-    //   ) {
-    //     Handsontable.renderers.TextRenderer(
-    //       instance,
-    //       td,
-    //       row,
-    //       col,
-    //       prop,
-    //       value,
-    //       cellProperties
-    //     );
-    //     return td;
-    //   }
-    //   var values = (value + "").split(",");
-    //   value = [];
-    //   for (var index = 0; index < optionsList.length; index++) {
-    //     if (optionsList[index].content && optionsList[index].content.length) {
-    //       for (let i = 0; i < optionsList[index].content.length; i++) {
-    //         if (
-    //           optionsList[index].content[i] &&
-    //           optionsList[index].content[i].length
-    //         ) {
-    //           for (let j = 0; j < optionsList[index].content[i].length; j++) {
-    //             if (
-    //               values.indexOf(
-    //                 optionsList[index].content[i].content[j].code + ""
-    //               ) > -1
-    //             ) {
-    //               selectedId = optionsList[index].content[i].content[j].code;
-    //               value.push(optionsList[index].content[i].content[j].name);
-    //             }
-    //           }
-    //         } else {
-    //           if (
-    //             values.indexOf(optionsList[index].content[i].code + "") > -1
-    //           ) {
-    //             selectedId = optionsList[index].content[i].code;
-    //             value.push(optionsList[index].content[i].name);
-    //           }
-    //         }
-    //       }
-    //     } else {
-    //       if (values.indexOf(optionsList[index].code + "") > -1) {
-    //         selectedId = optionsList[index].code;
-    //         value.push(optionsList[index].name);
-    //       }
-    //     }
-    //   }
-    //   value = value.join(", ");
-    //   Handsontable.renderers.TextRenderer(
-    //     instance,
-    //     td,
-    //     row,
-    //     col,
-    //     prop,
-    //     value,
-    //     cellProperties
-    //   );
-    //   return td;
-    // },
     /**  页面中的按钮事件--------------------------- */
     addSp() {
       //   this.dialog.addDevice = true
       //   this.hot.downloadFile()
       //   this.hot.getPlugin('exportFile').downloadFile("csv", { columnHeaders: true, exportHiddenRows: true, exportHiddenColumns: true, rowHeaders: true })
-      if (this.main && this.main.length && !!this.main[0].id) {
+      if (this.main && this.main.length && !!this.main[0].RoomID) {
         this.hot.destroy();
         this.hot = null;
         this.main.unshift([]);
-        this.getMain(this.main);
+        this.getMain();
       } else {
         if (this.main && this.main.length) {
           this.$message.error("请添加完成后继续添加");
         } else {
           this.main.unshift([]);
-          this.getMain(this.main);
+          this.getMain();
         }
       }
     },
@@ -608,29 +474,33 @@ export default {
     handleCurrentChange(val) {
       this.page.pageNumber = val
       this.getData()
-    },
-    // pageChange() {
-    //   this.getMain(
-    //     this.pagination(this.page.currentPage, this.page.size, this.allData)
-    //   );
-    // },
-    // pagination(pageNo, pageSize, array) {
-    //   let offset = (pageNo - 1) * pageSize;
-    //   return offset + pageSize >= array.length ?
-    //     array.slice(offset, array.length) :
-    //     array.slice(offset, offset + pageSize);
-    // }
+    }
   },
   watch: {
     projectId() {
       this.setData()
       this.main = null
+		},
+		showTypes: {
+      handler(newName, oldName) {
+        if (newName && newName[0] && newName[0].value) {
+          this.showType = newName[0].value
+        } else {
+          this.showType = ""
+        }
+      },
+      immediate: true,
+      deep: true
     }
   }
 };
 </script>
 <style lang="less" scoped>
 #handsontable {
+	.left{
+		padding-top: 0;
+		padding-bottom: 10px;
+	}
   .no-data {
     height: 150px;
     line-height: 150px;

+ 1 - 1
src/components/business_space/dialogs/facilityDialog.vue

@@ -20,7 +20,7 @@
       </span>
     </span>
     <div id="detailsDialog" v-show="step == 1">
-      <p class="influence-p">{{data.infos.RoomLocalName || data.infos.RoomName || '--'}}</p>
+      <p class="influence-p">{{data.RoomLocalName || data.RoomName || '--'}}</p>
       <equip-table :activeTabType="activeTabType" ref="myEquip" :param="myDia"></equip-table>
     </div>
     <div v-show="step == 1">

+ 3 - 4
src/components/business_space/graphy/business.vue

@@ -479,7 +479,6 @@
                             } else {
                                 _this.$message("没有元空间数据")
                             }
-                            console.log(ids,'ids')
                             if(!!ids && ids.length){
                                 _this.bimIdToId(ids, data);
                             }else{
@@ -1259,9 +1258,9 @@
 <style lang="less">
     .canvasGraphy {
         position: relative;
-        canvas {
-            border: 1px solid #ccc;
-        }
+        // canvas {
+        //     border: 1px solid #ccc;
+        // }
         .header-search {
             position: absolute;
             top: 0;

+ 6 - 6
src/components/business_space/table/equipTable.vue

@@ -125,7 +125,7 @@
                             count: this.page.size // 查询跳过300条数据之后的50条 (默认按照创建时间从大-->小排序)
                         },
                         criteria: {
-                            space: this.data.id, // 必填, 指定业务空间id
+                            space: this.data.RoomID, // 必填, 指定业务空间id
                             type: ["Eq"] // 必填, 查询类型, 允许四位编码的详细设备类
                         }
                     },
@@ -192,7 +192,7 @@
                         criteria: {
                             graphType: this.activeRelation,
                             relType: this.relType,
-                            toId: this.data.id,
+                            toId: this.data.RoomID,
                             fromId: this.data.fromId,
                             type: ["Eq"]
                         }
@@ -214,7 +214,7 @@
                     data: {
                         criterias: [{
                             from_id: row.id, //选填
-                            to_id: this.data.id, //选填
+                            to_id: this.data.RoomID, //选填
                             graph_id: this.graphyId, //选填
                             rel_type: this.relType
                         }]
@@ -299,7 +299,7 @@
                             count: this.page.size // 查询跳过300条数据之后的50条 (默认按照创建时间从大-->小排序)
                         },
                         criteria: {
-                            space: this.data.id, // 必填, 指定业务空间id
+                            space: this.data.RoomID, // 必填, 指定业务空间id
                             type: ["Eq"] // 必填, 查询类型, 允许四位编码的详细设备类
                         }
                     },
@@ -360,7 +360,7 @@
     };
 </script>
 <style>
-    .el-table tr th {
+    /* .el-table tr th { */
         /* background: #fafafa !important; */
-    }
+    /* } */
 </style>

+ 32 - 26
src/components/ledger/lib/floorCascader.vue

@@ -79,8 +79,18 @@
                         "FloorSequenceID"
                     ]
                 }
-                buildingQuery(buildParams, res => {
-                    let builData = res.Content
+                let promise1 = new Promise((resolve, reject) => {
+                    buildingQuery(buildParams, res => {
+                        resolve(res)
+                    })
+                })
+                let promise2 = new Promise((resolve, reject) => {
+                    floorQuery(floorParams, res => {
+                        resolve(res)
+                    })
+                })
+                Promise.all([promise1, promise2]).then(values => {
+                    let builData = values[0].Content, floorData = values[1].Content
                     data = builData.map(build => {
                         return {
                             value: build.BuildID,
@@ -94,33 +104,29 @@
                         value: "noKnow",
                         label: "未明确建筑的设备"
                     })
-                    floorQuery(floorParams, res => {
-                        // let floorData = tools.sortArr(res.Content, "FloorSequenceID", false) //对楼层排序
-                        let floorData = res.Content
-                        data.forEach(build => {
-                            floorData.forEach(floor => {
-                                if (build.value == floor.BuildID && floor.FloorID && floor.FloorLocalName && this.type == "yes") {
-                                    if (build.children) {
-                                        build.children.push({
-                                            value: floor.FloorID,
-                                            label: floor.FloorLocalName,
-                                            FloorSequenceID: floor.FloorSequenceID
-                                        })
-                                    } else {
-                                        build.children = []
-                                        build.children.push({
-                                            value: "all",
-                                            label: "全部"
-                                        },{
-                                            value: 'noKnow',
-                                            label: "未明确楼层的设备"
-                                        })
-                                    }
+                    data.forEach(build => {
+                        floorData.forEach(floor => {
+                            if (build.value == floor.BuildID && floor.FloorID && floor.FloorLocalName && this.type == "yes") {
+                                if (build.children) {
+                                    build.children.push({
+                                        value: floor.FloorID,
+                                        label: floor.FloorLocalName,
+                                        FloorSequenceID: floor.FloorSequenceID
+                                    })
+                                } else {
+                                    build.children = []
+                                    build.children.push({
+                                        value: "all",
+                                        label: "全部"
+                                    },{
+                                        value: 'noKnow',
+                                        label: "未明确楼层的设备"
+                                    })
                                 }
-                            })
+                            }
                         })
-                        this.options = data
                     })
+                    this.options = data
                 })
             },
             //改变item

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

@@ -32,7 +32,7 @@ const buildFloor = {
       })
     })
 
-    return Promise.all([promise1, promise2]).then(function(values) {
+    Promise.all([promise1, promise2]).then(function(values) {
       let builData = values[0].Content, floorData = values[1].Content
       data = builData.map(build => {
           return {

+ 8 - 2
src/utils/handsontable/notShow.js

@@ -967,7 +967,10 @@ const showTools = {
         }
     },
     textFormat(item, onlyRead) {
-        if (item.InfoPointCode == "EquipQRCode") {
+        if (
+            item.InfoPointCode == "EquipQRCode" ||
+            item.InfoPointCode == "RoomQRCode"
+        ) {
             return {
                 data: item.Path,
                 renderer: text.lookQRCode,
@@ -1061,7 +1064,10 @@ const showTools = {
         }
     },
     inputModeFilter(item, onlyRead) {
-        if (item.InfoPointCode == "EquipQRCode") {
+        if (
+            item.InfoPointCode == "EquipQRCode" ||
+            item.InfoPointCode == "RoomQRCode"
+        ) {
             return {
                 data: item.Path,
                 renderer: text.lookQRCode,

+ 5 - 2
src/views/business_space/business_list/index.vue

@@ -53,8 +53,7 @@
         <template v-for="(item,index) in tabsList">
           <el-tab-pane :name="item.code" :key="index" :disabled="item.code > 3">
             <span slot="label">{{item.name}}</span>
-            <handsontable-main @lookEqu="lookEqu" :ref="'handsontable' + item.code" :id="'handsontable' + item.code"
-              :param="param"></handsontable-main>
+            <handsontable-main @lookEqu="lookEqu" :ref="'handsontable' + item.code" :zoneObj="item" :id="'handsontable' + item.code" :param="param"></handsontable-main>
           </el-tab-pane>
         </template>
       </el-tabs>
@@ -480,9 +479,13 @@ export default {
     overflow: hidden;
     overflow-y: auto;
     background: #fff;
+    padding: 10px;
     .el-tabs__nav {
       padding-left: 10px;
     }
+    .el-tabs__header{
+      margin-bottom: 10px;
+    }
     .el-tabs__active-bar {
       padding-left: 24px;
     }

+ 9 - 23
src/views/ledger/cenotelist/index.vue

@@ -6,25 +6,11 @@
     <el-row class="left">
       <span style="float:right;">当前筛选条件下共{{page.total || '--'}}竖井</span>
       <el-select v-model="onlyRead" @change="getTableHeader" style="width:100px;margin-right:20px;vertical-align:bottom;">
-        <el-option
-          v-for="item in options"
-          :key="item.value"
-          :label="item.label"
-          :value="item.value">
-        </el-option>
+        <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value"></el-option>
       </el-select>
       <el-select v-model="showType" @change="initTable" style="width:100px;margin-right:10px;vertical-align:bottom;">
-        <el-option
-          v-for="item in showTypes"
-          :key="item.value"
-          :label="item.label"
-          :value="item.value">
-        </el-option>
+        <el-option v-for="item in showTypes" :key="item.value" :label="item.label" :value="item.value"></el-option>
       </el-select>
-      <!-- <div v-show="onlyRead" style="width:200px;display:inline-block;text-align:left;color:gray;font-size:12px;">
-        <span>只看要采集的信息</span>
-        <el-checkbox v-model="allMess" @change="getTableHeader"></el-checkbox>
-      </div> -->
       <el-button @click="handleCreateTableData">添加竖井</el-button>
       <el-button @click="getTableHeader">刷新</el-button>
       <el-button v-show="!onlyRead" @click="undo">撤销</el-button>
@@ -122,8 +108,8 @@ export default {
     ]),
     showTypes () {
       return this.onlyRead?
-        [{value: "all", label: '全部'}, {value: "Visible", label: '只看采集信息'}]: 
-        [{value: "all", label: '全部'}, {value: "Visible", label: '只看采集信息'}, {value: "partInfo", label: '隐藏信息点'}]
+        [{value: "Visible", label: '只看采集信息'}, {value: "all", label: '全部'}]: 
+        [{value: "partInfo", label: '隐藏信息点'}, {value: "Visible", label: '只看采集信息'}, {value: "all", label: '全部'}]
     }
   },
   created() {
@@ -191,10 +177,10 @@ export default {
       })
       //生成对应修改数据
       data.map((item, index) => {
-        // param.data.Projection.map(value => {
-        //   let itemData = tools.dataForKey(item, value)
-        //   tools.setDataForKey(item, value, itemData == "" ? null : itemData)
-        // })
+        param.Projection.map(value => {
+          let itemData = tools.dataForKey(item, value)
+          tools.setDataForKey(item, value, itemData == "" ? null : itemData)
+        })
         // let keyarr = change[index][1].split(".")
         // if (keyarr && keyarr.length > 1) {
         //   item[keyarr[0]][keyarr[1]] = item[keyarr[0]][keyarr[1]] != ""? item[keyarr[0]][keyarr[1]]: null
@@ -329,7 +315,7 @@ export default {
         },
         // 事件
         afterChange: this.handleUpdataTable, //修改后
-        // afterFilter: this.trimmedRows, //排序前
+        afterFilter: this.trimmedRows, //排序前
         afterRemoveRow: this.handleDeleteTableRow, //右键删除
         afterOnCellMouseDown: this.handleTdClick //鼠标点击
       };

+ 4 - 0
src/views/rent/rentlist/index.vue

@@ -193,6 +193,10 @@ export default {
       })
       //生成对应修改数据
       data.map((item, index) => {
+        param.Projection.map(value => {
+          let itemData = tools.dataForKey(item, value)
+          tools.setDataForKey(item, value, itemData == "" ? null : itemData)
+        })
         // let keyarr = change[index][1].split(".")
         // if (keyarr && keyarr.length > 1) {
         //   item[keyarr[0]][keyarr[1]] = item[keyarr[0]][keyarr[1]] != ""? item[keyarr[0]][keyarr[1]]: null