|
@@ -27,7 +27,7 @@
|
|
|
import { SGraphItem, SAnchorItem } from "@persagy-web/graph/lib";
|
|
|
import { SBaseIconTextEdit, SBaseTextEdit } from "@persagy-web/edit";
|
|
|
import { SColor } from "@persagy-web/draw/lib";
|
|
|
-import { uuid } from "./../until";
|
|
|
+import { v1 as uuidv1 } from "uuid";
|
|
|
import { Legend, svgTobase64 } from "@persagy-web/big/lib";
|
|
|
|
|
|
/**
|
|
@@ -106,8 +106,8 @@ export class SBaseEquipment extends SBaseIconTextEdit {
|
|
|
let item = new SAnchorItem(this);
|
|
|
|
|
|
// 是否存在 anchorId
|
|
|
- if (t.id) {
|
|
|
- item.id = t.id;
|
|
|
+ if (t.anchorId) {
|
|
|
+ item.id = t.anchorId;
|
|
|
}
|
|
|
|
|
|
item.moveTo(t.pos.x, t.pos.y);
|
|
@@ -115,7 +115,7 @@ export class SBaseEquipment extends SBaseIconTextEdit {
|
|
|
});
|
|
|
} else {
|
|
|
const anchorPoint = [
|
|
|
- { x: this.img.x, y: this.img.y, anchorId: uuid() }
|
|
|
+ { pos: { x: this.img.x, y: this.img.y }, anchorId: uuidv1() }
|
|
|
];
|
|
|
|
|
|
// 没锚点则默认中心点为锚点
|
|
@@ -126,7 +126,7 @@ export class SBaseEquipment extends SBaseIconTextEdit {
|
|
|
item.id = t.anchorId;
|
|
|
}
|
|
|
|
|
|
- item.moveTo(t.x, t.y);
|
|
|
+ item.moveTo(t.pos.x, t.pos.y);
|
|
|
return item;
|
|
|
});
|
|
|
}
|
|
@@ -257,14 +257,13 @@ export class SBaseEquipment extends SBaseIconTextEdit {
|
|
|
// 遍历锚点获取需要存储的数据格式
|
|
|
const list = this.anchorList.map(item => {
|
|
|
return {
|
|
|
- id: item.id,
|
|
|
+ anchorId: item.id, // 数据类型中定义为 id,但是后台保存要的是字段anchorId
|
|
|
pos: {
|
|
|
x: item.x,
|
|
|
y: item.y
|
|
|
}
|
|
|
};
|
|
|
});
|
|
|
-
|
|
|
this.legendData.anchorList = list;
|
|
|
// 反馈大小
|
|
|
if (this.legendData.size) {
|