|
@@ -78,17 +78,16 @@ export default {
|
|
|
init() {
|
|
|
this.isShow = true
|
|
|
this.$nextTick(function () {
|
|
|
- if (this.bimcodeobj.FloorId) {
|
|
|
+ if (this.bimcodeobj.floorId) {
|
|
|
this.isShow = false
|
|
|
}
|
|
|
if (this.$refs.floors) {
|
|
|
- this.$refs.floors.setValue([this.bimcodeobj.BuildingId, this.bimcodeobj.FloorId])
|
|
|
+ this.$refs.floors.setValue([this.bimcodeobj.buildingId, this.bimcodeobj.floorId])
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
//切换楼层
|
|
|
changeFloor(value) {
|
|
|
- this.Buildfloor = value
|
|
|
this.isShow = true
|
|
|
if (value.length > 1) {
|
|
|
this.isShow = false
|
|
@@ -132,10 +131,10 @@ export default {
|
|
|
return
|
|
|
}
|
|
|
this.view.scene = this.drawMainScene
|
|
|
- if (this.bimcodeobj.LocationJson) {
|
|
|
+ if (this.bimcodeobj.locationJson) {
|
|
|
let obj = {
|
|
|
- X: this.bimcodeobj.LocationJson.X,
|
|
|
- Y: -this.bimcodeobj.LocationJson.Y,
|
|
|
+ X: this.bimcodeobj.locationJson.x,
|
|
|
+ Y: -this.bimcodeobj.locationJson.y,
|
|
|
}
|
|
|
//回写编辑
|
|
|
this.drawMainScene.addMarker(obj)
|
|
@@ -143,8 +142,8 @@ export default {
|
|
|
this.view.fitSceneToView()
|
|
|
this.drawMainScene.isSpaceSelectable = false
|
|
|
this.drawMainScene.spaceClick(this, this.canvasClick) //锚点触发
|
|
|
- if (this.floorData.Outline && this.floorData.Outline.length) {
|
|
|
- let newArr = this.floorData.Outline.map((t) => {
|
|
|
+ if (this.floorData.outline && this.floorData.outline.length) {
|
|
|
+ let newArr = this.floorData.outline.map((t) => {
|
|
|
return new SPoint(t.X, t.Y)
|
|
|
})
|
|
|
this.drawMainScene.addSceneMark(newArr)
|
|
@@ -152,9 +151,9 @@ export default {
|
|
|
},
|
|
|
//获取楼层数据
|
|
|
getFloorData() {
|
|
|
- if (this.floorData && this.floorData.StructureInfo && this.floorData.StructureInfo.FloorMap) {
|
|
|
+ if (this.floorData && this.floorData.infos && this.floorData.infos.floorMap) {
|
|
|
this.isdata = true
|
|
|
- let floorMap = this.floorData.StructureInfo.FloorMap
|
|
|
+ let floorMap = this.floorData.infos.floorMap
|
|
|
const temp = floorMap.split('.')[1];
|
|
|
if (temp && (temp.toLowerCase() == 'png' || temp.toLowerCase() == 'jpg')) {
|
|
|
this.initGraphy(floorMap, 3)
|
|
@@ -179,17 +178,18 @@ export default {
|
|
|
if (this.drawMainScene.markerList.length) {
|
|
|
let obj = this.drawMainScene.markerList[0], BIMLocation;
|
|
|
|
|
|
- if (this.bimcodeobj.BIMLocation && this.bimcodeobj.BIMLocation.split(',')[2]) {
|
|
|
- BIMLocation = `${obj.x.toFixed(2)},${(obj.y * -1).toFixed(2)},${this.bimcodeobj.BIMLocation.split(',')[2]}`
|
|
|
+ if (this.bimcodeobj.bimLocation && this.bimcodeobj.bimLocation.split(',')[2]) {
|
|
|
+ BIMLocation = `${obj.x.toFixed(2)},${(obj.y * -1).toFixed(2)},${this.bimcodeobj.bimLocation.split(',')[2]}`
|
|
|
} else {
|
|
|
BIMLocation = `${obj.x.toFixed(2)},${(obj.y * -1).toFixed(2)},0`
|
|
|
}
|
|
|
+ const bfloor = this.$refs.floors.value
|
|
|
let param = {
|
|
|
content: [
|
|
|
{
|
|
|
- equipId: this.bimcodeobj.EquipID,
|
|
|
- buildingId: this.Buildfloor[0],
|
|
|
- floorId: this.Buildfloor[1],
|
|
|
+ id: this.bimcodeobj.id,
|
|
|
+ buildingId: bfloor[0] == 'noKnow'?undefined:bfloor[0],
|
|
|
+ floorId: bfloor[1] == 'noKnow'?undefined:bfloor[1],
|
|
|
bimLocation: BIMLocation
|
|
|
},
|
|
|
],
|
|
@@ -216,12 +216,12 @@ export default {
|
|
|
//得到floormap
|
|
|
getFloorMap(val) {
|
|
|
this.floorToMap = val
|
|
|
- this.floorData = this.floorToMap[this.bimcodeobj.FloorId]
|
|
|
+ this.floorData = this.floorToMap[this.bimcodeobj.floorId]
|
|
|
this.getFloorData()
|
|
|
},
|
|
|
// canvas点击事件
|
|
|
canvasClick(item, event) {
|
|
|
- if (item instanceof SGraphyItem) {
|
|
|
+ if (item instanceof SGraphItem) {
|
|
|
this.clearMark()
|
|
|
let obj = {
|
|
|
X: event[0].x,
|