@riil-frontend/component-topology 11.0.36 → 11.0.39

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