@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
|
@@ -87,43 +87,95 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
|
87
87
|
setShowComboResDrawer(true);
|
|
88
88
|
};
|
|
89
89
|
|
|
90
|
-
var onLayerAdded = function
|
|
91
|
-
var
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
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
|
-
|
|
109
|
-
|
|
110
|
-
|
|
105
|
+
if (!(!isLayerTopo && config.layers.length)) {
|
|
106
|
+
_context2.next = 7;
|
|
107
|
+
break;
|
|
108
|
+
}
|
|
111
109
|
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
config: config
|
|
115
|
-
}); // 如果没有分层,将拓扑类型切换为空白模板
|
|
110
|
+
_context2.next = 7;
|
|
111
|
+
return topoDispatchers.setTopoType(TPL_TREE);
|
|
116
112
|
|
|
117
|
-
|
|
118
|
-
|
|
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
|
-
|
|
128
|
+
return function onLayerAdded(_x) {
|
|
129
|
+
return _ref3.apply(this, arguments);
|
|
130
|
+
};
|
|
131
|
+
}();
|
|
123
132
|
|
|
124
|
-
|
|
125
|
-
|
|
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
|
|
148
|
-
return _regeneratorRuntime.wrap(function
|
|
199
|
+
var _onOk = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee4() {
|
|
200
|
+
return _regeneratorRuntime.wrap(function _callee4$(_context4) {
|
|
149
201
|
while (1) {
|
|
150
|
-
switch (
|
|
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
|
|
208
|
+
return _context4.stop();
|
|
157
209
|
}
|
|
158
210
|
}
|
|
159
|
-
},
|
|
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
|
|
206
|
-
return _regeneratorRuntime.wrap(function
|
|
257
|
+
var _onOk2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee5() {
|
|
258
|
+
return _regeneratorRuntime.wrap(function _callee5$(_context5) {
|
|
207
259
|
while (1) {
|
|
208
|
-
switch (
|
|
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
|
|
266
|
+
return _context5.stop();
|
|
215
267
|
}
|
|
216
268
|
}
|
|
217
|
-
},
|
|
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
|
|
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
|
|
368
|
+
return _regeneratorRuntime.wrap(function _callee6$(_context6) {
|
|
317
369
|
while (1) {
|
|
318
|
-
switch (
|
|
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
|
-
|
|
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
|
-
|
|
391
|
+
_context6.next = 8;
|
|
340
392
|
return resourceConfig.updateConfig(config);
|
|
341
393
|
|
|
342
394
|
case 8:
|
|
343
395
|
case "end":
|
|
344
|
-
return
|
|
396
|
+
return _context6.stop();
|
|
345
397
|
}
|
|
346
398
|
}
|
|
347
|
-
},
|
|
399
|
+
}, _callee6);
|
|
348
400
|
}));
|
|
349
401
|
|
|
350
|
-
return function deleteExLink(
|
|
351
|
-
return
|
|
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(
|
|
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
|
|
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
|
|
473
|
+
return _regeneratorRuntime.wrap(function _callee12$(_context12) {
|
|
422
474
|
while (1) {
|
|
423
|
-
switch (
|
|
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
|
-
|
|
479
|
+
_context12.next = 4;
|
|
428
480
|
return resourceConfig.updateGroupResources(group, resources);
|
|
429
481
|
|
|
430
482
|
case 4:
|
|
431
|
-
|
|
483
|
+
_context12.next = 6;
|
|
432
484
|
return editDispatchers.fetchDataByConfig();
|
|
433
485
|
|
|
434
486
|
case 6:
|
|
435
|
-
_yield$editDispatcher2 =
|
|
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
|
|
504
|
+
return _context12.stop();
|
|
453
505
|
}
|
|
454
506
|
}
|
|
455
|
-
},
|
|
507
|
+
}, _callee12);
|
|
456
508
|
}));
|
|
457
509
|
return _bindGroupResources.apply(this, arguments);
|
|
458
510
|
}
|
|
459
511
|
|
|
460
|
-
function addGroupResources(
|
|
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
|
|
521
|
+
_addGroupResources = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee13(group, newResourceIds) {
|
|
470
522
|
var groupConfig, resources, groupData;
|
|
471
|
-
return _regeneratorRuntime.wrap(function
|
|
523
|
+
return _regeneratorRuntime.wrap(function _callee13$(_context13) {
|
|
472
524
|
while (1) {
|
|
473
|
-
switch (
|
|
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
|
-
|
|
535
|
+
_context13.next = 5;
|
|
484
536
|
return bindGroupResources(groupData, resources, newResourceIds);
|
|
485
537
|
|
|
486
538
|
case 5:
|
|
487
539
|
case "end":
|
|
488
|
-
return
|
|
540
|
+
return _context13.stop();
|
|
489
541
|
}
|
|
490
542
|
}
|
|
491
|
-
},
|
|
543
|
+
}, _callee13);
|
|
492
544
|
}));
|
|
493
545
|
return _addGroupResources.apply(this, arguments);
|
|
494
546
|
}
|
|
495
547
|
|
|
496
|
-
function bindViewResources(
|
|
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
|
|
560
|
+
_bindViewResources = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee14(data) {
|
|
509
561
|
var config, _yield$editDispatcher3, elements;
|
|
510
562
|
|
|
511
|
-
return _regeneratorRuntime.wrap(function
|
|
563
|
+
return _regeneratorRuntime.wrap(function _callee14$(_context14) {
|
|
512
564
|
while (1) {
|
|
513
|
-
switch (
|
|
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
|
-
|
|
570
|
+
_context14.next = 5;
|
|
519
571
|
return resourceConfig.updateConfig(config);
|
|
520
572
|
|
|
521
573
|
case 5:
|
|
522
|
-
|
|
574
|
+
_context14.next = 7;
|
|
523
575
|
return editDispatchers.fetchDataByConfig();
|
|
524
576
|
|
|
525
577
|
case 7:
|
|
526
|
-
_yield$editDispatcher3 =
|
|
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
|
|
588
|
+
return _context14.stop();
|
|
537
589
|
}
|
|
538
590
|
}
|
|
539
|
-
},
|
|
591
|
+
}, _callee14);
|
|
540
592
|
}));
|
|
541
593
|
return _bindViewResources.apply(this, arguments);
|
|
542
594
|
}
|
|
543
595
|
|
|
544
|
-
function addLayerResources(
|
|
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
|
|
601
|
+
_addLayerResources = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee15(group, newResourceIds) {
|
|
550
602
|
var _yield$editDispatcher4, elements, data;
|
|
551
603
|
|
|
552
|
-
return _regeneratorRuntime.wrap(function
|
|
604
|
+
return _regeneratorRuntime.wrap(function _callee15$(_context15) {
|
|
553
605
|
while (1) {
|
|
554
|
-
switch (
|
|
606
|
+
switch (_context15.prev = _context15.next) {
|
|
555
607
|
case 0:
|
|
556
|
-
|
|
608
|
+
topo.historyManager.beginTransaction(); // 构造新的配置
|
|
609
|
+
|
|
610
|
+
_context15.next = 3;
|
|
557
611
|
return resourceConfig.addLayerStaticResources(group, newResourceIds);
|
|
558
612
|
|
|
559
|
-
case
|
|
560
|
-
|
|
613
|
+
case 3:
|
|
614
|
+
_context15.next = 5;
|
|
561
615
|
return editDispatchers.fetchDataByConfig();
|
|
562
616
|
|
|
563
|
-
case
|
|
564
|
-
_yield$editDispatcher4 =
|
|
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
|
-
|
|
633
|
+
_context15.next = 10;
|
|
580
634
|
return topo.updateElements(data);
|
|
581
635
|
|
|
582
|
-
case
|
|
636
|
+
case 10:
|
|
583
637
|
// 临时放这里,仅拓扑中心有
|
|
584
638
|
if (topo.linkDynamicStyleExecutor) {
|
|
585
639
|
topo.linkDynamicStyleExecutor.execute();
|
|
586
640
|
}
|
|
587
641
|
|
|
588
|
-
|
|
642
|
+
topo.historyManager.endTransaction();
|
|
643
|
+
|
|
644
|
+
case 12:
|
|
589
645
|
case "end":
|
|
590
|
-
return
|
|
646
|
+
return _context15.stop();
|
|
591
647
|
}
|
|
592
648
|
}
|
|
593
|
-
},
|
|
649
|
+
}, _callee15);
|
|
594
650
|
}));
|
|
595
651
|
return _addLayerResources.apply(this, arguments);
|
|
596
652
|
}
|
|
597
653
|
|
|
598
|
-
function addResourceToFirstLayer(
|
|
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
|
|
659
|
+
_addResourceToFirstLayer = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee16(data) {
|
|
604
660
|
var group;
|
|
605
|
-
return _regeneratorRuntime.wrap(function
|
|
661
|
+
return _regeneratorRuntime.wrap(function _callee16$(_context16) {
|
|
606
662
|
while (1) {
|
|
607
|
-
switch (
|
|
663
|
+
switch (_context16.prev = _context16.next) {
|
|
608
664
|
case 0:
|
|
609
665
|
group = resourceConfig.getGroups()[0];
|
|
610
|
-
|
|
666
|
+
_context16.next = 3;
|
|
611
667
|
return addLayerResources(group, data);
|
|
612
668
|
|
|
613
669
|
case 3:
|
|
614
670
|
case "end":
|
|
615
|
-
return
|
|
671
|
+
return _context16.stop();
|
|
616
672
|
}
|
|
617
673
|
}
|
|
618
|
-
},
|
|
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
|
|
645
|
-
return _regeneratorRuntime.wrap(function
|
|
700
|
+
var _ref6 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee7(data) {
|
|
701
|
+
return _regeneratorRuntime.wrap(function _callee7$(_context7) {
|
|
646
702
|
while (1) {
|
|
647
|
-
switch (
|
|
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
|
-
|
|
709
|
+
_context7.next = 7;
|
|
654
710
|
break;
|
|
655
711
|
}
|
|
656
712
|
|
|
657
|
-
|
|
713
|
+
_context7.next = 5;
|
|
658
714
|
return addResourceToFirstLayer(data);
|
|
659
715
|
|
|
660
716
|
case 5:
|
|
661
|
-
|
|
717
|
+
_context7.next = 9;
|
|
662
718
|
break;
|
|
663
719
|
|
|
664
720
|
case 7:
|
|
665
|
-
|
|
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
|
|
729
|
+
return _context7.stop();
|
|
674
730
|
}
|
|
675
731
|
}
|
|
676
|
-
},
|
|
732
|
+
}, _callee7);
|
|
677
733
|
}));
|
|
678
734
|
|
|
679
|
-
return function onSaveComboRes(
|
|
680
|
-
return
|
|
735
|
+
return function onSaveComboRes(_x12) {
|
|
736
|
+
return _ref6.apply(this, arguments);
|
|
681
737
|
};
|
|
682
738
|
}();
|
|
683
739
|
|
|
684
|
-
function checkSavePermission(
|
|
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
|
|
745
|
+
_checkSavePermission = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee17(id) {
|
|
690
746
|
var permission;
|
|
691
|
-
return _regeneratorRuntime.wrap(function
|
|
747
|
+
return _regeneratorRuntime.wrap(function _callee17$(_context17) {
|
|
692
748
|
while (1) {
|
|
693
|
-
switch (
|
|
749
|
+
switch (_context17.prev = _context17.next) {
|
|
694
750
|
case 0:
|
|
695
|
-
|
|
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 =
|
|
758
|
+
permission = _context17.sent;
|
|
703
759
|
|
|
704
760
|
if (!topoPermissonUtil.isEditable(permission)) {
|
|
705
|
-
|
|
761
|
+
_context17.next = 5;
|
|
706
762
|
break;
|
|
707
763
|
}
|
|
708
764
|
|
|
709
|
-
return
|
|
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
|
|
777
|
+
return _context17.abrupt("return", false);
|
|
722
778
|
|
|
723
779
|
case 7:
|
|
724
780
|
case "end":
|
|
725
|
-
return
|
|
781
|
+
return _context17.stop();
|
|
726
782
|
}
|
|
727
783
|
}
|
|
728
|
-
},
|
|
784
|
+
}, _callee17);
|
|
729
785
|
}));
|
|
730
786
|
return _checkSavePermission.apply(this, arguments);
|
|
731
787
|
}
|
|
732
788
|
|
|
733
789
|
var onSaveTopo = /*#__PURE__*/function () {
|
|
734
|
-
var
|
|
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
|
|
793
|
+
return _regeneratorRuntime.wrap(function _callee9$(_context9) {
|
|
738
794
|
while (1) {
|
|
739
|
-
switch (
|
|
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
|
-
|
|
801
|
+
_context9.next = 6;
|
|
746
802
|
break;
|
|
747
803
|
}
|
|
748
804
|
|
|
749
805
|
// 自定义保存
|
|
750
806
|
saveConfig = /*#__PURE__*/function () {
|
|
751
|
-
var
|
|
752
|
-
return _regeneratorRuntime.wrap(function
|
|
807
|
+
var _ref8 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee8() {
|
|
808
|
+
return _regeneratorRuntime.wrap(function _callee8$(_context8) {
|
|
753
809
|
while (1) {
|
|
754
|
-
switch (
|
|
810
|
+
switch (_context8.prev = _context8.next) {
|
|
755
811
|
case 0:
|
|
756
|
-
|
|
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
|
|
821
|
+
return _context8.stop();
|
|
766
822
|
}
|
|
767
823
|
}
|
|
768
|
-
},
|
|
824
|
+
}, _callee8);
|
|
769
825
|
}));
|
|
770
826
|
|
|
771
827
|
return function saveConfig() {
|
|
772
|
-
return
|
|
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
|
|
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
|
-
|
|
844
|
+
_context9.next = 9;
|
|
789
845
|
return checkSavePermission(id);
|
|
790
846
|
|
|
791
847
|
case 9:
|
|
792
|
-
valid =
|
|
848
|
+
valid = _context9.sent;
|
|
793
849
|
|
|
794
850
|
if (valid) {
|
|
795
|
-
|
|
851
|
+
_context9.next = 13;
|
|
796
852
|
break;
|
|
797
853
|
}
|
|
798
854
|
|
|
799
855
|
topoEditDispatchers.update({
|
|
800
856
|
saving: false
|
|
801
857
|
});
|
|
802
|
-
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
|
-
|
|
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
|
|
880
|
+
return _context9.stop();
|
|
825
881
|
}
|
|
826
882
|
}
|
|
827
|
-
},
|
|
883
|
+
}, _callee9);
|
|
828
884
|
}));
|
|
829
885
|
|
|
830
|
-
return function onSaveTopo(
|
|
831
|
-
return
|
|
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
|
|
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
|
|
916
|
+
return _regeneratorRuntime.wrap(function _callee11$(_context11) {
|
|
861
917
|
while (1) {
|
|
862
|
-
switch (
|
|
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
|
|
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
|
|
931
|
+
return _regeneratorRuntime.wrap(function _callee10$(_context10) {
|
|
876
932
|
while (1) {
|
|
877
|
-
switch (
|
|
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
|
-
|
|
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
|
|
1013
|
+
return _context10.stop();
|
|
958
1014
|
}
|
|
959
1015
|
}
|
|
960
|
-
},
|
|
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
|
-
|
|
1056
|
+
_context11.next = 13;
|
|
1000
1057
|
return resourceConfig.updateConfig(config);
|
|
1001
1058
|
|
|
1002
|
-
case
|
|
1003
|
-
|
|
1059
|
+
case 13:
|
|
1060
|
+
_context11.next = 15;
|
|
1004
1061
|
return editDispatchers.fetchDataByConfig();
|
|
1005
1062
|
|
|
1006
|
-
case
|
|
1007
|
-
_yield$editDispatcher =
|
|
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
|
-
|
|
1071
|
+
_context11.next = 23;
|
|
1015
1072
|
break;
|
|
1016
1073
|
}
|
|
1017
1074
|
|
|
1018
1075
|
_Message.error("关联资源失败");
|
|
1019
1076
|
|
|
1020
1077
|
rlog.warn("关联资源失败");
|
|
1021
|
-
|
|
1078
|
+
topo.historyManager.endTransaction();
|
|
1079
|
+
return _context11.abrupt("return", false);
|
|
1022
1080
|
|
|
1023
|
-
case
|
|
1024
|
-
|
|
1025
|
-
_context9.next = 24;
|
|
1081
|
+
case 23:
|
|
1082
|
+
_context11.next = 25;
|
|
1026
1083
|
return doBind();
|
|
1027
1084
|
|
|
1028
|
-
case
|
|
1085
|
+
case 25:
|
|
1029
1086
|
topo.historyManager.endTransaction();
|
|
1030
1087
|
|
|
1031
|
-
case
|
|
1088
|
+
case 26:
|
|
1032
1089
|
case "end":
|
|
1033
|
-
return
|
|
1090
|
+
return _context11.stop();
|
|
1034
1091
|
}
|
|
1035
1092
|
}
|
|
1036
|
-
},
|
|
1093
|
+
}, _callee11);
|
|
1037
1094
|
}));
|
|
1038
1095
|
|
|
1039
|
-
return function bindNodeResource(
|
|
1040
|
-
return
|
|
1096
|
+
return function bindNodeResource(_x15) {
|
|
1097
|
+
return _ref9.apply(this, arguments);
|
|
1041
1098
|
};
|
|
1042
1099
|
}();
|
|
1043
1100
|
|