|
@@ -4,7 +4,7 @@
|
|
|
<el-button style="float:left;" size="small" type="default" icon="el-icon-back" @click="goback"></el-button>
|
|
|
<div id="buildFloor">
|
|
|
<span class="buildFloor">建筑楼层</span>
|
|
|
- <el-cascader ref="floorCascader" placeholder="请选择" :props="props" :options="bfOptions" filterable size="small" @change="changeFloor"></el-cascader>
|
|
|
+ <el-cascader ref="floorCascader" placeholder="请选择" :props="props" v-model="floorValue" :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" :disabled="!isChange" style="float:right;">确认</el-button>
|
|
@@ -111,6 +111,8 @@ export default {
|
|
|
left: 0,
|
|
|
},
|
|
|
selectedIcon: null,
|
|
|
+ floorValue: "",
|
|
|
+ oldFloorValue: "",
|
|
|
buildId: "", //建筑Id
|
|
|
floorId: "", //楼层Id
|
|
|
floorMap: "", //楼层平面图地址
|
|
@@ -219,7 +221,7 @@ export default {
|
|
|
})
|
|
|
},
|
|
|
// 二次确认
|
|
|
- confirm(callback) {
|
|
|
+ confirm(callback, cancel) {
|
|
|
if (this.isChange) {
|
|
|
this.$confirm('平面图数据未保存,此操作将不会保存修改数据!', '提示', {
|
|
|
confirmButtonText: '确定',
|
|
@@ -227,6 +229,8 @@ export default {
|
|
|
type: 'warning'
|
|
|
}).then(() => {
|
|
|
callback();
|
|
|
+ }). catch(() => {
|
|
|
+ cancel();
|
|
|
});
|
|
|
} else {
|
|
|
callback();
|
|
@@ -410,38 +414,44 @@ export default {
|
|
|
},
|
|
|
//修改楼层
|
|
|
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.floorData = {}
|
|
|
- }
|
|
|
- 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 (this.floorData.infos && this.floorData.infos.height) {
|
|
|
- this.maxHeight = this.floorData.infos.height;
|
|
|
- this.minHeight = -(this.floorData.infos.height);
|
|
|
- } else {
|
|
|
- this.maxHeight = 99000;
|
|
|
- this.minHeight = -99000;
|
|
|
- }
|
|
|
- if (this.floorData.outline && this.floorData.outline.length) {
|
|
|
- this.floorOutline = this.floorData.outline;
|
|
|
- } else {
|
|
|
- this.floorOutline = null;
|
|
|
- }
|
|
|
+ this.confirm(() => {
|
|
|
+ this.oldFloorValue = value;
|
|
|
+ this.isChange = false;
|
|
|
+ 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.floorData = {}
|
|
|
+ }
|
|
|
+ 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 (this.floorData.infos && this.floorData.infos.height) {
|
|
|
+ this.maxHeight = this.floorData.infos.height;
|
|
|
+ this.minHeight = -(this.floorData.infos.height);
|
|
|
+ } else {
|
|
|
+ this.maxHeight = 99000;
|
|
|
+ this.minHeight = -99000;
|
|
|
+ }
|
|
|
+ if (this.floorData.outline && this.floorData.outline.length) {
|
|
|
+ this.floorOutline = this.floorData.outline;
|
|
|
+ } else {
|
|
|
+ this.floorOutline = null;
|
|
|
+ }
|
|
|
+ }, () => {
|
|
|
+ this.floorValue = this.oldFloorValue;
|
|
|
+ })
|
|
|
},
|
|
|
//修改设备族
|
|
|
changeDevice(value) {
|