Quellcode durchsuchen

建筑楼层不需要适配比例尺,其他设备扎点适配比例尺

haojianlong vor 4 Jahren
Ursprung
Commit
5717aeaea5

+ 1 - 0
src/components/business_space/newGraphy/graphy.vue

@@ -363,6 +363,7 @@
       that.scene = new DivideFloorScene();
       that.canvasLoading = true;
       if (this.FloorMap.split('.')[1].toString() == 'png' || this.FloorMap.split('.')[1].toString() == 'jpg') {
+        // 平面图创建业务空间时再改 增加图片偏移量及缩放比例
         that.scene.loadImg(`/image-service/common/image_get?systemId=dataPlatform&key=${this.FloorMap}`, res => {
           this.getGraphtSuc(res)
         })

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

@@ -33,6 +33,7 @@
   import {SPoint} from '@saga-web/draw/lib'
   import {updateEquip} from '@/api/scan/request'
   import {SGraphItem} from '@saga-web/graph/lib'
+  import { SMathUtil } from "@saga-web/cad-engine/lib/utils/SMathUtil"
 
   export default {
     components: {
@@ -115,9 +116,20 @@
                     that.getGraphtSuc(res)
                 })
             } else if (type == 3) {
+                let x = 0;
+                let y = 0;
+                let scale = 1;
+                if (this.floorData && this.floorData.Properties) {
+                  x = this.floorData.Properties.X;
+                  y = this.floorData.Properties.Y;
+                  const pro = this.floorData.Properties;
+                  const dis = SMathUtil.pointDistance(pro.Line[0].x, pro.Line[0].y, pro.Line[1].x, pro.Line[1].y)
+                  const proText = pro.Text.substring(0, pro.Text.length - 3);
+                  scale = proText / dis;
+                }
                 that.drawMainScene.loadImg(`/image-service/common/image_get?systemId=dataPlatform&key=${Id}`, (res) => {
                     that.getGraphtSuc(res)
-                })
+                }, x, y, scale)
             }
         },
         // 获取底图成功

+ 6 - 3
src/components/ledger/lib/floorCascader.vue

@@ -79,7 +79,8 @@
                         "FloorLocalName",
                         "FloorSequenceID",
                         "StructureInfo",
-                        "Outline"
+                        "Outline",
+                        "Properties"
                     ]
                 }
                 let promise1 = new Promise((resolve, reject) => {
@@ -116,7 +117,8 @@
                                         label: floor.FloorLocalName,
                                         FloorSequenceID: floor.FloorSequenceID,
                                         StructureInfo: floor.StructureInfo || {},
-                                        Outline: floor.Outline || null
+                                        Outline: floor.Outline || null,
+                                        Properties: floor.Properties || null
                                     })
                                 } else {
                                     build.children = []
@@ -131,7 +133,8 @@
                                         label: floor.FloorLocalName,
                                         FloorSequenceID: floor.FloorSequenceID,
                                         StructureInfo: floor.StructureInfo || {},
-                                        Outline: floor.Outline || null
+                                        Outline: floor.Outline || null,
+                                        Properties: floor.Properties || null
                                     })
                                 }
                             }

+ 14 - 1
src/views/ledger/facility/batchPoint.vue

@@ -89,6 +89,7 @@ import floorCascader from "@/components/ledger/lib/floorCascader";
 import myCascader from "@/components/ledger/lib/cascader";
 import { queryEquip, updateEquip } from '@/api/scan/request';
 import { LocationPointScene, FloorView, Opt, SpaceItem, ZoneItem } from "@saga-web/cad-engine/lib";
+import { SPoint } from "@saga-web/draw";
 import { mapGetters } from "vuex";
 export default {
   components: {
@@ -325,6 +326,7 @@ export default {
 	},
     //修改楼层
     changeFloor(value, data) {
+        this.floorData = data;
 		this.showCanvas = false;
 		this.clearGraphy();
 		if (value[0]) {
@@ -394,9 +396,20 @@ export default {
       this.scene.selectContainer.connect('listChange', this, this.listChange)
 	  this.canvasLoading = true;
       if (this.floorMap.split('.')[1].toString() == 'png' || this.floorMap.split('.')[1].toString() == 'jpg') {
+        let x = 0;
+        let y = 0;
+        let scale = 1;
+        if (this.floorData && this.floorData.Properties) {
+            x = this.floorData.Properties.X;
+            y = this.floorData.Properties.Y;
+            const pro = this.floorData.Properties;
+            const dis = SMathUtil.pointDistance(pro.Line[0].x, pro.Line[0].y, pro.Line[1].x, pro.Line[1].y)
+            const proText = pro.Text.substring(0, pro.Text.length - 3);
+            scale = proText / dis;
+        }
         this.scene.loadImg(`/image-service/common/image_get?systemId=dataPlatform&key=${this.floorMap}`, res => {
           this.getGraphtSuc(res)
-        })
+        }, x, y, scale)
       } else {
         this.scene.loadUrl(`/image-service/common/file_get?systemId=revit&key=${this.floorMap}`).then(res => {
           this.getGraphtSuc(res)