|
@@ -10,6 +10,11 @@ import { Marker } from '../types/Marker';
|
|
* * @author 张宇(taohuzy@163.com)
|
|
* * @author 张宇(taohuzy@163.com)
|
|
*/
|
|
*/
|
|
export class SLineMarkerItem extends SLineItem {
|
|
export class SLineMarkerItem extends SLineItem {
|
|
|
|
+ /** 起始锚点 */
|
|
|
|
+ startItem: SGraphItem | null = null;
|
|
|
|
+ /** 结束锚点 */
|
|
|
|
+ endItem: SGraphItem | null = null;
|
|
|
|
+
|
|
/** 标识对象数据 */
|
|
/** 标识对象数据 */
|
|
data: Marker;
|
|
data: Marker;
|
|
|
|
|
|
@@ -57,6 +62,22 @@ export class SLineMarkerItem extends SLineItem {
|
|
}
|
|
}
|
|
} // Constructor
|
|
} // Constructor
|
|
|
|
|
|
|
|
+ /** 接收事件作出修改 */
|
|
|
|
+ changePos() {
|
|
|
|
+ if (this.startItem) {
|
|
|
|
+ // 判断删除equip后,不移动
|
|
|
|
+ if (this.startItem.parent) {
|
|
|
|
+ this.line[0] = this.startItem.mapToScene(0, 0);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ if (this.endItem) {
|
|
|
|
+ // 删除equip后
|
|
|
|
+ if (this.endItem.parent) {
|
|
|
|
+ this.line[1] = this.endItem.mapToScene(0, 0);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
toData(): Marker {
|
|
toData(): Marker {
|
|
this.data.Pos = { X: this.x, Y: this.y };
|
|
this.data.Pos = { X: this.x, Y: this.y };
|
|
this.data.Properties.Line = this.line.map(pos => {
|
|
this.data.Properties.Line = this.line.map(pos => {
|
|
@@ -68,6 +89,12 @@ export class SLineMarkerItem extends SLineItem {
|
|
this.data.Properties.LineWidth = this.lineWidth;
|
|
this.data.Properties.LineWidth = this.lineWidth;
|
|
this.data.Properties.StrokeColor = this.strokeColor.value;
|
|
this.data.Properties.StrokeColor = this.strokeColor.value;
|
|
this.data.Properties.LineStyle = this.lineStyle;
|
|
this.data.Properties.LineStyle = this.lineStyle;
|
|
|
|
+ if (this.startItem && this.startItem.parent) {
|
|
|
|
+ this.data.Properties.StartItemId = this.startItem.id;
|
|
|
|
+ }
|
|
|
|
+ if (this.endItem && this.endItem.parent) {
|
|
|
|
+ this.data.Properties.EndItemId = this.endItem.id;
|
|
|
|
+ }
|
|
return this.data;
|
|
return this.data;
|
|
}
|
|
}
|
|
|
|
|