|
@@ -111,7 +111,7 @@
|
|
|
<el-button size="small" type="primary" @click="confirm">确认</el-button>
|
|
|
</span>
|
|
|
</el-dialog>
|
|
|
- <dialogZone ref="zone" @createSuccess="getOtherType" />
|
|
|
+ <!-- <dialogZone ref="zone" @createSuccess="getOtherType" /> -->
|
|
|
</div>
|
|
|
</template>
|
|
|
<script>
|
|
@@ -122,7 +122,7 @@
|
|
|
import {colorArr} from "@/utils/spaceColor"
|
|
|
import unRelateBSP from "./unRelateBSP";
|
|
|
import createBSP from "./createBSP";
|
|
|
- import dialogZone from "../../ledger/addDialog/dialogZone";
|
|
|
+ // import dialogZone from "../../ledger/addDialog/dialogZone";
|
|
|
import {
|
|
|
createRelateInZoneAndISp,
|
|
|
getIspNotInSpace,
|
|
@@ -132,6 +132,7 @@
|
|
|
queryZone,
|
|
|
zoneCount,
|
|
|
zoneCreate,
|
|
|
+ zoneQuery,
|
|
|
zoneQueryOutline,
|
|
|
zoneUpdate,
|
|
|
zoneUpdateOutline
|
|
@@ -142,7 +143,7 @@
|
|
|
canvasFun,
|
|
|
unRelateBSP,
|
|
|
createBSP,
|
|
|
- dialogZone
|
|
|
+ // dialogZone
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
@@ -250,14 +251,15 @@
|
|
|
}
|
|
|
}
|
|
|
queryZone(pa, res => {
|
|
|
- if (res.Message == this.buildFloor[1]) {
|
|
|
+ if (res.message == this.buildFloor[1]) {
|
|
|
this.BIMIDToSID = {}
|
|
|
this.BIMIDToSIName = {}
|
|
|
this.sourceIdToISP = {}
|
|
|
- res.Content.map(t => {
|
|
|
+ res.content.map(t => {
|
|
|
+ ////----
|
|
|
let key = t.BIMID.split(":")[1];
|
|
|
- this.BIMIDToSID[key] = t.RoomID;
|
|
|
- this.BIMIDToSIName[key] = t.RoomLocalName || t.RoomName;
|
|
|
+ this.BIMIDToSID[key] = t.id;
|
|
|
+ this.BIMIDToSIName[key] = t.localName || t.name;
|
|
|
this.sourceIdToISP[key] = t;
|
|
|
})
|
|
|
}
|
|
@@ -279,7 +281,7 @@
|
|
|
// 过滤器
|
|
|
createFilter(queryString) {
|
|
|
return restaurant => {
|
|
|
- return restaurant.data.RoomLocalName.indexOf(queryString) > -1;
|
|
|
+ return restaurant.data.localName.indexOf(queryString) > -1;
|
|
|
};
|
|
|
},
|
|
|
// 查询选中,定位
|
|
@@ -296,19 +298,19 @@
|
|
|
// 父组件调用
|
|
|
getData(buildFloor, FloorObj, tab) {
|
|
|
let initType = 1;
|
|
|
- if (FloorObj.FloorID == this.FloorObj.FloorID) {
|
|
|
+ if (FloorObj.id == this.FloorObj.id) {
|
|
|
initType = 2;
|
|
|
}
|
|
|
this.buildFloor = buildFloor;
|
|
|
this.FloorObj = FloorObj;
|
|
|
- this.FloorMap = FloorObj.StructureInfo ? FloorObj.StructureInfo.FloorMap : '';
|
|
|
+ this.FloorMap = FloorObj.infos ? FloorObj.infos.floorMap : '';
|
|
|
this.tab = tab;
|
|
|
this.buildFloorName = `${FloorObj.buildName}-${FloorObj.label}`;
|
|
|
console.log(arguments);
|
|
|
if (tab.code == "OtherZone") {
|
|
|
// 其他分区
|
|
|
this.showOtherFlag = true
|
|
|
- this.getOtherType();
|
|
|
+ // this.getOtherType();
|
|
|
// this.OtherValue = (localStorage.getItem('otherZone')) || ''
|
|
|
} else {
|
|
|
this.showOtherFlag = false;
|
|
@@ -316,33 +318,31 @@
|
|
|
this.init(initType);
|
|
|
},
|
|
|
// 其他分区类型查询
|
|
|
- getOtherType() {
|
|
|
- let pa = {
|
|
|
- cascade: [{ name: 'zoneType', filters: `projectId='${this.projectId}'` }],
|
|
|
- filters: `code="otherZone"`
|
|
|
- }
|
|
|
- queryAllZoneType(pa, res => {
|
|
|
- if (res.content[0].zoneType && res.content[0].zoneType.length) {
|
|
|
- this.options = res.content[0].zoneType.map(t => {
|
|
|
- t.value = t.code;
|
|
|
- t.label = t.name;
|
|
|
- return t;
|
|
|
- })
|
|
|
- } else {
|
|
|
- this.options = []
|
|
|
- }
|
|
|
- })
|
|
|
- },
|
|
|
+ // getOtherType() {
|
|
|
+ // let pa = {
|
|
|
+ // Cascade: [{ Filters: `ProjectId='${this.projectId}'` }],
|
|
|
+ // Filters: `Code="OtherZone"`
|
|
|
+ // }
|
|
|
+ // queryAllZoneType(pa, res => {
|
|
|
+ // if (res.content[0].zoneType && res.content[0].zoneType.length) {
|
|
|
+ // this.options = res.content[0].zoneType.map(t => {
|
|
|
+ // t.value = t.code;
|
|
|
+ // t.label = t.name;
|
|
|
+ // return t;
|
|
|
+ // })
|
|
|
+ // } else {
|
|
|
+ // this.options = []
|
|
|
+ // }
|
|
|
+ // })
|
|
|
+ // },
|
|
|
// 其他类型下拉change
|
|
|
changeOtherZone(val) {
|
|
|
this.init(2);
|
|
|
- // localStorage.setItem('otherZone', val)
|
|
|
},
|
|
|
// 获取未绑定业务空间的元空间
|
|
|
getISPSPUnrelaBSP() {
|
|
|
let pa = {
|
|
|
data: {
|
|
|
- // Filters: `FloorId='${this.buildFloor[1]}'`,
|
|
|
PageSize: 1000,
|
|
|
FloorId: this.buildFloor[1]
|
|
|
},
|
|
@@ -351,8 +351,8 @@
|
|
|
getIspNotInSpace(pa, res => {
|
|
|
// 类型需要重新获取,直接取pa.objecttype有问题
|
|
|
let tempType = this.tab.code == 'OtherZone' ? this.OtherValue : this.tab.code
|
|
|
- if (res.FloorId == this.buildFloor[1] && res.ZoneType == tempType) {
|
|
|
- this.allUnRelatISP = res.Content;
|
|
|
+ if (res.floorId == this.buildFloor[1] && res.zoneType == tempType) {
|
|
|
+ this.allUnRelatISP = res.content;
|
|
|
}
|
|
|
})
|
|
|
},
|
|
@@ -382,8 +382,8 @@
|
|
|
}
|
|
|
that.view.scene = that.scene;
|
|
|
// 蒙版
|
|
|
- if (this.FloorObj.Outline) {
|
|
|
- let newArr = this.FloorObj.Outline.map(t => {
|
|
|
+ if (this.FloorObj.outline) {
|
|
|
+ let newArr = this.FloorObj.outline.map(t => {
|
|
|
return new SPoint(t.X, t.Y);
|
|
|
})
|
|
|
this.scene.addSceneMark(newArr)
|
|
@@ -402,44 +402,39 @@
|
|
|
this.canvasLoading = true
|
|
|
let ObjectType = this.tab.code == 'OtherZone' ? this.OtherValue : this.tab.code;
|
|
|
let pa = {
|
|
|
- ZoneType: ObjectType,
|
|
|
- Filters: `not RoomID isNull`,
|
|
|
- Orders: "createTime desc, RoomID asc",
|
|
|
- PageSize: 10000
|
|
|
+ cascader: [{name: 'spaceOutline'}],
|
|
|
+ classCode: ObjectType,
|
|
|
+ filters: `not id isNull`,
|
|
|
+ orders: "createTime desc, id asc",
|
|
|
+ pageSize: 10000
|
|
|
}
|
|
|
if (this.buildFloor.length && this.buildFloor.length > 1) {
|
|
|
pa.BuildingId = this.buildFloor[0];
|
|
|
pa.FloorId = this.buildFloor[1];
|
|
|
}
|
|
|
- zoneQueryOutline(pa, res => {
|
|
|
+ zoneQuery(pa, res => {
|
|
|
// 类型需要重新获取,直接取pa.ZoneType
|
|
|
let tempType = this.tab.code == 'OtherZone' ? this.OtherValue : this.tab.code;
|
|
|
- if (res.FloorId == this.buildFloor[1] && res.ZoneType == tempType) {
|
|
|
+ if (res.floorId == this.buildFloor[1] && res.zoneType == tempType) {
|
|
|
// 所有业务空间
|
|
|
- this.businessSpaceList = res.Content;
|
|
|
+ this.businessSpaceList = res.content;
|
|
|
// 已关联元空间的业务空间
|
|
|
this.BSPRelaISPList = [];
|
|
|
- res.Content.map(t => {
|
|
|
- if (t.Outline && t.Outline.length) {
|
|
|
+ res.content.map(t => {
|
|
|
+ if (t.outline && t.outline.length) {
|
|
|
this.BSPRelaISPList.push(t)
|
|
|
}
|
|
|
})
|
|
|
// 绘制业务空间
|
|
|
let tempArr = this.BSPRelaISPList.map((t, i) => {
|
|
|
- // if (t.FloorId == this.buildFloor[1] && t.ObjectType == tempType) {
|
|
|
return {
|
|
|
- RoomLocalName: t.RoomLocalName,
|
|
|
- OutLine: t.Outline,
|
|
|
- RoomID: t.RoomID,
|
|
|
+ RoomLocalName: t.localName,
|
|
|
+ OutLine: t.outline,
|
|
|
+ RoomID: t.id,
|
|
|
Color: colorArr[i % colorArr.length],
|
|
|
- Infected: t.State
|
|
|
+ Infected: t.state
|
|
|
}
|
|
|
- // } else {
|
|
|
- // console.log('internet slow')
|
|
|
- // return undefined;
|
|
|
- // }
|
|
|
}).filter(item => item)
|
|
|
- console.log(this.scene)
|
|
|
this.scene.removeAllZone();
|
|
|
this.scene.addZoneList(tempArr);
|
|
|
this.scene.click(this, this.canvasClick);
|
|
@@ -476,7 +471,7 @@
|
|
|
this.curZoneItem = item;
|
|
|
this.scene.clearZoneSelection();
|
|
|
item.selected = true;
|
|
|
- this.$emit('copyID', this.curZoneItem.data.RoomID)
|
|
|
+ this.$emit('copyID', this.curZoneItem.data.id)
|
|
|
}
|
|
|
}
|
|
|
},
|
|
@@ -532,13 +527,13 @@
|
|
|
groupCreateBSpace() {
|
|
|
let text = []
|
|
|
let Spaces = this.allUnRelatISP.map(t => {
|
|
|
- if (t.Outline) {
|
|
|
+ if (t.outline) {
|
|
|
let area = 0;
|
|
|
- if (t.Outline[0]) {
|
|
|
- area = this.getarea(t.Outline[0]);
|
|
|
- if (t.Outline.length > 1) {
|
|
|
- for (let i = 1; i < t.Outline.length; i++) {
|
|
|
- let temp = this.getarea(t.Outline[i]);
|
|
|
+ if (t.outline[0]) {
|
|
|
+ area = this.getarea(t.outline[0]);
|
|
|
+ if (t.outline.length > 1) {
|
|
|
+ for (let i = 1; i < t.outline.length; i++) {
|
|
|
+ let temp = this.getarea(t.outline[i]);
|
|
|
area = area - temp
|
|
|
}
|
|
|
}
|
|
@@ -549,17 +544,17 @@
|
|
|
} else {
|
|
|
return undefined;
|
|
|
}
|
|
|
- text.push(t.RoomLocalName || t.RoomName)
|
|
|
+ text.push(t.localName || t.name)
|
|
|
let obj = {
|
|
|
- IspaceId: t.RoomID,
|
|
|
- RoomLocalName: t.RoomLocalName || t.RoomName,
|
|
|
- Outline: [t.Outline],
|
|
|
+ IspaceId: t.id,
|
|
|
+ RoomLocalName: t.localName || t.name,
|
|
|
+ Outline: [t.outline],
|
|
|
BuildingId: this.buildFloor[0],
|
|
|
FloorId: this.buildFloor[1],
|
|
|
Height: this.spaceHeight
|
|
|
}
|
|
|
- if (t.CustomParam) {
|
|
|
- obj.CustomParam = t.CustomParam
|
|
|
+ if (t.customParam) {
|
|
|
+ obj.customParam = t.customParam
|
|
|
}
|
|
|
return obj;
|
|
|
} else {
|
|
@@ -599,7 +594,7 @@
|
|
|
if (arr.length) {
|
|
|
let tempArr = [];
|
|
|
arr.map(t => {
|
|
|
- tempArr.push(this.BIMIDToSIName[t.data.SourceId]);
|
|
|
+ tempArr.push(this.BIMIDToSIName[t.data.sourceId]);
|
|
|
})
|
|
|
this.$refs.createBSP.showDialog(tempArr.toString());
|
|
|
} else {
|
|
@@ -608,7 +603,7 @@
|
|
|
},
|
|
|
// 根据图创建新的业务空间-弹窗返回确认创建
|
|
|
createRoom(val) {
|
|
|
- const zoneObj = { Outline: [], Height: 0 }, IspaceIdList = [];
|
|
|
+ const zoneObj = { outline: [], height: 0 }, IspaceIdList = [];
|
|
|
let spaces = {};
|
|
|
try {
|
|
|
if (this.scene.cutItem || this.scene.sceneMark) {
|
|
@@ -633,28 +628,28 @@
|
|
|
return temp;
|
|
|
})
|
|
|
let newarr = this.makeMaxAreaFirst(spaces[key])
|
|
|
- zoneObj.Outline.push(newarr);
|
|
|
+ zoneObj.outline.push(newarr);
|
|
|
let curISP = this.sourceIdToISP[key];
|
|
|
if (curISP) {
|
|
|
- curISP && IspaceIdList.push(curISP.RoomID);
|
|
|
- zoneObj.Height = this.spaceHeight;
|
|
|
+ curISP && IspaceIdList.push(curISP.id);
|
|
|
+ zoneObj.height = this.spaceHeight;
|
|
|
}
|
|
|
}
|
|
|
} catch (err) {
|
|
|
console.log(err)
|
|
|
let selectSpaces = this.scene.getSelectedSpaces();
|
|
|
selectSpaces.map(t => {
|
|
|
- zoneObj.Outline.push(t.data.OutLine);
|
|
|
- let key = t.data.SourceId;
|
|
|
+ zoneObj.outline.push(t.data.outLine);
|
|
|
+ let key = t.data.sourceId;
|
|
|
let curISP = this.sourceIdToISP[key];
|
|
|
if (curISP) {
|
|
|
- IspaceIdList.push(curISP.RoomID);
|
|
|
- zoneObj.Height = this.spaceHeight;
|
|
|
+ IspaceIdList.push(curISP.id);
|
|
|
+ zoneObj.height = this.spaceHeight;
|
|
|
}
|
|
|
})
|
|
|
// 如果有划分,求交集
|
|
|
if (this.scene.cutItem || this.scene.sceneMark) {
|
|
|
- zoneObj.Outline = [];
|
|
|
+ zoneObj.outline = [];
|
|
|
let arr = this.scene.getIntersect();
|
|
|
arr.map(t => {
|
|
|
let temp = t.map(item => {
|
|
@@ -664,23 +659,23 @@
|
|
|
Z: 0
|
|
|
}
|
|
|
})
|
|
|
- zoneObj.Outline.push([temp]);
|
|
|
+ zoneObj.outline.push([temp]);
|
|
|
})
|
|
|
}
|
|
|
}
|
|
|
// 至此
|
|
|
- if (!zoneObj.Outline.length) {
|
|
|
- zoneObj.Outline = null;
|
|
|
+ if (!zoneObj.outline.length) {
|
|
|
+ zoneObj.outline = null;
|
|
|
}
|
|
|
- zoneObj.RoomLocalName = val;
|
|
|
- zoneObj.BuildingId = this.buildFloor[0];
|
|
|
- zoneObj.FloorId = this.buildFloor[1];
|
|
|
+ zoneObj.localName = val;
|
|
|
+ zoneObj.buildingId = this.buildFloor[0];
|
|
|
+ zoneObj.floorId = this.buildFloor[1];
|
|
|
this.createSingleBSP(zoneObj, IspaceIdList)
|
|
|
},
|
|
|
// 根据图从未关联平面图的业务空间中选择--按钮返回关联信号
|
|
|
createFromUnrelated(zoneObj) {
|
|
|
- zoneObj.Outline = [];
|
|
|
- zoneObj.Height = 0;
|
|
|
+ zoneObj.outline = [];
|
|
|
+ zoneObj.height = 0;
|
|
|
let spaces = {}, IspaceIdList = [];
|
|
|
try {
|
|
|
if (this.scene.cutItem || this.scene.sceneMark) {
|
|
@@ -705,28 +700,28 @@
|
|
|
return temp;
|
|
|
})
|
|
|
let newarr = this.makeMaxAreaFirst(spaces[key])
|
|
|
- zoneObj.Outline.push(newarr);
|
|
|
+ zoneObj.outline.push(newarr);
|
|
|
let curISP = this.sourceIdToISP[key];
|
|
|
if (curISP) {
|
|
|
- curISP && IspaceIdList.push(curISP.RoomID);
|
|
|
- zoneObj.Height = this.spaceHeight;
|
|
|
+ curISP && IspaceIdList.push(curISP.id);
|
|
|
+ zoneObj.height = this.spaceHeight;
|
|
|
}
|
|
|
}
|
|
|
} catch (err) {
|
|
|
console.log(err);
|
|
|
let selectSpaces = this.scene.getSelectedSpaces();
|
|
|
selectSpaces.map(t => {
|
|
|
- zoneObj.Outline.push(t.data.OutLine);
|
|
|
- let key = t.data.SourceId;
|
|
|
+ zoneObj.outline.push(t.data.outLine);
|
|
|
+ let key = t.data.sourceId;
|
|
|
let curISP = this.sourceIdToISP[key];
|
|
|
if (curISP) {
|
|
|
- curISP && IspaceIdList.push(curISP.RoomID);
|
|
|
- zoneObj.Height = this.spaceHeight;
|
|
|
+ curISP && IspaceIdList.push(curISP.id);
|
|
|
+ zoneObj.height = this.spaceHeight;
|
|
|
}
|
|
|
})
|
|
|
// 如果有划分,求交集
|
|
|
if (this.scene.cutItem || this.scene.sceneMark) {
|
|
|
- zoneObj.Outline = [];
|
|
|
+ zoneObj.outline = [];
|
|
|
let arr = this.scene.getIntersect();
|
|
|
arr.map(t => {
|
|
|
let temp = t.map(item => {
|
|
@@ -736,12 +731,12 @@
|
|
|
Z: 0
|
|
|
}
|
|
|
})
|
|
|
- zoneObj.Outline.push([temp]);
|
|
|
+ zoneObj.outline.push([temp]);
|
|
|
})
|
|
|
}
|
|
|
}
|
|
|
- if (!zoneObj.Outline.length) {
|
|
|
- zoneObj.Outline = null;
|
|
|
+ if (!zoneObj.outline.length) {
|
|
|
+ zoneObj.outline = null;
|
|
|
}
|
|
|
this.updateBSPOutline(zoneObj, IspaceIdList)
|
|
|
},
|
|
@@ -749,7 +744,7 @@
|
|
|
editeSpaceDetail() {
|
|
|
let item = this.curZoneItem.data;
|
|
|
let query = {
|
|
|
- RoomID: item.RoomID,
|
|
|
+ RoomID: item.id,
|
|
|
zone: this.tab.code,
|
|
|
isMyTab: 1,
|
|
|
buildFloorSelectd: this.buildFloor
|
|
@@ -777,7 +772,7 @@
|
|
|
confirmZoneSpace() {
|
|
|
let ObjectType = this.tab.code == 'OtherZone' ? this.OtherValue : this.tab.code;
|
|
|
let space = {
|
|
|
- RoomID: this.curZoneItem.data.RoomID,
|
|
|
+ RoomID: this.curZoneItem.data.id,
|
|
|
State: 0,
|
|
|
ObjectType: ObjectType
|
|
|
}
|
|
@@ -801,26 +796,26 @@
|
|
|
let selectSpace = this.scene.getSelectedSpaces();
|
|
|
let selectLikeSpace = this.scene.getSelectedLikeSpace();
|
|
|
//更新业务空间
|
|
|
- let zoneObj = { Outline: [], Height: 0, State: this.confirmAndSaveFlag ? 0 : this.curZoneItem.isInfected ? 1 : 0 }, IspaceIdList = [];
|
|
|
+ let zoneObj = { outline: [], height: 0, state: this.confirmAndSaveFlag ? 0 : this.curZoneItem.isInfected ? 1 : 0 }, IspaceIdList = [];
|
|
|
// 空间
|
|
|
selectSpace.map(t => {
|
|
|
- zoneObj.Outline.push(t.data.OutLine);
|
|
|
- if (this.BIMIDToSID[t.data.SourceId]) {
|
|
|
- IspaceIdList.push(this.BIMIDToSID[t.data.SourceId]);
|
|
|
+ zoneObj.outline.push(t.data.outLine);
|
|
|
+ if (this.BIMIDToSID[t.data.sourceId]) {
|
|
|
+ IspaceIdList.push(this.BIMIDToSID[t.data.sourceId]);
|
|
|
}
|
|
|
|
|
|
// if (t.Height && (zoneObj.Height == 0 || t.Height < zoneObj.Height)) {
|
|
|
// zoneObj.Height = t.Height > 100 ? (t.Height / 1000).toFixed(2) : t.Height;
|
|
|
- zoneObj.Height = this.spaceHeight
|
|
|
+ zoneObj.height = this.spaceHeight
|
|
|
// }
|
|
|
})
|
|
|
// 类空间
|
|
|
selectLikeSpace.map(t => {
|
|
|
- zoneObj.Outline.push(t.data);
|
|
|
+ zoneObj.outline.push(t.data);
|
|
|
})
|
|
|
// 如果有划分,求交集
|
|
|
if (this.scene.cutItem || this.scene.sceneMark) {
|
|
|
- zoneObj.Outline = [];
|
|
|
+ zoneObj.outline = [];
|
|
|
let spaceIntersect = this.scene.getIntersect();
|
|
|
spaceIntersect.map(t => {
|
|
|
let temp = t.map(item => {
|
|
@@ -830,7 +825,7 @@
|
|
|
Z: 0
|
|
|
}
|
|
|
})
|
|
|
- zoneObj.Outline.push([temp]);
|
|
|
+ zoneObj.outline.push([temp]);
|
|
|
})
|
|
|
let likeSpaceIntersect = this.scene.getLikeIntersect();
|
|
|
likeSpaceIntersect.map(t => {
|
|
@@ -841,13 +836,13 @@
|
|
|
Z: 0
|
|
|
}
|
|
|
})
|
|
|
- zoneObj.Outline.push([temp]);
|
|
|
+ zoneObj.outline.push([temp]);
|
|
|
})
|
|
|
}
|
|
|
- if (!zoneObj.Outline.length) {
|
|
|
- zoneObj.Outline = null;
|
|
|
+ if (!zoneObj.outline.length) {
|
|
|
+ zoneObj.outline = null;
|
|
|
}
|
|
|
- zoneObj.RoomID = this.curZoneItem.data.RoomID;
|
|
|
+ zoneObj.id = this.curZoneItem.data.id;
|
|
|
this.updateBSPOutline(zoneObj, IspaceIdList)
|
|
|
},
|
|
|
// 根据图批量创建所选业务空间
|
|
@@ -866,7 +861,7 @@
|
|
|
spaces = this.scene.getZoneDifference();
|
|
|
}
|
|
|
for (let key in spaces) {
|
|
|
- let zoneObj = { Outline: [], Height: 0 }
|
|
|
+ let zoneObj = { outline: [], height: 0 }
|
|
|
spaces[key] = spaces[key].map(t => {
|
|
|
let temp = t.map(item => {
|
|
|
return {
|
|
@@ -878,12 +873,12 @@
|
|
|
return temp;
|
|
|
})
|
|
|
let newarr = this.makeMaxAreaFirst(spaces[key])
|
|
|
- zoneObj.Outline.push(newarr);
|
|
|
- if (!zoneObj.Outline.length) {
|
|
|
+ zoneObj.outline.push(newarr);
|
|
|
+ if (!zoneObj.outline.length) {
|
|
|
continue
|
|
|
}
|
|
|
//计算面积
|
|
|
- let area = 0, line = zoneObj.Outline;
|
|
|
+ let area = 0, line = zoneObj.outline;
|
|
|
for (let i = 0; i < line.length; i++) {
|
|
|
for (let j = 0; j < line[i].length; j++) {
|
|
|
if (j == 0) {
|
|
@@ -900,13 +895,13 @@
|
|
|
//生成空间对象
|
|
|
let curISP = this.sourceIdToISP[key];
|
|
|
if (curISP) {
|
|
|
- zoneObj.Height = this.spaceHeight;
|
|
|
+ zoneObj.height = this.spaceHeight;
|
|
|
// zoneObj.Height = zoneObj.Height == 0 ? curISP.Height : zoneObj.Height > curISP.Height ? curISP.Height : zoneObj.Height;
|
|
|
- zoneObj.IspaceId = curISP.RoomID;
|
|
|
- zoneObj.RoomLocalName = curISP.RoomLocalName;
|
|
|
+ zoneObj.ispaceId = curISP.id;
|
|
|
+ zoneObj.localName = curISP.localName;
|
|
|
}
|
|
|
- zoneObj.BuildingId = this.buildFloor[0];
|
|
|
- zoneObj.FloorId = this.buildFloor[1];
|
|
|
+ zoneObj.buildingId = this.buildFloor[0];
|
|
|
+ zoneObj.floorId = this.buildFloor[1];
|
|
|
createSpaces.push(zoneObj);
|
|
|
}
|
|
|
} catch (err) {
|
|
@@ -947,17 +942,17 @@
|
|
|
}
|
|
|
}
|
|
|
return {
|
|
|
- IspaceId: this.BIMIDToSID[t.data.SourceId],
|
|
|
- RoomLocalName: this.BIMIDToSIName[t.data.SourceId],
|
|
|
- Outline: line,
|
|
|
- BuildingId: this.buildFloor[0],
|
|
|
- FloorId: this.buildFloor[1],
|
|
|
- Height: this.spaceHeight
|
|
|
+ ispaceId: this.BIMIDToSID[t.data.sourceId],
|
|
|
+ localName: this.BIMIDToSIName[t.data.sourceId],
|
|
|
+ outline: line,
|
|
|
+ buildingId: this.buildFloor[0],
|
|
|
+ floorId: this.buildFloor[1],
|
|
|
+ height: this.spaceHeight
|
|
|
}
|
|
|
}).filter(item => item)
|
|
|
} else {
|
|
|
createSpaces = arr.map(t => {
|
|
|
- let line = t.data.OutLine;
|
|
|
+ let line = t.data.outLine;
|
|
|
if (!line || !line.length) {
|
|
|
return undefined
|
|
|
} else {
|
|
@@ -973,12 +968,12 @@
|
|
|
}
|
|
|
}
|
|
|
return {
|
|
|
- IspaceId: this.BIMIDToSID[t.data.SourceId],
|
|
|
- RoomLocalName: this.BIMIDToSIName[t.data.SourceId],
|
|
|
- Outline: [line],
|
|
|
- BuildingId: this.buildFloor[0],
|
|
|
- FloorId: this.buildFloor[1],
|
|
|
- Height: this.spaceHeight
|
|
|
+ ispaceId: this.BIMIDToSID[t.data.sourceId],
|
|
|
+ roomLocalName: this.BIMIDToSIName[t.data.sourceId],
|
|
|
+ outline: [line],
|
|
|
+ buildingId: this.buildFloor[0],
|
|
|
+ floorId: this.buildFloor[1],
|
|
|
+ height: this.spaceHeight
|
|
|
}
|
|
|
}).filter(item => item);
|
|
|
}
|
|
@@ -1010,7 +1005,7 @@
|
|
|
},
|
|
|
// 批量更新业务空间和元空间的关系
|
|
|
groupCreRelaZoneAndISp(Spaces) {
|
|
|
- Spaces = Spaces.filter(item => item.IspaceId);
|
|
|
+ Spaces = Spaces.filter(item => item.ispaceId);
|
|
|
let ObjectType = this.tab.code == 'OtherZone' ? this.OtherValue : this.tab.code;
|
|
|
if (Spaces.length) {
|
|
|
let param = {
|
|
@@ -1043,10 +1038,10 @@
|
|
|
Content: spaces,
|
|
|
}
|
|
|
zoneCreate(pa, res => {
|
|
|
- res.EntityList.map(t => {
|
|
|
+ res.entityList.map(t => {
|
|
|
spaces = spaces.map(item => {
|
|
|
- if (t.RoomLocalName == item.RoomLocalName) {
|
|
|
- item.SpaceId = t.RoomID
|
|
|
+ if (t.localName == item.localName) {
|
|
|
+ item.spaceId = t.id
|
|
|
}
|
|
|
return item;
|
|
|
})
|
|
@@ -1057,22 +1052,22 @@
|
|
|
// 单个创建
|
|
|
createSingleBSP(space, IspaceIdList) {
|
|
|
let ObjectType = this.tab.code == 'OtherZone' ? this.OtherValue : this.tab.code;
|
|
|
- space.BIMLocation = space.Outline ? this.getAverageVal(space.Outline) : null;
|
|
|
+ space.BIMLocation = space.outline ? this.getAverageVal(space.outline) : null;
|
|
|
space.ObjectType = ObjectType;
|
|
|
let pa = {
|
|
|
Content: [space]
|
|
|
}
|
|
|
zoneCreate(pa, res => {
|
|
|
- this.relationInBSPandISP(res.EntityList[0].RoomID, IspaceIdList)
|
|
|
+ this.relationInBSPandISP(res.entityList[0].id, IspaceIdList)
|
|
|
})
|
|
|
},
|
|
|
// 更新业务空间区域
|
|
|
updateBSPOutline(zoneObj, IspaceIdList) {
|
|
|
let ObjectType = this.tab.code == 'OtherZone' ? this.OtherValue : this.tab.code;
|
|
|
- zoneObj.BIMLocation = zoneObj.Outline ? this.getAverageVal(zoneObj.Outline) : null;
|
|
|
+ zoneObj.BIMLocation = zoneObj.outline ? this.getAverageVal(zoneObj.outline) : null;
|
|
|
zoneObj.ObjectType = ObjectType;
|
|
|
- zoneObj.BuildingId = this.buildFloor[0];
|
|
|
- zoneObj.FloorId = this.buildFloor[1];
|
|
|
+ zoneObj.buildingId = this.buildFloor[0];
|
|
|
+ zoneObj.floorId = this.buildFloor[1];
|
|
|
let pa = {
|
|
|
Content: [zoneObj],
|
|
|
Projection: ['BIMLocation', 'ObjectType', 'Outline', 'Height', 'BuildingId', 'FloorId']
|
|
@@ -1085,19 +1080,19 @@
|
|
|
// 从未关联平面图的业务空间中选择时更新业务空间建筑楼层
|
|
|
updateZoneBF(zoneObj, IspaceIdList) {
|
|
|
let pa = [{
|
|
|
- Type: zoneObj.ObjectType,
|
|
|
- SpaceId: zoneObj.RoomID,
|
|
|
- Id: zoneObj.FloorId,
|
|
|
+ type: zoneObj.classCode,
|
|
|
+ spaceId: zoneObj.id,
|
|
|
+ id: zoneObj.floorId,
|
|
|
}]
|
|
|
handleZoneUpdateBd(pa, res => {
|
|
|
- this.relationInBSPandISP(zoneObj.RoomID, IspaceIdList)
|
|
|
+ this.relationInBSPandISP(zoneObj.id, ispaceIdList)
|
|
|
})
|
|
|
},
|
|
|
// 查询未关联平面图的业务空间(项目下+当前分区)
|
|
|
getBSPunrelaISP() {
|
|
|
let ObjectType = this.tab.code == 'OtherZone' ? this.OtherValue : this.tab.code;
|
|
|
let pa = {
|
|
|
- Filters: `Outline isNull;ObjectType="${ObjectType}"`
|
|
|
+ Filters: `outline isNull;classCode="${ObjectType}"`
|
|
|
}
|
|
|
zoneCount(pa, res => {
|
|
|
this.num = res.count;
|