|
@@ -36,6 +36,8 @@ export class EditScence extends SGraphScene {
|
|
undoStack = new SUndoStack();
|
|
undoStack = new SUndoStack();
|
|
/** 判断是否为苹果电脑 */
|
|
/** 判断是否为苹果电脑 */
|
|
public isMac = /macintosh|mac os x/i.test(navigator.userAgent);
|
|
public isMac = /macintosh|mac os x/i.test(navigator.userAgent);
|
|
|
|
+ /** 是否为复制状态 */
|
|
|
|
+ public isCopy = "false"
|
|
/** 命令 1 绘制直线 */
|
|
/** 命令 1 绘制直线 */
|
|
private cmd = 'choice';
|
|
private cmd = 'choice';
|
|
/** 获取当前状态 */
|
|
/** 获取当前状态 */
|
|
@@ -761,13 +763,13 @@ export class EditScence extends SGraphScene {
|
|
let nameArr = name.split("\n");
|
|
let nameArr = name.split("\n");
|
|
// if (nameArr[nameArr.length - 1] != arr[arr.length - 1].name) //最后一行的名称和将要添加的名称如果不同(增加)
|
|
// if (nameArr[nameArr.length - 1] != arr[arr.length - 1].name) //最后一行的名称和将要添加的名称如果不同(增加)
|
|
if (nameArr.indexOf(arr[arr.length - 1].name) == -1) //将要添加的名称和每一行的名称都不同(新增)
|
|
if (nameArr.indexOf(arr[arr.length - 1].name) == -1) //将要添加的名称和每一行的名称都不同(新增)
|
|
- if (name) {
|
|
|
|
- item.name = name + `\n${arr[arr.length - 1].name}`;
|
|
|
|
- item.text = name + `\n${arr[arr.length - 1].name}`;
|
|
|
|
- } else {
|
|
|
|
- item.name = arr[arr.length - 1].name;
|
|
|
|
- item.text = arr[arr.length - 1].name;
|
|
|
|
- }
|
|
|
|
|
|
+ if (name) {
|
|
|
|
+ item.name = name + `\n${arr[arr.length - 1].name}`;
|
|
|
|
+ item.text = name + `\n${arr[arr.length - 1].name}`;
|
|
|
|
+ } else {
|
|
|
|
+ item.name = arr[arr.length - 1].name;
|
|
|
|
+ item.text = arr[arr.length - 1].name;
|
|
|
|
+ }
|
|
}
|
|
}
|
|
// 绑定工程信息化数据后设置状态
|
|
// 绑定工程信息化数据后设置状态
|
|
if (item.data.AttachObjectIds && item.data.AttachObjectIds.length) {
|
|
if (item.data.AttachObjectIds && item.data.AttachObjectIds.length) {
|
|
@@ -806,6 +808,10 @@ export class EditScence extends SGraphScene {
|
|
* 删除指定item
|
|
* 删除指定item
|
|
*/
|
|
*/
|
|
deleiteItem(): void {
|
|
deleiteItem(): void {
|
|
|
|
+ // 如果为复制状态则删除失效
|
|
|
|
+ if (this.isCopy == "true") {
|
|
|
|
+ return
|
|
|
|
+ }
|
|
if (this.focusItem) {
|
|
if (this.focusItem) {
|
|
if ((this.focusItem instanceof SZoneLegendItem ||
|
|
if ((this.focusItem instanceof SZoneLegendItem ||
|
|
this.focusItem instanceof SSCPZZoneLegendItem ||
|
|
this.focusItem instanceof SSCPZZoneLegendItem ||
|
|
@@ -1050,7 +1056,7 @@ export class EditScence extends SGraphScene {
|
|
}
|
|
}
|
|
switch (this.cmd) {
|
|
switch (this.cmd) {
|
|
case 'choice':
|
|
case 'choice':
|
|
- if (!super.onMouseDown(event)){
|
|
|
|
|
|
+ if (!super.onMouseDown(event)) {
|
|
this.addRectSelect(event);
|
|
this.addRectSelect(event);
|
|
}
|
|
}
|
|
break
|
|
break
|
|
@@ -1412,6 +1418,10 @@ export class EditScence extends SGraphScene {
|
|
* @return boolean
|
|
* @return boolean
|
|
*/
|
|
*/
|
|
onDoubleClick(event: SMouseEvent): boolean {
|
|
onDoubleClick(event: SMouseEvent): boolean {
|
|
|
|
+ // 如果为复制状态则双击失效
|
|
|
|
+ if (this.isCopy == "true") {
|
|
|
|
+ return true
|
|
|
|
+ }
|
|
if (!this.isEditStatus) {
|
|
if (!this.isEditStatus) {
|
|
return true
|
|
return true
|
|
} else {
|
|
} else {
|
|
@@ -1910,8 +1920,8 @@ export class EditScence extends SGraphScene {
|
|
/**
|
|
/**
|
|
* 计算框选交集
|
|
* 计算框选交集
|
|
*/
|
|
*/
|
|
- groupSelect(ctrl:boolean){
|
|
|
|
- if(!ctrl){
|
|
|
|
|
|
+ groupSelect(ctrl: boolean) {
|
|
|
|
+ if (!ctrl) {
|
|
this.selectContainer.clear()
|
|
this.selectContainer.clear()
|
|
}
|
|
}
|
|
if (this.grabItem instanceof SRectSelectItem) {
|
|
if (this.grabItem instanceof SRectSelectItem) {
|
|
@@ -1942,65 +1952,65 @@ export class EditScence extends SGraphScene {
|
|
/**
|
|
/**
|
|
* 修改item样式
|
|
* 修改item样式
|
|
*/
|
|
*/
|
|
- changeLengendItem(legend:any){
|
|
|
|
|
|
+ changeLengendItem(legend: any) {
|
|
if (this.focusItem) {
|
|
if (this.focusItem) {
|
|
// 如果更改得item类相同,则不需要
|
|
// 如果更改得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: this.focusItem.name,
|
|
|
|
- GraphElementType: legend.Type,
|
|
|
|
- Num: 1,
|
|
|
|
- GraphElementId: legend.Id,
|
|
|
|
- AttachObjectIds: this.focusItem.data.AttachObjectIds,
|
|
|
|
- Type: "Zone",
|
|
|
|
- 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,
|
|
|
|
- StrokeColor: legend.Color,
|
|
|
|
- FillColor: legend.FillColor,
|
|
|
|
- LineDash: legend.LineDash,
|
|
|
|
- LineWidth: legend.LineWidth,
|
|
|
|
- font: 14,
|
|
|
|
- color: "#1F2429",
|
|
|
|
- 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 : [],
|
|
|
|
- lengendName: legend.Name, //图例名称
|
|
|
|
- },
|
|
|
|
- }
|
|
|
|
- let Polylines = null;
|
|
|
|
- if (SubType == "SCPZ") {
|
|
|
|
- Polylines = new SSCPZZoneLegendItem(null, LegendData);
|
|
|
|
- } else if (SubType == "FHFQ") {
|
|
|
|
- Polylines = new SFHFQZoneLegendItem(null, LegendData);
|
|
|
|
- } else if (SubType == "CUSTOM") {
|
|
|
|
- Polylines = new SCustomLegendItem(null, LegendData);
|
|
|
|
- } else {
|
|
|
|
- Polylines = new SZoneLegendItem(null, LegendData);
|
|
|
|
- }
|
|
|
|
- Polylines.selectable = true;
|
|
|
|
- //设置状态
|
|
|
|
- Polylines.status = SItemStatus.Normal;
|
|
|
|
- // Polylines.moveable = true;
|
|
|
|
- this.addItem(Polylines);
|
|
|
|
- Polylines.connect("finishCreated", this, this.finishCreated);
|
|
|
|
- // 删除item
|
|
|
|
- this.deleiteItem();
|
|
|
|
- this.grabItem = Polylines;
|
|
|
|
- this.focusItem = Polylines;
|
|
|
|
|
|
+ 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: this.focusItem.name,
|
|
|
|
+ GraphElementType: legend.Type,
|
|
|
|
+ Num: 1,
|
|
|
|
+ GraphElementId: legend.Id,
|
|
|
|
+ AttachObjectIds: this.focusItem.data.AttachObjectIds,
|
|
|
|
+ Type: "Zone",
|
|
|
|
+ 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,
|
|
|
|
+ StrokeColor: legend.Color,
|
|
|
|
+ FillColor: legend.FillColor,
|
|
|
|
+ LineDash: legend.LineDash,
|
|
|
|
+ LineWidth: legend.LineWidth,
|
|
|
|
+ font: 14,
|
|
|
|
+ color: "#1F2429",
|
|
|
|
+ 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 : [],
|
|
|
|
+ lengendName: legend.Name, //图例名称
|
|
|
|
+ },
|
|
|
|
+ }
|
|
|
|
+ let Polylines = null;
|
|
|
|
+ if (SubType == "SCPZ") {
|
|
|
|
+ Polylines = new SSCPZZoneLegendItem(null, LegendData);
|
|
|
|
+ } else if (SubType == "FHFQ") {
|
|
|
|
+ Polylines = new SFHFQZoneLegendItem(null, LegendData);
|
|
|
|
+ } else if (SubType == "CUSTOM") {
|
|
|
|
+ Polylines = new SCustomLegendItem(null, LegendData);
|
|
|
|
+ } else {
|
|
|
|
+ Polylines = new SZoneLegendItem(null, LegendData);
|
|
|
|
+ }
|
|
|
|
+ Polylines.selectable = true;
|
|
|
|
+ //设置状态
|
|
|
|
+ Polylines.status = SItemStatus.Normal;
|
|
|
|
+ // Polylines.moveable = true;
|
|
|
|
+ this.addItem(Polylines);
|
|
|
|
+ Polylines.connect("finishCreated", this, this.finishCreated);
|
|
|
|
+ // 删除item
|
|
|
|
+ this.deleiteItem();
|
|
|
|
+ this.grabItem = Polylines;
|
|
|
|
+ this.focusItem = Polylines;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|