|
@@ -1,6 +1,6 @@
|
|
|
<template>
|
|
|
<div id="deviceList">
|
|
|
- <el-row class="right">
|
|
|
+ <el-row class="right">
|
|
|
<span style="width:20px;float:left;display:block;height:20px;cursor: pointer;" @click="changeAssetsFalg">
|
|
|
<i class="el-icon-fa el-icon-fa-compass"></i>
|
|
|
</span>
|
|
@@ -41,7 +41,7 @@ import handsonTable from "@/components/common/handsontable";
|
|
|
import {
|
|
|
getDataDictionary,
|
|
|
createGeneralSys,
|
|
|
- getSpaceFloor
|
|
|
+ buildingQuery
|
|
|
} from "@/api/scan/request";
|
|
|
import { mapGetters, mapActions } from "vuex";
|
|
|
|
|
@@ -95,7 +95,7 @@ export default {
|
|
|
},
|
|
|
created() {
|
|
|
this.category = this.$route.query;
|
|
|
- this.getFloorData();
|
|
|
+ this.getBuildData();
|
|
|
this.getTableHeader();
|
|
|
},
|
|
|
methods: {
|
|
@@ -118,52 +118,25 @@ export default {
|
|
|
})
|
|
|
}
|
|
|
},
|
|
|
- //获取楼层数据
|
|
|
- getFloorData() {
|
|
|
+ //获取建筑数据
|
|
|
+ getBuildData() {
|
|
|
let param = {
|
|
|
- ProjId: this.projectId,
|
|
|
- secret: this.secret
|
|
|
+ PageNumber: 1,
|
|
|
+ PageSize: 500,
|
|
|
+ Projection: [
|
|
|
+ "BuildID",
|
|
|
+ "BuildLocalName"
|
|
|
+ ]
|
|
|
}
|
|
|
- getSpaceFloor(param).then(res => {
|
|
|
- if (res.data.Result == 'success') {
|
|
|
- let data = this.changeArr(res.data.Content), floorData = []
|
|
|
- data.map(item => {
|
|
|
- floorData.push({
|
|
|
- Code: item.value,
|
|
|
- Name: item.label
|
|
|
- })
|
|
|
- })
|
|
|
- this.floorData = floorData
|
|
|
- this.floorData = floorData
|
|
|
- } else {
|
|
|
- this.$message.error(res.data.ResultMsg)
|
|
|
- }
|
|
|
- }).catch(() => {
|
|
|
- this.$message.error("请求出错")
|
|
|
- })
|
|
|
- },
|
|
|
- //将数组转换成optiosn格式
|
|
|
- changeArr(arr) {
|
|
|
- return arr.map(item => {
|
|
|
- if (item.floors && item.floors.length) {
|
|
|
+ buildingQuery(param, res => {
|
|
|
+ let data = res.Content.map(t => {
|
|
|
return {
|
|
|
- value: item.id,
|
|
|
- label: item.infos.BuildLocalName,
|
|
|
- children: item.floors.map(i => {
|
|
|
- return {
|
|
|
- value: i.id,
|
|
|
- label: i.infos.FloorLocalName || "未知",
|
|
|
- }
|
|
|
- })
|
|
|
+ Code: t.BuildID,
|
|
|
+ Name: t.BuildLocalName,
|
|
|
}
|
|
|
- } else {
|
|
|
- return {
|
|
|
- value: item.id,
|
|
|
- label: item.infos.BuildLocalName,
|
|
|
- children: null,
|
|
|
- isChilren: 1,
|
|
|
- }
|
|
|
- }
|
|
|
+ })
|
|
|
+ data.unshift({ Code: '', Name: '未明确建筑' })
|
|
|
+ this.buildingData = data;
|
|
|
})
|
|
|
},
|
|
|
// 获取表头数据(初始化表格)
|
|
@@ -218,8 +191,8 @@ export default {
|
|
|
this.$message.success('创建成功')
|
|
|
session.remove("systemAddData")
|
|
|
this.$router.push({
|
|
|
- path: "/system/list",
|
|
|
- query: { deviceId: this.category.Category }
|
|
|
+ name: "systemlist",
|
|
|
+ params: { deviceId: this.category.Category }
|
|
|
});
|
|
|
})
|
|
|
},
|
|
@@ -276,7 +249,7 @@ export default {
|
|
|
editor: "chosen",
|
|
|
chosenOptions: {
|
|
|
// multiple: true,//多选
|
|
|
- data: this.floorData
|
|
|
+ data: this.buildingData
|
|
|
}
|
|
|
});
|
|
|
return data;
|