@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.
- package/build/1.js +2 -2
- package/build/2.js +1 -1
- package/build/index.css +1 -1
- package/build/index.js +20 -20
- package/es/common/components/ColorPicker/ColorPicker.js +5 -3
- package/es/components/BatchAttrMetric/setting.js +3 -5
- package/es/components/ResourceSelectDrawer/ResourceSelectDrawer.js +2 -1
- package/es/core/components/DisplaySettingDrawer/DisplaySettingDrawer.js +2 -1
- package/es/core/components/DisplaySettingDrawer/LinkTip.js +5 -1
- package/es/core/components/DisplaySettingDrawer/demo/Demo.js +63 -0
- package/es/core/components/ResourceViewAttributeSetting/Setting.js +9 -48
- package/es/core/components/TopoView/TopoView.module.scss +1 -1
- package/es/core/components/TopoView/topoView.js +31 -22
- package/es/core/editor/components/BackgroundView/index.js +74 -35
- package/es/core/editor/components/settings/common/LineType/index.js +7 -1
- package/es/core/editor/components/settings/common/text/FontStyleCheckbox.js +3 -3
- package/es/core/editor/components/settings/common/text/TextStyle.js +21 -6
- package/es/core/editor/components/settings/common/text/fontStyleUtil.js +0 -1
- package/es/core/editor/components/settings/propertyViews/box/BoxPropertyView.js +12 -1
- package/es/core/editor/components/settings/propertyViews/box/NameInput.js +9 -1
- package/es/core/editor/components/settings/propertyViews/edge/CommonEdgePropertyView.js +15 -1
- package/es/core/editor/components/settings/propertyViews/group/DataTab/GroupNodeList.js +2 -0
- package/es/core/editor/components/settings/propertyViews/group/SettingTab/GroupExpandSetting.js +9 -5
- package/es/core/editor/components/settings/propertyViews/group/SettingTab/GroupExpandStatus.js +10 -2
- package/es/core/editor/components/settings/propertyViews/group/SettingTab/Setting.js +12 -1
- package/es/core/editor/components/settings/propertyViews/layer/SettingTab/Setting.js +13 -3
- package/es/core/editor/components/settings/propertyViews/layer/SettingTab/Setting_bak.js +0 -1
- package/es/core/editor/components/settings/propertyViews/multipleElements/BatchSetNodeIcon.js +2 -0
- package/es/core/editor/components/settings/propertyViews/multipleElements/BatchSetNodeSize/BatchSetNodeSize.js +2 -0
- package/es/core/editor/components/settings/propertyViews/multipleElements/MultipleElementPropertyView.js +4 -1
- package/es/core/editor/components/settings/propertyViews/node/Setting/Setting.js +4 -0
- package/es/core/editor/components/settings/propertyViews/node/data/Data.js +34 -6
- package/es/core/editor/components/settings/propertyViews/text/TextPropertyView.js +9 -2
- package/es/core/editor/components/settings/propertyViews/view/BackgroundSize.js +30 -1
- package/es/core/editor/components/settings/propertyViews/view/GlobalLayout.js +2 -0
- package/es/core/editor/components/settings/propertyViews/view/GlobalNodeLabelStyle.js +15 -1
- package/es/core/editor/components/settings/propertyViews/view/hooks/useBackgroundSizeConfig.js +0 -1
- package/es/core/editor/components/titlebar/TopoEditorTitleBar.js +4 -1
- package/es/core/editor/components/titlebar/widgets/DebugTools.js +29 -0
- package/es/core/hooks/useAlarm.js +18 -0
- package/es/core/hooks/useGraphAlarmDisplay.js +25 -3
- package/es/core/hooks/useResourceConfig.js +2 -1
- package/es/core/hooks/useRouterAdapter.js +7 -1
- package/es/core/hooks/useTopoEdit.js +220 -163
- package/es/core/models/AttributeMetricDisplay.js +31 -73
- package/es/core/models/HistoryManager.js +100 -50
- package/es/core/models/TopoApp.js +1 -1
- package/es/core/models/cache/CiTypeCache.js +10 -44
- package/es/core/models/cache/DictCache.js +2 -1
- package/es/core/models/graph/Background.js +31 -14
- package/es/core/models/tagstips/ElementTagTipConfig.js +46 -12
- package/es/core/models/tagstips/utils.js +1 -1
- package/es/core/models/topoData.js +7 -3
- package/es/core/models/utils/linkUtils.js +18 -0
- package/es/core/store/models/topoAlarm.js +5 -1
- package/es/core/store/models/topoMod.js +6 -31
- package/es/core/viewer/components/plugins/ResourceDetail/ResourceDetail.js +51 -249
- package/es/core/viewer/components/plugins/ResourceDetail/ResourceDetailDrawer.js +218 -0
- package/es/core/viewer/components/plugins/ResourceDetail/ResourceDetailPlugin.js +2 -2
- package/es/core/viewer/components/plugins/ResourceDetail/components/ClusterMemberTable.js +1 -1
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/BaseInfoBlock.js +0 -1
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/ResourceOverview.js +79 -43
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/ResourceOverviewMetric.js +2 -3
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/Configurator/index.js +2 -2
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/LinkTopo.js +23 -0
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/LinkTopo.module.scss +11 -0
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/LinkTopoCard.js +34 -0
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/constants.js +6 -0
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/hooks/useMetricPolling.js +62 -0
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/services/index.js +188 -0
- package/es/core/viewer/components/titlebar/BasicTools.js +1 -1
- package/es/core/viewer/components/titlebar/widgets/NodesDragSwitchWrapper.js +18 -0
- package/es/core/viewer/components/titlebar/widgets/SettingButton.js +11 -1
- package/es/networkTopo/components/TopoView.js +2 -1
- package/es/networkTopo/components/editor/propertyViews/edge/addLinkDrawer/AddLinkDrawer.js +164 -225
- package/es/networkTopo/components/editor/propertyViews/edge/addLinkDrawer/components/NetworkLinkForm.js +4 -0
- package/es/networkTopo/components/editor/propertyViews/edge/addLinkDrawer/components/editLinkInfo.js +161 -137
- package/es/networkTopo/components/editor/propertyViews/edge/addLinkDrawer/hooks/useAddLink.js +104 -0
- package/es/networkTopo/components/editor/propertyViews/edge/link/BindExitLinkSelect.js +17 -7
- package/es/networkTopo/components/editor/propertyViews/edge/link/LinkInfoPreview.js +8 -9
- package/es/networkTopo/components/viewer/displaySetting/LinkAttrCustomSettingDrawer.js +59 -0
- package/es/networkTopo/components/viewer/displaySetting/LinkTagV2.js +10 -4
- package/es/networkTopo/getTopoData.js +11 -14
- package/es/networkTopo/hooks/editor/useDeleteEdges.js +11 -8
- package/es/networkTopo/hooks/viewer/useRelateTopo.js +1 -1
- package/es/networkTopo/models/LinkDynamicStyleExecutor.js +2 -0
- package/es/networkTopo/models/TopoCenter.js +1 -1
- package/es/networkTopo/services/index.js +6 -4
- package/es/networkTopo/services/link.js +2 -2
- package/es/networkTopo/store/topoCenter.js +5 -2
- package/es/networkTopo/store/topoTreeMod.js +84 -43
- package/es/networkTopo/utils/__tests__/resourcePermissionUtil.test.js +135 -0
- package/es/networkTopo/utils/resourcePermissionUtil.js +10 -6
- package/es/style.js +2 -1
- package/es/utils/ResourceConfigUtil.js +79 -39
- package/es/utils/clusterUtil.js +1 -1
- package/es/utils/htElementUtils.js +0 -1
- package/es/utils/topoData.js +24 -63
- package/es/utils/tree.js +1 -3
- package/lib/common/components/ColorPicker/ColorPicker.js +6 -3
- package/lib/components/BatchAttrMetric/setting.js +3 -6
- package/lib/components/ResourceSelectDrawer/ResourceSelectDrawer.js +4 -1
- package/lib/core/components/DisplaySettingDrawer/DisplaySettingDrawer.js +4 -1
- package/lib/core/components/DisplaySettingDrawer/LinkTip.js +6 -1
- package/lib/core/components/DisplaySettingDrawer/demo/Demo.js +71 -0
- package/lib/core/components/ResourceViewAttributeSetting/Setting.js +8 -48
- package/lib/core/components/TopoView/TopoView.module.scss +1 -1
- package/lib/core/components/TopoView/topoView.js +26 -17
- package/lib/core/editor/components/BackgroundView/index.js +75 -35
- package/lib/core/editor/components/settings/common/LineType/index.js +7 -1
- package/lib/core/editor/components/settings/common/text/FontStyleCheckbox.js +5 -4
- package/lib/core/editor/components/settings/common/text/TextStyle.js +23 -7
- package/lib/core/editor/components/settings/common/text/fontStyleUtil.js +0 -1
- package/lib/core/editor/components/settings/propertyViews/box/BoxPropertyView.js +13 -1
- package/lib/core/editor/components/settings/propertyViews/box/NameInput.js +9 -1
- package/lib/core/editor/components/settings/propertyViews/edge/CommonEdgePropertyView.js +15 -1
- package/lib/core/editor/components/settings/propertyViews/group/DataTab/GroupNodeList.js +2 -0
- package/lib/core/editor/components/settings/propertyViews/group/SettingTab/GroupExpandSetting.js +9 -5
- package/lib/core/editor/components/settings/propertyViews/group/SettingTab/GroupExpandStatus.js +10 -2
- package/lib/core/editor/components/settings/propertyViews/group/SettingTab/Setting.js +12 -1
- package/lib/core/editor/components/settings/propertyViews/layer/SettingTab/Setting.js +17 -3
- package/lib/core/editor/components/settings/propertyViews/layer/SettingTab/Setting_bak.js +0 -1
- package/lib/core/editor/components/settings/propertyViews/multipleElements/BatchSetNodeIcon.js +2 -0
- package/lib/core/editor/components/settings/propertyViews/multipleElements/BatchSetNodeSize/BatchSetNodeSize.js +2 -0
- package/lib/core/editor/components/settings/propertyViews/multipleElements/MultipleElementPropertyView.js +4 -1
- package/lib/core/editor/components/settings/propertyViews/node/Setting/Setting.js +4 -0
- package/lib/core/editor/components/settings/propertyViews/node/data/Data.js +36 -6
- package/lib/core/editor/components/settings/propertyViews/text/TextPropertyView.js +9 -2
- package/lib/core/editor/components/settings/propertyViews/view/BackgroundSize.js +32 -1
- package/lib/core/editor/components/settings/propertyViews/view/GlobalLayout.js +2 -0
- package/lib/core/editor/components/settings/propertyViews/view/GlobalNodeLabelStyle.js +15 -1
- package/lib/core/editor/components/settings/propertyViews/view/hooks/useBackgroundSizeConfig.js +0 -1
- package/lib/core/editor/components/titlebar/TopoEditorTitleBar.js +5 -1
- package/lib/core/editor/components/titlebar/widgets/DebugTools.js +38 -0
- package/lib/core/hooks/useAlarm.js +19 -0
- package/lib/core/hooks/useGraphAlarmDisplay.js +27 -3
- package/lib/core/hooks/useResourceConfig.js +2 -1
- package/lib/core/hooks/useRouterAdapter.js +8 -1
- package/lib/core/hooks/useTopoEdit.js +219 -162
- package/lib/core/models/AttributeMetricDisplay.js +31 -73
- package/lib/core/models/HistoryManager.js +105 -51
- package/lib/core/models/TopoApp.js +1 -1
- package/lib/core/models/cache/CiTypeCache.js +12 -44
- package/lib/core/models/cache/DictCache.js +4 -1
- package/lib/core/models/graph/Background.js +36 -16
- package/lib/core/models/tagstips/ElementTagTipConfig.js +49 -12
- package/lib/core/models/tagstips/utils.js +1 -1
- package/lib/core/models/topoData.js +7 -3
- package/lib/core/models/utils/linkUtils.js +22 -0
- package/lib/core/store/models/topoAlarm.js +5 -1
- package/lib/core/store/models/topoMod.js +7 -32
- package/lib/core/viewer/components/plugins/ResourceDetail/ResourceDetail.js +51 -261
- package/lib/core/viewer/components/plugins/ResourceDetail/ResourceDetailDrawer.js +245 -0
- package/lib/core/viewer/components/plugins/ResourceDetail/ResourceDetailPlugin.js +2 -2
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ClusterMemberTable.js +1 -1
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/BaseInfoBlock.js +0 -1
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/ResourceOverview.js +79 -42
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/ResourceOverviewMetric.js +2 -3
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/Configurator/index.js +2 -2
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/LinkTopo.js +36 -0
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/LinkTopo.module.scss +11 -0
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/LinkTopoCard.js +45 -0
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/constants.js +11 -0
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/hooks/useMetricPolling.js +77 -0
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/services/index.js +214 -0
- package/lib/core/viewer/components/titlebar/BasicTools.js +2 -2
- package/lib/core/viewer/components/titlebar/widgets/NodesDragSwitchWrapper.js +28 -0
- package/lib/core/viewer/components/titlebar/widgets/SettingButton.js +10 -0
- package/lib/networkTopo/components/TopoView.js +3 -2
- package/lib/networkTopo/components/editor/propertyViews/edge/addLinkDrawer/AddLinkDrawer.js +160 -223
- package/lib/networkTopo/components/editor/propertyViews/edge/addLinkDrawer/components/NetworkLinkForm.js +12 -0
- package/lib/networkTopo/components/editor/propertyViews/edge/addLinkDrawer/components/editLinkInfo.js +161 -137
- package/lib/networkTopo/components/editor/propertyViews/edge/addLinkDrawer/hooks/useAddLink.js +120 -0
- package/lib/networkTopo/components/editor/propertyViews/edge/link/BindExitLinkSelect.js +19 -7
- package/lib/networkTopo/components/editor/propertyViews/edge/link/LinkInfoPreview.js +8 -9
- package/lib/networkTopo/components/viewer/displaySetting/LinkAttrCustomSettingDrawer.js +76 -0
- package/lib/networkTopo/components/viewer/displaySetting/LinkTagV2.js +10 -4
- package/lib/networkTopo/getTopoData.js +10 -13
- package/lib/networkTopo/hooks/editor/useDeleteEdges.js +11 -8
- package/lib/networkTopo/hooks/viewer/useRelateTopo.js +2 -1
- package/lib/networkTopo/models/LinkDynamicStyleExecutor.js +2 -0
- package/lib/networkTopo/models/TopoCenter.js +2 -2
- package/lib/networkTopo/services/index.js +6 -4
- package/lib/networkTopo/services/link.js +2 -2
- package/lib/networkTopo/store/topoCenter.js +5 -2
- package/lib/networkTopo/store/topoTreeMod.js +84 -43
- package/lib/networkTopo/utils/__tests__/resourcePermissionUtil.test.js +137 -0
- package/lib/networkTopo/utils/resourcePermissionUtil.js +11 -6
- package/lib/style.js +2 -1
- package/lib/utils/ResourceConfigUtil.js +78 -37
- package/lib/utils/clusterUtil.js +1 -1
- package/lib/utils/htElementUtils.js +0 -1
- package/lib/utils/topoData.js +25 -64
- package/lib/utils/tree.js +1 -3
- package/package.json +3 -2
|
@@ -110,47 +110,99 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
|
110
110
|
setShowComboResDrawer(true);
|
|
111
111
|
};
|
|
112
112
|
|
|
113
|
-
var onLayerAdded = function
|
|
114
|
-
var
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
113
|
+
var onLayerAdded = /*#__PURE__*/function () {
|
|
114
|
+
var _ref3 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee2(_ref2) {
|
|
115
|
+
var target, direction, config;
|
|
116
|
+
return _regenerator["default"].wrap(function _callee2$(_context2) {
|
|
117
|
+
while (1) {
|
|
118
|
+
switch (_context2.prev = _context2.next) {
|
|
119
|
+
case 0:
|
|
120
|
+
target = _ref2.target, direction = _ref2.direction;
|
|
121
|
+
topo.historyManager.beginTransaction(); // 从拓扑图获取分层和资源配置
|
|
118
122
|
|
|
119
|
-
|
|
120
|
-
config: config
|
|
121
|
-
}); // 如果非分层拓扑且有分层,切换到分层模板,设置方向
|
|
123
|
+
config = resourceConfig.getConfigFromHt(topo.getDataModel());
|
|
122
124
|
|
|
125
|
+
_rlog["default"].info("onLayerAdd", {
|
|
126
|
+
config: config
|
|
127
|
+
}); // 如果非分层拓扑且有分层,切换到分层模板,设置方向
|
|
123
128
|
|
|
124
|
-
if (!isLayerTopo && config.layers.length) {
|
|
125
|
-
topoDispatchers.setTopoType(_template.TPL_TREE);
|
|
126
|
-
} // 更新配置
|
|
127
|
-
// resourceConfig.updateConfig(config);
|
|
128
|
-
// 更新配置对应的资源、链路
|
|
129
|
-
// editDispatchers.fetchDataByConfig();
|
|
130
129
|
|
|
131
|
-
|
|
130
|
+
if (!(!isLayerTopo && config.layers.length)) {
|
|
131
|
+
_context2.next = 7;
|
|
132
|
+
break;
|
|
133
|
+
}
|
|
132
134
|
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
135
|
+
_context2.next = 7;
|
|
136
|
+
return topoDispatchers.setTopoType(_template.TPL_TREE);
|
|
137
|
+
|
|
138
|
+
case 7:
|
|
139
|
+
// 更新配置
|
|
140
|
+
// resourceConfig.updateConfig(config);
|
|
141
|
+
// 更新配置对应的资源、链路
|
|
142
|
+
// editDispatchers.fetchDataByConfig();
|
|
143
|
+
topo.historyManager.endTransaction();
|
|
144
|
+
|
|
145
|
+
case 8:
|
|
146
|
+
case "end":
|
|
147
|
+
return _context2.stop();
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
}, _callee2);
|
|
151
|
+
}));
|
|
152
|
+
|
|
153
|
+
return function onLayerAdded(_x) {
|
|
154
|
+
return _ref3.apply(this, arguments);
|
|
155
|
+
};
|
|
156
|
+
}();
|
|
136
157
|
|
|
137
|
-
|
|
158
|
+
var deleteLayer = /*#__PURE__*/function () {
|
|
159
|
+
var _ref4 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee3(layerElement) {
|
|
160
|
+
var config;
|
|
161
|
+
return _regenerator["default"].wrap(function _callee3$(_context3) {
|
|
162
|
+
while (1) {
|
|
163
|
+
switch (_context3.prev = _context3.next) {
|
|
164
|
+
case 0:
|
|
165
|
+
topo.historyManager.beginTransaction();
|
|
166
|
+
emitEvent(_componentTopologyGraph.TopoEvent.EVENT_TRIGGER_DELETE, layerElement); // 获取资源配置
|
|
138
167
|
|
|
139
|
-
|
|
140
|
-
config: config
|
|
141
|
-
}); // 如果没有分层,将拓扑类型切换为空白模板
|
|
168
|
+
config = resourceConfig.getConfigFromHt(topo.getDataModel());
|
|
142
169
|
|
|
170
|
+
_rlog["default"].info("deleteLayer", {
|
|
171
|
+
config: config
|
|
172
|
+
}); // 如果没有分层,将拓扑类型切换为空白模板
|
|
143
173
|
|
|
144
|
-
if (!config.layers.length) {
|
|
145
|
-
topoDispatchers.setTopoType(_template.TPL_BLANK);
|
|
146
|
-
} // 更新配置
|
|
147
174
|
|
|
175
|
+
if (config.layers.length) {
|
|
176
|
+
_context3.next = 7;
|
|
177
|
+
break;
|
|
178
|
+
}
|
|
148
179
|
|
|
149
|
-
|
|
180
|
+
_context3.next = 7;
|
|
181
|
+
return topoDispatchers.setTopoType(_template.TPL_BLANK);
|
|
150
182
|
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
183
|
+
case 7:
|
|
184
|
+
_context3.next = 9;
|
|
185
|
+
return resourceConfig.updateConfig(config);
|
|
186
|
+
|
|
187
|
+
case 9:
|
|
188
|
+
_context3.next = 11;
|
|
189
|
+
return editDispatchers.fetchDataByConfig();
|
|
190
|
+
|
|
191
|
+
case 11:
|
|
192
|
+
topo.historyManager.endTransaction();
|
|
193
|
+
|
|
194
|
+
case 12:
|
|
195
|
+
case "end":
|
|
196
|
+
return _context3.stop();
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
}, _callee3);
|
|
200
|
+
}));
|
|
201
|
+
|
|
202
|
+
return function deleteLayer(_x2) {
|
|
203
|
+
return _ref4.apply(this, arguments);
|
|
204
|
+
};
|
|
205
|
+
}();
|
|
154
206
|
|
|
155
207
|
var handleDeleteLayer = function handleDeleteLayer(layerElement) {
|
|
156
208
|
var hasChildren = !!layerElement.getChildren().toArray().length;
|
|
@@ -171,19 +223,19 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
|
171
223
|
type: "warning"
|
|
172
224
|
},
|
|
173
225
|
onOk: function () {
|
|
174
|
-
var _onOk = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function
|
|
175
|
-
return _regenerator["default"].wrap(function
|
|
226
|
+
var _onOk = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee4() {
|
|
227
|
+
return _regenerator["default"].wrap(function _callee4$(_context4) {
|
|
176
228
|
while (1) {
|
|
177
|
-
switch (
|
|
229
|
+
switch (_context4.prev = _context4.next) {
|
|
178
230
|
case 0:
|
|
179
231
|
deleteLayer(layerElement);
|
|
180
232
|
|
|
181
233
|
case 1:
|
|
182
234
|
case "end":
|
|
183
|
-
return
|
|
235
|
+
return _context4.stop();
|
|
184
236
|
}
|
|
185
237
|
}
|
|
186
|
-
},
|
|
238
|
+
}, _callee4);
|
|
187
239
|
}));
|
|
188
240
|
|
|
189
241
|
function onOk() {
|
|
@@ -229,19 +281,19 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
|
229
281
|
type: "warning"
|
|
230
282
|
},
|
|
231
283
|
onOk: function () {
|
|
232
|
-
var _onOk2 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function
|
|
233
|
-
return _regenerator["default"].wrap(function
|
|
284
|
+
var _onOk2 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee5() {
|
|
285
|
+
return _regenerator["default"].wrap(function _callee5$(_context5) {
|
|
234
286
|
while (1) {
|
|
235
|
-
switch (
|
|
287
|
+
switch (_context5.prev = _context5.next) {
|
|
236
288
|
case 0:
|
|
237
289
|
doDelete();
|
|
238
290
|
|
|
239
291
|
case 1:
|
|
240
292
|
case "end":
|
|
241
|
-
return
|
|
293
|
+
return _context5.stop();
|
|
242
294
|
}
|
|
243
295
|
}
|
|
244
|
-
},
|
|
296
|
+
}, _callee5);
|
|
245
297
|
}));
|
|
246
298
|
|
|
247
299
|
function onOk() {
|
|
@@ -338,20 +390,20 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
|
338
390
|
|
|
339
391
|
|
|
340
392
|
var deleteExLink = /*#__PURE__*/function () {
|
|
341
|
-
var
|
|
393
|
+
var _ref5 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee6(node) {
|
|
342
394
|
var _node$getEdges$toArra, _node$getEdges;
|
|
343
395
|
|
|
344
396
|
var config, edges, exportLinkIdList;
|
|
345
|
-
return _regenerator["default"].wrap(function
|
|
397
|
+
return _regenerator["default"].wrap(function _callee6$(_context6) {
|
|
346
398
|
while (1) {
|
|
347
|
-
switch (
|
|
399
|
+
switch (_context6.prev = _context6.next) {
|
|
348
400
|
case 0:
|
|
349
401
|
config = resourceConfig.getConfig(); // console.log("删除关联在节点上的出口链路- node, config", node, config);
|
|
350
402
|
|
|
351
403
|
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 = [];
|
|
352
404
|
|
|
353
405
|
if (!(edges.length > 0)) {
|
|
354
|
-
|
|
406
|
+
_context6.next = 8;
|
|
355
407
|
break;
|
|
356
408
|
}
|
|
357
409
|
|
|
@@ -365,19 +417,19 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
|
365
417
|
}
|
|
366
418
|
});
|
|
367
419
|
config.exportLinkIdList = exportLinkIdList;
|
|
368
|
-
|
|
420
|
+
_context6.next = 8;
|
|
369
421
|
return resourceConfig.updateConfig(config);
|
|
370
422
|
|
|
371
423
|
case 8:
|
|
372
424
|
case "end":
|
|
373
|
-
return
|
|
425
|
+
return _context6.stop();
|
|
374
426
|
}
|
|
375
427
|
}
|
|
376
|
-
},
|
|
428
|
+
}, _callee6);
|
|
377
429
|
}));
|
|
378
430
|
|
|
379
|
-
return function deleteExLink(
|
|
380
|
-
return
|
|
431
|
+
return function deleteExLink(_x3) {
|
|
432
|
+
return _ref5.apply(this, arguments);
|
|
381
433
|
};
|
|
382
434
|
}();
|
|
383
435
|
|
|
@@ -440,31 +492,31 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
|
440
492
|
*/
|
|
441
493
|
|
|
442
494
|
|
|
443
|
-
function bindGroupResources(
|
|
495
|
+
function bindGroupResources(_x4, _x5) {
|
|
444
496
|
return _bindGroupResources.apply(this, arguments);
|
|
445
497
|
}
|
|
446
498
|
|
|
447
499
|
function _bindGroupResources() {
|
|
448
|
-
_bindGroupResources = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function
|
|
500
|
+
_bindGroupResources = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee12(group, resources) {
|
|
449
501
|
var id, tag, _yield$editDispatcher2, elements, nodeElements, newLinkElements, updateElements;
|
|
450
502
|
|
|
451
|
-
return _regenerator["default"].wrap(function
|
|
503
|
+
return _regenerator["default"].wrap(function _callee12$(_context12) {
|
|
452
504
|
while (1) {
|
|
453
|
-
switch (
|
|
505
|
+
switch (_context12.prev = _context12.next) {
|
|
454
506
|
case 0:
|
|
455
507
|
id = group.id, tag = group.tag;
|
|
456
508
|
|
|
457
509
|
_rlog["default"].debug("bindGroupResources--id, tag", id, tag);
|
|
458
510
|
|
|
459
|
-
|
|
511
|
+
_context12.next = 4;
|
|
460
512
|
return resourceConfig.updateGroupResources(group, resources);
|
|
461
513
|
|
|
462
514
|
case 4:
|
|
463
|
-
|
|
515
|
+
_context12.next = 6;
|
|
464
516
|
return editDispatchers.fetchDataByConfig();
|
|
465
517
|
|
|
466
518
|
case 6:
|
|
467
|
-
_yield$editDispatcher2 =
|
|
519
|
+
_yield$editDispatcher2 = _context12.sent;
|
|
468
520
|
elements = _yield$editDispatcher2.elements;
|
|
469
521
|
// 区域里的子区域及子区域的节点、新增的链路
|
|
470
522
|
nodeElements = (0, _topoData.findGroupChildren)(elements, group);
|
|
@@ -481,15 +533,15 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
|
481
533
|
|
|
482
534
|
case 12:
|
|
483
535
|
case "end":
|
|
484
|
-
return
|
|
536
|
+
return _context12.stop();
|
|
485
537
|
}
|
|
486
538
|
}
|
|
487
|
-
},
|
|
539
|
+
}, _callee12);
|
|
488
540
|
}));
|
|
489
541
|
return _bindGroupResources.apply(this, arguments);
|
|
490
542
|
}
|
|
491
543
|
|
|
492
|
-
function addGroupResources(
|
|
544
|
+
function addGroupResources(_x6, _x7) {
|
|
493
545
|
return _addGroupResources.apply(this, arguments);
|
|
494
546
|
}
|
|
495
547
|
/**
|
|
@@ -498,11 +550,11 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
|
498
550
|
|
|
499
551
|
|
|
500
552
|
function _addGroupResources() {
|
|
501
|
-
_addGroupResources = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function
|
|
553
|
+
_addGroupResources = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee13(group, newResourceIds) {
|
|
502
554
|
var groupConfig, resources, groupData;
|
|
503
|
-
return _regenerator["default"].wrap(function
|
|
555
|
+
return _regenerator["default"].wrap(function _callee13$(_context13) {
|
|
504
556
|
while (1) {
|
|
505
|
-
switch (
|
|
557
|
+
switch (_context13.prev = _context13.next) {
|
|
506
558
|
case 0:
|
|
507
559
|
groupConfig = resourceConfig.getGroupConfigByElement(group);
|
|
508
560
|
resources = {
|
|
@@ -512,20 +564,20 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
|
512
564
|
id: group.getTag(),
|
|
513
565
|
tag: group.a("tag")
|
|
514
566
|
};
|
|
515
|
-
|
|
567
|
+
_context13.next = 5;
|
|
516
568
|
return bindGroupResources(groupData, resources, newResourceIds);
|
|
517
569
|
|
|
518
570
|
case 5:
|
|
519
571
|
case "end":
|
|
520
|
-
return
|
|
572
|
+
return _context13.stop();
|
|
521
573
|
}
|
|
522
574
|
}
|
|
523
|
-
},
|
|
575
|
+
}, _callee13);
|
|
524
576
|
}));
|
|
525
577
|
return _addGroupResources.apply(this, arguments);
|
|
526
578
|
}
|
|
527
579
|
|
|
528
|
-
function bindViewResources(
|
|
580
|
+
function bindViewResources(_x8) {
|
|
529
581
|
return _bindViewResources.apply(this, arguments);
|
|
530
582
|
}
|
|
531
583
|
/**
|
|
@@ -537,25 +589,25 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
|
537
589
|
|
|
538
590
|
|
|
539
591
|
function _bindViewResources() {
|
|
540
|
-
_bindViewResources = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function
|
|
592
|
+
_bindViewResources = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee14(data) {
|
|
541
593
|
var config, _yield$editDispatcher3, elements;
|
|
542
594
|
|
|
543
|
-
return _regenerator["default"].wrap(function
|
|
595
|
+
return _regenerator["default"].wrap(function _callee14$(_context14) {
|
|
544
596
|
while (1) {
|
|
545
|
-
switch (
|
|
597
|
+
switch (_context14.prev = _context14.next) {
|
|
546
598
|
case 0:
|
|
547
599
|
console.log("关联视图的资源", data);
|
|
548
600
|
config = resourceConfig.getConfig();
|
|
549
601
|
config.resources = data;
|
|
550
|
-
|
|
602
|
+
_context14.next = 5;
|
|
551
603
|
return resourceConfig.updateConfig(config);
|
|
552
604
|
|
|
553
605
|
case 5:
|
|
554
|
-
|
|
606
|
+
_context14.next = 7;
|
|
555
607
|
return editDispatchers.fetchDataByConfig();
|
|
556
608
|
|
|
557
609
|
case 7:
|
|
558
|
-
_yield$editDispatcher3 =
|
|
610
|
+
_yield$editDispatcher3 = _context14.sent;
|
|
559
611
|
elements = _yield$editDispatcher3.elements;
|
|
560
612
|
saveBind(_componentTopologyGraph.TopoEvent.DATA_TYPE_RESOURCE_COMBO, elements); // 临时放这里,仅拓扑中心有
|
|
561
613
|
|
|
@@ -565,35 +617,37 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
|
565
617
|
|
|
566
618
|
case 11:
|
|
567
619
|
case "end":
|
|
568
|
-
return
|
|
620
|
+
return _context14.stop();
|
|
569
621
|
}
|
|
570
622
|
}
|
|
571
|
-
},
|
|
623
|
+
}, _callee14);
|
|
572
624
|
}));
|
|
573
625
|
return _bindViewResources.apply(this, arguments);
|
|
574
626
|
}
|
|
575
627
|
|
|
576
|
-
function addLayerResources(
|
|
628
|
+
function addLayerResources(_x9, _x10) {
|
|
577
629
|
return _addLayerResources.apply(this, arguments);
|
|
578
630
|
}
|
|
579
631
|
|
|
580
632
|
function _addLayerResources() {
|
|
581
|
-
_addLayerResources = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function
|
|
633
|
+
_addLayerResources = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee15(group, newResourceIds) {
|
|
582
634
|
var _yield$editDispatcher4, elements, data;
|
|
583
635
|
|
|
584
|
-
return _regenerator["default"].wrap(function
|
|
636
|
+
return _regenerator["default"].wrap(function _callee15$(_context15) {
|
|
585
637
|
while (1) {
|
|
586
|
-
switch (
|
|
638
|
+
switch (_context15.prev = _context15.next) {
|
|
587
639
|
case 0:
|
|
588
|
-
|
|
640
|
+
topo.historyManager.beginTransaction(); // 构造新的配置
|
|
641
|
+
|
|
642
|
+
_context15.next = 3;
|
|
589
643
|
return resourceConfig.addLayerStaticResources(group, newResourceIds);
|
|
590
644
|
|
|
591
|
-
case
|
|
592
|
-
|
|
645
|
+
case 3:
|
|
646
|
+
_context15.next = 5;
|
|
593
647
|
return editDispatchers.fetchDataByConfig();
|
|
594
648
|
|
|
595
|
-
case
|
|
596
|
-
_yield$editDispatcher4 =
|
|
649
|
+
case 5:
|
|
650
|
+
_yield$editDispatcher4 = _context15.sent;
|
|
597
651
|
elements = _yield$editDispatcher4.elements;
|
|
598
652
|
// 过滤出新增的资源和链路
|
|
599
653
|
data = {
|
|
@@ -608,46 +662,48 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
|
608
662
|
})
|
|
609
663
|
}; // 添加到分层
|
|
610
664
|
|
|
611
|
-
|
|
665
|
+
_context15.next = 10;
|
|
612
666
|
return topo.updateElements(data);
|
|
613
667
|
|
|
614
|
-
case
|
|
668
|
+
case 10:
|
|
615
669
|
// 临时放这里,仅拓扑中心有
|
|
616
670
|
if (topo.linkDynamicStyleExecutor) {
|
|
617
671
|
topo.linkDynamicStyleExecutor.execute();
|
|
618
672
|
}
|
|
619
673
|
|
|
620
|
-
|
|
674
|
+
topo.historyManager.endTransaction();
|
|
675
|
+
|
|
676
|
+
case 12:
|
|
621
677
|
case "end":
|
|
622
|
-
return
|
|
678
|
+
return _context15.stop();
|
|
623
679
|
}
|
|
624
680
|
}
|
|
625
|
-
},
|
|
681
|
+
}, _callee15);
|
|
626
682
|
}));
|
|
627
683
|
return _addLayerResources.apply(this, arguments);
|
|
628
684
|
}
|
|
629
685
|
|
|
630
|
-
function addResourceToFirstLayer(
|
|
686
|
+
function addResourceToFirstLayer(_x11) {
|
|
631
687
|
return _addResourceToFirstLayer.apply(this, arguments);
|
|
632
688
|
}
|
|
633
689
|
|
|
634
690
|
function _addResourceToFirstLayer() {
|
|
635
|
-
_addResourceToFirstLayer = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function
|
|
691
|
+
_addResourceToFirstLayer = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee16(data) {
|
|
636
692
|
var group;
|
|
637
|
-
return _regenerator["default"].wrap(function
|
|
693
|
+
return _regenerator["default"].wrap(function _callee16$(_context16) {
|
|
638
694
|
while (1) {
|
|
639
|
-
switch (
|
|
695
|
+
switch (_context16.prev = _context16.next) {
|
|
640
696
|
case 0:
|
|
641
697
|
group = resourceConfig.getGroups()[0];
|
|
642
|
-
|
|
698
|
+
_context16.next = 3;
|
|
643
699
|
return addLayerResources(group, data);
|
|
644
700
|
|
|
645
701
|
case 3:
|
|
646
702
|
case "end":
|
|
647
|
-
return
|
|
703
|
+
return _context16.stop();
|
|
648
704
|
}
|
|
649
705
|
}
|
|
650
|
-
},
|
|
706
|
+
}, _callee16);
|
|
651
707
|
}));
|
|
652
708
|
return _addResourceToFirstLayer.apply(this, arguments);
|
|
653
709
|
}
|
|
@@ -673,29 +729,29 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
|
673
729
|
}
|
|
674
730
|
|
|
675
731
|
var onSaveComboRes = /*#__PURE__*/function () {
|
|
676
|
-
var
|
|
677
|
-
return _regenerator["default"].wrap(function
|
|
732
|
+
var _ref6 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee7(data) {
|
|
733
|
+
return _regenerator["default"].wrap(function _callee7$(_context7) {
|
|
678
734
|
while (1) {
|
|
679
|
-
switch (
|
|
735
|
+
switch (_context7.prev = _context7.next) {
|
|
680
736
|
case 0:
|
|
681
737
|
_rlog["default"].debug("关联资源-----onSaveComboRes", data);
|
|
682
738
|
|
|
683
739
|
topo.historyManager.beginTransaction();
|
|
684
740
|
|
|
685
741
|
if (!(getAddResourceType() === "addToFirstLayer")) {
|
|
686
|
-
|
|
742
|
+
_context7.next = 7;
|
|
687
743
|
break;
|
|
688
744
|
}
|
|
689
745
|
|
|
690
|
-
|
|
746
|
+
_context7.next = 5;
|
|
691
747
|
return addResourceToFirstLayer(data);
|
|
692
748
|
|
|
693
749
|
case 5:
|
|
694
|
-
|
|
750
|
+
_context7.next = 9;
|
|
695
751
|
break;
|
|
696
752
|
|
|
697
753
|
case 7:
|
|
698
|
-
|
|
754
|
+
_context7.next = 9;
|
|
699
755
|
return bindViewResources(data);
|
|
700
756
|
|
|
701
757
|
case 9:
|
|
@@ -703,43 +759,43 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
|
703
759
|
|
|
704
760
|
case 10:
|
|
705
761
|
case "end":
|
|
706
|
-
return
|
|
762
|
+
return _context7.stop();
|
|
707
763
|
}
|
|
708
764
|
}
|
|
709
|
-
},
|
|
765
|
+
}, _callee7);
|
|
710
766
|
}));
|
|
711
767
|
|
|
712
|
-
return function onSaveComboRes(
|
|
713
|
-
return
|
|
768
|
+
return function onSaveComboRes(_x12) {
|
|
769
|
+
return _ref6.apply(this, arguments);
|
|
714
770
|
};
|
|
715
771
|
}();
|
|
716
772
|
|
|
717
|
-
function checkSavePermission(
|
|
773
|
+
function checkSavePermission(_x13) {
|
|
718
774
|
return _checkSavePermission.apply(this, arguments);
|
|
719
775
|
}
|
|
720
776
|
|
|
721
777
|
function _checkSavePermission() {
|
|
722
|
-
_checkSavePermission = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function
|
|
778
|
+
_checkSavePermission = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee17(id) {
|
|
723
779
|
var permission;
|
|
724
|
-
return _regenerator["default"].wrap(function
|
|
780
|
+
return _regenerator["default"].wrap(function _callee17$(_context17) {
|
|
725
781
|
while (1) {
|
|
726
|
-
switch (
|
|
782
|
+
switch (_context17.prev = _context17.next) {
|
|
727
783
|
case 0:
|
|
728
|
-
|
|
784
|
+
_context17.next = 2;
|
|
729
785
|
return topoDispatchers.getTopoPermission({
|
|
730
786
|
id: id,
|
|
731
787
|
update: false
|
|
732
788
|
});
|
|
733
789
|
|
|
734
790
|
case 2:
|
|
735
|
-
permission =
|
|
791
|
+
permission = _context17.sent;
|
|
736
792
|
|
|
737
793
|
if (!_topoPermissionUtil["default"].isEditable(permission)) {
|
|
738
|
-
|
|
794
|
+
_context17.next = 5;
|
|
739
795
|
break;
|
|
740
796
|
}
|
|
741
797
|
|
|
742
|
-
return
|
|
798
|
+
return _context17.abrupt("return", true);
|
|
743
799
|
|
|
744
800
|
case 5:
|
|
745
801
|
_dialog["default"].alert({
|
|
@@ -751,42 +807,42 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
|
751
807
|
onOk: function onOk() {}
|
|
752
808
|
});
|
|
753
809
|
|
|
754
|
-
return
|
|
810
|
+
return _context17.abrupt("return", false);
|
|
755
811
|
|
|
756
812
|
case 7:
|
|
757
813
|
case "end":
|
|
758
|
-
return
|
|
814
|
+
return _context17.stop();
|
|
759
815
|
}
|
|
760
816
|
}
|
|
761
|
-
},
|
|
817
|
+
}, _callee17);
|
|
762
818
|
}));
|
|
763
819
|
return _checkSavePermission.apply(this, arguments);
|
|
764
820
|
}
|
|
765
821
|
|
|
766
822
|
var onSaveTopo = /*#__PURE__*/function () {
|
|
767
|
-
var
|
|
823
|
+
var _ref7 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee9(data) {
|
|
768
824
|
var id, config, serialize, _config$layout, template, layout, saveConfig, valid, saveData;
|
|
769
825
|
|
|
770
|
-
return _regenerator["default"].wrap(function
|
|
826
|
+
return _regenerator["default"].wrap(function _callee9$(_context9) {
|
|
771
827
|
while (1) {
|
|
772
|
-
switch (
|
|
828
|
+
switch (_context9.prev = _context9.next) {
|
|
773
829
|
case 0:
|
|
774
830
|
id = data.id, config = data.config, serialize = data.serialize;
|
|
775
831
|
_config$layout = config === null || config === void 0 ? void 0 : config.layout, template = _config$layout.type, layout = _config$layout.layout;
|
|
776
832
|
|
|
777
833
|
if (!onSave) {
|
|
778
|
-
|
|
834
|
+
_context9.next = 6;
|
|
779
835
|
break;
|
|
780
836
|
}
|
|
781
837
|
|
|
782
838
|
// 自定义保存
|
|
783
839
|
saveConfig = /*#__PURE__*/function () {
|
|
784
|
-
var
|
|
785
|
-
return _regenerator["default"].wrap(function
|
|
840
|
+
var _ref8 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee8() {
|
|
841
|
+
return _regenerator["default"].wrap(function _callee8$(_context8) {
|
|
786
842
|
while (1) {
|
|
787
|
-
switch (
|
|
843
|
+
switch (_context8.prev = _context8.next) {
|
|
788
844
|
case 0:
|
|
789
|
-
|
|
845
|
+
_context8.next = 2;
|
|
790
846
|
return editDispatchers.saveTopo({
|
|
791
847
|
id: id,
|
|
792
848
|
layout: layout,
|
|
@@ -795,14 +851,14 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
|
795
851
|
|
|
796
852
|
case 2:
|
|
797
853
|
case "end":
|
|
798
|
-
return
|
|
854
|
+
return _context8.stop();
|
|
799
855
|
}
|
|
800
856
|
}
|
|
801
|
-
},
|
|
857
|
+
}, _callee8);
|
|
802
858
|
}));
|
|
803
859
|
|
|
804
860
|
return function saveConfig() {
|
|
805
|
-
return
|
|
861
|
+
return _ref8.apply(this, arguments);
|
|
806
862
|
};
|
|
807
863
|
}();
|
|
808
864
|
|
|
@@ -810,7 +866,7 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
|
810
866
|
data: data,
|
|
811
867
|
saveConfig: saveConfig
|
|
812
868
|
});
|
|
813
|
-
return
|
|
869
|
+
return _context9.abrupt("return");
|
|
814
870
|
|
|
815
871
|
case 6:
|
|
816
872
|
// TODO 以下逻辑移到拓扑中心
|
|
@@ -818,21 +874,21 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
|
818
874
|
saving: true
|
|
819
875
|
}); // 检查权限
|
|
820
876
|
|
|
821
|
-
|
|
877
|
+
_context9.next = 9;
|
|
822
878
|
return checkSavePermission(id);
|
|
823
879
|
|
|
824
880
|
case 9:
|
|
825
|
-
valid =
|
|
881
|
+
valid = _context9.sent;
|
|
826
882
|
|
|
827
883
|
if (valid) {
|
|
828
|
-
|
|
884
|
+
_context9.next = 13;
|
|
829
885
|
break;
|
|
830
886
|
}
|
|
831
887
|
|
|
832
888
|
topoEditDispatchers.update({
|
|
833
889
|
saving: false
|
|
834
890
|
});
|
|
835
|
-
return
|
|
891
|
+
return _context9.abrupt("return");
|
|
836
892
|
|
|
837
893
|
case 13:
|
|
838
894
|
// 保存
|
|
@@ -844,7 +900,7 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
|
844
900
|
|
|
845
901
|
_rlog["default"].info("保存", saveData);
|
|
846
902
|
|
|
847
|
-
|
|
903
|
+
_context9.next = 17;
|
|
848
904
|
return editDispatchers.saveTopo(saveData);
|
|
849
905
|
|
|
850
906
|
case 17:
|
|
@@ -856,14 +912,14 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
|
856
912
|
|
|
857
913
|
case 19:
|
|
858
914
|
case "end":
|
|
859
|
-
return
|
|
915
|
+
return _context9.stop();
|
|
860
916
|
}
|
|
861
917
|
}
|
|
862
|
-
},
|
|
918
|
+
}, _callee9);
|
|
863
919
|
}));
|
|
864
920
|
|
|
865
|
-
return function onSaveTopo(
|
|
866
|
-
return
|
|
921
|
+
return function onSaveTopo(_x14) {
|
|
922
|
+
return _ref7.apply(this, arguments);
|
|
867
923
|
};
|
|
868
924
|
}();
|
|
869
925
|
|
|
@@ -891,12 +947,12 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
|
891
947
|
|
|
892
948
|
|
|
893
949
|
var bindNodeResource = /*#__PURE__*/function () {
|
|
894
|
-
var
|
|
950
|
+
var _ref9 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee11(params) {
|
|
895
951
|
var id, oldResId, newResId, node, parentGroupElement, htTopo, config, groupId, groupTag, _yield$editDispatcher, elements, newData, doBind, _doBind, replaceOrAddRes;
|
|
896
952
|
|
|
897
|
-
return _regenerator["default"].wrap(function
|
|
953
|
+
return _regenerator["default"].wrap(function _callee11$(_context11) {
|
|
898
954
|
while (1) {
|
|
899
|
-
switch (
|
|
955
|
+
switch (_context11.prev = _context11.next) {
|
|
900
956
|
case 0:
|
|
901
957
|
replaceOrAddRes = function _replaceOrAddRes(resources, oldResId, newResId) {
|
|
902
958
|
return (0, _extends2["default"])({}, resources, {
|
|
@@ -907,11 +963,11 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
|
907
963
|
};
|
|
908
964
|
|
|
909
965
|
_doBind = function _doBind3() {
|
|
910
|
-
_doBind = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function
|
|
966
|
+
_doBind = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee10() {
|
|
911
967
|
var dm, newLinkElements, createElementsData, groupChildren, newGroupChildren, existedGroupChildren, groupElement, newElement, sm;
|
|
912
|
-
return _regenerator["default"].wrap(function
|
|
968
|
+
return _regenerator["default"].wrap(function _callee10$(_context10) {
|
|
913
969
|
while (1) {
|
|
914
|
-
switch (
|
|
970
|
+
switch (_context10.prev = _context10.next) {
|
|
915
971
|
case 0:
|
|
916
972
|
dm = htTopo.getGraphView().dm(); // 创建
|
|
917
973
|
|
|
@@ -981,7 +1037,7 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
|
981
1037
|
// node.a("customName", null);
|
|
982
1038
|
// 删除关联在节点上的出口链路
|
|
983
1039
|
|
|
984
|
-
|
|
1040
|
+
_context10.next = 12;
|
|
985
1041
|
return deleteExLink(node);
|
|
986
1042
|
|
|
987
1043
|
case 12:
|
|
@@ -992,10 +1048,10 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
|
992
1048
|
|
|
993
1049
|
case 13:
|
|
994
1050
|
case "end":
|
|
995
|
-
return
|
|
1051
|
+
return _context10.stop();
|
|
996
1052
|
}
|
|
997
1053
|
}
|
|
998
|
-
},
|
|
1054
|
+
}, _callee10);
|
|
999
1055
|
}));
|
|
1000
1056
|
return _doBind.apply(this, arguments);
|
|
1001
1057
|
};
|
|
@@ -1004,6 +1060,7 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
|
1004
1060
|
return _doBind.apply(this, arguments);
|
|
1005
1061
|
};
|
|
1006
1062
|
|
|
1063
|
+
topo.historyManager.beginTransaction();
|
|
1007
1064
|
id = params.id, oldResId = params.oldResId, newResId = params.newResId;
|
|
1008
1065
|
|
|
1009
1066
|
_rlog["default"].debug("bindNodeResource", params);
|
|
@@ -1036,22 +1093,22 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
|
1036
1093
|
config.resources = replaceOrAddRes(config.resources, oldResId, newResId);
|
|
1037
1094
|
}
|
|
1038
1095
|
|
|
1039
|
-
|
|
1096
|
+
_context11.next = 13;
|
|
1040
1097
|
return resourceConfig.updateConfig(config);
|
|
1041
1098
|
|
|
1042
|
-
case
|
|
1043
|
-
|
|
1099
|
+
case 13:
|
|
1100
|
+
_context11.next = 15;
|
|
1044
1101
|
return editDispatchers.fetchDataByConfig();
|
|
1045
1102
|
|
|
1046
|
-
case
|
|
1047
|
-
_yield$editDispatcher =
|
|
1103
|
+
case 15:
|
|
1104
|
+
_yield$editDispatcher = _context11.sent;
|
|
1048
1105
|
elements = _yield$editDispatcher.elements;
|
|
1049
1106
|
newData = elements.find(function (item) {
|
|
1050
1107
|
return item.id === newResId;
|
|
1051
1108
|
});
|
|
1052
1109
|
|
|
1053
1110
|
if (newData) {
|
|
1054
|
-
|
|
1111
|
+
_context11.next = 23;
|
|
1055
1112
|
break;
|
|
1056
1113
|
}
|
|
1057
1114
|
|
|
@@ -1059,26 +1116,26 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
|
1059
1116
|
|
|
1060
1117
|
_rlog["default"].warn("关联资源失败");
|
|
1061
1118
|
|
|
1062
|
-
|
|
1119
|
+
topo.historyManager.endTransaction();
|
|
1120
|
+
return _context11.abrupt("return", false);
|
|
1063
1121
|
|
|
1064
|
-
case
|
|
1065
|
-
|
|
1066
|
-
_context9.next = 24;
|
|
1122
|
+
case 23:
|
|
1123
|
+
_context11.next = 25;
|
|
1067
1124
|
return doBind();
|
|
1068
1125
|
|
|
1069
|
-
case
|
|
1126
|
+
case 25:
|
|
1070
1127
|
topo.historyManager.endTransaction();
|
|
1071
1128
|
|
|
1072
|
-
case
|
|
1129
|
+
case 26:
|
|
1073
1130
|
case "end":
|
|
1074
|
-
return
|
|
1131
|
+
return _context11.stop();
|
|
1075
1132
|
}
|
|
1076
1133
|
}
|
|
1077
|
-
},
|
|
1134
|
+
}, _callee11);
|
|
1078
1135
|
}));
|
|
1079
1136
|
|
|
1080
|
-
return function bindNodeResource(
|
|
1081
|
-
return
|
|
1137
|
+
return function bindNodeResource(_x15) {
|
|
1138
|
+
return _ref9.apply(this, arguments);
|
|
1082
1139
|
};
|
|
1083
1140
|
}();
|
|
1084
1141
|
|