dcim-topology2d 2.1.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 (63) 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 -109
  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 -559
  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 +115 -83
  18. package/core/src/core.js +15 -1
  19. package/core/src/element/common.js +12 -4
  20. package/core/src/element/datePicker.js +13 -16
  21. package/core/src/element/select.d.ts +1 -1
  22. package/core/src/element/select.js +1 -3
  23. package/core/src/element/tab.js +3 -8
  24. package/core/src/healps/changeData.js +64 -41
  25. package/core/src/middles/default.js +49 -43
  26. package/core/src/middles/index.d.ts +1 -2
  27. package/core/src/middles/index.js +3 -2
  28. package/core/src/middles/nodes/formDatePicker.js +54 -12
  29. package/core/src/middles/nodes/formoverflow.js +17 -16
  30. package/core/src/middles/nodes/formselect.js +14 -5
  31. package/core/src/middles/nodes/index.d.ts +3 -1
  32. package/core/src/middles/nodes/index.js +2 -0
  33. package/core/src/middles/nodes/progress.d.ts +2 -0
  34. package/core/src/middles/nodes/progress.js +63 -0
  35. package/core/src/middles/nodes/progress.js.map +1 -0
  36. package/core/src/middles/nodes/rectangle.js +54 -15
  37. package/core/src/middles/nodes/switchs.d.ts +2 -0
  38. package/core/src/middles/nodes/switchs.js +46 -0
  39. package/core/src/models/line.js +7 -7
  40. package/core/src/models/node.js +90 -81
  41. package/core/src/models/pen.js +21 -12
  42. package/core/src/offscreen.js +19 -19
  43. package/core/src/preview.js +75 -40
  44. package/core/src/store/data.d.ts +11 -0
  45. package/core/src/store/data.js +11 -0
  46. package/core/src/utils/assignment.d.ts +1 -1
  47. package/core/src/utils/assignment.js +50 -6
  48. package/core/src/utils/construction.d.ts +24 -0
  49. package/core/src/utils/construction.js +22 -1
  50. package/core/src/utils/conversion.d.ts +2 -0
  51. package/core/src/utils/conversion.js +109 -0
  52. package/core/src/utils/math.d.ts +0 -1
  53. package/core/src/utils/math.js +0 -3
  54. package/core/src/utils/onmousevent.js +1 -1
  55. package/core/src/utils/params.d.ts +1 -0
  56. package/core/src/utils/params.js +75 -4
  57. package/package.json +1 -1
  58. package/static/echartsDefaultData.js +178 -178
  59. package/store/actions.js +2 -1
  60. package/store/clear.js +4 -0
  61. package/store/default.js +22 -0
  62. package/store/index.js +2 -1
  63. /package/myShape-diagram/{index.ts → index.d.ts} +0 -0
@@ -1,8 +1,8 @@
1
1
  var __extends = (this && this.__extends) || (function () {
2
2
  var extendStatics = function (d, b) {
3
3
  extendStatics = Object.setPrototypeOf ||
4
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
5
- function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
4
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
5
+ function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
6
6
  return extendStatics(d, b);
7
7
  };
8
8
  return function (d, b) {
@@ -13,7 +13,7 @@ var __extends = (this && this.__extends) || (function () {
13
13
  })();
14
14
  import { Store } from 'le5le-store';
15
15
  import { Canvas } from './canvas';
16
- import { Node } from './models'
16
+ import { Node, Line } from './models'
17
17
  import { commonStore } from './store'
18
18
  var Offscreen = /** @class */ (function (_super) {
19
19
  __extends(Offscreen, _super);
@@ -25,38 +25,38 @@ var Offscreen = /** @class */ (function (_super) {
25
25
  Store.set(_this.generateStoreKey('LT:offscreen'), _this.canvas);
26
26
  return _this;
27
27
  }
28
- Offscreen.prototype.getRoutineLayer = function(auto) {
29
- if(!auto || auto.includes('ActiveLayer')) {
30
- this.activeLayer = Store.get(this.generateStoreKey('LT:ActiveLayer'));
31
- }
32
- if(!auto || auto.includes('HoverLayer')) {
33
- this.hoverLayer = Store.get(this.generateStoreKey('LT:HoverLayer'));
34
- }
35
- if(!auto || auto.includes('AnimateLayer')) {
36
- this.animateLayer = Store.get(this.generateStoreKey('LT:AnimateLayer'));
37
- }
28
+ Offscreen.prototype.getRoutineLayer = function (auto) {
29
+ if (!auto || auto.includes('ActiveLayer')) {
30
+ this.activeLayer = Store.get(this.generateStoreKey('LT:ActiveLayer'));
31
+ }
32
+ if (!auto || auto.includes('HoverLayer')) {
33
+ this.hoverLayer = Store.get(this.generateStoreKey('LT:HoverLayer'));
34
+ }
35
+ if (!auto || auto.includes('AnimateLayer')) {
36
+ this.animateLayer = Store.get(this.generateStoreKey('LT:AnimateLayer'));
37
+ }
38
38
  };
39
39
  Offscreen.prototype.render = function () {
40
40
  _super.prototype.render.call(this);
41
41
  var ctx = this.canvas.getContext('2d');
42
- if(!commonStore || !commonStore[this.TID]) return;
42
+ if (!commonStore || !commonStore[this.TID]) return;
43
43
  let store = commonStore[this.TID];
44
44
  ctx.strokeStyle = store.options.color;
45
45
  for (var _i = 0, _a = store.data.pens; _i < _a.length; _i++) {
46
46
  var item = _a[_i];
47
- if(!(item instanceof Node)) item = new Node(item);
47
+ if (!(item instanceof Node) && !(item instanceof Line)) item = new Node(item);
48
48
  if (!item.getTID()) {
49
49
  item.setTID(this.TID);
50
50
  }
51
51
  item.render(ctx);
52
52
  }
53
- if(this.activeLayer) {
53
+ if (this.activeLayer) {
54
54
  this.activeLayer.render(ctx);
55
55
  }
56
- if(this.hoverLayer) {
57
- this.hoverLayer.render(ctx);
56
+ if (this.hoverLayer) {
57
+ this.hoverLayer.render(ctx);
58
58
  }
59
- if(this.animateLayer) {
59
+ if (this.animateLayer) {
60
60
  this.animateLayer.render(ctx);
61
61
  }
62
62
  store = null;
@@ -1,10 +1,9 @@
1
- import {Store} from "le5le-store";
2
-
1
+ import { Store } from "le5le-store";
3
2
  var __extends = (this && this.__extends) || (function () {
4
3
  var extendStatics = function (d, b) {
5
4
  extendStatics = Object.setPrototypeOf ||
6
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
7
- 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]; };
8
7
  return extendStatics(d, b);
9
8
  };
10
9
  return function (d, b) {
@@ -13,8 +12,8 @@ var __extends = (this && this.__extends) || (function () {
13
12
  d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
14
13
  };
15
14
  })();
16
- import {KeyType} from './options';
17
- import {Point} from './models';
15
+ import { KeyType } from './options';
16
+ import { Point } from './models';
18
17
  import { Common } from './common'
19
18
  import {
20
19
  downDataType,
@@ -22,7 +21,8 @@ import {
22
21
  formatPadding,
23
22
  mousMoveFun,
24
23
  mousDownFun,
25
- omouseEventPrototDoWindowFn
24
+ omouseEventPrototDoWindowFn,
25
+ pageZoom
26
26
  } from './utils';
27
27
  import {
28
28
  resetSelectInteractiveState,
@@ -40,8 +40,18 @@ 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;
44
- _this.dispatch('change', node, date); // eventOut外部事件
43
+ const { node, date } = data;
44
+ const pickerBindData = _this.store.pickerDataPool.bindData;
45
+ if (pickerBindData) {
46
+ // 切换显示日期文字的元件值
47
+ for (let value of Object.values(pickerBindData)) {
48
+ if (value.dateId === node.id) {
49
+ const pen = _this.store.data.pens[value.order];
50
+ pen.text = date.valueStr;
51
+ }
52
+ }
53
+ }
54
+ node.formData.realIds ? _this.dispatch('change', node, date) : _this.render(); // eventOut外部事件
45
55
  });
46
56
  _this.onMouseMove = function (e) {
47
57
  _this.store.data.dataResize = 0;
@@ -73,8 +83,8 @@ var Preview = (function (_super) {
73
83
  _this.hideTip();
74
84
  _this.setAttributeForCanvasPoint('default');
75
85
  if (hoverNode) {
76
- if(eventNode) _this.setAttributeForCanvasPoint('pointer');
77
- if(hoverNode.visible) _this.showTip(hoverNode, pos);
86
+ if (eventNode) _this.setAttributeForCanvasPoint('pointer');
87
+ if (hoverNode.visible) _this.showTip(hoverNode, pos);
78
88
  _this.moveIn.type = moveType;
79
89
  }
80
90
  _this.moveIn.eventNode = eventNode;
@@ -88,15 +98,16 @@ var Preview = (function (_super) {
88
98
  if (e.button !== 0)
89
99
  return;
90
100
  var canvasPos = _this.divLayer.canvas.getBoundingClientRect();
91
- _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 };
92
102
  if (e.altKey) {
93
103
  _this.setAttributeForCanvasPoint('pointer');
94
104
  }
95
105
  if (_this.inputObj) {
96
106
  _this.setNodeText();
97
107
  }
108
+ // 待优化,如何跳过这个函数,影响滚动组件功能
98
109
  resetSelectInteractiveState(_this.moveIn.hoverNode);
99
- const {eventType, value, staticType} = mousDownFun(_this.store.options.type, _this.moveIn.eventNode);
110
+ const { eventType, value } = mousDownFun(_this.store.options.type, _this.moveIn.eventNode);
100
111
  if (_this.moveIn.type == _this.moveInType.Nodes) {
101
112
  _this.setAttributeForCanvasPoint('pointer');
102
113
  switch (eventType) {
@@ -119,7 +130,7 @@ var Preview = (function (_super) {
119
130
  _this.switchStaticsCheckType(_this.moveIn.hoverNode, _this.moveIn.eventNode);
120
131
  break;
121
132
  case downDataType.Formselect:
122
- setSelectDropdownInteractiveState(_this.moveIn.hoverNode, staticType, previewType.Dcim);
133
+ setSelectDropdownInteractiveState(_this.moveIn.hoverNode, previewType.Dcim);
123
134
  break;
124
135
  }
125
136
  }
@@ -130,9 +141,9 @@ var Preview = (function (_super) {
130
141
  _this.mouseDown = null;
131
142
  _this.lastTranlated.x = 0;
132
143
  _this.lastTranlated.y = 0;
133
- if(_this.moveIn.eventNode) {
144
+ if (_this.moveIn.eventNode) {
134
145
  _this.setAttributeForCanvasPoint('pointer');
135
- }else {
146
+ } else {
136
147
  _this.setAttributeForCanvasPoint('default');
137
148
  }
138
149
  };
@@ -169,16 +180,16 @@ var Preview = (function (_super) {
169
180
  event.preventDefault();
170
181
  if (event.deltaY < 0) {
171
182
  if (event.layerX && event.layerY) {
172
- _this.scale(1.1, {x: event.layerX, y: event.layerY});
173
- _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 });
174
185
  } else {
175
186
  _this.scale(1.1);
176
187
  _this.canvas.scale(1.1);
177
188
  }
178
189
  } else {
179
190
  if (event.layerX && event.layerY) {
180
- _this.scale(0.9, {x: event.layerX, y: event.layerY});
181
- _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 });
182
193
  } else {
183
194
  _this.scale(0.9);
184
195
  _this.canvas.scale(0.9);
@@ -190,19 +201,19 @@ var Preview = (function (_super) {
190
201
  };
191
202
  window.onresize = function () {
192
203
  let isFullScreen = document.fullscreenElement || document.webkitFullscreenElement || document.mozFullscreenElement;
193
- if((!isFullScreen && _this.isFullScreen) || window.keyControlFullScreen){
204
+ if ((!isFullScreen && _this.isFullScreen) || window.keyControlFullScreen) {
194
205
  // F11或ESC退出全屏
195
- if(!window.keyControlFullScreen) _this.moveIn.hoverNode.text = '全屏';
206
+ if (!window.keyControlFullScreen) _this.moveIn.hoverNode.text = '全屏';
196
207
  _this.fitViewPreview(_this.isFullScreen);
197
208
  _this.isFullScreen = false;
198
209
  window.keyControlFullScreen = false;
199
- }else {
210
+ } else {
200
211
  const documentElementHeight = window.innerHeight || document.documentElement.clientHeight; // 每次窗口有变化就重新获取一次网页高度
201
- if(window.devicePixelRatio !== _this.devicePixelRatio) {
212
+ if (window.devicePixelRatio !== _this.devicePixelRatio) {
202
213
  _this.devicePixelInnerHeight = documentElementHeight;
203
214
  _this.devicePixelRatio = window.devicePixelRatio;
204
215
  }
205
- if(_this.devicePixelInnerHeight < documentElementHeight && !isFullScreen) {
216
+ if (_this.devicePixelInnerHeight < documentElementHeight && !isFullScreen) {
206
217
  // 按F11 全屏
207
218
  setTimeout(() => {
208
219
  _this.fitViewPreview(false);
@@ -211,14 +222,13 @@ var Preview = (function (_super) {
211
222
  window.keyControlFullScreen = true;
212
223
  }
213
224
  // topology编辑器或全屏下跳出程序
214
- if(_this.store.options.type === 'topology' || window.keyControlFullScreen) return;
215
- const screenWidth = window.screen.width < 1920 ? 1920 : window.screen.width;
216
- const zoom = window.innerWidth < screenWidth ? document.documentElement.clientWidth / screenWidth : 1;
225
+ if (_this.store.options.type === 'topology' || window.keyControlFullScreen) return;
226
+ const zoom = pageZoom();
217
227
  _this.isResize = true;
218
228
  clearTimeout(_this.pageResizeTim);
219
229
  _this.pageResizeTim = setTimeout(() => {
220
- if(_this.isResize){
221
- const pageZoom = 1/zoom;
230
+ if (_this.isResize) {
231
+ const pageZoom = 1 / zoom;
222
232
  _this.store.data.pageZoom = zoom;
223
233
  _this.store.parentElem.style.transform = `scale(${pageZoom})`;
224
234
  _this.store.parentElem.style.transformOrigin = '0 0';
@@ -232,14 +242,20 @@ var Preview = (function (_super) {
232
242
  }, 1000);
233
243
  }
234
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
+ });
235
251
  return _this;
236
252
  }
237
- Preview.prototype.setAttributeForCanvasPoint = function (type){
253
+ Preview.prototype.setAttributeForCanvasPoint = function (type) {
238
254
 
239
255
  this.divLayer.canvas.setAttribute('class', `canvas-point ${type}`);
240
256
 
241
257
  };
242
- Preview.prototype.fitViewPreview = function (restore){
258
+ Preview.prototype.fitViewPreview = function (restore) {
243
259
  this.fitView(null, restore);
244
260
  this.render();
245
261
  };
@@ -265,7 +281,7 @@ var Preview = (function (_super) {
265
281
  };
266
282
  Preview.prototype.scale = function (scale, center, w, h) {
267
283
  if (this.store.data.scale * scale < this.store.options.minScale ||
268
- this.store.data.scale * scale > this.store.options.maxScale) {
284
+ this.store.data.scale * scale > this.store.options.maxScale) {
269
285
  return;
270
286
  }
271
287
  this.store.data.scale *= scale;
@@ -274,7 +290,7 @@ var Preview = (function (_super) {
274
290
  var item = _a[_i];
275
291
  item.scale(scale, center, w, h);
276
292
  // 驾驶舱底部区域元件,用于控制底部区域Dom宽高等元素自由变换,后期会删除
277
- 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;
278
294
  }
279
295
  };
280
296
  Preview.prototype.scaleTo = function (scale) {
@@ -289,7 +305,7 @@ var Preview = (function (_super) {
289
305
  var parentElem = this.store.parentElem;
290
306
  var width = parentElem.offsetWidth,
291
307
  height = parentElem.offsetHeight;
292
- if(this.store.options.storeSubscribe) {
308
+ if (this.store.options.storeSubscribe) {
293
309
  width = this.store.options.width;
294
310
  height = this.store.options.height;
295
311
  }
@@ -305,28 +321,47 @@ var Preview = (function (_super) {
305
321
  var padding = formatPadding(viewPadding || this.store.options.viewPadding);
306
322
  // 4. 获取图形尺寸
307
323
  var rect = this.getRect();
308
- if(!rect.width) {
324
+ if (!rect.width) {
309
325
  const bkImageRect = this.store.data.bkImageRect;
310
326
  rect.width = bkImageRect && bkImageRect.width ? bkImageRect.width : width;
311
327
  rect.height = bkImageRect && bkImageRect.height ? bkImageRect.height : height;
312
328
  }
313
329
  // 6. 计算缩放比
314
- var w = (width - padding[1] - padding[3]) / rect.width ;
330
+ var w = (width - padding[1] - padding[3]) / rect.width;
315
331
  var h = (height - padding[0] - padding[2]) / rect.height;
316
332
  var ratio = w;
317
333
  if (w > h) {
318
334
  ratio = h;
319
335
  }
320
336
  // 保持缩放后的还原度
321
- if(typeof restore === 'boolean' && restore) ratio = w;
337
+ if (typeof restore === 'boolean' && restore) ratio = w;
322
338
  this.scale(ratio, undefined, w, h);
323
339
  this.canvas.scale(ratio, undefined, w, h);
324
340
  // 7. X抽滚动条隐藏
325
341
  this.store.parentElem.style.overflow = 'hidden auto';
326
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
+ }
327
362
  Preview.prototype.destroy = function () {
328
363
  this.destroyStatic();
329
- if(this.eventChangeSubcribe) this.eventChangeSubcribe.unsubscribe();
364
+ if (this.eventChangeSubcribe) this.eventChangeSubcribe.unsubscribe();
330
365
  this.onMouseMove = null;
331
366
  this.onmousedown = null;
332
367
  this.onmouseup = null;
@@ -335,5 +370,5 @@ var Preview = (function (_super) {
335
370
  return Preview;
336
371
  }(Common));
337
372
 
338
- export {Preview};
373
+ export { Preview };
339
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;
@@ -40,6 +42,7 @@ export interface paramsData {
40
42
  varVaule?: [],
41
43
  branchValue?: [],
42
44
  echartData?: [],
45
+ dataConfig?: {},
43
46
  echartAssemblyData?: [],
44
47
  routingkey?: string,
45
48
  pathRewrite?: string
@@ -56,6 +59,8 @@ export interface visualization2DStore {
56
59
  cacheDatas?: {
57
60
  data: visualization2DData;
58
61
  }[];
62
+ // @ts-ignore
63
+ tabsPageMasterData: Map<string, any>;
59
64
  elementInteractivePoor: {}; // element 交互过渡数据
60
65
  pickerDataPool: {}; // datePicker 交互数据池
61
66
  echartsDataPool: {}; // echarts Dom节点数据
@@ -77,6 +82,8 @@ export interface visualization2DStore {
77
82
  }
78
83
  // @ts-ignore
79
84
  export const createStore = () => {
85
+ // @ts-ignore
86
+ // @ts-ignore
80
87
  return {
81
88
  id: '',
82
89
  data: {
@@ -86,6 +93,8 @@ export const createStore = () => {
86
93
  toArrowType: 'triangleSolid',
87
94
  scale: 1,
88
95
  pageZoom: 1,
96
+ pageType: 0,
97
+ tabsContentOptions: {},
89
98
  locked: Lock.None,
90
99
  bkImageRect: null,
91
100
  mqttOptions: {
@@ -106,6 +115,7 @@ export const createStore = () => {
106
115
  varVaule: [],
107
116
  branchValue: [],
108
117
  echartData: [],
118
+ dataConfig: {},
109
119
  echartAssemblyData: [],
110
120
  routingkey: '',
111
121
  pathRewrite: ''
@@ -160,6 +170,7 @@ export const clearStore = (store: visualization2DStore, del: string) => {
160
170
  toArrowType: 'triangleSolid',
161
171
  scale: 1,
162
172
  pageZoom: 1,
173
+ pageType: 0,
163
174
  locked: Lock.None,
164
175
  bkImageRect: null,
165
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
  },
@@ -46,12 +48,14 @@ export var createStore = function () {
46
48
  varVaule: [],
47
49
  branchValue: [],
48
50
  echartData: [],
51
+ dataConfig: {},
49
52
  echartAssemblyData: [],
50
53
  routingkey: '',
51
54
  pathRewrite: ''
52
55
  },
53
56
  pens: {},
54
57
  options: { ...DefalutOptions },
58
+ tabsPageMasterData: new Map(),
55
59
  elementInteractivePoor: {}, // element 交互过渡数据
56
60
  pickerDataPool: {}, // datePicker 交互数据池
57
61
  echartsDataPool: {}, // echarts Dom节点数据
@@ -135,6 +139,8 @@ export var clearStore = function (store, del) {
135
139
  toArrowType: 'triangleSolid',
136
140
  scale: 1,
137
141
  pageZoom: 1,
142
+ pageType: 0, // 0-默认:1-tabs切换
143
+ tabsContentOptions: {},
138
144
  locked: Lock.None,
139
145
  dataResize: 1, // 数据是否加载,1是,0否
140
146
  bkImageRect: null,
@@ -155,6 +161,10 @@ export var clearStore = function (store, del) {
155
161
  varVaule: [],
156
162
  branchValue: [],
157
163
  echartData: [],
164
+ dataConfig: store.mqttParams.dataConfig.data ? {
165
+ data: {},
166
+ picker: store.mqttParams.dataConfig.picker
167
+ } : {},
158
168
  echartAssemblyData: [],
159
169
  routingkey: '',
160
170
  pathRewrite: ''
@@ -181,6 +191,7 @@ export var clearStore = function (store, del) {
181
191
  timeDataPool: store.timeDataPool
182
192
  });
183
193
  if(del) {
194
+ store.mqttParams.dataConfig = {};
184
195
  delete commonStore[store.id];
185
196
  removeAllElement();
186
197
  }
@@ -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;
@@ -2,20 +2,27 @@
2
2
  import {commonStore} from '../store';
3
3
  import { setConfItemNode } from '../healps';
4
4
  import { EventAction } from '../models';
5
-
5
+ import {confAssociateDateValueShowType, datePickerValueFormatting} from '../utils';
6
6
  /**
7
7
  * 在节点注册前初始化node数据
8
8
  * @param node 节点数据
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) {
@@ -47,7 +60,38 @@ export function initDefaultValidat(node, retData) {
47
60
  if (node.name === 'line') {
48
61
  node.defaultStrokeStyle = node.strokeStyle;
49
62
  }
50
- const dataDictionary = retData && {...retData.varData, ...retData.branchNameData} || {};
63
+ setPickerDateConnectData(node);
64
+ setVarBranchData(node, retData);
65
+ }
66
+ // 初始化配置日期元件关联的数据
67
+ function setPickerDateConnectData(node) {
68
+ if(node.formData && node.formData.bindDateShowType === confAssociateDateValueShowType.date) {
69
+ const pickerData = commonStore[node.TID].pickerDataPool;
70
+ if(!pickerData.bindData) pickerData.bindData = {};
71
+ pickerData.bindData[node.id] = {
72
+ order: node.order,
73
+ dateId: node.formData.dateId
74
+ };
75
+ node.text = datePickerValueFormatting({
76
+ formatType: node.formData.dateFormat,
77
+ valueType: node.formData.valueType
78
+ }).dateStr;
79
+ }
80
+ }
81
+ // 设置变量类型和支路地址的异步数据
82
+ function setVarBranchData(node, retData) {
83
+ if(!retData) return;
84
+ const componentData = retData.componentData;
85
+ let varData = null;
86
+ let branchNameData = null;
87
+ if(componentData && Object.keys(componentData).length) {
88
+ varData = componentData[node.id] || {};
89
+ branchNameData = componentData[node.id] || {};
90
+ }else {
91
+ varData = retData.varData;
92
+ branchNameData = retData.branchNameData;
93
+ }
94
+ const dataDictionary = {...varData, ...branchNameData};
51
95
  // 变量类型数据展示,不需要实时更新
52
96
  if(Array.isArray(node.data) && Object.keys(dataDictionary).length) {
53
97
  let typeName = '';
@@ -43,8 +43,32 @@ export interface SelectStaticType {
43
43
  dataShow?:number;
44
44
  visible?:number;
45
45
  }
46
+ export interface DatePickerBindType {
47
+ echarts?:number;
48
+ tag?:number;
49
+ kpi?:number;
50
+ asset?:number;
51
+ area?:number;
52
+ varType?:number;
53
+ branch?:number;
54
+ word?:number;
55
+ }
56
+ export interface ConfBindValueType {
57
+ increment?:number; // 增量值
58
+ current?:number; // 当前值
59
+ max?:number; // 最大值
60
+ min?:number; // 最小值
61
+ average?:number; // 平均值
62
+ }
63
+ export interface ConfAssociateDateValueShowType {
64
+ real?:number; // 实时值
65
+ date?:number; // 日期值
66
+ }
46
67
  export const moveDataType: MoveDataType;
47
68
  export const downDataType: DownDataType;
48
69
  export const previewType: PreviewType;
49
70
  export const animateType: AnimateType;
50
71
  export const selectStaticType: SelectStaticType;
72
+ export const datePickerBindType: DatePickerBindType;
73
+ export const confBindValueType: ConfBindValueType;
74
+ export const confAssociateDateValueShowType: ConfAssociateDateValueShowType;
@@ -1,4 +1,4 @@
1
- export const echartsStaticType = ['DAY', 'WEEK', 'MONTH', 'YEAR', 'REALTIME'];
1
+ export const echartsStaticType = ['DAY', 'WEEK', 'MONTH', 'YEAR', 'REALTIME', 'CUSTOMIZE'];
2
2
  export const winEventActionFns = ['Link', 'DoAnimate', 'DoFn', 'DoWindowFn', 'openImg'];
3
3
  export const moveDataType = {
4
4
  None: 0,
@@ -40,4 +40,25 @@ export const selectStaticType = {
40
40
  static: 1,
41
41
  dataShow: 2,
42
42
  visible: 3
43
+ };
44
+ export const datePickerBindType = {
45
+ echarts: 1, // echart
46
+ tag: 3, // 测点
47
+ kpi: 6, // 指标
48
+ asset: 9, // 资产
49
+ area: 21, // 区域
50
+ varType: 12, // 变量类型
51
+ branch: 15, // 支路地址
52
+ word: -1 // 文字
53
+ };
54
+ export const confBindValueType = {
55
+ increment: 1, // 增量值
56
+ current: 2, // 当前值
57
+ max: 3, // 最大值
58
+ min: 4, // 最小值
59
+ average: 5 // 平均值
60
+ };
61
+ export const confAssociateDateValueShowType = {
62
+ real: 1, // 实时值
63
+ date: 2 // 日期值
43
64
  };
@@ -1,4 +1,6 @@
1
1
  import {Node} from "../models";
2
+ export declare function pageZoom(): number;
3
+ export declare function datePickerValueFormatting(data: {}): {};
2
4
  export declare function getTabConnectSHConf(node: Node): Node;
3
5
  export declare function tabStaticOperation(type: string, node: Node, areaData: any, params: object): void;
4
6
  export declare function tabHideShowOperation(node: any, areaData: any, visible: boolean): void;