Browse Source

维护设备位置

haojianlong 4 years ago
parent
commit
57b123188d
1 changed files with 9 additions and 6 deletions
  1. 9 6
      src/views/maintain/device/components/deviceGraph.vue

+ 9 - 6
src/views/maintain/device/components/deviceGraph.vue

@@ -173,18 +173,21 @@ export default class deviceGraph extends Vue {
     getLocation() {
         const arr = this.scene?.markList || [];
         if (arr.length) {
+            const obj = {
+                x: arr[0].x | 0,
+                y: -arr[0].y | 0,
+                z: 0,
+                buildingId: this.graphBuilding[0],
+                floorId: this.graphBuilding[1],
+            }
             if (
                 this.equip &&
                 this.equip.locationJson &&
                 this.equip.locationJson.z
             ) {
-                return {
-                    x: arr[0].x | 0,
-                    y: -arr[0].y | 0,
-                    z: this.equip.locationJson.z,
-                };
+                obj.z = this.equip.locationJson.z;
             }
-            return { x: arr[0].x, y: -arr[0].y, z: 0, buildingId: this.graphBuilding[0], floorId: this.graphBuilding[1] };
+            return obj;
         }
         return undefined;
     }