dcim-topology2d 1.1.6 → 3.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (168) hide show
  1. package/activity-diagram/src/final/final.d.ts +1 -1
  2. package/activity-diagram/src/final/final.rect.d.ts +1 -1
  3. package/activity-diagram/src/final/final.rect.js +1 -1
  4. package/activity-diagram/src/fork/fork.anchor.d.ts +1 -1
  5. package/activity-diagram/src/fork/fork.anchor.js +1 -1
  6. package/activity-diagram/src/fork/fork.d.ts +1 -1
  7. package/activity-diagram/src/fork/fork.rect.d.ts +1 -1
  8. package/activity-diagram/src/fork/fork.rect.js +1 -1
  9. package/activity-diagram/src/register.js +1 -1
  10. package/activity-diagram/src/swimlaneH/swimlaneH.d.ts +1 -1
  11. package/activity-diagram/src/swimlaneH/swimlaneH.rect.d.ts +1 -1
  12. package/activity-diagram/src/swimlaneH/swimlaneH.rect.js +1 -1
  13. package/activity-diagram/src/swimlaneV/swimlaneV.d.ts +1 -1
  14. package/activity-diagram/src/swimlaneV/swimlaneV.rect.d.ts +1 -1
  15. package/activity-diagram/src/swimlaneV/swimlaneV.rect.js +1 -1
  16. package/chart-diagram/index.d.ts +0 -2
  17. package/chart-diagram/index.js +0 -1
  18. package/chart-diagram/src/echarts/index.d.ts +2 -1
  19. package/chart-diagram/src/echarts/index.js +104 -106
  20. package/chart-diagram/src/register.js +8 -9
  21. package/class-diagram/src/class/class.d.ts +1 -1
  22. package/class-diagram/src/class/class.rect.d.ts +1 -1
  23. package/class-diagram/src/class/class.rect.js +1 -1
  24. package/class-diagram/src/register.js +1 -1
  25. package/core/index.d.ts +0 -1
  26. package/core/index.js +0 -1
  27. package/core/src/activeLayer.d.ts +10 -2
  28. package/core/src/activeLayer.js +41 -42
  29. package/core/src/animateLayer.d.ts +7 -3
  30. package/core/src/animateLayer.js +12 -10
  31. package/core/src/calling.d.ts +4 -1
  32. package/core/src/calling.js +41 -43
  33. package/core/src/canvas.d.ts +6 -1
  34. package/core/src/canvas.js +18 -17
  35. package/core/src/common.d.ts +5 -5
  36. package/core/src/common.js +202 -172
  37. package/core/src/core.d.ts +4 -3
  38. package/core/src/core.js +321 -339
  39. package/core/src/divLayer.d.ts +33 -2
  40. package/core/src/divLayer.js +292 -41
  41. package/core/src/healps/changeData.d.ts +1 -1
  42. package/core/src/healps/changeData.js +44 -102
  43. package/core/src/hoverLayer.d.ts +9 -2
  44. package/core/src/hoverLayer.js +34 -31
  45. package/core/src/middles/default.d.ts +3 -1
  46. package/core/src/middles/default.js +51 -51
  47. package/core/src/middles/index.js +2 -3
  48. package/core/src/middles/nodes/pentagon.rect.js +1 -1
  49. package/core/src/middles/nodes/rectangle.rect.js +1 -1
  50. package/core/src/models/data.d.ts +26 -0
  51. package/core/src/models/data.js +77 -0
  52. package/core/src/models/data.js.map +1 -0
  53. package/core/src/models/index.d.ts +1 -0
  54. package/core/src/models/index.js +1 -0
  55. package/core/src/models/node.d.ts +0 -6
  56. package/core/src/models/node.js +16 -29
  57. package/core/src/models/pen.js +7 -16
  58. package/core/src/mqtt.d.ts +14 -0
  59. package/core/src/mqtt.js +82 -0
  60. package/core/src/mqtt.js.map +1 -0
  61. package/core/src/offscreen.d.ts +4 -1
  62. package/core/src/offscreen.js +8 -10
  63. package/core/src/options.js +0 -1
  64. package/core/src/poll.js +2 -0
  65. package/core/src/preview.d.ts +13 -1
  66. package/core/src/preview.js +34 -56
  67. package/core/src/renderLayer.d.ts +3 -1
  68. package/core/src/renderLayer.js +31 -26
  69. package/core/src/socket.d.ts +10 -0
  70. package/core/src/socket.js +51 -0
  71. package/core/src/socket.js.map +1 -0
  72. package/core/src/utils/canvas.js +1 -1
  73. package/core/src/utils/conversion.d.ts +0 -7
  74. package/core/src/utils/conversion.js +0 -54
  75. package/core/src/utils/dom.d.ts +5 -6
  76. package/core/src/utils/dom.js +46 -82
  77. package/core/src/utils/index.d.ts +0 -1
  78. package/core/src/utils/index.js +0 -1
  79. package/core/src/utils/onmousevent.js +3 -12
  80. package/flow-diagram/src/comment/comment.anchor.d.ts +1 -1
  81. package/flow-diagram/src/comment/comment.anchor.js +1 -1
  82. package/flow-diagram/src/comment/comment.d.ts +1 -1
  83. package/flow-diagram/src/data/data.anchor.d.ts +1 -1
  84. package/flow-diagram/src/data/data.anchor.js +1 -1
  85. package/flow-diagram/src/data/data.d.ts +1 -1
  86. package/flow-diagram/src/data/data.rect.d.ts +1 -1
  87. package/flow-diagram/src/data/data.rect.js +1 -1
  88. package/flow-diagram/src/db/db.d.ts +1 -1
  89. package/flow-diagram/src/db/db.rect.d.ts +1 -1
  90. package/flow-diagram/src/db/db.rect.js +1 -1
  91. package/flow-diagram/src/display/display.anchor.d.ts +1 -1
  92. package/flow-diagram/src/display/display.anchor.js +1 -1
  93. package/flow-diagram/src/display/display.d.ts +1 -1
  94. package/flow-diagram/src/display/display.rect.d.ts +1 -1
  95. package/flow-diagram/src/display/display.rect.js +1 -1
  96. package/flow-diagram/src/document/document.anchor.d.ts +1 -1
  97. package/flow-diagram/src/document/document.anchor.js +1 -1
  98. package/flow-diagram/src/document/document.d.ts +1 -1
  99. package/flow-diagram/src/document/document.rect.d.ts +1 -1
  100. package/flow-diagram/src/document/document.rect.js +1 -1
  101. package/flow-diagram/src/externStorage/externStorage.anchor.d.ts +1 -1
  102. package/flow-diagram/src/externStorage/externStorage.anchor.js +1 -1
  103. package/flow-diagram/src/externStorage/externStorage.d.ts +1 -1
  104. package/flow-diagram/src/externStorage/externStorage.rect.d.ts +1 -1
  105. package/flow-diagram/src/externStorage/externStorage.rect.js +1 -1
  106. package/flow-diagram/src/internalStorage/internalStorage.d.ts +1 -1
  107. package/flow-diagram/src/internalStorage/internalStorage.rect.d.ts +1 -1
  108. package/flow-diagram/src/internalStorage/internalStorage.rect.js +1 -1
  109. package/flow-diagram/src/manually/manually.anchor.d.ts +1 -1
  110. package/flow-diagram/src/manually/manually.anchor.js +1 -1
  111. package/flow-diagram/src/manually/manually.d.ts +1 -1
  112. package/flow-diagram/src/manually/manually.rect.d.ts +1 -1
  113. package/flow-diagram/src/manually/manually.rect.js +1 -1
  114. package/flow-diagram/src/parallel/parallel.anchor.d.ts +1 -1
  115. package/flow-diagram/src/parallel/parallel.anchor.js +1 -1
  116. package/flow-diagram/src/parallel/parallel.d.ts +1 -1
  117. package/flow-diagram/src/queue/queue.d.ts +1 -1
  118. package/flow-diagram/src/queue/queue.rect.d.ts +1 -1
  119. package/flow-diagram/src/queue/queue.rect.js +1 -1
  120. package/flow-diagram/src/register.js +1 -1
  121. package/flow-diagram/src/subprocess/subprocess.d.ts +1 -1
  122. package/flow-diagram/src/subprocess/subprocess.rect.d.ts +1 -1
  123. package/flow-diagram/src/subprocess/subprocess.rect.js +1 -1
  124. package/layout/src/align.d.ts +1 -1
  125. package/layout/src/align.js +1 -1
  126. package/layout/src/layout.d.ts +1 -1
  127. package/layout/src/layout.js +1 -1
  128. package/myShape-diagram/myShape.js +1 -1
  129. package/package.json +1 -1
  130. package/sequence-diagram/src/focus/focus.anchor.d.ts +1 -1
  131. package/sequence-diagram/src/focus/focus.anchor.js +1 -1
  132. package/sequence-diagram/src/focus/focus.d.ts +1 -1
  133. package/sequence-diagram/src/focus/focus.rect.d.ts +1 -1
  134. package/sequence-diagram/src/focus/focus.rect.js +1 -1
  135. package/sequence-diagram/src/lifeline/lifeline.anchor.d.ts +1 -1
  136. package/sequence-diagram/src/lifeline/lifeline.anchor.js +1 -1
  137. package/sequence-diagram/src/lifeline/lifeline.d.ts +1 -1
  138. package/sequence-diagram/src/lifeline/lifeline.rect.d.ts +1 -1
  139. package/sequence-diagram/src/lifeline/lifeline.rect.js +1 -1
  140. package/sequence-diagram/src/register.js +1 -1
  141. package/chart-diagram/src/utils/changeOptions.d.ts +0 -4
  142. package/chart-diagram/src/utils/changeOptions.js +0 -163
  143. package/chart-diagram/src/utils/conversion.d.ts +0 -17
  144. package/chart-diagram/src/utils/conversion.js +0 -179
  145. package/chart-diagram/src/utils/drawGraphic.d.ts +0 -3
  146. package/chart-diagram/src/utils/drawGraphic.js +0 -97
  147. package/chart-diagram/src/utils/index.d.ts +0 -3
  148. package/chart-diagram/src/utils/index.js +0 -3
  149. package/core/src/middles/arrows/index.d.ts +0 -4
  150. package/core/src/middles/arrows/index.js +0 -5
  151. package/core/src/middles/lines/index.d.ts +0 -4
  152. package/core/src/middles/lines/index.js +0 -5
  153. package/core/src/middles/nodes/iframe.d.ts +0 -2
  154. package/core/src/middles/nodes/iframe.js +0 -12
  155. package/core/src/middles/nodes/index.d.ts +0 -46
  156. package/core/src/middles/nodes/index.js +0 -47
  157. package/core/src/store/common.d.ts +0 -9
  158. package/core/src/store/common.js +0 -5
  159. package/core/src/store/data.d.ts +0 -129
  160. package/core/src/store/data.js +0 -86
  161. package/core/src/store/index.d.ts +0 -2
  162. package/core/src/store/index.js +0 -2
  163. package/core/src/utils/assignment.d.ts +0 -3
  164. package/core/src/utils/assignment.js +0 -69
  165. package/static/echartsDefaultData.js +0 -239
  166. package/static/echartsStore.js +0 -14
  167. package/static/index.js +0 -2
  168. package/style/index.css +0 -13
@@ -13,20 +13,22 @@ var __extends = (this && this.__extends) || (function () {
13
13
  })();
14
14
  import { Store } from 'le5le-store';
15
15
  import { Canvas } from './canvas';
16
- import { commonStore } from './store'
16
+ import {previewType} from './utils/construction'
17
17
  //let isQttFillStyle = false;
18
18
  var RenderLayer = /** @class */ (function (_super) {
19
19
  __extends(RenderLayer, _super);
20
- function RenderLayer(TID) {
20
+ function RenderLayer(parentElem, options, TID) {
21
21
  //isQttFillStyle = false;
22
- var _this = _super.call(this, TID) || this;
22
+ if (options === void 0) { options = {}; }
23
+ var _this = _super.call(this, parentElem, options, TID) || this;
24
+ _this.parentElem = parentElem;
25
+ _this.options = options;
23
26
  _this.bkImgRect = null;
24
27
  _this.initImage = false;
25
28
  _this.coverType = 'container';
26
29
  _this.bgRect = null;
27
30
  _this.render = function () {
28
- if(!commonStore || !commonStore[TID]) return;
29
- if (commonStore[TID].data.bkImage && !_this.initImage) {
31
+ if (_this.data.bkImage && !_this.initImage) {
30
32
  _this.loadBkImg(_this.render, 'pixi');
31
33
  return;
32
34
  }
@@ -35,8 +37,12 @@ var RenderLayer = /** @class */ (function (_super) {
35
37
  }
36
38
  var ctx = _this.canvas.getContext('2d');
37
39
  ctx.clearRect(0, 0, _this.canvas.width, _this.canvas.height);
38
- if (commonStore[TID].data.bkColor) {
39
- ctx.fillStyle = commonStore[TID].data.bkColor;
40
+ // if (_this.data.pens && _this.data.pens.length > 0 && !isQttFillStyle) {
41
+ // _this.data.pens.map((penItem) => {penItem.defaultFillStyle = penItem.fillStyle;})
42
+ // isQttFillStyle = true;
43
+ // }
44
+ if (_this.data.bkColor) {
45
+ ctx.fillStyle = _this.data.bkColor;
40
46
  ctx.fillRect(0, 0, _this.width, _this.height);
41
47
  }
42
48
  if (_this.bkImg && _this.bkImgRect) {
@@ -46,38 +52,34 @@ var RenderLayer = /** @class */ (function (_super) {
46
52
  ctx.drawImage(_this.offscreen, 0, 0, _this.width, _this.height);
47
53
  };
48
54
  _this.offscreen = Store.get(_this.generateStoreKey('LT:offscreen'));
49
- commonStore[TID].parentElem.appendChild(_this.canvas);
55
+ _this.parentElem.appendChild(_this.canvas);
50
56
  return _this;
51
57
  }
52
58
  RenderLayer.prototype.scale = function (scale, center, w, h){
53
- const TID = this.TID;
54
- if(!commonStore || !commonStore[TID]) return;
55
- const bkImage = commonStore[TID].data.bkImage;
56
- const bkImageRect = commonStore[TID].data.bkImageRect;
57
- if(!bkImage) return;
59
+ if(!this.data.bkImage) return;
58
60
  if(!center) {
59
- center = bkImageRect ? bkImageRect.center : this.bgRect.center;
61
+ center = this.data.bkImageRect ? this.data.bkImageRect.center : this.bgRect.center;
60
62
  }
61
63
  if (!w) {
62
64
  w = scale;
63
- if(bkImageRect) {
64
- bkImageRect.x = center.x - (center.x - bkImageRect.x) * w;
65
+ if(this.data.bkImageRect) {
66
+ this.data.bkImageRect.x = center.x - (center.x - this.data.bkImageRect.x) * w;
65
67
  }else {
66
68
  this.bgRect.x = center.x - (center.x - this.bgRect.x) * w;
67
69
  }
68
70
  }
69
71
  if (!h) {
70
72
  h = scale;
71
- if(bkImageRect){
72
- bkImageRect.y = center.y - (center.y - bkImageRect.y) * h;
73
+ if(this.data.bkImageRect){
74
+ this.data.bkImageRect.y = center.y - (center.y - this.data.bkImageRect.y) * h;
73
75
  }else {
74
76
  this.bgRect.y = center.y - (center.y - this.bgRect.y) * h;
75
77
  }
76
78
  }
77
- if(bkImageRect) {
78
- bkImageRect.width *= w;
79
- bkImageRect.height *= h;
80
- this.bkImgRect = bkImageRect;
79
+ if(this.data.bkImageRect) {
80
+ this.data.bkImageRect.width *= w;
81
+ this.data.bkImageRect.height *= h;
82
+ this.bkImgRect = this.data.bkImageRect;
81
83
  }else {
82
84
  if(this.initImage) {
83
85
  this.bgRect.width *= w;
@@ -88,13 +90,12 @@ var RenderLayer = /** @class */ (function (_super) {
88
90
  };
89
91
  RenderLayer.prototype.loadBkImg = function (cb, pixi) {
90
92
  var _this = this;
91
- const bkImage = commonStore[_this.TID].data.bkImage;
92
- if (!bkImage || this.initImage) {
93
+ if (!this.data.bkImage || this.initImage) {
93
94
  return;
94
95
  }
95
96
  this.bkImg = new Image();
96
97
  this.bkImg.crossOrigin = 'anonymous';
97
- this.bkImg.src = bkImage;
98
+ this.bkImg.src = this.data.bkImage;
98
99
  this.bkImg.onload = function () {
99
100
  if(pixi && !_this.bkImgRect) {
100
101
  _this.bkImgRectResize({width: _this.canvas.width, height: _this.canvas.height});
@@ -148,7 +149,7 @@ var RenderLayer = /** @class */ (function (_super) {
148
149
  };
149
150
 
150
151
  RenderLayer.prototype.bkImgRectResize = function (size) {
151
- const bkImageRect = commonStore[this.TID].data.bkImageRect;
152
+ const bkImageRect = this.data.bkImageRect;
152
153
  if(!size) return;
153
154
  if(bkImageRect) {
154
155
  let x = bkImageRect.x ? Number(bkImageRect.x) : 0;
@@ -169,12 +170,16 @@ var RenderLayer = /** @class */ (function (_super) {
169
170
 
170
171
  RenderLayer.prototype.destroy = function() {
171
172
 
173
+ this.data = null;
174
+
172
175
  this.canvas = null;
173
176
 
174
177
  this.render = null;
175
178
 
176
179
  this.offscreen = null;
177
180
 
181
+ this.options = null;
182
+
178
183
  }
179
184
  return RenderLayer;
180
185
  }(Canvas));
@@ -0,0 +1,10 @@
1
+ import { TopologyData } from './models';
2
+ export declare class Socket {
3
+ url: string;
4
+ data: TopologyData;
5
+ socket: WebSocket;
6
+ constructor(url: string, data: TopologyData);
7
+ init(): void;
8
+ onmessage: (e: MessageEvent) => void;
9
+ close(): void;
10
+ }
@@ -0,0 +1,51 @@
1
+ import { EventType } from './models';
2
+ var Socket = /** @class */ (function () {
3
+ function Socket(url, data) {
4
+ var _this = this;
5
+ this.url = url;
6
+ this.data = data;
7
+ this.onmessage = function (e) {
8
+ if (!_this.data.pens.length || !e || !e.data) {
9
+ return;
10
+ }
11
+ var msg;
12
+ try {
13
+ msg = JSON.parse(e.data);
14
+ }
15
+ catch (error) {
16
+ msg = e.data;
17
+ }
18
+ for (var _i = 0, _a = _this.data.pens; _i < _a.length; _i++) {
19
+ var item = _a[_i];
20
+ for (var _b = 0, _c = item.events; _b < _c.length; _b++) {
21
+ var event_1 = _c[_b];
22
+ if (event_1.type === EventType.WebSocket) {
23
+ if (event_1.name && event_1.name === msg.event) {
24
+ item.doSocketMqtt(event_1, msg.data, _this.socket);
25
+ }
26
+ else if (!event_1.name && msg) {
27
+ item.doSocketMqtt(event_1, msg, _this.socket);
28
+ }
29
+ }
30
+ }
31
+ }
32
+ };
33
+ this.init();
34
+ }
35
+ Socket.prototype.init = function () {
36
+ var _this = this;
37
+ this.socket = new WebSocket(this.url);
38
+ this.socket.onmessage = this.onmessage;
39
+ this.socket.onclose = function () {
40
+ console.log('Canvas websocket closed and reconneting...');
41
+ _this.init();
42
+ };
43
+ };
44
+ Socket.prototype.close = function () {
45
+ this.socket.onclose = null;
46
+ this.socket.close();
47
+ };
48
+ return Socket;
49
+ }());
50
+ export { Socket };
51
+ //# sourceMappingURL=socket.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"socket.js","sourceRoot":"","sources":["../../../packages/core/src/socket.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAgB,MAAM,UAAU,CAAC;AAEnD;IAEE,gBAAmB,GAAW,EAAS,IAAkB;QAAzD,iBAEC;QAFkB,QAAG,GAAH,GAAG,CAAQ;QAAS,SAAI,GAAJ,IAAI,CAAc;QAczD,cAAS,GAAG,UAAC,CAAe;YAC1B,IAAI,CAAC,KAAI,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,EAAE;gBAC3C,OAAO;aACR;YAED,IAAI,GAAkC,CAAC;YACvC,IAAI;gBACF,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;aAC1B;YAAC,OAAO,KAAK,EAAE;gBACd,GAAG,GAAG,CAAC,CAAC,IAAI,CAAC;aACd;YAED,KAAmB,UAAc,EAAd,KAAA,KAAI,CAAC,IAAI,CAAC,IAAI,EAAd,cAAc,EAAd,IAAc,EAAE;gBAA9B,IAAM,IAAI,SAAA;gBACb,KAAoB,UAAW,EAAX,KAAA,IAAI,CAAC,MAAM,EAAX,cAAW,EAAX,IAAW,EAAE;oBAA5B,IAAM,OAAK,SAAA;oBACd,IAAI,OAAK,CAAC,IAAI,KAAK,SAAS,CAAC,SAAS,EAAE;wBACtC,IAAI,OAAK,CAAC,IAAI,IAAI,OAAK,CAAC,IAAI,KAAK,GAAG,CAAC,KAAK,EAAE;4BAC1C,IAAI,CAAC,YAAY,CAAC,OAAK,EAAE,GAAG,CAAC,IAAI,EAAE,KAAI,CAAC,MAAM,CAAC,CAAC;yBACjD;6BAAM,IAAI,CAAC,OAAK,CAAC,IAAI,IAAI,GAAG,EAAE;4BAC7B,IAAI,CAAC,YAAY,CAAC,OAAK,EAAE,GAAG,EAAE,KAAI,CAAC,MAAM,CAAC,CAAC;yBAC5C;qBACF;iBACF;aACF;QACH,CAAC,CAAC;QApCA,IAAI,CAAC,IAAI,EAAE,CAAC;IACd,CAAC;IAED,qBAAI,GAAJ;QAAA,iBAQC;QAPC,IAAI,CAAC,MAAM,GAAG,IAAI,SAAS,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QACtC,IAAI,CAAC,MAAM,CAAC,SAAS,GAAG,IAAI,CAAC,SAAS,CAAC;QAEvC,IAAI,CAAC,MAAM,CAAC,OAAO,GAAG;YACpB,OAAO,CAAC,GAAG,CAAC,4CAA4C,CAAC,CAAC;YAC1D,KAAI,CAAC,IAAI,EAAE,CAAC;QACd,CAAC,CAAC;IACJ,CAAC;IA2BD,sBAAK,GAAL;QACE,IAAI,CAAC,MAAM,CAAC,OAAO,GAAG,IAAI,CAAC;QAC3B,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC;IACtB,CAAC;IACH,aAAC;AAAD,CAAC,AA7CD,IA6CC"}
@@ -1,4 +1,4 @@
1
- import { Point } from '../models';
1
+ import { Point } from '../models/point';
2
2
  export function flatNodes(nodes) {
3
3
  var result = {
4
4
  nodes: [],
@@ -1,7 +0,0 @@
1
- import {Node} from "../models";
2
-
3
- export declare function setTagIdData(data: any): [];
4
- export declare function setKpiAddrData(data: any): [];
5
- export declare function setAssetIdData(data: any): [];
6
- export declare function setAreaIdData(data: any): [];
7
- export declare function setThreeCategoryIdData(pen: Node, data: any): [];
@@ -1,54 +0,0 @@
1
- export function setTagIdData(data) {
2
- return [{
3
- "key": "tagId",
4
- "value": data.tagId,
5
- "isControlDis": data.isControlDis,
6
- "type": data.tagType,
7
- "tagVal": data.value,
8
- "valExplain": data.valExplain,
9
- "tagId": data.tagId
10
- }, {
11
- "key": "测点名称",
12
- "value": data.tagName
13
- }];
14
- }
15
- export function setKpiAddrData(data) {
16
- return [{
17
- "key": "kpiAddr",
18
- "value": data.kpiId + '_' + data.kpiAddr,
19
- "isControlDis": data.isControlDis,
20
- "type": data.tagType
21
- }, {
22
- "key": "指标名称",
23
- "value": data.kpiName
24
- }];
25
- }
26
- export function setAssetIdData(data) {
27
- return [{
28
- "key": "assetId",
29
- "value": data.id
30
- }, {
31
- "key": "资产名称",
32
- "value": data.name
33
- }];
34
- }
35
- export function setAreaIdData(data) {
36
- return [{
37
- "key": "areaId",
38
- "value": data.id
39
- }, {
40
- "key": "区域名称",
41
- "value": data.name
42
- }];
43
- }
44
- export function setThreeCategoryIdData(pen, data) {
45
- let params = [];
46
- const hasThreeCategoryId = pen.data.find((tc) => {
47
- return tc.key === 'threeCategoryId' && tc.value.includes(data.threeCategoryId);
48
- });
49
- if(!hasThreeCategoryId) params = [{
50
- "key": "threeCategoryId",
51
- "value": data.threeCategoryId
52
- }];
53
- return params;
54
- }
@@ -1,9 +1,8 @@
1
- import { Node } from '../models';
2
- import { visualization2DStore } from '../store';
1
+ import { Node } from '../models/node';
2
+ // @ts-ignore
3
+ import { TopologyData } from 'dcim-topology/core'
3
4
  export declare let DomElements: {};
4
- export declare let DomIframes: {};
5
- export declare function createChildrenDivByElementId(node: Node, data?: visualization2DStore): HTMLDivElement;
6
- export declare function createIframeElement(node: Node): HTMLDivElement;
7
- export declare function setStyleForElementIdDiv(node: Node, elem: HTMLElement, data: visualization2DStore): void;
5
+ export declare function createChildrenDivByElementId(node: Node, data?: TopologyData): HTMLDivElement;
6
+ export declare function setStyleForElementIdDiv(node: Node, elem: HTMLElement, data: TopologyData): void;
8
7
  export declare function createDiv(node: Node): HTMLDivElement;
9
8
  export declare function loadJS(url: string, callback?: () => void, render?: boolean): void;
@@ -1,74 +1,40 @@
1
- import {Store} from 'le5le-store';
2
- import {Lock} from '../models'
3
- import {commonStore} from '../store';
4
-
1
+ import { Store } from 'le5le-store';
2
+ import { Lock } from 'dcim-topology/core/src/models/status'
5
3
  export let DomElements = {};
6
- export let DomIframes = {};
7
-
8
4
  export function createChildrenDivByElementId(node, data) {
9
- if (!data) data = commonStore[node.TID] && commonStore[node.TID].data;
10
- // echarts图表的初始化渲染
11
- if (node.elementId) {
12
- if (!DomElements[node.id]) {
13
- DomElements[node.id] = document.getElementById(node.id);
14
- if (DomElements[node.id]) {
15
- document.querySelector('.canvas-point').appendChild(DomElements[node.id]);
16
- }
17
- }
18
- setStyleForElementIdDiv(node, DomElements[node.id], data);
19
- }
20
- // iframe元件的初始化渲染
21
- if (node.iframe) {
22
- if (!DomIframes[node.id]) {
23
- let iframe = document.getElementById(`iframe${node.id}`);
24
- if (!(iframe && iframe.length)) iframe = createIframeElement(node);
25
- DomIframes[node.id] = iframe;
26
- if (DomIframes[node.id]) {
27
- commonStore[node.TID].parentElem.appendChild(DomIframes[node.id]);
28
- }
29
- }
30
- setStyleForElementIdDiv(node, DomIframes[node.id], data);
5
+ if (!DomElements[node.id]) {
6
+ DomElements[node.id] = document.getElementById(node.id);
7
+ if (DomElements[node.id]) {
8
+ document.querySelector('.canvas-point').appendChild(DomElements[node.id]);
31
9
  }
10
+ }
11
+ setStyleForElementIdDiv(node, DomElements[node.id], data);
32
12
  }
33
-
34
- export function createIframeElement(node) {
35
- const iframe = document.createElement('iframe');
36
- // iframe.scrolling = 'no';
37
- iframe.frameBorder = '0';
38
- iframe.src = node.iframe;
39
- iframe.width = node.rect.width;
40
- iframe.height = node.rect.height;
41
- iframe.setAttribute('id', `iframe${node.id}`);
42
- iframe.setAttribute('class', 'topology2dConfIfram');
43
- return iframe;
44
- }
45
-
46
13
  export function setStyleForElementIdDiv(node, elem, data) {
47
- if (!elem) {
48
- return;
49
- }
50
- elem.style.position = 'absolute';
51
- elem.style.outline = 'none';
52
- elem.style.left = node.rect.x + 'px';
53
- elem.style.top = node.rect.y + 'px';
54
- elem.style.width = node.rect.width + 'px';
55
- elem.style.height = node.rect.height + 'px';
56
- if (node.rotate || node.offsetRotate) {
57
- elem.style.transform = "rotate(" + (node.rotate + node.offsetRotate) + "deg)";
58
- }
59
- // if (node.video && this.videos[node.id] && this.videos[node.id].media) {
60
- // this.videos[node.id].media.style.width = '100%';
61
- // this.videos[node.id].media.style.height = '100%';
62
- // }
63
- if (data && data.locked > Lock.None || node.locked > Lock.None) {
64
- elem.style.userSelect = 'initial';
65
- elem.style.pointerEvents = 'initial';
66
- } else {
67
- elem.style.userSelect = 'none';
68
- elem.style.pointerEvents = 'none';
69
- }
14
+ if (!elem) {
15
+ return;
16
+ }
17
+ elem.style.position = 'absolute';
18
+ elem.style.outline = 'none';
19
+ elem.style.left = node.rect.x + 'px';
20
+ elem.style.top = node.rect.y + 'px';
21
+ elem.style.width = node.rect.width + 'px';
22
+ elem.style.height = node.rect.height + 'px';
23
+ if (node.rotate || node.offsetRotate) {
24
+ elem.style.transform = "rotate(" + (node.rotate + node.offsetRotate) + "deg)";
25
+ }
26
+ // if (node.video && this.videos[node.id] && this.videos[node.id].media) {
27
+ // this.videos[node.id].media.style.width = '100%';
28
+ // this.videos[node.id].media.style.height = '100%';
29
+ // }
30
+ if (data && data.locked > Lock.None || node.locked > Lock.None) {
31
+ elem.style.userSelect = 'initial';
32
+ elem.style.pointerEvents = 'initial';
33
+ } else {
34
+ elem.style.userSelect = 'none';
35
+ elem.style.pointerEvents = 'none';
36
+ }
70
37
  }
71
-
72
38
  export function createDiv(node) {
73
39
  var div = document.createElement('div');
74
40
  div.style.position = 'absolute';
@@ -83,21 +49,19 @@ export function createDiv(node) {
83
49
  div.id = node.id;
84
50
  return div;
85
51
  }
86
-
87
- // export function loadJS(url, callback, render) {
88
- // var loaderScript = document.createElement('script');
89
- // loaderScript.type = 'text/javascript';
90
- // loaderScript.src = url;
91
- // loaderScript.addEventListener('load', function () {
92
- // if (callback) {
93
- // callback();
94
- // }
95
- // // how to do
96
- // if (render) {
97
- // Store.set('LT:render', true);
98
- // }
99
- // });
100
- // document.body.appendChild(loaderScript);
101
- // }
102
-
52
+ export function loadJS(url, callback, render) {
53
+ var loaderScript = document.createElement('script');
54
+ loaderScript.type = 'text/javascript';
55
+ loaderScript.src = url;
56
+ loaderScript.addEventListener('load', function () {
57
+ if (callback) {
58
+ callback();
59
+ }
60
+ // how to do
61
+ if (render) {
62
+ Store.set('LT:render', true);
63
+ }
64
+ });
65
+ document.body.appendChild(loaderScript);
66
+ }
103
67
  //# sourceMappingURL=dom.js.map
@@ -7,4 +7,3 @@ export * from './padding'
7
7
  export * from './construction';
8
8
  export * from './onmousevent';
9
9
  export * from './conversion';
10
- export * from './assignment';
@@ -7,5 +7,4 @@ export * from './padding'
7
7
  export * from './construction';
8
8
  export * from './onmousevent';
9
9
  export * from './conversion';
10
- export * from './assignment';
11
10
  //# sourceMappingURL=index.js.map
@@ -1,6 +1,5 @@
1
1
  import { ptInPolyXY } from './math';
2
2
  import { moveDataType, downDataType } from './construction'
3
- import { Node } from '../models'
4
3
  // 执行window函数
5
4
  export function omouseEventPrototDoWindowFn (eventNode, node) {
6
5
 
@@ -19,16 +18,8 @@ export function mousMoveFun(type, pos, data) {
19
18
 
20
19
  for (var _i = 0, _a = data; _i < _a.length; _i++) {
21
20
  var item = _a[_i];
22
- //const isPoint = ptInPolyXY(pos, item.rotatedAnchors);
23
- let isInPointNode = null;
24
- if(item.name === 'arbitraryGraph') {
25
- // 任意多边形通过点获取区域
26
- isInPointNode = ptInPolyXY(pos, item.rotatedAnchors);
27
- }else {
28
- if(!(item instanceof Node)) item = new Node(item);
29
- isInPointNode = item.hit(pos);
30
- }
31
- if(isInPointNode) {
21
+ const isPoint = ptInPolyXY(pos, item.rotatedAnchors);
22
+ if(isPoint) {
32
23
  params.hoverNode = item;
33
24
  params.order = _i;
34
25
  }
@@ -52,7 +43,7 @@ export function mousDownFun(type, eventNode) {
52
43
  if(action === 3) {
53
44
  params.eventType = downDataType.Window; // 打开会话窗口
54
45
  }else if(action === 7){
55
- params.eventType = downDataType.Showhide; // 显示/隐藏
46
+ params.eventType = downDataType.Showhide; // 链接跳转
56
47
  params.value = eventNode.value;
57
48
  }else if(action === 8){
58
49
  params.eventType = downDataType.Tabswitch; // Tab切换
@@ -1,2 +1,2 @@
1
- import { Node } from '../../../core';
1
+ import { Node } from 'dcim-topology/core';
2
2
  export declare function flowCommentAnchors(node: Node): void;
@@ -1,4 +1,4 @@
1
- import { Point, Direction } from '../../../core';
1
+ import { Point, Direction } from 'dcim-topology/core';
2
2
  export function flowCommentAnchors(node) {
3
3
  node.anchors.push(new Point(node.rect.x, node.rect.y + node.rect.height / 2, Direction.Left));
4
4
  }
@@ -1,2 +1,2 @@
1
- import { Node } from '../../../core';
1
+ import { Node } from 'dcim-topology/core';
2
2
  export declare function flowComment(ctx: CanvasRenderingContext2D, node: Node): void;
@@ -1,2 +1,2 @@
1
- import { Node } from '../../../core';
1
+ import { Node } from 'dcim-topology/core';
2
2
  export declare function flowDataAnchors(node: Node): void;
@@ -1,4 +1,4 @@
1
- import { Point, Direction } from '../../../core';
1
+ import { Point, Direction } from 'dcim-topology/core';
2
2
  export function flowDataAnchors(node) {
3
3
  node.anchors.push(new Point(node.rect.x + node.rect.width / 14, node.rect.y + node.rect.height / 2, Direction.Left));
4
4
  node.anchors.push(new Point(node.rect.x + (node.rect.width * 4) / 7, node.rect.y, Direction.Up));
@@ -1,2 +1,2 @@
1
- import { Node } from '../../../core';
1
+ import { Node } from 'dcim-topology/core';
2
2
  export declare function flowData(ctx: CanvasRenderingContext2D, node: Node): void;
@@ -1,3 +1,3 @@
1
- import { Node } from '../../../core';
1
+ import { Node } from 'dcim-topology/core';
2
2
  export declare function flowDataIconRect(node: Node): void;
3
3
  export declare function flowDataTextRect(node: Node): void;
@@ -1,4 +1,4 @@
1
- import { Rect } from '../../../core';
1
+ import { Rect } from 'dcim-topology/core';
2
2
  export function flowDataIconRect(node) {
3
3
  node.iconRect = new Rect(0, 0, 0, 0);
4
4
  }
@@ -1,2 +1,2 @@
1
- import { Node } from '../../../core';
1
+ import { Node } from 'dcim-topology/core';
2
2
  export declare function flowDb(ctx: CanvasRenderingContext2D, node: Node): void;
@@ -1,4 +1,4 @@
1
1
  // @ts-ignore
2
- import { Node } from '../../../core';
2
+ import { Node } from 'dcim-topology/core';
3
3
  export declare function flowDbIconRect(node: Node): void;
4
4
  export declare function flowDbTextRect(node: Node): void;
@@ -1,4 +1,4 @@
1
- import { Rect } from '../../../core';
1
+ import { Rect } from 'dcim-topology/core';
2
2
  export function flowDbIconRect(node) {
3
3
  node.iconRect = new Rect(0, 0, 0, 0);
4
4
  }
@@ -1,2 +1,2 @@
1
- import { Node } from '../../../core';
1
+ import { Node } from 'dcim-topology/core';
2
2
  export declare function flowDisplayAnchors(node: Node): void;
@@ -1,4 +1,4 @@
1
- import { Point, Direction } from '../../../core';
1
+ import { Point, Direction } from 'dcim-topology/core';
2
2
  export function flowDisplayAnchors(node) {
3
3
  node.anchors.push(new Point(node.rect.x, node.rect.y + node.rect.height / 2, Direction.Left));
4
4
  node.anchors.push(new Point(node.rect.x + node.rect.width / 2, node.rect.y, Direction.Up));
@@ -1,2 +1,2 @@
1
- import { Node } from '../../../core';
1
+ import { Node } from 'dcim-topology/core';
2
2
  export declare function flowDisplay(ctx: CanvasRenderingContext2D, node: Node): void;
@@ -1,3 +1,3 @@
1
- import { Node } from '../../../core';
1
+ import { Node } from 'dcim-topology/core';
2
2
  export declare function flowDisplayIconRect(node: Node): void;
3
3
  export declare function flowDisplayTextRect(node: Node): void;
@@ -1,4 +1,4 @@
1
- import { Rect } from '../../../core';
1
+ import { Rect } from 'dcim-topology/core';
2
2
  export function flowDisplayIconRect(node) {
3
3
  node.iconRect = new Rect(0, 0, 0, 0);
4
4
  }
@@ -1,2 +1,2 @@
1
- import { Node } from '../../../core';
1
+ import { Node } from 'dcim-topology/core';
2
2
  export declare function flowDocumentAnchors(node: Node): void;
@@ -1,4 +1,4 @@
1
- import { Point, Direction } from '../../../core';
1
+ import { Point, Direction } from 'dcim-topology/core';
2
2
  export function flowDocumentAnchors(node) {
3
3
  node.anchors.push(new Point(node.rect.x, node.rect.y + node.rect.height / 2, Direction.Left));
4
4
  node.anchors.push(new Point(node.rect.x + node.rect.width / 2, node.rect.y, Direction.Up));
@@ -1,2 +1,2 @@
1
- import { Node } from '../../../core';
1
+ import { Node } from 'dcim-topology/core';
2
2
  export declare function flowDocument(ctx: CanvasRenderingContext2D, node: Node): void;
@@ -1,3 +1,3 @@
1
- import { Node } from '../../../core';
1
+ import { Node } from 'dcim-topology/core';
2
2
  export declare function flowDocumentIconRect(node: Node): void;
3
3
  export declare function flowDocumentTextRect(node: Node): void;
@@ -1,4 +1,4 @@
1
- import { Rect } from '../../../core';
1
+ import { Rect } from 'dcim-topology/core';
2
2
  export function flowDocumentIconRect(node) {
3
3
  node.iconRect = new Rect(0, 0, 0, 0);
4
4
  }
@@ -1,2 +1,2 @@
1
- import { Node } from '../../../core';
1
+ import { Node } from 'dcim-topology/core';
2
2
  export declare function flowExternStorageAnchors(node: Node): void;
@@ -1,4 +1,4 @@
1
- import { Point, Direction } from '../../../core';
1
+ import { Point, Direction } from 'dcim-topology/core';
2
2
  export function flowExternStorageAnchors(node) {
3
3
  node.anchors.push(new Point(node.rect.x, node.rect.y + node.rect.height / 2, Direction.Left));
4
4
  node.anchors.push(new Point(node.rect.x + (node.rect.width * 8) / 15, node.rect.y, Direction.Up));
@@ -1,2 +1,2 @@
1
- import { Node } from '../../../core';
1
+ import { Node } from 'dcim-topology/core';
2
2
  export declare function flowExternStorage(ctx: CanvasRenderingContext2D, node: Node): void;
@@ -1,3 +1,3 @@
1
- import { Node } from '../../../core';
1
+ import { Node } from 'dcim-topology/core';
2
2
  export declare function flowExternStorageIconRect(node: Node): void;
3
3
  export declare function flowExternStorageTextRect(node: Node): void;