YaolongHan 5 years ago
parent
commit
548c1ca72c

+ 4 - 4
src/assets/graphy/SGraphy/newItems/SGraphyPolygonItem.js

@@ -171,7 +171,7 @@ var SGraphyPolygonItem = /** @class */ (function (_super) {
   * @return  boolean
   */
     SGraphyPolygonItem.prototype.onDoubleClick = function (event) {
-        this.$emit('doubleClick', { item: this, event: event });
+        this.$emit('doubleClick', event);
         return true;
     };
     /**
@@ -181,7 +181,7 @@ var SGraphyPolygonItem = /** @class */ (function (_super) {
   * @return  boolean
   */
     SGraphyPolygonItem.prototype.onMouseDown = function (event) {
-        this.$emit('mouseDown', { item: this, event: event });
+        this.$emit('mouseDown', event);
         return true;
     }; // Function onMouseDown()
     /**
@@ -191,7 +191,7 @@ var SGraphyPolygonItem = /** @class */ (function (_super) {
      * @return  boolean
      */
     SGraphyPolygonItem.prototype.onMouseMove = function (event) {
-        this.$emit('mouseMove', { item: this, event: event });
+        this.$emit('mouseMove', event);
         return true;
     }; // Function onMouseMove()
     /**
@@ -201,7 +201,7 @@ var SGraphyPolygonItem = /** @class */ (function (_super) {
      * @return  boolean
      */
     SGraphyPolygonItem.prototype.onMouseUp = function (event) {
-        this.$emit('mouseUp', { item: this, event: event });
+        this.$emit('mouseUp', event);
         return true;
     };
     return SGraphyPolygonItem;

+ 4 - 4
src/assets/graphy/SGraphy/newItems/SGraphyPolygonItem.ts

@@ -178,7 +178,7 @@ export default class SGraphyPolygonItem extends SGraphyItem {
   * @return  boolean
   */
 	onDoubleClick(event: SMouseEvent): boolean {
-		this.$emit('doubleClick', { item: this, event: event });
+		this.$emit('doubleClick', event);
 		return true;
 	}
 	/**
@@ -188,7 +188,7 @@ export default class SGraphyPolygonItem extends SGraphyItem {
   * @return  boolean
   */
 	onMouseDown(event: SMouseEvent): boolean {
-		this.$emit('mouseDown', { item: this, event: event });
+		this.$emit('mouseDown', event);
 		return true;
 	} // Function onMouseDown()
 
@@ -199,7 +199,7 @@ export default class SGraphyPolygonItem extends SGraphyItem {
      * @return  boolean
      */
 	onMouseMove(event: SMouseEvent): boolean {
-		this.$emit('mouseMove', { item: this, event: event });
+		this.$emit('mouseMove', event);
 		return true;
 	} // Function onMouseMove()
 
@@ -210,7 +210,7 @@ export default class SGraphyPolygonItem extends SGraphyItem {
      * @return  boolean
      */
 	onMouseUp(event: SMouseEvent): boolean {
-		this.$emit('mouseUp', { item: this, event: event });
+		this.$emit('mouseUp', event);
 		return true;
 	}
 

+ 1 - 1
src/components/business_space/graphy/business.vue

@@ -141,11 +141,11 @@
         SGraphyScene,
         SGraphyRectItem,
         SGraphyLineItem,
-        SGraphyPolygonItem,
         SGraphyVirtualItem,
         SGraphyImageItem,
         SGraphyPillarItems
     } from "@/assets/graphy";
+    import SGraphyPolygonItem from "@/assets/js/items/SGraphyPolygonItem";
     import pako from '@/assets/pako/pako'
     //ele动画组件
     import tools from "@/utils/scan/tools";

+ 6 - 6
src/views/ready/buildfloor/drawGraphy/checkGraphy.vue

@@ -24,11 +24,12 @@
         <drawFloor
           ref="drawFloor"
           :findGraphyItemId="findGraphyItemId"
-          :cadWidth="cadWidth"
-          :cadHeight="cadHeight"
           :dataKey="dataKey"
           :point="point"
           :pointWidth="pointWidth"
+          :cadWidth="720"
+          :cadHeight='300'
+          :isScale="true"
         ></drawFloor>
       </div>
     </div>
@@ -72,9 +73,6 @@ export default {
         }
       ],
       value: "",
-      // graphy测试
-      cadWidth: 1700, // cad宽;
-      cadHeight: 450, //cad 高;
       dataKey:  "/image-service/common/file_get/Fl4201050001c72ff970d2ba11e8a57543fa3e79672520181120041440bim.jsonz?systemId=revit", // key
       point: [40703.54760591985, 42678.14510522981], //坐标
       pointWidth: 2000,
@@ -87,7 +85,9 @@ export default {
     },
     // 绑定图片
     bindGraphy() {}
-  }
+  },
+  mounted() {
+  },
 };
 </script>
 <style lang="less">

+ 23 - 23
src/views/ready/buildfloor/drawGraphy/drawFloor.vue

@@ -17,13 +17,13 @@ import { mainScene, SGraphyRectItem } from "@/assets/graphy/index.js";
 export default {
   props: {
     cadWidth: {
-      type: Number,
-      default: 1000,
+      type: String | Number,
+      default: '100%',
       required: false
     },
     cadHeight: {
-      type: Number,
-      default: 800,
+      type: String | Number,
+      default: '100%',
       required: false
     },
     dataKey: {
@@ -70,7 +70,12 @@ export default {
       type: String,
       default: "#1abc9c",
       required: false
-    }
+    },
+    isScale: { //是否放大缩小
+      type: Boolean,
+      default: false,
+      required: false
+    },
   },
   data() {
     return {
@@ -81,22 +86,6 @@ export default {
     this.initGraphy();
   },
   methods: {
-    // // 请求获取地图的压缩包
-    // getMapBlob() {
-    //   return new Promise((resolve, reject) => {
-    //     this.$http
-    //       .fetchImageFile({
-    //         key: this.dataKey
-    //       })
-    //       .then(res => {
-    //         resolve(res);
-    //       })
-    //       .catch(err => {
-    //         console.log(err);
-    //       });
-    //   });
-    // },
-    //clickItem
     clickItem(item) {
       this.$emit("clickGraphyItem", item);
     },
@@ -133,10 +122,19 @@ export default {
           this.drawAllItemColor();
           // this.drawMainScene.click(this, this.clickItem);
         });
+        if(this.isScale){
+          this.cancelScale(view)
+        }
     },
     // 单个item 高亮
     heightLightitem(item, highlightColor) {
       this.drawItemColor(item, highlightColor);
+    },
+    // 取消放大缩小
+    cancelScale(view){
+      console.log(2123)
+      view.wheelZoom = 1;
+        console.log(view)
     }
   },
   watch: {
@@ -154,6 +152,8 @@ export default {
 };
 </script>
 <style scoped>
-/* #drawFloor {
-} */
+#drawFloor {
+  width: 100%;
+  height: 100%;
+}
 </style>

+ 0 - 21
src/views/ready/buildfloor/drawGraphy/noGraphy.vue

@@ -1,21 +0,0 @@
-<template>
-  <el-dialog
-    id="checkdrawimg"
-    title="添加平面图"
-    :visible.sync="dialogVisible"
-    width="40%"
-    :before-close="handleClose"
-  >
-    <div class="bodys">
-    </div>
-    <span slot="footer" class="dialog-footer">
-      <el-button @click="dialogVisible = false">取 消</el-button>
-      <el-button type="primary" @click="dialogVisible = false">确 定</el-button>
-    </span>
-  </el-dialog>
-</template>
-<style lang="less">
-    #checkdrawimg{
-        
-    }
-</style>

+ 27 - 7
src/views/ready/buildfloor/drawGraphy/repetitionGraphy.vue

@@ -13,7 +13,18 @@
         <el-button size="mini">编辑平面图</el-button>
       </div>
       <!-- 展示图片 -->
-      <div class="drawImg"></div>
+      <div class="drawImg">
+        <drawFloor
+          ref="drawFloor"
+          :findGraphyItemId="findGraphyItemId"
+          :dataKey="dataKey"
+          :point="point"
+          :pointWidth="pointWidth"
+          :cadWidth="1000"
+          :cadHeight="500"
+          :isScale="true"
+        ></drawFloor>
+      </div>
     </div>
     <span slot="footer" class="dialog-footer">
       <el-button @click="dialogVisible = false">取 消</el-button>
@@ -22,27 +33,36 @@
   </el-dialog>
 </template>
 <script>
+import drawFloor from "./drawFloor";
 export default {
+  components: {
+    drawFloor
+  },
   props: {
     repetitionGraphyVisible: Boolean
   },
   data() {
     return {
-      dialogVisible: true
+      dataKey:
+        "/image-service/common/file_get/Fl4201050001c72ff970d2ba11e8a57543fa3e79672520181120041440bim.jsonz?systemId=revit", // key
+      point: [40703.54760591985, 42678.14510522981], //坐标
+      pointWidth: 2000,
+      findGraphyItemId: "" //高亮的id
     };
   },
   methods: {
-      handleClose(){
-        this.$emit('closeRepeatVisible')
-      }
-  },
+    handleClose() {
+      this.$emit("closeRepeatVisible");
+    }
+  }
 };
 </script>
 <style lang="less">
 #checkdrawimg {
   .drawImg {
     width: 100%;
-    height: 300px;
+    height: 500px;
+    margin-top: 12px;
     border: 1px solid #ccc;
   }
 }

+ 0 - 2
src/views/ready/buildfloor/index.vue

@@ -146,7 +146,6 @@ import { mapGetters, mapActions } from "vuex";
 import addConnectivity from "@/components/ready/buildfloor/addConnectivity";
 
 import checkGraphy from "./drawGraphy/checkGraphy"; //查看图片
-import noGraphy from "./drawGraphy/noGraphy"; //无图片
 import repetitionGraphy from "./drawGraphy/repetitionGraphy"; //重复图片
 import {
   buildingQuery,
@@ -159,7 +158,6 @@ export default {
     addBuild,
     addConnectivity,
     checkGraphy,
-    noGraphy,
     repetitionGraphy
   },
   data() {