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