@riil-frontend/component-topology 11.0.34 → 12.0.0-dev.1

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/build/1.js +2 -2
  2. package/build/2.js +1 -1
  3. package/build/index.css +4 -2
  4. package/build/index.js +57 -34
  5. package/es/components/BatchAttrMetric/setting.js +1 -1
  6. package/es/components/MultiResourceDrawer/index.js +16 -18
  7. package/es/components/ResourceList/ResourceSelect.js +48 -50
  8. package/es/components/ResourceSelectDrawer/ResourceSelectDrawer.js +24 -26
  9. package/es/components/SingleResourceDrawer/SelectDrawer.js +18 -20
  10. package/es/core/components/DisplaySettingDrawer/DisplaySettingDrawer.js +23 -25
  11. package/es/core/components/DisplaySettingDrawer/hooks/useDisplaySetting.js +78 -84
  12. package/es/core/components/titlebar/widgets/TitleWidget.js +5 -3
  13. package/es/core/editor/components/BackgroundView/UploadDialog/index.js +17 -18
  14. package/es/core/editor/components/BackgroundView/index.js +119 -129
  15. package/es/core/editor/components/CustomIconPlugin/RenameDialog.js +20 -22
  16. package/es/core/editor/components/CustomIconPlugin/UploadIconDialog.js +33 -34
  17. package/es/core/editor/components/CustomIconPlugin/utils/svgToShape.js +15 -17
  18. package/es/core/editor/components/GroupAddResourceDrawerPlugin/GroupAddResourceDrawer.js +7 -9
  19. package/es/core/editor/components/Sidebar/views/CanvasPanel/hooks/useCanvasThemeConfig.js +37 -41
  20. package/es/core/editor/components/Toolbar/widgets/BoxBackgroundButton/BoxBackgroundSetting.js +50 -54
  21. package/es/core/editor/components/Toolbar/widgets/FontColorButton.js +50 -54
  22. package/es/core/editor/components/settings/propertyViews/layer/DataTab/DefaultLayerAddResourceDrawer.js +11 -13
  23. package/es/core/editor/components/settings/propertyViews/node/data/BindResourceDrawer.js +21 -23
  24. package/es/core/editor/components/settings/propertyViews/node/data/Data.js +15 -17
  25. package/es/core/editor/components/settings/propertyViews/view/BackgroundSize.js +10 -12
  26. package/es/core/editor/components/titlebar/TopoEditorTitleBar.js +21 -27
  27. package/es/core/editor/hooks/useKeyboardShortcut.js +36 -32
  28. package/es/core/editor/hooks/useNewElementTheme.js +2 -2
  29. package/es/core/editor/store/background.js +8 -10
  30. package/es/core/editor/store/topoEdit.js +4 -6
  31. package/es/core/editor/utils/copyElementUtil.js +171 -0
  32. package/es/core/editor/utils/edgeTypeStyleUtil.js +2 -4
  33. package/es/core/hooks/usePolling.js +117 -121
  34. package/es/core/hooks/useResourceConfig.js +58 -66
  35. package/es/core/hooks/useTopoEdit.js +473 -503
  36. package/es/core/models/Alarm.js +281 -298
  37. package/es/core/models/AttributeMetricDisplay.js +101 -107
  38. package/es/core/models/PluginManager.js +4 -3
  39. package/es/core/models/SelectionModel.js +4 -5
  40. package/es/core/models/TopoApp.js +205 -240
  41. package/es/core/models/TopoGraphView.js +18 -21
  42. package/es/core/models/cache/CiCache.js +28 -27
  43. package/es/core/models/cache/CiTypeCache.js +37 -41
  44. package/es/core/models/cache/DictCache.js +33 -35
  45. package/es/core/models/graph/Background.js +15 -17
  46. package/es/core/models/plugins/resourceWebControllUrl.js +76 -82
  47. package/es/core/models/tagstips/ElementTagTipConfig.js +34 -38
  48. package/es/core/models/topoData.js +68 -70
  49. package/es/core/models/utils/linkUtils.js +41 -43
  50. package/es/core/models/utils/nodeNameVisibleUtil.js +4 -4
  51. package/es/core/services/alarm.js +14 -16
  52. package/es/core/services/background.js +59 -67
  53. package/es/core/services/cmdb/metric.js +9 -11
  54. package/es/core/services/cmdb.js +20 -20
  55. package/es/core/services/index.js +39 -45
  56. package/es/core/services/overview.js +131 -151
  57. package/es/core/services/topo/basic.js +37 -41
  58. package/es/core/services/topo/tagtip.js +10 -12
  59. package/es/core/store/models/ciModel.js +58 -62
  60. package/es/core/store/models/customIcon.js +120 -134
  61. package/es/core/store/models/displayConfig.js +15 -19
  62. package/es/core/store/models/selection.js +4 -6
  63. package/es/core/store/models/topoAlarm.js +162 -145
  64. package/es/core/store/models/topoBaseInfoOverview.js +4 -6
  65. package/es/core/store/models/topoBizMod.js +9 -11
  66. package/es/core/store/models/topoConfig.js +215 -231
  67. package/es/core/store/models/topoGraphView.js +4 -6
  68. package/es/core/store/models/topoMod.js +373 -395
  69. package/es/core/utils/imageUtil.js +18 -20
  70. package/es/core/utils/metricUtil.js +5 -0
  71. package/es/core/utils/saveSerialize.js +9 -11
  72. package/es/core/viewer/components/plugins/ResourceDetail/components/ClusterMemberTable.js +56 -58
  73. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/EventsCard.js +15 -17
  74. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/ResourceOverview.js +343 -357
  75. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/Configurator/index.js +86 -92
  76. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/LinkTopoCard.js +39 -41
  77. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/services/index.js +189 -205
  78. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/hooks/useAlarmAndRiskData.js +107 -109
  79. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/hooks/useMetricModels.js +57 -59
  80. package/es/core/viewer/components/plugins/ResourceDetail/components/WebConsole/WebConsoleForm/hooks/useWebConsole.js +33 -37
  81. package/es/core/viewer/components/plugins/ResourceDetail/getCiDisplayMetricModels.js +25 -29
  82. package/es/core/viewer/components/plugins/ResourceDetail/hooks/useUserId.js +32 -36
  83. package/es/core/viewer/components/plugins/ResourceWebControllUrlSettingDialog.js +17 -19
  84. package/es/networkTopo/components/Link/hook.js +73 -77
  85. package/es/networkTopo/components/Link/index.js +86 -94
  86. package/es/networkTopo/components/Link/setting.js +42 -44
  87. package/es/networkTopo/getTopoData.js +63 -69
  88. package/es/networkTopo/hooks/viewer/useRelateTopo.js +30 -32
  89. package/es/networkTopo/models/LinkDynamicStyleExecutor.js +2 -2
  90. package/es/networkTopo/models/TopoCenter.js +18 -22
  91. package/es/networkTopo/services/alert.js +18 -22
  92. package/es/networkTopo/services/authorization.js +45 -55
  93. package/es/networkTopo/services/cmdb.js +422 -470
  94. package/es/networkTopo/services/funcAuth.js +22 -24
  95. package/es/networkTopo/services/link.js +107 -117
  96. package/es/networkTopo/services/mdc.js +18 -24
  97. package/es/networkTopo/services/metric.js +23 -27
  98. package/es/networkTopo/services/model.js +445 -509
  99. package/es/networkTopo/services/risk.js +9 -11
  100. package/es/networkTopo/services/topo/auth.js +27 -33
  101. package/es/networkTopo/services/topo/basic.js +251 -289
  102. package/es/networkTopo/services/topo/blacklist.js +20 -24
  103. package/es/networkTopo/services/topo/ciInfo.js +27 -31
  104. package/es/networkTopo/services/topo/icon.js +49 -59
  105. package/es/networkTopo/services/topo/networkLink.js +32 -36
  106. package/es/networkTopo/services/topo/relation.js +9 -11
  107. package/es/networkTopo/services/topo/resourceWebUrl.js +36 -42
  108. package/es/networkTopo/store/functionAuth.js +31 -37
  109. package/es/networkTopo/store/topoCenter.js +142 -152
  110. package/es/networkTopo/store/topoLinkMod.js +4 -6
  111. package/es/networkTopo/store/topoTreeMod.js +170 -182
  112. package/es/networkTopo/utils/exportData.js +52 -54
  113. package/lib/components/BatchAttrMetric/setting.js +1 -1
  114. package/lib/components/MultiResourceDrawer/index.js +16 -18
  115. package/lib/components/ResourceList/ResourceSelect.js +48 -50
  116. package/lib/components/ResourceSelectDrawer/ResourceSelectDrawer.js +27 -29
  117. package/lib/components/SingleResourceDrawer/SelectDrawer.js +18 -20
  118. package/lib/core/components/DisplaySettingDrawer/DisplaySettingDrawer.js +30 -32
  119. package/lib/core/components/DisplaySettingDrawer/hooks/useDisplaySetting.js +78 -84
  120. package/lib/core/components/titlebar/widgets/TitleWidget.js +5 -3
  121. package/lib/core/editor/components/BackgroundView/UploadDialog/index.js +18 -18
  122. package/lib/core/editor/components/BackgroundView/index.js +118 -128
  123. package/lib/core/editor/components/CustomIconPlugin/RenameDialog.js +22 -24
  124. package/lib/core/editor/components/CustomIconPlugin/UploadIconDialog.js +34 -34
  125. package/lib/core/editor/components/CustomIconPlugin/utils/svgToShape.js +19 -21
  126. package/lib/core/editor/components/GroupAddResourceDrawerPlugin/GroupAddResourceDrawer.js +8 -10
  127. package/lib/core/editor/components/Sidebar/views/CanvasPanel/hooks/useCanvasThemeConfig.js +37 -41
  128. package/lib/core/editor/components/Toolbar/widgets/BoxBackgroundButton/BoxBackgroundSetting.js +50 -54
  129. package/lib/core/editor/components/Toolbar/widgets/FontColorButton.js +50 -54
  130. package/lib/core/editor/components/settings/propertyViews/layer/DataTab/DefaultLayerAddResourceDrawer.js +12 -14
  131. package/lib/core/editor/components/settings/propertyViews/node/data/BindResourceDrawer.js +26 -28
  132. package/lib/core/editor/components/settings/propertyViews/node/data/Data.js +15 -17
  133. package/lib/core/editor/components/settings/propertyViews/view/BackgroundSize.js +12 -14
  134. package/lib/core/editor/components/titlebar/TopoEditorTitleBar.js +25 -31
  135. package/lib/core/editor/hooks/useKeyboardShortcut.js +37 -34
  136. package/lib/core/editor/hooks/useNewElementTheme.js +2 -2
  137. package/lib/core/editor/store/background.js +8 -10
  138. package/lib/core/editor/store/topoEdit.js +4 -6
  139. package/lib/core/editor/utils/copyElementUtil.js +182 -0
  140. package/lib/core/editor/utils/edgeTypeStyleUtil.js +2 -4
  141. package/lib/core/hooks/usePolling.js +116 -120
  142. package/lib/core/hooks/useResourceConfig.js +58 -66
  143. package/lib/core/hooks/useTopoEdit.js +465 -495
  144. package/lib/core/models/Alarm.js +275 -292
  145. package/lib/core/models/AttributeMetricDisplay.js +104 -110
  146. package/lib/core/models/PluginManager.js +4 -3
  147. package/lib/core/models/SelectionModel.js +4 -5
  148. package/lib/core/models/TopoApp.js +205 -240
  149. package/lib/core/models/TopoGraphView.js +18 -21
  150. package/lib/core/models/cache/CiCache.js +33 -32
  151. package/lib/core/models/cache/CiTypeCache.js +38 -42
  152. package/lib/core/models/cache/DictCache.js +33 -35
  153. package/lib/core/models/graph/Background.js +16 -18
  154. package/lib/core/models/plugins/resourceWebControllUrl.js +74 -80
  155. package/lib/core/models/tagstips/ElementTagTipConfig.js +34 -38
  156. package/lib/core/models/topoData.js +69 -71
  157. package/lib/core/models/utils/linkUtils.js +41 -43
  158. package/lib/core/models/utils/nodeNameVisibleUtil.js +4 -4
  159. package/lib/core/services/alarm.js +18 -20
  160. package/lib/core/services/background.js +70 -78
  161. package/lib/core/services/cmdb/metric.js +10 -12
  162. package/lib/core/services/cmdb.js +22 -22
  163. package/lib/core/services/index.js +45 -51
  164. package/lib/core/services/overview.js +131 -151
  165. package/lib/core/services/topo/basic.js +37 -41
  166. package/lib/core/services/topo/tagtip.js +12 -14
  167. package/lib/core/store/models/ciModel.js +66 -70
  168. package/lib/core/store/models/customIcon.js +120 -134
  169. package/lib/core/store/models/displayConfig.js +15 -19
  170. package/lib/core/store/models/selection.js +4 -6
  171. package/lib/core/store/models/topoAlarm.js +163 -145
  172. package/lib/core/store/models/topoBaseInfoOverview.js +4 -6
  173. package/lib/core/store/models/topoBizMod.js +9 -11
  174. package/lib/core/store/models/topoConfig.js +222 -238
  175. package/lib/core/store/models/topoGraphView.js +4 -6
  176. package/lib/core/store/models/topoMod.js +375 -397
  177. package/lib/core/utils/imageUtil.js +22 -24
  178. package/lib/core/utils/metricUtil.js +5 -0
  179. package/lib/core/utils/saveSerialize.js +9 -11
  180. package/lib/core/viewer/components/plugins/ResourceDetail/components/ClusterMemberTable.js +56 -58
  181. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/EventsCard.js +15 -17
  182. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/ResourceOverview.js +344 -358
  183. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/Configurator/index.js +86 -92
  184. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/LinkTopoCard.js +39 -41
  185. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/services/index.js +190 -206
  186. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/hooks/useAlarmAndRiskData.js +107 -109
  187. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/hooks/useMetricModels.js +57 -59
  188. package/lib/core/viewer/components/plugins/ResourceDetail/components/WebConsole/WebConsoleForm/hooks/useWebConsole.js +29 -33
  189. package/lib/core/viewer/components/plugins/ResourceDetail/getCiDisplayMetricModels.js +25 -29
  190. package/lib/core/viewer/components/plugins/ResourceDetail/hooks/useUserId.js +32 -36
  191. package/lib/core/viewer/components/plugins/ResourceWebControllUrlSettingDialog.js +18 -20
  192. package/lib/networkTopo/components/Link/hook.js +73 -77
  193. package/lib/networkTopo/components/Link/index.js +87 -95
  194. package/lib/networkTopo/components/Link/setting.js +42 -44
  195. package/lib/networkTopo/getTopoData.js +63 -69
  196. package/lib/networkTopo/hooks/viewer/useRelateTopo.js +31 -33
  197. package/lib/networkTopo/models/LinkDynamicStyleExecutor.js +2 -2
  198. package/lib/networkTopo/models/TopoCenter.js +18 -22
  199. package/lib/networkTopo/services/alert.js +18 -22
  200. package/lib/networkTopo/services/authorization.js +55 -65
  201. package/lib/networkTopo/services/cmdb.js +422 -470
  202. package/lib/networkTopo/services/funcAuth.js +24 -26
  203. package/lib/networkTopo/services/link.js +108 -118
  204. package/lib/networkTopo/services/mdc.js +21 -27
  205. package/lib/networkTopo/services/metric.js +27 -31
  206. package/lib/networkTopo/services/model.js +445 -509
  207. package/lib/networkTopo/services/risk.js +11 -13
  208. package/lib/networkTopo/services/topo/auth.js +27 -33
  209. package/lib/networkTopo/services/topo/basic.js +252 -290
  210. package/lib/networkTopo/services/topo/blacklist.js +20 -24
  211. package/lib/networkTopo/services/topo/ciInfo.js +34 -38
  212. package/lib/networkTopo/services/topo/icon.js +59 -69
  213. package/lib/networkTopo/services/topo/networkLink.js +32 -36
  214. package/lib/networkTopo/services/topo/relation.js +11 -13
  215. package/lib/networkTopo/services/topo/resourceWebUrl.js +44 -50
  216. package/lib/networkTopo/store/functionAuth.js +31 -37
  217. package/lib/networkTopo/store/topoCenter.js +142 -152
  218. package/lib/networkTopo/store/topoLinkMod.js +4 -6
  219. package/lib/networkTopo/store/topoTreeMod.js +166 -178
  220. package/lib/networkTopo/utils/exportData.js +59 -61
  221. package/lib/utils/htElementDataUtil.js +4 -2
  222. package/package.json +5 -3
@@ -24,19 +24,20 @@ import ElementTagTipConfig from "./tagstips/ElementTagTipConfig";
24
24
  import SelectionModel from "./SelectionModel";
25
25
  import CiCache from "./cache/CiCache"; // eslint-disable-next-line no-undef
26
26
 
27
- var version = typeof "11.0.34" === 'string' ? "11.0.34" : null;
27
+ var version = typeof "12.0.0-dev.1" === 'string' ? "12.0.0-dev.1" : null;
28
28
  console.info("\u62D3\u6251\u7248\u672C: " + version);
29
29
  /**
30
30
  * 拓扑显示和编辑
31
31
  */
32
32
 
33
33
  var Topo = /*#__PURE__*/function () {
34
- /**
35
- * @type TopoGraphView
36
- */
37
34
  function Topo(options) {
38
35
  this.options = void 0;
39
36
  this.id = void 0;
37
+
38
+ /**
39
+ * @type TopoGraphView
40
+ */
40
41
  this.view = void 0;
41
42
  this.alarm = new Alarm();
42
43
  this.store = void 0;
@@ -98,20 +99,18 @@ var Topo = /*#__PURE__*/function () {
98
99
  var _exit = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
99
100
  var topoDispatchers;
100
101
  return _regeneratorRuntime.wrap(function _callee$(_context) {
101
- while (1) {
102
- switch (_context.prev = _context.next) {
103
- case 0:
104
- topoDispatchers = this.store.getModelDispatchers('topoMod');
105
- _context.next = 3;
106
- return topoDispatchers.exit();
107
-
108
- case 3:
109
- this.destroy();
110
-
111
- case 4:
112
- case "end":
113
- return _context.stop();
114
- }
102
+ while (1) switch (_context.prev = _context.next) {
103
+ case 0:
104
+ topoDispatchers = this.store.getModelDispatchers('topoMod');
105
+ _context.next = 3;
106
+ return topoDispatchers.exit();
107
+
108
+ case 3:
109
+ this.destroy();
110
+
111
+ case 4:
112
+ case "end":
113
+ return _context.stop();
115
114
  }
116
115
  }, _callee, this);
117
116
  }));
@@ -128,29 +127,27 @@ var Topo = /*#__PURE__*/function () {
128
127
  var _data$groups, groups, _data$nodes, nodes, links, lines, topoDispatchers;
129
128
 
130
129
  return _regeneratorRuntime.wrap(function _callee2$(_context2) {
131
- while (1) {
132
- switch (_context2.prev = _context2.next) {
133
- case 0:
134
- if (options === void 0) {
135
- options = {};
136
- }
137
-
138
- _data$groups = data.groups, groups = _data$groups === void 0 ? [] : _data$groups, _data$nodes = data.nodes, nodes = _data$nodes === void 0 ? [] : _data$nodes, links = data.links, lines = data.lines;
139
- topoDispatchers = this.store.getModelDispatchers('topoMod');
140
- _context2.next = 5;
141
- return topoDispatchers.openTopoPage(_extends({
142
- data: _extends({}, data, {
143
- groups: groups,
144
- nodes: nodes,
145
- links: links || lines || [],
146
- linkGroups: data.linkGroups || data.lineGroups || []
147
- })
148
- }, options));
149
-
150
- case 5:
151
- case "end":
152
- return _context2.stop();
153
- }
130
+ while (1) switch (_context2.prev = _context2.next) {
131
+ case 0:
132
+ if (options === void 0) {
133
+ options = {};
134
+ }
135
+
136
+ _data$groups = data.groups, groups = _data$groups === void 0 ? [] : _data$groups, _data$nodes = data.nodes, nodes = _data$nodes === void 0 ? [] : _data$nodes, links = data.links, lines = data.lines;
137
+ topoDispatchers = this.store.getModelDispatchers('topoMod');
138
+ _context2.next = 5;
139
+ return topoDispatchers.openTopoPage(_extends({
140
+ data: _extends({}, data, {
141
+ groups: groups,
142
+ nodes: nodes,
143
+ links: links || lines || [],
144
+ linkGroups: data.linkGroups || data.lineGroups || []
145
+ })
146
+ }, options));
147
+
148
+ case 5:
149
+ case "end":
150
+ return _context2.stop();
154
151
  }
155
152
  }, _callee2, this);
156
153
  }));
@@ -165,12 +162,10 @@ var Topo = /*#__PURE__*/function () {
165
162
  _proto.clear = /*#__PURE__*/function () {
166
163
  var _clear = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3() {
167
164
  return _regeneratorRuntime.wrap(function _callee3$(_context3) {
168
- while (1) {
169
- switch (_context3.prev = _context3.next) {
170
- case 0:
171
- case "end":
172
- return _context3.stop();
173
- }
165
+ while (1) switch (_context3.prev = _context3.next) {
166
+ case 0:
167
+ case "end":
168
+ return _context3.stop();
174
169
  }
175
170
  }, _callee3);
176
171
  }));
@@ -240,30 +235,28 @@ var Topo = /*#__PURE__*/function () {
240
235
  var _data$groups2, groups, _data$nodes2, nodes, links, lines;
241
236
 
242
237
  return _regeneratorRuntime.wrap(function _callee4$(_context4) {
243
- while (1) {
244
- switch (_context4.prev = _context4.next) {
245
- case 0:
246
- _data$groups2 = data.groups, groups = _data$groups2 === void 0 ? [] : _data$groups2, _data$nodes2 = data.nodes, nodes = _data$nodes2 === void 0 ? [] : _data$nodes2, links = data.links, lines = data.lines;
247
- this.view.topoClient.updateElements(cloneDeep({
248
- groups: formatGroups(groups),
249
- nodes: nodes.map(function (node) {
250
- return _extends({}, node, {
251
- type: 'node',
252
- dtype: 'device'
253
- });
254
- }),
255
- links: (links || lines || []).map(function (link) {
256
- return _extends({}, link, {
257
- type: 'link',
258
- dtype: 'link'
259
- });
260
- })
261
- })); // TODO 更新store,触发属性、指标模型加载,更新指标
262
-
263
- case 2:
264
- case "end":
265
- return _context4.stop();
266
- }
238
+ while (1) switch (_context4.prev = _context4.next) {
239
+ case 0:
240
+ _data$groups2 = data.groups, groups = _data$groups2 === void 0 ? [] : _data$groups2, _data$nodes2 = data.nodes, nodes = _data$nodes2 === void 0 ? [] : _data$nodes2, links = data.links, lines = data.lines;
241
+ this.view.topoClient.updateElements(cloneDeep({
242
+ groups: formatGroups(groups),
243
+ nodes: nodes.map(function (node) {
244
+ return _extends({}, node, {
245
+ type: 'node',
246
+ dtype: 'device'
247
+ });
248
+ }),
249
+ links: (links || lines || []).map(function (link) {
250
+ return _extends({}, link, {
251
+ type: 'link',
252
+ dtype: 'link'
253
+ });
254
+ })
255
+ })); // TODO 更新store,触发属性、指标模型加载,更新指标
256
+
257
+ case 2:
258
+ case "end":
259
+ return _context4.stop();
267
260
  }
268
261
  }, _callee4, this);
269
262
  }));
@@ -287,20 +280,18 @@ var Topo = /*#__PURE__*/function () {
287
280
  var _addElements = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee5(elements) {
288
281
  var data;
289
282
  return _regeneratorRuntime.wrap(function _callee5$(_context5) {
290
- while (1) {
291
- switch (_context5.prev = _context5.next) {
292
- case 0:
293
- data = {
294
- groups: [].concat(this.getGroups(), elements.groups || []),
295
- nodes: [].concat(this.getNodes(), elements.nodes || []),
296
- lines: [].concat(this.getLines(), elements.lines || [])
297
- };
298
- this.updateElements(data); // TODO 更新store,触发属性、指标模型加载,更新指标
299
-
300
- case 2:
301
- case "end":
302
- return _context5.stop();
303
- }
283
+ while (1) switch (_context5.prev = _context5.next) {
284
+ case 0:
285
+ data = {
286
+ groups: [].concat(this.getGroups(), elements.groups || []),
287
+ nodes: [].concat(this.getNodes(), elements.nodes || []),
288
+ lines: [].concat(this.getLines(), elements.lines || [])
289
+ };
290
+ this.updateElements(data); // TODO 更新store,触发属性、指标模型加载,更新指标
291
+
292
+ case 2:
293
+ case "end":
294
+ return _context5.stop();
304
295
  }
305
296
  }, _callee5, this);
306
297
  }));
@@ -323,15 +314,13 @@ var Topo = /*#__PURE__*/function () {
323
314
  function () {
324
315
  var _updateData = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee6(data) {
325
316
  return _regeneratorRuntime.wrap(function _callee6$(_context6) {
326
- while (1) {
327
- switch (_context6.prev = _context6.next) {
328
- case 0:
329
- this.updateElements(data);
330
-
331
- case 1:
332
- case "end":
333
- return _context6.stop();
334
- }
317
+ while (1) switch (_context6.prev = _context6.next) {
318
+ case 0:
319
+ this.updateElements(data);
320
+
321
+ case 1:
322
+ case "end":
323
+ return _context6.stop();
335
324
  }
336
325
  }, _callee6, this);
337
326
  }));
@@ -362,23 +351,21 @@ var Topo = /*#__PURE__*/function () {
362
351
  var _open = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee7(id, mode) {
363
352
  var lastId;
364
353
  return _regeneratorRuntime.wrap(function _callee7$(_context7) {
365
- while (1) {
366
- switch (_context7.prev = _context7.next) {
367
- case 0:
368
- rlog.info('TopoApp.open 打开拓扑图', id); // 如果是切换拓扑图,注销原拓扑图
354
+ while (1) switch (_context7.prev = _context7.next) {
355
+ case 0:
356
+ rlog.info('TopoApp.open 打开拓扑图', id); // 如果是切换拓扑图,注销原拓扑图
369
357
 
370
- lastId = this.id;
371
- this.id = id;
358
+ lastId = this.id;
359
+ this.id = id;
372
360
 
373
- if (lastId && id !== lastId) {
374
- this.alarm.close();
375
- } // 加载新拓扑图
361
+ if (lastId && id !== lastId) {
362
+ this.alarm.close();
363
+ } // 加载新拓扑图
376
364
 
377
365
 
378
- case 4:
379
- case "end":
380
- return _context7.stop();
381
- }
366
+ case 4:
367
+ case "end":
368
+ return _context7.stop();
382
369
  }
383
370
  }, _callee7, this);
384
371
  }));
@@ -393,26 +380,24 @@ var Topo = /*#__PURE__*/function () {
393
380
  _proto.close = /*#__PURE__*/function () {
394
381
  var _close = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee8() {
395
382
  return _regeneratorRuntime.wrap(function _callee8$(_context8) {
396
- while (1) {
397
- switch (_context8.prev = _context8.next) {
398
- case 0:
399
- rlog.info('关闭拓扑图', this.id);
383
+ while (1) switch (_context8.prev = _context8.next) {
384
+ case 0:
385
+ rlog.info('关闭拓扑图', this.id);
400
386
 
401
- if (this.id) {
402
- _context8.next = 3;
403
- break;
404
- }
387
+ if (this.id) {
388
+ _context8.next = 3;
389
+ break;
390
+ }
405
391
 
406
- return _context8.abrupt("return");
392
+ return _context8.abrupt("return");
407
393
 
408
- case 3:
409
- this.alarm.close();
410
- this.id = null;
394
+ case 3:
395
+ this.alarm.close();
396
+ this.id = null;
411
397
 
412
- case 5:
413
- case "end":
414
- return _context8.stop();
415
- }
398
+ case 5:
399
+ case "end":
400
+ return _context8.stop();
416
401
  }
417
402
  }, _callee8, this);
418
403
  }));
@@ -427,12 +412,10 @@ var Topo = /*#__PURE__*/function () {
427
412
  _proto.refresh = /*#__PURE__*/function () {
428
413
  var _refresh = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee9() {
429
414
  return _regeneratorRuntime.wrap(function _callee9$(_context9) {
430
- while (1) {
431
- switch (_context9.prev = _context9.next) {
432
- case 0:
433
- case "end":
434
- return _context9.stop();
435
- }
415
+ while (1) switch (_context9.prev = _context9.next) {
416
+ case 0:
417
+ case "end":
418
+ return _context9.stop();
436
419
  }
437
420
  }, _callee9);
438
421
  }));
@@ -472,12 +455,10 @@ var Topo = /*#__PURE__*/function () {
472
455
  _proto.openViewMode = /*#__PURE__*/function () {
473
456
  var _openViewMode = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee10(id) {
474
457
  return _regeneratorRuntime.wrap(function _callee10$(_context10) {
475
- while (1) {
476
- switch (_context10.prev = _context10.next) {
477
- case 0:
478
- case "end":
479
- return _context10.stop();
480
- }
458
+ while (1) switch (_context10.prev = _context10.next) {
459
+ case 0:
460
+ case "end":
461
+ return _context10.stop();
481
462
  }
482
463
  }, _callee10);
483
464
  }));
@@ -504,15 +485,13 @@ var Topo = /*#__PURE__*/function () {
504
485
  _proto.onTopoDataLoaded = /*#__PURE__*/function () {
505
486
  var _onTopoDataLoaded = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee11(topoData) {
506
487
  return _regeneratorRuntime.wrap(function _callee11$(_context11) {
507
- while (1) {
508
- switch (_context11.prev = _context11.next) {
509
- case 0:
510
- this.pluginManager.onTopoDataLoaded(topoData);
511
-
512
- case 1:
513
- case "end":
514
- return _context11.stop();
515
- }
488
+ while (1) switch (_context11.prev = _context11.next) {
489
+ case 0:
490
+ this.pluginManager.onTopoDataLoaded(topoData);
491
+
492
+ case 1:
493
+ case "end":
494
+ return _context11.stop();
516
495
  }
517
496
  }, _callee11, this);
518
497
  }));
@@ -534,55 +513,53 @@ var Topo = /*#__PURE__*/function () {
534
513
  var _enterEditMode = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee12() {
535
514
  var topoDispatchers, iconManageDispatchers;
536
515
  return _regeneratorRuntime.wrap(function _callee12$(_context12) {
537
- while (1) {
538
- switch (_context12.prev = _context12.next) {
539
- case 0:
540
- rlog.info('TopoApp.enterEditMode');
541
-
542
- if (!this.options.onSwitchToEditModeBegin) {
543
- _context12.next = 4;
544
- break;
545
- }
516
+ while (1) switch (_context12.prev = _context12.next) {
517
+ case 0:
518
+ rlog.info('TopoApp.enterEditMode');
546
519
 
520
+ if (!this.options.onSwitchToEditModeBegin) {
547
521
  _context12.next = 4;
548
- return this.options.onSwitchToEditModeBegin(this);
522
+ break;
523
+ }
549
524
 
550
- case 4:
551
- topoDispatchers = this.store.getModelDispatchers('topoMod');
552
- _context12.next = 7;
553
- return topoDispatchers.update({
554
- viewState: 'edit'
555
- });
525
+ _context12.next = 4;
526
+ return this.options.onSwitchToEditModeBegin(this);
556
527
 
557
- case 7:
558
- _context12.next = 9;
559
- return this.view.switchToEditMode();
528
+ case 4:
529
+ topoDispatchers = this.store.getModelDispatchers('topoMod');
530
+ _context12.next = 7;
531
+ return topoDispatchers.update({
532
+ viewState: 'edit'
533
+ });
560
534
 
561
- case 9:
562
- updateEdgeExpanded(this);
535
+ case 7:
536
+ _context12.next = 9;
537
+ return this.view.switchToEditMode();
563
538
 
564
- if (!this.options.onSwitchToEditMode) {
565
- _context12.next = 13;
566
- break;
567
- }
539
+ case 9:
540
+ updateEdgeExpanded(this);
568
541
 
542
+ if (!this.options.onSwitchToEditMode) {
569
543
  _context12.next = 13;
570
- return this.options.onSwitchToEditMode(this);
544
+ break;
545
+ }
546
+
547
+ _context12.next = 13;
548
+ return this.options.onSwitchToEditMode(this);
571
549
 
572
- case 13:
573
- if (this.getDataModel()) {
574
- // 更新节点名称显示隐藏
575
- this.attributeMetricDisplay.updateNodesNameVisible();
576
- } // 加载自定义上传的图标
550
+ case 13:
551
+ if (this.getDataModel()) {
552
+ // 更新节点名称显示隐藏
553
+ this.attributeMetricDisplay.updateNodesNameVisible();
554
+ } // 加载自定义上传的图标
577
555
 
578
556
 
579
- iconManageDispatchers = this.store.getModelDispatchers('customIcon');
580
- iconManageDispatchers.loadEditorIcons();
557
+ iconManageDispatchers = this.store.getModelDispatchers('customIcon');
558
+ iconManageDispatchers.loadEditorIcons();
581
559
 
582
- case 16:
583
- case "end":
584
- return _context12.stop();
585
- }
560
+ case 16:
561
+ case "end":
562
+ return _context12.stop();
586
563
  }
587
564
  }, _callee12, this);
588
565
  }));
@@ -598,28 +575,26 @@ var Topo = /*#__PURE__*/function () {
598
575
  var _exitEditMode = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee13() {
599
576
  var editDispatchers;
600
577
  return _regeneratorRuntime.wrap(function _callee13$(_context13) {
601
- while (1) {
602
- switch (_context13.prev = _context13.next) {
603
- case 0:
604
- _context13.next = 2;
605
- return this.view.switchToViewMode();
606
-
607
- case 2:
608
- editDispatchers = this.store.getModelDispatchers('topoConfig');
609
- editDispatchers.switchToViewMode(this.id);
578
+ while (1) switch (_context13.prev = _context13.next) {
579
+ case 0:
580
+ _context13.next = 2;
581
+ return this.view.switchToViewMode();
610
582
 
611
- if (!this.options.onSwitchToViewMode) {
612
- _context13.next = 7;
613
- break;
614
- }
583
+ case 2:
584
+ editDispatchers = this.store.getModelDispatchers('topoConfig');
585
+ editDispatchers.switchToViewMode(this.id);
615
586
 
587
+ if (!this.options.onSwitchToViewMode) {
616
588
  _context13.next = 7;
617
- return this.options.onSwitchToViewMode(this);
589
+ break;
590
+ }
618
591
 
619
- case 7:
620
- case "end":
621
- return _context13.stop();
622
- }
592
+ _context13.next = 7;
593
+ return this.options.onSwitchToViewMode(this);
594
+
595
+ case 7:
596
+ case "end":
597
+ return _context13.stop();
623
598
  }
624
599
  }, _callee13, this);
625
600
  }));
@@ -640,15 +615,13 @@ var Topo = /*#__PURE__*/function () {
640
615
  function () {
641
616
  var _triggerSaveEvent = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee14() {
642
617
  return _regeneratorRuntime.wrap(function _callee14$(_context14) {
643
- while (1) {
644
- switch (_context14.prev = _context14.next) {
645
- case 0:
646
- this.view.topoClient.saveExternal();
647
-
648
- case 1:
649
- case "end":
650
- return _context14.stop();
651
- }
618
+ while (1) switch (_context14.prev = _context14.next) {
619
+ case 0:
620
+ this.view.topoClient.saveExternal();
621
+
622
+ case 1:
623
+ case "end":
624
+ return _context14.stop();
652
625
  }
653
626
  }, _callee14, this);
654
627
  }));
@@ -669,15 +642,13 @@ var Topo = /*#__PURE__*/function () {
669
642
  function () {
670
643
  var _save = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee15() {
671
644
  return _regeneratorRuntime.wrap(function _callee15$(_context15) {
672
- while (1) {
673
- switch (_context15.prev = _context15.next) {
674
- case 0:
675
- this.triggerSaveEvent();
676
-
677
- case 1:
678
- case "end":
679
- return _context15.stop();
680
- }
645
+ while (1) switch (_context15.prev = _context15.next) {
646
+ case 0:
647
+ this.triggerSaveEvent();
648
+
649
+ case 1:
650
+ case "end":
651
+ return _context15.stop();
681
652
  }
682
653
  }, _callee15, this);
683
654
  }));
@@ -701,20 +672,18 @@ var Topo = /*#__PURE__*/function () {
701
672
  var _exportImage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee16(name) {
702
673
  var fileName;
703
674
  return _regeneratorRuntime.wrap(function _callee16$(_context16) {
704
- while (1) {
705
- switch (_context16.prev = _context16.next) {
706
- case 0:
707
- fileName = name;
675
+ while (1) switch (_context16.prev = _context16.next) {
676
+ case 0:
677
+ fileName = name;
708
678
 
709
- if (!name) {// TODO 获取拓扑名称,避免改名重绘拓扑图
710
- }
679
+ if (!name) {// TODO 获取拓扑名称,避免改名重绘拓扑图
680
+ }
711
681
 
712
- this.view.topoClient.exportImage(fileName);
682
+ this.view.topoClient.exportImage(fileName);
713
683
 
714
- case 3:
715
- case "end":
716
- return _context16.stop();
717
- }
684
+ case 3:
685
+ case "end":
686
+ return _context16.stop();
718
687
  }
719
688
  }, _callee16, this);
720
689
  }));
@@ -735,12 +704,10 @@ var Topo = /*#__PURE__*/function () {
735
704
  _proto.switchToViewMode = /*#__PURE__*/function () {
736
705
  var _switchToViewMode = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee17() {
737
706
  return _regeneratorRuntime.wrap(function _callee17$(_context17) {
738
- while (1) {
739
- switch (_context17.prev = _context17.next) {
740
- case 0:
741
- case "end":
742
- return _context17.stop();
743
- }
707
+ while (1) switch (_context17.prev = _context17.next) {
708
+ case 0:
709
+ case "end":
710
+ return _context17.stop();
744
711
  }
745
712
  }, _callee17);
746
713
  }));
@@ -755,12 +722,10 @@ var Topo = /*#__PURE__*/function () {
755
722
  _proto.switchToEditMode = /*#__PURE__*/function () {
756
723
  var _switchToEditMode = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee18() {
757
724
  return _regeneratorRuntime.wrap(function _callee18$(_context18) {
758
- while (1) {
759
- switch (_context18.prev = _context18.next) {
760
- case 0:
761
- case "end":
762
- return _context18.stop();
763
- }
725
+ while (1) switch (_context18.prev = _context18.next) {
726
+ case 0:
727
+ case "end":
728
+ return _context18.stop();
764
729
  }
765
730
  }, _callee18);
766
731
  }));
@@ -9,11 +9,12 @@ import Background from "./graph/Background";
9
9
  */
10
10
 
11
11
  var TopoGraphView = /*#__PURE__*/function () {
12
- /**
13
- * @type TopoClient
14
- */
15
12
  function TopoGraphView() {
16
13
  this.store = void 0;
14
+
15
+ /**
16
+ * @type TopoClient
17
+ */
17
18
  this.topoClient = void 0;
18
19
  this.background = void 0;
19
20
  this.init();
@@ -52,15 +53,13 @@ var TopoGraphView = /*#__PURE__*/function () {
52
53
  _proto.switchToViewMode = /*#__PURE__*/function () {
53
54
  var _switchToViewMode = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
54
55
  return _regeneratorRuntime.wrap(function _callee$(_context) {
55
- while (1) {
56
- switch (_context.prev = _context.next) {
57
- case 0:
58
- this.topoClient.exitEditMode();
59
-
60
- case 1:
61
- case "end":
62
- return _context.stop();
63
- }
56
+ while (1) switch (_context.prev = _context.next) {
57
+ case 0:
58
+ this.topoClient.exitEditMode();
59
+
60
+ case 1:
61
+ case "end":
62
+ return _context.stop();
64
63
  }
65
64
  }, _callee, this);
66
65
  }));
@@ -75,15 +74,13 @@ var TopoGraphView = /*#__PURE__*/function () {
75
74
  _proto.switchToEditMode = /*#__PURE__*/function () {
76
75
  var _switchToEditMode = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
77
76
  return _regeneratorRuntime.wrap(function _callee2$(_context2) {
78
- while (1) {
79
- switch (_context2.prev = _context2.next) {
80
- case 0:
81
- this.topoClient.enterEditMode();
82
-
83
- case 1:
84
- case "end":
85
- return _context2.stop();
86
- }
77
+ while (1) switch (_context2.prev = _context2.next) {
78
+ case 0:
79
+ this.topoClient.enterEditMode();
80
+
81
+ case 1:
82
+ case "end":
83
+ return _context2.stop();
87
84
  }
88
85
  }, _callee2, this);
89
86
  }));