Browse Source

设备台账bim坐标问题修改

haojianlong 4 years ago
parent
commit
7488da73ec
1 changed files with 13 additions and 13 deletions
  1. 13 13
      src/components/ledger/lib/bimDialog.vue

+ 13 - 13
src/components/ledger/lib/bimDialog.vue

@@ -78,11 +78,11 @@ 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])
         }
       })
     },
@@ -132,10 +132,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 +143,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 +152,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,15 +179,15 @@ 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`
           }
           let param = {
             content: [
               {
-                equipId: this.bimcodeobj.EquipID,
+                equipId: this.bimcodeobj.id,
                 buildingId: this.Buildfloor[0],
                 floorId: this.Buildfloor[1],
                 bimLocation: BIMLocation
@@ -216,7 +216,7 @@ 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点击事件