|
@@ -1,4 +1,4 @@
|
|
-import { SBaseEditScene, SBaseLineEdit, SBaseTextEdit, SBaseImageEdit, SBaseExpainEdit, SBaseRectEdit } from "./../big-edit";
|
|
+import { SBaseEditScene, SBaseLineEdit, SBaseTextEdit, SBaseExpainEdit, SBaseRectEdit, SBaseEquipment } from "./../big-edit";
|
|
import { SPersagyImageEdit } from "./"
|
|
import { SPersagyImageEdit } from "./"
|
|
|
|
|
|
import { SGraphEdit } from "./../edit"
|
|
import { SGraphEdit } from "./../edit"
|
|
@@ -50,12 +50,12 @@ export class PTopoScene extends SBaseEditScene {
|
|
} else if (this.editCmd == "EditBasetext") {
|
|
} else if (this.editCmd == "EditBasetext") {
|
|
this.addTextItem(event);
|
|
this.addTextItem(event);
|
|
this.clearCmdStatus();
|
|
this.clearCmdStatus();
|
|
|
|
+ } else if (this.editCmd == "BaseExplain") {
|
|
|
|
+ this.addExplainItem(event);
|
|
|
|
+ this.clearCmdStatus();
|
|
} else if (this.editCmd == "EditBaseImage") {
|
|
} else if (this.editCmd == "EditBaseImage") {
|
|
this.addImageItem(event)
|
|
this.addImageItem(event)
|
|
this.clearCmdStatus();
|
|
this.clearCmdStatus();
|
|
- } else if (this.editCmd == "EditBasePostil") {
|
|
|
|
- this.addExplainItem(event)
|
|
|
|
- this.clearCmdStatus();
|
|
|
|
} else if (this.editCmd == "EditBasePolygon") {
|
|
} else if (this.editCmd == "EditBasePolygon") {
|
|
console.log('编辑多边形')
|
|
console.log('编辑多边形')
|
|
} else if (this.editCmd == "EditBaseRect") {
|
|
} else if (this.editCmd == "EditBaseRect") {
|
|
@@ -70,6 +70,9 @@ export class PTopoScene extends SBaseEditScene {
|
|
} else if (this.editCmd == "EditBaseArrows") {
|
|
} else if (this.editCmd == "EditBaseArrows") {
|
|
this.addArrowsItem(event)
|
|
this.addArrowsItem(event)
|
|
this.clearCmdStatus();
|
|
this.clearCmdStatus();
|
|
|
|
+ } else if (this.editCmd == "EditEuqipment") {
|
|
|
|
+ this.addEuqipment(event)
|
|
|
|
+ this.clearCmdStatus();
|
|
} else if (this.editCmd == "") {
|
|
} else if (this.editCmd == "") {
|
|
super.onMouseDown(event);
|
|
super.onMouseDown(event);
|
|
}
|
|
}
|
|
@@ -180,15 +183,18 @@ export class PTopoScene extends SBaseEditScene {
|
|
Pos: { X: event.x, Y: event.y },
|
|
Pos: { X: event.x, Y: event.y },
|
|
|
|
|
|
Properties: {
|
|
Properties: {
|
|
- Text: '请在右侧属性栏输入文字!',
|
|
|
|
- Color: "#646c73",
|
|
|
|
- Font: 14,
|
|
|
|
- BackgroundColor: "#f7f9facc",
|
|
|
|
Type: "BaseExplain",
|
|
Type: "BaseExplain",
|
|
},
|
|
},
|
|
- Style: {}
|
|
+ Style: {
|
|
|
|
+ Default: {
|
|
|
|
+ Text: '请在右侧属性栏输入文字!',
|
|
|
|
+ Color: "#646c73",
|
|
|
|
+ Font: 14,
|
|
|
|
+ BackgroundColor: "#f7f9facc",
|
|
|
|
+ }
|
|
|
|
+ }
|
|
}
|
|
}
|
|
- const item = new SBaseTextEdit(null, data);
|
|
+ const item = new SBaseExpainEdit(null, data);
|
|
item.moveTo(event.x, event.y);
|
|
item.moveTo(event.x, event.y);
|
|
item.selectable = true;
|
|
item.selectable = true;
|
|
item.moveable = true;
|
|
item.moveable = true;
|
|
@@ -275,9 +281,10 @@ export class PTopoScene extends SBaseEditScene {
|
|
const data = {
|
|
const data = {
|
|
ID: uuid(),
|
|
ID: uuid(),
|
|
Name: '基础三角形',
|
|
Name: '基础三角形',
|
|
- Type: "BaseTriangle",
|
|
+ Type: "Zone",
|
|
Pos: { X: 0, Y: 0 },
|
|
Pos: { X: 0, Y: 0 },
|
|
Properties: {
|
|
Properties: {
|
|
|
|
+ Type: "BaseTriangle",
|
|
},
|
|
},
|
|
Style: {
|
|
Style: {
|
|
Default: {
|
|
Default: {
|
|
@@ -305,9 +312,10 @@ export class PTopoScene extends SBaseEditScene {
|
|
const data = {
|
|
const data = {
|
|
ID: uuid(),
|
|
ID: uuid(),
|
|
Name: '基础箭头',
|
|
Name: '基础箭头',
|
|
- Type: "BaseArrow",
|
|
+ Type: "Zone",
|
|
Pos: { X: 0, Y: 0 },
|
|
Pos: { X: 0, Y: 0 },
|
|
Properties: {
|
|
Properties: {
|
|
|
|
+ Type: "BaseArrow",
|
|
},
|
|
},
|
|
Style: {
|
|
Style: {
|
|
Default: {
|
|
Default: {
|
|
@@ -357,7 +365,42 @@ export class PTopoScene extends SBaseEditScene {
|
|
this.view.update();
|
|
this.view.update();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-
|
|
+
|
|
|
|
+ * 添加基本设备item
|
|
|
|
+ */
|
|
|
|
+ addEuqipment(event: SMouseEvent): void {
|
|
|
|
+ const data = {
|
|
|
|
+
|
|
|
|
+ Name: '基础设备',
|
|
|
|
+ Num: 1,
|
|
|
|
+ Size: { Width: 50, Height: 50 },
|
|
|
|
+
|
|
|
|
+ Type: "Image",
|
|
|
|
+
|
|
|
|
+ Pos: { X: event.x, Y: event.y },
|
|
|
|
+
|
|
|
|
+ Properties: {
|
|
|
|
+ Type: "baseEquipment",
|
|
|
|
+ },
|
|
|
|
+ Style: {
|
|
|
|
+ Default: {
|
|
|
|
+ StrokeColor: "#c0ccda",
|
|
|
|
+ Url: require('./../../../assets/images/svg.svg'),
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ const circleItem = new SBaseEquipment(null, data);
|
|
|
|
+ circleItem.status = SItemStatus.Create;
|
|
|
|
+ this.addItem(circleItem);
|
|
|
|
+ this.undoStack.push(new SGraphAddCommand(this, circleItem));
|
|
|
|
+ circleItem.selectable = true;
|
|
|
|
+ this.grabItem = circleItem;
|
|
|
|
+ circleItem.connect("finishCreated", this, this.finishCreated);
|
|
|
|
+ circleItem.connect("onContextMenu", this, this.getItem);
|
|
|
|
+ if (this.view) {
|
|
|
|
+ this.view.update();
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
|
|
* 修改 item 样式,数据等方法
|
|
* 修改 item 样式,数据等方法
|
|
* @param styleType string 修改样式类型
|
|
* @param styleType string 修改样式类型
|
|
@@ -433,7 +476,7 @@ export class PTopoScene extends SBaseEditScene {
|
|
const Nodes: any = [];
|
|
const Nodes: any = [];
|
|
const Relations: any = [];
|
|
const Relations: any = [];
|
|
this.root.children.forEach(item => {
|
|
this.root.children.forEach(item => {
|
|
- if (!(item instanceof SGraphSelectContainer) && MarkType.includes(item.data.Properties.Type)) {
|
|
+ if ((item instanceof SGraphEdit) && !(item instanceof SGraphSelectContainer) && MarkType.includes(item.data.Properties.Type)) {
|
|
Markers.push(item.toData())
|
|
Markers.push(item.toData())
|
|
}
|
|
}
|
|
});
|
|
});
|