Parcourir la source

建筑楼层新增下载json

haojianlong il y a 5 ans
Parent
commit
7dd05c0ea1
1 fichiers modifiés avec 5 ajouts et 1 suppressions
  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() {