|
@@ -3,13 +3,15 @@ import { SGraphScene, SGraphLayoutType } from '@saga-web/graph/lib';
|
|
|
import { SFloorParser, SLineItem, SPolylineItem, SItemStatus, ItemOrder } from "@saga-web/big";
|
|
|
import { SGraphItem, SLineStyle, SImageItem, STextItem, SGraphPointListInsert, SGraphPointListDelete, SGraphPointListUpdate, SGraphAddCommand } from "@saga-web/graph/lib";
|
|
|
import { SZoneLegendItem } from "@/lib/items/SZoneLegendItem";
|
|
|
+import { SSCPZZoneLegendItem } from "@/lib/items/SSCPZZoneLegendItem";
|
|
|
+import { SFHFQZoneLegendItem } from "@/lib/items/SFHFQZoneLegendItem";
|
|
|
import { SImageLegendItem } from "@/lib/items/SImageLegendItem";
|
|
|
import { TipelineItem } from "@/lib/items/TipelineItem";
|
|
|
import { SImgTextItem } from "@/lib/items/SImgTextItem";
|
|
|
import { SImageMarkerItem } from "@/lib/items/SImageMarkerItem"
|
|
|
import { SPoint, SFont, SColor } from '@saga-web/draw/lib';
|
|
|
import { Legend } from '@/lib/types/Legend';
|
|
|
-import { Relation } from '@/lib/types/Legend';
|
|
|
+import { Relation } from '@/lib/types/Relation';
|
|
|
|
|
|
import { uuid } from "@/components/mapClass/until";
|
|
|
import { STextMarkerItem } from '@/lib/items/STextMarkerItem';
|
|
@@ -78,13 +80,16 @@ export class EditScence extends SGraphScene {
|
|
|
|
|
|
if (obj.itemList[0] instanceof STextMarkerItem) {
|
|
|
itemType = 'baseText'
|
|
|
- console.log('obj.itemList[0]', itemType, obj.itemList[0])
|
|
|
} else if (obj.itemList[0] instanceof SImageMarkerItem) {
|
|
|
itemType = 'baseImage'
|
|
|
} else if (obj.itemList[0] instanceof SLineMarkerItem) {
|
|
|
itemType = 'baseLine'
|
|
|
} else if (obj.itemList[0] instanceof SZoneLegendItem) {
|
|
|
itemType = 'Zone'
|
|
|
+ } else if (obj.itemList[0] instanceof SFHFQZoneLegendItem) {
|
|
|
+ itemType = 'Zone'
|
|
|
+ } else if (obj.itemList[0] instanceof SSCPZZoneLegendItem) {
|
|
|
+ itemType = 'Zone'
|
|
|
} else if (obj.itemList[0] instanceof SImageLegendItem) {
|
|
|
itemType = 'Image'
|
|
|
} else if (obj.itemList[0] instanceof TipelineItem) {
|
|
@@ -194,6 +199,8 @@ export class EditScence extends SGraphScene {
|
|
|
* 增加多边形item lenged
|
|
|
*/
|
|
|
addPolygonItem(event: SMouseEvent): void {
|
|
|
+
|
|
|
+ const SubType = this._legend.SubType ? this._legend.SubType : ''
|
|
|
const LegendData: Legend = {
|
|
|
ID: uuid(),
|
|
|
Name: this._legend.Name,
|
|
@@ -204,18 +211,25 @@ export class EditScence extends SGraphScene {
|
|
|
Type: "Zone",
|
|
|
Pos: { X: event.x, Y: event.y },
|
|
|
OutLine: [{ X: event.x, Y: event.y }],
|
|
|
+ SubType: SubType,
|
|
|
Properties: {
|
|
|
StrokeColor: this._legend.Color,
|
|
|
FillColor: this._legend.FillColor,
|
|
|
LineDash: this._legend.LineDash,
|
|
|
LineWidth: this._legend.LineWidth,
|
|
|
- font:0,
|
|
|
- color:'',
|
|
|
- TextPos:{X:0,Y:0}
|
|
|
+ font: 0,
|
|
|
+ color: '',
|
|
|
+ TextPos: { X: 0, Y: 0 }
|
|
|
},
|
|
|
}
|
|
|
-
|
|
|
- const Polylines = new SZoneLegendItem(null, LegendData);
|
|
|
+ let Polylines = null;
|
|
|
+ if (SubType == "SCPZ") {
|
|
|
+ Polylines = new SSCPZZoneLegendItem(null, LegendData);
|
|
|
+ } else if (SubType == "FHFQ") {
|
|
|
+ Polylines = new SFHFQZoneLegendItem(null, LegendData);
|
|
|
+ } else {
|
|
|
+ Polylines = new SZoneLegendItem(null, LegendData);
|
|
|
+ }
|
|
|
Polylines.selectable = true;
|
|
|
//设置状态
|
|
|
Polylines.status = SItemStatus.Create;
|
|
@@ -308,10 +322,10 @@ export class EditScence extends SGraphScene {
|
|
|
Properties: {
|
|
|
Url: '/serve/topology-wanda/Picture/query/' + this._legend.Url,
|
|
|
Num: 1, // 此num与信息工程化得num无关
|
|
|
- sWidth:0, //icon 的宽
|
|
|
- sHeight:0, //icon 的高
|
|
|
- font:0, //font
|
|
|
- color:'' //字体颜色
|
|
|
+ sWidth: 0, //icon 的宽
|
|
|
+ sHeight: 0, //icon 的高
|
|
|
+ font: 0, //font
|
|
|
+ color: '' //字体颜色
|
|
|
},
|
|
|
}
|
|
|
const item = new SImageLegendItem(null, LegendData);
|
|
@@ -391,8 +405,12 @@ export class EditScence extends SGraphScene {
|
|
|
*/
|
|
|
updatedBorderColor(color: string): void {
|
|
|
if (this.focusItem) {
|
|
|
- let old = this.focusItem.strokeColor;
|
|
|
- this.focusItem.strokeColor = color;
|
|
|
+ if (this.focusItem instanceof SZoneLegendItem || this.focusItem instanceof SSCPZZoneLegendItem || this.focusItem instanceof SFHFQZoneLegendItem) {
|
|
|
+ this.focusItem.strokeColor = new SColor(color)
|
|
|
+ } else {
|
|
|
+ // let old = this.focusItem.strokeColor;
|
|
|
+ this.focusItem.strokeColor = color;
|
|
|
+ }
|
|
|
// this.undoStack.push(new SGraphPropertyCommand(this, this.focusItem, "color", old, color));
|
|
|
}
|
|
|
}
|
|
@@ -514,6 +532,15 @@ export class EditScence extends SGraphScene {
|
|
|
this.focusItem.fillColor = new SColor(fillColor)
|
|
|
}
|
|
|
}
|
|
|
+ /**
|
|
|
+ * 更改图例说明数量
|
|
|
+ * @param num number item数量 (只对icon设备类)
|
|
|
+ */
|
|
|
+ upadatitemExplain(itemExplain: string): void {
|
|
|
+ if (this.focusItem) {
|
|
|
+ this.focusItem.itemExplain = itemExplain
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
/**
|
|
|
* 删除指定item
|