|
@@ -1938,19 +1938,29 @@ export class EditScence extends SGraphScene {
|
|
|
/**
|
|
|
* 修改item样式
|
|
|
*/
|
|
|
- changeLengendItem(legend:any,event:SMouseEvent){
|
|
|
+ changeLengendItem(legend:any){
|
|
|
if (this.focusItem) {
|
|
|
+ // 如果更改得item类相同,则不需要
|
|
|
+ if(this.focusItem.data.GraphElementId == legend.Id){
|
|
|
+ return
|
|
|
+ }
|
|
|
+ const OutLine:any = []
|
|
|
+ if(this.focusItem.pointList){
|
|
|
+ this.focusItem.pointList.forEach(item=>{
|
|
|
+ OutLine.push({X:item.x,Y:item.y})
|
|
|
+ })
|
|
|
+ }
|
|
|
const SubType = legend.SubType ? legend.SubType : '';
|
|
|
const LegendData: Legend = {
|
|
|
ID: uuid(),
|
|
|
- Name: legend.Name,
|
|
|
+ Name: this.focusItem.name,
|
|
|
GraphElementType: legend.Type,
|
|
|
Num: 1,
|
|
|
GraphElementId: legend.Id,
|
|
|
- AttachObjectIds: [],
|
|
|
+ AttachObjectIds: this.focusItem.data.AttachObjectIds,
|
|
|
Type: "Zone",
|
|
|
- Pos: { X: event.x, Y: event.y },
|
|
|
- OutLine: [{ X: event.x, Y: event.y }],
|
|
|
+ Pos: { X: this.focusItem.data.Pos.X, Y: this.focusItem.data.Pos.Y },
|
|
|
+ OutLine: OutLine,
|
|
|
SubType: SubType,
|
|
|
Properties: {
|
|
|
IconUrl: '/serve/topology-wanda/Picture/query/' + legend.Url,
|
|
@@ -1960,7 +1970,7 @@ export class EditScence extends SGraphScene {
|
|
|
LineWidth: legend.LineWidth,
|
|
|
font: 14,
|
|
|
color: "#1F2429",
|
|
|
- TextPos: { X: 0, Y: 0 },
|
|
|
+ TextPos: { X:this.focusItem.data.Properties.TextPos.X, Y: this.focusItem.data.Properties.TextPos.Y },
|
|
|
InfoTypeId: legend.InfoTypeId.length ? legend.InfoTypeId : [],
|
|
|
InfoSystemId: legend.InfoSystemId ? legend.InfoSystemId : '',
|
|
|
InfoLocal: legend.InfoLocal.length ? legend.InfoLocal : [],
|
|
@@ -1979,7 +1989,7 @@ export class EditScence extends SGraphScene {
|
|
|
}
|
|
|
Polylines.selectable = true;
|
|
|
//设置状态
|
|
|
- Polylines.status = SItemStatus.Create;
|
|
|
+ Polylines.status = SItemStatus.Normal;
|
|
|
// Polylines.moveable = true;
|
|
|
this.addItem(Polylines);
|
|
|
Polylines.connect("finishCreated", this, this.finishCreated);
|