@riil-frontend/component-topology 11.0.30 → 11.0.31

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 (217) hide show
  1. package/build/1.js +2 -2
  2. package/build/2.js +1 -1
  3. package/build/index.css +2 -4
  4. package/build/index.js +34 -49
  5. package/es/components/MultiResourceDrawer/index.js +18 -16
  6. package/es/components/ResourceList/ResourceSelect.js +50 -48
  7. package/es/components/ResourceSelectDrawer/ResourceSelectDrawer.js +26 -24
  8. package/es/components/SingleResourceDrawer/SelectDrawer.js +20 -18
  9. package/es/core/components/DisplaySettingDrawer/DisplaySettingDrawer.js +25 -23
  10. package/es/core/components/DisplaySettingDrawer/hooks/useDisplaySetting.js +84 -78
  11. package/es/core/components/titlebar/widgets/TitleWidget.js +3 -5
  12. package/es/core/editor/components/BackgroundView/UploadDialog/index.js +17 -15
  13. package/es/core/editor/components/BackgroundView/index.js +129 -119
  14. package/es/core/editor/components/CustomIconPlugin/RenameDialog.js +22 -20
  15. package/es/core/editor/components/CustomIconPlugin/UploadIconDialog.js +33 -31
  16. package/es/core/editor/components/CustomIconPlugin/utils/svgToShape.js +17 -15
  17. package/es/core/editor/components/GroupAddResourceDrawerPlugin/GroupAddResourceDrawer.js +9 -7
  18. package/es/core/editor/components/Sidebar/views/CanvasPanel/hooks/useCanvasThemeConfig.js +41 -37
  19. package/es/core/editor/components/Toolbar/widgets/BoxBackgroundButton/BoxBackgroundSetting.js +54 -50
  20. package/es/core/editor/components/Toolbar/widgets/FontColorButton.js +54 -50
  21. package/es/core/editor/components/Toolbar/widgets/IconSelect/index.module.scss +1 -1
  22. package/es/core/editor/components/settings/propertyViews/layer/DataTab/DefaultLayerAddResourceDrawer.js +13 -11
  23. package/es/core/editor/components/settings/propertyViews/node/data/BindResourceDrawer.js +23 -21
  24. package/es/core/editor/components/settings/propertyViews/node/data/Data.js +17 -15
  25. package/es/core/editor/components/settings/propertyViews/view/BackgroundSize.js +12 -10
  26. package/es/core/editor/components/titlebar/TopoEditorTitleBar.js +27 -21
  27. package/es/core/editor/hooks/useKeyboardShortcut.js +2 -2
  28. package/es/core/editor/hooks/useNewElementTheme.js +2 -2
  29. package/es/core/editor/store/background.js +10 -8
  30. package/es/core/editor/store/topoEdit.js +6 -4
  31. package/es/core/editor/utils/edgeTypeStyleUtil.js +4 -2
  32. package/es/core/hooks/usePolling.js +121 -117
  33. package/es/core/hooks/useResourceConfig.js +66 -58
  34. package/es/core/hooks/useTopoEdit.js +511 -476
  35. package/es/core/models/Alarm.js +298 -281
  36. package/es/core/models/AttributeMetricDisplay.js +107 -101
  37. package/es/core/models/PluginManager.js +3 -4
  38. package/es/core/models/SelectionModel.js +5 -4
  39. package/es/core/models/TopoApp.js +240 -205
  40. package/es/core/models/TopoGraphView.js +21 -18
  41. package/es/core/models/cache/CiCache.js +27 -28
  42. package/es/core/models/cache/CiTypeCache.js +41 -37
  43. package/es/core/models/cache/DictCache.js +35 -33
  44. package/es/core/models/graph/Background.js +17 -15
  45. package/es/core/models/plugins/resourceWebControllUrl.js +82 -76
  46. package/es/core/models/tagstips/ElementTagTipConfig.js +38 -34
  47. package/es/core/models/topoData.js +70 -68
  48. package/es/core/models/utils/linkUtils.js +43 -41
  49. package/es/core/models/utils/nodeNameVisibleUtil.js +4 -4
  50. package/es/core/services/alarm.js +16 -14
  51. package/es/core/services/background.js +67 -59
  52. package/es/core/services/cmdb/metric.js +11 -9
  53. package/es/core/services/cmdb.js +20 -18
  54. package/es/core/services/index.js +45 -39
  55. package/es/core/services/overview.js +151 -131
  56. package/es/core/services/topo/basic.js +13 -11
  57. package/es/core/services/topo/tagtip.js +12 -10
  58. package/es/core/store/models/ciModel.js +62 -58
  59. package/es/core/store/models/customIcon.js +134 -120
  60. package/es/core/store/models/displayConfig.js +19 -15
  61. package/es/core/store/models/selection.js +6 -4
  62. package/es/core/store/models/topoAlarm.js +145 -162
  63. package/es/core/store/models/topoBaseInfoOverview.js +6 -4
  64. package/es/core/store/models/topoBizMod.js +32 -28
  65. package/es/core/store/models/topoConfig.js +231 -215
  66. package/es/core/store/models/topoGraphView.js +6 -4
  67. package/es/core/store/models/topoMod.js +395 -373
  68. package/es/core/utils/imageUtil.js +20 -18
  69. package/es/core/utils/saveSerialize.js +11 -9
  70. package/es/core/viewer/components/plugins/ResourceDetail/components/ClusterMemberTable.js +58 -56
  71. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/EventsCard.js +17 -15
  72. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/ResourceOverview.js +357 -343
  73. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/Configurator/index.js +92 -86
  74. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/LinkTopoCard.js +41 -39
  75. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/services/index.js +205 -189
  76. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/hooks/useAlarmAndRiskData.js +109 -107
  77. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/hooks/useMetricModels.js +59 -57
  78. package/es/core/viewer/components/plugins/ResourceDetail/components/WebConsole/WebConsoleForm/hooks/useWebConsole.js +37 -33
  79. package/es/core/viewer/components/plugins/ResourceDetail/getCiDisplayMetricModels.js +29 -25
  80. package/es/core/viewer/components/plugins/ResourceDetail/hooks/useUserId.js +36 -32
  81. package/es/core/viewer/components/plugins/ResourceWebControllUrlSettingDialog.js +19 -17
  82. package/es/networkTopo/components/Link/hook.js +77 -73
  83. package/es/networkTopo/components/Link/index.js +94 -86
  84. package/es/networkTopo/components/Link/setting.js +44 -42
  85. package/es/networkTopo/getTopoData.js +69 -63
  86. package/es/networkTopo/hooks/viewer/useRelateTopo.js +32 -30
  87. package/es/networkTopo/models/LinkDynamicStyleExecutor.js +2 -2
  88. package/es/networkTopo/models/TopoCenter.js +22 -18
  89. package/es/networkTopo/services/alert.js +22 -18
  90. package/es/networkTopo/services/authorization.js +55 -45
  91. package/es/networkTopo/services/cmdb.js +470 -422
  92. package/es/networkTopo/services/funcAuth.js +24 -22
  93. package/es/networkTopo/services/link.js +117 -107
  94. package/es/networkTopo/services/mdc.js +24 -18
  95. package/es/networkTopo/services/metric.js +27 -23
  96. package/es/networkTopo/services/model.js +509 -445
  97. package/es/networkTopo/services/risk.js +11 -9
  98. package/es/networkTopo/services/topo/auth.js +33 -27
  99. package/es/networkTopo/services/topo/basic.js +314 -274
  100. package/es/networkTopo/services/topo/blacklist.js +24 -20
  101. package/es/networkTopo/services/topo/ciInfo.js +31 -27
  102. package/es/networkTopo/services/topo/icon.js +59 -49
  103. package/es/networkTopo/services/topo/networkLink.js +36 -32
  104. package/es/networkTopo/services/topo/relation.js +11 -9
  105. package/es/networkTopo/services/topo/resourceWebUrl.js +42 -36
  106. package/es/networkTopo/store/functionAuth.js +37 -31
  107. package/es/networkTopo/store/topoCenter.js +152 -142
  108. package/es/networkTopo/store/topoLinkMod.js +6 -4
  109. package/es/networkTopo/store/topoTreeMod.js +182 -170
  110. package/es/networkTopo/utils/exportData.js +54 -52
  111. package/lib/components/MultiResourceDrawer/index.js +18 -16
  112. package/lib/components/ResourceList/ResourceSelect.js +50 -48
  113. package/lib/components/ResourceSelectDrawer/ResourceSelectDrawer.js +29 -27
  114. package/lib/components/SingleResourceDrawer/SelectDrawer.js +20 -18
  115. package/lib/core/components/DisplaySettingDrawer/DisplaySettingDrawer.js +32 -30
  116. package/lib/core/components/DisplaySettingDrawer/hooks/useDisplaySetting.js +84 -78
  117. package/lib/core/components/titlebar/widgets/TitleWidget.js +3 -5
  118. package/lib/core/editor/components/BackgroundView/UploadDialog/index.js +17 -15
  119. package/lib/core/editor/components/BackgroundView/index.js +128 -118
  120. package/lib/core/editor/components/CustomIconPlugin/RenameDialog.js +24 -22
  121. package/lib/core/editor/components/CustomIconPlugin/UploadIconDialog.js +33 -31
  122. package/lib/core/editor/components/CustomIconPlugin/utils/svgToShape.js +21 -19
  123. package/lib/core/editor/components/GroupAddResourceDrawerPlugin/GroupAddResourceDrawer.js +10 -8
  124. package/lib/core/editor/components/Sidebar/views/CanvasPanel/hooks/useCanvasThemeConfig.js +41 -37
  125. package/lib/core/editor/components/Toolbar/widgets/BoxBackgroundButton/BoxBackgroundSetting.js +54 -50
  126. package/lib/core/editor/components/Toolbar/widgets/FontColorButton.js +54 -50
  127. package/lib/core/editor/components/Toolbar/widgets/IconSelect/index.module.scss +1 -1
  128. package/lib/core/editor/components/settings/propertyViews/layer/DataTab/DefaultLayerAddResourceDrawer.js +14 -12
  129. package/lib/core/editor/components/settings/propertyViews/node/data/BindResourceDrawer.js +28 -26
  130. package/lib/core/editor/components/settings/propertyViews/node/data/Data.js +17 -15
  131. package/lib/core/editor/components/settings/propertyViews/view/BackgroundSize.js +14 -12
  132. package/lib/core/editor/components/titlebar/TopoEditorTitleBar.js +31 -25
  133. package/lib/core/editor/hooks/useKeyboardShortcut.js +2 -2
  134. package/lib/core/editor/hooks/useNewElementTheme.js +2 -2
  135. package/lib/core/editor/store/background.js +10 -8
  136. package/lib/core/editor/store/topoEdit.js +6 -4
  137. package/lib/core/editor/utils/edgeTypeStyleUtil.js +4 -2
  138. package/lib/core/hooks/usePolling.js +120 -116
  139. package/lib/core/hooks/useResourceConfig.js +66 -58
  140. package/lib/core/hooks/useTopoEdit.js +503 -468
  141. package/lib/core/models/Alarm.js +292 -275
  142. package/lib/core/models/AttributeMetricDisplay.js +110 -104
  143. package/lib/core/models/PluginManager.js +3 -4
  144. package/lib/core/models/SelectionModel.js +5 -4
  145. package/lib/core/models/TopoApp.js +240 -205
  146. package/lib/core/models/TopoGraphView.js +21 -18
  147. package/lib/core/models/cache/CiCache.js +32 -33
  148. package/lib/core/models/cache/CiTypeCache.js +42 -38
  149. package/lib/core/models/cache/DictCache.js +35 -33
  150. package/lib/core/models/graph/Background.js +18 -16
  151. package/lib/core/models/plugins/resourceWebControllUrl.js +80 -74
  152. package/lib/core/models/tagstips/ElementTagTipConfig.js +38 -34
  153. package/lib/core/models/topoData.js +71 -69
  154. package/lib/core/models/utils/linkUtils.js +43 -41
  155. package/lib/core/models/utils/nodeNameVisibleUtil.js +4 -4
  156. package/lib/core/services/alarm.js +20 -18
  157. package/lib/core/services/background.js +78 -70
  158. package/lib/core/services/cmdb/metric.js +12 -10
  159. package/lib/core/services/cmdb.js +22 -20
  160. package/lib/core/services/index.js +51 -45
  161. package/lib/core/services/overview.js +151 -131
  162. package/lib/core/services/topo/basic.js +15 -13
  163. package/lib/core/services/topo/tagtip.js +14 -12
  164. package/lib/core/store/models/ciModel.js +70 -66
  165. package/lib/core/store/models/customIcon.js +134 -120
  166. package/lib/core/store/models/displayConfig.js +19 -15
  167. package/lib/core/store/models/selection.js +6 -4
  168. package/lib/core/store/models/topoAlarm.js +145 -163
  169. package/lib/core/store/models/topoBaseInfoOverview.js +6 -4
  170. package/lib/core/store/models/topoBizMod.js +38 -34
  171. package/lib/core/store/models/topoConfig.js +238 -222
  172. package/lib/core/store/models/topoGraphView.js +6 -4
  173. package/lib/core/store/models/topoMod.js +397 -375
  174. package/lib/core/utils/imageUtil.js +24 -22
  175. package/lib/core/utils/saveSerialize.js +11 -9
  176. package/lib/core/viewer/components/plugins/ResourceDetail/components/ClusterMemberTable.js +58 -56
  177. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/EventsCard.js +17 -15
  178. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/ResourceOverview.js +358 -344
  179. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/Configurator/index.js +92 -86
  180. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/LinkTopoCard.js +41 -39
  181. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/services/index.js +206 -190
  182. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/hooks/useAlarmAndRiskData.js +109 -107
  183. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/hooks/useMetricModels.js +59 -57
  184. package/lib/core/viewer/components/plugins/ResourceDetail/components/WebConsole/WebConsoleForm/hooks/useWebConsole.js +33 -29
  185. package/lib/core/viewer/components/plugins/ResourceDetail/getCiDisplayMetricModels.js +29 -25
  186. package/lib/core/viewer/components/plugins/ResourceDetail/hooks/useUserId.js +36 -32
  187. package/lib/core/viewer/components/plugins/ResourceWebControllUrlSettingDialog.js +20 -18
  188. package/lib/networkTopo/components/Link/hook.js +77 -73
  189. package/lib/networkTopo/components/Link/index.js +95 -87
  190. package/lib/networkTopo/components/Link/setting.js +44 -42
  191. package/lib/networkTopo/getTopoData.js +69 -63
  192. package/lib/networkTopo/hooks/viewer/useRelateTopo.js +33 -31
  193. package/lib/networkTopo/models/LinkDynamicStyleExecutor.js +2 -2
  194. package/lib/networkTopo/models/TopoCenter.js +22 -18
  195. package/lib/networkTopo/services/alert.js +22 -18
  196. package/lib/networkTopo/services/authorization.js +65 -55
  197. package/lib/networkTopo/services/cmdb.js +470 -422
  198. package/lib/networkTopo/services/funcAuth.js +26 -24
  199. package/lib/networkTopo/services/link.js +118 -108
  200. package/lib/networkTopo/services/mdc.js +27 -21
  201. package/lib/networkTopo/services/metric.js +31 -27
  202. package/lib/networkTopo/services/model.js +509 -445
  203. package/lib/networkTopo/services/risk.js +13 -11
  204. package/lib/networkTopo/services/topo/auth.js +33 -27
  205. package/lib/networkTopo/services/topo/basic.js +317 -277
  206. package/lib/networkTopo/services/topo/blacklist.js +24 -20
  207. package/lib/networkTopo/services/topo/ciInfo.js +38 -34
  208. package/lib/networkTopo/services/topo/icon.js +69 -59
  209. package/lib/networkTopo/services/topo/networkLink.js +36 -32
  210. package/lib/networkTopo/services/topo/relation.js +13 -11
  211. package/lib/networkTopo/services/topo/resourceWebUrl.js +50 -44
  212. package/lib/networkTopo/store/functionAuth.js +37 -31
  213. package/lib/networkTopo/store/topoCenter.js +152 -142
  214. package/lib/networkTopo/store/topoLinkMod.js +6 -4
  215. package/lib/networkTopo/store/topoTreeMod.js +178 -166
  216. package/lib/networkTopo/utils/exportData.js +61 -59
  217. package/package.json +3 -3
@@ -56,20 +56,19 @@ 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.30" === 'string' ? "11.0.30" : null;
59
+ var version = typeof "11.0.31" === 'string' ? "11.0.31" : 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
+ */
66
69
  function Topo(options) {
67
70
  this.options = void 0;
68
71
  this.id = void 0;
69
-
70
- /**
71
- * @type TopoGraphView
72
- */
73
72
  this.view = void 0;
74
73
  this.alarm = new _Alarm["default"]();
75
74
  this.store = void 0;
@@ -131,18 +130,20 @@ var Topo = /*#__PURE__*/function () {
131
130
  var _exit = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee() {
132
131
  var topoDispatchers;
133
132
  return _regenerator["default"].wrap(function _callee$(_context) {
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();
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
+ }
146
147
  }
147
148
  }, _callee, this);
148
149
  }));
@@ -159,27 +160,29 @@ var Topo = /*#__PURE__*/function () {
159
160
  var _data$groups, groups, _data$nodes, nodes, links, lines, topoDispatchers;
160
161
 
161
162
  return _regenerator["default"].wrap(function _callee2$(_context2) {
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();
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
+ }
183
186
  }
184
187
  }, _callee2, this);
185
188
  }));
@@ -194,10 +197,12 @@ var Topo = /*#__PURE__*/function () {
194
197
  _proto.clear = /*#__PURE__*/function () {
195
198
  var _clear = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee3() {
196
199
  return _regenerator["default"].wrap(function _callee3$(_context3) {
197
- while (1) switch (_context3.prev = _context3.next) {
198
- case 0:
199
- case "end":
200
- return _context3.stop();
200
+ while (1) {
201
+ switch (_context3.prev = _context3.next) {
202
+ case 0:
203
+ case "end":
204
+ return _context3.stop();
205
+ }
201
206
  }
202
207
  }, _callee3);
203
208
  }));
@@ -266,28 +271,30 @@ var Topo = /*#__PURE__*/function () {
266
271
  var _data$groups2, groups, _data$nodes2, nodes, links, lines;
267
272
 
268
273
  return _regenerator["default"].wrap(function _callee4$(_context4) {
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();
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
+ }
291
298
  }
292
299
  }, _callee4, this);
293
300
  }));
@@ -311,18 +318,20 @@ var Topo = /*#__PURE__*/function () {
311
318
  var _addElements = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee5(elements) {
312
319
  var data;
313
320
  return _regenerator["default"].wrap(function _callee5$(_context5) {
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();
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
+ }
326
335
  }
327
336
  }, _callee5, this);
328
337
  }));
@@ -345,13 +354,15 @@ var Topo = /*#__PURE__*/function () {
345
354
  function () {
346
355
  var _updateData = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee6(data) {
347
356
  return _regenerator["default"].wrap(function _callee6$(_context6) {
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();
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
+ }
355
366
  }
356
367
  }, _callee6, this);
357
368
  }));
@@ -382,22 +393,24 @@ var Topo = /*#__PURE__*/function () {
382
393
  var _open = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee7(id, mode) {
383
394
  var lastId;
384
395
  return _regenerator["default"].wrap(function _callee7$(_context7) {
385
- while (1) switch (_context7.prev = _context7.next) {
386
- case 0:
387
- _rlog["default"].info('TopoApp.open 打开拓扑图', id); // 如果是切换拓扑图,注销原拓扑图
396
+ while (1) {
397
+ switch (_context7.prev = _context7.next) {
398
+ case 0:
399
+ _rlog["default"].info('TopoApp.open 打开拓扑图', id); // 如果是切换拓扑图,注销原拓扑图
388
400
 
389
401
 
390
- lastId = this.id;
391
- this.id = id;
402
+ lastId = this.id;
403
+ this.id = id;
392
404
 
393
- if (lastId && id !== lastId) {
394
- this.alarm.close();
395
- } // 加载新拓扑图
405
+ if (lastId && id !== lastId) {
406
+ this.alarm.close();
407
+ } // 加载新拓扑图
396
408
 
397
409
 
398
- case 4:
399
- case "end":
400
- return _context7.stop();
410
+ case 4:
411
+ case "end":
412
+ return _context7.stop();
413
+ }
401
414
  }
402
415
  }, _callee7, this);
403
416
  }));
@@ -412,24 +425,26 @@ var Topo = /*#__PURE__*/function () {
412
425
  _proto.close = /*#__PURE__*/function () {
413
426
  var _close = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee8() {
414
427
  return _regenerator["default"].wrap(function _callee8$(_context8) {
415
- while (1) switch (_context8.prev = _context8.next) {
416
- case 0:
417
- _rlog["default"].info('关闭拓扑图', this.id);
428
+ while (1) {
429
+ switch (_context8.prev = _context8.next) {
430
+ case 0:
431
+ _rlog["default"].info('关闭拓扑图', this.id);
418
432
 
419
- if (this.id) {
420
- _context8.next = 3;
421
- break;
422
- }
433
+ if (this.id) {
434
+ _context8.next = 3;
435
+ break;
436
+ }
423
437
 
424
- return _context8.abrupt("return");
438
+ return _context8.abrupt("return");
425
439
 
426
- case 3:
427
- this.alarm.close();
428
- this.id = null;
440
+ case 3:
441
+ this.alarm.close();
442
+ this.id = null;
429
443
 
430
- case 5:
431
- case "end":
432
- return _context8.stop();
444
+ case 5:
445
+ case "end":
446
+ return _context8.stop();
447
+ }
433
448
  }
434
449
  }, _callee8, this);
435
450
  }));
@@ -444,10 +459,12 @@ var Topo = /*#__PURE__*/function () {
444
459
  _proto.refresh = /*#__PURE__*/function () {
445
460
  var _refresh = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee9() {
446
461
  return _regenerator["default"].wrap(function _callee9$(_context9) {
447
- while (1) switch (_context9.prev = _context9.next) {
448
- case 0:
449
- case "end":
450
- return _context9.stop();
462
+ while (1) {
463
+ switch (_context9.prev = _context9.next) {
464
+ case 0:
465
+ case "end":
466
+ return _context9.stop();
467
+ }
451
468
  }
452
469
  }, _callee9);
453
470
  }));
@@ -487,10 +504,12 @@ var Topo = /*#__PURE__*/function () {
487
504
  _proto.openViewMode = /*#__PURE__*/function () {
488
505
  var _openViewMode = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee10(id) {
489
506
  return _regenerator["default"].wrap(function _callee10$(_context10) {
490
- while (1) switch (_context10.prev = _context10.next) {
491
- case 0:
492
- case "end":
493
- return _context10.stop();
507
+ while (1) {
508
+ switch (_context10.prev = _context10.next) {
509
+ case 0:
510
+ case "end":
511
+ return _context10.stop();
512
+ }
494
513
  }
495
514
  }, _callee10);
496
515
  }));
@@ -517,13 +536,15 @@ var Topo = /*#__PURE__*/function () {
517
536
  _proto.onTopoDataLoaded = /*#__PURE__*/function () {
518
537
  var _onTopoDataLoaded = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee11(topoData) {
519
538
  return _regenerator["default"].wrap(function _callee11$(_context11) {
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();
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
+ }
527
548
  }
528
549
  }, _callee11, this);
529
550
  }));
@@ -545,53 +566,55 @@ var Topo = /*#__PURE__*/function () {
545
566
  var _enterEditMode = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee12() {
546
567
  var topoDispatchers, iconManageDispatchers;
547
568
  return _regenerator["default"].wrap(function _callee12$(_context12) {
548
- while (1) switch (_context12.prev = _context12.next) {
549
- case 0:
550
- _rlog["default"].info('TopoApp.enterEditMode');
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
+ }
551
578
 
552
- if (!this.options.onSwitchToEditModeBegin) {
553
579
  _context12.next = 4;
554
- break;
555
- }
580
+ return this.options.onSwitchToEditModeBegin(this);
556
581
 
557
- _context12.next = 4;
558
- return this.options.onSwitchToEditModeBegin(this);
582
+ case 4:
583
+ topoDispatchers = this.store.getModelDispatchers('topoMod');
584
+ _context12.next = 7;
585
+ return topoDispatchers.update({
586
+ viewState: 'edit'
587
+ });
559
588
 
560
- case 4:
561
- topoDispatchers = this.store.getModelDispatchers('topoMod');
562
- _context12.next = 7;
563
- return topoDispatchers.update({
564
- viewState: 'edit'
565
- });
589
+ case 7:
590
+ _context12.next = 9;
591
+ return this.view.switchToEditMode();
566
592
 
567
- case 7:
568
- _context12.next = 9;
569
- return this.view.switchToEditMode();
593
+ case 9:
594
+ (0, _edgeUtil.updateEdgeExpanded)(this);
570
595
 
571
- case 9:
572
- (0, _edgeUtil.updateEdgeExpanded)(this);
596
+ if (!this.options.onSwitchToEditMode) {
597
+ _context12.next = 13;
598
+ break;
599
+ }
573
600
 
574
- if (!this.options.onSwitchToEditMode) {
575
601
  _context12.next = 13;
576
- break;
577
- }
578
-
579
- _context12.next = 13;
580
- return this.options.onSwitchToEditMode(this);
602
+ return this.options.onSwitchToEditMode(this);
581
603
 
582
- case 13:
583
- if (this.getDataModel()) {
584
- // 更新节点名称显示隐藏
585
- this.attributeMetricDisplay.updateNodesNameVisible();
586
- } // 加载自定义上传的图标
604
+ case 13:
605
+ if (this.getDataModel()) {
606
+ // 更新节点名称显示隐藏
607
+ this.attributeMetricDisplay.updateNodesNameVisible();
608
+ } // 加载自定义上传的图标
587
609
 
588
610
 
589
- iconManageDispatchers = this.store.getModelDispatchers('customIcon');
590
- iconManageDispatchers.loadEditorIcons();
611
+ iconManageDispatchers = this.store.getModelDispatchers('customIcon');
612
+ iconManageDispatchers.loadEditorIcons();
591
613
 
592
- case 16:
593
- case "end":
594
- return _context12.stop();
614
+ case 16:
615
+ case "end":
616
+ return _context12.stop();
617
+ }
595
618
  }
596
619
  }, _callee12, this);
597
620
  }));
@@ -607,26 +630,28 @@ var Topo = /*#__PURE__*/function () {
607
630
  var _exitEditMode = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee13() {
608
631
  var editDispatchers;
609
632
  return _regenerator["default"].wrap(function _callee13$(_context13) {
610
- while (1) switch (_context13.prev = _context13.next) {
611
- case 0:
612
- _context13.next = 2;
613
- return this.view.switchToViewMode();
633
+ while (1) {
634
+ switch (_context13.prev = _context13.next) {
635
+ case 0:
636
+ _context13.next = 2;
637
+ return this.view.switchToViewMode();
614
638
 
615
- case 2:
616
- editDispatchers = this.store.getModelDispatchers('topoConfig');
617
- editDispatchers.switchToViewMode(this.id);
639
+ case 2:
640
+ editDispatchers = this.store.getModelDispatchers('topoConfig');
641
+ editDispatchers.switchToViewMode(this.id);
618
642
 
619
- if (!this.options.onSwitchToViewMode) {
620
- _context13.next = 7;
621
- break;
622
- }
643
+ if (!this.options.onSwitchToViewMode) {
644
+ _context13.next = 7;
645
+ break;
646
+ }
623
647
 
624
- _context13.next = 7;
625
- return this.options.onSwitchToViewMode(this);
648
+ _context13.next = 7;
649
+ return this.options.onSwitchToViewMode(this);
626
650
 
627
- case 7:
628
- case "end":
629
- return _context13.stop();
651
+ case 7:
652
+ case "end":
653
+ return _context13.stop();
654
+ }
630
655
  }
631
656
  }, _callee13, this);
632
657
  }));
@@ -647,13 +672,15 @@ var Topo = /*#__PURE__*/function () {
647
672
  function () {
648
673
  var _triggerSaveEvent = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee14() {
649
674
  return _regenerator["default"].wrap(function _callee14$(_context14) {
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();
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
+ }
657
684
  }
658
685
  }, _callee14, this);
659
686
  }));
@@ -674,13 +701,15 @@ var Topo = /*#__PURE__*/function () {
674
701
  function () {
675
702
  var _save = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee15() {
676
703
  return _regenerator["default"].wrap(function _callee15$(_context15) {
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();
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
+ }
684
713
  }
685
714
  }, _callee15, this);
686
715
  }));
@@ -704,18 +733,20 @@ var Topo = /*#__PURE__*/function () {
704
733
  var _exportImage = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee16(name) {
705
734
  var fileName;
706
735
  return _regenerator["default"].wrap(function _callee16$(_context16) {
707
- while (1) switch (_context16.prev = _context16.next) {
708
- case 0:
709
- fileName = name;
736
+ while (1) {
737
+ switch (_context16.prev = _context16.next) {
738
+ case 0:
739
+ fileName = name;
710
740
 
711
- if (!name) {// TODO 获取拓扑名称,避免改名重绘拓扑图
712
- }
741
+ if (!name) {// TODO 获取拓扑名称,避免改名重绘拓扑图
742
+ }
713
743
 
714
- this.view.topoClient.exportImage(fileName);
744
+ this.view.topoClient.exportImage(fileName);
715
745
 
716
- case 3:
717
- case "end":
718
- return _context16.stop();
746
+ case 3:
747
+ case "end":
748
+ return _context16.stop();
749
+ }
719
750
  }
720
751
  }, _callee16, this);
721
752
  }));
@@ -736,10 +767,12 @@ var Topo = /*#__PURE__*/function () {
736
767
  _proto.switchToViewMode = /*#__PURE__*/function () {
737
768
  var _switchToViewMode = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee17() {
738
769
  return _regenerator["default"].wrap(function _callee17$(_context17) {
739
- while (1) switch (_context17.prev = _context17.next) {
740
- case 0:
741
- case "end":
742
- return _context17.stop();
770
+ while (1) {
771
+ switch (_context17.prev = _context17.next) {
772
+ case 0:
773
+ case "end":
774
+ return _context17.stop();
775
+ }
743
776
  }
744
777
  }, _callee17);
745
778
  }));
@@ -754,10 +787,12 @@ var Topo = /*#__PURE__*/function () {
754
787
  _proto.switchToEditMode = /*#__PURE__*/function () {
755
788
  var _switchToEditMode = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee18() {
756
789
  return _regenerator["default"].wrap(function _callee18$(_context18) {
757
- while (1) switch (_context18.prev = _context18.next) {
758
- case 0:
759
- case "end":
760
- return _context18.stop();
790
+ while (1) {
791
+ switch (_context18.prev = _context18.next) {
792
+ case 0:
793
+ case "end":
794
+ return _context18.stop();
795
+ }
761
796
  }
762
797
  }, _callee18);
763
798
  }));