dcim-topology2d 2.2.0 → 2.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (42) hide show
  1. package/chart-diagram/index.d.ts +1 -1
  2. package/chart-diagram/index.js +1 -1
  3. package/chart-diagram/src/echarts/index.js +112 -112
  4. package/chart-diagram/src/utils/changeOptions.d.ts +8 -8
  5. package/chart-diagram/src/utils/changeOptions.js +8 -2
  6. package/chart-diagram/src/utils/conversion.d.ts +19 -19
  7. package/chart-diagram/src/utils/conversion.js +601 -560
  8. package/chart-diagram/src/utils/drawGraphic.d.ts +3 -3
  9. package/chart-diagram/src/utils/drawGraphic.js +97 -97
  10. package/chart-diagram/src/utils/index.d.ts +5 -5
  11. package/chart-diagram/src/utils/index.js +5 -5
  12. package/chart-diagram/src/utils/render.js +4 -0
  13. package/core/index.js +1 -19
  14. package/core/src/activeLayer.js +23 -23
  15. package/core/src/calling.js +32 -33
  16. package/core/src/common.d.ts +1 -0
  17. package/core/src/common.js +106 -75
  18. package/core/src/element/common.js +0 -1
  19. package/core/src/healps/changeData.js +3 -0
  20. package/core/src/middles/default.js +3 -1
  21. package/core/src/middles/index.d.ts +1 -2
  22. package/core/src/middles/index.js +3 -2
  23. package/core/src/middles/nodes/formDatePicker.js +1 -0
  24. package/core/src/middles/nodes/formoverflow.js +17 -16
  25. package/core/src/middles/nodes/index.d.ts +2 -1
  26. package/core/src/middles/nodes/index.js +1 -0
  27. package/core/src/middles/nodes/progress.d.ts +2 -0
  28. package/core/src/middles/nodes/progress.js +63 -0
  29. package/core/src/middles/nodes/progress.js.map +1 -0
  30. package/core/src/middles/nodes/rectangle.js +54 -15
  31. package/core/src/models/node.js +7 -0
  32. package/core/src/models/pen.js +10 -1
  33. package/core/src/preview.js +63 -37
  34. package/core/src/store/data.d.ts +9 -0
  35. package/core/src/store/data.js +5 -0
  36. package/core/src/utils/assignment.d.ts +1 -1
  37. package/core/src/utils/assignment.js +18 -5
  38. package/package.json +1 -1
  39. package/static/echartsDefaultData.js +178 -178
  40. package/store/actions.js +2 -1
  41. package/store/clear.js +4 -0
  42. /package/myShape-diagram/{index.ts → index.d.ts} +0 -0
@@ -1,23 +1,62 @@
1
1
  export function rectangle(ctx, node) {
2
- var wr = node.borderRadius;
3
- var hr = node.borderRadius;
4
- if (node.borderRadius < 1) {
5
- wr = node.rect.width * node.borderRadius;
6
- hr = node.rect.height * node.borderRadius;
2
+
3
+ var topLeftR = node.borderRadiusTopLeft;
4
+ var topRightR = node.borderRadiusTopRight;
5
+ var bottomLeftR = node.borderRadiusBottomLeft;
6
+ var bottomRightR = node.borderRadiusBottomRight;
7
+
8
+
9
+ var w = node.rect.width > node.rect.height ? node.rect.height : node.rect.width;
10
+
11
+
12
+ if (node.borderRadiusTopLeft < 1) {
13
+
14
+ topLeftR = w * node.borderRadiusTopLeft;
15
+
7
16
  }
8
- var r = wr < hr ? wr : hr;
9
- if (node.rect.width < 2 * r) {
10
- r = node.rect.width / 2;
17
+ if (node.borderRadiusTopRight < 1) {
18
+
19
+ topRightR = w * node.borderRadiusTopRight;
20
+
11
21
  }
12
- if (node.rect.height < 2 * r) {
13
- r = node.rect.height / 2;
22
+ if (node.borderRadiusBottomLeft < 1) {
23
+
24
+ bottomLeftR = w * node.borderRadiusBottomLeft;
25
+
14
26
  }
27
+ if (node.borderRadiusBottomRight < 1) {
28
+
29
+ bottomRightR = w * node.borderRadiusBottomRight;
30
+
31
+ }
32
+
33
+ var tlr = topLeftR;
34
+ if (w < 2 * tlr) {
35
+ tlr = w / 2
36
+ }
37
+
38
+ var trr = topRightR;
39
+ if (w < 2 * trr) {
40
+ trr = w / 2
41
+ }
42
+
43
+ var blr = bottomLeftR;
44
+ if (w < 2 * blr) {
45
+ blr = w / 2
46
+ }
47
+
48
+ var brr = bottomRightR;
49
+ if (w < 2 * brr) {
50
+ brr = w / 2
51
+ }
52
+
15
53
  ctx.beginPath();
16
- ctx.moveTo(node.rect.x + r, node.rect.y);
17
- ctx.arcTo(node.rect.x + node.rect.width, node.rect.y, node.rect.x + node.rect.width, node.rect.y + node.rect.height, r);
18
- ctx.arcTo(node.rect.x + node.rect.width, node.rect.y + node.rect.height, node.rect.x, node.rect.y + node.rect.height, r);
19
- ctx.arcTo(node.rect.x, node.rect.y + node.rect.height, node.rect.x, node.rect.y, r);
20
- ctx.arcTo(node.rect.x, node.rect.y, node.rect.x + node.rect.width, node.rect.y, r);
54
+
55
+ ctx.moveTo(node.rect.x + tlr, node.rect.y);
56
+ ctx.arcTo(node.rect.x + node.rect.width, node.rect.y, node.rect.x + node.rect.width, node.rect.y + node.rect.height, trr);
57
+ ctx.arcTo(node.rect.x + node.rect.width, node.rect.y + node.rect.height, node.rect.x, node.rect.y + node.rect.height, brr);
58
+ ctx.arcTo(node.rect.x, node.rect.y + node.rect.height, node.rect.x, node.rect.y, blr);
59
+ ctx.arcTo(node.rect.x, node.rect.y, node.rect.x + node.rect.width, node.rect.y, tlr);
21
60
  ctx.closePath();
22
61
  (node.fillStyle || node.bkType) && ctx.fill();
23
62
  ctx.stroke();
@@ -96,6 +96,7 @@ var Node = /** @class */ (function (_super) {
96
96
  _this.visitStrokeStyle = json.visitStrokeStyle || '';
97
97
  _this.thBottomStrokeStyle = json.thBottomStrokeStyle || '#fff';
98
98
  _this.thBottomLineWidth = json.thBottomLineWidth || 1;
99
+ _this.focusFillStyle = json.focusFillStyle;
99
100
  // 兼容老数据
100
101
  if (json.children && json.children[0] && json.children[0].parentRect) {
101
102
  _this.paddingLeft = json.children[0].parentRect.offsetX;
@@ -148,6 +149,9 @@ var Node = /** @class */ (function (_super) {
148
149
  _this.nextPlay = json.nextPlay;
149
150
  _this.time = json.time;
150
151
  _this.isOpen = json.isOpen;
152
+ _this.isShowPercent = json.isShowPercent || false;
153
+ _this.maxValue = json.maxValue || 100;
154
+ _this.retationDecimalPlaces = json.retationDecimalPlaces;
151
155
  if (json.elementLoaded !== undefined) {
152
156
  _this.elementId = null;
153
157
  _this.elementLoaded = false;
@@ -265,6 +269,9 @@ var Node = /** @class */ (function (_super) {
265
269
  Store.set(this.generateStoreKey('LT:addDiv'), this);
266
270
  }
267
271
  };
272
+ Node.prototype.createOverflow = function () {
273
+ Store.set(this.generateStoreKey('LT:createOverflow'), this);
274
+ };
268
275
  Node.prototype.hasGif = function () {
269
276
  if (this.gif) {
270
277
  return true;
@@ -111,6 +111,13 @@ var Pen = /** @class */ (function () {
111
111
  this.defaultFillStyle = json.defaultFillStyle || '';
112
112
  this.defaultFontColor = json.defaultFontColor || '';
113
113
  this.defaultStrokeStyle = json.defaultStrokeStyle || '';
114
+
115
+ this.borderRadiusTopLeft = json.borderRadiusTopLeft || 0;
116
+ this.borderRadiusTopRight = json.borderRadiusTopRight || 0;
117
+ this.borderRadiusBottomLeft = json.borderRadiusBottomLeft || 0;
118
+ this.borderRadiusBottomRight = json.borderRadiusBottomRight || 0;
119
+
120
+ this.focusFillStyle = json.focusFillStyle || '';
114
121
  if (json.rectInParent) {
115
122
  this.rectInParent = json.rectInParent;
116
123
  }
@@ -157,7 +164,9 @@ var Pen = /** @class */ (function () {
157
164
  ctx.strokeStyle = !this.activeImgeIndex ? this.visitStrokeStyle || staticStrokeStyle : this.defaultStrokeStyle || staticStrokeStyle;
158
165
  }
159
166
  //ctx.strokeStyle = this.dash === 4 ? 'transparent' : this.strokeStyle || '#222';
160
- this.fillStyle && (ctx.fillStyle = this.fillStyle);
167
+ //背景聚焦色
168
+ this.focusFillStyle && !this.activeImgeIndex ? ctx.fillStyle = this.focusFillStyle : (this.fillStyle && (ctx.fillStyle = this.fillStyle));
169
+
161
170
  if (this.lineCap) {
162
171
  ctx.lineCap = this.lineCap;
163
172
  }
@@ -1,9 +1,9 @@
1
- import {Store} from "le5le-store";
1
+ import { Store } from "le5le-store";
2
2
  var __extends = (this && this.__extends) || (function () {
3
3
  var extendStatics = function (d, b) {
4
4
  extendStatics = Object.setPrototypeOf ||
5
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6
- function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
5
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6
+ function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
7
7
  return extendStatics(d, b);
8
8
  };
9
9
  return function (d, b) {
@@ -12,8 +12,8 @@ var __extends = (this && this.__extends) || (function () {
12
12
  d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
13
13
  };
14
14
  })();
15
- import {KeyType} from './options';
16
- import {Point} from './models';
15
+ import { KeyType } from './options';
16
+ import { Point } from './models';
17
17
  import { Common } from './common'
18
18
  import {
19
19
  downDataType,
@@ -40,12 +40,12 @@ var Preview = (function (_super) {
40
40
  _this.devicePixelRatio = window.devicePixelRatio; // 初始化窗口分辨率
41
41
  // 选中值发生变化时触发,目前用于日期切换
42
42
  _this.eventChangeSubcribe = Store.subscribe(this.generateStoreKey('EVENT:change'), function (data) {
43
- const {node, date} = data;
43
+ const { node, date } = data;
44
44
  const pickerBindData = _this.store.pickerDataPool.bindData;
45
- if(pickerBindData) {
45
+ if (pickerBindData) {
46
46
  // 切换显示日期文字的元件值
47
- for (let value of Object.values(pickerBindData)){
48
- if(value.dateId === node.id) {
47
+ for (let value of Object.values(pickerBindData)) {
48
+ if (value.dateId === node.id) {
49
49
  const pen = _this.store.data.pens[value.order];
50
50
  pen.text = date.valueStr;
51
51
  }
@@ -83,8 +83,8 @@ var Preview = (function (_super) {
83
83
  _this.hideTip();
84
84
  _this.setAttributeForCanvasPoint('default');
85
85
  if (hoverNode) {
86
- if(eventNode) _this.setAttributeForCanvasPoint('pointer');
87
- if(hoverNode.visible) _this.showTip(hoverNode, pos);
86
+ if (eventNode) _this.setAttributeForCanvasPoint('pointer');
87
+ if (hoverNode.visible) _this.showTip(hoverNode, pos);
88
88
  _this.moveIn.type = moveType;
89
89
  }
90
90
  _this.moveIn.eventNode = eventNode;
@@ -98,15 +98,16 @@ var Preview = (function (_super) {
98
98
  if (e.button !== 0)
99
99
  return;
100
100
  var canvasPos = _this.divLayer.canvas.getBoundingClientRect();
101
- _this.mouseDown = {x: e.x - canvasPos.x, y: e.y - canvasPos.y};
101
+ _this.mouseDown = { x: e.x - canvasPos.x, y: e.y - canvasPos.y };
102
102
  if (e.altKey) {
103
103
  _this.setAttributeForCanvasPoint('pointer');
104
104
  }
105
105
  if (_this.inputObj) {
106
106
  _this.setNodeText();
107
107
  }
108
+ // 待优化,如何跳过这个函数,影响滚动组件功能
108
109
  resetSelectInteractiveState(_this.moveIn.hoverNode);
109
- const {eventType, value} = mousDownFun(_this.store.options.type, _this.moveIn.eventNode);
110
+ const { eventType, value } = mousDownFun(_this.store.options.type, _this.moveIn.eventNode);
110
111
  if (_this.moveIn.type == _this.moveInType.Nodes) {
111
112
  _this.setAttributeForCanvasPoint('pointer');
112
113
  switch (eventType) {
@@ -140,9 +141,9 @@ var Preview = (function (_super) {
140
141
  _this.mouseDown = null;
141
142
  _this.lastTranlated.x = 0;
142
143
  _this.lastTranlated.y = 0;
143
- if(_this.moveIn.eventNode) {
144
+ if (_this.moveIn.eventNode) {
144
145
  _this.setAttributeForCanvasPoint('pointer');
145
- }else {
146
+ } else {
146
147
  _this.setAttributeForCanvasPoint('default');
147
148
  }
148
149
  };
@@ -179,16 +180,16 @@ var Preview = (function (_super) {
179
180
  event.preventDefault();
180
181
  if (event.deltaY < 0) {
181
182
  if (event.layerX && event.layerY) {
182
- _this.scale(1.1, {x: event.layerX, y: event.layerY});
183
- _this.canvas.scale(1.1, {x: event.layerX, y: event.layerY});
183
+ _this.scale(1.1, { x: event.layerX, y: event.layerY });
184
+ _this.canvas.scale(1.1, { x: event.layerX, y: event.layerY });
184
185
  } else {
185
186
  _this.scale(1.1);
186
187
  _this.canvas.scale(1.1);
187
188
  }
188
189
  } else {
189
190
  if (event.layerX && event.layerY) {
190
- _this.scale(0.9, {x: event.layerX, y: event.layerY});
191
- _this.canvas.scale(0.9, {x: event.layerX, y: event.layerY});
191
+ _this.scale(0.9, { x: event.layerX, y: event.layerY });
192
+ _this.canvas.scale(0.9, { x: event.layerX, y: event.layerY });
192
193
  } else {
193
194
  _this.scale(0.9);
194
195
  _this.canvas.scale(0.9);
@@ -200,19 +201,19 @@ var Preview = (function (_super) {
200
201
  };
201
202
  window.onresize = function () {
202
203
  let isFullScreen = document.fullscreenElement || document.webkitFullscreenElement || document.mozFullscreenElement;
203
- if((!isFullScreen && _this.isFullScreen) || window.keyControlFullScreen){
204
+ if ((!isFullScreen && _this.isFullScreen) || window.keyControlFullScreen) {
204
205
  // F11或ESC退出全屏
205
- if(!window.keyControlFullScreen) _this.moveIn.hoverNode.text = '全屏';
206
+ if (!window.keyControlFullScreen) _this.moveIn.hoverNode.text = '全屏';
206
207
  _this.fitViewPreview(_this.isFullScreen);
207
208
  _this.isFullScreen = false;
208
209
  window.keyControlFullScreen = false;
209
- }else {
210
+ } else {
210
211
  const documentElementHeight = window.innerHeight || document.documentElement.clientHeight; // 每次窗口有变化就重新获取一次网页高度
211
- if(window.devicePixelRatio !== _this.devicePixelRatio) {
212
+ if (window.devicePixelRatio !== _this.devicePixelRatio) {
212
213
  _this.devicePixelInnerHeight = documentElementHeight;
213
214
  _this.devicePixelRatio = window.devicePixelRatio;
214
215
  }
215
- if(_this.devicePixelInnerHeight < documentElementHeight && !isFullScreen) {
216
+ if (_this.devicePixelInnerHeight < documentElementHeight && !isFullScreen) {
216
217
  // 按F11 全屏
217
218
  setTimeout(() => {
218
219
  _this.fitViewPreview(false);
@@ -221,13 +222,13 @@ var Preview = (function (_super) {
221
222
  window.keyControlFullScreen = true;
222
223
  }
223
224
  // topology编辑器或全屏下跳出程序
224
- if(_this.store.options.type === 'topology' || window.keyControlFullScreen) return;
225
+ if (_this.store.options.type === 'topology' || window.keyControlFullScreen) return;
225
226
  const zoom = pageZoom();
226
227
  _this.isResize = true;
227
228
  clearTimeout(_this.pageResizeTim);
228
229
  _this.pageResizeTim = setTimeout(() => {
229
- if(_this.isResize){
230
- const pageZoom = 1/zoom;
230
+ if (_this.isResize) {
231
+ const pageZoom = 1 / zoom;
231
232
  _this.store.data.pageZoom = zoom;
232
233
  _this.store.parentElem.style.transform = `scale(${pageZoom})`;
233
234
  _this.store.parentElem.style.transformOrigin = '0 0';
@@ -241,14 +242,20 @@ var Preview = (function (_super) {
241
242
  }, 1000);
242
243
  }
243
244
  };
245
+ _this.subcribecreateOverflow = Store.subscribe(this.generateStoreKey('LT:createOverflow'), function (node) {
246
+ _this.dispatch('createOverflow', node);
247
+ });
248
+ _this.subcribeconversionDataOverflow = Store.subscribe(this.generateStoreKey('LT:conversionDataOverflow'), function (data) {
249
+ _this.dispatch('conversionDataOverflow', data);
250
+ });
244
251
  return _this;
245
252
  }
246
- Preview.prototype.setAttributeForCanvasPoint = function (type){
253
+ Preview.prototype.setAttributeForCanvasPoint = function (type) {
247
254
 
248
255
  this.divLayer.canvas.setAttribute('class', `canvas-point ${type}`);
249
256
 
250
257
  };
251
- Preview.prototype.fitViewPreview = function (restore){
258
+ Preview.prototype.fitViewPreview = function (restore) {
252
259
  this.fitView(null, restore);
253
260
  this.render();
254
261
  };
@@ -274,7 +281,7 @@ var Preview = (function (_super) {
274
281
  };
275
282
  Preview.prototype.scale = function (scale, center, w, h) {
276
283
  if (this.store.data.scale * scale < this.store.options.minScale ||
277
- this.store.data.scale * scale > this.store.options.maxScale) {
284
+ this.store.data.scale * scale > this.store.options.maxScale) {
278
285
  return;
279
286
  }
280
287
  this.store.data.scale *= scale;
@@ -283,7 +290,7 @@ var Preview = (function (_super) {
283
290
  var item = _a[_i];
284
291
  item.scale(scale, center, w, h);
285
292
  // 驾驶舱底部区域元件,用于控制底部区域Dom宽高等元素自由变换,后期会删除
286
- if(item.tags && item.tags[0] && item.tags[0].includes('contromRoomBottom')) this.store.pens['contromRoomBottom'] = item;
293
+ if (item.tags && item.tags[0] && item.tags[0].includes('contromRoomBottom')) this.store.pens['contromRoomBottom'] = item;
287
294
  }
288
295
  };
289
296
  Preview.prototype.scaleTo = function (scale) {
@@ -298,7 +305,7 @@ var Preview = (function (_super) {
298
305
  var parentElem = this.store.parentElem;
299
306
  var width = parentElem.offsetWidth,
300
307
  height = parentElem.offsetHeight;
301
- if(this.store.options.storeSubscribe) {
308
+ if (this.store.options.storeSubscribe) {
302
309
  width = this.store.options.width;
303
310
  height = this.store.options.height;
304
311
  }
@@ -314,28 +321,47 @@ var Preview = (function (_super) {
314
321
  var padding = formatPadding(viewPadding || this.store.options.viewPadding);
315
322
  // 4. 获取图形尺寸
316
323
  var rect = this.getRect();
317
- if(!rect.width) {
324
+ if (!rect.width) {
318
325
  const bkImageRect = this.store.data.bkImageRect;
319
326
  rect.width = bkImageRect && bkImageRect.width ? bkImageRect.width : width;
320
327
  rect.height = bkImageRect && bkImageRect.height ? bkImageRect.height : height;
321
328
  }
322
329
  // 6. 计算缩放比
323
- var w = (width - padding[1] - padding[3]) / rect.width ;
330
+ var w = (width - padding[1] - padding[3]) / rect.width;
324
331
  var h = (height - padding[0] - padding[2]) / rect.height;
325
332
  var ratio = w;
326
333
  if (w > h) {
327
334
  ratio = h;
328
335
  }
329
336
  // 保持缩放后的还原度
330
- if(typeof restore === 'boolean' && restore) ratio = w;
337
+ if (typeof restore === 'boolean' && restore) ratio = w;
331
338
  this.scale(ratio, undefined, w, h);
332
339
  this.canvas.scale(ratio, undefined, w, h);
333
340
  // 7. X抽滚动条隐藏
334
341
  this.store.parentElem.style.overflow = 'hidden auto';
335
342
  };
343
+ Preview.prototype.formOverflowOpen = function (data) {
344
+ this.formOverflowConversionData(data);
345
+ this.overflowView();
346
+ this.render(true);
347
+ }
348
+ Preview.prototype.overflowView = function () {
349
+ if (!this.hasView())
350
+ return;
351
+ var rect = this.getRect();
352
+ var width = rect.ex,
353
+ height = rect.ey
354
+ width *= this.store.data.pageZoom;
355
+ height *= this.store.data.pageZoom;
356
+ this.canvasResize({
357
+ width: width,
358
+ height: height,
359
+ });
360
+ this.store.parentElem.style.overflow = 'auto';
361
+ }
336
362
  Preview.prototype.destroy = function () {
337
363
  this.destroyStatic();
338
- if(this.eventChangeSubcribe) this.eventChangeSubcribe.unsubscribe();
364
+ if (this.eventChangeSubcribe) this.eventChangeSubcribe.unsubscribe();
339
365
  this.onMouseMove = null;
340
366
  this.onmousedown = null;
341
367
  this.onmouseup = null;
@@ -344,5 +370,5 @@ var Preview = (function (_super) {
344
370
  return Preview;
345
371
  }(Common));
346
372
 
347
- export {Preview};
373
+ export { Preview };
348
374
  //# sourceMappingURL=core.js.map
@@ -12,12 +12,14 @@ export interface visualization2DData {
12
12
  toArrowType: string;
13
13
  scale: number;
14
14
  pageZoom: number,
15
+ pageType: number,
15
16
  locked: Lock;
16
17
  bkImage: string;
17
18
  bkColor: string;
18
19
  grid?: boolean;
19
20
  websocket?: string;
20
21
  mqttUrl?: string;
22
+ tabsContentOptions?: {},
21
23
  mqttOptions?: {
22
24
  clientId?: string;
23
25
  username?: string;
@@ -57,6 +59,8 @@ export interface visualization2DStore {
57
59
  cacheDatas?: {
58
60
  data: visualization2DData;
59
61
  }[];
62
+ // @ts-ignore
63
+ tabsPageMasterData: Map<string, any>;
60
64
  elementInteractivePoor: {}; // element 交互过渡数据
61
65
  pickerDataPool: {}; // datePicker 交互数据池
62
66
  echartsDataPool: {}; // echarts Dom节点数据
@@ -78,6 +82,8 @@ export interface visualization2DStore {
78
82
  }
79
83
  // @ts-ignore
80
84
  export const createStore = () => {
85
+ // @ts-ignore
86
+ // @ts-ignore
81
87
  return {
82
88
  id: '',
83
89
  data: {
@@ -87,6 +93,8 @@ export const createStore = () => {
87
93
  toArrowType: 'triangleSolid',
88
94
  scale: 1,
89
95
  pageZoom: 1,
96
+ pageType: 0,
97
+ tabsContentOptions: {},
90
98
  locked: Lock.None,
91
99
  bkImageRect: null,
92
100
  mqttOptions: {
@@ -162,6 +170,7 @@ export const clearStore = (store: visualization2DStore, del: string) => {
162
170
  toArrowType: 'triangleSolid',
163
171
  scale: 1,
164
172
  pageZoom: 1,
173
+ pageType: 0,
165
174
  locked: Lock.None,
166
175
  bkImageRect: null,
167
176
  mqttOptions: {
@@ -28,6 +28,8 @@ export var createStore = function () {
28
28
  dataResize: 1, // 数据是否加载,1是,0否
29
29
  bkImageRect: null,
30
30
  pageZoom: 1,
31
+ pageType: 0, // 0-默认:1-tabs切换
32
+ tabsContentOptions: {}, // tabs内容区域配置属性
31
33
  mqttOptions: {
32
34
  clientId: s8()
33
35
  },
@@ -53,6 +55,7 @@ export var createStore = function () {
53
55
  },
54
56
  pens: {},
55
57
  options: { ...DefalutOptions },
58
+ tabsPageMasterData: new Map(),
56
59
  elementInteractivePoor: {}, // element 交互过渡数据
57
60
  pickerDataPool: {}, // datePicker 交互数据池
58
61
  echartsDataPool: {}, // echarts Dom节点数据
@@ -136,6 +139,8 @@ export var clearStore = function (store, del) {
136
139
  toArrowType: 'triangleSolid',
137
140
  scale: 1,
138
141
  pageZoom: 1,
142
+ pageType: 0, // 0-默认:1-tabs切换
143
+ tabsContentOptions: {},
139
144
  locked: Lock.None,
140
145
  dataResize: 1, // 数据是否加载,1是,0否
141
146
  bkImageRect: null,
@@ -1,6 +1,6 @@
1
1
  import {Node} from '../models';
2
2
 
3
- export declare function setInitNodeDataValidat(node: any, TID: string, type: string, order: number): void;
3
+ export declare function setInitNodeDataValidat(node: any, TID: string, type: string, order: number, options: any): void;
4
4
  export declare function initDefaultValidat(node: any, retData: any): void;
5
5
  export declare function setDefaultNodeValidat(node: any, retData: any): any;
6
6
  export declare function setConnectionTagForConf(node: Node): void;
@@ -9,13 +9,20 @@ import {confAssociateDateValueShowType, datePickerValueFormatting} from '../util
9
9
  * @param TID 数据键
10
10
  * @param type topology类型
11
11
  * @param order 节点序列
12
+ * @param options 配置数据
12
13
  */
13
- export function setInitNodeDataValidat(node, TID, type, order) {
14
+ export function setInitNodeDataValidat(node, TID, type, order, options) {
14
15
 
15
- const syncData = commonStore[TID].mqttData;
16
+ const syncData = node.PTID? commonStore[node.PTID].mqttData: commonStore[TID].mqttData;
16
17
 
17
18
  node.TID = TID;
18
19
 
20
+ if(options.pageId){
21
+ // tabs页面元件偏移量计算
22
+ node.rect.x += options.x;
23
+ node.rect.y += options.y;
24
+ }
25
+
19
26
  if(typeof node.visibleSwitch !== 'boolean') {
20
27
  // 兼容旧版显示隐藏属性值设置
21
28
  node.visibleSwitch = type === 'topology';
@@ -33,12 +40,18 @@ export function setInitNodeDataValidat(node, TID, type, order) {
33
40
  if (node.children && node.children.length) {
34
41
 
35
42
  node.children.map((_item) => {
36
-
37
- setInitNodeDataValidat(_item, TID, type);
43
+ _item.PTID = node.PTID;
44
+ setInitNodeDataValidat(_item, TID, type, null, options);
38
45
 
39
46
  })
40
47
 
41
48
  }
49
+
50
+ if (node.formData && node.formData.detailPageData && node.formData.detailPageData.pens && node.formData.detailPageData.pens.length) {
51
+ // PTID为滚动组件子页面的父级节点的TID
52
+ node.formData.detailPageData.pens.forEach(pen => pen.PTID = TID);
53
+ }
54
+
42
55
  }
43
56
  // 初始化默认节点值
44
57
  export function initDefaultValidat(node, retData) {
@@ -71,7 +84,7 @@ function setVarBranchData(node, retData) {
71
84
  const componentData = retData.componentData;
72
85
  let varData = null;
73
86
  let branchNameData = null;
74
- if(componentData) {
87
+ if(componentData && Object.keys(componentData).length) {
75
88
  varData = componentData[node.id] || {};
76
89
  branchNameData = componentData[node.id] || {};
77
90
  }else {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dcim-topology2d",
3
- "version": "2.2.0",
3
+ "version": "2.2.2",
4
4
  "description": "",
5
5
  "main": "-",
6
6
  "scripts": {