Преглед изворни кода

注释修改 处理ts检查报错

haojianlong пре 4 година
родитељ
комит
b607431e13

Разлика између датотеке није приказан због своје велике величине
+ 4 - 3
persagy-web-edit/src/SGraphEditScene.ts


+ 0 - 1
persagy-web-edit/src/items/SBaseCirclePolylineEdit.ts

@@ -52,7 +52,6 @@ import { Marker } from "@persagy-web/big/lib";
  */
 export default class SBaseCirclePolylineEdit extends SGraphEdit {
     /** 传入数据 */
-    private _data: Marker | null = null;
     get data(): Marker | null {
         return this._data;
     } // Get data

+ 3 - 4
persagy-web-edit/src/items/SBaseIconTextEdit.ts

@@ -46,7 +46,6 @@ import { Marker } from "@persagy-web/big/lib";
 
 export class SBaseIconTextEdit extends SGraphEdit {
     /** item 数据*/
-    _data: Marker | null = null;
     get data(): Marker | null {
         return this._data;
     } // Get data
@@ -365,7 +364,7 @@ export class SBaseIconTextEdit extends SGraphEdit {
      *
      * @param item 文本图例
      */
-    addTextItem(item: SBaseTextEdit) {
+    addTextItem(item: SBaseTextEdit): void {
         this.textItemList.push(item);
     } // Function addTextItem
 
@@ -374,7 +373,7 @@ export class SBaseIconTextEdit extends SGraphEdit {
      *
      * @param index 索引
      */
-    removeTextItem(index: number) {
+    removeTextItem(index: number): void {
         let [delteItem] = this.textItemList.splice(index, 1);
         if (this.scene) {
             // 当前 item 场景中
@@ -450,7 +449,7 @@ export class SBaseIconTextEdit extends SGraphEdit {
      * @param oldSize   改之前的大小
      * @param newSize   改之后大小
      */
-    onResize(oldSize: SSize, newSize: SSize) {
+    onResize(oldSize: SSize, newSize: SSize): void {
         // console.log(arguments);
     } // Function onResize()
 

+ 7 - 7
persagy-web-edit/src/items/SBaseImageEdit.ts

@@ -46,7 +46,6 @@ export class SBaseImageEdit extends SGraphEdit {
     //////////////////////////////////////////////////////////////////////////////////////////////////////////////////
     //属性
     /** item 数据*/
-    private _data: Marker | null = null;
     get data(): Marker | null {
         return this._data;
     } // Get data
@@ -54,7 +53,7 @@ export class SBaseImageEdit extends SGraphEdit {
         this._data = v;
         // 数据存在,则初始化数据
         if (v) {
-            this.inData(v);
+            this.initData(v);
             this.update();
         }
     } // Set data
@@ -219,6 +218,7 @@ export class SBaseImageEdit extends SGraphEdit {
      * 构造函数
      *
      * @param parent    指向父对象
+     * @param data      数据
      */
     constructor(parent: SGraphItem | null, data: Marker | null = null) {
         super(parent);
@@ -230,7 +230,7 @@ export class SBaseImageEdit extends SGraphEdit {
     /**
      * 如果 data 设置;初始化data
      */
-    inData(data: Marker) {
+    initData(data: Marker): void {
         this.zOrder = ItemOrder.imageOrder;
         // this.isTransform = false;
         this.url =
@@ -273,14 +273,14 @@ export class SBaseImageEdit extends SGraphEdit {
 
             this.origin = new SPoint(this.width / 2, this.height / 2);
         }
-    } // Function inData()
+    } // Function initData()
 
     /**
      * 初始化svgurl
      *
      * @param v url字符串
      */
-    initSvg(v: any) {
+    initSvg(v: any): void {
         this._url = v;
         svgTobase64(this.url)
             .then(res => {
@@ -296,7 +296,7 @@ export class SBaseImageEdit extends SGraphEdit {
      *
      * @param {*} val 修改svg图对应的色值(矩阵)
      */
-    changeSvgColor(val) {
+    changeSvgColor(val: string): void {
         const parser = new DOMParser();
         const doc = parser.parseFromString(this.svgUrl, "text/xml");
         const svgDom = doc.children[0];
@@ -322,7 +322,7 @@ export class SBaseImageEdit extends SGraphEdit {
      *
      * @param v url字符串
      */
-    initUrl(v: any) {
+    initUrl(v: any): void {
         this._url = v;
         this.img = new Image();
         this.img.onload = (e): void => {

+ 0 - 1
persagy-web-edit/src/items/SBasePolylineEdit.ts

@@ -45,7 +45,6 @@ import { Marker } from "@persagy-web/big/lib";
  */
 export class SBasePolylineEdit extends SGraphEdit {
     /** 传入数据 */
-    private _data: Marker | null = null;
     get data(): Marker | null {
         return this._data;
     } // Get data

+ 1 - 1
persagy-web-graph/src/SGraphItem.ts

@@ -217,7 +217,7 @@ export class SGraphItem extends SObject {
     private _lastGrab: SGraphItem | null = null;
 
     /** 外层自定义数据 */
-    private _data: any | null = null;
+    protected _data: any | null = null;
     set data(d: any) {
         this._data = d;