Browse Source

建筑楼层新增下载json

haojianlong 5 năm trước cách đây
mục cha
commit
7dd05c0ea1
1 tập tin đã thay đổi với 5 bổ sung1 xóa
  1. 5 1
      src/views/ready/buildfloor/drawGraphy/drawFloor.vue

+ 5 - 1
src/views/ready/buildfloor/drawGraphy/drawFloor.vue

@@ -3,7 +3,7 @@
     <canvas :id="`floorCanvas${id}`" :width="cadWidth" :height="cadHeight" ref="canvas" tabindex="0"></canvas>
     <div class="operate" v-if="showTools">
       <canvasFun @fit="fit" @savePng="savePng" @saveSvg="saveSvg" @divide="divide" @clearDivide="clearDivide" @undo="undo" @redo="redo" @scale="scale"
-        @changeAbsorb="changeAbsorb" :config="config" ref="canvasFun"></canvasFun>
+        @changeAbsorb="changeAbsorb" :config="config" ref="canvasFun" @saveJson="saveJson"></canvasFun>
     </div>
   </div>
 </template>
@@ -158,6 +158,10 @@ export default {
     changeAbsorb(isAbsorbing) {
       this.drawMainScene.isAbsorbing = isAbsorbing;
     },
+    // 保存json
+    saveJson() {
+      this.view.saveFloorJson(`${this.floor}.json`)
+    },
     // 撤销
     undo() {