@riil-frontend/component-topology 3.5.0-a.9 → 3.5.2

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 (106) hide show
  1. package/build/1.js +1 -1
  2. package/build/index.css +1 -1
  3. package/build/index.js +12 -12
  4. package/es/components/index.module.scss +3 -114
  5. package/es/core/components/AlarmListPanel/index.js +7 -12
  6. package/es/core/components/DisplaySettingDrawer/DisplaySetting.js +8 -5
  7. package/es/core/components/DisplaySettingDrawer/NodeTag.js +10 -5
  8. package/es/core/components/DisplaySettingDrawer/NodeTip.js +10 -5
  9. package/es/core/components/DisplaySettingDrawer/hooks/useDisplaySetting.js +3 -21
  10. package/es/core/components/TopoView/topoView.js +1 -0
  11. package/es/core/editor/components/settings/propertyViews/edge/CommonEdgePropertyView.js +7 -140
  12. package/es/core/editor/components/settings/propertyViews/edge/EdgePropertyView.js +1 -1
  13. package/es/core/editor/components/settings/propertyViews/node/Setting/Setting.js +1 -1
  14. package/es/core/editor/components/settings/propertyViews/node/data/Data.js +18 -17
  15. package/es/core/editor/components/titlebar/TopoEditorTitleBar.js +62 -18
  16. package/es/core/models/Alarm.js +206 -120
  17. package/es/core/models/DataModel.js +15 -1
  18. package/es/core/models/TopoApp.js +4 -6
  19. package/es/core/models/cache/CiTyeCache.js +4 -0
  20. package/es/core/models/utils/linkUtils.js +87 -42
  21. package/es/core/services/index.js +28 -0
  22. package/es/core/utils/saveSerialize.js +34 -0
  23. package/es/core/viewer/components/plugins/ResourceDetail/ResourceDetail.js +0 -37
  24. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/BaseInfo.js +31 -28
  25. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/ResourceOverview.js +44 -43
  26. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/ResourceOverviewMetric.js +39 -26
  27. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/hooks/useCiData.js +0 -0
  28. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/hooks/useMetricModels.js +143 -0
  29. package/es/core/viewer/components/plugins/ResourceDetail/getCiDisplayMetricModels.js +37 -0
  30. package/es/core/viewer/components/titlebar/BasicTools.js +11 -1
  31. package/es/core/viewer/components/titlebar/widgets/AlarmListShowButton.js +21 -13
  32. package/es/hooks/useGraphAlarmDisplay.js +3 -4
  33. package/es/hooks/useManageStatus.js +1 -1
  34. package/es/hooks/useTopoEdit.js +200 -144
  35. package/es/hooks/useTopoEventListener.js +13 -6
  36. package/es/index.js +3 -2
  37. package/es/models/topoConfig.js +0 -1
  38. package/es/models/topoMod.js +15 -10
  39. package/es/topoCenter/components/Topo404.js +3 -1
  40. package/es/topoCenter/components/TopoNoPermission.js +3 -1
  41. package/es/topoCenter/components/TopoView.js +77 -32
  42. package/es/topoCenter/components/Topology.js +2 -0
  43. package/es/topoCenter/components/editor/propertyViews/edge/EdgePropertyView.js +10 -0
  44. package/es/topoCenter/components/editor/propertyViews/edge/LinkPropertyView/Data/index.js +5 -20
  45. package/es/topoCenter/components/editor/propertyViews/edge/LinkPropertyView/LinkPropertyView.js +12 -6
  46. package/es/topoCenter/components/editor/propertyViews/edge/addLinkDrawer/AddLinkDrawer.js +84 -43
  47. package/es/topoCenter/components/editor/propertyViews/edge/addLinkDrawer/components/editLinkInfo.js +60 -34
  48. package/es/topoCenter/components/editor/propertyViews/edge/addLinkDrawer/index.module.scss +9 -0
  49. package/es/topoCenter/components/editor/propertyViews/edge/addLinkDrawer/server.js +62 -19
  50. package/es/topoCenter/components/editor/propertyViews/edge/link/BindExitLinkSelect.js +157 -0
  51. package/es/topoCenter/components/editor/propertyViews/edge/link/LinkInfoPreview.js +1 -2
  52. package/es/topoCenter/hooks/editor/useDeleteEdges.js +2 -3
  53. package/es/topoCenter/utils/resourcePermissionUtil.js +18 -12
  54. package/es/utils/topoData.js +15 -13
  55. package/lib/components/index.module.scss +3 -114
  56. package/lib/core/components/AlarmListPanel/index.js +7 -12
  57. package/lib/core/components/DisplaySettingDrawer/DisplaySetting.js +9 -5
  58. package/lib/core/components/DisplaySettingDrawer/NodeTag.js +11 -5
  59. package/lib/core/components/DisplaySettingDrawer/NodeTip.js +12 -5
  60. package/lib/core/components/DisplaySettingDrawer/hooks/useDisplaySetting.js +3 -21
  61. package/lib/core/components/TopoView/topoView.js +1 -0
  62. package/lib/core/editor/components/settings/propertyViews/edge/CommonEdgePropertyView.js +7 -151
  63. package/lib/core/editor/components/settings/propertyViews/edge/EdgePropertyView.js +2 -2
  64. package/lib/core/editor/components/settings/propertyViews/node/Setting/Setting.js +1 -1
  65. package/lib/core/editor/components/settings/propertyViews/node/data/Data.js +17 -16
  66. package/lib/core/editor/components/titlebar/TopoEditorTitleBar.js +66 -20
  67. package/lib/core/models/Alarm.js +206 -121
  68. package/lib/core/models/DataModel.js +15 -1
  69. package/lib/core/models/TopoApp.js +4 -6
  70. package/lib/core/models/cache/CiTyeCache.js +4 -0
  71. package/lib/core/models/utils/linkUtils.js +92 -43
  72. package/lib/core/services/index.js +29 -0
  73. package/lib/core/utils/saveSerialize.js +43 -0
  74. package/lib/core/viewer/components/plugins/ResourceDetail/ResourceDetail.js +0 -37
  75. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/BaseInfo.js +29 -26
  76. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/ResourceOverview.js +45 -43
  77. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/ResourceOverviewMetric.js +38 -24
  78. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/hooks/useCiData.js +1 -0
  79. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/hooks/useMetricModels.js +155 -0
  80. package/lib/core/viewer/components/plugins/ResourceDetail/getCiDisplayMetricModels.js +47 -0
  81. package/lib/core/viewer/components/titlebar/BasicTools.js +11 -1
  82. package/lib/core/viewer/components/titlebar/widgets/AlarmListShowButton.js +22 -15
  83. package/lib/hooks/useGraphAlarmDisplay.js +3 -5
  84. package/lib/hooks/useManageStatus.js +1 -1
  85. package/lib/hooks/useTopoEdit.js +197 -141
  86. package/lib/hooks/useTopoEventListener.js +13 -6
  87. package/lib/index.js +5 -0
  88. package/lib/models/topoConfig.js +0 -1
  89. package/lib/models/topoMod.js +15 -10
  90. package/lib/topoCenter/components/Topo404.js +4 -1
  91. package/lib/topoCenter/components/TopoNoPermission.js +4 -1
  92. package/lib/topoCenter/components/TopoView.js +78 -33
  93. package/lib/topoCenter/components/Topology.js +3 -0
  94. package/lib/topoCenter/components/editor/propertyViews/edge/EdgePropertyView.js +22 -0
  95. package/lib/topoCenter/components/editor/propertyViews/edge/LinkPropertyView/Data/index.js +5 -21
  96. package/lib/topoCenter/components/editor/propertyViews/edge/LinkPropertyView/LinkPropertyView.js +13 -8
  97. package/lib/topoCenter/components/editor/propertyViews/edge/addLinkDrawer/AddLinkDrawer.js +87 -42
  98. package/lib/topoCenter/components/editor/propertyViews/edge/addLinkDrawer/components/editLinkInfo.js +61 -37
  99. package/lib/topoCenter/components/editor/propertyViews/edge/addLinkDrawer/index.module.scss +9 -0
  100. package/lib/topoCenter/components/editor/propertyViews/edge/addLinkDrawer/server.js +62 -18
  101. package/lib/topoCenter/components/editor/propertyViews/edge/link/BindExitLinkSelect.js +183 -0
  102. package/lib/topoCenter/components/editor/propertyViews/edge/link/LinkInfoPreview.js +1 -2
  103. package/lib/topoCenter/hooks/editor/useDeleteEdges.js +2 -3
  104. package/lib/topoCenter/utils/resourcePermissionUtil.js +20 -12
  105. package/lib/utils/topoData.js +15 -13
  106. package/package.json +5 -5
@@ -3,9 +3,9 @@ import _extends from "@babel/runtime/helpers/extends";
3
3
  import _Dialog from "@alifd/next/es/dialog";
4
4
  import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
5
5
  import _regeneratorRuntime from "@babel/runtime/regenerator";
6
- import { useCallback, useEffect, useMemo, useState } from 'react';
7
- import rlog from '@riil-frontend/component-topology-utils/es/rlog';
8
- import { TopoEvent } from '@riil-frontend/component-topology-graph';
6
+ import { useCallback, useEffect, useMemo, useState } from "react";
7
+ import rlog from "@riil-frontend/component-topology-utils/es/rlog";
8
+ import { TopoEvent } from "@riil-frontend/component-topology-graph";
9
9
  import { filterElementsByNodeId } from "../utils/format";
10
10
  import { TPL_BLANK, TPL_TREE } from "../utils/template";
11
11
  import topoPermissonUtil from "../utils/topoPermissionUtil";
@@ -35,15 +35,15 @@ var useTopoEdit = function useTopoEdit(params) {
35
35
  resourceConfig: resourceConfig
36
36
  });
37
37
 
38
- var _store$useModel = store.useModel('topoEdit'),
38
+ var _store$useModel = store.useModel("topoEdit"),
39
39
  topoEditState = _store$useModel[0],
40
40
  topoEditDispatchers = _store$useModel[1];
41
41
 
42
- var _store$useModel2 = store.useModel('topoConfig'),
42
+ var _store$useModel2 = store.useModel("topoConfig"),
43
43
  editState = _store$useModel2[0],
44
44
  editDispatchers = _store$useModel2[1];
45
45
 
46
- var _store$useModel3 = store.useModel('topoMod'),
46
+ var _store$useModel3 = store.useModel("topoMod"),
47
47
  topoState = _store$useModel3[0],
48
48
  topoDispatchers = _store$useModel3[1];
49
49
 
@@ -90,7 +90,7 @@ var useTopoEdit = function useTopoEdit(params) {
90
90
 
91
91
 
92
92
  var addResourceToView = function addResourceToView() {
93
- rlog.debug('addResourceToView', resourceConfig.getViewResources());
93
+ rlog.debug("addResourceToView", resourceConfig.getViewResources());
94
94
  setComboResData(resourceConfig.getViewResources());
95
95
  setShowComboResDrawer(true);
96
96
  };
@@ -100,7 +100,7 @@ var useTopoEdit = function useTopoEdit(params) {
100
100
  direction = _ref2.direction;
101
101
  // 从拓扑图获取分层和资源配置
102
102
  var config = resourceConfig.getConfigFromHt(topo.getDataModel());
103
- rlog.info('onLayerAdd', {
103
+ rlog.info("onLayerAdd", {
104
104
  config: config
105
105
  }); // 如果非分层拓扑且有分层,切换到分层模板,设置方向
106
106
 
@@ -118,7 +118,7 @@ var useTopoEdit = function useTopoEdit(params) {
118
118
  emitEvent(TopoEvent.EVENT_TRIGGER_DELETE, layerElement); // 获取资源配置
119
119
 
120
120
  var config = resourceConfig.getConfigFromHt(topo.getDataModel());
121
- rlog.info('deleteLayer', {
121
+ rlog.info("deleteLayer", {
122
122
  config: config
123
123
  }); // 如果没有分层,将拓扑类型切换为空白模板
124
124
 
@@ -142,13 +142,13 @@ var useTopoEdit = function useTopoEdit(params) {
142
142
 
143
143
 
144
144
  _Dialog.confirm({
145
- title: '删除',
146
- content: '若执行相关操作,此分层包含的内容也会一同被删除,确定删除吗?',
145
+ title: "删除",
146
+ content: "若执行相关操作,此分层包含的内容也会一同被删除,确定删除吗?",
147
147
  okProps: {
148
- children: '确定'
148
+ children: "确定"
149
149
  },
150
150
  messageProps: {
151
- type: 'warning'
151
+ type: "warning"
152
152
  },
153
153
  onOk: function () {
154
154
  var _onOk = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
@@ -200,13 +200,13 @@ var useTopoEdit = function useTopoEdit(params) {
200
200
 
201
201
 
202
202
  _Dialog.confirm({
203
- title: '删除',
204
- content: '若执行相关操作,此区域包含的内容也会一同被删除,确定删除吗?',
203
+ title: "删除",
204
+ content: "若执行相关操作,此区域包含的内容也会一同被删除,确定删除吗?",
205
205
  okProps: {
206
- children: '确定'
206
+ children: "确定"
207
207
  },
208
208
  messageProps: {
209
- type: 'warning'
209
+ type: "warning"
210
210
  },
211
211
  onOk: function () {
212
212
  var _onOk2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3() {
@@ -281,7 +281,7 @@ var useTopoEdit = function useTopoEdit(params) {
281
281
 
282
282
  return newGroup;
283
283
  });
284
- rlog.info('删除容器内的单个资源', {
284
+ rlog.info("删除容器内的单个资源", {
285
285
  groups: groups,
286
286
  node: node,
287
287
  newGroups: newGroups
@@ -298,17 +298,62 @@ var useTopoEdit = function useTopoEdit(params) {
298
298
  var nodeDeleteable = params.nodeDeleteable || ((_topo$options$editor = topo.options.editor) === null || _topo$options$editor === void 0 ? void 0 : _topo$options$editor.nodeDeleteable);
299
299
 
300
300
  if (nodeDeleteable === undefined || nodeDeleteable(data)) {
301
- if (typeof onNodeDelete === 'function') {
301
+ if (typeof onNodeDelete === "function") {
302
302
  onNodeDelete(data);
303
303
  } else {
304
304
  deleteNode(data);
305
305
  }
306
306
  }
307
- };
307
+ }; // 删除关联在节点上的出口链路
308
+
309
+
310
+ var deleteExLink = /*#__PURE__*/function () {
311
+ var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee4(node) {
312
+ var _node$getEdges$toArra, _node$getEdges;
313
+
314
+ var config, edges, exportLinkIdList;
315
+ return _regeneratorRuntime.wrap(function _callee4$(_context4) {
316
+ while (1) {
317
+ switch (_context4.prev = _context4.next) {
318
+ case 0:
319
+ config = resourceConfig.getConfig(); // console.log("删除关联在节点上的出口链路- node, config", node, config);
320
+
321
+ 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 = [];
322
+
323
+ if (!(edges.length > 0)) {
324
+ _context4.next = 9;
325
+ break;
326
+ }
327
+
328
+ exportLinkIdList = [].concat(config.exportLinkIdList);
329
+ console.log("删除关联在节点上的出口链路- edge", edges);
330
+ edges.map(function (edge) {
331
+ if (edge.a("connect_type") === "exit" && exportLinkIdList.indexOf(edge.getTag() >= 0)) {
332
+ // exLink.push(edge);
333
+ topo.getGraphView().dm().remove(edge);
334
+ exportLinkIdList.splice(config.exportLinkIdList.indexOf(edge.getTag()), 1);
335
+ }
336
+ });
337
+ config.exportLinkIdList = exportLinkIdList;
338
+ _context4.next = 9;
339
+ return resourceConfig.updateConfig(config);
340
+
341
+ case 9:
342
+ case "end":
343
+ return _context4.stop();
344
+ }
345
+ }
346
+ }, _callee4);
347
+ }));
348
+
349
+ return function deleteExLink(_x) {
350
+ return _ref3.apply(this, arguments);
351
+ };
352
+ }();
308
353
 
309
354
  var onDeleteElement = function onDeleteElement(data) {
310
355
  var dtype = data.dtype;
311
- rlog.info('onDeleteElement', data);
356
+ rlog.info("onDeleteElement", data);
312
357
 
313
358
  if (isLayer(data)) {
314
359
  handleDeleteLayer(data);
@@ -332,18 +377,18 @@ var useTopoEdit = function useTopoEdit(params) {
332
377
  }
333
378
 
334
379
  switch (dtype) {
335
- case 'link':
380
+ case "link":
336
381
  if (onLineDelete) {
337
382
  onLineDelete(data);
338
383
  }
339
384
 
340
385
  break;
341
386
 
342
- case 'device':
387
+ case "device":
343
388
  handleDeleteNode(data);
344
389
  break;
345
390
 
346
- case 'container':
391
+ case "container":
347
392
  deleteGroup(data);
348
393
  break;
349
394
 
@@ -357,39 +402,39 @@ var useTopoEdit = function useTopoEdit(params) {
357
402
  */
358
403
 
359
404
 
360
- function bindGroupResources(_x, _x2) {
405
+ function bindGroupResources(_x2, _x3) {
361
406
  return _bindGroupResources.apply(this, arguments);
362
407
  }
363
408
 
364
409
  function _bindGroupResources() {
365
- _bindGroupResources = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee8(group, resources) {
410
+ _bindGroupResources = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee9(group, resources) {
366
411
  var id, tag, _yield$editDispatcher2, elements, nodeElements, existedLinkIds, newLinkElements, updateElements;
367
412
 
368
- return _regeneratorRuntime.wrap(function _callee8$(_context8) {
413
+ return _regeneratorRuntime.wrap(function _callee9$(_context9) {
369
414
  while (1) {
370
- switch (_context8.prev = _context8.next) {
415
+ switch (_context9.prev = _context9.next) {
371
416
  case 0:
372
417
  id = group.id, tag = group.tag;
373
- rlog.debug('bindGroupResources--id, tag', id, tag);
374
- _context8.next = 4;
418
+ rlog.debug("bindGroupResources--id, tag", id, tag);
419
+ _context9.next = 4;
375
420
  return resourceConfig.updateGroupResources(group, resources);
376
421
 
377
422
  case 4:
378
- _context8.next = 6;
423
+ _context9.next = 6;
379
424
  return editDispatchers.fetchDataByConfig();
380
425
 
381
426
  case 6:
382
- _yield$editDispatcher2 = _context8.sent;
427
+ _yield$editDispatcher2 = _context9.sent;
383
428
  elements = _yield$editDispatcher2.elements;
384
429
  nodeElements = elements.filter(function (element) {
385
430
  var type = element.type,
386
431
  groupId = element.groupId,
387
432
  groupTag = element.groupTag;
388
- return type === 'node' && (groupId === id || groupTag === tag);
433
+ return type === "node" && (groupId === id || groupTag === tag);
389
434
  });
390
435
  existedLinkIds = resourceConfig.getAllEdgeResourceIds();
391
436
  newLinkElements = elements.filter(function (element) {
392
- return (element.type === 'link' || element.type === 'linkGroup') && existedLinkIds.indexOf(element.id) === -1;
437
+ return (element.type === "link" || element.type === "linkGroup") && existedLinkIds.indexOf(element.id) === -1;
393
438
  });
394
439
  updateElements = [].concat(nodeElements, newLinkElements);
395
440
 
@@ -403,15 +448,15 @@ var useTopoEdit = function useTopoEdit(params) {
403
448
 
404
449
  case 13:
405
450
  case "end":
406
- return _context8.stop();
451
+ return _context9.stop();
407
452
  }
408
453
  }
409
- }, _callee8);
454
+ }, _callee9);
410
455
  }));
411
456
  return _bindGroupResources.apply(this, arguments);
412
457
  }
413
458
 
414
- function addGroupResources(_x3, _x4) {
459
+ function addGroupResources(_x4, _x5) {
415
460
  return _addGroupResources.apply(this, arguments);
416
461
  }
417
462
  /**
@@ -420,11 +465,11 @@ var useTopoEdit = function useTopoEdit(params) {
420
465
 
421
466
 
422
467
  function _addGroupResources() {
423
- _addGroupResources = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee9(group, newResourceIds) {
468
+ _addGroupResources = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee10(group, newResourceIds) {
424
469
  var groupConfig, resources, groupData;
425
- return _regeneratorRuntime.wrap(function _callee9$(_context9) {
470
+ return _regeneratorRuntime.wrap(function _callee10$(_context10) {
426
471
  while (1) {
427
- switch (_context9.prev = _context9.next) {
472
+ switch (_context10.prev = _context10.next) {
428
473
  case 0:
429
474
  groupConfig = resourceConfig.getGroupConfigByElement(group);
430
475
  resources = {
@@ -432,22 +477,22 @@ var useTopoEdit = function useTopoEdit(params) {
432
477
  };
433
478
  groupData = {
434
479
  id: group.getTag(),
435
- tag: group.a('tag')
480
+ tag: group.a("tag")
436
481
  };
437
- _context9.next = 5;
482
+ _context10.next = 5;
438
483
  return bindGroupResources(groupData, resources, newResourceIds);
439
484
 
440
485
  case 5:
441
486
  case "end":
442
- return _context9.stop();
487
+ return _context10.stop();
443
488
  }
444
489
  }
445
- }, _callee9);
490
+ }, _callee10);
446
491
  }));
447
492
  return _addGroupResources.apply(this, arguments);
448
493
  }
449
494
 
450
- function bindViewResources(_x5) {
495
+ function bindViewResources(_x6) {
451
496
  return _bindViewResources.apply(this, arguments);
452
497
  }
453
498
  /**
@@ -459,24 +504,25 @@ var useTopoEdit = function useTopoEdit(params) {
459
504
 
460
505
 
461
506
  function _bindViewResources() {
462
- _bindViewResources = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee10(data) {
507
+ _bindViewResources = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee11(data) {
463
508
  var config, _yield$editDispatcher3, elements;
464
509
 
465
- return _regeneratorRuntime.wrap(function _callee10$(_context10) {
510
+ return _regeneratorRuntime.wrap(function _callee11$(_context11) {
466
511
  while (1) {
467
- switch (_context10.prev = _context10.next) {
512
+ switch (_context11.prev = _context11.next) {
468
513
  case 0:
514
+ console.log("关联视图的资源", data);
469
515
  config = resourceConfig.getConfig();
470
516
  config.resources = data;
471
- _context10.next = 4;
517
+ _context11.next = 5;
472
518
  return resourceConfig.updateConfig(config);
473
519
 
474
- case 4:
475
- _context10.next = 6;
520
+ case 5:
521
+ _context11.next = 7;
476
522
  return editDispatchers.fetchDataByConfig();
477
523
 
478
- case 6:
479
- _yield$editDispatcher3 = _context10.sent;
524
+ case 7:
525
+ _yield$editDispatcher3 = _context11.sent;
480
526
  elements = _yield$editDispatcher3.topoDataTrans;
481
527
  saveBind(TopoEvent.DATA_TYPE_RESOURCE_COMBO, elements); // 临时放这里,仅拓扑中心有
482
528
 
@@ -484,37 +530,37 @@ var useTopoEdit = function useTopoEdit(params) {
484
530
  topo.linkDynamicStyleExecutor.execute();
485
531
  }
486
532
 
487
- case 10:
533
+ case 11:
488
534
  case "end":
489
- return _context10.stop();
535
+ return _context11.stop();
490
536
  }
491
537
  }
492
- }, _callee10);
538
+ }, _callee11);
493
539
  }));
494
540
  return _bindViewResources.apply(this, arguments);
495
541
  }
496
542
 
497
- function addLayerResources(_x6, _x7) {
543
+ function addLayerResources(_x7, _x8) {
498
544
  return _addLayerResources.apply(this, arguments);
499
545
  }
500
546
 
501
547
  function _addLayerResources() {
502
- _addLayerResources = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee11(group, newResourceIds) {
548
+ _addLayerResources = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee12(group, newResourceIds) {
503
549
  var _yield$editDispatcher4, topoData, data;
504
550
 
505
- return _regeneratorRuntime.wrap(function _callee11$(_context11) {
551
+ return _regeneratorRuntime.wrap(function _callee12$(_context12) {
506
552
  while (1) {
507
- switch (_context11.prev = _context11.next) {
553
+ switch (_context12.prev = _context12.next) {
508
554
  case 0:
509
- _context11.next = 2;
555
+ _context12.next = 2;
510
556
  return resourceConfig.addLayerStaticResources(group, newResourceIds);
511
557
 
512
558
  case 2:
513
- _context11.next = 4;
559
+ _context12.next = 4;
514
560
  return editDispatchers.fetchDataByConfig();
515
561
 
516
562
  case 4:
517
- _yield$editDispatcher4 = _context11.sent;
563
+ _yield$editDispatcher4 = _context12.sent;
518
564
  topoData = _yield$editDispatcher4.topoData;
519
565
  // 过滤出新增的资源和链路
520
566
  data = {
@@ -526,7 +572,7 @@ var useTopoEdit = function useTopoEdit(params) {
526
572
  })
527
573
  }; // 添加到分层
528
574
 
529
- _context11.next = 9;
575
+ _context12.next = 9;
530
576
  return topo.addElements(data);
531
577
 
532
578
  case 9:
@@ -537,35 +583,35 @@ var useTopoEdit = function useTopoEdit(params) {
537
583
 
538
584
  case 10:
539
585
  case "end":
540
- return _context11.stop();
586
+ return _context12.stop();
541
587
  }
542
588
  }
543
- }, _callee11);
589
+ }, _callee12);
544
590
  }));
545
591
  return _addLayerResources.apply(this, arguments);
546
592
  }
547
593
 
548
- function addResourceToFirstLayer(_x8) {
594
+ function addResourceToFirstLayer(_x9) {
549
595
  return _addResourceToFirstLayer.apply(this, arguments);
550
596
  }
551
597
 
552
598
  function _addResourceToFirstLayer() {
553
- _addResourceToFirstLayer = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee12(data) {
599
+ _addResourceToFirstLayer = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee13(data) {
554
600
  var group;
555
- return _regeneratorRuntime.wrap(function _callee12$(_context12) {
601
+ return _regeneratorRuntime.wrap(function _callee13$(_context13) {
556
602
  while (1) {
557
- switch (_context12.prev = _context12.next) {
603
+ switch (_context13.prev = _context13.next) {
558
604
  case 0:
559
605
  group = resourceConfig.getGroups()[0];
560
- _context12.next = 3;
606
+ _context13.next = 3;
561
607
  return addLayerResources(group, data);
562
608
 
563
609
  case 3:
564
610
  case "end":
565
- return _context12.stop();
611
+ return _context13.stop();
566
612
  }
567
613
  }
568
- }, _callee12);
614
+ }, _callee13);
569
615
  }));
570
616
  return _addResourceToFirstLayer.apply(this, arguments);
571
617
  }
@@ -574,7 +620,7 @@ var useTopoEdit = function useTopoEdit(params) {
574
620
  var type;
575
621
 
576
622
  if (isLayerTopo) {
577
- type = 'addToFirstLayer';
623
+ type = "addToFirstLayer";
578
624
  }
579
625
 
580
626
  return type;
@@ -587,119 +633,119 @@ var useTopoEdit = function useTopoEdit(params) {
587
633
 
588
634
 
589
635
  function getAddResourceDrawerMode() {
590
- return getAddResourceType() === 'addToFirstLayer' ? 'new' : 'all';
636
+ return getAddResourceType() === "addToFirstLayer" ? "new" : "all";
591
637
  }
592
638
 
593
639
  var onSaveComboRes = /*#__PURE__*/function () {
594
- var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee4(data) {
595
- return _regeneratorRuntime.wrap(function _callee4$(_context4) {
640
+ var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee5(data) {
641
+ return _regeneratorRuntime.wrap(function _callee5$(_context5) {
596
642
  while (1) {
597
- switch (_context4.prev = _context4.next) {
643
+ switch (_context5.prev = _context5.next) {
598
644
  case 0:
599
- rlog.debug('关联资源-----onSaveComboRes', data);
645
+ rlog.debug("关联资源-----onSaveComboRes", data);
600
646
 
601
- if (!(getAddResourceType() === 'addToFirstLayer')) {
602
- _context4.next = 6;
647
+ if (!(getAddResourceType() === "addToFirstLayer")) {
648
+ _context5.next = 6;
603
649
  break;
604
650
  }
605
651
 
606
- _context4.next = 4;
652
+ _context5.next = 4;
607
653
  return addResourceToFirstLayer(data);
608
654
 
609
655
  case 4:
610
- _context4.next = 8;
656
+ _context5.next = 8;
611
657
  break;
612
658
 
613
659
  case 6:
614
- _context4.next = 8;
660
+ _context5.next = 8;
615
661
  return bindViewResources(data);
616
662
 
617
663
  case 8:
618
664
  case "end":
619
- return _context4.stop();
665
+ return _context5.stop();
620
666
  }
621
667
  }
622
- }, _callee4);
668
+ }, _callee5);
623
669
  }));
624
670
 
625
- return function onSaveComboRes(_x9) {
626
- return _ref3.apply(this, arguments);
671
+ return function onSaveComboRes(_x10) {
672
+ return _ref4.apply(this, arguments);
627
673
  };
628
674
  }();
629
675
 
630
- function checkSavePermission(_x10) {
676
+ function checkSavePermission(_x11) {
631
677
  return _checkSavePermission.apply(this, arguments);
632
678
  }
633
679
 
634
680
  function _checkSavePermission() {
635
- _checkSavePermission = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee13(id) {
681
+ _checkSavePermission = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee14(id) {
636
682
  var permission;
637
- return _regeneratorRuntime.wrap(function _callee13$(_context13) {
683
+ return _regeneratorRuntime.wrap(function _callee14$(_context14) {
638
684
  while (1) {
639
- switch (_context13.prev = _context13.next) {
685
+ switch (_context14.prev = _context14.next) {
640
686
  case 0:
641
- _context13.next = 2;
687
+ _context14.next = 2;
642
688
  return topoDispatchers.getTopoPermission({
643
689
  id: id,
644
690
  update: false
645
691
  });
646
692
 
647
693
  case 2:
648
- permission = _context13.sent;
694
+ permission = _context14.sent;
649
695
 
650
696
  if (!topoPermissonUtil.isEditable(permission)) {
651
- _context13.next = 5;
697
+ _context14.next = 5;
652
698
  break;
653
699
  }
654
700
 
655
- return _context13.abrupt("return", true);
701
+ return _context14.abrupt("return", true);
656
702
 
657
703
  case 5:
658
704
  _Dialog.alert({
659
- title: '没有权限进行此操作',
660
- content: '您的权限发生了变化,请联系相关管理员。',
705
+ title: "没有权限进行此操作",
706
+ content: "您的权限发生了变化,请联系相关管理员。",
661
707
  okProps: {
662
- children: '确定'
708
+ children: "确定"
663
709
  },
664
710
  onOk: function onOk() {}
665
711
  });
666
712
 
667
- return _context13.abrupt("return", false);
713
+ return _context14.abrupt("return", false);
668
714
 
669
715
  case 7:
670
716
  case "end":
671
- return _context13.stop();
717
+ return _context14.stop();
672
718
  }
673
719
  }
674
- }, _callee13);
720
+ }, _callee14);
675
721
  }));
676
722
  return _checkSavePermission.apply(this, arguments);
677
723
  }
678
724
 
679
725
  var onSaveTopo = /*#__PURE__*/function () {
680
- var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee6(data) {
726
+ var _ref5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee7(data) {
681
727
  var id, config, serialize, _config$layout, template, layout, saveConfig, valid, saveData;
682
728
 
683
- return _regeneratorRuntime.wrap(function _callee6$(_context6) {
729
+ return _regeneratorRuntime.wrap(function _callee7$(_context7) {
684
730
  while (1) {
685
- switch (_context6.prev = _context6.next) {
731
+ switch (_context7.prev = _context7.next) {
686
732
  case 0:
687
733
  id = data.id, config = data.config, serialize = data.serialize;
688
734
  _config$layout = config === null || config === void 0 ? void 0 : config.layout, template = _config$layout.type, layout = _config$layout.layout;
689
735
 
690
736
  if (!onSave) {
691
- _context6.next = 6;
737
+ _context7.next = 6;
692
738
  break;
693
739
  }
694
740
 
695
741
  // 自定义保存
696
742
  saveConfig = /*#__PURE__*/function () {
697
- var _ref5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee5() {
698
- return _regeneratorRuntime.wrap(function _callee5$(_context5) {
743
+ var _ref6 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee6() {
744
+ return _regeneratorRuntime.wrap(function _callee6$(_context6) {
699
745
  while (1) {
700
- switch (_context5.prev = _context5.next) {
746
+ switch (_context6.prev = _context6.next) {
701
747
  case 0:
702
- _context5.next = 2;
748
+ _context6.next = 2;
703
749
  return editDispatchers.saveTopo({
704
750
  id: id,
705
751
  layout: layout,
@@ -708,14 +754,14 @@ var useTopoEdit = function useTopoEdit(params) {
708
754
 
709
755
  case 2:
710
756
  case "end":
711
- return _context5.stop();
757
+ return _context6.stop();
712
758
  }
713
759
  }
714
- }, _callee5);
760
+ }, _callee6);
715
761
  }));
716
762
 
717
763
  return function saveConfig() {
718
- return _ref5.apply(this, arguments);
764
+ return _ref6.apply(this, arguments);
719
765
  };
720
766
  }();
721
767
 
@@ -723,7 +769,7 @@ var useTopoEdit = function useTopoEdit(params) {
723
769
  data: data,
724
770
  saveConfig: saveConfig
725
771
  });
726
- return _context6.abrupt("return");
772
+ return _context7.abrupt("return");
727
773
 
728
774
  case 6:
729
775
  // TODO 以下逻辑移到拓扑中心
@@ -731,21 +777,21 @@ var useTopoEdit = function useTopoEdit(params) {
731
777
  saving: true
732
778
  }); // 检查权限
733
779
 
734
- _context6.next = 9;
780
+ _context7.next = 9;
735
781
  return checkSavePermission(id);
736
782
 
737
783
  case 9:
738
- valid = _context6.sent;
784
+ valid = _context7.sent;
739
785
 
740
786
  if (valid) {
741
- _context6.next = 13;
787
+ _context7.next = 13;
742
788
  break;
743
789
  }
744
790
 
745
791
  topoEditDispatchers.update({
746
792
  saving: false
747
793
  });
748
- return _context6.abrupt("return");
794
+ return _context7.abrupt("return");
749
795
 
750
796
  case 13:
751
797
  // 保存
@@ -754,8 +800,8 @@ var useTopoEdit = function useTopoEdit(params) {
754
800
  layout: layout,
755
801
  serialize: serialize
756
802
  }, resourceConfig.getConfig());
757
- rlog.info('保存', saveData);
758
- _context6.next = 17;
803
+ rlog.info("保存", saveData);
804
+ _context7.next = 17;
759
805
  return editDispatchers.saveTopo(saveData);
760
806
 
761
807
  case 17:
@@ -763,18 +809,18 @@ var useTopoEdit = function useTopoEdit(params) {
763
809
  saving: false
764
810
  });
765
811
 
766
- _Message.success('保存成功!');
812
+ _Message.success("保存成功!");
767
813
 
768
814
  case 19:
769
815
  case "end":
770
- return _context6.stop();
816
+ return _context7.stop();
771
817
  }
772
818
  }
773
- }, _callee6);
819
+ }, _callee7);
774
820
  }));
775
821
 
776
- return function onSaveTopo(_x11) {
777
- return _ref4.apply(this, arguments);
822
+ return function onSaveTopo(_x12) {
823
+ return _ref5.apply(this, arguments);
778
824
  };
779
825
  }();
780
826
 
@@ -783,7 +829,7 @@ var useTopoEdit = function useTopoEdit(params) {
783
829
  type: type,
784
830
  data: data
785
831
  };
786
- rlog.debug('TopoCenter:onSaveBind', eventData);
832
+ rlog.debug("TopoCenter:onSaveBind", eventData);
787
833
  emitEvent(TopoEvent.EVENT_DATA_RESULT, eventData);
788
834
  };
789
835
  /**
@@ -808,12 +854,12 @@ var useTopoEdit = function useTopoEdit(params) {
808
854
 
809
855
 
810
856
  var bindNodeResource = /*#__PURE__*/function () {
811
- var _ref6 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee7(params) {
857
+ var _ref7 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee8(params) {
812
858
  var id, oldResId, newResId, node, groupElement, config, groupId, groupTag, _yield$editDispatcher, elements, nodeRelatedDatas, replaceOrAddRes;
813
859
 
814
- return _regeneratorRuntime.wrap(function _callee7$(_context7) {
860
+ return _regeneratorRuntime.wrap(function _callee8$(_context8) {
815
861
  while (1) {
816
- switch (_context7.prev = _context7.next) {
862
+ switch (_context8.prev = _context8.next) {
817
863
  case 0:
818
864
  replaceOrAddRes = function _replaceOrAddRes(resources, oldResId, newResId) {
819
865
  return _extends({}, resources, {
@@ -824,7 +870,7 @@ var useTopoEdit = function useTopoEdit(params) {
824
870
  };
825
871
 
826
872
  id = params.id, oldResId = params.oldResId, newResId = params.newResId;
827
- rlog.debug('bindNodeResource', params);
873
+ rlog.debug("bindNodeResource", params);
828
874
  node = topo.getDataModel().getDataById(id); // 节点所属容器
829
875
 
830
876
  groupElement = node.getParent();
@@ -834,7 +880,7 @@ var useTopoEdit = function useTopoEdit(params) {
834
880
  // 在容器中
835
881
  groupId = groupElement.getTag(); // 容器业务id
836
882
 
837
- groupTag = groupElement.a('tag'); // 容器临时id
883
+ groupTag = groupElement.a("tag"); // 容器临时id
838
884
 
839
885
  config.groups = config.groups.map(function (g) {
840
886
  // 匹配到容器,替换资源或增加
@@ -852,46 +898,51 @@ var useTopoEdit = function useTopoEdit(params) {
852
898
  config.resources = replaceOrAddRes(config.resources, oldResId, newResId);
853
899
  }
854
900
 
855
- _context7.next = 9;
901
+ _context8.next = 9;
856
902
  return resourceConfig.updateConfig(config);
857
903
 
858
904
  case 9:
859
- _context7.next = 11;
905
+ _context8.next = 11;
860
906
  return editDispatchers.fetchDataByConfig();
861
907
 
862
908
  case 11:
863
- _yield$editDispatcher = _context7.sent;
909
+ _yield$editDispatcher = _context8.sent;
864
910
  elements = _yield$editDispatcher.topoDataTrans;
865
911
  // 过滤出关联的节点和连线,通知ht更新
866
912
  nodeRelatedDatas = filterElementsByNodeId(elements, newResId);
867
913
 
868
914
  if (nodeRelatedDatas.length) {
869
- _context7.next = 17;
915
+ _context8.next = 17;
870
916
  break;
871
917
  }
872
918
 
873
- _Message.error('关联资源失败');
919
+ _Message.error("关联资源失败");
874
920
 
875
- return _context7.abrupt("return", false);
921
+ return _context8.abrupt("return", false);
876
922
 
877
923
  case 17:
878
924
  saveBind(TopoEvent.DATA_TYPE_RESOURCE_SINGLE, nodeRelatedDatas);
879
- node.a('customName', null); // 临时放这里,仅拓扑中心有
925
+ node.a("customName", null); // 删除关联在节点上的出口链路
880
926
 
927
+ _context8.next = 21;
928
+ return deleteExLink(node);
929
+
930
+ case 21:
931
+ // 临时放这里,仅拓扑中心有
881
932
  if (topo.linkDynamicStyleExecutor) {
882
933
  topo.linkDynamicStyleExecutor.execute();
883
934
  }
884
935
 
885
- case 20:
936
+ case 22:
886
937
  case "end":
887
- return _context7.stop();
938
+ return _context8.stop();
888
939
  }
889
940
  }
890
- }, _callee7);
941
+ }, _callee8);
891
942
  }));
892
943
 
893
- return function bindNodeResource(_x12) {
894
- return _ref6.apply(this, arguments);
944
+ return function bindNodeResource(_x13) {
945
+ return _ref7.apply(this, arguments);
895
946
  };
896
947
  }();
897
948
  /**
@@ -912,7 +963,7 @@ var useTopoEdit = function useTopoEdit(params) {
912
963
  }
913
964
  };
914
965
 
915
- var effectsState = store.useModelEffectsState('topoConfig');
966
+ var effectsState = store.useModelEffectsState("topoConfig");
916
967
  var topoLoading = effectsState.getTopoByConditions.isLoading;
917
968
  return {
918
969
  resourceConfig: resourceConfig,
@@ -986,6 +1037,11 @@ var useTopoEdit = function useTopoEdit(params) {
986
1037
  */
987
1038
  bindNodeResource: bindNodeResource,
988
1039
 
1040
+ /**
1041
+ * 删除节点关联的出口链路
1042
+ */
1043
+ deleteExLink: deleteExLink,
1044
+
989
1045
  /**
990
1046
  * 关闭资源绑定(单选)抽屉
991
1047
  */