@riil-frontend/component-topology 5.0.0-alpha.9 → 5.0.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 (195) 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 +20 -20
  5. package/es/common/components/ColorPicker/ColorPicker.js +5 -3
  6. package/es/components/BatchAttrMetric/setting.js +3 -5
  7. package/es/components/ResourceSelectDrawer/ResourceSelectDrawer.js +2 -1
  8. package/es/core/components/DisplaySettingDrawer/DisplaySettingDrawer.js +2 -1
  9. package/es/core/components/DisplaySettingDrawer/LinkTip.js +5 -1
  10. package/es/core/components/DisplaySettingDrawer/demo/Demo.js +63 -0
  11. package/es/core/components/ResourceViewAttributeSetting/Setting.js +9 -48
  12. package/es/core/components/TopoView/TopoView.module.scss +1 -1
  13. package/es/core/components/TopoView/topoView.js +31 -22
  14. package/es/core/editor/components/BackgroundView/index.js +74 -35
  15. package/es/core/editor/components/settings/common/LineType/index.js +7 -1
  16. package/es/core/editor/components/settings/common/text/FontStyleCheckbox.js +3 -3
  17. package/es/core/editor/components/settings/common/text/TextStyle.js +21 -6
  18. package/es/core/editor/components/settings/common/text/fontStyleUtil.js +0 -1
  19. package/es/core/editor/components/settings/propertyViews/box/BoxPropertyView.js +12 -1
  20. package/es/core/editor/components/settings/propertyViews/box/NameInput.js +9 -1
  21. package/es/core/editor/components/settings/propertyViews/edge/CommonEdgePropertyView.js +15 -1
  22. package/es/core/editor/components/settings/propertyViews/group/DataTab/GroupNodeList.js +2 -0
  23. package/es/core/editor/components/settings/propertyViews/group/SettingTab/GroupExpandSetting.js +9 -5
  24. package/es/core/editor/components/settings/propertyViews/group/SettingTab/GroupExpandStatus.js +10 -2
  25. package/es/core/editor/components/settings/propertyViews/group/SettingTab/Setting.js +12 -1
  26. package/es/core/editor/components/settings/propertyViews/layer/SettingTab/Setting.js +13 -3
  27. package/es/core/editor/components/settings/propertyViews/layer/SettingTab/Setting_bak.js +0 -1
  28. package/es/core/editor/components/settings/propertyViews/multipleElements/BatchSetNodeIcon.js +2 -0
  29. package/es/core/editor/components/settings/propertyViews/multipleElements/BatchSetNodeSize/BatchSetNodeSize.js +2 -0
  30. package/es/core/editor/components/settings/propertyViews/multipleElements/MultipleElementPropertyView.js +4 -1
  31. package/es/core/editor/components/settings/propertyViews/node/Setting/Setting.js +4 -0
  32. package/es/core/editor/components/settings/propertyViews/node/data/Data.js +34 -6
  33. package/es/core/editor/components/settings/propertyViews/text/TextPropertyView.js +9 -2
  34. package/es/core/editor/components/settings/propertyViews/view/BackgroundSize.js +30 -1
  35. package/es/core/editor/components/settings/propertyViews/view/GlobalLayout.js +2 -0
  36. package/es/core/editor/components/settings/propertyViews/view/GlobalNodeLabelStyle.js +15 -1
  37. package/es/core/editor/components/settings/propertyViews/view/hooks/useBackgroundSizeConfig.js +0 -1
  38. package/es/core/editor/components/titlebar/TopoEditorTitleBar.js +4 -1
  39. package/es/core/editor/components/titlebar/widgets/DebugTools.js +29 -0
  40. package/es/core/hooks/useAlarm.js +18 -0
  41. package/es/core/hooks/useGraphAlarmDisplay.js +25 -3
  42. package/es/core/hooks/useResourceConfig.js +2 -1
  43. package/es/core/hooks/useRouterAdapter.js +7 -1
  44. package/es/core/hooks/useTopoEdit.js +220 -163
  45. package/es/core/models/AttributeMetricDisplay.js +31 -73
  46. package/es/core/models/HistoryManager.js +100 -50
  47. package/es/core/models/TopoApp.js +1 -1
  48. package/es/core/models/cache/CiTypeCache.js +10 -44
  49. package/es/core/models/cache/DictCache.js +2 -1
  50. package/es/core/models/graph/Background.js +31 -14
  51. package/es/core/models/tagstips/ElementTagTipConfig.js +46 -12
  52. package/es/core/models/tagstips/utils.js +1 -1
  53. package/es/core/models/topoData.js +7 -3
  54. package/es/core/models/utils/linkUtils.js +18 -0
  55. package/es/core/store/models/topoAlarm.js +5 -1
  56. package/es/core/store/models/topoMod.js +6 -31
  57. package/es/core/viewer/components/plugins/ResourceDetail/ResourceDetail.js +51 -249
  58. package/es/core/viewer/components/plugins/ResourceDetail/ResourceDetailDrawer.js +218 -0
  59. package/es/core/viewer/components/plugins/ResourceDetail/ResourceDetailPlugin.js +2 -2
  60. package/es/core/viewer/components/plugins/ResourceDetail/components/ClusterMemberTable.js +1 -1
  61. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/BaseInfoBlock.js +0 -1
  62. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/ResourceOverview.js +79 -43
  63. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/ResourceOverviewMetric.js +2 -3
  64. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/Configurator/index.js +2 -2
  65. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/LinkTopo.js +23 -0
  66. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/LinkTopo.module.scss +11 -0
  67. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/LinkTopoCard.js +34 -0
  68. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/constants.js +6 -0
  69. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/hooks/useMetricPolling.js +62 -0
  70. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/services/index.js +188 -0
  71. package/es/core/viewer/components/titlebar/BasicTools.js +1 -1
  72. package/es/core/viewer/components/titlebar/widgets/NodesDragSwitchWrapper.js +18 -0
  73. package/es/core/viewer/components/titlebar/widgets/SettingButton.js +11 -1
  74. package/es/networkTopo/components/TopoView.js +2 -1
  75. package/es/networkTopo/components/editor/propertyViews/edge/addLinkDrawer/AddLinkDrawer.js +164 -225
  76. package/es/networkTopo/components/editor/propertyViews/edge/addLinkDrawer/components/NetworkLinkForm.js +4 -0
  77. package/es/networkTopo/components/editor/propertyViews/edge/addLinkDrawer/components/editLinkInfo.js +161 -137
  78. package/es/networkTopo/components/editor/propertyViews/edge/addLinkDrawer/hooks/useAddLink.js +104 -0
  79. package/es/networkTopo/components/editor/propertyViews/edge/link/BindExitLinkSelect.js +17 -7
  80. package/es/networkTopo/components/editor/propertyViews/edge/link/LinkInfoPreview.js +8 -9
  81. package/es/networkTopo/components/viewer/displaySetting/LinkAttrCustomSettingDrawer.js +59 -0
  82. package/es/networkTopo/components/viewer/displaySetting/LinkTagV2.js +10 -4
  83. package/es/networkTopo/getTopoData.js +11 -14
  84. package/es/networkTopo/hooks/editor/useDeleteEdges.js +11 -8
  85. package/es/networkTopo/hooks/viewer/useRelateTopo.js +1 -1
  86. package/es/networkTopo/models/LinkDynamicStyleExecutor.js +2 -0
  87. package/es/networkTopo/models/TopoCenter.js +1 -1
  88. package/es/networkTopo/services/index.js +6 -4
  89. package/es/networkTopo/services/link.js +2 -2
  90. package/es/networkTopo/store/topoCenter.js +5 -2
  91. package/es/networkTopo/store/topoTreeMod.js +84 -43
  92. package/es/networkTopo/utils/__tests__/resourcePermissionUtil.test.js +135 -0
  93. package/es/networkTopo/utils/resourcePermissionUtil.js +10 -6
  94. package/es/style.js +2 -1
  95. package/es/utils/ResourceConfigUtil.js +79 -39
  96. package/es/utils/clusterUtil.js +1 -1
  97. package/es/utils/htElementUtils.js +0 -1
  98. package/es/utils/topoData.js +24 -63
  99. package/es/utils/tree.js +1 -3
  100. package/lib/common/components/ColorPicker/ColorPicker.js +6 -3
  101. package/lib/components/BatchAttrMetric/setting.js +3 -6
  102. package/lib/components/ResourceSelectDrawer/ResourceSelectDrawer.js +4 -1
  103. package/lib/core/components/DisplaySettingDrawer/DisplaySettingDrawer.js +4 -1
  104. package/lib/core/components/DisplaySettingDrawer/LinkTip.js +6 -1
  105. package/lib/core/components/DisplaySettingDrawer/demo/Demo.js +71 -0
  106. package/lib/core/components/ResourceViewAttributeSetting/Setting.js +8 -48
  107. package/lib/core/components/TopoView/TopoView.module.scss +1 -1
  108. package/lib/core/components/TopoView/topoView.js +26 -17
  109. package/lib/core/editor/components/BackgroundView/index.js +75 -35
  110. package/lib/core/editor/components/settings/common/LineType/index.js +7 -1
  111. package/lib/core/editor/components/settings/common/text/FontStyleCheckbox.js +5 -4
  112. package/lib/core/editor/components/settings/common/text/TextStyle.js +23 -7
  113. package/lib/core/editor/components/settings/common/text/fontStyleUtil.js +0 -1
  114. package/lib/core/editor/components/settings/propertyViews/box/BoxPropertyView.js +13 -1
  115. package/lib/core/editor/components/settings/propertyViews/box/NameInput.js +9 -1
  116. package/lib/core/editor/components/settings/propertyViews/edge/CommonEdgePropertyView.js +15 -1
  117. package/lib/core/editor/components/settings/propertyViews/group/DataTab/GroupNodeList.js +2 -0
  118. package/lib/core/editor/components/settings/propertyViews/group/SettingTab/GroupExpandSetting.js +9 -5
  119. package/lib/core/editor/components/settings/propertyViews/group/SettingTab/GroupExpandStatus.js +10 -2
  120. package/lib/core/editor/components/settings/propertyViews/group/SettingTab/Setting.js +12 -1
  121. package/lib/core/editor/components/settings/propertyViews/layer/SettingTab/Setting.js +17 -3
  122. package/lib/core/editor/components/settings/propertyViews/layer/SettingTab/Setting_bak.js +0 -1
  123. package/lib/core/editor/components/settings/propertyViews/multipleElements/BatchSetNodeIcon.js +2 -0
  124. package/lib/core/editor/components/settings/propertyViews/multipleElements/BatchSetNodeSize/BatchSetNodeSize.js +2 -0
  125. package/lib/core/editor/components/settings/propertyViews/multipleElements/MultipleElementPropertyView.js +4 -1
  126. package/lib/core/editor/components/settings/propertyViews/node/Setting/Setting.js +4 -0
  127. package/lib/core/editor/components/settings/propertyViews/node/data/Data.js +36 -6
  128. package/lib/core/editor/components/settings/propertyViews/text/TextPropertyView.js +9 -2
  129. package/lib/core/editor/components/settings/propertyViews/view/BackgroundSize.js +32 -1
  130. package/lib/core/editor/components/settings/propertyViews/view/GlobalLayout.js +2 -0
  131. package/lib/core/editor/components/settings/propertyViews/view/GlobalNodeLabelStyle.js +15 -1
  132. package/lib/core/editor/components/settings/propertyViews/view/hooks/useBackgroundSizeConfig.js +0 -1
  133. package/lib/core/editor/components/titlebar/TopoEditorTitleBar.js +5 -1
  134. package/lib/core/editor/components/titlebar/widgets/DebugTools.js +38 -0
  135. package/lib/core/hooks/useAlarm.js +19 -0
  136. package/lib/core/hooks/useGraphAlarmDisplay.js +27 -3
  137. package/lib/core/hooks/useResourceConfig.js +2 -1
  138. package/lib/core/hooks/useRouterAdapter.js +8 -1
  139. package/lib/core/hooks/useTopoEdit.js +219 -162
  140. package/lib/core/models/AttributeMetricDisplay.js +31 -73
  141. package/lib/core/models/HistoryManager.js +105 -51
  142. package/lib/core/models/TopoApp.js +1 -1
  143. package/lib/core/models/cache/CiTypeCache.js +12 -44
  144. package/lib/core/models/cache/DictCache.js +4 -1
  145. package/lib/core/models/graph/Background.js +36 -16
  146. package/lib/core/models/tagstips/ElementTagTipConfig.js +49 -12
  147. package/lib/core/models/tagstips/utils.js +1 -1
  148. package/lib/core/models/topoData.js +7 -3
  149. package/lib/core/models/utils/linkUtils.js +22 -0
  150. package/lib/core/store/models/topoAlarm.js +5 -1
  151. package/lib/core/store/models/topoMod.js +7 -32
  152. package/lib/core/viewer/components/plugins/ResourceDetail/ResourceDetail.js +51 -261
  153. package/lib/core/viewer/components/plugins/ResourceDetail/ResourceDetailDrawer.js +245 -0
  154. package/lib/core/viewer/components/plugins/ResourceDetail/ResourceDetailPlugin.js +2 -2
  155. package/lib/core/viewer/components/plugins/ResourceDetail/components/ClusterMemberTable.js +1 -1
  156. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/BaseInfoBlock.js +0 -1
  157. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/ResourceOverview.js +79 -42
  158. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/ResourceOverviewMetric.js +2 -3
  159. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/Configurator/index.js +2 -2
  160. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/LinkTopo.js +36 -0
  161. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/LinkTopo.module.scss +11 -0
  162. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/LinkTopoCard.js +45 -0
  163. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/constants.js +11 -0
  164. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/hooks/useMetricPolling.js +77 -0
  165. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/services/index.js +214 -0
  166. package/lib/core/viewer/components/titlebar/BasicTools.js +2 -2
  167. package/lib/core/viewer/components/titlebar/widgets/NodesDragSwitchWrapper.js +28 -0
  168. package/lib/core/viewer/components/titlebar/widgets/SettingButton.js +10 -0
  169. package/lib/networkTopo/components/TopoView.js +3 -2
  170. package/lib/networkTopo/components/editor/propertyViews/edge/addLinkDrawer/AddLinkDrawer.js +160 -223
  171. package/lib/networkTopo/components/editor/propertyViews/edge/addLinkDrawer/components/NetworkLinkForm.js +12 -0
  172. package/lib/networkTopo/components/editor/propertyViews/edge/addLinkDrawer/components/editLinkInfo.js +161 -137
  173. package/lib/networkTopo/components/editor/propertyViews/edge/addLinkDrawer/hooks/useAddLink.js +120 -0
  174. package/lib/networkTopo/components/editor/propertyViews/edge/link/BindExitLinkSelect.js +19 -7
  175. package/lib/networkTopo/components/editor/propertyViews/edge/link/LinkInfoPreview.js +8 -9
  176. package/lib/networkTopo/components/viewer/displaySetting/LinkAttrCustomSettingDrawer.js +76 -0
  177. package/lib/networkTopo/components/viewer/displaySetting/LinkTagV2.js +10 -4
  178. package/lib/networkTopo/getTopoData.js +10 -13
  179. package/lib/networkTopo/hooks/editor/useDeleteEdges.js +11 -8
  180. package/lib/networkTopo/hooks/viewer/useRelateTopo.js +2 -1
  181. package/lib/networkTopo/models/LinkDynamicStyleExecutor.js +2 -0
  182. package/lib/networkTopo/models/TopoCenter.js +2 -2
  183. package/lib/networkTopo/services/index.js +6 -4
  184. package/lib/networkTopo/services/link.js +2 -2
  185. package/lib/networkTopo/store/topoCenter.js +5 -2
  186. package/lib/networkTopo/store/topoTreeMod.js +84 -43
  187. package/lib/networkTopo/utils/__tests__/resourcePermissionUtil.test.js +137 -0
  188. package/lib/networkTopo/utils/resourcePermissionUtil.js +11 -6
  189. package/lib/style.js +2 -1
  190. package/lib/utils/ResourceConfigUtil.js +78 -37
  191. package/lib/utils/clusterUtil.js +1 -1
  192. package/lib/utils/htElementUtils.js +0 -1
  193. package/lib/utils/topoData.js +25 -64
  194. package/lib/utils/tree.js +1 -3
  195. package/package.json +3 -2
@@ -4,10 +4,9 @@ import _Message from "@alifd/next/es/message";
4
4
  import _extends from "@babel/runtime/helpers/extends";
5
5
  import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
6
6
  import _regeneratorRuntime from "@babel/runtime/regenerator";
7
- import React, { useState, useEffect, useRef } from "react";
8
- import topoService from "@riil-frontend/component-topology-common/es/services/topo";
9
- import _ from "lodash";
10
- import rlog from "@riil-frontend/component-topology-utils/es/rlog";
7
+ import React, { useState, useEffect, useRef } from 'react';
8
+ import _ from 'lodash';
9
+ import rlog from '@riil-frontend/component-topology-utils/es/rlog';
11
10
  import TopoCenterEvent from "../../../../../event";
12
11
  import EditLinkInfo from "./components/editLinkInfo";
13
12
  import styles from "./index.module.scss";
@@ -15,25 +14,21 @@ import service from "./server";
15
14
  import { clone } from "../../../../../../utils/copyUtil";
16
15
  import { getInterfaceObject } from "../../../../../../core/models/utils/linkUtils";
17
16
  import { getEdgesBetweenNodes, getNodes, isGroup } from "../../../../../../utils/htElementUtils";
18
- import { getCiTypes } from "../../../../../../utils/topoData";
17
+ import useAddLink from "./hooks/useAddLink";
19
18
 
20
19
  function AddLinkDrawer(props) {
21
20
  var topo = props.topo,
22
21
  lineData = props.lineData;
23
22
  var store = topo.store;
24
23
 
25
- var _topo$store$useModel = topo.store.useModel("topoMod"),
24
+ var _topo$store$useModel = topo.store.useModel('topoMod'),
26
25
  topoState = _topo$store$useModel[0],
27
26
  topoDispatchers = _topo$store$useModel[1];
28
27
 
29
- var _store$useModel = store.useModel("topoConfig"),
28
+ var _store$useModel = store.useModel('topoConfig'),
30
29
  editState = _store$useModel[0],
31
30
  editDispatchers = _store$useModel[1];
32
31
 
33
- var _store$useModel2 = store.useModel("topoLinkMod"),
34
- linkState = _store$useModel2[0],
35
- linkDispatchers = _store$useModel2[1];
36
-
37
32
  var addLinkIsOpen = editState.addLinkIsOpen,
38
33
  currentLink = editState.currentLink;
39
34
 
@@ -50,28 +45,27 @@ function AddLinkDrawer(props) {
50
45
  setLoading = _useState3[1];
51
46
 
52
47
  var _useState4 = useState(false),
53
- loadingConnectableNodes = _useState4[0],
54
- setLoadingConnectableNodes = _useState4[1];
48
+ loadingFormData = _useState4[0],
49
+ setLoadingFormData = _useState4[1];
55
50
 
56
- var _useState5 = useState(false),
57
- loadingFormData = _useState5[0],
58
- setLoadingFormData = _useState5[1];
51
+ var _useState5 = useState(),
52
+ sourceIFDoc = _useState5[0],
53
+ setSourceIFDoc = _useState5[1];
59
54
 
60
55
  var _useState6 = useState(),
61
- sourceIFDoc = _useState6[0],
62
- setSourceIFDoc = _useState6[1];
63
-
64
- var _useState7 = useState(),
65
- targetIFDoc = _useState7[0],
66
- setTargetIFDoc = _useState7[1]; // 保存后更新拓扑图状态
56
+ targetIFDoc = _useState6[0],
57
+ setTargetIFDoc = _useState6[1]; // 保存后更新拓扑图状态
67
58
 
68
59
 
69
- var _useState8 = useState([]),
70
- ciIdsConnectable = _useState8[0],
71
- setCiIdsConnectable = _useState8[1];
72
-
73
60
  var linkNodesRef = useRef();
74
61
 
62
+ var _useAddLink = useAddLink({
63
+ topo: topo
64
+ }),
65
+ enterAddLinkMode = _useAddLink.enterAddLinkMode,
66
+ resetConnectableNodes = _useAddLink.resetConnectableNodes,
67
+ loadingConnectableNodes = _useAddLink.loadingConnectableNodes;
68
+
75
69
  var getPortsById = /*#__PURE__*/function () {
76
70
  var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(id, currentLink) {
77
71
  var result, links, ifTypes, ifDoc, usedPorts, portsDoc, ports;
@@ -79,7 +73,7 @@ function AddLinkDrawer(props) {
79
73
  while (1) {
80
74
  switch (_context.prev = _context.next) {
81
75
  case 0:
82
- console.log("getPortsById", id, currentLink);
76
+ console.log('getPortsById', id, currentLink);
83
77
 
84
78
  if (id) {
85
79
  _context.next = 3;
@@ -131,12 +125,14 @@ function AddLinkDrawer(props) {
131
125
  value: item.id,
132
126
  label: item.name,
133
127
  type: item.type,
134
- typeName: (_ifDoc$item$type$disp = (_ifDoc$item$type = ifDoc[item.type]) === null || _ifDoc$item$type === void 0 ? void 0 : _ifDoc$item$type.displayName) !== null && _ifDoc$item$type$disp !== void 0 ? _ifDoc$item$type$disp : "",
128
+ typeName: (_ifDoc$item$type$disp = (_ifDoc$item$type = ifDoc[item.type]) === null || _ifDoc$item$type === void 0 ? void 0 : _ifDoc$item$type.displayName) !== null && _ifDoc$item$type$disp !== void 0 ? _ifDoc$item$type$disp : '',
135
129
  disabled: usedPorts.indexOf(item.id) >= 0,
136
130
  ratedBandwidth: parseInt(item.ratedBandwidth, 10)
137
131
  };
138
132
  portsDoc[item.id] = obj;
139
133
  return obj;
134
+ }).filter(function (item) {
135
+ return !item.disabled;
140
136
  });
141
137
  return _context.abrupt("return", {
142
138
  ports: ports,
@@ -161,96 +157,93 @@ function AddLinkDrawer(props) {
161
157
  */
162
158
 
163
159
 
164
- var handleEvent = /*#__PURE__*/function () {
160
+ var handleSelectTargetNodeEvent = /*#__PURE__*/function () {
165
161
  var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(e) {
166
- var sourcePorts, targetPorts, source, target, targetDisableCreatePhyAggLink, connect_type;
162
+ var sourcePorts, targetPorts, source, target;
167
163
  return _regeneratorRuntime.wrap(function _callee2$(_context2) {
168
164
  while (1) {
169
165
  switch (_context2.prev = _context2.next) {
170
166
  case 0:
171
- linkNodesRef.current = e; // const { type, data } = e;
172
-
173
- rlog.debug("接到打开创建链路抽屉信息", e);
174
- setIsAddMode(true); // setTrue();
175
-
167
+ resetConnectableNodes();
168
+ linkNodesRef.current = e;
169
+ rlog.debug('接到打开创建链路抽屉信息', e);
170
+ setIsAddMode(true);
176
171
  setLoadingFormData(true);
177
- _context2.prev = 4;
178
- _context2.next = 7;
172
+ _context2.prev = 5;
173
+ _context2.next = 8;
179
174
  return getPortsById(e.source._attrObject.id);
180
175
 
181
- case 7:
176
+ case 8:
182
177
  sourcePorts = _context2.sent;
183
- _context2.next = 10;
178
+ _context2.next = 11;
184
179
  return getPortsById(e.target._attrObject.id);
185
180
 
186
- case 10:
181
+ case 11:
187
182
  targetPorts = _context2.sent;
188
183
  setSourceIFDoc(sourcePorts.portsDoc);
189
184
  setTargetIFDoc(targetPorts.portsDoc);
190
185
  source = translationNode(e.source, sourcePorts);
191
186
  target = translationNode(e.target, targetPorts);
192
- targetDisableCreatePhyAggLink = !target.ciData || !(target.ciData.permission.writeable || target.ciData.permission.deleteable);
193
187
  editDispatchers.update({
194
188
  addLinkIsOpen: true,
195
189
  currentLink: null
196
190
  });
197
- connect_type = target.ciType !== "customNode" && target.ipAddress && targetPorts.ports.length > 0 && !targetDisableCreatePhyAggLink ? "phy" : "exit";
198
191
  setLink({
199
192
  source: source,
200
193
  target: target,
201
194
  attributes: {
202
- "network_link.destination_ipv4 ": target.ipAddress,
203
- destination_id: "",
204
- source_type: "",
205
- display_name: "",
206
- destination_type: "",
207
- "network_link.source_ipv4 ": source.ipAddress,
208
- name: "",
209
- source_id: "",
210
- "network_link.source_device_id": source.id,
211
- "network_link.destination_device_id": target.id,
212
- "network_link.actual_bandwidth": null,
213
- connect_type: connect_type
195
+ display_name: '',
196
+ name: '',
197
+ source_id: '',
198
+ source_type: '',
199
+ 'network_link.source_device_id': source.id,
200
+ 'network_link.source_device_ipv4': source.ipAddress,
201
+ destination_id: '',
202
+ destination_type: '',
203
+ 'network_link.destination_device_id': target.id,
204
+ 'network_link.destination_device_ipv4': target.ipAddress,
205
+ 'network_link.actual_bandwidth': null
214
206
  }
215
207
  });
216
- _context2.next = 24;
208
+ _context2.next = 23;
217
209
  break;
218
210
 
219
- case 21:
220
- _context2.prev = 21;
221
- _context2.t0 = _context2["catch"](4);
222
- rlog.error("出现异常", _context2.t0);
211
+ case 20:
212
+ _context2.prev = 20;
213
+ _context2.t0 = _context2["catch"](5);
214
+ rlog.error('出现异常', _context2.t0);
223
215
 
224
- case 24:
216
+ case 23:
225
217
  setLoadingFormData(false);
226
218
 
227
- case 25:
219
+ case 24:
228
220
  case "end":
229
221
  return _context2.stop();
230
222
  }
231
223
  }
232
- }, _callee2, null, [[4, 21]]);
224
+ }, _callee2, null, [[5, 20]]);
233
225
  }));
234
226
 
235
- return function handleEvent(_x3) {
227
+ return function handleSelectTargetNodeEvent(_x3) {
236
228
  return _ref2.apply(this, arguments);
237
229
  };
238
230
  }();
239
231
 
240
- var selectedSourceNodeHandleEvent = function selectedSourceNodeHandleEvent(e) {
232
+ var handleSelectSourceNodeEvent = function handleSelectSourceNodeEvent(e) {
241
233
  // rlog.debug("设置了起始节点", e);
242
- //const allData = topo.getData();
234
+ topo.historyManager.setDisabled(true);
243
235
  var enableNodes = getNodes(topo.getDataModel());
244
- topo.view.topoClient.emitEvent("topo_link_set_connectable_nodes", enableNodes.filter(function (ele) {
236
+ topo.view.topoClient.emitEvent('topo_link_set_connectable_nodes', enableNodes.filter(function (ele) {
245
237
  return !(isGroup(ele) && !ele.a('ciType'));
246
238
  }));
239
+ topo.historyManager.setDisabled(false);
247
240
  };
248
241
 
249
242
  var initEditLineData = /*#__PURE__*/function () {
250
243
  var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3() {
251
244
  var _currentLink$attribut, _sourcePorts$ports, _currentLink$attribut2, _targetPorts$ports;
252
245
 
253
- var sourcePorts, targetPorts, connect_type;
246
+ var sourcePorts, targetPorts;
254
247
  return _regeneratorRuntime.wrap(function _callee3$(_context3) {
255
248
  while (1) {
256
249
  switch (_context3.prev = _context3.next) {
@@ -267,14 +260,12 @@ function AddLinkDrawer(props) {
267
260
  targetPorts = _context3.sent;
268
261
  setSourceIFDoc(sourcePorts.portsDoc);
269
262
  setTargetIFDoc(targetPorts.portsDoc);
270
- connect_type = currentLink.attributes["network_link.connect_type"] === "exit" ? "exit" : "phy";
271
263
  setLink({
272
264
  source: {
273
265
  ciData: topo.dataModel.getDataById(currentLink.source),
274
266
  id: currentLink.source,
275
- name: currentLink.attributes["network_link.source_device_id_object"].displayName,
276
- ciId: currentLink.attributes["network_link.source_device_id"],
277
- ipAddress: currentLink.attributes["network_link.source_ipv4"],
267
+ name: currentLink.attributes['network_link.source_device_id_object'].displayName,
268
+ ciId: currentLink.attributes['network_link.source_device_id'],
278
269
  ciName: (_currentLink$attribut = currentLink.attributes.source_type_object) === null || _currentLink$attribut === void 0 ? void 0 : _currentLink$attribut.displayName,
279
270
  ciType: currentLink.attributes.source_type,
280
271
  interfaceSource: currentLink.interfaceSource,
@@ -284,22 +275,20 @@ function AddLinkDrawer(props) {
284
275
  target: {
285
276
  ciData: topo.dataModel.getDataById(currentLink.target),
286
277
  id: currentLink.target,
287
- name: currentLink.attributes["network_link.destination_device_id_object"].displayName,
288
- ciId: currentLink.attributes["network_link.destination_device_id"],
289
- ipAddress: currentLink.attributes["network_link.destination_ipv4"],
278
+ name: currentLink.attributes['network_link.destination_device_id_object'].displayName,
279
+ ciId: currentLink.attributes['network_link.destination_device_id'],
290
280
  ciName: (_currentLink$attribut2 = currentLink.attributes.destination_type_object) === null || _currentLink$attribut2 === void 0 ? void 0 : _currentLink$attribut2.displayName,
291
- ciType: currentLink.target !== "" ? currentLink.attributes.destination_type : "customNode",
281
+ ciType: currentLink.target !== '' ? currentLink.attributes.destination_type : 'customNode',
292
282
  interfaceTarget: currentLink.interfaceTarget,
293
283
  ports: (_targetPorts$ports = targetPorts.ports) !== null && _targetPorts$ports !== void 0 ? _targetPorts$ports : [],
294
284
  portsDoc: targetPorts.portsDoc
295
285
  },
296
286
  attributes: _extends({}, currentLink.attributes, {
297
- linkId: currentLink.id,
298
- connect_type: connect_type
287
+ linkId: currentLink.id
299
288
  })
300
289
  });
301
290
 
302
- case 10:
291
+ case 9:
303
292
  case "end":
304
293
  return _context3.stop();
305
294
  }
@@ -323,89 +312,22 @@ function AddLinkDrawer(props) {
323
312
  if (!addLinkIsOpen) {
324
313
  setLink(null);
325
314
  }
326
- }, [addLinkIsOpen]);
327
-
328
- var getCiTypesConnectable = /*#__PURE__*/function () {
329
- var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee4() {
330
- var ciNodes, ciTypes, ciTypesConnectable, nodes, ciIds, isWriteable;
331
- return _regeneratorRuntime.wrap(function _callee4$(_context4) {
332
- while (1) {
333
- switch (_context4.prev = _context4.next) {
334
- case 0:
335
- ciNodes = [];
336
- setLoadingConnectableNodes(true);
337
- _context4.prev = 2;
338
- ciTypes = getCiTypes(topo.dataModel.getData());
339
- _context4.next = 6;
340
- return topoService.networkLink.getCiTypesConnectable(ciTypes);
341
-
342
- case 6:
343
- ciTypesConnectable = _context4.sent;
344
- nodes = getNodes(topo.getDataModel());
345
- ciIds = [];
346
-
347
- isWriteable = function isWriteable(node) {
348
- var _node$a;
349
-
350
- return ["delete", "write"].indexOf(node.a("operation")) >= 0 || ((_node$a = node.a('permission')) === null || _node$a === void 0 ? void 0 : _node$a.writeable);
351
- };
352
-
353
- nodes.forEach(function (node) {
354
- // rlog.debug("过滤属性", node.a("operation"));
355
- if (ciTypesConnectable[node.a("ciType")] && isWriteable(node)) {
356
- ciIds.push(node.id);
357
- ciNodes.push(node);
358
- }
359
- });
360
- linkDispatchers.update({
361
- ciConnectable: ciIds
362
- });
363
- setCiIdsConnectable(ciIds);
364
- _context4.next = 18;
365
- break;
366
-
367
- case 15:
368
- _context4.prev = 15;
369
- _context4.t0 = _context4["catch"](2);
370
- rlog.error('查询可创建链路节点失败', _context4.t0);
371
-
372
- case 18:
373
- setLoadingConnectableNodes(false);
374
- return _context4.abrupt("return", ciNodes);
375
-
376
- case 20:
377
- case "end":
378
- return _context4.stop();
379
- }
380
- }
381
- }, _callee4, null, [[2, 15]]);
382
- }));
383
-
384
- return function getCiTypesConnectable() {
385
- return _ref4.apply(this, arguments);
386
- };
387
- }(); // 注册事件
388
-
315
+ }, [addLinkIsOpen]); // 注册事件
389
316
 
390
317
  useEffect(function () {
391
318
  var notifier = topo.view.topoClient.notifier; // rlog.debug("注册事件");
392
- // 进入划线模式,置灰不可用的节点
319
+ // 进入链路模式
393
320
 
394
- var enterHandleEvent = function enterHandleEvent() {
395
- getCiTypesConnectable().then(function (ciNodes) {
396
- // rlog.debug("设置可连线节点", ciIdsConnectable, ciNodes);
397
- topo.view.topoClient.emitEvent("topo_link_set_connectable_nodes", ciNodes);
398
- });
399
- };
321
+ notifier.on(TopoCenterEvent.TOPO_LINK_ENTER_CREATE_MODE, enterAddLinkMode); // 选择第一个节点
322
+
323
+ notifier.on(TopoCenterEvent.TOPO_LINK_SELECT_SOURCE_NODE, handleSelectSourceNodeEvent); // 选择第二个节点
400
324
 
401
- notifier.on(TopoCenterEvent.TOPO_LINK_ENTER_CREATE_MODE, enterHandleEvent);
402
- notifier.on(TopoCenterEvent.TOPO_LINK_CREATED, handleEvent);
403
- notifier.on(TopoCenterEvent.TOPO_LINK_SELECT_SOURCE_NODE, selectedSourceNodeHandleEvent);
325
+ notifier.on(TopoCenterEvent.TOPO_LINK_CREATED, handleSelectTargetNodeEvent);
404
326
  return function () {
405
327
  // 取消注册事件
406
328
  // rlog.debug("取消注册事件");
407
- notifier.off(TopoCenterEvent.TOPO_LINK_ENTER_CREATE_MODE, enterHandleEvent);
408
- notifier.off(TopoCenterEvent.TOPO_LINK_CREATED, handleEvent);
329
+ notifier.off(TopoCenterEvent.TOPO_LINK_ENTER_CREATE_MODE, enterAddLinkMode);
330
+ notifier.off(TopoCenterEvent.TOPO_LINK_CREATED, handleSelectTargetNodeEvent);
409
331
  };
410
332
  }, []);
411
333
 
@@ -420,7 +342,7 @@ function AddLinkDrawer(props) {
420
342
  ciId: attrObject.id,
421
343
  ipAddress: attrObject.ipAddress,
422
344
  ciName: (_topo$ciTyeCache$getC = (_topo$ciTyeCache$getC2 = topo.ciTyeCache.getCiType(attrObject.ciType)) === null || _topo$ciTyeCache$getC2 === void 0 ? void 0 : _topo$ciTyeCache$getC2.displayName) !== null && _topo$ciTyeCache$getC !== void 0 ? _topo$ciTyeCache$getC : attrObject.customName,
423
- ciType: (_attrObject$ciType = attrObject.ciType) !== null && _attrObject$ciType !== void 0 ? _attrObject$ciType : "customNode",
345
+ ciType: (_attrObject$ciType = attrObject.ciType) !== null && _attrObject$ciType !== void 0 ? _attrObject$ciType : 'customNode',
424
346
  ports: (_Ports$ports = Ports.ports) !== null && _Ports$ports !== void 0 ? _Ports$ports : [],
425
347
  portsDoc: Ports.portsDoc
426
348
  };
@@ -435,10 +357,10 @@ function AddLinkDrawer(props) {
435
357
  });
436
358
  };
437
359
 
438
- var addLinkToGraph = function addLinkToGraph(_ref5) {
439
- var linkData = _ref5.linkData,
440
- linkType = _ref5.linkType,
441
- targetName = _ref5.targetName;
360
+ var addLinkToGraph = function addLinkToGraph(_ref4) {
361
+ var linkData = _ref4.linkData,
362
+ isExportLink = _ref4.isExportLink,
363
+ targetName = _ref4.targetName;
442
364
  var htTopo = topo.getHtTopo();
443
365
  var _linkNodesRef$current = linkNodesRef.current,
444
366
  source = _linkNodesRef$current.source,
@@ -447,8 +369,9 @@ function AddLinkDrawer(props) {
447
369
  try {
448
370
  // 获取两个节点间的连线数据列表
449
371
  var edgesInNodes = getEdgesBetweenNodes(source, target);
372
+ var _isGroup = false; // linkType === "agg"
450
373
 
451
- if (linkType === "agg") {
374
+ if (_isGroup) {
452
375
  // 聚合链路
453
376
  if (edgesInNodes.length === 0) {
454
377
  htTopo.createEdge(source, target, linkData);
@@ -462,9 +385,9 @@ function AddLinkDrawer(props) {
462
385
  // 有连线组无子连线时,设置连线数据,切换到连线并选中
463
386
  var edge = htTopo.createEdge(source, target, linkData);
464
387
 
465
- if (linkType === "exit" && target.getTag() === undefined) {
388
+ if (isExportLink && target.getTag() === undefined) {
466
389
  // rlog.debug("addLinkToGraph-export-target", target, target.getTag());
467
- target.a("name", targetName);
390
+ target.a('name', targetName);
468
391
  }
469
392
 
470
393
  htTopo.toggleEdgeGroup(source, target, true);
@@ -472,30 +395,30 @@ function AddLinkDrawer(props) {
472
395
 
473
396
  topo.getGraphView().dm().sm().ss(topo.getDataModel().getDataByTag(linkData.id));
474
397
  } catch (error) {
475
- rlog.error("addLinkToGraph", error);
398
+ rlog.error('addLinkToGraph', error);
476
399
  }
477
400
  };
478
401
 
479
- var mergeExportLinkData = function mergeExportLinkData(data, attributes) {
402
+ var mergeExportLinkData = function mergeExportLinkData(data, attributes, linkFormAttributes) {
480
403
  var _sourceIFDoc$data$sou, _targetIFDoc$data$des;
481
404
 
482
405
  // console.log("mergeExportLinkData", data, attributes);
483
406
  return _extends({}, attributes, {
484
407
  id: data.id,
485
408
  name: data.name,
486
- source: data["network_link.source_device_id"],
487
- target: data["network_link.destination_device_id"],
409
+ source: data['network_link.source_device_id'],
410
+ target: data['network_link.destination_device_id'],
488
411
  operation: data.operation,
489
- interfaceSource: data["source_id"],
490
- interfaceTarget: data["destination_id"],
412
+ interfaceSource: data['source_id'],
413
+ interfaceTarget: data['destination_id'],
491
414
  ciType: data.ciType,
492
- attributes: _extends({}, attributes.attributes, {
415
+ attributes: _extends({}, attributes.attributes, linkFormAttributes, {
493
416
  display_name: data.display_name,
494
417
  name: data.name,
495
- "network_link.actual_bandwidth": data["network_link.actual_bandwidth"],
496
- "network_link.connect_type": data["network_link.connect_type"],
497
- "network_link.destination_ipv4": data["network_link.destination_ipv4"],
498
- "network_link.source_device_id": data["network_link.source_device_id"],
418
+ 'network_link.actual_bandwidth': data['network_link.actual_bandwidth'],
419
+ 'network_link.connect_type': data['network_link.connect_type'],
420
+ 'network_link.destination_ipv4': data['network_link.destination_ipv4'],
421
+ 'network_link.source_device_id': data['network_link.source_device_id'],
499
422
  source_id: data.source_id,
500
423
  support_templates: data.support_templates,
501
424
  use: data.use,
@@ -510,12 +433,12 @@ function AddLinkDrawer(props) {
510
433
  };
511
434
 
512
435
  var onSave = /*#__PURE__*/function () {
513
- var _ref6 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee5(data) {
514
- var parm, result, linkType, config, exportLinkIdList, _yield$editDispatcher, elements, linkData, edge, aobj, target, links, linkAttrKey, newLinkData, newLinks, newData, _config, _yield$editDispatcher2, _elements;
436
+ var _ref5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee4(data) {
437
+ var parm, result, config, isExportLink, exportLinkIdList, _yield$editDispatcher, elements, linkData, edge, aobj, target, links, linkAttrKey, newLinkData, newLinks, newData, _config, _yield$editDispatcher2, _elements;
515
438
 
516
- return _regeneratorRuntime.wrap(function _callee5$(_context5) {
439
+ return _regeneratorRuntime.wrap(function _callee4$(_context4) {
517
440
  while (1) {
518
- switch (_context5.prev = _context5.next) {
441
+ switch (_context4.prev = _context4.next) {
519
442
  case 0:
520
443
  //editDispatchers.update({ addLinkIsOpen: false });
521
444
  // console.log("保存链路信息", isAddMode, data);
@@ -526,77 +449,80 @@ function AddLinkDrawer(props) {
526
449
  result = null;
527
450
 
528
451
  if (!isAddMode) {
529
- _context5.next = 9;
452
+ _context4.next = 9;
530
453
  break;
531
454
  }
532
455
 
533
- _context5.next = 6;
456
+ _context4.next = 6;
534
457
  return service.addLink(parm);
535
458
 
536
459
  case 6:
537
- result = _context5.sent;
538
- _context5.next = 13;
460
+ result = _context4.sent;
461
+ _context4.next = 13;
539
462
  break;
540
463
 
541
464
  case 9:
542
465
  parm.id = currentLink.id;
543
- _context5.next = 12;
466
+ _context4.next = 12;
544
467
  return service.editLink(parm);
545
468
 
546
469
  case 12:
547
- result = _context5.sent;
470
+ result = _context4.sent;
548
471
 
549
472
  case 13:
550
- setLoading(false);
551
- linkType = data["network_link.connect_type"];
552
- _context5.prev = 15;
473
+ topo.historyManager.setDisabled(true, '保存链路');
474
+ _context4.prev = 14;
553
475
 
554
476
  if (!result) {
555
- _context5.next = 55;
477
+ _context4.next = 59;
556
478
  break;
557
479
  }
558
480
 
559
- config = topo.resourceConfig.getConfigFromHt(); // 新建后显示到图上
481
+ config = topo.resourceConfig.getConfigFromHt();
482
+ isExportLink = !data['network_link.destination_device_id']; // 新建后显示到图上
560
483
 
561
484
  if (!isAddMode) {
562
- _context5.next = 31;
485
+ _context4.next = 33;
563
486
  break;
564
487
  }
565
488
 
566
489
  exportLinkIdList = config.exportLinkIdList;
567
490
 
568
- if (data["network_link.connect_type"] === "exit") {
491
+ if (isExportLink) {
569
492
  exportLinkIdList.push(result);
570
493
  }
571
494
 
572
- topo.resourceConfig.updateConfig(_extends({}, config, {
495
+ _context4.next = 23;
496
+ return topo.resourceConfig.updateConfig(_extends({}, config, {
573
497
  exportLinkIdList: exportLinkIdList
574
- })); // const linkType = data["network_link.connect_type"];
498
+ }));
575
499
 
576
- _context5.next = 24;
500
+ case 23:
501
+ _context4.next = 25;
577
502
  return editDispatchers.fetchDataByConfig();
578
503
 
579
- case 24:
580
- _yield$editDispatcher = _context5.sent;
504
+ case 25:
505
+ _yield$editDispatcher = _context4.sent;
581
506
  elements = _yield$editDispatcher.elements;
582
507
  linkData = elements.find(function (element) {
583
508
  return element.id === result;
584
509
  }); // console.log("创建成功-parm,linkData", parm, linkData);
585
510
 
511
+ topo.historyManager.setDisabled(true, '保存链路');
586
512
  addLinkToGraph({
587
513
  linkData: clone(linkData),
588
- linkType: linkType,
589
- targetName: data["network_link.destination_ipv4"]
514
+ isExportLink: isExportLink,
515
+ targetName: data['network_link.destination_ipv4']
590
516
  });
591
517
 
592
- _Message.success("创建成功");
518
+ _Message.success('创建成功');
593
519
 
594
- _context5.next = 53;
520
+ _context4.next = 56;
595
521
  break;
596
522
 
597
- case 31:
598
- if (!(linkType === "exit")) {
599
- _context5.next = 46;
523
+ case 33:
524
+ if (!isExportLink) {
525
+ _context4.next = 49;
600
526
  break;
601
527
  }
602
528
 
@@ -606,64 +532,77 @@ function AddLinkDrawer(props) {
606
532
  target = edge.getTarget();
607
533
 
608
534
  if (target.getTag() === undefined) {
609
- target.a("name", data["network_link.destination_ipv4"]);
535
+ target.a('name', data['network_link.destination_ipv4']);
610
536
  }
611
537
 
612
538
  links = topoState.data.links;
613
539
  linkAttrKey = links.findIndex(function (item) {
614
540
  return item.id === aobj.id;
615
541
  });
616
- newLinkData = mergeExportLinkData(edge.getAttrObject(), links[linkAttrKey]);
542
+ newLinkData = mergeExportLinkData(edge.getAttrObject(), links[linkAttrKey], data);
617
543
  newLinks = clone(links);
618
544
  newLinks.splice(linkAttrKey, 1, newLinkData);
619
545
  newData = _extends({}, topoState.data, {
620
546
  links: newLinks
621
547
  });
622
- topoDispatchers.update({
548
+ _context4.next = 47;
549
+ return topoDispatchers.update({
623
550
  data: newData
624
551
  });
625
- _context5.next = 52;
552
+
553
+ case 47:
554
+ _context4.next = 55;
626
555
  break;
627
556
 
628
- case 46:
557
+ case 49:
629
558
  _config = topo.resourceConfig.getConfigFromHt();
630
559
  topo.resourceConfig.updateConfig(_config);
631
- _context5.next = 50;
560
+ _context4.next = 53;
632
561
  return editDispatchers.fetchDataByConfig();
633
562
 
634
- case 50:
635
- _yield$editDispatcher2 = _context5.sent;
563
+ case 53:
564
+ _yield$editDispatcher2 = _context4.sent;
636
565
  _elements = _yield$editDispatcher2.elements;
637
566
 
638
- case 52:
639
- _Message.success("保存成功");
567
+ case 55:
568
+ _Message.success('保存成功');
640
569
 
641
- case 53:
642
- editDispatchers.update({
570
+ case 56:
571
+ _context4.next = 58;
572
+ return editDispatchers.update({
643
573
  addLinkIsOpen: false,
644
574
  currentLink: null
645
575
  });
576
+
577
+ case 58:
646
578
  topo.linkDynamicStyleExecutor.execute();
647
579
 
648
- case 55:
649
- _context5.next = 60;
580
+ case 59:
581
+ _context4.next = 65;
650
582
  break;
651
583
 
652
- case 57:
653
- _context5.prev = 57;
654
- _context5.t0 = _context5["catch"](15);
655
- rlog.debug("保存链路信息异常", _context5.t0);
584
+ case 61:
585
+ _context4.prev = 61;
586
+ _context4.t0 = _context4["catch"](14);
587
+
588
+ _Message.error('保存失败');
589
+
590
+ rlog.error('保存链路信息异常', _context4.t0);
656
591
 
657
- case 60:
592
+ case 65:
593
+ setLoading(false);
594
+ topo.historyManager.setDisabled(false, '保存链路');
595
+
596
+ case 67:
658
597
  case "end":
659
- return _context5.stop();
598
+ return _context4.stop();
660
599
  }
661
600
  }
662
- }, _callee5, null, [[15, 57]]);
601
+ }, _callee4, null, [[14, 61]]);
663
602
  }));
664
603
 
665
604
  return function onSave(_x4) {
666
- return _ref6.apply(this, arguments);
605
+ return _ref5.apply(this, arguments);
667
606
  };
668
607
  }();
669
608
 
@@ -674,10 +613,10 @@ function AddLinkDrawer(props) {
674
613
  visible: loadingFormData,
675
614
  fullScreen: true
676
615
  }), /*#__PURE__*/React.createElement(_Drawer, {
677
- closeMode: ["close", "esc"],
616
+ closeMode: ['close', 'esc'],
678
617
  visible: addLinkIsOpen,
679
618
  onClose: closeDrawer,
680
- title: isAddMode ? "添加链路" : "编辑链路",
619
+ title: isAddMode ? '添加链路' : '编辑链路',
681
620
  className: styles.drawer
682
621
  }, addLinkIsOpen && link && /*#__PURE__*/React.createElement(EditLinkInfo, {
683
622
  lineData: link,