@riil-frontend/component-topology 7.0.0-dev.2 → 7.0.0-dev.20

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 (143) hide show
  1. package/build/1.js +2 -2
  2. package/build/2.js +1 -1
  3. package/build/index.css +1 -1
  4. package/build/index.js +31 -31
  5. package/es/core/components/TopoView/topoView.js +2 -19
  6. package/es/core/components/titlebar/index.js +2 -1
  7. package/es/core/editor/components/EditorPlugin.js +1 -2
  8. package/es/core/editor/components/Toolbar/buttons.js +2 -2
  9. package/es/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/elements/edgeTag.js +11 -3
  10. package/es/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/elements/nodeTag.js +6 -1
  11. package/es/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/textStyleUtil.js +5 -0
  12. package/es/core/editor/components/settings/PropertyView.js +11 -10
  13. package/es/core/editor/components/settings/Settings.js +8 -1
  14. package/es/core/editor/components/settings/core/PropertyViewManager.js +4 -3
  15. package/es/core/editor/components/settings/core/edgePropertyViewAdapter.js +1 -7
  16. package/es/core/editor/components/settings/propertyViews/node/data/Data.js +6 -3
  17. package/es/core/editor/components/settings/propertyViews/node/data/NodeRelateResourceButton.js +4 -2
  18. package/es/core/editor/components/settings/propertyViews/node/data/PlatformDisplay.js +10 -0
  19. package/es/core/editor/hooks/useKeyboardShortcut.js +1 -1
  20. package/es/core/hooks/usePolling.js +1 -6
  21. package/es/core/hooks/useTopoEdit.js +134 -170
  22. package/es/core/models/Alarm.js +12 -24
  23. package/es/core/models/TopoApp.js +1 -1
  24. package/es/core/models/topoData.js +3 -3
  25. package/es/core/models/utils/linkUtils.js +0 -3
  26. package/es/core/store/models/topoConfig.js +7 -5
  27. package/es/core/store/models/topoMod.js +8 -7
  28. package/es/core/utils/saveSerialize.js +2 -3
  29. package/es/core/viewer/components/plugins/ResourceDetail/ResourceDetailDrawer.js +13 -2
  30. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/EventsCard.js +28 -25
  31. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/ResourceOverview.js +4 -0
  32. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/Configurator/index.js +17 -17
  33. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/index.module.scss +1 -0
  34. package/es/core/viewer/components/titlebar/BasicTools.js +3 -16
  35. package/es/core/viewer/components/titlebar/widgets/AlarmButton.js +25 -0
  36. package/es/networkTopo/components/editor/propertyViews/edge/LinkPropertyView/Data/index.js +8 -2
  37. package/es/networkTopo/components/editor/propertyViews/edge/LinkPropertyView/LinkPropertyView.js +7 -9
  38. package/es/networkTopo/components/editor/propertyViews/edge/link/LinkInfoPreview.js +42 -16
  39. package/es/networkTopo/components/editor/useEditorProps.js +4 -5
  40. package/es/networkTopo/getTopoData.js +18 -30
  41. package/es/networkTopo/hooks/editor/useDeleteEdges.js +6 -3
  42. package/es/networkTopo/services/alert.js +55 -0
  43. package/es/networkTopo/services/authorization.js +135 -0
  44. package/es/networkTopo/services/cmdb.js +897 -0
  45. package/es/networkTopo/services/index.js +2 -26
  46. package/es/networkTopo/services/mdc.js +74 -0
  47. package/es/networkTopo/services/metric.js +68 -0
  48. package/es/networkTopo/services/model.js +1283 -0
  49. package/es/networkTopo/services/risk.js +29 -0
  50. package/es/networkTopo/services/topo/auth.js +67 -0
  51. package/es/networkTopo/services/topo/basic.js +727 -0
  52. package/es/networkTopo/services/topo/blacklist.js +60 -0
  53. package/es/networkTopo/services/topo/ciInfo.js +69 -0
  54. package/es/networkTopo/services/topo/constants.js +1 -0
  55. package/es/networkTopo/services/topo/icon.js +131 -0
  56. package/es/networkTopo/services/topo/index.js +18 -0
  57. package/es/networkTopo/services/topo/networkLink.js +33 -0
  58. package/es/networkTopo/services/topo/relation.js +27 -0
  59. package/es/networkTopo/services/topo/resourceWebUrl.js +84 -0
  60. package/es/networkTopo/utils/storage.js +38 -0
  61. package/es/style.js +21 -21
  62. package/es/utils/tree.js +1 -0
  63. package/lib/core/components/TopoView/topoView.js +2 -20
  64. package/lib/core/components/titlebar/index.js +5 -1
  65. package/lib/core/editor/components/EditorPlugin.js +1 -3
  66. package/lib/core/editor/components/Toolbar/buttons.js +2 -2
  67. package/lib/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/elements/edgeTag.js +11 -4
  68. package/lib/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/elements/nodeTag.js +6 -1
  69. package/lib/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/textStyleUtil.js +5 -0
  70. package/lib/core/editor/components/settings/PropertyView.js +10 -10
  71. package/lib/core/editor/components/settings/Settings.js +9 -1
  72. package/lib/core/editor/components/settings/core/PropertyViewManager.js +4 -3
  73. package/lib/core/editor/components/settings/core/edgePropertyViewAdapter.js +1 -10
  74. package/lib/core/editor/components/settings/propertyViews/node/data/Data.js +7 -4
  75. package/lib/core/editor/components/settings/propertyViews/node/data/NodeRelateResourceButton.js +4 -2
  76. package/lib/core/editor/components/settings/propertyViews/node/data/PlatformDisplay.js +18 -0
  77. package/lib/core/editor/hooks/useKeyboardShortcut.js +1 -1
  78. package/lib/core/hooks/usePolling.js +1 -6
  79. package/lib/core/hooks/useTopoEdit.js +134 -170
  80. package/lib/core/models/Alarm.js +12 -24
  81. package/lib/core/models/TopoApp.js +1 -1
  82. package/lib/core/models/topoData.js +7 -11
  83. package/lib/core/models/utils/linkUtils.js +0 -5
  84. package/lib/core/store/models/topoConfig.js +7 -5
  85. package/lib/core/store/models/topoMod.js +10 -7
  86. package/lib/core/utils/saveSerialize.js +1 -3
  87. package/lib/core/viewer/components/plugins/ResourceDetail/ResourceDetailDrawer.js +13 -2
  88. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/EventsCard.js +28 -26
  89. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/ResourceOverview.js +4 -0
  90. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/Configurator/index.js +17 -17
  91. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/index.module.scss +1 -0
  92. package/lib/core/viewer/components/titlebar/BasicTools.js +3 -17
  93. package/lib/core/viewer/components/titlebar/widgets/AlarmButton.js +36 -0
  94. package/lib/networkTopo/components/editor/propertyViews/edge/LinkPropertyView/Data/index.js +8 -2
  95. package/lib/networkTopo/components/editor/propertyViews/edge/LinkPropertyView/LinkPropertyView.js +7 -9
  96. package/lib/networkTopo/components/editor/propertyViews/edge/link/LinkInfoPreview.js +42 -16
  97. package/lib/networkTopo/components/editor/useEditorProps.js +4 -6
  98. package/lib/networkTopo/getTopoData.js +19 -33
  99. package/lib/networkTopo/hooks/editor/useDeleteEdges.js +6 -4
  100. package/lib/networkTopo/services/alert.js +66 -0
  101. package/lib/networkTopo/services/authorization.js +145 -0
  102. package/lib/networkTopo/services/cmdb.js +977 -0
  103. package/lib/networkTopo/services/index.js +3 -29
  104. package/lib/networkTopo/services/mdc.js +91 -0
  105. package/lib/networkTopo/services/metric.js +82 -0
  106. package/lib/networkTopo/services/model.js +1387 -0
  107. package/lib/networkTopo/services/risk.js +40 -0
  108. package/lib/networkTopo/services/topo/auth.js +79 -0
  109. package/lib/networkTopo/services/topo/basic.js +753 -0
  110. package/lib/networkTopo/services/topo/blacklist.js +72 -0
  111. package/lib/networkTopo/services/topo/ciInfo.js +82 -0
  112. package/lib/networkTopo/services/topo/constants.js +6 -0
  113. package/lib/networkTopo/services/topo/icon.js +144 -0
  114. package/lib/networkTopo/services/topo/index.js +42 -0
  115. package/lib/networkTopo/services/topo/networkLink.js +45 -0
  116. package/lib/networkTopo/services/topo/relation.js +39 -0
  117. package/lib/networkTopo/services/topo/resourceWebUrl.js +95 -0
  118. package/lib/networkTopo/utils/storage.js +46 -0
  119. package/lib/style.js +21 -21
  120. package/lib/utils/tree.js +1 -0
  121. package/package.json +3 -3
  122. package/es/core/editor/components/plugins/MultipleResourceSelectPlugin.js +0 -15
  123. package/es/core/editor/components/settings/propertyViews/edge/addEdgeProps.js +0 -10
  124. package/es/networkTopo/components/editor/propertyViews/edge/addLinkDrawer/AddLinkDrawer.js +0 -630
  125. package/es/networkTopo/components/editor/propertyViews/edge/addLinkDrawer/components/NetworkLinkForm.js +0 -4
  126. package/es/networkTopo/components/editor/propertyViews/edge/addLinkDrawer/components/editLinkInfo.js +0 -458
  127. package/es/networkTopo/components/editor/propertyViews/edge/addLinkDrawer/components/index.module.scss +0 -34
  128. package/es/networkTopo/components/editor/propertyViews/edge/addLinkDrawer/hooks/useAddLink.js +0 -104
  129. package/es/networkTopo/components/editor/propertyViews/edge/addLinkDrawer/index.module.scss +0 -12
  130. package/es/networkTopo/components/editor/propertyViews/edge/addLinkDrawer/mock.js +0 -55
  131. package/es/networkTopo/components/editor/propertyViews/edge/addLinkDrawer/server.js +0 -187
  132. package/es/networkTopo/event/index.js +0 -6
  133. package/lib/core/editor/components/plugins/MultipleResourceSelectPlugin.js +0 -25
  134. package/lib/core/editor/components/settings/propertyViews/edge/addEdgeProps.js +0 -19
  135. package/lib/networkTopo/components/editor/propertyViews/edge/addLinkDrawer/AddLinkDrawer.js +0 -661
  136. package/lib/networkTopo/components/editor/propertyViews/edge/addLinkDrawer/components/NetworkLinkForm.js +0 -12
  137. package/lib/networkTopo/components/editor/propertyViews/edge/addLinkDrawer/components/editLinkInfo.js +0 -486
  138. package/lib/networkTopo/components/editor/propertyViews/edge/addLinkDrawer/components/index.module.scss +0 -34
  139. package/lib/networkTopo/components/editor/propertyViews/edge/addLinkDrawer/hooks/useAddLink.js +0 -120
  140. package/lib/networkTopo/components/editor/propertyViews/edge/addLinkDrawer/index.module.scss +0 -12
  141. package/lib/networkTopo/components/editor/propertyViews/edge/addLinkDrawer/mock.js +0 -60
  142. package/lib/networkTopo/components/editor/propertyViews/edge/addLinkDrawer/server.js +0 -207
  143. package/lib/networkTopo/event/index.js +0 -11
@@ -52,33 +52,12 @@ var useTopoEdit = function useTopoEdit(params) {
52
52
  comboResData = _useState2[0],
53
53
  setComboResData = _useState2[1];
54
54
 
55
- var onEnterEdit = /*#__PURE__*/function () {
56
- var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
57
- return _regeneratorRuntime.wrap(function _callee$(_context) {
58
- while (1) {
59
- switch (_context.prev = _context.next) {
60
- case 0:
61
- case "end":
62
- return _context.stop();
63
- }
64
- }
65
- }, _callee);
66
- }));
67
-
68
- return function onEnterEdit() {
69
- return _ref.apply(this, arguments);
70
- };
71
- }();
72
-
73
- var onExitEdit = function onExitEdit() {// editDispatchers.switchToViewMode(topoId);
74
- };
75
-
76
55
  var reset = function reset() {
56
+ var _topo$historyManager;
57
+
77
58
  topoEditDispatchers.reset();
78
- topo.historyManager.destroy();
59
+ (_topo$historyManager = topo.historyManager) === null || _topo$historyManager === void 0 ? void 0 : _topo$historyManager.destroy();
79
60
  };
80
-
81
- var onBindData = function onBindData(eventData) {};
82
61
  /**
83
62
  * 增加资源到视图
84
63
  */
@@ -91,13 +70,13 @@ var useTopoEdit = function useTopoEdit(params) {
91
70
  };
92
71
 
93
72
  var onLayerAdded = /*#__PURE__*/function () {
94
- var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(_ref2) {
73
+ var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(_ref) {
95
74
  var target, direction, config;
96
- return _regeneratorRuntime.wrap(function _callee2$(_context2) {
75
+ return _regeneratorRuntime.wrap(function _callee$(_context) {
97
76
  while (1) {
98
- switch (_context2.prev = _context2.next) {
77
+ switch (_context.prev = _context.next) {
99
78
  case 0:
100
- target = _ref2.target, direction = _ref2.direction;
79
+ target = _ref.target, direction = _ref.direction;
101
80
  topo.historyManager.beginTransaction(); // 从拓扑图获取分层和资源配置
102
81
 
103
82
  config = resourceConfig.getConfigFromHt(topo.getDataModel());
@@ -106,11 +85,11 @@ var useTopoEdit = function useTopoEdit(params) {
106
85
  }); // 如果非分层拓扑且有分层,切换到分层模板,设置方向
107
86
 
108
87
  if (!(!isLayerTopo && config.layers.length)) {
109
- _context2.next = 7;
88
+ _context.next = 7;
110
89
  break;
111
90
  }
112
91
 
113
- _context2.next = 7;
92
+ _context.next = 7;
114
93
  return topoDispatchers.setTopoType(TPL_TREE);
115
94
 
116
95
  case 7:
@@ -122,23 +101,23 @@ var useTopoEdit = function useTopoEdit(params) {
122
101
 
123
102
  case 8:
124
103
  case "end":
125
- return _context2.stop();
104
+ return _context.stop();
126
105
  }
127
106
  }
128
- }, _callee2);
107
+ }, _callee);
129
108
  }));
130
109
 
131
110
  return function onLayerAdded(_x) {
132
- return _ref3.apply(this, arguments);
111
+ return _ref2.apply(this, arguments);
133
112
  };
134
113
  }();
135
114
 
136
115
  var deleteLayer = /*#__PURE__*/function () {
137
- var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3(layerElement) {
116
+ var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(layerElement) {
138
117
  var config;
139
- return _regeneratorRuntime.wrap(function _callee3$(_context3) {
118
+ return _regeneratorRuntime.wrap(function _callee2$(_context2) {
140
119
  while (1) {
141
- switch (_context3.prev = _context3.next) {
120
+ switch (_context2.prev = _context2.next) {
142
121
  case 0:
143
122
  topo.historyManager.beginTransaction();
144
123
  emitEvent(TopoEvent.EVENT_TRIGGER_DELETE, layerElement); // 获取资源配置
@@ -149,19 +128,19 @@ var useTopoEdit = function useTopoEdit(params) {
149
128
  }); // 如果没有分层,将拓扑类型切换为空白模板
150
129
 
151
130
  if (config.layers.length) {
152
- _context3.next = 7;
131
+ _context2.next = 7;
153
132
  break;
154
133
  }
155
134
 
156
- _context3.next = 7;
135
+ _context2.next = 7;
157
136
  return topoDispatchers.setTopoType(TPL_BLANK);
158
137
 
159
138
  case 7:
160
- _context3.next = 9;
139
+ _context2.next = 9;
161
140
  return resourceConfig.updateConfig(config);
162
141
 
163
142
  case 9:
164
- _context3.next = 11;
143
+ _context2.next = 11;
165
144
  return editDispatchers.fetchDataByConfig();
166
145
 
167
146
  case 11:
@@ -169,14 +148,14 @@ var useTopoEdit = function useTopoEdit(params) {
169
148
 
170
149
  case 12:
171
150
  case "end":
172
- return _context3.stop();
151
+ return _context2.stop();
173
152
  }
174
153
  }
175
- }, _callee3);
154
+ }, _callee2);
176
155
  }));
177
156
 
178
157
  return function deleteLayer(_x2) {
179
- return _ref4.apply(this, arguments);
158
+ return _ref3.apply(this, arguments);
180
159
  };
181
160
  }();
182
161
 
@@ -199,19 +178,19 @@ var useTopoEdit = function useTopoEdit(params) {
199
178
  type: "warning"
200
179
  },
201
180
  onOk: function () {
202
- var _onOk = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee4() {
203
- return _regeneratorRuntime.wrap(function _callee4$(_context4) {
181
+ var _onOk = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3() {
182
+ return _regeneratorRuntime.wrap(function _callee3$(_context3) {
204
183
  while (1) {
205
- switch (_context4.prev = _context4.next) {
184
+ switch (_context3.prev = _context3.next) {
206
185
  case 0:
207
186
  deleteLayer(layerElement);
208
187
 
209
188
  case 1:
210
189
  case "end":
211
- return _context4.stop();
190
+ return _context3.stop();
212
191
  }
213
192
  }
214
- }, _callee4);
193
+ }, _callee3);
215
194
  }));
216
195
 
217
196
  function onOk() {
@@ -257,19 +236,19 @@ var useTopoEdit = function useTopoEdit(params) {
257
236
  type: "warning"
258
237
  },
259
238
  onOk: function () {
260
- var _onOk2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee5() {
261
- return _regeneratorRuntime.wrap(function _callee5$(_context5) {
239
+ var _onOk2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee4() {
240
+ return _regeneratorRuntime.wrap(function _callee4$(_context4) {
262
241
  while (1) {
263
- switch (_context5.prev = _context5.next) {
242
+ switch (_context4.prev = _context4.next) {
264
243
  case 0:
265
244
  doDelete();
266
245
 
267
246
  case 1:
268
247
  case "end":
269
- return _context5.stop();
248
+ return _context4.stop();
270
249
  }
271
250
  }
272
- }, _callee5);
251
+ }, _callee4);
273
252
  }));
274
253
 
275
254
  function onOk() {
@@ -315,20 +294,20 @@ var useTopoEdit = function useTopoEdit(params) {
315
294
 
316
295
 
317
296
  var deleteExLink = /*#__PURE__*/function () {
318
- var _ref5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee6(node) {
297
+ var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee5(node) {
319
298
  var _node$getEdges$toArra, _node$getEdges;
320
299
 
321
300
  var config, edges, exportLinkIdList;
322
- return _regeneratorRuntime.wrap(function _callee6$(_context6) {
301
+ return _regeneratorRuntime.wrap(function _callee5$(_context5) {
323
302
  while (1) {
324
- switch (_context6.prev = _context6.next) {
303
+ switch (_context5.prev = _context5.next) {
325
304
  case 0:
326
305
  config = resourceConfig.getConfig(); // console.log("删除关联在节点上的出口链路- node, config", node, config);
327
306
 
328
307
  edges = (_node$getEdges$toArra = (_node$getEdges = node.getEdges()) === null || _node$getEdges === void 0 ? void 0 : _node$getEdges.toArray()) !== null && _node$getEdges$toArra !== void 0 ? _node$getEdges$toArra : []; // const exLink = [];
329
308
 
330
309
  if (!(edges.length > 0)) {
331
- _context6.next = 8;
310
+ _context5.next = 8;
332
311
  break;
333
312
  }
334
313
 
@@ -342,19 +321,19 @@ var useTopoEdit = function useTopoEdit(params) {
342
321
  }
343
322
  });
344
323
  config.exportLinkIdList = exportLinkIdList;
345
- _context6.next = 8;
324
+ _context5.next = 8;
346
325
  return resourceConfig.updateConfig(config);
347
326
 
348
327
  case 8:
349
328
  case "end":
350
- return _context6.stop();
329
+ return _context5.stop();
351
330
  }
352
331
  }
353
- }, _callee6);
332
+ }, _callee5);
354
333
  }));
355
334
 
356
335
  return function deleteExLink(_x3) {
357
- return _ref5.apply(this, arguments);
336
+ return _ref4.apply(this, arguments);
358
337
  };
359
338
  }();
360
339
 
@@ -435,25 +414,25 @@ var useTopoEdit = function useTopoEdit(params) {
435
414
  }
436
415
 
437
416
  function _bindGroupResources() {
438
- _bindGroupResources = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee12(group, resources) {
417
+ _bindGroupResources = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee11(group, resources) {
439
418
  var id, tag, _yield$editDispatcher2, elements, nodeElements, newLinkElements, updateElements;
440
419
 
441
- return _regeneratorRuntime.wrap(function _callee12$(_context12) {
420
+ return _regeneratorRuntime.wrap(function _callee11$(_context11) {
442
421
  while (1) {
443
- switch (_context12.prev = _context12.next) {
422
+ switch (_context11.prev = _context11.next) {
444
423
  case 0:
445
424
  id = group.id, tag = group.tag;
446
425
  rlog.debug("bindGroupResources--id, tag", id, tag);
447
426
  topo.historyManager.beginTransaction();
448
- _context12.next = 5;
427
+ _context11.next = 5;
449
428
  return resourceConfig.updateGroupResources(group, resources);
450
429
 
451
430
  case 5:
452
- _context12.next = 7;
431
+ _context11.next = 7;
453
432
  return editDispatchers.fetchDataByConfig();
454
433
 
455
434
  case 7:
456
- _yield$editDispatcher2 = _context12.sent;
435
+ _yield$editDispatcher2 = _context11.sent;
457
436
  elements = _yield$editDispatcher2.elements;
458
437
  // 区域里的子区域及子区域的节点、新增的链路
459
438
  nodeElements = findGroupChildren(elements, group);
@@ -472,10 +451,10 @@ var useTopoEdit = function useTopoEdit(params) {
472
451
 
473
452
  case 14:
474
453
  case "end":
475
- return _context12.stop();
454
+ return _context11.stop();
476
455
  }
477
456
  }
478
- }, _callee12);
457
+ }, _callee11);
479
458
  }));
480
459
  return _bindGroupResources.apply(this, arguments);
481
460
  }
@@ -489,11 +468,11 @@ var useTopoEdit = function useTopoEdit(params) {
489
468
 
490
469
 
491
470
  function _addGroupResources() {
492
- _addGroupResources = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee13(group, newResourceIds) {
471
+ _addGroupResources = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee12(group, newResourceIds) {
493
472
  var groupConfig, resources, groupData;
494
- return _regeneratorRuntime.wrap(function _callee13$(_context13) {
473
+ return _regeneratorRuntime.wrap(function _callee12$(_context12) {
495
474
  while (1) {
496
- switch (_context13.prev = _context13.next) {
475
+ switch (_context12.prev = _context12.next) {
497
476
  case 0:
498
477
  groupConfig = resourceConfig.getGroupConfigByElement(group);
499
478
  resources = {
@@ -503,15 +482,15 @@ var useTopoEdit = function useTopoEdit(params) {
503
482
  id: group.getTag(),
504
483
  tag: group.a("tag")
505
484
  };
506
- _context13.next = 5;
485
+ _context12.next = 5;
507
486
  return bindGroupResources(groupData, resources, newResourceIds);
508
487
 
509
488
  case 5:
510
489
  case "end":
511
- return _context13.stop();
490
+ return _context12.stop();
512
491
  }
513
492
  }
514
- }, _callee13);
493
+ }, _callee12);
515
494
  }));
516
495
  return _addGroupResources.apply(this, arguments);
517
496
  }
@@ -528,25 +507,25 @@ var useTopoEdit = function useTopoEdit(params) {
528
507
 
529
508
 
530
509
  function _bindViewResources() {
531
- _bindViewResources = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee14(data) {
510
+ _bindViewResources = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee13(data) {
532
511
  var config, _yield$editDispatcher3, elements;
533
512
 
534
- return _regeneratorRuntime.wrap(function _callee14$(_context14) {
513
+ return _regeneratorRuntime.wrap(function _callee13$(_context13) {
535
514
  while (1) {
536
- switch (_context14.prev = _context14.next) {
515
+ switch (_context13.prev = _context13.next) {
537
516
  case 0:
538
517
  // console.log("关联视图的资源", data);
539
518
  config = resourceConfig.getConfig();
540
519
  config.resources = data;
541
- _context14.next = 4;
520
+ _context13.next = 4;
542
521
  return resourceConfig.updateConfig(config);
543
522
 
544
523
  case 4:
545
- _context14.next = 6;
524
+ _context13.next = 6;
546
525
  return editDispatchers.fetchDataByConfig();
547
526
 
548
527
  case 6:
549
- _yield$editDispatcher3 = _context14.sent;
528
+ _yield$editDispatcher3 = _context13.sent;
550
529
  elements = _yield$editDispatcher3.elements;
551
530
  saveBind(TopoEvent.DATA_TYPE_RESOURCE_COMBO, elements); // 临时放这里,仅拓扑中心有
552
531
 
@@ -556,10 +535,10 @@ var useTopoEdit = function useTopoEdit(params) {
556
535
 
557
536
  case 10:
558
537
  case "end":
559
- return _context14.stop();
538
+ return _context13.stop();
560
539
  }
561
540
  }
562
- }, _callee14);
541
+ }, _callee13);
563
542
  }));
564
543
  return _bindViewResources.apply(this, arguments);
565
544
  }
@@ -569,24 +548,24 @@ var useTopoEdit = function useTopoEdit(params) {
569
548
  }
570
549
 
571
550
  function _addLayerResources() {
572
- _addLayerResources = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee15(group, newResourceIds) {
551
+ _addLayerResources = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee14(group, newResourceIds) {
573
552
  var _yield$editDispatcher4, elements, newElements;
574
553
 
575
- return _regeneratorRuntime.wrap(function _callee15$(_context15) {
554
+ return _regeneratorRuntime.wrap(function _callee14$(_context14) {
576
555
  while (1) {
577
- switch (_context15.prev = _context15.next) {
556
+ switch (_context14.prev = _context14.next) {
578
557
  case 0:
579
558
  topo.historyManager.beginTransaction(); // 构造新的配置
580
559
 
581
- _context15.next = 3;
560
+ _context14.next = 3;
582
561
  return resourceConfig.addLayerStaticResources(group, newResourceIds);
583
562
 
584
563
  case 3:
585
- _context15.next = 5;
564
+ _context14.next = 5;
586
565
  return editDispatchers.fetchDataByConfig();
587
566
 
588
567
  case 5:
589
- _yield$editDispatcher4 = _context15.sent;
568
+ _yield$editDispatcher4 = _context14.sent;
590
569
  elements = _yield$editDispatcher4.elements;
591
570
  // 2022-11-10 修复 添加资源后分层重新布局问题,仅布局新增资源。替换api topo.updateElements(data)
592
571
  newElements = findUNExistedElements(elements);
@@ -609,10 +588,10 @@ var useTopoEdit = function useTopoEdit(params) {
609
588
 
610
589
  case 14:
611
590
  case "end":
612
- return _context15.stop();
591
+ return _context14.stop();
613
592
  }
614
593
  }
615
- }, _callee15);
594
+ }, _callee14);
616
595
  }));
617
596
  return _addLayerResources.apply(this, arguments);
618
597
  }
@@ -622,22 +601,22 @@ var useTopoEdit = function useTopoEdit(params) {
622
601
  }
623
602
 
624
603
  function _addResourceToFirstLayer() {
625
- _addResourceToFirstLayer = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee16(data) {
604
+ _addResourceToFirstLayer = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee15(data) {
626
605
  var group;
627
- return _regeneratorRuntime.wrap(function _callee16$(_context16) {
606
+ return _regeneratorRuntime.wrap(function _callee15$(_context15) {
628
607
  while (1) {
629
- switch (_context16.prev = _context16.next) {
608
+ switch (_context15.prev = _context15.next) {
630
609
  case 0:
631
610
  group = resourceConfig.getGroups()[0];
632
- _context16.next = 3;
611
+ _context15.next = 3;
633
612
  return addLayerResources(group, data);
634
613
 
635
614
  case 3:
636
615
  case "end":
637
- return _context16.stop();
616
+ return _context15.stop();
638
617
  }
639
618
  }
640
- }, _callee16);
619
+ }, _callee15);
641
620
  }));
642
621
  return _addResourceToFirstLayer.apply(this, arguments);
643
622
  }
@@ -669,28 +648,28 @@ var useTopoEdit = function useTopoEdit(params) {
669
648
 
670
649
 
671
650
  var onSaveComboRes = /*#__PURE__*/function () {
672
- var _ref6 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee7(data) {
673
- return _regeneratorRuntime.wrap(function _callee7$(_context7) {
651
+ var _ref5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee6(data) {
652
+ return _regeneratorRuntime.wrap(function _callee6$(_context6) {
674
653
  while (1) {
675
- switch (_context7.prev = _context7.next) {
654
+ switch (_context6.prev = _context6.next) {
676
655
  case 0:
677
656
  rlog.debug("关联资源-----onSaveComboRes", data);
678
657
  topo.historyManager.beginTransaction();
679
658
 
680
659
  if (!(getAddResourceType() === "addToFirstLayer")) {
681
- _context7.next = 7;
660
+ _context6.next = 7;
682
661
  break;
683
662
  }
684
663
 
685
- _context7.next = 5;
664
+ _context6.next = 5;
686
665
  return addResourceToFirstLayer(data);
687
666
 
688
667
  case 5:
689
- _context7.next = 9;
668
+ _context6.next = 9;
690
669
  break;
691
670
 
692
671
  case 7:
693
- _context7.next = 9;
672
+ _context6.next = 9;
694
673
  return bindViewResources(data);
695
674
 
696
675
  case 9:
@@ -702,14 +681,14 @@ var useTopoEdit = function useTopoEdit(params) {
702
681
 
703
682
  case 12:
704
683
  case "end":
705
- return _context7.stop();
684
+ return _context6.stop();
706
685
  }
707
686
  }
708
- }, _callee7);
687
+ }, _callee6);
709
688
  }));
710
689
 
711
690
  return function onSaveComboRes(_x12) {
712
- return _ref6.apply(this, arguments);
691
+ return _ref5.apply(this, arguments);
713
692
  };
714
693
  }();
715
694
 
@@ -718,27 +697,27 @@ var useTopoEdit = function useTopoEdit(params) {
718
697
  }
719
698
 
720
699
  function _checkSavePermission() {
721
- _checkSavePermission = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee17(id) {
700
+ _checkSavePermission = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee16(id) {
722
701
  var permission;
723
- return _regeneratorRuntime.wrap(function _callee17$(_context17) {
702
+ return _regeneratorRuntime.wrap(function _callee16$(_context16) {
724
703
  while (1) {
725
- switch (_context17.prev = _context17.next) {
704
+ switch (_context16.prev = _context16.next) {
726
705
  case 0:
727
- _context17.next = 2;
706
+ _context16.next = 2;
728
707
  return topoDispatchers.getTopoPermission({
729
708
  id: id,
730
709
  update: false
731
710
  });
732
711
 
733
712
  case 2:
734
- permission = _context17.sent;
713
+ permission = _context16.sent;
735
714
 
736
715
  if (!topoPermissonUtil.isEditable(permission)) {
737
- _context17.next = 5;
716
+ _context16.next = 5;
738
717
  break;
739
718
  }
740
719
 
741
- return _context17.abrupt("return", true);
720
+ return _context16.abrupt("return", true);
742
721
 
743
722
  case 5:
744
723
  _Dialog.alert({
@@ -750,42 +729,42 @@ var useTopoEdit = function useTopoEdit(params) {
750
729
  onOk: function onOk() {}
751
730
  });
752
731
 
753
- return _context17.abrupt("return", false);
732
+ return _context16.abrupt("return", false);
754
733
 
755
734
  case 7:
756
735
  case "end":
757
- return _context17.stop();
736
+ return _context16.stop();
758
737
  }
759
738
  }
760
- }, _callee17);
739
+ }, _callee16);
761
740
  }));
762
741
  return _checkSavePermission.apply(this, arguments);
763
742
  }
764
743
 
765
744
  var onSaveTopo = /*#__PURE__*/function () {
766
- var _ref7 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee9(data) {
745
+ var _ref6 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee8(data) {
767
746
  var id, config, serialize, _config$layout, template, layout, saveConfig, valid, saveData;
768
747
 
769
- return _regeneratorRuntime.wrap(function _callee9$(_context9) {
748
+ return _regeneratorRuntime.wrap(function _callee8$(_context8) {
770
749
  while (1) {
771
- switch (_context9.prev = _context9.next) {
750
+ switch (_context8.prev = _context8.next) {
772
751
  case 0:
773
752
  id = data.id, config = data.config, serialize = data.serialize;
774
753
  _config$layout = config === null || config === void 0 ? void 0 : config.layout, template = _config$layout.type, layout = _config$layout.layout;
775
754
 
776
755
  if (!onSave) {
777
- _context9.next = 6;
756
+ _context8.next = 6;
778
757
  break;
779
758
  }
780
759
 
781
760
  // 自定义保存
782
761
  saveConfig = /*#__PURE__*/function () {
783
- var _ref8 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee8() {
784
- return _regeneratorRuntime.wrap(function _callee8$(_context8) {
762
+ var _ref7 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee7() {
763
+ return _regeneratorRuntime.wrap(function _callee7$(_context7) {
785
764
  while (1) {
786
- switch (_context8.prev = _context8.next) {
765
+ switch (_context7.prev = _context7.next) {
787
766
  case 0:
788
- _context8.next = 2;
767
+ _context7.next = 2;
789
768
  return editDispatchers.saveTopo({
790
769
  id: id,
791
770
  layout: layout,
@@ -794,14 +773,14 @@ var useTopoEdit = function useTopoEdit(params) {
794
773
 
795
774
  case 2:
796
775
  case "end":
797
- return _context8.stop();
776
+ return _context7.stop();
798
777
  }
799
778
  }
800
- }, _callee8);
779
+ }, _callee7);
801
780
  }));
802
781
 
803
782
  return function saveConfig() {
804
- return _ref8.apply(this, arguments);
783
+ return _ref7.apply(this, arguments);
805
784
  };
806
785
  }();
807
786
 
@@ -809,7 +788,7 @@ var useTopoEdit = function useTopoEdit(params) {
809
788
  data: data,
810
789
  saveConfig: saveConfig
811
790
  });
812
- return _context9.abrupt("return");
791
+ return _context8.abrupt("return");
813
792
 
814
793
  case 6:
815
794
  // TODO 以下逻辑移到拓扑中心
@@ -817,21 +796,21 @@ var useTopoEdit = function useTopoEdit(params) {
817
796
  saving: true
818
797
  }); // 检查权限
819
798
 
820
- _context9.next = 9;
799
+ _context8.next = 9;
821
800
  return checkSavePermission(id);
822
801
 
823
802
  case 9:
824
- valid = _context9.sent;
803
+ valid = _context8.sent;
825
804
 
826
805
  if (valid) {
827
- _context9.next = 13;
806
+ _context8.next = 13;
828
807
  break;
829
808
  }
830
809
 
831
810
  topoEditDispatchers.update({
832
811
  saving: false
833
812
  });
834
- return _context9.abrupt("return");
813
+ return _context8.abrupt("return");
835
814
 
836
815
  case 13:
837
816
  // 保存
@@ -841,7 +820,7 @@ var useTopoEdit = function useTopoEdit(params) {
841
820
  serialize: serialize
842
821
  }, resourceConfig.getConfig());
843
822
  rlog.info("保存", saveData);
844
- _context9.next = 17;
823
+ _context8.next = 17;
845
824
  return editDispatchers.saveTopo(saveData);
846
825
 
847
826
  case 17:
@@ -853,14 +832,14 @@ var useTopoEdit = function useTopoEdit(params) {
853
832
 
854
833
  case 19:
855
834
  case "end":
856
- return _context9.stop();
835
+ return _context8.stop();
857
836
  }
858
837
  }
859
- }, _callee9);
838
+ }, _callee8);
860
839
  }));
861
840
 
862
841
  return function onSaveTopo(_x14) {
863
- return _ref7.apply(this, arguments);
842
+ return _ref6.apply(this, arguments);
864
843
  };
865
844
  }();
866
845
 
@@ -886,12 +865,12 @@ var useTopoEdit = function useTopoEdit(params) {
886
865
 
887
866
 
888
867
  var bindNodeResource = /*#__PURE__*/function () {
889
- var _ref9 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee11(params) {
868
+ var _ref8 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee10(params) {
890
869
  var id, oldResId, newResId, node, parentGroupElement, htTopo, config, groupId, groupTag, _yield$editDispatcher, elements, newData, doBind, _doBind, replaceOrAddRes;
891
870
 
892
- return _regeneratorRuntime.wrap(function _callee11$(_context11) {
871
+ return _regeneratorRuntime.wrap(function _callee10$(_context10) {
893
872
  while (1) {
894
- switch (_context11.prev = _context11.next) {
873
+ switch (_context10.prev = _context10.next) {
895
874
  case 0:
896
875
  replaceOrAddRes = function _replaceOrAddRes(resources, oldResId, newResId) {
897
876
  return _extends({}, resources, {
@@ -902,11 +881,11 @@ var useTopoEdit = function useTopoEdit(params) {
902
881
  };
903
882
 
904
883
  _doBind = function _doBind3() {
905
- _doBind = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee10() {
884
+ _doBind = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee9() {
906
885
  var dm, newLinkElements, createElementsData, groupChildren, newGroupChildren, existedGroupChildren, groupElement, newElement, sm;
907
- return _regeneratorRuntime.wrap(function _callee10$(_context10) {
886
+ return _regeneratorRuntime.wrap(function _callee9$(_context9) {
908
887
  while (1) {
909
- switch (_context10.prev = _context10.next) {
888
+ switch (_context9.prev = _context9.next) {
910
889
  case 0:
911
890
  dm = htTopo.getGraphView().dm(); // 创建
912
891
 
@@ -975,7 +954,7 @@ var useTopoEdit = function useTopoEdit(params) {
975
954
  // node.a("customName", null);
976
955
  // 删除关联在节点上的出口链路
977
956
 
978
- _context10.next = 12;
957
+ _context9.next = 12;
979
958
  return deleteExLink(node);
980
959
 
981
960
  case 12:
@@ -986,10 +965,10 @@ var useTopoEdit = function useTopoEdit(params) {
986
965
 
987
966
  case 13:
988
967
  case "end":
989
- return _context10.stop();
968
+ return _context9.stop();
990
969
  }
991
970
  }
992
- }, _callee10);
971
+ }, _callee9);
993
972
  }));
994
973
  return _doBind.apply(this, arguments);
995
974
  };
@@ -1029,22 +1008,22 @@ var useTopoEdit = function useTopoEdit(params) {
1029
1008
  config.resources = replaceOrAddRes(config.resources, oldResId, newResId);
1030
1009
  }
1031
1010
 
1032
- _context11.next = 13;
1011
+ _context10.next = 13;
1033
1012
  return resourceConfig.updateConfig(config);
1034
1013
 
1035
1014
  case 13:
1036
- _context11.next = 15;
1015
+ _context10.next = 15;
1037
1016
  return editDispatchers.fetchDataByConfig();
1038
1017
 
1039
1018
  case 15:
1040
- _yield$editDispatcher = _context11.sent;
1019
+ _yield$editDispatcher = _context10.sent;
1041
1020
  elements = _yield$editDispatcher.elements;
1042
1021
  newData = elements.find(function (item) {
1043
1022
  return item.id === newResId;
1044
1023
  });
1045
1024
 
1046
1025
  if (newData) {
1047
- _context11.next = 23;
1026
+ _context10.next = 23;
1048
1027
  break;
1049
1028
  }
1050
1029
 
@@ -1052,10 +1031,10 @@ var useTopoEdit = function useTopoEdit(params) {
1052
1031
 
1053
1032
  rlog.warn("关联资源失败");
1054
1033
  topo.historyManager.endTransaction();
1055
- return _context11.abrupt("return", false);
1034
+ return _context10.abrupt("return", false);
1056
1035
 
1057
1036
  case 23:
1058
- _context11.next = 25;
1037
+ _context10.next = 25;
1059
1038
  return doBind();
1060
1039
 
1061
1040
  case 25:
@@ -1063,14 +1042,14 @@ var useTopoEdit = function useTopoEdit(params) {
1063
1042
 
1064
1043
  case 26:
1065
1044
  case "end":
1066
- return _context11.stop();
1045
+ return _context10.stop();
1067
1046
  }
1068
1047
  }
1069
- }, _callee11);
1048
+ }, _callee10);
1070
1049
  }));
1071
1050
 
1072
1051
  return function bindNodeResource(_x15) {
1073
- return _ref9.apply(this, arguments);
1052
+ return _ref8.apply(this, arguments);
1074
1053
  };
1075
1054
  }();
1076
1055
 
@@ -1126,24 +1105,9 @@ var useTopoEdit = function useTopoEdit(params) {
1126
1105
  */
1127
1106
  getAllNodeResourceIds: resourceConfig.getAllNodeResourceIds,
1128
1107
  onEvent: onEvent,
1129
-
1130
- /**
1131
- * 进入编辑模式回调
1132
- */
1133
- onEnterEdit: onEnterEdit,
1134
-
1135
- /**
1136
- * 退出编辑模式回调
1137
- */
1138
- onExitEdit: onExitEdit,
1139
1108
  reset: reset,
1140
1109
  addLayerResources: addLayerResources,
1141
1110
 
1142
- /**
1143
- * 发起业务数据(资源、链路)绑定回调
1144
- */
1145
- onBindData: onBindData,
1146
-
1147
1111
  /**
1148
1112
  * 显示全局添加资源抽屉
1149
1113
  */