Browse Source

修改建筑楼层交互

haojianlong 5 years ago
parent
commit
a3f09ad9dc

+ 1 - 1
package.json

@@ -28,7 +28,7 @@
         "@saga-web/base": "2.1.9",
         "@saga-web/draw": "2.1.58",
         "@saga-web/graphy": "2.1.30",
-        "@saga-web/cad-engine": "2.0.385"
+        "@saga-web/cad-engine": "2.0.386"
     },
     "devDependencies": {
         "ajv": "^6.9.1",

+ 21 - 6
src/views/ready/buildfloor/drawGraphy/drawFloor.vue

@@ -33,7 +33,8 @@ export default {
       config: {
         isEdit: false,
         divide: true
-      }
+      },
+      shadeList: []
     };
   },
   props: {
@@ -53,7 +54,7 @@ export default {
   created() {
     this.FloorID = this.$route.query.FloorID;
     if (!this.dialog) {
-      this.getFloorData();
+      this.init();
     }
   },
   mounted() {
@@ -61,6 +62,11 @@ export default {
     this.cadHeight = document.getElementById(`drawFloor${this.id}`).offsetHeight;
   },
   methods: {
+    //
+    init(){
+      this.getFloorData();
+      this.getOtherFloorOutLine();
+    },
     // 初始化canvas
     initGraphy(Id, type) {
       // type=1 => id:模型id
@@ -121,14 +127,23 @@ export default {
       })
     },
     // 获取绑定该模型id的其他楼层轮廓线
-    getOtherFloorOutLine(){
-      let modelid =  this.$route.query.modelId;
+    getOtherFloorOutLine() {
+      let modelid = this.$route.query.modelId;
       let pa = {
         Filters: `ModelId='${modelid}'`
       }
+      this.shadeList = [];
       floorQuery(pa, res => {
-        console.log(res)
-      })
+        res.Content.map(t => {
+          if (t.FloorID != this.FloorID && t.Outline && t.Outline.length) {
+            let line = t.Outline.map(item => {
+              return new SPoint(item.X, item.Y);
+            })
+            this.shadeList.push(line);
+          }
+        });
+        this.drawMainScene.addAllShade(this.shadeList);
+      });
     },
     // 清空平面图
     clearGraphy() {

+ 1 - 1
src/views/ready/buildfloor/repetitionGraphy.vue

@@ -79,7 +79,7 @@ export default {
     // 取消
     cancel() {
       this.isEdit = false;
-      this.$refs.drawFloor.getFloorData();
+      this.$refs.drawFloor.init();
     },
     // 编辑平面图
     editGraphy() {