|
@@ -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, SColor } from "@saga-web/draw";
|
|
|
import { mapGetters } from "vuex";
|
|
@@ -155,6 +158,13 @@ export default {
|
|
|
total: 0,
|
|
|
isChange: false, //平面图设备是否更改
|
|
|
isMarking: false, // 标记是否选中的是无坐标的设备,true-打点,打完以后重置为false
|
|
|
+ props: {
|
|
|
+ value: 'id',
|
|
|
+ label: 'localName',
|
|
|
+ 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,28 @@ export default {
|
|
|
this.$router.push({ name: "facilityLedger" });
|
|
|
})
|
|
|
},
|
|
|
+ getCascader() {
|
|
|
+ let param = {
|
|
|
+ cascade: [
|
|
|
+ { name: "floor", orders: "floorSequenceID desc" }
|
|
|
+ ],
|
|
|
+ orders: "localName 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.id] = item;
|
|
|
+ return item
|
|
|
+ }).filter(it => it)
|
|
|
+ }
|
|
|
+ return t
|
|
|
+ })
|
|
|
+ })
|
|
|
+ },
|
|
|
// 二次确认
|
|
|
confirm(callback) {
|
|
|
if (this.isChange) {
|
|
@@ -374,8 +408,7 @@ export default {
|
|
|
this.getEquipData();
|
|
|
},
|
|
|
//修改楼层
|
|
|
- changeFloor(value, data) {
|
|
|
- this.floorData = data;
|
|
|
+ changeFloor(value) {
|
|
|
this.showCanvas = false;
|
|
|
this.clearGraphy();
|
|
|
if (value[0]) {
|
|
@@ -383,24 +416,26 @@ export default {
|
|
|
}
|
|
|
if (value[1]) {
|
|
|
this.floorId = value[1];
|
|
|
+ this.floorData = this.fIdToFloor[value[1]];
|
|
|
} else {
|
|
|
this.floorId = "";
|
|
|
+ this.floorData = {}
|
|
|
}
|
|
|
- if (data.infos && data.infos.floorMap) {
|
|
|
- this.floorMap = data.infos.floorMap;
|
|
|
+ if (this.floorData.infos && this.floorData.infos.floorMap) {
|
|
|
+ this.floorMap = this.floorData.infos.floorMap;
|
|
|
this.showCanvas = true;
|
|
|
this.getGraphy();
|
|
|
} else {
|
|
|
this.initParams();
|
|
|
this.floorMap = "";
|
|
|
}
|
|
|
- if (data.infos && data.infos.height) {
|
|
|
- this.maxHeight = data.infos.height;
|
|
|
+ if (this.floorData.infos && this.floorData.infos.height) {
|
|
|
+ this.maxHeight = this.floorData.infos.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 +459,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 +471,6 @@ export default {
|
|
|
}
|
|
|
})
|
|
|
updateEquip(param, () => {
|
|
|
- this.isChange = false
|
|
|
this.$message({message: '保存成功!', type: 'success'});
|
|
|
})
|
|
|
}
|
|
@@ -522,6 +557,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;
|