@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
@@ -56,19 +56,20 @@ var _SelectionModel = _interopRequireDefault(require("./SelectionModel"));
56
56
  var _CiCache = _interopRequireDefault(require("./cache/CiCache"));
57
57
 
58
58
  // eslint-disable-next-line no-undef
59
- var version = typeof "11.0.34" === 'string' ? "11.0.34" : null;
59
+ var version = typeof "12.0.0-dev.1" === 'string' ? "12.0.0-dev.1" : null;
60
60
  console.info("\u62D3\u6251\u7248\u672C: " + version);
61
61
  /**
62
62
  * 拓扑显示和编辑
63
63
  */
64
64
 
65
65
  var Topo = /*#__PURE__*/function () {
66
- /**
67
- * @type TopoGraphView
68
- */
69
66
  function Topo(options) {
70
67
  this.options = void 0;
71
68
  this.id = void 0;
69
+
70
+ /**
71
+ * @type TopoGraphView
72
+ */
72
73
  this.view = void 0;
73
74
  this.alarm = new _Alarm["default"]();
74
75
  this.store = void 0;
@@ -130,20 +131,18 @@ var Topo = /*#__PURE__*/function () {
130
131
  var _exit = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee() {
131
132
  var topoDispatchers;
132
133
  return _regenerator["default"].wrap(function _callee$(_context) {
133
- while (1) {
134
- switch (_context.prev = _context.next) {
135
- case 0:
136
- topoDispatchers = this.store.getModelDispatchers('topoMod');
137
- _context.next = 3;
138
- return topoDispatchers.exit();
139
-
140
- case 3:
141
- this.destroy();
142
-
143
- case 4:
144
- case "end":
145
- return _context.stop();
146
- }
134
+ while (1) switch (_context.prev = _context.next) {
135
+ case 0:
136
+ topoDispatchers = this.store.getModelDispatchers('topoMod');
137
+ _context.next = 3;
138
+ return topoDispatchers.exit();
139
+
140
+ case 3:
141
+ this.destroy();
142
+
143
+ case 4:
144
+ case "end":
145
+ return _context.stop();
147
146
  }
148
147
  }, _callee, this);
149
148
  }));
@@ -160,29 +159,27 @@ var Topo = /*#__PURE__*/function () {
160
159
  var _data$groups, groups, _data$nodes, nodes, links, lines, topoDispatchers;
161
160
 
162
161
  return _regenerator["default"].wrap(function _callee2$(_context2) {
163
- while (1) {
164
- switch (_context2.prev = _context2.next) {
165
- case 0:
166
- if (options === void 0) {
167
- options = {};
168
- }
169
-
170
- _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;
171
- topoDispatchers = this.store.getModelDispatchers('topoMod');
172
- _context2.next = 5;
173
- return topoDispatchers.openTopoPage((0, _extends2["default"])({
174
- data: (0, _extends2["default"])({}, data, {
175
- groups: groups,
176
- nodes: nodes,
177
- links: links || lines || [],
178
- linkGroups: data.linkGroups || data.lineGroups || []
179
- })
180
- }, options));
181
-
182
- case 5:
183
- case "end":
184
- return _context2.stop();
185
- }
162
+ while (1) switch (_context2.prev = _context2.next) {
163
+ case 0:
164
+ if (options === void 0) {
165
+ options = {};
166
+ }
167
+
168
+ _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;
169
+ topoDispatchers = this.store.getModelDispatchers('topoMod');
170
+ _context2.next = 5;
171
+ return topoDispatchers.openTopoPage((0, _extends2["default"])({
172
+ data: (0, _extends2["default"])({}, data, {
173
+ groups: groups,
174
+ nodes: nodes,
175
+ links: links || lines || [],
176
+ linkGroups: data.linkGroups || data.lineGroups || []
177
+ })
178
+ }, options));
179
+
180
+ case 5:
181
+ case "end":
182
+ return _context2.stop();
186
183
  }
187
184
  }, _callee2, this);
188
185
  }));
@@ -197,12 +194,10 @@ var Topo = /*#__PURE__*/function () {
197
194
  _proto.clear = /*#__PURE__*/function () {
198
195
  var _clear = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee3() {
199
196
  return _regenerator["default"].wrap(function _callee3$(_context3) {
200
- while (1) {
201
- switch (_context3.prev = _context3.next) {
202
- case 0:
203
- case "end":
204
- return _context3.stop();
205
- }
197
+ while (1) switch (_context3.prev = _context3.next) {
198
+ case 0:
199
+ case "end":
200
+ return _context3.stop();
206
201
  }
207
202
  }, _callee3);
208
203
  }));
@@ -271,30 +266,28 @@ var Topo = /*#__PURE__*/function () {
271
266
  var _data$groups2, groups, _data$nodes2, nodes, links, lines;
272
267
 
273
268
  return _regenerator["default"].wrap(function _callee4$(_context4) {
274
- while (1) {
275
- switch (_context4.prev = _context4.next) {
276
- case 0:
277
- _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;
278
- this.view.topoClient.updateElements((0, _lodash.cloneDeep)({
279
- groups: (0, _topoData.formatGroups)(groups),
280
- nodes: nodes.map(function (node) {
281
- return (0, _extends2["default"])({}, node, {
282
- type: 'node',
283
- dtype: 'device'
284
- });
285
- }),
286
- links: (links || lines || []).map(function (link) {
287
- return (0, _extends2["default"])({}, link, {
288
- type: 'link',
289
- dtype: 'link'
290
- });
291
- })
292
- })); // TODO 更新store,触发属性、指标模型加载,更新指标
293
-
294
- case 2:
295
- case "end":
296
- return _context4.stop();
297
- }
269
+ while (1) switch (_context4.prev = _context4.next) {
270
+ case 0:
271
+ _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;
272
+ this.view.topoClient.updateElements((0, _lodash.cloneDeep)({
273
+ groups: (0, _topoData.formatGroups)(groups),
274
+ nodes: nodes.map(function (node) {
275
+ return (0, _extends2["default"])({}, node, {
276
+ type: 'node',
277
+ dtype: 'device'
278
+ });
279
+ }),
280
+ links: (links || lines || []).map(function (link) {
281
+ return (0, _extends2["default"])({}, link, {
282
+ type: 'link',
283
+ dtype: 'link'
284
+ });
285
+ })
286
+ })); // TODO 更新store,触发属性、指标模型加载,更新指标
287
+
288
+ case 2:
289
+ case "end":
290
+ return _context4.stop();
298
291
  }
299
292
  }, _callee4, this);
300
293
  }));
@@ -318,20 +311,18 @@ var Topo = /*#__PURE__*/function () {
318
311
  var _addElements = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee5(elements) {
319
312
  var data;
320
313
  return _regenerator["default"].wrap(function _callee5$(_context5) {
321
- while (1) {
322
- switch (_context5.prev = _context5.next) {
323
- case 0:
324
- data = {
325
- groups: [].concat(this.getGroups(), elements.groups || []),
326
- nodes: [].concat(this.getNodes(), elements.nodes || []),
327
- lines: [].concat(this.getLines(), elements.lines || [])
328
- };
329
- this.updateElements(data); // TODO 更新store,触发属性、指标模型加载,更新指标
330
-
331
- case 2:
332
- case "end":
333
- return _context5.stop();
334
- }
314
+ while (1) switch (_context5.prev = _context5.next) {
315
+ case 0:
316
+ data = {
317
+ groups: [].concat(this.getGroups(), elements.groups || []),
318
+ nodes: [].concat(this.getNodes(), elements.nodes || []),
319
+ lines: [].concat(this.getLines(), elements.lines || [])
320
+ };
321
+ this.updateElements(data); // TODO 更新store,触发属性、指标模型加载,更新指标
322
+
323
+ case 2:
324
+ case "end":
325
+ return _context5.stop();
335
326
  }
336
327
  }, _callee5, this);
337
328
  }));
@@ -354,15 +345,13 @@ var Topo = /*#__PURE__*/function () {
354
345
  function () {
355
346
  var _updateData = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee6(data) {
356
347
  return _regenerator["default"].wrap(function _callee6$(_context6) {
357
- while (1) {
358
- switch (_context6.prev = _context6.next) {
359
- case 0:
360
- this.updateElements(data);
361
-
362
- case 1:
363
- case "end":
364
- return _context6.stop();
365
- }
348
+ while (1) switch (_context6.prev = _context6.next) {
349
+ case 0:
350
+ this.updateElements(data);
351
+
352
+ case 1:
353
+ case "end":
354
+ return _context6.stop();
366
355
  }
367
356
  }, _callee6, this);
368
357
  }));
@@ -393,24 +382,22 @@ var Topo = /*#__PURE__*/function () {
393
382
  var _open = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee7(id, mode) {
394
383
  var lastId;
395
384
  return _regenerator["default"].wrap(function _callee7$(_context7) {
396
- while (1) {
397
- switch (_context7.prev = _context7.next) {
398
- case 0:
399
- _rlog["default"].info('TopoApp.open 打开拓扑图', id); // 如果是切换拓扑图,注销原拓扑图
385
+ while (1) switch (_context7.prev = _context7.next) {
386
+ case 0:
387
+ _rlog["default"].info('TopoApp.open 打开拓扑图', id); // 如果是切换拓扑图,注销原拓扑图
400
388
 
401
389
 
402
- lastId = this.id;
403
- this.id = id;
390
+ lastId = this.id;
391
+ this.id = id;
404
392
 
405
- if (lastId && id !== lastId) {
406
- this.alarm.close();
407
- } // 加载新拓扑图
393
+ if (lastId && id !== lastId) {
394
+ this.alarm.close();
395
+ } // 加载新拓扑图
408
396
 
409
397
 
410
- case 4:
411
- case "end":
412
- return _context7.stop();
413
- }
398
+ case 4:
399
+ case "end":
400
+ return _context7.stop();
414
401
  }
415
402
  }, _callee7, this);
416
403
  }));
@@ -425,26 +412,24 @@ var Topo = /*#__PURE__*/function () {
425
412
  _proto.close = /*#__PURE__*/function () {
426
413
  var _close = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee8() {
427
414
  return _regenerator["default"].wrap(function _callee8$(_context8) {
428
- while (1) {
429
- switch (_context8.prev = _context8.next) {
430
- case 0:
431
- _rlog["default"].info('关闭拓扑图', this.id);
415
+ while (1) switch (_context8.prev = _context8.next) {
416
+ case 0:
417
+ _rlog["default"].info('关闭拓扑图', this.id);
432
418
 
433
- if (this.id) {
434
- _context8.next = 3;
435
- break;
436
- }
419
+ if (this.id) {
420
+ _context8.next = 3;
421
+ break;
422
+ }
437
423
 
438
- return _context8.abrupt("return");
424
+ return _context8.abrupt("return");
439
425
 
440
- case 3:
441
- this.alarm.close();
442
- this.id = null;
426
+ case 3:
427
+ this.alarm.close();
428
+ this.id = null;
443
429
 
444
- case 5:
445
- case "end":
446
- return _context8.stop();
447
- }
430
+ case 5:
431
+ case "end":
432
+ return _context8.stop();
448
433
  }
449
434
  }, _callee8, this);
450
435
  }));
@@ -459,12 +444,10 @@ var Topo = /*#__PURE__*/function () {
459
444
  _proto.refresh = /*#__PURE__*/function () {
460
445
  var _refresh = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee9() {
461
446
  return _regenerator["default"].wrap(function _callee9$(_context9) {
462
- while (1) {
463
- switch (_context9.prev = _context9.next) {
464
- case 0:
465
- case "end":
466
- return _context9.stop();
467
- }
447
+ while (1) switch (_context9.prev = _context9.next) {
448
+ case 0:
449
+ case "end":
450
+ return _context9.stop();
468
451
  }
469
452
  }, _callee9);
470
453
  }));
@@ -504,12 +487,10 @@ var Topo = /*#__PURE__*/function () {
504
487
  _proto.openViewMode = /*#__PURE__*/function () {
505
488
  var _openViewMode = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee10(id) {
506
489
  return _regenerator["default"].wrap(function _callee10$(_context10) {
507
- while (1) {
508
- switch (_context10.prev = _context10.next) {
509
- case 0:
510
- case "end":
511
- return _context10.stop();
512
- }
490
+ while (1) switch (_context10.prev = _context10.next) {
491
+ case 0:
492
+ case "end":
493
+ return _context10.stop();
513
494
  }
514
495
  }, _callee10);
515
496
  }));
@@ -536,15 +517,13 @@ var Topo = /*#__PURE__*/function () {
536
517
  _proto.onTopoDataLoaded = /*#__PURE__*/function () {
537
518
  var _onTopoDataLoaded = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee11(topoData) {
538
519
  return _regenerator["default"].wrap(function _callee11$(_context11) {
539
- while (1) {
540
- switch (_context11.prev = _context11.next) {
541
- case 0:
542
- this.pluginManager.onTopoDataLoaded(topoData);
543
-
544
- case 1:
545
- case "end":
546
- return _context11.stop();
547
- }
520
+ while (1) switch (_context11.prev = _context11.next) {
521
+ case 0:
522
+ this.pluginManager.onTopoDataLoaded(topoData);
523
+
524
+ case 1:
525
+ case "end":
526
+ return _context11.stop();
548
527
  }
549
528
  }, _callee11, this);
550
529
  }));
@@ -566,55 +545,53 @@ var Topo = /*#__PURE__*/function () {
566
545
  var _enterEditMode = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee12() {
567
546
  var topoDispatchers, iconManageDispatchers;
568
547
  return _regenerator["default"].wrap(function _callee12$(_context12) {
569
- while (1) {
570
- switch (_context12.prev = _context12.next) {
571
- case 0:
572
- _rlog["default"].info('TopoApp.enterEditMode');
573
-
574
- if (!this.options.onSwitchToEditModeBegin) {
575
- _context12.next = 4;
576
- break;
577
- }
548
+ while (1) switch (_context12.prev = _context12.next) {
549
+ case 0:
550
+ _rlog["default"].info('TopoApp.enterEditMode');
578
551
 
552
+ if (!this.options.onSwitchToEditModeBegin) {
579
553
  _context12.next = 4;
580
- return this.options.onSwitchToEditModeBegin(this);
554
+ break;
555
+ }
581
556
 
582
- case 4:
583
- topoDispatchers = this.store.getModelDispatchers('topoMod');
584
- _context12.next = 7;
585
- return topoDispatchers.update({
586
- viewState: 'edit'
587
- });
557
+ _context12.next = 4;
558
+ return this.options.onSwitchToEditModeBegin(this);
588
559
 
589
- case 7:
590
- _context12.next = 9;
591
- return this.view.switchToEditMode();
560
+ case 4:
561
+ topoDispatchers = this.store.getModelDispatchers('topoMod');
562
+ _context12.next = 7;
563
+ return topoDispatchers.update({
564
+ viewState: 'edit'
565
+ });
592
566
 
593
- case 9:
594
- (0, _edgeUtil.updateEdgeExpanded)(this);
567
+ case 7:
568
+ _context12.next = 9;
569
+ return this.view.switchToEditMode();
595
570
 
596
- if (!this.options.onSwitchToEditMode) {
597
- _context12.next = 13;
598
- break;
599
- }
571
+ case 9:
572
+ (0, _edgeUtil.updateEdgeExpanded)(this);
600
573
 
574
+ if (!this.options.onSwitchToEditMode) {
601
575
  _context12.next = 13;
602
- return this.options.onSwitchToEditMode(this);
576
+ break;
577
+ }
578
+
579
+ _context12.next = 13;
580
+ return this.options.onSwitchToEditMode(this);
603
581
 
604
- case 13:
605
- if (this.getDataModel()) {
606
- // 更新节点名称显示隐藏
607
- this.attributeMetricDisplay.updateNodesNameVisible();
608
- } // 加载自定义上传的图标
582
+ case 13:
583
+ if (this.getDataModel()) {
584
+ // 更新节点名称显示隐藏
585
+ this.attributeMetricDisplay.updateNodesNameVisible();
586
+ } // 加载自定义上传的图标
609
587
 
610
588
 
611
- iconManageDispatchers = this.store.getModelDispatchers('customIcon');
612
- iconManageDispatchers.loadEditorIcons();
589
+ iconManageDispatchers = this.store.getModelDispatchers('customIcon');
590
+ iconManageDispatchers.loadEditorIcons();
613
591
 
614
- case 16:
615
- case "end":
616
- return _context12.stop();
617
- }
592
+ case 16:
593
+ case "end":
594
+ return _context12.stop();
618
595
  }
619
596
  }, _callee12, this);
620
597
  }));
@@ -630,28 +607,26 @@ var Topo = /*#__PURE__*/function () {
630
607
  var _exitEditMode = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee13() {
631
608
  var editDispatchers;
632
609
  return _regenerator["default"].wrap(function _callee13$(_context13) {
633
- while (1) {
634
- switch (_context13.prev = _context13.next) {
635
- case 0:
636
- _context13.next = 2;
637
- return this.view.switchToViewMode();
638
-
639
- case 2:
640
- editDispatchers = this.store.getModelDispatchers('topoConfig');
641
- editDispatchers.switchToViewMode(this.id);
610
+ while (1) switch (_context13.prev = _context13.next) {
611
+ case 0:
612
+ _context13.next = 2;
613
+ return this.view.switchToViewMode();
642
614
 
643
- if (!this.options.onSwitchToViewMode) {
644
- _context13.next = 7;
645
- break;
646
- }
615
+ case 2:
616
+ editDispatchers = this.store.getModelDispatchers('topoConfig');
617
+ editDispatchers.switchToViewMode(this.id);
647
618
 
619
+ if (!this.options.onSwitchToViewMode) {
648
620
  _context13.next = 7;
649
- return this.options.onSwitchToViewMode(this);
621
+ break;
622
+ }
650
623
 
651
- case 7:
652
- case "end":
653
- return _context13.stop();
654
- }
624
+ _context13.next = 7;
625
+ return this.options.onSwitchToViewMode(this);
626
+
627
+ case 7:
628
+ case "end":
629
+ return _context13.stop();
655
630
  }
656
631
  }, _callee13, this);
657
632
  }));
@@ -672,15 +647,13 @@ var Topo = /*#__PURE__*/function () {
672
647
  function () {
673
648
  var _triggerSaveEvent = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee14() {
674
649
  return _regenerator["default"].wrap(function _callee14$(_context14) {
675
- while (1) {
676
- switch (_context14.prev = _context14.next) {
677
- case 0:
678
- this.view.topoClient.saveExternal();
679
-
680
- case 1:
681
- case "end":
682
- return _context14.stop();
683
- }
650
+ while (1) switch (_context14.prev = _context14.next) {
651
+ case 0:
652
+ this.view.topoClient.saveExternal();
653
+
654
+ case 1:
655
+ case "end":
656
+ return _context14.stop();
684
657
  }
685
658
  }, _callee14, this);
686
659
  }));
@@ -701,15 +674,13 @@ var Topo = /*#__PURE__*/function () {
701
674
  function () {
702
675
  var _save = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee15() {
703
676
  return _regenerator["default"].wrap(function _callee15$(_context15) {
704
- while (1) {
705
- switch (_context15.prev = _context15.next) {
706
- case 0:
707
- this.triggerSaveEvent();
708
-
709
- case 1:
710
- case "end":
711
- return _context15.stop();
712
- }
677
+ while (1) switch (_context15.prev = _context15.next) {
678
+ case 0:
679
+ this.triggerSaveEvent();
680
+
681
+ case 1:
682
+ case "end":
683
+ return _context15.stop();
713
684
  }
714
685
  }, _callee15, this);
715
686
  }));
@@ -733,20 +704,18 @@ var Topo = /*#__PURE__*/function () {
733
704
  var _exportImage = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee16(name) {
734
705
  var fileName;
735
706
  return _regenerator["default"].wrap(function _callee16$(_context16) {
736
- while (1) {
737
- switch (_context16.prev = _context16.next) {
738
- case 0:
739
- fileName = name;
707
+ while (1) switch (_context16.prev = _context16.next) {
708
+ case 0:
709
+ fileName = name;
740
710
 
741
- if (!name) {// TODO 获取拓扑名称,避免改名重绘拓扑图
742
- }
711
+ if (!name) {// TODO 获取拓扑名称,避免改名重绘拓扑图
712
+ }
743
713
 
744
- this.view.topoClient.exportImage(fileName);
714
+ this.view.topoClient.exportImage(fileName);
745
715
 
746
- case 3:
747
- case "end":
748
- return _context16.stop();
749
- }
716
+ case 3:
717
+ case "end":
718
+ return _context16.stop();
750
719
  }
751
720
  }, _callee16, this);
752
721
  }));
@@ -767,12 +736,10 @@ var Topo = /*#__PURE__*/function () {
767
736
  _proto.switchToViewMode = /*#__PURE__*/function () {
768
737
  var _switchToViewMode = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee17() {
769
738
  return _regenerator["default"].wrap(function _callee17$(_context17) {
770
- while (1) {
771
- switch (_context17.prev = _context17.next) {
772
- case 0:
773
- case "end":
774
- return _context17.stop();
775
- }
739
+ while (1) switch (_context17.prev = _context17.next) {
740
+ case 0:
741
+ case "end":
742
+ return _context17.stop();
776
743
  }
777
744
  }, _callee17);
778
745
  }));
@@ -787,12 +754,10 @@ var Topo = /*#__PURE__*/function () {
787
754
  _proto.switchToEditMode = /*#__PURE__*/function () {
788
755
  var _switchToEditMode = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee18() {
789
756
  return _regenerator["default"].wrap(function _callee18$(_context18) {
790
- while (1) {
791
- switch (_context18.prev = _context18.next) {
792
- case 0:
793
- case "end":
794
- return _context18.stop();
795
- }
757
+ while (1) switch (_context18.prev = _context18.next) {
758
+ case 0:
759
+ case "end":
760
+ return _context18.stop();
796
761
  }
797
762
  }, _callee18);
798
763
  }));