Browse Source

Merge branch 'dev' of http://39.106.8.246:3003/web/persagy-plan-editer into dev

YaolongHan 4 năm trước cách đây
mục cha
commit
08e534a753

+ 4 - 4
package.json

@@ -18,11 +18,11 @@
   },
   "dependencies": {
     "@persagy-web/base": "2.2.1",
-    "@persagy-web/big": "2.2.55",
+    "@persagy-web/big": "2.2.57",
     "@persagy-web/draw": "2.2.14",
-    "@persagy-web/graph": "2.2.46",
-    "@persagy-web/big-edit": "2.2.34",
-    "@persagy-web/edit": "2.2.28",
+    "@persagy-web/graph": "2.2.48",
+    "@persagy-web/big-edit": "2.2.37",
+    "@persagy-web/edit": "2.2.30",
     "@types/uuid": "^8.0.0",
     "ant-design-vue": "^1.6.5",
     "axios": "^0.20.0",

+ 1 - 1
src/components/editview/basePlanEditer.vue

@@ -15,7 +15,7 @@
 </template>
 <script>
 import { SFloorParser, getJsonz } from "@persagy-web/big";
-import { SImageItem, SImageShowType,SGraphPropertyCommand } from "@persagy-web/graph";
+import { SImageItem, SImageShowType, SGraphPropertyCommand } from "@persagy-web/graph";
 import { SPlanView, SPlanParser, SPlanScene, SPlanDecorator, SPlanEquipment, SPlanZone } from "@/lib";
 import planTooltip from "./planTooltip.vue";
 import { mapState, mapMutations } from "vuex";

+ 6 - 6
src/lib/SPlanScene.ts

@@ -24,13 +24,11 @@
  * ****/
 
 import { SBaseEditScene, SBasePipe, SBaseEquipment } from "@persagy-web/big-edit";
-import { SGraphEdit, SGraphPropertyCommand, SBaseImageEdit, SGraphDeleteListCommand, SBaseMaskEdit } from "@persagy-web/edit";
+import { SGraphEdit, SBaseImageEdit, SGraphDeleteListCommand, SBaseMaskEdit } from "@persagy-web/edit";
 import { SMouseEvent } from "@persagy-web/base";
-import { SGraphItem, SGraphSelectContainer, SLineStyle } from "@persagy-web/graph";
+import { SGraphAddCommand, SGraphItem, SGraphPropertyCommand, SGraphSelectContainer, SLineStyle } from "@persagy-web/graph";
 import { SItemStatus, ItemColor } from "@persagy-web/big";
 import { rgbaNum } from "@persagy-web/big-edit/lib/until";
-// 引入命令
-import { SGraphAddCommand } from "@persagy-web/edit";
 import { SColor, SFont, SArrowStyleType } from "@persagy-web/draw";
 import { SPlanEquipment, SPlanParser, SPlanZone } from "./";
 import { SPlanBackgroundImage } from "@/lib/item/SPlanBackgroundImage";
@@ -475,7 +473,7 @@ export class SPlanScene extends SBaseEditScene {
         const markers: any = []; /**图例节点 */ // 与工程信息无关的标识对象(增加文本注释,图上的图片说明)
         const objExtInfo: any = []; /**图例节点 */ // 与工程信息无关的标识对象(增加文本注释,图上的图片说明)
         const relations: any = []; /**图例节点 */ // 与工程信息无关的标识对象(增加文本注释,图上的图片说明)
-        let outline: null | array = null; /**区域显示 */
+        let outline: null | [] = null; /**区域显示 */
         let nodeList;
         if (isAll) {
             nodeList = this.root.children;
@@ -676,9 +674,11 @@ export class SPlanScene extends SBaseEditScene {
         if (itemList?.length) {
             itemList.forEach((item) => {
                 const oldV = item.zOrder;
+                const oldIndex = item.parent?.children.indexOf(item)
                 this.setOrder(val);
+                const newIndex = item.parent?.children.indexOf(item)
                 const newV = item.zOrder;
-                this.undoStack.push(new SGraphPropertyCommand(this, item, "zOrder", oldV, newV));
+                this.undoStack.push(new SGraphPropertyCommand(this, item, "zOrder", oldV, newV, oldIndex, newIndex));
             });
         }
     }

+ 3 - 3
src/lib/item/SPlanEquipment.ts

@@ -28,8 +28,8 @@ import { SGraphItem, SAnchorItem } from "@persagy-web/graph/lib";
 import { SPoint, SPainter, SColor } from "@persagy-web/draw";
 import { Example } from "../index";
 import { SBaseIconTextEdit, SBaseTextEdit } from "@persagy-web/edit";
-import { svgTobase64 } from "@persagy-web/big";
-import { uuid } from "@persagy-web/big-edit/lib/until";
+import { svgTobase64 } from "@persagy-web/big/lib";
+import { v1 as uuidv1 } from "uuid";
 /**
  * 编辑基础设备类
  *
@@ -171,7 +171,7 @@ export class SPlanEquipment extends SBaseIconTextEdit {
                 return item;
             });
         } else {
-            const anchorPoint = [{ x: this.img.x, y: this.img.y, anchorId: uuid() }];
+            const anchorPoint = [{ x: this.img.x, y: this.img.y, anchorId: uuidv1() }];
             this.anchorList = anchorPoint.map((t) => {
                 let item = new SAnchorItem(this);
                 if (t.anchorId) {