@riil-frontend/component-topology 12.0.0-dev.3 → 12.0.0-dev.31
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 +1 -1
- package/build/index.css +1 -1
- package/build/index.js +13 -13
- package/es/components/BatchAttrMetric/setting.js +1 -1
- package/es/components/ModelAttrSelectDrawer/components/MultipleTypeAttributeSelectDrawer.js +1 -1
- package/es/components/ResourceSelectDrawer/ResourceSelectDrawer.js +1 -1
- package/es/components/TemplateButton/index.module.scss +1 -1
- package/es/core/components/AlarmListPanel/components/AlarmListItem.js +58 -3
- package/es/core/components/AlarmListPanel/index.js +1 -1
- package/es/core/components/DisplaySettingDrawer/DisplaySetting.js +1 -1
- package/es/core/components/DisplaySettingDrawer/DisplaySettingDrawer.js +2 -2
- package/es/core/components/DisplaySettingDrawer/ResourceDisplay/BasicConfig.js +1 -1
- package/es/core/components/DisplaySettingDrawer/components/NodeAttrSettingDrawer.js +1 -1
- package/es/core/components/ResourceViewAttributeSetting/Setting.js +1 -1
- package/es/core/components/TopoView/topoView.js +6 -2
- package/es/core/editor/components/BackgroundView/index.js +1 -1
- package/es/core/editor/components/CustomIconPlugin/UploadIconDialog.js +1 -1
- package/es/core/editor/components/EditorPlugin.js +1 -1
- package/es/core/editor/components/Sidebar/views/ComponentPanel.js +1 -1
- package/es/core/editor/components/Sidebar/views/ImagePanel/CiTypeImagePanel.js +1 -1
- package/es/core/editor/components/Sidebar/views/ImagePanel/CustomImagePanel.js +1 -1
- package/es/core/editor/components/Sidebar/views/ImagePanel/HtCustomImagePanel.js +1 -1
- package/es/core/editor/components/Sidebar/views/ImagePanel/HtImagePalette.js +1 -1
- package/es/core/editor/components/Sidebar/views/ImagePanel/ImagePalette.js +1 -1
- package/es/core/editor/components/Sidebar/views/LinkPanel.js +1 -1
- package/es/core/editor/components/Toolbar/widgets/EdgeColorButton/EdgeColorButton.js +5 -12
- package/es/core/editor/components/Toolbar/widgets/EdgeTypeButton/EdgeType.js +27 -10
- package/es/core/editor/components/Toolbar/widgets/EdgeTypeButton/EdgeType.module.scss +21 -1
- package/es/core/editor/components/Toolbar/widgets/EdgeTypeButton/LineType.js +9 -0
- package/es/core/editor/components/Toolbar/widgets/EdgeTypeButton/index.js +2 -2
- package/es/core/editor/components/Toolbar/widgets/Layout/index.js +16 -2
- package/es/core/editor/components/settings/common/NodeSizeInput/NodeSizeInput.js +1 -1
- package/es/core/editor/components/settings/common/SizeInput/NodeSizeInput.js +1 -1
- package/es/core/editor/components/settings/propertyViews/layer/BasicSetting.js +1 -1
- package/es/core/editor/components/settings/propertyViews/layer/SettingTab/Setting.js +1 -1
- package/es/core/editor/components/settings/propertyViews/view/hooks/useBackgroundSizeConfig.js +1 -1
- package/es/core/editor/hooks/useKeyboardShortcut.js +3 -1
- package/es/core/editor/store/background.js +1 -1
- package/es/core/editor/store/historyManager.js +1 -1
- package/es/core/editor/store/topoEdit.js +1 -1
- package/es/core/editor/utils/copyElementUtil.js +12 -0
- package/es/core/editor/utils/edgeTypeStyleUtil.js +8 -7
- package/es/core/hooks/__tests__/useCiAttributeChange.test.js +0 -0
- package/es/core/hooks/ht/useHtDataPropertyChangeListener.js +1 -1
- package/es/core/hooks/useAlarm.js +119 -82
- package/es/core/hooks/useCiAttributeChange.js +31 -15
- package/es/core/hooks/useCmpLinkAlarm.js +153 -0
- package/es/core/hooks/useEventData.js +1 -2
- package/es/core/hooks/useGraphAlarmDisplay.js +91 -56
- package/es/core/hooks/useManageStatus.js +1 -1
- package/es/core/hooks/usePolling.js +1 -1
- package/es/core/hooks/useResourceConfig.js +1 -3
- package/es/core/hooks/useTopoEdit.js +51 -54
- package/es/core/models/Alarm.js +70 -143
- package/es/core/models/AttributeMetricDisplay.js +15 -6
- package/es/core/models/HistoryManager.js +1 -1
- package/es/core/models/SelectionModel.js +1 -1
- package/es/core/models/TopoApp.js +2 -2
- package/es/core/models/attributeFormatter/formatter/graphTransform.js +1 -1
- package/es/core/models/attributeFormatter/index.js +1 -1
- package/es/core/models/cache/CiCache.d.ts +1 -1
- package/es/core/models/cache/CiCache.js +3 -3
- package/es/core/models/cache/CiTypeCache.js +5 -1
- package/es/core/models/cache/DictCache.js +1 -1
- package/es/core/models/plugins/resourceWebControllUrl.js +1 -1
- package/es/core/models/tagstips/ElementTagTipConfig.js +1 -1
- package/es/core/models/topoData.js +0 -1
- package/es/core/services/alarm.js +1 -1
- package/es/core/services/index.js +1 -1
- package/es/core/services/topo/basic.js +2 -2
- package/es/core/store/models/customIcon.js +1 -1
- package/es/core/store/models/displayConfig.js +1 -1
- package/es/core/store/models/selection.js +1 -1
- package/es/core/store/models/topoBaseInfoOverview.js +1 -1
- package/es/core/store/models/topoBizMod.js +1 -1
- package/es/core/store/models/topoConfig.js +7 -10
- package/es/core/store/models/topoGraphView.js +1 -1
- package/es/core/store/models/topoMod.js +82 -135
- package/es/core/store/models/viewer/lock.js +1 -1
- package/es/core/store/models/viewer/resourceDetail.js +1 -1
- package/es/core/store/models/viewer/resourceWebControllUrlSetting.js +1 -1
- package/es/core/utils/edgeUtil.js +10 -1
- package/es/core/utils/metricUtil.js +8 -4
- package/es/core/utils/showGraphManageStatusUtil.js +3 -2
- package/es/core/utils/showMessage.js +1 -1
- package/es/core/viewer/components/plugins/ResourceDetail/ResourceDetail.js +1 -0
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/EventsCard.js +12 -13
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/ResourceOverview.js +3 -1
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/LinkTopoCard.js +4 -2
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/hooks/useMetricPolling.js +1 -1
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/services/index.js +1 -1
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/hooks/useAlarmAndRiskData.js +20 -18
- package/es/core/viewer/components/plugins/ResourceDetail/components/WebConsole/WebConsoleForm/hooks/useWebConsole.js +1 -1
- package/es/core/viewer/components/plugins/ViewerPlugin.js +3 -1
- package/es/core/viewer/components/titlebar/widgets/AlarmButton.js +1 -5
- package/es/networkTopo/components/Link/index.js +1 -1
- package/es/networkTopo/components/TopoView.js +6 -11
- package/es/networkTopo/hooks/useEdgeExpand.js +2 -3
- package/es/networkTopo/hooks/viewer/useRelateTopo.js +1 -1
- package/es/networkTopo/models/LinkDynamicStyleExecutor.js +1 -1
- package/es/networkTopo/models/LinkTagsTipsBuilder.js +1 -1
- package/es/networkTopo/models/TopoCenter.js +1 -1
- package/es/networkTopo/services/model.js +1 -1
- package/es/networkTopo/services/topo/basic.js +4 -4
- package/es/networkTopo/services/topo/ciInfo.js +1 -1
- package/es/networkTopo/store/functionAuth.js +1 -1
- package/es/networkTopo/store/topoCenter.js +261 -224
- package/es/networkTopo/store/topoTreeMod.js +1 -1
- package/es/networkTopo/utils/exportData.js +1 -1
- package/es/style.js +2 -2
- package/es/utils/ResourceConfigUtil.js +4 -37
- package/es/utils/ciRefAttributeTranslateUtil.d.ts +19 -0
- package/es/utils/ciRefAttributeTranslateUtil.js +155 -0
- package/es/utils/format.js +1 -1
- package/es/utils/topoData.js +4 -2
- package/lib/components/BatchAttrMetric/setting.js +2 -2
- package/lib/components/ModelAttrSelectDrawer/components/MultipleTypeAttributeSelectDrawer.js +2 -2
- package/lib/components/ResourceSelectDrawer/ResourceSelectDrawer.js +2 -2
- package/lib/components/TemplateButton/index.module.scss +1 -1
- package/lib/core/components/AlarmListPanel/components/AlarmListItem.js +60 -3
- package/lib/core/components/AlarmListPanel/index.js +1 -1
- package/lib/core/components/DisplaySettingDrawer/DisplaySetting.js +2 -2
- package/lib/core/components/DisplaySettingDrawer/DisplaySettingDrawer.js +2 -2
- package/lib/core/components/DisplaySettingDrawer/ResourceDisplay/BasicConfig.js +3 -3
- package/lib/core/components/DisplaySettingDrawer/components/NodeAttrSettingDrawer.js +2 -2
- package/lib/core/components/ResourceViewAttributeSetting/Setting.js +2 -2
- package/lib/core/components/TopoView/topoView.js +14 -10
- package/lib/core/editor/components/BackgroundView/index.js +3 -3
- package/lib/core/editor/components/CustomIconPlugin/UploadIconDialog.js +2 -2
- package/lib/core/editor/components/EditorPlugin.js +3 -3
- package/lib/core/editor/components/Sidebar/views/ComponentPanel.js +2 -4
- package/lib/core/editor/components/Sidebar/views/ImagePanel/CiTypeImagePanel.js +1 -1
- package/lib/core/editor/components/Sidebar/views/ImagePanel/CustomImagePanel.js +1 -1
- package/lib/core/editor/components/Sidebar/views/ImagePanel/HtCustomImagePanel.js +2 -2
- package/lib/core/editor/components/Sidebar/views/ImagePanel/HtImagePalette.js +2 -2
- package/lib/core/editor/components/Sidebar/views/ImagePanel/ImagePalette.js +2 -4
- package/lib/core/editor/components/Sidebar/views/LinkPanel.js +2 -4
- package/lib/core/editor/components/Toolbar/widgets/EdgeColorButton/EdgeColorButton.js +6 -12
- package/lib/core/editor/components/Toolbar/widgets/EdgeTypeButton/EdgeType.js +27 -9
- package/lib/core/editor/components/Toolbar/widgets/EdgeTypeButton/EdgeType.module.scss +21 -1
- package/lib/core/editor/components/Toolbar/widgets/EdgeTypeButton/LineType.js +8 -0
- package/lib/core/editor/components/Toolbar/widgets/EdgeTypeButton/index.js +1 -1
- package/lib/core/editor/components/Toolbar/widgets/Layout/index.js +16 -2
- package/lib/core/editor/components/settings/common/NodeSizeInput/NodeSizeInput.js +5 -5
- package/lib/core/editor/components/settings/common/SizeInput/NodeSizeInput.js +1 -1
- package/lib/core/editor/components/settings/propertyViews/layer/BasicSetting.js +1 -1
- package/lib/core/editor/components/settings/propertyViews/layer/SettingTab/Setting.js +3 -3
- package/lib/core/editor/components/settings/propertyViews/view/hooks/useBackgroundSizeConfig.js +2 -2
- package/lib/core/editor/hooks/useKeyboardShortcut.js +2 -0
- package/lib/core/editor/store/background.js +1 -1
- package/lib/core/editor/store/historyManager.js +1 -1
- package/lib/core/editor/store/topoEdit.js +1 -1
- package/lib/core/editor/utils/copyElementUtil.js +15 -0
- package/lib/core/editor/utils/edgeTypeStyleUtil.js +8 -6
- package/lib/core/hooks/__tests__/useCiAttributeChange.test.js +1 -0
- package/lib/core/hooks/ht/useHtDataPropertyChangeListener.js +1 -3
- package/lib/core/hooks/useAlarm.js +118 -80
- package/lib/core/hooks/useCiAttributeChange.js +30 -14
- package/lib/core/hooks/useCmpLinkAlarm.js +166 -0
- package/lib/core/hooks/useEventData.js +1 -2
- package/lib/core/hooks/useGraphAlarmDisplay.js +91 -55
- package/lib/core/hooks/useManageStatus.js +1 -1
- package/lib/core/hooks/usePolling.js +3 -3
- package/lib/core/hooks/useResourceConfig.js +1 -3
- package/lib/core/hooks/useTopoEdit.js +50 -53
- package/lib/core/models/Alarm.js +77 -152
- package/lib/core/models/AttributeMetricDisplay.js +18 -6
- package/lib/core/models/HistoryManager.js +8 -8
- package/lib/core/models/SelectionModel.js +5 -5
- package/lib/core/models/TopoApp.js +4 -6
- package/lib/core/models/attributeFormatter/formatter/graphTransform.js +2 -4
- package/lib/core/models/attributeFormatter/index.js +1 -1
- package/lib/core/models/cache/CiCache.d.ts +1 -1
- package/lib/core/models/cache/CiCache.js +3 -3
- package/lib/core/models/cache/CiTypeCache.js +6 -2
- package/lib/core/models/cache/DictCache.js +2 -2
- package/lib/core/models/plugins/resourceWebControllUrl.js +2 -2
- package/lib/core/models/tagstips/ElementTagTipConfig.js +2 -2
- package/lib/core/models/topoData.js +0 -1
- package/lib/core/services/alarm.js +2 -2
- package/lib/core/services/index.js +1 -1
- package/lib/core/services/topo/basic.js +2 -2
- package/lib/core/store/models/customIcon.js +3 -3
- package/lib/core/store/models/displayConfig.js +1 -1
- package/lib/core/store/models/selection.js +1 -1
- package/lib/core/store/models/topoBaseInfoOverview.js +1 -1
- package/lib/core/store/models/topoBizMod.js +1 -1
- package/lib/core/store/models/topoConfig.js +7 -10
- package/lib/core/store/models/topoGraphView.js +1 -1
- package/lib/core/store/models/topoMod.js +89 -142
- package/lib/core/store/models/viewer/lock.js +1 -1
- package/lib/core/store/models/viewer/resourceDetail.js +1 -1
- package/lib/core/store/models/viewer/resourceWebControllUrlSetting.js +1 -1
- package/lib/core/utils/edgeUtil.js +12 -1
- package/lib/core/utils/metricUtil.js +8 -4
- package/lib/core/utils/showGraphManageStatusUtil.js +3 -2
- package/lib/core/utils/showMessage.js +2 -2
- package/lib/core/viewer/components/plugins/ResourceDetail/ResourceDetail.js +1 -0
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/EventsCard.js +12 -13
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/ResourceOverview.js +3 -1
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/LinkTopoCard.js +4 -2
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/hooks/useMetricPolling.js +6 -6
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/services/index.js +3 -5
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/hooks/useAlarmAndRiskData.js +20 -18
- package/lib/core/viewer/components/plugins/ResourceDetail/components/WebConsole/WebConsoleForm/hooks/useWebConsole.js +2 -2
- package/lib/core/viewer/components/plugins/ViewerPlugin.js +3 -1
- package/lib/core/viewer/components/titlebar/widgets/AlarmButton.js +1 -5
- package/lib/networkTopo/components/Link/index.js +2 -2
- package/lib/networkTopo/components/TopoView.js +5 -14
- package/lib/networkTopo/hooks/useEdgeExpand.js +2 -3
- package/lib/networkTopo/hooks/viewer/useRelateTopo.js +4 -4
- package/lib/networkTopo/models/LinkDynamicStyleExecutor.js +3 -5
- package/lib/networkTopo/models/LinkTagsTipsBuilder.js +3 -3
- package/lib/networkTopo/models/TopoCenter.js +1 -1
- package/lib/networkTopo/services/model.js +1 -3
- package/lib/networkTopo/services/topo/basic.js +4 -6
- package/lib/networkTopo/services/topo/ciInfo.js +0 -2
- package/lib/networkTopo/store/functionAuth.js +1 -1
- package/lib/networkTopo/store/topoCenter.js +263 -226
- package/lib/networkTopo/store/topoTreeMod.js +5 -5
- package/lib/networkTopo/utils/exportData.js +1 -3
- package/lib/style.js +2 -2
- package/lib/utils/ResourceConfigUtil.js +4 -39
- package/lib/utils/ciRefAttributeTranslateUtil.d.ts +19 -0
- package/lib/utils/ciRefAttributeTranslateUtil.js +168 -0
- package/lib/utils/format.js +1 -1
- package/lib/utils/topoData.js +4 -2
- package/package.json +4 -4
@@ -3,7 +3,7 @@
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
4
4
|
|
5
5
|
exports.__esModule = true;
|
6
|
-
exports["default"] =
|
6
|
+
exports["default"] = _default;
|
7
7
|
|
8
8
|
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
9
9
|
|
@@ -11,251 +11,288 @@ var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/
|
|
11
11
|
|
12
12
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
13
13
|
|
14
|
-
var
|
14
|
+
var _componentTopologyUtils = require("@riil-frontend/component-topology-utils");
|
15
|
+
|
16
|
+
var _topoData = require("../../utils/topoData");
|
15
17
|
|
16
18
|
/**
|
17
19
|
* 拓扑中心 Model
|
18
20
|
*
|
19
21
|
*
|
20
22
|
*/
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
params
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
23
|
+
function _default(topo) {
|
24
|
+
return {
|
25
|
+
// 定义 model 的初始 state
|
26
|
+
state: {
|
27
|
+
loading: true,
|
28
|
+
id: undefined,
|
29
|
+
viewState: 'view' // view, create, 2种模式
|
30
|
+
|
31
|
+
},
|
32
|
+
// 定义改变该模型状态的纯函数
|
33
|
+
reducers: {
|
34
|
+
update: function update(prevState, payload) {
|
35
|
+
return (0, _extends2["default"])({}, prevState, payload);
|
36
|
+
}
|
37
|
+
},
|
38
|
+
// 定义处理该模型副作用的函数
|
39
|
+
effects: function effects(dispatch) {
|
40
|
+
return {
|
41
|
+
/**
|
42
|
+
* 初始化。
|
43
|
+
*/
|
44
|
+
initData: function initData(params, rootState) {
|
45
|
+
var _this = this;
|
46
|
+
|
47
|
+
return (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee() {
|
48
|
+
var topoModState, viewType, id, topoTreeModState;
|
49
|
+
return _regenerator["default"].wrap(function _callee$(_context) {
|
50
|
+
while (1) switch (_context.prev = _context.next) {
|
51
|
+
case 0:
|
52
|
+
if (params === void 0) {
|
53
|
+
params = {};
|
54
|
+
}
|
55
|
+
|
56
|
+
topoModState = rootState.topoMod;
|
57
|
+
viewType = params.type || 'view';
|
58
|
+
id = params.id || topoModState.topoId || '';
|
59
|
+
|
60
|
+
_this.update({
|
61
|
+
loading: true,
|
62
|
+
viewState: viewType
|
63
|
+
}); // 加载功能操作权限
|
64
|
+
|
65
|
+
|
66
|
+
_context.next = 7;
|
67
|
+
return dispatch.functionAuth.init();
|
68
|
+
|
69
|
+
case 7:
|
70
|
+
// 加载拓扑树数据
|
71
|
+
topoTreeModState = rootState.topoTreeMod;
|
72
|
+
|
73
|
+
if (topoTreeModState.loaded) {
|
74
|
+
_context.next = 16;
|
75
|
+
break;
|
76
|
+
}
|
77
|
+
|
78
|
+
_context.next = 11;
|
79
|
+
return dispatch.topoTreeMod.fetchTopoTree({
|
80
|
+
id: id
|
81
|
+
});
|
82
|
+
|
83
|
+
case 11:
|
84
|
+
_context.next = 13;
|
85
|
+
return dispatch.topoTreeMod.getSelectedTopoId();
|
86
|
+
|
87
|
+
case 13:
|
88
|
+
id = _context.sent;
|
89
|
+
_context.next = 18;
|
72
90
|
break;
|
73
|
-
}
|
74
91
|
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
});
|
92
|
+
case 16:
|
93
|
+
_context.next = 18;
|
94
|
+
return _this.refreshTopoTree();
|
79
95
|
|
80
|
-
|
81
|
-
|
82
|
-
|
96
|
+
case 18:
|
97
|
+
if (id) {
|
98
|
+
// 左侧树切换选中
|
99
|
+
dispatch.topoTreeMod.selectNode(id);
|
100
|
+
}
|
83
101
|
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
102
|
+
if (!(viewType === 'create')) {
|
103
|
+
_context.next = 24;
|
104
|
+
break;
|
105
|
+
}
|
88
106
|
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
case 18:
|
94
|
-
if (id) {
|
95
|
-
// 左侧树切换选中
|
96
|
-
dispatch.topoTreeMod.selectNode(id);
|
97
|
-
}
|
107
|
+
_context.next = 22;
|
108
|
+
return _this.openCreateTopoPage({
|
109
|
+
id: id
|
110
|
+
});
|
98
111
|
|
99
|
-
|
100
|
-
_context.next =
|
112
|
+
case 22:
|
113
|
+
_context.next = 29;
|
101
114
|
break;
|
102
|
-
}
|
103
115
|
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
116
|
+
case 24:
|
117
|
+
if (!params.selectedElementTag) {
|
118
|
+
_context.next = 27;
|
119
|
+
break;
|
120
|
+
}
|
108
121
|
|
109
|
-
case 22:
|
110
|
-
_context.next = 29;
|
111
|
-
break;
|
112
|
-
|
113
|
-
case 24:
|
114
|
-
if (!params.selectedElementTag) {
|
115
122
|
_context.next = 27;
|
116
|
-
|
117
|
-
|
123
|
+
return dispatch.selection.update({
|
124
|
+
initSelectionId: params.selectedElementTag
|
125
|
+
});
|
118
126
|
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
127
|
+
case 27:
|
128
|
+
_context.next = 29;
|
129
|
+
return dispatch.topoMod.initData((0, _extends2["default"])({}, params, {
|
130
|
+
type: params.type,
|
131
|
+
id: id
|
132
|
+
}));
|
123
133
|
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
id: id
|
129
|
-
}));
|
134
|
+
case 29:
|
135
|
+
_this.update({
|
136
|
+
loading: false
|
137
|
+
}); // 是否打开概览
|
130
138
|
|
131
|
-
case 29:
|
132
|
-
_this.update({
|
133
|
-
loading: false
|
134
|
-
}); // 是否打开概览
|
135
139
|
|
140
|
+
if (!params.openResourceOverview) {
|
141
|
+
_context.next = 33;
|
142
|
+
break;
|
143
|
+
}
|
136
144
|
|
137
|
-
if (!params.openResourceOverview) {
|
138
145
|
_context.next = 33;
|
146
|
+
return dispatch.resourceDetail.update({
|
147
|
+
visible: true,
|
148
|
+
id: params.openResourceOverview
|
149
|
+
});
|
150
|
+
|
151
|
+
case 33:
|
152
|
+
case "end":
|
153
|
+
return _context.stop();
|
154
|
+
}
|
155
|
+
}, _callee);
|
156
|
+
}))();
|
157
|
+
},
|
158
|
+
|
159
|
+
/**
|
160
|
+
* 退出。
|
161
|
+
*/
|
162
|
+
exit: function exit(playload, rootState) {
|
163
|
+
return (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee2() {
|
164
|
+
return _regenerator["default"].wrap(function _callee2$(_context2) {
|
165
|
+
while (1) switch (_context2.prev = _context2.next) {
|
166
|
+
case 0:
|
167
|
+
_context2.next = 2;
|
168
|
+
return dispatch.topoMod.exit(playload);
|
169
|
+
|
170
|
+
case 2:
|
171
|
+
case "end":
|
172
|
+
return _context2.stop();
|
173
|
+
}
|
174
|
+
}, _callee2);
|
175
|
+
}))();
|
176
|
+
},
|
177
|
+
openCreateTopoPage: function openCreateTopoPage(playload, state) {
|
178
|
+
var _this2 = this;
|
179
|
+
|
180
|
+
return (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee3() {
|
181
|
+
return _regenerator["default"].wrap(function _callee3$(_context3) {
|
182
|
+
while (1) switch (_context3.prev = _context3.next) {
|
183
|
+
case 0:
|
184
|
+
if (playload === void 0) {
|
185
|
+
playload = {};
|
186
|
+
}
|
187
|
+
|
188
|
+
_this2.update({
|
189
|
+
viewState: 'create',
|
190
|
+
id: playload.id
|
191
|
+
});
|
192
|
+
|
193
|
+
dispatch.topoCreate.init(playload); // history.replace(`/default/topoCenter?type=create&id=${playload.id}`);
|
194
|
+
|
195
|
+
case 3:
|
196
|
+
case "end":
|
197
|
+
return _context3.stop();
|
198
|
+
}
|
199
|
+
}, _callee3);
|
200
|
+
}))();
|
201
|
+
},
|
202
|
+
|
203
|
+
/**
|
204
|
+
*
|
205
|
+
* @param playload {{id: string, linkTo:?object}}
|
206
|
+
*/
|
207
|
+
openTopoPage: function openTopoPage(playload, rootState) {
|
208
|
+
var _this3 = this;
|
209
|
+
|
210
|
+
return (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee4() {
|
211
|
+
var id, viewState;
|
212
|
+
return _regenerator["default"].wrap(function _callee4$(_context4) {
|
213
|
+
while (1) switch (_context4.prev = _context4.next) {
|
214
|
+
case 0:
|
215
|
+
id = playload.id, viewState = playload.viewState; // 左侧树切换选中
|
216
|
+
|
217
|
+
dispatch.topoTreeMod.selectNode(id);
|
218
|
+
|
219
|
+
_this3.update({
|
220
|
+
viewState: viewState || 'view'
|
221
|
+
});
|
222
|
+
|
223
|
+
if (!id) {
|
224
|
+
_context4.next = 8;
|
225
|
+
break;
|
226
|
+
}
|
227
|
+
|
228
|
+
_context4.next = 6;
|
229
|
+
return dispatch.topoMod.openTopoPage(playload);
|
230
|
+
|
231
|
+
case 6:
|
232
|
+
_context4.next = 10;
|
139
233
|
break;
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
var _this3 = this;
|
206
|
-
|
207
|
-
return (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee4() {
|
208
|
-
var id, viewState;
|
209
|
-
return _regenerator["default"].wrap(function _callee4$(_context4) {
|
210
|
-
while (1) switch (_context4.prev = _context4.next) {
|
211
|
-
case 0:
|
212
|
-
id = playload.id, viewState = playload.viewState; // 左侧树切换选中
|
213
|
-
|
214
|
-
dispatch.topoTreeMod.selectNode(id);
|
215
|
-
|
216
|
-
_this3.update({
|
217
|
-
viewState: viewState || 'view'
|
218
|
-
});
|
219
|
-
|
220
|
-
if (!id) {
|
221
|
-
_context4.next = 8;
|
222
|
-
break;
|
223
|
-
}
|
224
|
-
|
225
|
-
_context4.next = 6;
|
226
|
-
return dispatch.topoMod.openTopoPage(playload);
|
227
|
-
|
228
|
-
case 6:
|
229
|
-
_context4.next = 10;
|
230
|
-
break;
|
231
|
-
|
232
|
-
case 8:
|
233
|
-
_context4.next = 10;
|
234
|
-
return dispatch.topoMod.clearData();
|
235
|
-
|
236
|
-
case 10:
|
237
|
-
case "end":
|
238
|
-
return _context4.stop();
|
239
|
-
}
|
240
|
-
}, _callee4);
|
241
|
-
}))();
|
242
|
-
},
|
243
|
-
refreshTopoTree: function refreshTopoTree() {
|
244
|
-
return (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee5() {
|
245
|
-
return _regenerator["default"].wrap(function _callee5$(_context5) {
|
246
|
-
while (1) switch (_context5.prev = _context5.next) {
|
247
|
-
case 0:
|
248
|
-
_context5.next = 2;
|
249
|
-
return dispatch.topoTreeMod.refreshTree();
|
250
|
-
|
251
|
-
case 2:
|
252
|
-
case "end":
|
253
|
-
return _context5.stop();
|
254
|
-
}
|
255
|
-
}, _callee5);
|
256
|
-
}))();
|
257
|
-
}
|
258
|
-
};
|
259
|
-
}
|
260
|
-
};
|
261
|
-
exports["default"] = _default;
|
234
|
+
|
235
|
+
case 8:
|
236
|
+
_context4.next = 10;
|
237
|
+
return dispatch.topoMod.clearData();
|
238
|
+
|
239
|
+
case 10:
|
240
|
+
case "end":
|
241
|
+
return _context4.stop();
|
242
|
+
}
|
243
|
+
}, _callee4);
|
244
|
+
}))();
|
245
|
+
},
|
246
|
+
refreshTopoTree: function refreshTopoTree() {
|
247
|
+
return (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee5() {
|
248
|
+
return _regenerator["default"].wrap(function _callee5$(_context5) {
|
249
|
+
while (1) switch (_context5.prev = _context5.next) {
|
250
|
+
case 0:
|
251
|
+
_context5.next = 2;
|
252
|
+
return dispatch.topoTreeMod.refreshTree();
|
253
|
+
|
254
|
+
case 2:
|
255
|
+
case "end":
|
256
|
+
return _context5.stop();
|
257
|
+
}
|
258
|
+
}, _callee5);
|
259
|
+
}))();
|
260
|
+
},
|
261
|
+
refreshGlobalConfig: function refreshGlobalConfig() {
|
262
|
+
return (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee6() {
|
263
|
+
var result, extraConfig;
|
264
|
+
return _regenerator["default"].wrap(function _callee6$(_context6) {
|
265
|
+
while (1) switch (_context6.prev = _context6.next) {
|
266
|
+
case 0:
|
267
|
+
if (topo.id) {
|
268
|
+
_context6.next = 2;
|
269
|
+
break;
|
270
|
+
}
|
271
|
+
|
272
|
+
return _context6.abrupt("return");
|
273
|
+
|
274
|
+
case 2:
|
275
|
+
_context6.next = 4;
|
276
|
+
return topo.options.loadData(topo.id, topo.serverApi);
|
277
|
+
|
278
|
+
case 4:
|
279
|
+
result = _context6.sent;
|
280
|
+
result = (0, _topoData.parseTopoData)(result);
|
281
|
+
extraConfig = result.global.extraConfig;
|
282
|
+
_context6.next = 9;
|
283
|
+
return dispatch.displayConfig.setConfig((0, _extends2["default"])({}, extraConfig, {
|
284
|
+
alarmSwitch: result.global.alarmSwitch,
|
285
|
+
alarmListDefaultOpen: result.global.alarmListDefaultOpen
|
286
|
+
}));
|
287
|
+
|
288
|
+
case 9:
|
289
|
+
case "end":
|
290
|
+
return _context6.stop();
|
291
|
+
}
|
292
|
+
}, _callee6);
|
293
|
+
}))();
|
294
|
+
}
|
295
|
+
};
|
296
|
+
}
|
297
|
+
};
|
298
|
+
}
|
@@ -13,7 +13,7 @@ var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/
|
|
13
13
|
|
14
14
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
15
15
|
|
16
|
-
var
|
16
|
+
var _componentTopologyUtils = require("@riil-frontend/component-topology-utils");
|
17
17
|
|
18
18
|
var _tree = require("../../utils/tree");
|
19
19
|
|
@@ -165,7 +165,7 @@ function _default(topoApp) {
|
|
165
165
|
conditions = {};
|
166
166
|
}
|
167
167
|
|
168
|
-
|
168
|
+
_componentTopologyUtils.rlog.debug('editTopoOnTree', conditions);
|
169
169
|
|
170
170
|
_context4.next = 4;
|
171
171
|
return topoApp.serverApi.editTopo({
|
@@ -236,7 +236,7 @@ function _default(topoApp) {
|
|
236
236
|
return _regenerator["default"].wrap(function _callee5$(_context5) {
|
237
237
|
while (1) switch (_context5.prev = _context5.next) {
|
238
238
|
case 0:
|
239
|
-
|
239
|
+
_componentTopologyUtils.rlog.debug('deleteTopoOnTree', conditions, state, dispatch.topoMod);
|
240
240
|
|
241
241
|
currentTopoId = state.topoMod.topoId;
|
242
242
|
|
@@ -245,7 +245,7 @@ function _default(topoApp) {
|
|
245
245
|
break;
|
246
246
|
}
|
247
247
|
|
248
|
-
|
248
|
+
_componentTopologyUtils.rlog.debug('deleteTopo-currentTopo', conditions);
|
249
249
|
|
250
250
|
_context5.next = 6;
|
251
251
|
return dispatch.topoMod.updateDelId("" + conditions);
|
@@ -304,7 +304,7 @@ function _default(topoApp) {
|
|
304
304
|
conditions = {};
|
305
305
|
}
|
306
306
|
|
307
|
-
|
307
|
+
_componentTopologyUtils.rlog.debug('setDefTopoOnTree', conditions);
|
308
308
|
|
309
309
|
_context6.next = 4;
|
310
310
|
return topoApp.serverApi.setDefTopo(parseInt(conditions, 10));
|
@@ -11,8 +11,6 @@ var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/
|
|
11
11
|
|
12
12
|
var _componentTopologyUtils = require("@riil-frontend/component-topology-utils");
|
13
13
|
|
14
|
-
var _rlog = _interopRequireDefault(require("@riil-frontend/component-topology-utils/es/rlog"));
|
15
|
-
|
16
14
|
var _clusterUtil = require("../../utils/clusterUtil");
|
17
15
|
|
18
16
|
function _default(_x) {
|
@@ -57,7 +55,7 @@ function _ref() {
|
|
57
55
|
})
|
58
56
|
};
|
59
57
|
|
60
|
-
|
58
|
+
_componentTopologyUtils.rlog.error('导出数据', params);
|
61
59
|
|
62
60
|
_context.next = 6;
|
63
61
|
return _componentTopologyUtils.request.post('/topo/v1/api/structure/excel', params, {
|
package/lib/style.js
CHANGED
@@ -1,9 +1,9 @@
|
|
1
1
|
require('@riil-frontend/component-topology-graph/lib/style');
|
2
2
|
require('@alifd/next/lib/box/style');
|
3
|
-
require('@alifd/next/lib/message/style');
|
4
3
|
require('@riil-frontend/component-topology-utils/lib/style');
|
5
|
-
require('@
|
4
|
+
require('@alifd/next/lib/message/style');
|
6
5
|
require('@riil-frontend/utils/lib/style');
|
6
|
+
require('@riil-frontend/component-riil-event-emitter/lib/style');
|
7
7
|
require('@alifd/next/lib/menu-button/style');
|
8
8
|
require('@alifd/next/lib/search/style');
|
9
9
|
require('@alifd/next/lib/drawer/style');
|
@@ -5,7 +5,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
5
5
|
exports.__esModule = true;
|
6
6
|
exports["default"] = void 0;
|
7
7
|
|
8
|
-
var
|
8
|
+
var _componentTopologyUtils = require("@riil-frontend/component-topology-utils");
|
9
9
|
|
10
10
|
var _sortBy = _interopRequireDefault(require("lodash/sortBy"));
|
11
11
|
|
@@ -53,12 +53,6 @@ function getResourceConfigFromHt(topo) {
|
|
53
53
|
layers: (0, _sortBy["default"])(layers, 'order'),
|
54
54
|
groups: groups,
|
55
55
|
resources: resources,
|
56
|
-
exportLinkIdList: getExportLinkIdList({
|
57
|
-
topo: topo,
|
58
|
-
htTopo: htTopo,
|
59
|
-
dataModel: dataModel
|
60
|
-
}),
|
61
|
-
// 出口链路id列表
|
62
56
|
relateTopoIdList: getRelateTopoIdList(dataModel)
|
63
57
|
};
|
64
58
|
} // 查询关联拓扑id列表
|
@@ -75,35 +69,6 @@ function getRelateTopoIdList(dataModel) {
|
|
75
69
|
|
76
70
|
return topoIds;
|
77
71
|
}, []);
|
78
|
-
} // 查询出口链路列表
|
79
|
-
|
80
|
-
|
81
|
-
function getExportLinkIdList(_ref) {
|
82
|
-
var topo = _ref.topo,
|
83
|
-
htTopo = _ref.htTopo,
|
84
|
-
dataModel = _ref.dataModel;
|
85
|
-
var exportLinkIdList = [];
|
86
|
-
var edges = (0, _htElementUtils.getEdges)(dataModel);
|
87
|
-
|
88
|
-
_rlog["default"].debug(' 查询出口链路列表-edges', edges, dataModel);
|
89
|
-
|
90
|
-
edges.forEach(function (edge) {
|
91
|
-
var edgeData = htTopo.getEdgeData(edge); // 有组无子连线返回null
|
92
|
-
|
93
|
-
if (edgeData) {
|
94
|
-
// eslint-disable-next-line no-underscore-dangle
|
95
|
-
var id = edgeData._attrObject.id;
|
96
|
-
|
97
|
-
if (id) {
|
98
|
-
var linkData = topo.dataModel.getDataById(id);
|
99
|
-
|
100
|
-
if ((0, _linkUtils.isExitLink)(linkData) && !exportLinkIdList.includes(id)) {
|
101
|
-
exportLinkIdList.push(id);
|
102
|
-
}
|
103
|
-
}
|
104
|
-
}
|
105
|
-
});
|
106
|
-
return exportLinkIdList;
|
107
72
|
}
|
108
73
|
|
109
74
|
function getLayerDatas(dataModel) {
|
@@ -127,9 +92,9 @@ function getLayerDatas(dataModel) {
|
|
127
92
|
return layers;
|
128
93
|
}
|
129
94
|
|
130
|
-
function getGroupDatas(
|
131
|
-
var groupElements =
|
132
|
-
layers =
|
95
|
+
function getGroupDatas(_ref) {
|
96
|
+
var groupElements = _ref.groupElements,
|
97
|
+
layers = _ref.layers;
|
133
98
|
// 获得视图上的区域配置
|
134
99
|
var groups = groupElements.filter(function (node) {
|
135
100
|
return !node.getParent();
|