|
@@ -2,9 +2,12 @@
|
|
|
<div id="manageTenantZone">
|
|
|
<el-row style="margin:5px 0 0 0;">
|
|
|
<el-button style="float:left;" size="small" type="default" icon="el-icon-back" @click="goback"></el-button>
|
|
|
- <floor-cascader @change="changeFloor"></floor-cascader>
|
|
|
+ <div id="buildFloor">
|
|
|
+ <span class="buildFloor">建筑楼层</span>
|
|
|
+ <el-cascader ref="floorCascader" placeholder="请选择" :props="props" :options="bfOptions" filterable size="small" @change="changeFloor"></el-cascader>
|
|
|
+ </div>
|
|
|
<my-cascader ref="cascader" @change="changeDevice"></my-cascader>
|
|
|
- <el-button type="primary" size="mini" @click="handleClickSave" style="float:right;">确认</el-button>
|
|
|
+ <el-button type="primary" size="mini" @click="handleClickSave" :disabled="!isChange" style="float:right;">确认</el-button>
|
|
|
<el-button size="mini" style="float:right;margin-right:10px;" @click="cancel">取消</el-button>
|
|
|
</el-row>
|
|
|
<el-row class="main-container">
|
|
@@ -59,7 +62,7 @@
|
|
|
<div class="no-data" v-show="!showCanvas">
|
|
|
<div class="position-icon">
|
|
|
<i class="icon-wushuju iconfont"></i>
|
|
|
- 数据暂无
|
|
|
+ 暂无数据
|
|
|
</div>
|
|
|
</div>
|
|
|
</el-col>
|
|
@@ -87,7 +90,7 @@
|
|
|
<script>
|
|
|
import floorCascader from "@/components/ledger/lib/floorCascader";
|
|
|
import myCascader from "@/components/ledger/lib/cascader";
|
|
|
-import { queryEquip, updateEquip } from '@/api/scan/request';
|
|
|
+import { queryEquip, updateEquip, buildingQuery } from '@/api/scan/request';
|
|
|
import { LocationPointScene, FloorView, Opt, SpaceItem, ZoneItem } from "@saga-web/cad-engine/lib";
|
|
|
import { SPoint } from "@saga-web/draw";
|
|
|
import { mapGetters } from "vuex";
|
|
@@ -155,6 +158,13 @@ export default {
|
|
|
total: 0,
|
|
|
isChange: false, //平面图设备是否更改
|
|
|
isMarking: false, // 标记是否选中的是无坐标的设备,true-打点,打完以后重置为false
|
|
|
+ props: {
|
|
|
+ value: 'BuildID',
|
|
|
+ label: 'BuildLocalName',
|
|
|
+ children: 'Floor'
|
|
|
+ }, // 建筑楼层字段绑定
|
|
|
+ bfOptions: [], // 建筑楼层下拉
|
|
|
+ fIdToFloor: {}, // 楼层id映射楼层对象
|
|
|
};
|
|
|
},
|
|
|
computed: {
|
|
@@ -166,7 +176,9 @@ export default {
|
|
|
return this.loading || this.noMore
|
|
|
}
|
|
|
},
|
|
|
- created() {},
|
|
|
+ created() {
|
|
|
+ this.getCascader()
|
|
|
+ },
|
|
|
mounted() {
|
|
|
this.cadWidth = document.getElementById('canvasBox').offsetWidth;
|
|
|
this.cadHeight = document.getElementById('canvasBox').offsetHeight;
|
|
@@ -183,6 +195,30 @@ export default {
|
|
|
this.$router.push({ name: "facilityLedger" });
|
|
|
})
|
|
|
},
|
|
|
+ getCascader() {
|
|
|
+ let param = {
|
|
|
+ Cascade: [
|
|
|
+ { Name: "floor", Orders: "FloorSequenceID desc" }
|
|
|
+ ],
|
|
|
+ Orders: "BuildLocalName asc",
|
|
|
+ PageNumber: 1,
|
|
|
+ PageSize: 50
|
|
|
+ }
|
|
|
+ buildingQuery(param, res => {
|
|
|
+ this.fIdToFloor = {}
|
|
|
+ this.bfOptions = res.Content.map(t => {
|
|
|
+ if (t.Floor && t.Floor.length) {
|
|
|
+ t.Floor = t.Floor.map(item => {
|
|
|
+ this.fIdToFloor[item.FloorID] = item;
|
|
|
+ item.BuildID = item.FloorID
|
|
|
+ item.BuildLocalName = item.FloorLocalName || item.FloorName
|
|
|
+ return item
|
|
|
+ }).filter(it => it)
|
|
|
+ }
|
|
|
+ return t
|
|
|
+ })
|
|
|
+ })
|
|
|
+ },
|
|
|
// 二次确认
|
|
|
confirm(callback) {
|
|
|
if (this.isChange) {
|
|
@@ -374,33 +410,34 @@ export default {
|
|
|
this.getEquipData();
|
|
|
},
|
|
|
//修改楼层
|
|
|
- changeFloor(value, data) {
|
|
|
- this.floorData = data;
|
|
|
+ changeFloor(value) {
|
|
|
this.showCanvas = false;
|
|
|
this.clearGraphy();
|
|
|
if (value[0]) {
|
|
|
this.buildId = value[0];
|
|
|
- }
|
|
|
+ }
|
|
|
if (value[1]) {
|
|
|
this.floorId = value[1];
|
|
|
+ this.floorData = this.fIdToFloor[value[1]];
|
|
|
} else {
|
|
|
- this.floorId = "";
|
|
|
+ this.floorId = "";
|
|
|
+ this.floorData = {}
|
|
|
}
|
|
|
- if (data.StructureInfo && data.StructureInfo.FloorMap) {
|
|
|
- this.floorMap = data.StructureInfo.FloorMap;
|
|
|
+ if (this.floorData.StructureInfo && this.floorData.StructureInfo.FloorMap) {
|
|
|
+ this.floorMap = this.floorData.StructureInfo.FloorMap;
|
|
|
this.showCanvas = true;
|
|
|
this.getGraphy();
|
|
|
} else {
|
|
|
this.initParams();
|
|
|
this.floorMap = "";
|
|
|
}
|
|
|
- if (data.StructureInfo && data.StructureInfo.Height) {
|
|
|
- this.maxHeight = data.StructureInfo.Height;
|
|
|
+ if (this.floorData.StructureInfo && this.floorData.StructureInfo.Height) {
|
|
|
+ this.maxHeight = this.floorData.StructureInfo.Height;
|
|
|
} else {
|
|
|
this.maxHeight = 99000;
|
|
|
}
|
|
|
- if (data.Outline && data.Outline.length) {
|
|
|
- this.floorOutline = data.Outline;
|
|
|
+ if (this.floorData.Outline && this.floorData.Outline.length) {
|
|
|
+ this.floorOutline = this.floorData.Outline;
|
|
|
} else {
|
|
|
this.floorOutline = null;
|
|
|
}
|
|
@@ -424,7 +461,8 @@ export default {
|
|
|
},
|
|
|
// 保存数据
|
|
|
handleClickSave() {
|
|
|
- if (this.scene && this.scene.iconList.length) {
|
|
|
+ if (this.scene && this.scene.iconList.length && this.isChange) {
|
|
|
+ this.isChange = false
|
|
|
let param = {Content: []}
|
|
|
this.scene.iconList.map((item) => {
|
|
|
if (item.data.id) {
|
|
@@ -435,7 +473,6 @@ export default {
|
|
|
}
|
|
|
})
|
|
|
updateEquip(param, () => {
|
|
|
- this.isChange = false
|
|
|
this.$message({message: '保存成功!', type: 'success'});
|
|
|
})
|
|
|
}
|
|
@@ -521,6 +558,15 @@ export default {
|
|
|
#manageTenantZone {
|
|
|
position: relative;
|
|
|
height: 100%;
|
|
|
+ #buildFloor{
|
|
|
+ margin-left: 10px;
|
|
|
+ float: left;
|
|
|
+ .buildFloor {
|
|
|
+ color: #999999;
|
|
|
+ font-size: 14px;
|
|
|
+ margin-right: 12px;
|
|
|
+ }
|
|
|
+ }
|
|
|
.main-container {
|
|
|
margin-top: 10px;
|
|
|
background: #fff;
|