|
@@ -3,7 +3,7 @@
|
|
<div class="hanson-bar">
|
|
<div class="hanson-bar">
|
|
<div style="float:right;overflow:hidden;">
|
|
<div style="float:right;overflow:hidden;">
|
|
<span style="width:20px;float:left;display:block;height:20px;cursor: pointer;" @click="changeAssetsFalg">
|
|
<span style="width:20px;float:left;display:block;height:20px;cursor: pointer;" @click="changeAssetsFalg">
|
|
- <i v-show="!onlyRead" class="el-icon-fa el-icon-fa-compass"></i>
|
|
|
|
|
|
+ <i v-show="!onlyRead" class="el-icon-fa el-icon-fa-eye"></i>
|
|
</span>
|
|
</span>
|
|
<span>当前筛选条件下共{{page.total || '--'}}设备</span>
|
|
<span>当前筛选条件下共{{page.total || '--'}}设备</span>
|
|
</div>
|
|
</div>
|
|
@@ -55,6 +55,7 @@ import tools from "@/utils/scan/tools"
|
|
import handsonUtils from "@/utils/scan/hasontableUtils"
|
|
import handsonUtils from "@/utils/scan/hasontableUtils"
|
|
import showTools from "@/utils/handsontable/notShow"
|
|
import showTools from "@/utils/handsontable/notShow"
|
|
import text from "@/utils/handsontable/mainText"
|
|
import text from "@/utils/handsontable/mainText"
|
|
|
|
+import buildFloorData from '@/utils/handsontable/buildFloorData'
|
|
|
|
|
|
import qrcode from "@/components/business_space/lib/qrcode"
|
|
import qrcode from "@/components/business_space/lib/qrcode"
|
|
import firm from "@/components/business_space/dialogs/list/firm"
|
|
import firm from "@/components/business_space/dialogs/list/firm"
|
|
@@ -160,6 +161,7 @@ export default {
|
|
floorData: [],
|
|
floorData: [],
|
|
curDevice: '',//当前点击的资产id
|
|
curDevice: '',//当前点击的资产id
|
|
addData: {}, //添加资产选择的资产类型
|
|
addData: {}, //添加资产选择的资产类型
|
|
|
|
+ showFlowBuild: false //是否显示建筑楼层
|
|
};
|
|
};
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
@@ -205,18 +207,25 @@ export default {
|
|
}
|
|
}
|
|
queryProperty(param, res => {
|
|
queryProperty(param, res => {
|
|
this.loading = false
|
|
this.loading = false
|
|
- this.tableData = res.Content
|
|
|
|
- this.copyMain = tools.deepCopy(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
|
|
this.page.total = res.Total
|
|
if (this.hot) {
|
|
if (this.hot) {
|
|
this.hot.destroy()
|
|
this.hot.destroy()
|
|
this.hot = null
|
|
this.hot = null
|
|
}
|
|
}
|
|
- if (res.Content && res.Content.length) {
|
|
|
|
|
|
+ if (this.tableData && this.tableData.length) {
|
|
if (this.onlyRead) {
|
|
if (this.onlyRead) {
|
|
- this.getBatch(res.Content)
|
|
|
|
|
|
+ this.getBatch(this.tableData)
|
|
}
|
|
}
|
|
- this.initTable();
|
|
|
|
|
|
+ this.initTable()
|
|
}
|
|
}
|
|
})
|
|
})
|
|
}
|
|
}
|
|
@@ -229,53 +238,74 @@ export default {
|
|
data: {
|
|
data: {
|
|
criterias: []
|
|
criterias: []
|
|
}
|
|
}
|
|
- }
|
|
|
|
- if (!!data && data.length) {
|
|
|
|
- //一级遍历list
|
|
|
|
- data.map(item => {
|
|
|
|
- if (!!item.infos) {
|
|
|
|
- // 二级遍历对象infos
|
|
|
|
- for (let key in item.infos) {
|
|
|
|
- //判断是否是设定参数和动态参数
|
|
|
|
- if (!!item.infos[key]) {
|
|
|
|
- this.tableHeader.map(child => {
|
|
|
|
- //如果一级标签为动态参数或者设定参数放入数据等待请求
|
|
|
|
- if (key == child.InfoPointCode && (child.InputMode == "L" || child.InputMode == "L1" || child.InputMode == "L2" || child.InputMode == "M")) {
|
|
|
|
- param.data.criterias.push({
|
|
|
|
- id: item.id,
|
|
|
|
- code: key
|
|
|
|
- })
|
|
|
|
- }
|
|
|
|
- })
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- })
|
|
|
|
- if (param.data.criterias.length) {
|
|
|
|
- BeatchQueryParam(param, res => {
|
|
|
|
- if (!this.onlyRead) {
|
|
|
|
- return false
|
|
|
|
|
|
+ };
|
|
|
|
+ this.tableHeader.map(head => {
|
|
|
|
+ if (
|
|
|
|
+ head.InputMode == "L" ||
|
|
|
|
+ head.InputMode == "L1" ||
|
|
|
|
+ head.InputMode == "L2" ||
|
|
|
|
+ head.InputMode == "M"
|
|
|
|
+ ) {
|
|
|
|
+ data.map(item => {
|
|
|
|
+ let cur = tools.dataForKey(item, head.Path);
|
|
|
|
+ if (cur) {
|
|
|
|
+ param.data.criterias.push({
|
|
|
|
+ id: item.EquipID,
|
|
|
|
+ code: head.InfoPointCode
|
|
|
|
+ });
|
|
}
|
|
}
|
|
- this.tableData = data.map(item => {
|
|
|
|
- res.Content.map(child => {
|
|
|
|
- if (item.id == child.id) {
|
|
|
|
- if (!!child.data || child.data == 0) {
|
|
|
|
- item.infos[child.code] = child.data
|
|
|
|
- } else {
|
|
|
|
- item.infos[child.code] = child.error ? "表号功能号格式错误" : "表号功能号不存在"
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- })
|
|
|
|
- return item
|
|
|
|
- })
|
|
|
|
- this.hot.loadData(this.tableData)
|
|
|
|
- })
|
|
|
|
|
|
+ });
|
|
}
|
|
}
|
|
|
|
+ });
|
|
|
|
+ if (param.data.criterias.length) {
|
|
|
|
+ BeatchQueryParam(param, res => {
|
|
|
|
+ this.tableData = data.map(item => {
|
|
|
|
+ res.Content.map(child => {
|
|
|
|
+ if (item.EquipID == child.id) {
|
|
|
|
+ if (child.data || child.data == 0) {
|
|
|
|
+ this.tableHeader.map(head => {
|
|
|
|
+ if (head.InfoPointCode == child.code) {
|
|
|
|
+ tools.setDataForKey(item, head.Path, child.data);
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ } else {
|
|
|
|
+ this.tableHeader.map(head => {
|
|
|
|
+ if (head.InfoPointCode == child.code) {
|
|
|
|
+ tools.setDataForKey(
|
|
|
|
+ item,
|
|
|
|
+ head.Path,
|
|
|
|
+ child.error ? "表号功能号格式错误" : "表号功能号不存在"
|
|
|
|
+ );
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ return item;
|
|
|
|
+ });
|
|
|
|
+ this.hot.loadData(this.tableData);
|
|
|
|
+ });
|
|
}
|
|
}
|
|
},
|
|
},
|
|
//显示楼层信息
|
|
//显示楼层信息
|
|
changeAssetsFalg() {
|
|
changeAssetsFalg() {
|
|
-
|
|
|
|
|
|
+ if (this.showFlowBuild) {
|
|
|
|
+ this.showFlowBuild = false
|
|
|
|
+ this.getTableData()
|
|
|
|
+ } else {
|
|
|
|
+ this.$confirm('<p>维护资产所在建筑楼层后,对后续数据影响较大,如业务空间中的所在关系or其他?暂未梳理明白……</p><p>后续要修改设备所属建筑楼层,只能通过模型中的待建模清单操作</p>', '提示', {
|
|
|
|
+ dangerouslyUseHTMLString: true,
|
|
|
|
+ confirmButtonText: '就要维护资产所属建筑楼层',
|
|
|
|
+ cancelButtonText: '暂时不搞了',
|
|
|
|
+ confirmButtonClass: 'confirmButtonClass',
|
|
|
|
+ cancelButtonClass: 'cancelButtonClass'
|
|
|
|
+ }).then(_ => {
|
|
|
|
+ this.showFlowBuild = true
|
|
|
|
+ this.initTable()
|
|
|
|
+ }).catch(_ => {
|
|
|
|
+ this.$message("取消")
|
|
|
|
+ })
|
|
|
|
+ }
|
|
},
|
|
},
|
|
//撤回
|
|
//撤回
|
|
undo() {
|
|
undo() {
|
|
@@ -326,6 +356,9 @@ export default {
|
|
let arr = tools.copyArr(list)
|
|
let arr = tools.copyArr(list)
|
|
let data = showTools.headerTextFilter(arr, 'property', this.onlyRead, this.showType, true)
|
|
let data = showTools.headerTextFilter(arr, 'property', this.onlyRead, this.showType, true)
|
|
data.unshift("操作", "当前关联的设备")
|
|
data.unshift("操作", "当前关联的设备")
|
|
|
|
+ if (this.showFlowBuild) {
|
|
|
|
+ data.splice(2, 0, "所属建筑楼层")
|
|
|
|
+ }
|
|
return data
|
|
return data
|
|
},
|
|
},
|
|
//格式化表内容
|
|
//格式化表内容
|
|
@@ -341,7 +374,17 @@ export default {
|
|
readOnly: true
|
|
readOnly: true
|
|
}
|
|
}
|
|
)
|
|
)
|
|
- return data;
|
|
|
|
|
|
+ if (this.showFlowBuild) {
|
|
|
|
+ data.splice(2, 0, {
|
|
|
|
+ data: "flowBuild",
|
|
|
|
+ renderer: tools.customDropdownRenderer,
|
|
|
|
+ editor: "chosen",
|
|
|
|
+ chosenOptions: {
|
|
|
|
+ data: buildFloorData.data
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ return data
|
|
},
|
|
},
|
|
//初始化插件
|
|
//初始化插件
|
|
initTable() {
|
|
initTable() {
|
|
@@ -349,7 +392,7 @@ export default {
|
|
let winHeight = document.documentElement.clientHeight;
|
|
let winHeight = document.documentElement.clientHeight;
|
|
this.hot = new Handsontable(container, {
|
|
this.hot = new Handsontable(container, {
|
|
data: this.tableData,
|
|
data: this.tableData,
|
|
- fixedColumnsLeft: 4,
|
|
|
|
|
|
+ fixedColumnsLeft: this.showFlowBuild?5:4,
|
|
colHeaders: this.formatHeaderData(this.tableHeader), //表头文案
|
|
colHeaders: this.formatHeaderData(this.tableHeader), //表头文案
|
|
columns: this.formatHeaderType(this.tableHeader), //数据显示格式
|
|
columns: this.formatHeaderType(this.tableHeader), //数据显示格式
|
|
filters: true,
|
|
filters: true,
|
|
@@ -432,7 +475,7 @@ export default {
|
|
|
|
|
|
//存在data进行修改请求
|
|
//存在data进行修改请求
|
|
if (data && data.length) {
|
|
if (data && data.length) {
|
|
- this.updateBusiness(data, changeData);
|
|
|
|
|
|
+ this.updateProperty(data, changeData);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -468,26 +511,49 @@ export default {
|
|
})
|
|
})
|
|
},
|
|
},
|
|
// 更新
|
|
// 更新
|
|
- updateBusiness(data, change) {
|
|
|
|
|
|
+ updateProperty(data, change) {
|
|
let param = {
|
|
let param = {
|
|
Content: [],
|
|
Content: [],
|
|
Projection: []
|
|
Projection: []
|
|
- };
|
|
|
|
|
|
+ }
|
|
//生成要修改字段列表
|
|
//生成要修改字段列表
|
|
change.map(item => {
|
|
change.map(item => {
|
|
if (item[1] && param.Projection.indexOf(item[1]) == -1) {
|
|
if (item[1] && param.Projection.indexOf(item[1]) == -1) {
|
|
- param.Projection.push(item[1].split(".")[0]);
|
|
|
|
|
|
+ if (item[1].split(".")[0] == "flowBuild") {
|
|
|
|
+ param.Projection.push("BuildingId","FloorId")
|
|
|
|
+ } else {
|
|
|
|
+ param.Projection.push(item[1].split(".")[0])
|
|
|
|
+ }
|
|
}
|
|
}
|
|
- });
|
|
|
|
|
|
+ })
|
|
//生成对应修改数据
|
|
//生成对应修改数据
|
|
data.map((item, index) => {
|
|
data.map((item, index) => {
|
|
param.Projection.map(value => {
|
|
param.Projection.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);
|
|
|
|
- });
|
|
|
|
- updateEquip(param, res => { });
|
|
|
|
|
|
+ param.Content.push(item)
|
|
|
|
+ })
|
|
|
|
+ updateProperty(param, res => { })
|
|
},
|
|
},
|
|
//修改资产类型
|
|
//修改资产类型
|
|
// changeCader() {
|
|
// changeCader() {
|