@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.
- package/build/1.js +2 -2
- package/build/2.js +1 -1
- package/build/index.css +1 -1
- package/build/index.js +31 -31
- package/es/core/components/TopoView/topoView.js +2 -19
- package/es/core/components/titlebar/index.js +2 -1
- package/es/core/editor/components/EditorPlugin.js +1 -2
- package/es/core/editor/components/Toolbar/buttons.js +2 -2
- package/es/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/elements/edgeTag.js +11 -3
- package/es/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/elements/nodeTag.js +6 -1
- package/es/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/textStyleUtil.js +5 -0
- package/es/core/editor/components/settings/PropertyView.js +11 -10
- package/es/core/editor/components/settings/Settings.js +8 -1
- package/es/core/editor/components/settings/core/PropertyViewManager.js +4 -3
- package/es/core/editor/components/settings/core/edgePropertyViewAdapter.js +1 -7
- package/es/core/editor/components/settings/propertyViews/node/data/Data.js +6 -3
- package/es/core/editor/components/settings/propertyViews/node/data/NodeRelateResourceButton.js +4 -2
- package/es/core/editor/components/settings/propertyViews/node/data/PlatformDisplay.js +10 -0
- package/es/core/editor/hooks/useKeyboardShortcut.js +1 -1
- package/es/core/hooks/usePolling.js +1 -6
- package/es/core/hooks/useTopoEdit.js +134 -170
- package/es/core/models/Alarm.js +12 -24
- package/es/core/models/TopoApp.js +1 -1
- package/es/core/models/topoData.js +3 -3
- package/es/core/models/utils/linkUtils.js +0 -3
- package/es/core/store/models/topoConfig.js +7 -5
- package/es/core/store/models/topoMod.js +8 -7
- package/es/core/utils/saveSerialize.js +2 -3
- package/es/core/viewer/components/plugins/ResourceDetail/ResourceDetailDrawer.js +13 -2
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/EventsCard.js +28 -25
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/ResourceOverview.js +4 -0
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/Configurator/index.js +17 -17
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/index.module.scss +1 -0
- package/es/core/viewer/components/titlebar/BasicTools.js +3 -16
- package/es/core/viewer/components/titlebar/widgets/AlarmButton.js +25 -0
- package/es/networkTopo/components/editor/propertyViews/edge/LinkPropertyView/Data/index.js +8 -2
- package/es/networkTopo/components/editor/propertyViews/edge/LinkPropertyView/LinkPropertyView.js +7 -9
- package/es/networkTopo/components/editor/propertyViews/edge/link/LinkInfoPreview.js +42 -16
- package/es/networkTopo/components/editor/useEditorProps.js +4 -5
- package/es/networkTopo/getTopoData.js +18 -30
- package/es/networkTopo/hooks/editor/useDeleteEdges.js +6 -3
- package/es/networkTopo/services/alert.js +55 -0
- package/es/networkTopo/services/authorization.js +135 -0
- package/es/networkTopo/services/cmdb.js +897 -0
- package/es/networkTopo/services/index.js +2 -26
- package/es/networkTopo/services/mdc.js +74 -0
- package/es/networkTopo/services/metric.js +68 -0
- package/es/networkTopo/services/model.js +1283 -0
- package/es/networkTopo/services/risk.js +29 -0
- package/es/networkTopo/services/topo/auth.js +67 -0
- package/es/networkTopo/services/topo/basic.js +727 -0
- package/es/networkTopo/services/topo/blacklist.js +60 -0
- package/es/networkTopo/services/topo/ciInfo.js +69 -0
- package/es/networkTopo/services/topo/constants.js +1 -0
- package/es/networkTopo/services/topo/icon.js +131 -0
- package/es/networkTopo/services/topo/index.js +18 -0
- package/es/networkTopo/services/topo/networkLink.js +33 -0
- package/es/networkTopo/services/topo/relation.js +27 -0
- package/es/networkTopo/services/topo/resourceWebUrl.js +84 -0
- package/es/networkTopo/utils/storage.js +38 -0
- package/es/style.js +21 -21
- package/es/utils/tree.js +1 -0
- package/lib/core/components/TopoView/topoView.js +2 -20
- package/lib/core/components/titlebar/index.js +5 -1
- package/lib/core/editor/components/EditorPlugin.js +1 -3
- package/lib/core/editor/components/Toolbar/buttons.js +2 -2
- package/lib/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/elements/edgeTag.js +11 -4
- package/lib/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/elements/nodeTag.js +6 -1
- package/lib/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/textStyleUtil.js +5 -0
- package/lib/core/editor/components/settings/PropertyView.js +10 -10
- package/lib/core/editor/components/settings/Settings.js +9 -1
- package/lib/core/editor/components/settings/core/PropertyViewManager.js +4 -3
- package/lib/core/editor/components/settings/core/edgePropertyViewAdapter.js +1 -10
- package/lib/core/editor/components/settings/propertyViews/node/data/Data.js +7 -4
- package/lib/core/editor/components/settings/propertyViews/node/data/NodeRelateResourceButton.js +4 -2
- package/lib/core/editor/components/settings/propertyViews/node/data/PlatformDisplay.js +18 -0
- package/lib/core/editor/hooks/useKeyboardShortcut.js +1 -1
- package/lib/core/hooks/usePolling.js +1 -6
- package/lib/core/hooks/useTopoEdit.js +134 -170
- package/lib/core/models/Alarm.js +12 -24
- package/lib/core/models/TopoApp.js +1 -1
- package/lib/core/models/topoData.js +7 -11
- package/lib/core/models/utils/linkUtils.js +0 -5
- package/lib/core/store/models/topoConfig.js +7 -5
- package/lib/core/store/models/topoMod.js +10 -7
- package/lib/core/utils/saveSerialize.js +1 -3
- package/lib/core/viewer/components/plugins/ResourceDetail/ResourceDetailDrawer.js +13 -2
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/EventsCard.js +28 -26
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/ResourceOverview.js +4 -0
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/Configurator/index.js +17 -17
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/index.module.scss +1 -0
- package/lib/core/viewer/components/titlebar/BasicTools.js +3 -17
- package/lib/core/viewer/components/titlebar/widgets/AlarmButton.js +36 -0
- package/lib/networkTopo/components/editor/propertyViews/edge/LinkPropertyView/Data/index.js +8 -2
- package/lib/networkTopo/components/editor/propertyViews/edge/LinkPropertyView/LinkPropertyView.js +7 -9
- package/lib/networkTopo/components/editor/propertyViews/edge/link/LinkInfoPreview.js +42 -16
- package/lib/networkTopo/components/editor/useEditorProps.js +4 -6
- package/lib/networkTopo/getTopoData.js +19 -33
- package/lib/networkTopo/hooks/editor/useDeleteEdges.js +6 -4
- package/lib/networkTopo/services/alert.js +66 -0
- package/lib/networkTopo/services/authorization.js +145 -0
- package/lib/networkTopo/services/cmdb.js +977 -0
- package/lib/networkTopo/services/index.js +3 -29
- package/lib/networkTopo/services/mdc.js +91 -0
- package/lib/networkTopo/services/metric.js +82 -0
- package/lib/networkTopo/services/model.js +1387 -0
- package/lib/networkTopo/services/risk.js +40 -0
- package/lib/networkTopo/services/topo/auth.js +79 -0
- package/lib/networkTopo/services/topo/basic.js +753 -0
- package/lib/networkTopo/services/topo/blacklist.js +72 -0
- package/lib/networkTopo/services/topo/ciInfo.js +82 -0
- package/lib/networkTopo/services/topo/constants.js +6 -0
- package/lib/networkTopo/services/topo/icon.js +144 -0
- package/lib/networkTopo/services/topo/index.js +42 -0
- package/lib/networkTopo/services/topo/networkLink.js +45 -0
- package/lib/networkTopo/services/topo/relation.js +39 -0
- package/lib/networkTopo/services/topo/resourceWebUrl.js +95 -0
- package/lib/networkTopo/utils/storage.js +46 -0
- package/lib/style.js +21 -21
- package/lib/utils/tree.js +1 -0
- package/package.json +3 -3
- package/es/core/editor/components/plugins/MultipleResourceSelectPlugin.js +0 -15
- package/es/core/editor/components/settings/propertyViews/edge/addEdgeProps.js +0 -10
- package/es/networkTopo/components/editor/propertyViews/edge/addLinkDrawer/AddLinkDrawer.js +0 -630
- package/es/networkTopo/components/editor/propertyViews/edge/addLinkDrawer/components/NetworkLinkForm.js +0 -4
- package/es/networkTopo/components/editor/propertyViews/edge/addLinkDrawer/components/editLinkInfo.js +0 -458
- package/es/networkTopo/components/editor/propertyViews/edge/addLinkDrawer/components/index.module.scss +0 -34
- package/es/networkTopo/components/editor/propertyViews/edge/addLinkDrawer/hooks/useAddLink.js +0 -104
- package/es/networkTopo/components/editor/propertyViews/edge/addLinkDrawer/index.module.scss +0 -12
- package/es/networkTopo/components/editor/propertyViews/edge/addLinkDrawer/mock.js +0 -55
- package/es/networkTopo/components/editor/propertyViews/edge/addLinkDrawer/server.js +0 -187
- package/es/networkTopo/event/index.js +0 -6
- package/lib/core/editor/components/plugins/MultipleResourceSelectPlugin.js +0 -25
- package/lib/core/editor/components/settings/propertyViews/edge/addEdgeProps.js +0 -19
- package/lib/networkTopo/components/editor/propertyViews/edge/addLinkDrawer/AddLinkDrawer.js +0 -661
- package/lib/networkTopo/components/editor/propertyViews/edge/addLinkDrawer/components/NetworkLinkForm.js +0 -12
- package/lib/networkTopo/components/editor/propertyViews/edge/addLinkDrawer/components/editLinkInfo.js +0 -486
- package/lib/networkTopo/components/editor/propertyViews/edge/addLinkDrawer/components/index.module.scss +0 -34
- package/lib/networkTopo/components/editor/propertyViews/edge/addLinkDrawer/hooks/useAddLink.js +0 -120
- package/lib/networkTopo/components/editor/propertyViews/edge/addLinkDrawer/index.module.scss +0 -12
- package/lib/networkTopo/components/editor/propertyViews/edge/addLinkDrawer/mock.js +0 -60
- package/lib/networkTopo/components/editor/propertyViews/edge/addLinkDrawer/server.js +0 -207
- package/lib/networkTopo/event/index.js +0 -11
@@ -74,33 +74,12 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
74
74
|
comboResData = _useState2[0],
|
75
75
|
setComboResData = _useState2[1];
|
76
76
|
|
77
|
-
var onEnterEdit = /*#__PURE__*/function () {
|
78
|
-
var _ref = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee() {
|
79
|
-
return _regenerator["default"].wrap(function _callee$(_context) {
|
80
|
-
while (1) {
|
81
|
-
switch (_context.prev = _context.next) {
|
82
|
-
case 0:
|
83
|
-
case "end":
|
84
|
-
return _context.stop();
|
85
|
-
}
|
86
|
-
}
|
87
|
-
}, _callee);
|
88
|
-
}));
|
89
|
-
|
90
|
-
return function onEnterEdit() {
|
91
|
-
return _ref.apply(this, arguments);
|
92
|
-
};
|
93
|
-
}();
|
94
|
-
|
95
|
-
var onExitEdit = function onExitEdit() {// editDispatchers.switchToViewMode(topoId);
|
96
|
-
};
|
97
|
-
|
98
77
|
var reset = function reset() {
|
78
|
+
var _topo$historyManager;
|
79
|
+
|
99
80
|
topoEditDispatchers.reset();
|
100
|
-
topo.historyManager.destroy();
|
81
|
+
(_topo$historyManager = topo.historyManager) === null || _topo$historyManager === void 0 ? void 0 : _topo$historyManager.destroy();
|
101
82
|
};
|
102
|
-
|
103
|
-
var onBindData = function onBindData(eventData) {};
|
104
83
|
/**
|
105
84
|
* 增加资源到视图
|
106
85
|
*/
|
@@ -114,13 +93,13 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
114
93
|
};
|
115
94
|
|
116
95
|
var onLayerAdded = /*#__PURE__*/function () {
|
117
|
-
var
|
96
|
+
var _ref2 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee(_ref) {
|
118
97
|
var target, direction, config;
|
119
|
-
return _regenerator["default"].wrap(function
|
98
|
+
return _regenerator["default"].wrap(function _callee$(_context) {
|
120
99
|
while (1) {
|
121
|
-
switch (
|
100
|
+
switch (_context.prev = _context.next) {
|
122
101
|
case 0:
|
123
|
-
target =
|
102
|
+
target = _ref.target, direction = _ref.direction;
|
124
103
|
topo.historyManager.beginTransaction(); // 从拓扑图获取分层和资源配置
|
125
104
|
|
126
105
|
config = resourceConfig.getConfigFromHt(topo.getDataModel());
|
@@ -131,11 +110,11 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
131
110
|
|
132
111
|
|
133
112
|
if (!(!isLayerTopo && config.layers.length)) {
|
134
|
-
|
113
|
+
_context.next = 7;
|
135
114
|
break;
|
136
115
|
}
|
137
116
|
|
138
|
-
|
117
|
+
_context.next = 7;
|
139
118
|
return topoDispatchers.setTopoType(_template.TPL_TREE);
|
140
119
|
|
141
120
|
case 7:
|
@@ -147,23 +126,23 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
147
126
|
|
148
127
|
case 8:
|
149
128
|
case "end":
|
150
|
-
return
|
129
|
+
return _context.stop();
|
151
130
|
}
|
152
131
|
}
|
153
|
-
},
|
132
|
+
}, _callee);
|
154
133
|
}));
|
155
134
|
|
156
135
|
return function onLayerAdded(_x) {
|
157
|
-
return
|
136
|
+
return _ref2.apply(this, arguments);
|
158
137
|
};
|
159
138
|
}();
|
160
139
|
|
161
140
|
var deleteLayer = /*#__PURE__*/function () {
|
162
|
-
var
|
141
|
+
var _ref3 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee2(layerElement) {
|
163
142
|
var config;
|
164
|
-
return _regenerator["default"].wrap(function
|
143
|
+
return _regenerator["default"].wrap(function _callee2$(_context2) {
|
165
144
|
while (1) {
|
166
|
-
switch (
|
145
|
+
switch (_context2.prev = _context2.next) {
|
167
146
|
case 0:
|
168
147
|
topo.historyManager.beginTransaction();
|
169
148
|
emitEvent(_componentTopologyGraph.TopoEvent.EVENT_TRIGGER_DELETE, layerElement); // 获取资源配置
|
@@ -176,19 +155,19 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
176
155
|
|
177
156
|
|
178
157
|
if (config.layers.length) {
|
179
|
-
|
158
|
+
_context2.next = 7;
|
180
159
|
break;
|
181
160
|
}
|
182
161
|
|
183
|
-
|
162
|
+
_context2.next = 7;
|
184
163
|
return topoDispatchers.setTopoType(_template.TPL_BLANK);
|
185
164
|
|
186
165
|
case 7:
|
187
|
-
|
166
|
+
_context2.next = 9;
|
188
167
|
return resourceConfig.updateConfig(config);
|
189
168
|
|
190
169
|
case 9:
|
191
|
-
|
170
|
+
_context2.next = 11;
|
192
171
|
return editDispatchers.fetchDataByConfig();
|
193
172
|
|
194
173
|
case 11:
|
@@ -196,14 +175,14 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
196
175
|
|
197
176
|
case 12:
|
198
177
|
case "end":
|
199
|
-
return
|
178
|
+
return _context2.stop();
|
200
179
|
}
|
201
180
|
}
|
202
|
-
},
|
181
|
+
}, _callee2);
|
203
182
|
}));
|
204
183
|
|
205
184
|
return function deleteLayer(_x2) {
|
206
|
-
return
|
185
|
+
return _ref3.apply(this, arguments);
|
207
186
|
};
|
208
187
|
}();
|
209
188
|
|
@@ -226,19 +205,19 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
226
205
|
type: "warning"
|
227
206
|
},
|
228
207
|
onOk: function () {
|
229
|
-
var _onOk = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function
|
230
|
-
return _regenerator["default"].wrap(function
|
208
|
+
var _onOk = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee3() {
|
209
|
+
return _regenerator["default"].wrap(function _callee3$(_context3) {
|
231
210
|
while (1) {
|
232
|
-
switch (
|
211
|
+
switch (_context3.prev = _context3.next) {
|
233
212
|
case 0:
|
234
213
|
deleteLayer(layerElement);
|
235
214
|
|
236
215
|
case 1:
|
237
216
|
case "end":
|
238
|
-
return
|
217
|
+
return _context3.stop();
|
239
218
|
}
|
240
219
|
}
|
241
|
-
},
|
220
|
+
}, _callee3);
|
242
221
|
}));
|
243
222
|
|
244
223
|
function onOk() {
|
@@ -284,19 +263,19 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
284
263
|
type: "warning"
|
285
264
|
},
|
286
265
|
onOk: function () {
|
287
|
-
var _onOk2 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function
|
288
|
-
return _regenerator["default"].wrap(function
|
266
|
+
var _onOk2 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee4() {
|
267
|
+
return _regenerator["default"].wrap(function _callee4$(_context4) {
|
289
268
|
while (1) {
|
290
|
-
switch (
|
269
|
+
switch (_context4.prev = _context4.next) {
|
291
270
|
case 0:
|
292
271
|
doDelete();
|
293
272
|
|
294
273
|
case 1:
|
295
274
|
case "end":
|
296
|
-
return
|
275
|
+
return _context4.stop();
|
297
276
|
}
|
298
277
|
}
|
299
|
-
},
|
278
|
+
}, _callee4);
|
300
279
|
}));
|
301
280
|
|
302
281
|
function onOk() {
|
@@ -342,20 +321,20 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
342
321
|
|
343
322
|
|
344
323
|
var deleteExLink = /*#__PURE__*/function () {
|
345
|
-
var
|
324
|
+
var _ref4 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee5(node) {
|
346
325
|
var _node$getEdges$toArra, _node$getEdges;
|
347
326
|
|
348
327
|
var config, edges, exportLinkIdList;
|
349
|
-
return _regenerator["default"].wrap(function
|
328
|
+
return _regenerator["default"].wrap(function _callee5$(_context5) {
|
350
329
|
while (1) {
|
351
|
-
switch (
|
330
|
+
switch (_context5.prev = _context5.next) {
|
352
331
|
case 0:
|
353
332
|
config = resourceConfig.getConfig(); // console.log("删除关联在节点上的出口链路- node, config", node, config);
|
354
333
|
|
355
334
|
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 = [];
|
356
335
|
|
357
336
|
if (!(edges.length > 0)) {
|
358
|
-
|
337
|
+
_context5.next = 8;
|
359
338
|
break;
|
360
339
|
}
|
361
340
|
|
@@ -369,19 +348,19 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
369
348
|
}
|
370
349
|
});
|
371
350
|
config.exportLinkIdList = exportLinkIdList;
|
372
|
-
|
351
|
+
_context5.next = 8;
|
373
352
|
return resourceConfig.updateConfig(config);
|
374
353
|
|
375
354
|
case 8:
|
376
355
|
case "end":
|
377
|
-
return
|
356
|
+
return _context5.stop();
|
378
357
|
}
|
379
358
|
}
|
380
|
-
},
|
359
|
+
}, _callee5);
|
381
360
|
}));
|
382
361
|
|
383
362
|
return function deleteExLink(_x3) {
|
384
|
-
return
|
363
|
+
return _ref4.apply(this, arguments);
|
385
364
|
};
|
386
365
|
}();
|
387
366
|
|
@@ -463,27 +442,27 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
463
442
|
}
|
464
443
|
|
465
444
|
function _bindGroupResources() {
|
466
|
-
_bindGroupResources = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function
|
445
|
+
_bindGroupResources = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee11(group, resources) {
|
467
446
|
var id, tag, _yield$editDispatcher2, elements, nodeElements, newLinkElements, updateElements;
|
468
447
|
|
469
|
-
return _regenerator["default"].wrap(function
|
448
|
+
return _regenerator["default"].wrap(function _callee11$(_context11) {
|
470
449
|
while (1) {
|
471
|
-
switch (
|
450
|
+
switch (_context11.prev = _context11.next) {
|
472
451
|
case 0:
|
473
452
|
id = group.id, tag = group.tag;
|
474
453
|
|
475
454
|
_rlog["default"].debug("bindGroupResources--id, tag", id, tag);
|
476
455
|
|
477
456
|
topo.historyManager.beginTransaction();
|
478
|
-
|
457
|
+
_context11.next = 5;
|
479
458
|
return resourceConfig.updateGroupResources(group, resources);
|
480
459
|
|
481
460
|
case 5:
|
482
|
-
|
461
|
+
_context11.next = 7;
|
483
462
|
return editDispatchers.fetchDataByConfig();
|
484
463
|
|
485
464
|
case 7:
|
486
|
-
_yield$editDispatcher2 =
|
465
|
+
_yield$editDispatcher2 = _context11.sent;
|
487
466
|
elements = _yield$editDispatcher2.elements;
|
488
467
|
// 区域里的子区域及子区域的节点、新增的链路
|
489
468
|
nodeElements = (0, _topoData.findGroupChildren)(elements, group);
|
@@ -502,10 +481,10 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
502
481
|
|
503
482
|
case 14:
|
504
483
|
case "end":
|
505
|
-
return
|
484
|
+
return _context11.stop();
|
506
485
|
}
|
507
486
|
}
|
508
|
-
},
|
487
|
+
}, _callee11);
|
509
488
|
}));
|
510
489
|
return _bindGroupResources.apply(this, arguments);
|
511
490
|
}
|
@@ -519,11 +498,11 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
519
498
|
|
520
499
|
|
521
500
|
function _addGroupResources() {
|
522
|
-
_addGroupResources = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function
|
501
|
+
_addGroupResources = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee12(group, newResourceIds) {
|
523
502
|
var groupConfig, resources, groupData;
|
524
|
-
return _regenerator["default"].wrap(function
|
503
|
+
return _regenerator["default"].wrap(function _callee12$(_context12) {
|
525
504
|
while (1) {
|
526
|
-
switch (
|
505
|
+
switch (_context12.prev = _context12.next) {
|
527
506
|
case 0:
|
528
507
|
groupConfig = resourceConfig.getGroupConfigByElement(group);
|
529
508
|
resources = {
|
@@ -533,15 +512,15 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
533
512
|
id: group.getTag(),
|
534
513
|
tag: group.a("tag")
|
535
514
|
};
|
536
|
-
|
515
|
+
_context12.next = 5;
|
537
516
|
return bindGroupResources(groupData, resources, newResourceIds);
|
538
517
|
|
539
518
|
case 5:
|
540
519
|
case "end":
|
541
|
-
return
|
520
|
+
return _context12.stop();
|
542
521
|
}
|
543
522
|
}
|
544
|
-
},
|
523
|
+
}, _callee12);
|
545
524
|
}));
|
546
525
|
return _addGroupResources.apply(this, arguments);
|
547
526
|
}
|
@@ -558,25 +537,25 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
558
537
|
|
559
538
|
|
560
539
|
function _bindViewResources() {
|
561
|
-
_bindViewResources = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function
|
540
|
+
_bindViewResources = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee13(data) {
|
562
541
|
var config, _yield$editDispatcher3, elements;
|
563
542
|
|
564
|
-
return _regenerator["default"].wrap(function
|
543
|
+
return _regenerator["default"].wrap(function _callee13$(_context13) {
|
565
544
|
while (1) {
|
566
|
-
switch (
|
545
|
+
switch (_context13.prev = _context13.next) {
|
567
546
|
case 0:
|
568
547
|
// console.log("关联视图的资源", data);
|
569
548
|
config = resourceConfig.getConfig();
|
570
549
|
config.resources = data;
|
571
|
-
|
550
|
+
_context13.next = 4;
|
572
551
|
return resourceConfig.updateConfig(config);
|
573
552
|
|
574
553
|
case 4:
|
575
|
-
|
554
|
+
_context13.next = 6;
|
576
555
|
return editDispatchers.fetchDataByConfig();
|
577
556
|
|
578
557
|
case 6:
|
579
|
-
_yield$editDispatcher3 =
|
558
|
+
_yield$editDispatcher3 = _context13.sent;
|
580
559
|
elements = _yield$editDispatcher3.elements;
|
581
560
|
saveBind(_componentTopologyGraph.TopoEvent.DATA_TYPE_RESOURCE_COMBO, elements); // 临时放这里,仅拓扑中心有
|
582
561
|
|
@@ -586,10 +565,10 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
586
565
|
|
587
566
|
case 10:
|
588
567
|
case "end":
|
589
|
-
return
|
568
|
+
return _context13.stop();
|
590
569
|
}
|
591
570
|
}
|
592
|
-
},
|
571
|
+
}, _callee13);
|
593
572
|
}));
|
594
573
|
return _bindViewResources.apply(this, arguments);
|
595
574
|
}
|
@@ -599,24 +578,24 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
599
578
|
}
|
600
579
|
|
601
580
|
function _addLayerResources() {
|
602
|
-
_addLayerResources = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function
|
581
|
+
_addLayerResources = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee14(group, newResourceIds) {
|
603
582
|
var _yield$editDispatcher4, elements, newElements;
|
604
583
|
|
605
|
-
return _regenerator["default"].wrap(function
|
584
|
+
return _regenerator["default"].wrap(function _callee14$(_context14) {
|
606
585
|
while (1) {
|
607
|
-
switch (
|
586
|
+
switch (_context14.prev = _context14.next) {
|
608
587
|
case 0:
|
609
588
|
topo.historyManager.beginTransaction(); // 构造新的配置
|
610
589
|
|
611
|
-
|
590
|
+
_context14.next = 3;
|
612
591
|
return resourceConfig.addLayerStaticResources(group, newResourceIds);
|
613
592
|
|
614
593
|
case 3:
|
615
|
-
|
594
|
+
_context14.next = 5;
|
616
595
|
return editDispatchers.fetchDataByConfig();
|
617
596
|
|
618
597
|
case 5:
|
619
|
-
_yield$editDispatcher4 =
|
598
|
+
_yield$editDispatcher4 = _context14.sent;
|
620
599
|
elements = _yield$editDispatcher4.elements;
|
621
600
|
// 2022-11-10 修复 添加资源后分层重新布局问题,仅布局新增资源。替换api topo.updateElements(data)
|
622
601
|
newElements = findUNExistedElements(elements);
|
@@ -641,10 +620,10 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
641
620
|
|
642
621
|
case 14:
|
643
622
|
case "end":
|
644
|
-
return
|
623
|
+
return _context14.stop();
|
645
624
|
}
|
646
625
|
}
|
647
|
-
},
|
626
|
+
}, _callee14);
|
648
627
|
}));
|
649
628
|
return _addLayerResources.apply(this, arguments);
|
650
629
|
}
|
@@ -654,22 +633,22 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
654
633
|
}
|
655
634
|
|
656
635
|
function _addResourceToFirstLayer() {
|
657
|
-
_addResourceToFirstLayer = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function
|
636
|
+
_addResourceToFirstLayer = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee15(data) {
|
658
637
|
var group;
|
659
|
-
return _regenerator["default"].wrap(function
|
638
|
+
return _regenerator["default"].wrap(function _callee15$(_context15) {
|
660
639
|
while (1) {
|
661
|
-
switch (
|
640
|
+
switch (_context15.prev = _context15.next) {
|
662
641
|
case 0:
|
663
642
|
group = resourceConfig.getGroups()[0];
|
664
|
-
|
643
|
+
_context15.next = 3;
|
665
644
|
return addLayerResources(group, data);
|
666
645
|
|
667
646
|
case 3:
|
668
647
|
case "end":
|
669
|
-
return
|
648
|
+
return _context15.stop();
|
670
649
|
}
|
671
650
|
}
|
672
|
-
},
|
651
|
+
}, _callee15);
|
673
652
|
}));
|
674
653
|
return _addResourceToFirstLayer.apply(this, arguments);
|
675
654
|
}
|
@@ -701,29 +680,29 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
701
680
|
|
702
681
|
|
703
682
|
var onSaveComboRes = /*#__PURE__*/function () {
|
704
|
-
var
|
705
|
-
return _regenerator["default"].wrap(function
|
683
|
+
var _ref5 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee6(data) {
|
684
|
+
return _regenerator["default"].wrap(function _callee6$(_context6) {
|
706
685
|
while (1) {
|
707
|
-
switch (
|
686
|
+
switch (_context6.prev = _context6.next) {
|
708
687
|
case 0:
|
709
688
|
_rlog["default"].debug("关联资源-----onSaveComboRes", data);
|
710
689
|
|
711
690
|
topo.historyManager.beginTransaction();
|
712
691
|
|
713
692
|
if (!(getAddResourceType() === "addToFirstLayer")) {
|
714
|
-
|
693
|
+
_context6.next = 7;
|
715
694
|
break;
|
716
695
|
}
|
717
696
|
|
718
|
-
|
697
|
+
_context6.next = 5;
|
719
698
|
return addResourceToFirstLayer(data);
|
720
699
|
|
721
700
|
case 5:
|
722
|
-
|
701
|
+
_context6.next = 9;
|
723
702
|
break;
|
724
703
|
|
725
704
|
case 7:
|
726
|
-
|
705
|
+
_context6.next = 9;
|
727
706
|
return bindViewResources(data);
|
728
707
|
|
729
708
|
case 9:
|
@@ -735,14 +714,14 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
735
714
|
|
736
715
|
case 12:
|
737
716
|
case "end":
|
738
|
-
return
|
717
|
+
return _context6.stop();
|
739
718
|
}
|
740
719
|
}
|
741
|
-
},
|
720
|
+
}, _callee6);
|
742
721
|
}));
|
743
722
|
|
744
723
|
return function onSaveComboRes(_x12) {
|
745
|
-
return
|
724
|
+
return _ref5.apply(this, arguments);
|
746
725
|
};
|
747
726
|
}();
|
748
727
|
|
@@ -751,27 +730,27 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
751
730
|
}
|
752
731
|
|
753
732
|
function _checkSavePermission() {
|
754
|
-
_checkSavePermission = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function
|
733
|
+
_checkSavePermission = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee16(id) {
|
755
734
|
var permission;
|
756
|
-
return _regenerator["default"].wrap(function
|
735
|
+
return _regenerator["default"].wrap(function _callee16$(_context16) {
|
757
736
|
while (1) {
|
758
|
-
switch (
|
737
|
+
switch (_context16.prev = _context16.next) {
|
759
738
|
case 0:
|
760
|
-
|
739
|
+
_context16.next = 2;
|
761
740
|
return topoDispatchers.getTopoPermission({
|
762
741
|
id: id,
|
763
742
|
update: false
|
764
743
|
});
|
765
744
|
|
766
745
|
case 2:
|
767
|
-
permission =
|
746
|
+
permission = _context16.sent;
|
768
747
|
|
769
748
|
if (!_topoPermissionUtil["default"].isEditable(permission)) {
|
770
|
-
|
749
|
+
_context16.next = 5;
|
771
750
|
break;
|
772
751
|
}
|
773
752
|
|
774
|
-
return
|
753
|
+
return _context16.abrupt("return", true);
|
775
754
|
|
776
755
|
case 5:
|
777
756
|
_dialog["default"].alert({
|
@@ -783,42 +762,42 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
783
762
|
onOk: function onOk() {}
|
784
763
|
});
|
785
764
|
|
786
|
-
return
|
765
|
+
return _context16.abrupt("return", false);
|
787
766
|
|
788
767
|
case 7:
|
789
768
|
case "end":
|
790
|
-
return
|
769
|
+
return _context16.stop();
|
791
770
|
}
|
792
771
|
}
|
793
|
-
},
|
772
|
+
}, _callee16);
|
794
773
|
}));
|
795
774
|
return _checkSavePermission.apply(this, arguments);
|
796
775
|
}
|
797
776
|
|
798
777
|
var onSaveTopo = /*#__PURE__*/function () {
|
799
|
-
var
|
778
|
+
var _ref6 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee8(data) {
|
800
779
|
var id, config, serialize, _config$layout, template, layout, saveConfig, valid, saveData;
|
801
780
|
|
802
|
-
return _regenerator["default"].wrap(function
|
781
|
+
return _regenerator["default"].wrap(function _callee8$(_context8) {
|
803
782
|
while (1) {
|
804
|
-
switch (
|
783
|
+
switch (_context8.prev = _context8.next) {
|
805
784
|
case 0:
|
806
785
|
id = data.id, config = data.config, serialize = data.serialize;
|
807
786
|
_config$layout = config === null || config === void 0 ? void 0 : config.layout, template = _config$layout.type, layout = _config$layout.layout;
|
808
787
|
|
809
788
|
if (!onSave) {
|
810
|
-
|
789
|
+
_context8.next = 6;
|
811
790
|
break;
|
812
791
|
}
|
813
792
|
|
814
793
|
// 自定义保存
|
815
794
|
saveConfig = /*#__PURE__*/function () {
|
816
|
-
var
|
817
|
-
return _regenerator["default"].wrap(function
|
795
|
+
var _ref7 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee7() {
|
796
|
+
return _regenerator["default"].wrap(function _callee7$(_context7) {
|
818
797
|
while (1) {
|
819
|
-
switch (
|
798
|
+
switch (_context7.prev = _context7.next) {
|
820
799
|
case 0:
|
821
|
-
|
800
|
+
_context7.next = 2;
|
822
801
|
return editDispatchers.saveTopo({
|
823
802
|
id: id,
|
824
803
|
layout: layout,
|
@@ -827,14 +806,14 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
827
806
|
|
828
807
|
case 2:
|
829
808
|
case "end":
|
830
|
-
return
|
809
|
+
return _context7.stop();
|
831
810
|
}
|
832
811
|
}
|
833
|
-
},
|
812
|
+
}, _callee7);
|
834
813
|
}));
|
835
814
|
|
836
815
|
return function saveConfig() {
|
837
|
-
return
|
816
|
+
return _ref7.apply(this, arguments);
|
838
817
|
};
|
839
818
|
}();
|
840
819
|
|
@@ -842,7 +821,7 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
842
821
|
data: data,
|
843
822
|
saveConfig: saveConfig
|
844
823
|
});
|
845
|
-
return
|
824
|
+
return _context8.abrupt("return");
|
846
825
|
|
847
826
|
case 6:
|
848
827
|
// TODO 以下逻辑移到拓扑中心
|
@@ -850,21 +829,21 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
850
829
|
saving: true
|
851
830
|
}); // 检查权限
|
852
831
|
|
853
|
-
|
832
|
+
_context8.next = 9;
|
854
833
|
return checkSavePermission(id);
|
855
834
|
|
856
835
|
case 9:
|
857
|
-
valid =
|
836
|
+
valid = _context8.sent;
|
858
837
|
|
859
838
|
if (valid) {
|
860
|
-
|
839
|
+
_context8.next = 13;
|
861
840
|
break;
|
862
841
|
}
|
863
842
|
|
864
843
|
topoEditDispatchers.update({
|
865
844
|
saving: false
|
866
845
|
});
|
867
|
-
return
|
846
|
+
return _context8.abrupt("return");
|
868
847
|
|
869
848
|
case 13:
|
870
849
|
// 保存
|
@@ -876,7 +855,7 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
876
855
|
|
877
856
|
_rlog["default"].info("保存", saveData);
|
878
857
|
|
879
|
-
|
858
|
+
_context8.next = 17;
|
880
859
|
return editDispatchers.saveTopo(saveData);
|
881
860
|
|
882
861
|
case 17:
|
@@ -888,14 +867,14 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
888
867
|
|
889
868
|
case 19:
|
890
869
|
case "end":
|
891
|
-
return
|
870
|
+
return _context8.stop();
|
892
871
|
}
|
893
872
|
}
|
894
|
-
},
|
873
|
+
}, _callee8);
|
895
874
|
}));
|
896
875
|
|
897
876
|
return function onSaveTopo(_x14) {
|
898
|
-
return
|
877
|
+
return _ref6.apply(this, arguments);
|
899
878
|
};
|
900
879
|
}();
|
901
880
|
|
@@ -923,12 +902,12 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
923
902
|
|
924
903
|
|
925
904
|
var bindNodeResource = /*#__PURE__*/function () {
|
926
|
-
var
|
905
|
+
var _ref8 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee10(params) {
|
927
906
|
var id, oldResId, newResId, node, parentGroupElement, htTopo, config, groupId, groupTag, _yield$editDispatcher, elements, newData, doBind, _doBind, replaceOrAddRes;
|
928
907
|
|
929
|
-
return _regenerator["default"].wrap(function
|
908
|
+
return _regenerator["default"].wrap(function _callee10$(_context10) {
|
930
909
|
while (1) {
|
931
|
-
switch (
|
910
|
+
switch (_context10.prev = _context10.next) {
|
932
911
|
case 0:
|
933
912
|
replaceOrAddRes = function _replaceOrAddRes(resources, oldResId, newResId) {
|
934
913
|
return (0, _extends2["default"])({}, resources, {
|
@@ -939,11 +918,11 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
939
918
|
};
|
940
919
|
|
941
920
|
_doBind = function _doBind3() {
|
942
|
-
_doBind = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function
|
921
|
+
_doBind = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee9() {
|
943
922
|
var dm, newLinkElements, createElementsData, groupChildren, newGroupChildren, existedGroupChildren, groupElement, newElement, sm;
|
944
|
-
return _regenerator["default"].wrap(function
|
923
|
+
return _regenerator["default"].wrap(function _callee9$(_context9) {
|
945
924
|
while (1) {
|
946
|
-
switch (
|
925
|
+
switch (_context9.prev = _context9.next) {
|
947
926
|
case 0:
|
948
927
|
dm = htTopo.getGraphView().dm(); // 创建
|
949
928
|
|
@@ -1013,7 +992,7 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
1013
992
|
// node.a("customName", null);
|
1014
993
|
// 删除关联在节点上的出口链路
|
1015
994
|
|
1016
|
-
|
995
|
+
_context9.next = 12;
|
1017
996
|
return deleteExLink(node);
|
1018
997
|
|
1019
998
|
case 12:
|
@@ -1024,10 +1003,10 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
1024
1003
|
|
1025
1004
|
case 13:
|
1026
1005
|
case "end":
|
1027
|
-
return
|
1006
|
+
return _context9.stop();
|
1028
1007
|
}
|
1029
1008
|
}
|
1030
|
-
},
|
1009
|
+
}, _callee9);
|
1031
1010
|
}));
|
1032
1011
|
return _doBind.apply(this, arguments);
|
1033
1012
|
};
|
@@ -1069,22 +1048,22 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
1069
1048
|
config.resources = replaceOrAddRes(config.resources, oldResId, newResId);
|
1070
1049
|
}
|
1071
1050
|
|
1072
|
-
|
1051
|
+
_context10.next = 13;
|
1073
1052
|
return resourceConfig.updateConfig(config);
|
1074
1053
|
|
1075
1054
|
case 13:
|
1076
|
-
|
1055
|
+
_context10.next = 15;
|
1077
1056
|
return editDispatchers.fetchDataByConfig();
|
1078
1057
|
|
1079
1058
|
case 15:
|
1080
|
-
_yield$editDispatcher =
|
1059
|
+
_yield$editDispatcher = _context10.sent;
|
1081
1060
|
elements = _yield$editDispatcher.elements;
|
1082
1061
|
newData = elements.find(function (item) {
|
1083
1062
|
return item.id === newResId;
|
1084
1063
|
});
|
1085
1064
|
|
1086
1065
|
if (newData) {
|
1087
|
-
|
1066
|
+
_context10.next = 23;
|
1088
1067
|
break;
|
1089
1068
|
}
|
1090
1069
|
|
@@ -1093,10 +1072,10 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
1093
1072
|
_rlog["default"].warn("关联资源失败");
|
1094
1073
|
|
1095
1074
|
topo.historyManager.endTransaction();
|
1096
|
-
return
|
1075
|
+
return _context10.abrupt("return", false);
|
1097
1076
|
|
1098
1077
|
case 23:
|
1099
|
-
|
1078
|
+
_context10.next = 25;
|
1100
1079
|
return doBind();
|
1101
1080
|
|
1102
1081
|
case 25:
|
@@ -1104,14 +1083,14 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
1104
1083
|
|
1105
1084
|
case 26:
|
1106
1085
|
case "end":
|
1107
|
-
return
|
1086
|
+
return _context10.stop();
|
1108
1087
|
}
|
1109
1088
|
}
|
1110
|
-
},
|
1089
|
+
}, _callee10);
|
1111
1090
|
}));
|
1112
1091
|
|
1113
1092
|
return function bindNodeResource(_x15) {
|
1114
|
-
return
|
1093
|
+
return _ref8.apply(this, arguments);
|
1115
1094
|
};
|
1116
1095
|
}();
|
1117
1096
|
|
@@ -1168,24 +1147,9 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
1168
1147
|
*/
|
1169
1148
|
getAllNodeResourceIds: resourceConfig.getAllNodeResourceIds,
|
1170
1149
|
onEvent: onEvent,
|
1171
|
-
|
1172
|
-
/**
|
1173
|
-
* 进入编辑模式回调
|
1174
|
-
*/
|
1175
|
-
onEnterEdit: onEnterEdit,
|
1176
|
-
|
1177
|
-
/**
|
1178
|
-
* 退出编辑模式回调
|
1179
|
-
*/
|
1180
|
-
onExitEdit: onExitEdit,
|
1181
1150
|
reset: reset,
|
1182
1151
|
addLayerResources: addLayerResources,
|
1183
1152
|
|
1184
|
-
/**
|
1185
|
-
* 发起业务数据(资源、链路)绑定回调
|
1186
|
-
*/
|
1187
|
-
onBindData: onBindData,
|
1188
|
-
|
1189
1153
|
/**
|
1190
1154
|
* 显示全局添加资源抽屉
|
1191
1155
|
*/
|