|
@@ -24,11 +24,11 @@
|
|
* *********************************************************************************************************************
|
|
* *********************************************************************************************************************
|
|
*/
|
|
*/
|
|
|
|
|
|
-import { SGraphItem, SAnchorItem } from "@persagy-web/graph/lib";
|
|
|
|
-import { SIconTextItem } from "@persagy-web/big";
|
|
|
|
-import { STextItem, } from "@persagy-web/graph"
|
|
|
|
-import { SColor } from '@persagy-web/draw/lib';
|
|
|
|
-import { svgTobase64 } from "./../until/svgTobase64"
|
|
|
|
|
|
+import { SGraphItem } from "@persagy-web/graph/lib";
|
|
|
|
+import { STextItem } from "@persagy-web/graph";
|
|
|
|
+import { SColor } from "@persagy-web/draw/lib";
|
|
|
|
+import { SIconTextItem } from "./SIconTextItem";
|
|
|
|
+import { svgTobase64 } from "../utils/svgTobase64";
|
|
|
|
|
|
/**
|
|
/**
|
|
* 编辑基础设备类
|
|
* 编辑基础设备类
|
|
@@ -40,26 +40,26 @@ export class SEquipItem extends SIconTextItem {
|
|
nodeId: string | null = null;
|
|
nodeId: string | null = null;
|
|
|
|
|
|
/** 信息点存储 */
|
|
/** 信息点存储 */
|
|
- _infoPointList: any[] = []
|
|
|
|
|
|
+ _infoPointList: any[] = [];
|
|
set infoPointList(val) {
|
|
set infoPointList(val) {
|
|
this._infoPointList = val;
|
|
this._infoPointList = val;
|
|
} // set infoPointList()
|
|
} // set infoPointList()
|
|
get infoPointList(): any[] {
|
|
get infoPointList(): any[] {
|
|
- return this._infoPointList
|
|
|
|
|
|
+ return this._infoPointList;
|
|
} // get infoPointList()
|
|
} // get infoPointList()
|
|
|
|
|
|
/** 图得url */
|
|
/** 图得url */
|
|
- _url: string = '';
|
|
|
|
|
|
+ _url: string = "";
|
|
set url(val) {
|
|
set url(val) {
|
|
this._url = val;
|
|
this._url = val;
|
|
- this.initUrl()
|
|
|
|
|
|
+ this.initUrl();
|
|
} // set url()
|
|
} // set url()
|
|
get url(): string {
|
|
get url(): string {
|
|
- return this._url
|
|
|
|
|
|
+ return this._url;
|
|
} // get url()
|
|
} // get url()
|
|
|
|
|
|
// 设备附加数据
|
|
// 设备附加数据
|
|
- anotherMsg: string = ''
|
|
|
|
|
|
+ anotherMsg: string = "";
|
|
|
|
|
|
/**
|
|
/**
|
|
* 构造函数
|
|
* 构造函数
|
|
@@ -69,7 +69,7 @@ export class SEquipItem extends SIconTextItem {
|
|
*/
|
|
*/
|
|
constructor(parent: SGraphItem | null) {
|
|
constructor(parent: SGraphItem | null) {
|
|
super(parent);
|
|
super(parent);
|
|
- this.showSelect = false
|
|
|
|
|
|
+ this.showSelect = false;
|
|
} // Constructor
|
|
} // Constructor
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -77,11 +77,14 @@ export class SEquipItem extends SIconTextItem {
|
|
*
|
|
*
|
|
*/
|
|
*/
|
|
initUrl() {
|
|
initUrl() {
|
|
- svgTobase64(this.url).then((res) => {
|
|
|
|
- this.img.url = res ? res : '';
|
|
|
|
- }).catch((res) => {
|
|
|
|
- this.img.url = res;
|
|
|
|
- })
|
|
|
|
|
|
+ svgTobase64(this.url)
|
|
|
|
+ .then(res => {
|
|
|
|
+ // @ts-ignore
|
|
|
|
+ this.img.url = res ? res : "";
|
|
|
|
+ })
|
|
|
|
+ .catch(res => {
|
|
|
|
+ this.img.url = res;
|
|
|
|
+ });
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -96,22 +99,24 @@ export class SEquipItem extends SIconTextItem {
|
|
item.data = val;
|
|
item.data = val;
|
|
item.text = val.name;
|
|
item.text = val.name;
|
|
if (val.pos) {
|
|
if (val.pos) {
|
|
- item.moveTo(val.pos.x, val.pos.x)
|
|
|
|
|
|
+ item.moveTo(val.pos.x, val.pos.x);
|
|
} else {
|
|
} else {
|
|
item.moveTo(
|
|
item.moveTo(
|
|
this.img.width * 0.5,
|
|
this.img.width * 0.5,
|
|
- -(this.font.size * 1.25 * 0.5) + (index) * 10
|
|
|
|
|
|
+ -(this.font.size * 1.25 * 0.5) + index * 10
|
|
);
|
|
);
|
|
}
|
|
}
|
|
|
|
|
|
item.font.size = val.font ? val.font : 12;
|
|
item.font.size = val.font ? val.font : 12;
|
|
item.isTransform = false;
|
|
item.isTransform = false;
|
|
item.showSelect = false;
|
|
item.showSelect = false;
|
|
- item.color = val.color ? new SColor(val.color) : new SColor('#000000');
|
|
|
|
- this.textItemList.push(item)
|
|
|
|
|
|
+ item.color = val.color
|
|
|
|
+ ? new SColor(val.color)
|
|
|
|
+ : new SColor("#000000");
|
|
|
|
+ this.textItemList.push(item);
|
|
} else {
|
|
} else {
|
|
- this.textItemList.splice(index, 1)
|
|
|
|
- this.scene ? this.scene.removeItem(this.textItemList[index]) : '';
|
|
|
|
|
|
+ this.textItemList.splice(index, 1);
|
|
|
|
+ this.scene ? this.scene.removeItem(this.textItemList[index]) : "";
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|