|
@@ -6,7 +6,7 @@ import { SZoneLegendItem } from "@/lib/items/SZoneLegendItem";
|
|
|
import { TipelineItem } from "@/lib/items/TipelineItem";
|
|
|
import { SImgTextItem } from "@/lib/items/SImgTextItem"
|
|
|
import { SPoint, SFont } from '@saga-web/draw/lib';
|
|
|
-
|
|
|
+import { Legend } from '@/lib/types/Legend';
|
|
|
|
|
|
/**
|
|
|
* 在线绘图
|
|
@@ -54,7 +54,14 @@ export class EditScence extends SGraphScene {
|
|
|
// // 选择绑定选额item事件
|
|
|
this.selectContainer.connect("listChange", this, this.listChange);
|
|
|
}
|
|
|
-
|
|
|
+ /** 绘制图例样式 */
|
|
|
+ _legend: any | null = null;
|
|
|
+ get getlegend(): any {
|
|
|
+ return this._legend;
|
|
|
+ };
|
|
|
+ set setlegend(obj:any) {
|
|
|
+ this._legend = obj
|
|
|
+ }
|
|
|
/**
|
|
|
* 监听变化
|
|
|
* @param obj 变化后的对象
|
|
@@ -128,21 +135,22 @@ export class EditScence extends SGraphScene {
|
|
|
*/
|
|
|
addPolygonItem(event: SMouseEvent): void {
|
|
|
//创建item
|
|
|
- const Legend = {
|
|
|
- ID: 123,
|
|
|
- Name: "哈哈",
|
|
|
- GraphElementType: 'Zone',
|
|
|
- GraphElementId: '123',
|
|
|
- Pos: { x: 0, y: 0 },
|
|
|
- OutLine: [[new SPoint(event.x, event.y)]],
|
|
|
- Properties: {
|
|
|
- strokeColor: '#3d73c0',
|
|
|
- fillColor: '#eda986'
|
|
|
- },
|
|
|
- Num: 123
|
|
|
- }
|
|
|
+ // const Legend = {
|
|
|
+ // ID: 123,
|
|
|
+ // Name: "哈哈",
|
|
|
+ // GraphElementType: 'Zone',
|
|
|
+ // GraphElementId: '123',
|
|
|
+ // Pos: { x: 0, y: 0 },
|
|
|
+ // OutLine: [[new SPoint(event.x, event.y)]],
|
|
|
+ // Properties: {
|
|
|
+ // strokeColor: '#3d73c0',
|
|
|
+ // fillColor: '#eda986'
|
|
|
+ // },
|
|
|
+ // Num: 123
|
|
|
+ // }
|
|
|
+ const LegendData
|
|
|
|
|
|
- const Polylines = new SZoneLegendItem(null, Legend);
|
|
|
+ const Polylines = new SZoneLegendItem(null, this._legend);
|
|
|
Polylines.selectable = true;
|
|
|
//设置状态
|
|
|
Polylines.setStatus = SItemStatus.Create;
|