@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
@@ -87,43 +87,95 @@ var useTopoEdit = function useTopoEdit(params) {
87
87
  setShowComboResDrawer(true);
88
88
  };
89
89
 
90
- var onLayerAdded = function onLayerAdded(_ref2) {
91
- var target = _ref2.target,
92
- direction = _ref2.direction;
93
- // 从拓扑图获取分层和资源配置
94
- var config = resourceConfig.getConfigFromHt(topo.getDataModel());
95
- rlog.info("onLayerAdd", {
96
- config: config
97
- }); // 如果非分层拓扑且有分层,切换到分层模板,设置方向
98
-
99
- if (!isLayerTopo && config.layers.length) {
100
- topoDispatchers.setTopoType(TPL_TREE);
101
- } // 更新配置
102
- // resourceConfig.updateConfig(config);
103
- // 更新配置对应的资源、链路
104
- // editDispatchers.fetchDataByConfig();
90
+ var onLayerAdded = /*#__PURE__*/function () {
91
+ var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(_ref2) {
92
+ var target, direction, config;
93
+ return _regeneratorRuntime.wrap(function _callee2$(_context2) {
94
+ while (1) {
95
+ switch (_context2.prev = _context2.next) {
96
+ case 0:
97
+ target = _ref2.target, direction = _ref2.direction;
98
+ topo.historyManager.beginTransaction(); // 从拓扑图获取分层和资源配置
105
99
 
106
- };
100
+ config = resourceConfig.getConfigFromHt(topo.getDataModel());
101
+ rlog.info("onLayerAdd", {
102
+ config: config
103
+ }); // 如果非分层拓扑且有分层,切换到分层模板,设置方向
107
104
 
108
- var deleteLayer = function deleteLayer(layerElement) {
109
- topo.historyManager.beginTransaction();
110
- emitEvent(TopoEvent.EVENT_TRIGGER_DELETE, layerElement); // 获取资源配置
105
+ if (!(!isLayerTopo && config.layers.length)) {
106
+ _context2.next = 7;
107
+ break;
108
+ }
111
109
 
112
- var config = resourceConfig.getConfigFromHt(topo.getDataModel());
113
- rlog.info("deleteLayer", {
114
- config: config
115
- }); // 如果没有分层,将拓扑类型切换为空白模板
110
+ _context2.next = 7;
111
+ return topoDispatchers.setTopoType(TPL_TREE);
116
112
 
117
- if (!config.layers.length) {
118
- topoDispatchers.setTopoType(TPL_BLANK);
119
- } // 更新配置
113
+ case 7:
114
+ // 更新配置
115
+ // resourceConfig.updateConfig(config);
116
+ // 更新配置对应的资源、链路
117
+ // editDispatchers.fetchDataByConfig();
118
+ topo.historyManager.endTransaction();
120
119
 
120
+ case 8:
121
+ case "end":
122
+ return _context2.stop();
123
+ }
124
+ }
125
+ }, _callee2);
126
+ }));
121
127
 
122
- resourceConfig.updateConfig(config); // 更新配置对应的资源、链路
128
+ return function onLayerAdded(_x) {
129
+ return _ref3.apply(this, arguments);
130
+ };
131
+ }();
123
132
 
124
- editDispatchers.fetchDataByConfig();
125
- topo.historyManager.endTransaction();
126
- };
133
+ var deleteLayer = /*#__PURE__*/function () {
134
+ var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3(layerElement) {
135
+ var config;
136
+ return _regeneratorRuntime.wrap(function _callee3$(_context3) {
137
+ while (1) {
138
+ switch (_context3.prev = _context3.next) {
139
+ case 0:
140
+ topo.historyManager.beginTransaction();
141
+ emitEvent(TopoEvent.EVENT_TRIGGER_DELETE, layerElement); // 获取资源配置
142
+
143
+ config = resourceConfig.getConfigFromHt(topo.getDataModel());
144
+ rlog.info("deleteLayer", {
145
+ config: config
146
+ }); // 如果没有分层,将拓扑类型切换为空白模板
147
+
148
+ if (config.layers.length) {
149
+ _context3.next = 7;
150
+ break;
151
+ }
152
+
153
+ _context3.next = 7;
154
+ return topoDispatchers.setTopoType(TPL_BLANK);
155
+
156
+ case 7:
157
+ _context3.next = 9;
158
+ return resourceConfig.updateConfig(config);
159
+
160
+ case 9:
161
+ _context3.next = 11;
162
+ return editDispatchers.fetchDataByConfig();
163
+
164
+ case 11:
165
+ topo.historyManager.endTransaction();
166
+
167
+ case 12:
168
+ case "end":
169
+ return _context3.stop();
170
+ }
171
+ }
172
+ }, _callee3);
173
+ }));
174
+
175
+ return function deleteLayer(_x2) {
176
+ return _ref4.apply(this, arguments);
177
+ };
178
+ }();
127
179
 
128
180
  var handleDeleteLayer = function handleDeleteLayer(layerElement) {
129
181
  var hasChildren = !!layerElement.getChildren().toArray().length;
@@ -144,19 +196,19 @@ var useTopoEdit = function useTopoEdit(params) {
144
196
  type: "warning"
145
197
  },
146
198
  onOk: function () {
147
- var _onOk = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
148
- return _regeneratorRuntime.wrap(function _callee2$(_context2) {
199
+ var _onOk = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee4() {
200
+ return _regeneratorRuntime.wrap(function _callee4$(_context4) {
149
201
  while (1) {
150
- switch (_context2.prev = _context2.next) {
202
+ switch (_context4.prev = _context4.next) {
151
203
  case 0:
152
204
  deleteLayer(layerElement);
153
205
 
154
206
  case 1:
155
207
  case "end":
156
- return _context2.stop();
208
+ return _context4.stop();
157
209
  }
158
210
  }
159
- }, _callee2);
211
+ }, _callee4);
160
212
  }));
161
213
 
162
214
  function onOk() {
@@ -202,19 +254,19 @@ var useTopoEdit = function useTopoEdit(params) {
202
254
  type: "warning"
203
255
  },
204
256
  onOk: function () {
205
- var _onOk2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3() {
206
- return _regeneratorRuntime.wrap(function _callee3$(_context3) {
257
+ var _onOk2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee5() {
258
+ return _regeneratorRuntime.wrap(function _callee5$(_context5) {
207
259
  while (1) {
208
- switch (_context3.prev = _context3.next) {
260
+ switch (_context5.prev = _context5.next) {
209
261
  case 0:
210
262
  doDelete();
211
263
 
212
264
  case 1:
213
265
  case "end":
214
- return _context3.stop();
266
+ return _context5.stop();
215
267
  }
216
268
  }
217
- }, _callee3);
269
+ }, _callee5);
218
270
  }));
219
271
 
220
272
  function onOk() {
@@ -309,20 +361,20 @@ var useTopoEdit = function useTopoEdit(params) {
309
361
 
310
362
 
311
363
  var deleteExLink = /*#__PURE__*/function () {
312
- var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee4(node) {
364
+ var _ref5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee6(node) {
313
365
  var _node$getEdges$toArra, _node$getEdges;
314
366
 
315
367
  var config, edges, exportLinkIdList;
316
- return _regeneratorRuntime.wrap(function _callee4$(_context4) {
368
+ return _regeneratorRuntime.wrap(function _callee6$(_context6) {
317
369
  while (1) {
318
- switch (_context4.prev = _context4.next) {
370
+ switch (_context6.prev = _context6.next) {
319
371
  case 0:
320
372
  config = resourceConfig.getConfig(); // console.log("删除关联在节点上的出口链路- node, config", node, config);
321
373
 
322
374
  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 = [];
323
375
 
324
376
  if (!(edges.length > 0)) {
325
- _context4.next = 8;
377
+ _context6.next = 8;
326
378
  break;
327
379
  }
328
380
 
@@ -336,19 +388,19 @@ var useTopoEdit = function useTopoEdit(params) {
336
388
  }
337
389
  });
338
390
  config.exportLinkIdList = exportLinkIdList;
339
- _context4.next = 8;
391
+ _context6.next = 8;
340
392
  return resourceConfig.updateConfig(config);
341
393
 
342
394
  case 8:
343
395
  case "end":
344
- return _context4.stop();
396
+ return _context6.stop();
345
397
  }
346
398
  }
347
- }, _callee4);
399
+ }, _callee6);
348
400
  }));
349
401
 
350
- return function deleteExLink(_x) {
351
- return _ref3.apply(this, arguments);
402
+ return function deleteExLink(_x3) {
403
+ return _ref5.apply(this, arguments);
352
404
  };
353
405
  }();
354
406
 
@@ -410,29 +462,29 @@ var useTopoEdit = function useTopoEdit(params) {
410
462
  */
411
463
 
412
464
 
413
- function bindGroupResources(_x2, _x3) {
465
+ function bindGroupResources(_x4, _x5) {
414
466
  return _bindGroupResources.apply(this, arguments);
415
467
  }
416
468
 
417
469
  function _bindGroupResources() {
418
- _bindGroupResources = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee10(group, resources) {
470
+ _bindGroupResources = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee12(group, resources) {
419
471
  var id, tag, _yield$editDispatcher2, elements, nodeElements, newLinkElements, updateElements;
420
472
 
421
- return _regeneratorRuntime.wrap(function _callee10$(_context10) {
473
+ return _regeneratorRuntime.wrap(function _callee12$(_context12) {
422
474
  while (1) {
423
- switch (_context10.prev = _context10.next) {
475
+ switch (_context12.prev = _context12.next) {
424
476
  case 0:
425
477
  id = group.id, tag = group.tag;
426
478
  rlog.debug("bindGroupResources--id, tag", id, tag);
427
- _context10.next = 4;
479
+ _context12.next = 4;
428
480
  return resourceConfig.updateGroupResources(group, resources);
429
481
 
430
482
  case 4:
431
- _context10.next = 6;
483
+ _context12.next = 6;
432
484
  return editDispatchers.fetchDataByConfig();
433
485
 
434
486
  case 6:
435
- _yield$editDispatcher2 = _context10.sent;
487
+ _yield$editDispatcher2 = _context12.sent;
436
488
  elements = _yield$editDispatcher2.elements;
437
489
  // 区域里的子区域及子区域的节点、新增的链路
438
490
  nodeElements = findGroupChildren(elements, group);
@@ -449,15 +501,15 @@ var useTopoEdit = function useTopoEdit(params) {
449
501
 
450
502
  case 12:
451
503
  case "end":
452
- return _context10.stop();
504
+ return _context12.stop();
453
505
  }
454
506
  }
455
- }, _callee10);
507
+ }, _callee12);
456
508
  }));
457
509
  return _bindGroupResources.apply(this, arguments);
458
510
  }
459
511
 
460
- function addGroupResources(_x4, _x5) {
512
+ function addGroupResources(_x6, _x7) {
461
513
  return _addGroupResources.apply(this, arguments);
462
514
  }
463
515
  /**
@@ -466,11 +518,11 @@ var useTopoEdit = function useTopoEdit(params) {
466
518
 
467
519
 
468
520
  function _addGroupResources() {
469
- _addGroupResources = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee11(group, newResourceIds) {
521
+ _addGroupResources = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee13(group, newResourceIds) {
470
522
  var groupConfig, resources, groupData;
471
- return _regeneratorRuntime.wrap(function _callee11$(_context11) {
523
+ return _regeneratorRuntime.wrap(function _callee13$(_context13) {
472
524
  while (1) {
473
- switch (_context11.prev = _context11.next) {
525
+ switch (_context13.prev = _context13.next) {
474
526
  case 0:
475
527
  groupConfig = resourceConfig.getGroupConfigByElement(group);
476
528
  resources = {
@@ -480,20 +532,20 @@ var useTopoEdit = function useTopoEdit(params) {
480
532
  id: group.getTag(),
481
533
  tag: group.a("tag")
482
534
  };
483
- _context11.next = 5;
535
+ _context13.next = 5;
484
536
  return bindGroupResources(groupData, resources, newResourceIds);
485
537
 
486
538
  case 5:
487
539
  case "end":
488
- return _context11.stop();
540
+ return _context13.stop();
489
541
  }
490
542
  }
491
- }, _callee11);
543
+ }, _callee13);
492
544
  }));
493
545
  return _addGroupResources.apply(this, arguments);
494
546
  }
495
547
 
496
- function bindViewResources(_x6) {
548
+ function bindViewResources(_x8) {
497
549
  return _bindViewResources.apply(this, arguments);
498
550
  }
499
551
  /**
@@ -505,25 +557,25 @@ var useTopoEdit = function useTopoEdit(params) {
505
557
 
506
558
 
507
559
  function _bindViewResources() {
508
- _bindViewResources = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee12(data) {
560
+ _bindViewResources = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee14(data) {
509
561
  var config, _yield$editDispatcher3, elements;
510
562
 
511
- return _regeneratorRuntime.wrap(function _callee12$(_context12) {
563
+ return _regeneratorRuntime.wrap(function _callee14$(_context14) {
512
564
  while (1) {
513
- switch (_context12.prev = _context12.next) {
565
+ switch (_context14.prev = _context14.next) {
514
566
  case 0:
515
567
  console.log("关联视图的资源", data);
516
568
  config = resourceConfig.getConfig();
517
569
  config.resources = data;
518
- _context12.next = 5;
570
+ _context14.next = 5;
519
571
  return resourceConfig.updateConfig(config);
520
572
 
521
573
  case 5:
522
- _context12.next = 7;
574
+ _context14.next = 7;
523
575
  return editDispatchers.fetchDataByConfig();
524
576
 
525
577
  case 7:
526
- _yield$editDispatcher3 = _context12.sent;
578
+ _yield$editDispatcher3 = _context14.sent;
527
579
  elements = _yield$editDispatcher3.elements;
528
580
  saveBind(TopoEvent.DATA_TYPE_RESOURCE_COMBO, elements); // 临时放这里,仅拓扑中心有
529
581
 
@@ -533,35 +585,37 @@ var useTopoEdit = function useTopoEdit(params) {
533
585
 
534
586
  case 11:
535
587
  case "end":
536
- return _context12.stop();
588
+ return _context14.stop();
537
589
  }
538
590
  }
539
- }, _callee12);
591
+ }, _callee14);
540
592
  }));
541
593
  return _bindViewResources.apply(this, arguments);
542
594
  }
543
595
 
544
- function addLayerResources(_x7, _x8) {
596
+ function addLayerResources(_x9, _x10) {
545
597
  return _addLayerResources.apply(this, arguments);
546
598
  }
547
599
 
548
600
  function _addLayerResources() {
549
- _addLayerResources = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee13(group, newResourceIds) {
601
+ _addLayerResources = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee15(group, newResourceIds) {
550
602
  var _yield$editDispatcher4, elements, data;
551
603
 
552
- return _regeneratorRuntime.wrap(function _callee13$(_context13) {
604
+ return _regeneratorRuntime.wrap(function _callee15$(_context15) {
553
605
  while (1) {
554
- switch (_context13.prev = _context13.next) {
606
+ switch (_context15.prev = _context15.next) {
555
607
  case 0:
556
- _context13.next = 2;
608
+ topo.historyManager.beginTransaction(); // 构造新的配置
609
+
610
+ _context15.next = 3;
557
611
  return resourceConfig.addLayerStaticResources(group, newResourceIds);
558
612
 
559
- case 2:
560
- _context13.next = 4;
613
+ case 3:
614
+ _context15.next = 5;
561
615
  return editDispatchers.fetchDataByConfig();
562
616
 
563
- case 4:
564
- _yield$editDispatcher4 = _context13.sent;
617
+ case 5:
618
+ _yield$editDispatcher4 = _context15.sent;
565
619
  elements = _yield$editDispatcher4.elements;
566
620
  // 过滤出新增的资源和链路
567
621
  data = {
@@ -576,46 +630,48 @@ var useTopoEdit = function useTopoEdit(params) {
576
630
  })
577
631
  }; // 添加到分层
578
632
 
579
- _context13.next = 9;
633
+ _context15.next = 10;
580
634
  return topo.updateElements(data);
581
635
 
582
- case 9:
636
+ case 10:
583
637
  // 临时放这里,仅拓扑中心有
584
638
  if (topo.linkDynamicStyleExecutor) {
585
639
  topo.linkDynamicStyleExecutor.execute();
586
640
  }
587
641
 
588
- case 10:
642
+ topo.historyManager.endTransaction();
643
+
644
+ case 12:
589
645
  case "end":
590
- return _context13.stop();
646
+ return _context15.stop();
591
647
  }
592
648
  }
593
- }, _callee13);
649
+ }, _callee15);
594
650
  }));
595
651
  return _addLayerResources.apply(this, arguments);
596
652
  }
597
653
 
598
- function addResourceToFirstLayer(_x9) {
654
+ function addResourceToFirstLayer(_x11) {
599
655
  return _addResourceToFirstLayer.apply(this, arguments);
600
656
  }
601
657
 
602
658
  function _addResourceToFirstLayer() {
603
- _addResourceToFirstLayer = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee14(data) {
659
+ _addResourceToFirstLayer = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee16(data) {
604
660
  var group;
605
- return _regeneratorRuntime.wrap(function _callee14$(_context14) {
661
+ return _regeneratorRuntime.wrap(function _callee16$(_context16) {
606
662
  while (1) {
607
- switch (_context14.prev = _context14.next) {
663
+ switch (_context16.prev = _context16.next) {
608
664
  case 0:
609
665
  group = resourceConfig.getGroups()[0];
610
- _context14.next = 3;
666
+ _context16.next = 3;
611
667
  return addLayerResources(group, data);
612
668
 
613
669
  case 3:
614
670
  case "end":
615
- return _context14.stop();
671
+ return _context16.stop();
616
672
  }
617
673
  }
618
- }, _callee14);
674
+ }, _callee16);
619
675
  }));
620
676
  return _addResourceToFirstLayer.apply(this, arguments);
621
677
  }
@@ -641,28 +697,28 @@ var useTopoEdit = function useTopoEdit(params) {
641
697
  }
642
698
 
643
699
  var onSaveComboRes = /*#__PURE__*/function () {
644
- var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee5(data) {
645
- return _regeneratorRuntime.wrap(function _callee5$(_context5) {
700
+ var _ref6 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee7(data) {
701
+ return _regeneratorRuntime.wrap(function _callee7$(_context7) {
646
702
  while (1) {
647
- switch (_context5.prev = _context5.next) {
703
+ switch (_context7.prev = _context7.next) {
648
704
  case 0:
649
705
  rlog.debug("关联资源-----onSaveComboRes", data);
650
706
  topo.historyManager.beginTransaction();
651
707
 
652
708
  if (!(getAddResourceType() === "addToFirstLayer")) {
653
- _context5.next = 7;
709
+ _context7.next = 7;
654
710
  break;
655
711
  }
656
712
 
657
- _context5.next = 5;
713
+ _context7.next = 5;
658
714
  return addResourceToFirstLayer(data);
659
715
 
660
716
  case 5:
661
- _context5.next = 9;
717
+ _context7.next = 9;
662
718
  break;
663
719
 
664
720
  case 7:
665
- _context5.next = 9;
721
+ _context7.next = 9;
666
722
  return bindViewResources(data);
667
723
 
668
724
  case 9:
@@ -670,43 +726,43 @@ var useTopoEdit = function useTopoEdit(params) {
670
726
 
671
727
  case 10:
672
728
  case "end":
673
- return _context5.stop();
729
+ return _context7.stop();
674
730
  }
675
731
  }
676
- }, _callee5);
732
+ }, _callee7);
677
733
  }));
678
734
 
679
- return function onSaveComboRes(_x10) {
680
- return _ref4.apply(this, arguments);
735
+ return function onSaveComboRes(_x12) {
736
+ return _ref6.apply(this, arguments);
681
737
  };
682
738
  }();
683
739
 
684
- function checkSavePermission(_x11) {
740
+ function checkSavePermission(_x13) {
685
741
  return _checkSavePermission.apply(this, arguments);
686
742
  }
687
743
 
688
744
  function _checkSavePermission() {
689
- _checkSavePermission = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee15(id) {
745
+ _checkSavePermission = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee17(id) {
690
746
  var permission;
691
- return _regeneratorRuntime.wrap(function _callee15$(_context15) {
747
+ return _regeneratorRuntime.wrap(function _callee17$(_context17) {
692
748
  while (1) {
693
- switch (_context15.prev = _context15.next) {
749
+ switch (_context17.prev = _context17.next) {
694
750
  case 0:
695
- _context15.next = 2;
751
+ _context17.next = 2;
696
752
  return topoDispatchers.getTopoPermission({
697
753
  id: id,
698
754
  update: false
699
755
  });
700
756
 
701
757
  case 2:
702
- permission = _context15.sent;
758
+ permission = _context17.sent;
703
759
 
704
760
  if (!topoPermissonUtil.isEditable(permission)) {
705
- _context15.next = 5;
761
+ _context17.next = 5;
706
762
  break;
707
763
  }
708
764
 
709
- return _context15.abrupt("return", true);
765
+ return _context17.abrupt("return", true);
710
766
 
711
767
  case 5:
712
768
  _Dialog.alert({
@@ -718,42 +774,42 @@ var useTopoEdit = function useTopoEdit(params) {
718
774
  onOk: function onOk() {}
719
775
  });
720
776
 
721
- return _context15.abrupt("return", false);
777
+ return _context17.abrupt("return", false);
722
778
 
723
779
  case 7:
724
780
  case "end":
725
- return _context15.stop();
781
+ return _context17.stop();
726
782
  }
727
783
  }
728
- }, _callee15);
784
+ }, _callee17);
729
785
  }));
730
786
  return _checkSavePermission.apply(this, arguments);
731
787
  }
732
788
 
733
789
  var onSaveTopo = /*#__PURE__*/function () {
734
- var _ref5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee7(data) {
790
+ var _ref7 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee9(data) {
735
791
  var id, config, serialize, _config$layout, template, layout, saveConfig, valid, saveData;
736
792
 
737
- return _regeneratorRuntime.wrap(function _callee7$(_context7) {
793
+ return _regeneratorRuntime.wrap(function _callee9$(_context9) {
738
794
  while (1) {
739
- switch (_context7.prev = _context7.next) {
795
+ switch (_context9.prev = _context9.next) {
740
796
  case 0:
741
797
  id = data.id, config = data.config, serialize = data.serialize;
742
798
  _config$layout = config === null || config === void 0 ? void 0 : config.layout, template = _config$layout.type, layout = _config$layout.layout;
743
799
 
744
800
  if (!onSave) {
745
- _context7.next = 6;
801
+ _context9.next = 6;
746
802
  break;
747
803
  }
748
804
 
749
805
  // 自定义保存
750
806
  saveConfig = /*#__PURE__*/function () {
751
- var _ref6 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee6() {
752
- return _regeneratorRuntime.wrap(function _callee6$(_context6) {
807
+ var _ref8 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee8() {
808
+ return _regeneratorRuntime.wrap(function _callee8$(_context8) {
753
809
  while (1) {
754
- switch (_context6.prev = _context6.next) {
810
+ switch (_context8.prev = _context8.next) {
755
811
  case 0:
756
- _context6.next = 2;
812
+ _context8.next = 2;
757
813
  return editDispatchers.saveTopo({
758
814
  id: id,
759
815
  layout: layout,
@@ -762,14 +818,14 @@ var useTopoEdit = function useTopoEdit(params) {
762
818
 
763
819
  case 2:
764
820
  case "end":
765
- return _context6.stop();
821
+ return _context8.stop();
766
822
  }
767
823
  }
768
- }, _callee6);
824
+ }, _callee8);
769
825
  }));
770
826
 
771
827
  return function saveConfig() {
772
- return _ref6.apply(this, arguments);
828
+ return _ref8.apply(this, arguments);
773
829
  };
774
830
  }();
775
831
 
@@ -777,7 +833,7 @@ var useTopoEdit = function useTopoEdit(params) {
777
833
  data: data,
778
834
  saveConfig: saveConfig
779
835
  });
780
- return _context7.abrupt("return");
836
+ return _context9.abrupt("return");
781
837
 
782
838
  case 6:
783
839
  // TODO 以下逻辑移到拓扑中心
@@ -785,21 +841,21 @@ var useTopoEdit = function useTopoEdit(params) {
785
841
  saving: true
786
842
  }); // 检查权限
787
843
 
788
- _context7.next = 9;
844
+ _context9.next = 9;
789
845
  return checkSavePermission(id);
790
846
 
791
847
  case 9:
792
- valid = _context7.sent;
848
+ valid = _context9.sent;
793
849
 
794
850
  if (valid) {
795
- _context7.next = 13;
851
+ _context9.next = 13;
796
852
  break;
797
853
  }
798
854
 
799
855
  topoEditDispatchers.update({
800
856
  saving: false
801
857
  });
802
- return _context7.abrupt("return");
858
+ return _context9.abrupt("return");
803
859
 
804
860
  case 13:
805
861
  // 保存
@@ -809,7 +865,7 @@ var useTopoEdit = function useTopoEdit(params) {
809
865
  serialize: serialize
810
866
  }, resourceConfig.getConfig());
811
867
  rlog.info("保存", saveData);
812
- _context7.next = 17;
868
+ _context9.next = 17;
813
869
  return editDispatchers.saveTopo(saveData);
814
870
 
815
871
  case 17:
@@ -821,14 +877,14 @@ var useTopoEdit = function useTopoEdit(params) {
821
877
 
822
878
  case 19:
823
879
  case "end":
824
- return _context7.stop();
880
+ return _context9.stop();
825
881
  }
826
882
  }
827
- }, _callee7);
883
+ }, _callee9);
828
884
  }));
829
885
 
830
- return function onSaveTopo(_x12) {
831
- return _ref5.apply(this, arguments);
886
+ return function onSaveTopo(_x14) {
887
+ return _ref7.apply(this, arguments);
832
888
  };
833
889
  }();
834
890
 
@@ -854,12 +910,12 @@ var useTopoEdit = function useTopoEdit(params) {
854
910
 
855
911
 
856
912
  var bindNodeResource = /*#__PURE__*/function () {
857
- var _ref7 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee9(params) {
913
+ var _ref9 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee11(params) {
858
914
  var id, oldResId, newResId, node, parentGroupElement, htTopo, config, groupId, groupTag, _yield$editDispatcher, elements, newData, doBind, _doBind, replaceOrAddRes;
859
915
 
860
- return _regeneratorRuntime.wrap(function _callee9$(_context9) {
916
+ return _regeneratorRuntime.wrap(function _callee11$(_context11) {
861
917
  while (1) {
862
- switch (_context9.prev = _context9.next) {
918
+ switch (_context11.prev = _context11.next) {
863
919
  case 0:
864
920
  replaceOrAddRes = function _replaceOrAddRes(resources, oldResId, newResId) {
865
921
  return _extends({}, resources, {
@@ -870,11 +926,11 @@ var useTopoEdit = function useTopoEdit(params) {
870
926
  };
871
927
 
872
928
  _doBind = function _doBind3() {
873
- _doBind = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee8() {
929
+ _doBind = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee10() {
874
930
  var dm, newLinkElements, createElementsData, groupChildren, newGroupChildren, existedGroupChildren, groupElement, newElement, sm;
875
- return _regeneratorRuntime.wrap(function _callee8$(_context8) {
931
+ return _regeneratorRuntime.wrap(function _callee10$(_context10) {
876
932
  while (1) {
877
- switch (_context8.prev = _context8.next) {
933
+ switch (_context10.prev = _context10.next) {
878
934
  case 0:
879
935
  dm = htTopo.getGraphView().dm(); // 创建
880
936
 
@@ -943,7 +999,7 @@ var useTopoEdit = function useTopoEdit(params) {
943
999
  // node.a("customName", null);
944
1000
  // 删除关联在节点上的出口链路
945
1001
 
946
- _context8.next = 12;
1002
+ _context10.next = 12;
947
1003
  return deleteExLink(node);
948
1004
 
949
1005
  case 12:
@@ -954,10 +1010,10 @@ var useTopoEdit = function useTopoEdit(params) {
954
1010
 
955
1011
  case 13:
956
1012
  case "end":
957
- return _context8.stop();
1013
+ return _context10.stop();
958
1014
  }
959
1015
  }
960
- }, _callee8);
1016
+ }, _callee10);
961
1017
  }));
962
1018
  return _doBind.apply(this, arguments);
963
1019
  };
@@ -966,6 +1022,7 @@ var useTopoEdit = function useTopoEdit(params) {
966
1022
  return _doBind.apply(this, arguments);
967
1023
  };
968
1024
 
1025
+ topo.historyManager.beginTransaction();
969
1026
  id = params.id, oldResId = params.oldResId, newResId = params.newResId;
970
1027
  rlog.debug("bindNodeResource", params);
971
1028
  node = topo.getDataModel().getDataById(id); // 节点所属容器
@@ -996,48 +1053,48 @@ var useTopoEdit = function useTopoEdit(params) {
996
1053
  config.resources = replaceOrAddRes(config.resources, oldResId, newResId);
997
1054
  }
998
1055
 
999
- _context9.next = 12;
1056
+ _context11.next = 13;
1000
1057
  return resourceConfig.updateConfig(config);
1001
1058
 
1002
- case 12:
1003
- _context9.next = 14;
1059
+ case 13:
1060
+ _context11.next = 15;
1004
1061
  return editDispatchers.fetchDataByConfig();
1005
1062
 
1006
- case 14:
1007
- _yield$editDispatcher = _context9.sent;
1063
+ case 15:
1064
+ _yield$editDispatcher = _context11.sent;
1008
1065
  elements = _yield$editDispatcher.elements;
1009
1066
  newData = elements.find(function (item) {
1010
1067
  return item.id === newResId;
1011
1068
  });
1012
1069
 
1013
1070
  if (newData) {
1014
- _context9.next = 21;
1071
+ _context11.next = 23;
1015
1072
  break;
1016
1073
  }
1017
1074
 
1018
1075
  _Message.error("关联资源失败");
1019
1076
 
1020
1077
  rlog.warn("关联资源失败");
1021
- return _context9.abrupt("return", false);
1078
+ topo.historyManager.endTransaction();
1079
+ return _context11.abrupt("return", false);
1022
1080
 
1023
- case 21:
1024
- topo.historyManager.beginTransaction();
1025
- _context9.next = 24;
1081
+ case 23:
1082
+ _context11.next = 25;
1026
1083
  return doBind();
1027
1084
 
1028
- case 24:
1085
+ case 25:
1029
1086
  topo.historyManager.endTransaction();
1030
1087
 
1031
- case 25:
1088
+ case 26:
1032
1089
  case "end":
1033
- return _context9.stop();
1090
+ return _context11.stop();
1034
1091
  }
1035
1092
  }
1036
- }, _callee9);
1093
+ }, _callee11);
1037
1094
  }));
1038
1095
 
1039
- return function bindNodeResource(_x13) {
1040
- return _ref7.apply(this, arguments);
1096
+ return function bindNodeResource(_x15) {
1097
+ return _ref9.apply(this, arguments);
1041
1098
  };
1042
1099
  }();
1043
1100