dcim-topology2d 2.2.3 → 3.0.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 (222) 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 +1 -3
  17. package/chart-diagram/index.js +1 -2
  18. package/chart-diagram/src/echarts/index.d.ts +2 -1
  19. package/chart-diagram/src/echarts/index.js +78 -86
  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 -2
  26. package/core/index.js +18 -2
  27. package/core/src/activeLayer.d.ts +10 -2
  28. package/core/src/activeLayer.js +62 -57
  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 +68 -69
  33. package/core/src/canvas.d.ts +6 -1
  34. package/core/src/canvas.js +21 -22
  35. package/core/src/common.d.ts +7 -7
  36. package/core/src/common.js +698 -397
  37. package/core/src/core.d.ts +4 -5
  38. package/core/src/core.js +385 -536
  39. package/core/src/divLayer.d.ts +36 -2
  40. package/core/src/divLayer.js +305 -33
  41. package/core/src/healps/changeData.d.ts +2 -1
  42. package/core/src/healps/changeData.js +100 -89
  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 -65
  47. package/core/src/middles/index.d.ts +2 -1
  48. package/core/src/middles/index.js +2 -4
  49. package/core/src/middles/nodes/arbitrarygraph.js +9 -11
  50. package/core/src/middles/nodes/pentagon.rect.js +1 -1
  51. package/core/src/middles/nodes/rectangle.js +15 -54
  52. package/core/src/middles/nodes/rectangle.rect.js +1 -1
  53. package/core/src/models/data.d.ts +26 -0
  54. package/core/src/models/data.js +77 -0
  55. package/core/src/models/data.js.map +1 -0
  56. package/core/src/models/index.d.ts +1 -0
  57. package/core/src/models/index.js +1 -0
  58. package/core/src/models/line.js +7 -7
  59. package/core/src/models/node.d.ts +0 -10
  60. package/core/src/models/node.js +101 -155
  61. package/core/src/models/pen.js +68 -37
  62. package/core/src/models/rect.js +2 -2
  63. package/core/src/mqtt.d.ts +14 -0
  64. package/core/src/mqtt.js +82 -0
  65. package/core/src/mqtt.js.map +1 -0
  66. package/core/src/offscreen.d.ts +4 -1
  67. package/core/src/offscreen.js +24 -26
  68. package/core/src/options.d.ts +1 -3
  69. package/core/src/options.js +0 -2
  70. package/core/src/poll.js +39 -0
  71. package/core/src/preview.d.ts +13 -2
  72. package/core/src/preview.js +54 -181
  73. package/core/src/renderLayer.d.ts +9 -11
  74. package/core/src/renderLayer.js +61 -60
  75. package/core/src/socket.d.ts +10 -0
  76. package/core/src/socket.js +51 -0
  77. package/core/src/socket.js.map +1 -0
  78. package/core/src/utils/canvas.js +1 -1
  79. package/core/src/utils/construction.d.ts +3 -36
  80. package/core/src/utils/construction.js +1 -29
  81. package/core/src/utils/conversion.d.ts +0 -15
  82. package/core/src/utils/conversion.js +0 -319
  83. package/core/src/utils/dom.d.ts +8 -0
  84. package/core/src/utils/dom.js +67 -0
  85. package/core/src/utils/dom.js.map +1 -0
  86. package/core/src/utils/index.d.ts +1 -2
  87. package/core/src/utils/index.js +1 -2
  88. package/core/src/utils/onmousevent.d.ts +0 -3
  89. package/core/src/utils/onmousevent.js +10 -42
  90. package/flow-diagram/src/comment/comment.anchor.d.ts +1 -1
  91. package/flow-diagram/src/comment/comment.anchor.js +1 -1
  92. package/flow-diagram/src/comment/comment.d.ts +1 -1
  93. package/flow-diagram/src/data/data.anchor.d.ts +1 -1
  94. package/flow-diagram/src/data/data.anchor.js +1 -1
  95. package/flow-diagram/src/data/data.d.ts +1 -1
  96. package/flow-diagram/src/data/data.rect.d.ts +1 -1
  97. package/flow-diagram/src/data/data.rect.js +1 -1
  98. package/flow-diagram/src/db/db.d.ts +1 -1
  99. package/flow-diagram/src/db/db.rect.d.ts +1 -1
  100. package/flow-diagram/src/db/db.rect.js +1 -1
  101. package/flow-diagram/src/display/display.anchor.d.ts +1 -1
  102. package/flow-diagram/src/display/display.anchor.js +1 -1
  103. package/flow-diagram/src/display/display.d.ts +1 -1
  104. package/flow-diagram/src/display/display.rect.d.ts +1 -1
  105. package/flow-diagram/src/display/display.rect.js +1 -1
  106. package/flow-diagram/src/document/document.anchor.d.ts +1 -1
  107. package/flow-diagram/src/document/document.anchor.js +1 -1
  108. package/flow-diagram/src/document/document.d.ts +1 -1
  109. package/flow-diagram/src/document/document.rect.d.ts +1 -1
  110. package/flow-diagram/src/document/document.rect.js +1 -1
  111. package/flow-diagram/src/externStorage/externStorage.anchor.d.ts +1 -1
  112. package/flow-diagram/src/externStorage/externStorage.anchor.js +1 -1
  113. package/flow-diagram/src/externStorage/externStorage.d.ts +1 -1
  114. package/flow-diagram/src/externStorage/externStorage.rect.d.ts +1 -1
  115. package/flow-diagram/src/externStorage/externStorage.rect.js +1 -1
  116. package/flow-diagram/src/internalStorage/internalStorage.d.ts +1 -1
  117. package/flow-diagram/src/internalStorage/internalStorage.rect.d.ts +1 -1
  118. package/flow-diagram/src/internalStorage/internalStorage.rect.js +1 -1
  119. package/flow-diagram/src/manually/manually.anchor.d.ts +1 -1
  120. package/flow-diagram/src/manually/manually.anchor.js +1 -1
  121. package/flow-diagram/src/manually/manually.d.ts +1 -1
  122. package/flow-diagram/src/manually/manually.rect.d.ts +1 -1
  123. package/flow-diagram/src/manually/manually.rect.js +1 -1
  124. package/flow-diagram/src/parallel/parallel.anchor.d.ts +1 -1
  125. package/flow-diagram/src/parallel/parallel.anchor.js +1 -1
  126. package/flow-diagram/src/parallel/parallel.d.ts +1 -1
  127. package/flow-diagram/src/queue/queue.d.ts +1 -1
  128. package/flow-diagram/src/queue/queue.rect.d.ts +1 -1
  129. package/flow-diagram/src/queue/queue.rect.js +1 -1
  130. package/flow-diagram/src/register.js +1 -1
  131. package/flow-diagram/src/subprocess/subprocess.d.ts +1 -1
  132. package/flow-diagram/src/subprocess/subprocess.rect.d.ts +1 -1
  133. package/flow-diagram/src/subprocess/subprocess.rect.js +1 -1
  134. package/layout/src/align.d.ts +1 -1
  135. package/layout/src/align.js +1 -1
  136. package/layout/src/layout.d.ts +1 -1
  137. package/layout/src/layout.js +1 -1
  138. package/myShape-diagram/{index.js → myShape.js} +1 -4
  139. package/package.json +1 -1
  140. package/sequence-diagram/src/focus/focus.anchor.d.ts +1 -1
  141. package/sequence-diagram/src/focus/focus.anchor.js +1 -1
  142. package/sequence-diagram/src/focus/focus.d.ts +1 -1
  143. package/sequence-diagram/src/focus/focus.rect.d.ts +1 -1
  144. package/sequence-diagram/src/focus/focus.rect.js +1 -1
  145. package/sequence-diagram/src/lifeline/lifeline.anchor.d.ts +1 -1
  146. package/sequence-diagram/src/lifeline/lifeline.anchor.js +1 -1
  147. package/sequence-diagram/src/lifeline/lifeline.d.ts +1 -1
  148. package/sequence-diagram/src/lifeline/lifeline.rect.d.ts +1 -1
  149. package/sequence-diagram/src/lifeline/lifeline.rect.js +1 -1
  150. package/sequence-diagram/src/register.js +1 -1
  151. package/chart-diagram/src/utils/changeOptions.d.ts +0 -8
  152. package/chart-diagram/src/utils/changeOptions.js +0 -273
  153. package/chart-diagram/src/utils/conversion.d.ts +0 -19
  154. package/chart-diagram/src/utils/conversion.js +0 -601
  155. package/chart-diagram/src/utils/drawGraphic.d.ts +0 -3
  156. package/chart-diagram/src/utils/drawGraphic.js +0 -97
  157. package/chart-diagram/src/utils/formatter.d.ts +0 -1
  158. package/chart-diagram/src/utils/formatter.js +0 -206
  159. package/chart-diagram/src/utils/index.d.ts +0 -5
  160. package/chart-diagram/src/utils/index.js +0 -5
  161. package/chart-diagram/src/utils/render.d.ts +0 -8
  162. package/chart-diagram/src/utils/render.js +0 -223
  163. package/chart-diagram/src/utils/surfaceParametricConversion.d.ts +0 -3
  164. package/chart-diagram/src/utils/surfaceParametricConversion.js +0 -252
  165. package/core/src/element/common.d.ts +0 -6
  166. package/core/src/element/common.js +0 -62
  167. package/core/src/element/datePicker.d.ts +0 -3
  168. package/core/src/element/datePicker.js +0 -44
  169. package/core/src/element/iframe.d.ts +0 -3
  170. package/core/src/element/iframe.js +0 -12
  171. package/core/src/element/index.d.ts +0 -5
  172. package/core/src/element/index.js +0 -6
  173. package/core/src/element/select.d.ts +0 -11
  174. package/core/src/element/select.js +0 -273
  175. package/core/src/element/tab.d.ts +0 -1
  176. package/core/src/element/tab.js +0 -20
  177. package/core/src/element/time.d.ts +0 -3
  178. package/core/src/element/time.js +0 -44
  179. package/core/src/middles/arrows/index.d.ts +0 -4
  180. package/core/src/middles/arrows/index.js +0 -5
  181. package/core/src/middles/lines/index.d.ts +0 -4
  182. package/core/src/middles/lines/index.js +0 -5
  183. package/core/src/middles/nodes/formDatePicker.d.ts +0 -2
  184. package/core/src/middles/nodes/formDatePicker.js +0 -108
  185. package/core/src/middles/nodes/formoverflow.js +0 -62
  186. package/core/src/middles/nodes/formselect.d.ts +0 -2
  187. package/core/src/middles/nodes/formselect.js +0 -111
  188. package/core/src/middles/nodes/iframe.d.ts +0 -2
  189. package/core/src/middles/nodes/iframe.js +0 -29
  190. package/core/src/middles/nodes/index.d.ts +0 -52
  191. package/core/src/middles/nodes/index.js +0 -54
  192. package/core/src/middles/nodes/progress.d.ts +0 -2
  193. package/core/src/middles/nodes/progress.js +0 -63
  194. package/core/src/middles/nodes/progress.js.map +0 -1
  195. package/core/src/middles/nodes/switchs.d.ts +0 -2
  196. package/core/src/middles/nodes/switchs.js +0 -46
  197. package/core/src/middles/nodes/time.d.ts +0 -2
  198. package/core/src/middles/nodes/time.js +0 -98
  199. package/core/src/store/common.d.ts +0 -9
  200. package/core/src/store/common.js +0 -5
  201. package/core/src/store/data.d.ts +0 -205
  202. package/core/src/store/data.js +0 -198
  203. package/core/src/store/index.d.ts +0 -2
  204. package/core/src/store/index.js +0 -2
  205. package/core/src/utils/assignment.d.ts +0 -7
  206. package/core/src/utils/assignment.js +0 -229
  207. package/core/src/utils/params.d.ts +0 -3
  208. package/core/src/utils/params.js +0 -136
  209. package/static/echartsDefaultData.js +0 -178
  210. package/static/element.js +0 -14
  211. package/static/form.js +0 -11
  212. package/static/index.js +0 -3
  213. package/store/actions.js +0 -2
  214. package/store/clear.js +0 -14
  215. package/store/default.js +0 -22
  216. package/store/index.js +0 -3
  217. package/style/common.css +0 -15
  218. package/style/datePicker.css +0 -44
  219. package/style/editor.css +0 -16
  220. package/style/index.css +0 -5
  221. package/style/select.css +0 -143
  222. /package/myShape-diagram/{index.d.ts → myShape.ts} +0 -0
@@ -1,198 +0,0 @@
1
- var __assign = (this && this.__assign) || function () {
2
- __assign = Object.assign || function(t) {
3
- for (var s, i = 1, n = arguments.length; i < n; i++) {
4
- s = arguments[i];
5
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
- t[p] = s[p];
7
- }
8
- return t;
9
- };
10
- return __assign.apply(this, arguments);
11
- };
12
- import { default as mitt } from 'mitt';
13
- import { Lock } from '../models';
14
- import {DefalutOptions} from '../options';
15
- import {s8} from '../utils';
16
- import {commonStore} from './common';
17
- import {removeAllElement} from '../../../store';
18
- export var createStore = function () {
19
- return {
20
- id: '',
21
- data: {
22
- pens: [],
23
- lineName: 'curve',
24
- fromArrowType: '',
25
- toArrowType: 'triangleSolid',
26
- scale: 1,
27
- locked: Lock.None,
28
- dataResize: 1, // 数据是否加载,1是,0否
29
- bkImageRect: null,
30
- pageZoom: 1,
31
- pageType: 0, // 0-默认:1-tabs切换
32
- tabsContentOptions: {}, // tabs内容区域配置属性
33
- mqttOptions: {
34
- clientId: s8()
35
- },
36
- dataConstruct: {},
37
- bindDataTooltipVisible: true
38
- },
39
- mqttData: null,
40
- initConfNode: {},
41
- mqttParams: {
42
- doorIds: [],
43
- tagIds: [],
44
- kpiAddrs: [],
45
- tagEcharts: [],
46
- assetIds: [],
47
- areaIds: [],
48
- varVaule: [],
49
- branchValue: [],
50
- echartData: [],
51
- dataConfig: {},
52
- echartAssemblyData: [],
53
- routingkey: '',
54
- pathRewrite: ''
55
- },
56
- pens: {},
57
- options: { ...DefalutOptions },
58
- tabsPageMasterData: new Map(),
59
- elementInteractivePoor: {}, // element 交互过渡数据
60
- pickerDataPool: {}, // datePicker 交互数据池
61
- echartsDataPool: {}, // echarts Dom节点数据
62
- echartsOptionsPool: {}, // echarts options节点数据
63
- echartsRealDataPool: {}, // echarts 实时数据 datePicker
64
- switchTabDataPool: {}, // tabs
65
- tableDataPool: {}, // form table
66
- selectDataPool: {}, // form select
67
- selectRealDataPool: {}, // form select
68
- selectTabDataPool: {}, // form select
69
- iframeDataPool: {}, // iframe
70
- formoverDataPool: {}, // 滚动组件 Dom节点数据
71
- formoverCanvasDataPool: {}, // 滚动组件 画布节点数据
72
- emitter: mitt(),
73
- cacheDatas: [],
74
- dpiRatio: 1,
75
- lastScale: 1,
76
- monitorAlarm: false,// 全局报警标记,代表正在访问的这个topology文件中是否有告警发生
77
- parentElem: null,
78
- timeDataPool: {}, // time
79
- };
80
- };
81
- export var useStore = function (id) {
82
- if (id === void 0) { id = 'default'; }
83
- if (!commonStore[id]) {
84
- commonStore[id] = createStore();
85
- commonStore[id].id = id;
86
- }
87
- return commonStore[id];
88
- };
89
- export function clearElementDataPool(data) {
90
- const { echartsDataPool, selectDataPool, iframeDataPool, formoverDataPool, formoverCanvasDataPool} = data;
91
- for (let [key, node] of Object.entries(echartsDataPool)) {
92
- if(node) {
93
- clearInterval(node.timeTicket);
94
- if(node.chart) {
95
- node.chart.off('mouseover');
96
- node.chart.off('mouseout');
97
- node.chart.off('globalout');
98
- node.chart.dispose();
99
- }
100
- if(node.div && node.div.parentNode) node.div.parentNode.removeChild(node.div);
101
- }
102
- delete data.echartsDataPool[key];
103
- }
104
- if(Object.keys(selectDataPool).length) {
105
- let dropdownEle = null,
106
- dropdownListEle = null;
107
- for (let [key, node] of Object.entries(selectDataPool)) {
108
- if(!dropdownEle) {
109
- dropdownEle = node.dom.selectDropdown;
110
- dropdownListEle = node.dom.selectDropdownUl;
111
- }
112
- if(node.dom.selectEle && node.dom.selectEle.parentNode) node.dom.selectEle.parentNode.removeChild(node.dom.selectEle);
113
- delete data.selectDataPool[key];
114
- }
115
- if(dropdownEle) dropdownEle.style.display = 'none';
116
- if(dropdownListEle) dropdownListEle.innerHTML = '';
117
- }
118
- for (let [key, node] of Object.entries(iframeDataPool)) {
119
- node.iframe.parentNode.removeChild(node.iframe);
120
- delete data.iframeDataPool[key];
121
- }
122
- for (let key of Object.keys(formoverDataPool)) {
123
- delete formoverDataPool[key];
124
- }
125
- for (let key of Object.keys(formoverCanvasDataPool)) {
126
- const elementNode = document.getElementById(key);
127
- if(elementNode) {
128
- elementNode.parentNode.removeChild(elementNode);
129
- }
130
- delete formoverCanvasDataPool[key];
131
- }
132
- }
133
- export var clearStore = function (store, del) {
134
- store.lastScale = store.data.scale;
135
- store.data = {
136
- pens: [],
137
- lineName: 'curve',
138
- fromArrowType: '',
139
- toArrowType: 'triangleSolid',
140
- scale: 1,
141
- pageZoom: 1,
142
- pageType: 0, // 0-默认:1-tabs切换
143
- tabsContentOptions: {},
144
- locked: Lock.None,
145
- dataResize: 1, // 数据是否加载,1是,0否
146
- bkImageRect: null,
147
- mqttOptions: {
148
- clientId: s8()
149
- },
150
- dataConstruct: {},
151
- bindDataTooltipVisible: true
152
- };
153
- store.initConfNode = {};
154
- store.mqttParams = {
155
- doorIds: [],
156
- tagIds: [],
157
- kpiAddrs: [],
158
- tagEcharts: [],
159
- assetIds: [],
160
- areaIds: [],
161
- varVaule: [],
162
- branchValue: [],
163
- echartData: [],
164
- dataConfig: store.mqttParams.dataConfig.data ? {
165
- data: {},
166
- picker: store.mqttParams.dataConfig.picker
167
- } : {},
168
- echartAssemblyData: [],
169
- routingkey: '',
170
- pathRewrite: ''
171
- };
172
- store.pens = {}; // 先保留,后期优化提取变量用
173
- store.cacheDatas = [];
174
- store.dpiRatio = 1;
175
- store.lastScale = 1;
176
- store.monitorAlarm = false;
177
- store.elementInteractivePoor = {};
178
- store.pickerDataPool = {};
179
- store.echartsOptionsPool = {};
180
- store.echartsRealDataPool = {};
181
- store.switchTabDataPool = {};
182
- store.tableDataPool = {};
183
- store.selectRealDataPool = {};
184
- store.selectTabDataPool = {};
185
- clearElementDataPool({
186
- echartsDataPool: store.echartsDataPool,
187
- selectDataPool: store.selectDataPool,
188
- iframeDataPool: store.iframeDataPool,
189
- formoverDataPool: store.formoverDataPool,
190
- formoverCanvasDataPool: store.formoverCanvasDataPool,
191
- timeDataPool: store.timeDataPool
192
- });
193
- if(del) {
194
- store.mqttParams.dataConfig = {};
195
- delete commonStore[store.id];
196
- removeAllElement();
197
- }
198
- };
@@ -1,2 +0,0 @@
1
- export * from './data'
2
- export * from './common'
@@ -1,2 +0,0 @@
1
- export * from './data'
2
- export * from './common'
@@ -1,7 +0,0 @@
1
- import {Node} from '../models';
2
-
3
- export declare function setInitNodeDataValidat(node: any, TID: string, type: string, order: number, options: any): void;
4
- export declare function initDefaultValidat(node: any, retData: any): void;
5
- export declare function setDefaultNodeValidat(node: any, retData: any): any;
6
- export declare function setConnectionTagForConf(node: Node): void;
7
- export declare function setConnectionTabsData(node: Node): void;
@@ -1,229 +0,0 @@
1
- // 变量赋值操作
2
- import {commonStore} from '../store';
3
- import { setConfItemNode } from '../healps';
4
- import { EventAction } from '../models';
5
- import {confAssociateDateValueShowType, datePickerValueFormatting} from '../utils';
6
- /**
7
- * 在节点注册前初始化node数据
8
- * @param node 节点数据
9
- * @param TID 数据键
10
- * @param type topology类型
11
- * @param order 节点序列
12
- * @param options 配置数据
13
- */
14
- export function setInitNodeDataValidat(node, TID, type, order, options) {
15
-
16
- const syncData = node.PTID? commonStore[node.PTID].mqttData: commonStore[TID].mqttData;
17
-
18
- node.TID = TID;
19
-
20
- if(options.pageId){
21
- // tabs页面元件偏移量计算
22
- node.rect.x += options.x;
23
- node.rect.y += options.y;
24
- }
25
-
26
- if(typeof node.visibleSwitch !== 'boolean') {
27
- // 兼容旧版显示隐藏属性值设置
28
- node.visibleSwitch = type === 'topology';
29
- }else {
30
- node.visibleSwitch = type === 'topology' && node.visibleSwitch;
31
- }
32
-
33
- if(typeof order === "number") node.order = order;
34
- if(type !== 'topology') node.selectDropdown = false;
35
-
36
- initDefaultValidat(node, syncData);
37
-
38
- setDefaultNodeValidat(node, syncData);
39
-
40
- if (node.children && node.children.length) {
41
-
42
- node.children.map((_item) => {
43
- _item.PTID = node.PTID;
44
- setInitNodeDataValidat(_item, TID, type, null, options);
45
-
46
- })
47
-
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
-
55
- }
56
- // 初始化默认节点值
57
- export function initDefaultValidat(node, retData) {
58
- node.defaultFillStyle = node.fillStyle;
59
- node.defaultFontColor = node.font.color;
60
- if (node.name === 'line') {
61
- node.defaultStrokeStyle = node.strokeStyle;
62
- }
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};
95
- // 变量类型数据展示,不需要实时更新
96
- if(Array.isArray(node.data) && Object.keys(dataDictionary).length) {
97
- let typeName = '';
98
- let imgs = '';
99
- const assetId = retData.asset && retData.asset.assetId;
100
- node.data.map((vd) => {
101
- const varNode = dataDictionary[vd.value] || dataDictionary[`${assetId}_${vd.value}`];
102
- if((vd.key.includes('varValue') || vd.key.includes('branchVal')) && varNode){
103
- const showType = varNode.showType ? parseInt(varNode.showType) : 1;
104
- if(showType === 1 && varNode.value) typeName += typeName ? `,${varNode.value}` : varNode.value;
105
- if(showType === 2 && varNode.value) console.log('显示图标>>>');
106
- if(showType === 3 && varNode.value) imgs = `/dcim-api${varNode.value}`; //imgs += imgs ? `,${varData.value}` : varData.value;
107
- }
108
- });
109
- if(typeName) node.text = typeName;
110
- if(imgs) {
111
- node.text = '';
112
- node.image = imgs;
113
- node.paddingBottom = 0;
114
- node.paddingBottomNum = 0;
115
- node.paddingLeft = 0;
116
- node.paddingLeftNum = 0;
117
- node.paddingRight = 0;
118
- node.paddingRightNum = 0;
119
- node.paddingTop = 0;
120
- node.paddingTopNum = 0;
121
- }
122
- }
123
- }
124
- // 初始化mqtt实时值
125
- export function setDefaultNodeValidat(node, retData) {
126
- //const item = JSON.parse(JSON.stringify(node));
127
- if (!retData) return;
128
- //const node = detailData.length > 0 ? detailData : syncData
129
- const functionData = node.events.filter((ev) => {
130
- return ev.action === EventAction.Function
131
- });
132
- const dataValue = functionData[0]
133
- if (functionData.length && dataValue.value && retData) {
134
- if(node.data && node.data.length) node.data.map((d) => {
135
- const {kpiData, tagData} = retData;
136
- const key = d.key;
137
- const value = d.value;
138
- const _syncItem = key === 'tagId' ? tagData[value] : kpiData[value];
139
- if ((key === 'tagId' || key === 'kpiAddr') && _syncItem) {
140
- const isControl = parseInt(_syncItem.isControlDis); // 是否可控,0可控,1不可控
141
- if (!isControl) {
142
- d.tagVal = value
143
- d.controlParams = _syncItem
144
- // delete _syncItem[value]
145
- // Object.assign(d, _syncItem)
146
- }
147
- }
148
- })
149
- // console.log('定制函数=====')
150
- try {
151
- const func = new Function('pen', 'params', dataValue.value);
152
- const funcData = func(node, JSON.stringify(retData));
153
- /**
154
- * 此方式在九所的 服务器状态监测功能中用到
155
- * 全局报警标记,代表正在访问的这个topology文件中是否有告警发生
156
- * 需要注意:自定义函数中要通过 return {monitorAlarm: boolean}的格式将元件告警状态返回
157
- */
158
- if(funcData && funcData.monitorAlarm && commonStore[node.TID]) commonStore[node.TID].monitorAlarm = true;
159
- }catch (e) {
160
- console.log(`自定义函数出错>>>`,);
161
- console.log(`目标元件:${node.id}>>>`,);
162
- console.log(`目标元件方位:X->${node.rect.x},Y->${node.rect.y}>>>`,);
163
- }
164
- } else {
165
- // console.log('默认函数')
166
- const newData = setConfItemNode(node, retData);
167
- if(newData && newData.monitorAlarm && commonStore[node.TID]) commonStore[node.TID].monitorAlarm = true;
168
- }
169
- if (node.animateFrames && node.animateFrames.length) {
170
- for (var _a = 0, _af = node.animateFrames; _a < _af.length; _a++) {
171
- var ani = _af[_a];
172
- ani.state.strokeStyle = node.strokeStyle;
173
- ani.state.fillStyle = node.fillStyle;
174
- }
175
- }
176
- //return node;
177
- }
178
-
179
- /**
180
- * 配置与元件关联的tag数据
181
- * @param node 元件节点数据
182
- */
183
- export function setConnectionTagForConf(node) {
184
- if(!node.tags || node.tags && !node.tags.length) return;
185
- let setType = '';
186
- node.tags.map((t) => {
187
- if(t === 'statisticType' || t.includes('switchTabType')) setType = 'tab';
188
- if(t.includes('selectOption')) setType = 'selectShow';
189
- });
190
- if(!setType) console.log('>>>未能找到绑定的标签数据,请检查绑定的Tabs标签是否包含switchTabType前缀>>>');
191
- if(setType === 'tab'){
192
- // tab切换
193
- setConnectionTabsData(node);
194
- }
195
- if(setType === 'selectShow'){
196
- // 下拉显示隐藏
197
- const tagData = node.tags[0].split('-');
198
- const parentId = tagData[1] && tagData[1].trim();
199
- if(!parentId) return console.log('>>>请检查select节点ID是否设置正确【selectOption+其他任意字符-下拉元件ID】>>>');
200
- if(parentId) {
201
- const params = {
202
- TID: node.TID,
203
- id: node.id,
204
- name: node.name,
205
- order: node.order,
206
- visible: node.visible,
207
- tag: node.tags[0].trim()
208
- }
209
- if(!commonStore[node.TID].selectTabDataPool[parentId]) commonStore[node.TID].selectTabDataPool[parentId] = new Map();
210
- commonStore[node.TID].selectTabDataPool[parentId].set(node.id, params);
211
- }
212
- }
213
- }
214
-
215
- /**
216
- * 初始化配置tabs数据
217
- * @param node
218
- */
219
- export function setConnectionTabsData(node) {
220
- const switchTabType = node.tags.find((t) => {
221
- return t.includes('switchTabType');
222
- }); // 获取按钮组类型
223
- if(!switchTabType) return;
224
- const isTabs = node.events && node.events.find((ev) => ev.action === 8);
225
- let topologyChangeData = commonStore[node.TID].switchTabDataPool;
226
- let keyName = node.bindStaticId && isTabs ? `${switchTabType}Data` : `${switchTabType}AreaData`;
227
- if (!topologyChangeData[keyName]) topologyChangeData[keyName] = {};
228
- topologyChangeData[keyName][node.id] = node;
229
- }
@@ -1,3 +0,0 @@
1
- // @ts-ignore
2
- export declare function getParams(id: string, data: []): void;
3
- export declare function filterParams(node: any): void;
@@ -1,136 +0,0 @@
1
- import {commonStore} from '../store';
2
- import {datePickerValueFormatting} from "./conversion";
3
- import {datePickerBindType, confBindValueType} from "./construction";
4
- const confConfigMap = new Map();
5
- // 获取绑定数据的参数
6
- export function getParams(id, data) {
7
- for (let i = 0, length = data.length; i < length; i++) {
8
- const item = data[i];
9
- filterParams(id, item);
10
- if (item.children && item.children.length) {
11
- getParams(id, item.children);
12
- }
13
- if (item.formData && item.formData.detailPageData && item.formData.detailPageData.pens && item.formData.detailPageData.pens.length) {
14
- getParams(id, item.formData.detailPageData.pens);
15
- }
16
- }
17
- confConfigMap.clear();
18
- }
19
- // 过滤出参数
20
- export function filterParams(id, node) {
21
- let tagIds = [];
22
- let kpiAddrs = [];
23
- let assetIds = [];
24
- let areaIds = [];
25
- let tagEcharts = [];
26
- let echartData = [];
27
- let varVaule = [];
28
- let branchValue = [];
29
- let doorIds = [];
30
- let isMqttEventType = false;
31
- let dcimStaticForType = '';
32
- node.events.map((ev) => {
33
- if(ev.value && ev.value === 'entranceGuard') doorIds.push(ev.params); // 门禁参数
34
- if(ev.type === 3) isMqttEventType = true;
35
- if(ev.type === 4) dcimStaticForType = ev.dcimStaticForType;
36
- });
37
- if(doorIds.length) commonStore[id].mqttParams.doorIds = [...commonStore[id].mqttParams.doorIds, ...doorIds];
38
- if(!isMqttEventType) return;
39
- if (node.data && Array.isArray(node.data) && node.data.length) {
40
- for (let i = 0, length = node.data.length; i < length; i ++) {
41
- const item = node.data[i];
42
- let type = 0;
43
- if (item.key === 'tagId') {
44
- tagIds.push(item.value);
45
- type = datePickerBindType.tag;
46
- }
47
- if (item.key === 'kpiAddr') {
48
- kpiAddrs.push(item.value);
49
- type = datePickerBindType.kpi;
50
- }
51
- if (item.key === 'assetId') {
52
- assetIds.push(item.value);
53
- type = datePickerBindType.asset;
54
- }
55
- if (item.key === 'areaId') {
56
- areaIds.push(item.value);
57
- type = datePickerBindType.area;
58
- }
59
- if (item.key.includes('varValue')) {
60
- varVaule.push(item.value);
61
- type = datePickerBindType.varType;
62
- }
63
- if (item.key === 'branchVal') {
64
- branchValue.push(item.value);
65
- type = datePickerBindType.branch;
66
- }
67
- if(dcimStaticForType && node.formData && type) setConfConfigMap(node.id, id, node.formData, item.value, type);
68
- }
69
- }
70
- if (node.data && Object.prototype.toString.call(node.data) === '[object Object]' && node.data.params && node.data.params.id) {
71
- echartData.push(node.data.params.id);
72
- if(dcimStaticForType && node.formData) setConfConfigMap(node.id, id, node.formData, node.data.params.id, 1);
73
- }
74
- commonStore[id].mqttParams.tagIds = [...commonStore[id].mqttParams.tagIds, ...tagIds];
75
- commonStore[id].mqttParams.kpiAddrs = [...commonStore[id].mqttParams.kpiAddrs, ...kpiAddrs];
76
- commonStore[id].mqttParams.assetIds = [...commonStore[id].mqttParams.assetIds, ...assetIds];
77
- commonStore[id].mqttParams.areaIds = [...commonStore[id].mqttParams.areaIds, ...areaIds];
78
- commonStore[id].mqttParams.varVaule = [...commonStore[id].mqttParams.varVaule, ...varVaule];
79
- commonStore[id].mqttParams.branchValue = [...commonStore[id].mqttParams.branchValue, ...branchValue];
80
- commonStore[id].mqttParams.tagEcharts = [...commonStore[id].mqttParams.tagEcharts, ...tagEcharts];
81
- commonStore[id].mqttParams.echartData = [...commonStore[id].mqttParams.echartData, ...echartData];
82
- }
83
-
84
- /**
85
- * 设置绑定日期的配置数据
86
- * @param formData 元件关联的日期数据
87
- * @param id 当前元件id
88
- * @param tid
89
- * @param realData 当前元件绑定的数据
90
- * @param type 当前元件绑定的数据类型 1:echart 3:测点 6:指标 9:资产 12:变量类型 15:支路地址 21:区域
91
- */
92
- function setConfConfigMap(id, tid, formData, realData, type) {
93
- if(!formData.dateId) return;
94
- const dateId = formData.dateId;
95
- let value = null;
96
- let valueStr = '';
97
- if(confConfigMap.has(dateId)) {
98
-
99
- const {date, dateStr} = confConfigMap.get(dateId);
100
-
101
- value = date;
102
-
103
- valueStr = dateStr;
104
-
105
- }else {
106
-
107
- const {date, dateStr} = datePickerValueFormatting({
108
- formatType: formData.dateFormat,
109
- valueType: formData.valueType,
110
- dateType: formData.dateType
111
- });
112
-
113
- value = date;
114
-
115
- valueStr = dateStr;
116
-
117
- confConfigMap.set(dateId, {date, dateStr});
118
-
119
- }
120
- const dataConfig = commonStore[tid].mqttParams.dataConfig;
121
- if(!dataConfig.data){
122
- dataConfig.data = {};
123
- dataConfig.picker = new Map();
124
- }
125
- dataConfig.data[id] = {
126
- id: realData,
127
- date: value,
128
- dataType: type,
129
- valueType: confBindValueType.increment
130
- };
131
- dataConfig.picker.set(id, {
132
- dateId,
133
- date: value,
134
- dateStr: valueStr
135
- });
136
- }