|
@@ -84,32 +84,33 @@ import {
|
|
|
} from "@/api/scan/request";
|
|
|
|
|
|
|
|
|
-import tools from "@/utils/scan/tools";
|
|
|
+import tools from "@/utils/scan/tools"
|
|
|
import handsonUtils from "@/utils/hasontableUtils"
|
|
|
import showTools from "@/utils/handsontable/notShow"
|
|
|
import text from "@/utils/handsontable/mainText"
|
|
|
-import myCascader from "@/components/ledger/lib/cascader";
|
|
|
+import myCascader from "@/components/ledger/lib/cascader"
|
|
|
+import buildFloor from '@/utils/handsontable/buildFloorData'
|
|
|
|
|
|
-import qrcode from "@/components/ledger/lib/qrcode";
|
|
|
-import firm from "@/components/dialogs/list/firm";
|
|
|
-import supplyDialog from "@/components/dialogs/list/supplyDialog";
|
|
|
-import supplierDialog from "@/components/dialogs/list/supplierDialog";
|
|
|
-import maintainerDialog from "@/components/dialogs/list/maintainerDialog";
|
|
|
-import insurerDialog from "@/components/dialogs/list/insurerDialog";
|
|
|
-import guaranteeDialog from "@/components/dialogs/list/guaranteeDialog";
|
|
|
-import uploadFilesDialog from "@/components/dialogs/list/filesDialog";
|
|
|
-import uploadImgDialog from "@/components/dialogs/list/uploadImgDialog";
|
|
|
+import qrcode from "@/components/ledger/lib/qrcode"
|
|
|
+import firm from "@/components/dialogs/list/firm"
|
|
|
+import supplyDialog from "@/components/dialogs/list/supplyDialog"
|
|
|
+import supplierDialog from "@/components/dialogs/list/supplierDialog"
|
|
|
+import maintainerDialog from "@/components/dialogs/list/maintainerDialog"
|
|
|
+import insurerDialog from "@/components/dialogs/list/insurerDialog"
|
|
|
+import guaranteeDialog from "@/components/dialogs/list/guaranteeDialog"
|
|
|
+import uploadFilesDialog from "@/components/dialogs/list/filesDialog"
|
|
|
+import uploadImgDialog from "@/components/dialogs/list/uploadImgDialog"
|
|
|
import picDialog from "@/components/dialogs/list/picDialog"
|
|
|
import systemType from "@/components/dialogs/list/systemType"
|
|
|
-import myPagination from "@/components/ledger/lib/myPagination";
|
|
|
+import myPagination from "@/components/ledger/lib/myPagination"
|
|
|
import detailsDialog from "@/components/ledger/lib/detailsDia"
|
|
|
import changeRea from "@/components/dialogs/changeRea"
|
|
|
-import { mapGetters, mapActions } from "vuex";
|
|
|
+import { mapGetters, mapActions } from "vuex"
|
|
|
//图片查看
|
|
|
import lookPic from "@/components/ledger/lib/lookImages"
|
|
|
import Handsontable from "handsontable-pro"
|
|
|
import 'handsontable-pro/dist/handsontable.full.css'
|
|
|
-import zhCN from 'handsontable-pro/languages/zh-CN';
|
|
|
+import zhCN from 'handsontable-pro/languages/zh-CN'
|
|
|
//下拉插件
|
|
|
// import "@/assets/js/chosen.jquery.min";
|
|
|
// import "@/assets/js/handsontable-chosen-editor";
|
|
@@ -134,12 +135,14 @@ export default {
|
|
|
lookPic,
|
|
|
myCascader
|
|
|
},
|
|
|
- created() { },
|
|
|
+ created() {
|
|
|
+ buildFloor.getData(this.buildFloorData)
|
|
|
+ },
|
|
|
computed: {
|
|
|
...mapGetters("layout", ["projectId", "secret", "userId"]),
|
|
|
showTypes() {
|
|
|
return this.onlyRead ?
|
|
|
- [{ value: "all", label: '全部' }, { value: "Visible", label: '只看采集信息' }] :
|
|
|
+ [{ value: "Visible", label: '只看采集信息' }, { value: "all", label: '全部' }] :
|
|
|
[{ value: "partInfo", label: '隐藏信息点' }, { value: "all", label: '全部' }, { value: "Visible", label: '只看采集信息' }]
|
|
|
}
|
|
|
},
|
|
@@ -152,6 +155,7 @@ export default {
|
|
|
value: false,
|
|
|
label: '编辑模式'
|
|
|
}],
|
|
|
+ buildFloorData: [], //楼层数据
|
|
|
tableData: [],
|
|
|
mess: {},
|
|
|
tableHeader: null,
|
|
@@ -243,7 +247,14 @@ export default {
|
|
|
}
|
|
|
getEquipTableCon(param, res => {
|
|
|
this.loading = false;
|
|
|
- this.tableData = res.Content;
|
|
|
+ this.tableData = res.Content.map((item) => {
|
|
|
+ if (item.hasOwnProperty("BuildingId") && item.hasOwnProperty("FloorId")) {
|
|
|
+ item.flowBuild = item.BuildingId + "-" + item.FloorId
|
|
|
+ } else if (item.hasOwnProperty("BuildingId") && !item.hasOwnProperty("FloorId")) {
|
|
|
+ item.flowBuild = item.BuildingId
|
|
|
+ }
|
|
|
+ return item
|
|
|
+ });
|
|
|
this.copyMain = tools.deepCopy(this.tableData);
|
|
|
this.page.total = res.Total;
|
|
|
if (this.tableData && this.tableData.length) {
|
|
@@ -384,6 +395,9 @@ export default {
|
|
|
let arr = tools.copyArr(list)
|
|
|
let data = showTools.headerTextFilter(arr, 'equipment', this.onlyRead, this.showType, true)
|
|
|
data.unshift("操作", "当前关联的资产", "所属系统实例", "包含的部件");
|
|
|
+ if (this.showType == "all") {
|
|
|
+ data.splice(6, 0, "所属建筑楼层")
|
|
|
+ }
|
|
|
return data;
|
|
|
},
|
|
|
//格式化表内容
|
|
@@ -410,9 +424,15 @@ export default {
|
|
|
renderer: tools.lookDetails
|
|
|
}
|
|
|
);
|
|
|
- if (this.onlyRead) {
|
|
|
- data.map(item => {
|
|
|
- item.readOnly = true
|
|
|
+ if (this.showType == "all") {
|
|
|
+ data.splice(6, 0, {
|
|
|
+ data: "flowBuild",
|
|
|
+ renderer: tools.customDropdownRenderer,
|
|
|
+ editor: "chosen",
|
|
|
+ chosenOptions: {
|
|
|
+ data: this.buildFloorData
|
|
|
+ },
|
|
|
+ readOnly: this.onlyRead
|
|
|
})
|
|
|
}
|
|
|
return data;
|
|
@@ -555,6 +575,10 @@ export default {
|
|
|
//生成要修改字段列表
|
|
|
change.map(item => {
|
|
|
let key = item[1].split(".")[0]
|
|
|
+ if (key == "flowBuild" && keyList.indexOf(key) == -1) {
|
|
|
+ keyList.push("BuildingId","FloorId")
|
|
|
+ param.Projection.push("BuildingId","FloorId")
|
|
|
+ }
|
|
|
if (item[1] && keyList.indexOf(key) == -1 && item[1] != 'PropertyId') {
|
|
|
keyList.push(key);
|
|
|
}
|
|
@@ -565,8 +589,26 @@ export default {
|
|
|
//生成对应修改数据
|
|
|
data.map((item, index) => {
|
|
|
keyList.map(value => {
|
|
|
- let itemData = tools.dataForKey(item, value);
|
|
|
- tools.setDataForKey(item, value, itemData == "" ? null : itemData);
|
|
|
+ if (value == "BuildingId") {
|
|
|
+ let itemData = tools.dataForKey(item, "flowBuild")
|
|
|
+ if (itemData == "") {
|
|
|
+ tools.setDataForKey(item, "BuildingId", null)
|
|
|
+ tools.setDataForKey(item, "FloorId", null)
|
|
|
+ } else {
|
|
|
+ let BuildingId = itemData.split("-")[0]
|
|
|
+ let FloorId = itemData.split("-")[1]
|
|
|
+ if (BuildingId && FloorId) {
|
|
|
+ tools.setDataForKey(item, "BuildingId", BuildingId)
|
|
|
+ tools.setDataForKey(item, "FloorId", FloorId)
|
|
|
+ } else if (BuildingId && !FloorId) {
|
|
|
+ tools.setDataForKey(item, "BuildingId", BuildingId)
|
|
|
+ tools.setDataForKey(item, "FloorId", null)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ let itemData = tools.dataForKey(item, value)
|
|
|
+ tools.setDataForKey(item, value, itemData == "" ? null : itemData)
|
|
|
+ }
|
|
|
});
|
|
|
param.Content.push(item);
|
|
|
});
|