tangning hace 7 meses
padre
commit
e9def7b476

+ 6 - 3
src/view/case/draw/board/editCAD/History/Change.js

@@ -7,7 +7,8 @@ import { coordinate } from "../Coordinate";
 
 export default class Change {
   constructor() {
-    this.lastData = {}; // 每次都是当前数据和lastData进行比较,一般在mouseDown的时候存储进来
+    this.lastData = {
+    }; // 每次都是当前数据和lastData进行比较,一般在mouseDown的时候存储进来
     this.elements = {}; // 当前的变化
   }
 
@@ -249,8 +250,10 @@ export default class Change {
     const cells = floorplanService.getCells();
 
     for (const key in cells) {
+      console.log('compareCells', key, cells);
       const cell = cells[key];
-      const lastCell = this.lastData.cells[key];
+      console.log('compareCells', cell, this.lastData);
+      const lastCell = this.lastData.cells && this.lastData.cells[key] || undefined;
       // 不存在意味着增加
       if (!lastCell) {
         const item = {
@@ -530,7 +533,7 @@ export default class Change {
     this.elements.title = null;
     const title = floorplanService.getTitle();
     const lastTitle = this.lastData.title;
-
+    console.log('compareTitle', title, lastTitle);
     const flag = historyUtil.isDifferentForTitle(title, lastTitle);
     if (flag) {
       const item = {

+ 3 - 1
src/view/case/draw/board/editCAD/Layer.js

@@ -511,7 +511,9 @@ export default class Layer {
             stateService.setDraggingItem(stateService.selectItem);
           }
         } else {
-          const sign = floorplanService.getSign(draggingItem.vectorId);
+          const sign = floorplanService.getSign(draggingItem.vectorId) || {
+            center: { x: 0, y: 0 },
+          };
           mathUtil.clonePoint(sign.center, position);
         }
         break;

+ 2 - 2
src/view/case/draw/selectFuseImage.vue

@@ -167,9 +167,9 @@ watchEffect(async (onClanup) => {
 <style lang="scss" scoped>
 .house-layout {
   --w: calc(540 / 390 * var(--h));
-  --h: 610px;
+  --h: 600px;
   display: flex;
-  height: var(--h);
+  height: 560px;
 }
 
 .iframe-layout {