|
@@ -7,6 +7,7 @@ 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';
|
|
|
+import {uuid} from "@/components/mapClass/until"
|
|
|
|
|
|
/**
|
|
|
* 在线绘图
|
|
@@ -59,8 +60,8 @@ export class EditScence extends SGraphScene {
|
|
|
get getlegend(): any {
|
|
|
return this._legend;
|
|
|
};
|
|
|
- set setlegend(obj:any) {
|
|
|
- this._legend = obj
|
|
|
+ set setlegend(obj: any) {
|
|
|
+ this._legend = obj;
|
|
|
}
|
|
|
/**
|
|
|
* 监听变化
|
|
@@ -135,22 +136,37 @@ 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 LegendData
|
|
|
+ const Legend = {
|
|
|
+ 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: Legend = {
|
|
|
+ ID:uuid(),
|
|
|
+ Name: this._legend.Name,
|
|
|
+ GraphElementType: this._legend.Type,
|
|
|
+ Num: 0,
|
|
|
+ GraphElementId:this._legend.Id,
|
|
|
+ AttachObjectIds: [],
|
|
|
+ Pos: { x: 0, y: 0 },
|
|
|
+ OutLine: [[new SPoint(event.x, event.y)]],
|
|
|
+ Scale: { X: 1, Y: 1, Z: 1 }, // 缩放
|
|
|
+ Rolate: { X: 0, Y: 0, Z: 0 },
|
|
|
+ Size: { Width: 0, Height: 0 }, // 大小
|
|
|
+ Properties: {
|
|
|
+ strokeColor: this._legend.Color,
|
|
|
+ fillColor: this._legend.FillColor,
|
|
|
+ },
|
|
|
+ }
|
|
|
|
|
|
- const Polylines = new SZoneLegendItem(null, this._legend);
|
|
|
+ const Polylines = new SZoneLegendItem(null,LegendData);
|
|
|
Polylines.selectable = true;
|
|
|
//设置状态
|
|
|
Polylines.setStatus = SItemStatus.Create;
|
|
@@ -344,7 +360,8 @@ export class EditScence extends SGraphScene {
|
|
|
* @param v
|
|
|
*/
|
|
|
changeAlignItem(v: any): void {
|
|
|
- this.selectContainer.layout(SGraphLayoutType.v);
|
|
|
+ console.log(v);
|
|
|
+ this.selectContainer.layout(v);
|
|
|
}
|
|
|
|
|
|
/**
|