@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
@@ -7,244 +7,281 @@ import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
7
7
|
*
|
8
8
|
*
|
9
9
|
*/
|
10
|
-
import rlog from '@riil-frontend/component-topology-utils
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
return _regeneratorRuntime.
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
10
|
+
import { rlog } from '@riil-frontend/component-topology-utils';
|
11
|
+
import { parseTopoData } from "../../utils/topoData";
|
12
|
+
export default function (topo) {
|
13
|
+
return {
|
14
|
+
// 定义 model 的初始 state
|
15
|
+
state: {
|
16
|
+
loading: true,
|
17
|
+
id: undefined,
|
18
|
+
viewState: 'view' // view, create, 2种模式
|
19
|
+
|
20
|
+
},
|
21
|
+
// 定义改变该模型状态的纯函数
|
22
|
+
reducers: {
|
23
|
+
update: function update(prevState, payload) {
|
24
|
+
return _extends({}, prevState, payload);
|
25
|
+
}
|
26
|
+
},
|
27
|
+
// 定义处理该模型副作用的函数
|
28
|
+
effects: function effects(dispatch) {
|
29
|
+
return {
|
30
|
+
/**
|
31
|
+
* 初始化。
|
32
|
+
*/
|
33
|
+
initData: function initData(params, rootState) {
|
34
|
+
var _this = this;
|
35
|
+
|
36
|
+
return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
37
|
+
var topoModState, viewType, id, topoTreeModState;
|
38
|
+
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
39
|
+
while (1) switch (_context.prev = _context.next) {
|
40
|
+
case 0:
|
41
|
+
if (params === void 0) {
|
42
|
+
params = {};
|
43
|
+
}
|
44
|
+
|
45
|
+
topoModState = rootState.topoMod;
|
46
|
+
viewType = params.type || 'view';
|
47
|
+
id = params.id || topoModState.topoId || '';
|
48
|
+
|
49
|
+
_this.update({
|
50
|
+
loading: true,
|
51
|
+
viewState: viewType
|
52
|
+
}); // 加载功能操作权限
|
53
|
+
|
54
|
+
|
55
|
+
_context.next = 7;
|
56
|
+
return dispatch.functionAuth.init();
|
57
|
+
|
58
|
+
case 7:
|
59
|
+
// 加载拓扑树数据
|
60
|
+
topoTreeModState = rootState.topoTreeMod;
|
61
|
+
|
62
|
+
if (topoTreeModState.loaded) {
|
63
|
+
_context.next = 16;
|
64
|
+
break;
|
65
|
+
}
|
66
|
+
|
67
|
+
_context.next = 11;
|
68
|
+
return dispatch.topoTreeMod.fetchTopoTree({
|
69
|
+
id: id
|
70
|
+
});
|
71
|
+
|
72
|
+
case 11:
|
73
|
+
_context.next = 13;
|
74
|
+
return dispatch.topoTreeMod.getSelectedTopoId();
|
75
|
+
|
76
|
+
case 13:
|
77
|
+
id = _context.sent;
|
78
|
+
_context.next = 18;
|
62
79
|
break;
|
63
|
-
}
|
64
80
|
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
});
|
81
|
+
case 16:
|
82
|
+
_context.next = 18;
|
83
|
+
return _this.refreshTopoTree();
|
69
84
|
|
70
|
-
|
71
|
-
|
72
|
-
|
85
|
+
case 18:
|
86
|
+
if (id) {
|
87
|
+
// 左侧树切换选中
|
88
|
+
dispatch.topoTreeMod.selectNode(id);
|
89
|
+
}
|
73
90
|
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
91
|
+
if (!(viewType === 'create')) {
|
92
|
+
_context.next = 24;
|
93
|
+
break;
|
94
|
+
}
|
78
95
|
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
case 18:
|
84
|
-
if (id) {
|
85
|
-
// 左侧树切换选中
|
86
|
-
dispatch.topoTreeMod.selectNode(id);
|
87
|
-
}
|
96
|
+
_context.next = 22;
|
97
|
+
return _this.openCreateTopoPage({
|
98
|
+
id: id
|
99
|
+
});
|
88
100
|
|
89
|
-
|
90
|
-
_context.next =
|
101
|
+
case 22:
|
102
|
+
_context.next = 29;
|
91
103
|
break;
|
92
|
-
}
|
93
104
|
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
105
|
+
case 24:
|
106
|
+
if (!params.selectedElementTag) {
|
107
|
+
_context.next = 27;
|
108
|
+
break;
|
109
|
+
}
|
98
110
|
|
99
|
-
case 22:
|
100
|
-
_context.next = 29;
|
101
|
-
break;
|
102
|
-
|
103
|
-
case 24:
|
104
|
-
if (!params.selectedElementTag) {
|
105
111
|
_context.next = 27;
|
106
|
-
|
107
|
-
|
112
|
+
return dispatch.selection.update({
|
113
|
+
initSelectionId: params.selectedElementTag
|
114
|
+
});
|
108
115
|
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
116
|
+
case 27:
|
117
|
+
_context.next = 29;
|
118
|
+
return dispatch.topoMod.initData(_extends({}, params, {
|
119
|
+
type: params.type,
|
120
|
+
id: id
|
121
|
+
}));
|
113
122
|
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
id: id
|
119
|
-
}));
|
123
|
+
case 29:
|
124
|
+
_this.update({
|
125
|
+
loading: false
|
126
|
+
}); // 是否打开概览
|
120
127
|
|
121
|
-
case 29:
|
122
|
-
_this.update({
|
123
|
-
loading: false
|
124
|
-
}); // 是否打开概览
|
125
128
|
|
129
|
+
if (!params.openResourceOverview) {
|
130
|
+
_context.next = 33;
|
131
|
+
break;
|
132
|
+
}
|
126
133
|
|
127
|
-
if (!params.openResourceOverview) {
|
128
134
|
_context.next = 33;
|
135
|
+
return dispatch.resourceDetail.update({
|
136
|
+
visible: true,
|
137
|
+
id: params.openResourceOverview
|
138
|
+
});
|
139
|
+
|
140
|
+
case 33:
|
141
|
+
case "end":
|
142
|
+
return _context.stop();
|
143
|
+
}
|
144
|
+
}, _callee);
|
145
|
+
}))();
|
146
|
+
},
|
147
|
+
|
148
|
+
/**
|
149
|
+
* 退出。
|
150
|
+
*/
|
151
|
+
exit: function exit(playload, rootState) {
|
152
|
+
return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
|
153
|
+
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
154
|
+
while (1) switch (_context2.prev = _context2.next) {
|
155
|
+
case 0:
|
156
|
+
_context2.next = 2;
|
157
|
+
return dispatch.topoMod.exit(playload);
|
158
|
+
|
159
|
+
case 2:
|
160
|
+
case "end":
|
161
|
+
return _context2.stop();
|
162
|
+
}
|
163
|
+
}, _callee2);
|
164
|
+
}))();
|
165
|
+
},
|
166
|
+
openCreateTopoPage: function openCreateTopoPage(playload, state) {
|
167
|
+
var _this2 = this;
|
168
|
+
|
169
|
+
return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3() {
|
170
|
+
return _regeneratorRuntime.wrap(function _callee3$(_context3) {
|
171
|
+
while (1) switch (_context3.prev = _context3.next) {
|
172
|
+
case 0:
|
173
|
+
if (playload === void 0) {
|
174
|
+
playload = {};
|
175
|
+
}
|
176
|
+
|
177
|
+
_this2.update({
|
178
|
+
viewState: 'create',
|
179
|
+
id: playload.id
|
180
|
+
});
|
181
|
+
|
182
|
+
dispatch.topoCreate.init(playload); // history.replace(`/default/topoCenter?type=create&id=${playload.id}`);
|
183
|
+
|
184
|
+
case 3:
|
185
|
+
case "end":
|
186
|
+
return _context3.stop();
|
187
|
+
}
|
188
|
+
}, _callee3);
|
189
|
+
}))();
|
190
|
+
},
|
191
|
+
|
192
|
+
/**
|
193
|
+
*
|
194
|
+
* @param playload {{id: string, linkTo:?object}}
|
195
|
+
*/
|
196
|
+
openTopoPage: function openTopoPage(playload, rootState) {
|
197
|
+
var _this3 = this;
|
198
|
+
|
199
|
+
return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee4() {
|
200
|
+
var id, viewState;
|
201
|
+
return _regeneratorRuntime.wrap(function _callee4$(_context4) {
|
202
|
+
while (1) switch (_context4.prev = _context4.next) {
|
203
|
+
case 0:
|
204
|
+
id = playload.id, viewState = playload.viewState; // 左侧树切换选中
|
205
|
+
|
206
|
+
dispatch.topoTreeMod.selectNode(id);
|
207
|
+
|
208
|
+
_this3.update({
|
209
|
+
viewState: viewState || 'view'
|
210
|
+
});
|
211
|
+
|
212
|
+
if (!id) {
|
213
|
+
_context4.next = 8;
|
214
|
+
break;
|
215
|
+
}
|
216
|
+
|
217
|
+
_context4.next = 6;
|
218
|
+
return dispatch.topoMod.openTopoPage(playload);
|
219
|
+
|
220
|
+
case 6:
|
221
|
+
_context4.next = 10;
|
129
222
|
break;
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
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
|
-
var _this3 = this;
|
196
|
-
|
197
|
-
return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee4() {
|
198
|
-
var id, viewState;
|
199
|
-
return _regeneratorRuntime.wrap(function _callee4$(_context4) {
|
200
|
-
while (1) switch (_context4.prev = _context4.next) {
|
201
|
-
case 0:
|
202
|
-
id = playload.id, viewState = playload.viewState; // 左侧树切换选中
|
203
|
-
|
204
|
-
dispatch.topoTreeMod.selectNode(id);
|
205
|
-
|
206
|
-
_this3.update({
|
207
|
-
viewState: viewState || 'view'
|
208
|
-
});
|
209
|
-
|
210
|
-
if (!id) {
|
211
|
-
_context4.next = 8;
|
212
|
-
break;
|
213
|
-
}
|
214
|
-
|
215
|
-
_context4.next = 6;
|
216
|
-
return dispatch.topoMod.openTopoPage(playload);
|
217
|
-
|
218
|
-
case 6:
|
219
|
-
_context4.next = 10;
|
220
|
-
break;
|
221
|
-
|
222
|
-
case 8:
|
223
|
-
_context4.next = 10;
|
224
|
-
return dispatch.topoMod.clearData();
|
225
|
-
|
226
|
-
case 10:
|
227
|
-
case "end":
|
228
|
-
return _context4.stop();
|
229
|
-
}
|
230
|
-
}, _callee4);
|
231
|
-
}))();
|
232
|
-
},
|
233
|
-
refreshTopoTree: function refreshTopoTree() {
|
234
|
-
return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee5() {
|
235
|
-
return _regeneratorRuntime.wrap(function _callee5$(_context5) {
|
236
|
-
while (1) switch (_context5.prev = _context5.next) {
|
237
|
-
case 0:
|
238
|
-
_context5.next = 2;
|
239
|
-
return dispatch.topoTreeMod.refreshTree();
|
240
|
-
|
241
|
-
case 2:
|
242
|
-
case "end":
|
243
|
-
return _context5.stop();
|
244
|
-
}
|
245
|
-
}, _callee5);
|
246
|
-
}))();
|
247
|
-
}
|
248
|
-
};
|
249
|
-
}
|
250
|
-
};
|
223
|
+
|
224
|
+
case 8:
|
225
|
+
_context4.next = 10;
|
226
|
+
return dispatch.topoMod.clearData();
|
227
|
+
|
228
|
+
case 10:
|
229
|
+
case "end":
|
230
|
+
return _context4.stop();
|
231
|
+
}
|
232
|
+
}, _callee4);
|
233
|
+
}))();
|
234
|
+
},
|
235
|
+
refreshTopoTree: function refreshTopoTree() {
|
236
|
+
return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee5() {
|
237
|
+
return _regeneratorRuntime.wrap(function _callee5$(_context5) {
|
238
|
+
while (1) switch (_context5.prev = _context5.next) {
|
239
|
+
case 0:
|
240
|
+
_context5.next = 2;
|
241
|
+
return dispatch.topoTreeMod.refreshTree();
|
242
|
+
|
243
|
+
case 2:
|
244
|
+
case "end":
|
245
|
+
return _context5.stop();
|
246
|
+
}
|
247
|
+
}, _callee5);
|
248
|
+
}))();
|
249
|
+
},
|
250
|
+
refreshGlobalConfig: function refreshGlobalConfig() {
|
251
|
+
return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee6() {
|
252
|
+
var result, extraConfig;
|
253
|
+
return _regeneratorRuntime.wrap(function _callee6$(_context6) {
|
254
|
+
while (1) switch (_context6.prev = _context6.next) {
|
255
|
+
case 0:
|
256
|
+
if (topo.id) {
|
257
|
+
_context6.next = 2;
|
258
|
+
break;
|
259
|
+
}
|
260
|
+
|
261
|
+
return _context6.abrupt("return");
|
262
|
+
|
263
|
+
case 2:
|
264
|
+
_context6.next = 4;
|
265
|
+
return topo.options.loadData(topo.id, topo.serverApi);
|
266
|
+
|
267
|
+
case 4:
|
268
|
+
result = _context6.sent;
|
269
|
+
result = parseTopoData(result);
|
270
|
+
extraConfig = result.global.extraConfig;
|
271
|
+
_context6.next = 9;
|
272
|
+
return dispatch.displayConfig.setConfig(_extends({}, extraConfig, {
|
273
|
+
alarmSwitch: result.global.alarmSwitch,
|
274
|
+
alarmListDefaultOpen: result.global.alarmListDefaultOpen
|
275
|
+
}));
|
276
|
+
|
277
|
+
case 9:
|
278
|
+
case "end":
|
279
|
+
return _context6.stop();
|
280
|
+
}
|
281
|
+
}, _callee6);
|
282
|
+
}))();
|
283
|
+
}
|
284
|
+
};
|
285
|
+
}
|
286
|
+
};
|
287
|
+
}
|
@@ -2,7 +2,7 @@ import _Message from "@alifd/next/es/message";
|
|
2
2
|
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
3
3
|
import _extends from "@babel/runtime/helpers/extends";
|
4
4
|
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
5
|
-
import rlog from '@riil-frontend/component-topology-utils
|
5
|
+
import { rlog } from '@riil-frontend/component-topology-utils';
|
6
6
|
import { formatTree, loopTree, loopTreeFun, findParentIdsById, treeNodeCount } from "../../utils/tree";
|
7
7
|
|
8
8
|
var clone = function clone(data) {
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
2
2
|
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
3
3
|
import { request } from '@riil-frontend/component-topology-utils';
|
4
|
-
import rlog from '@riil-frontend/component-topology-utils
|
4
|
+
import { rlog } from '@riil-frontend/component-topology-utils';
|
5
5
|
import { findClusters, isCluster } from "../../utils/clusterUtil";
|
6
6
|
export default function (_x) {
|
7
7
|
return _ref.apply(this, arguments);
|
package/es/style.js
CHANGED
@@ -1,9 +1,9 @@
|
|
1
1
|
import '@riil-frontend/component-topology-graph/es/style';
|
2
2
|
import '@alifd/next/es/box/style';
|
3
|
-
import '@alifd/next/es/message/style';
|
4
3
|
import '@riil-frontend/component-topology-utils/es/style';
|
5
|
-
import '@
|
4
|
+
import '@alifd/next/es/message/style';
|
6
5
|
import '@riil-frontend/utils/es/style';
|
6
|
+
import '@riil-frontend/component-riil-event-emitter/es/style';
|
7
7
|
import '@alifd/next/es/menu-button/style';
|
8
8
|
import '@alifd/next/es/search/style';
|
9
9
|
import '@alifd/next/es/drawer/style';
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import rlog from '@riil-frontend/component-topology-utils
|
1
|
+
import { rlog } from '@riil-frontend/component-topology-utils';
|
2
2
|
import sortBy from 'lodash/sortBy';
|
3
3
|
import { isExitLink } from "../core/models/utils/linkUtils";
|
4
4
|
import { isClusterHtElement } from "./clusterUtil";
|
@@ -42,12 +42,6 @@ function getResourceConfigFromHt(topo) {
|
|
42
42
|
layers: sortBy(layers, 'order'),
|
43
43
|
groups: groups,
|
44
44
|
resources: resources,
|
45
|
-
exportLinkIdList: getExportLinkIdList({
|
46
|
-
topo: topo,
|
47
|
-
htTopo: htTopo,
|
48
|
-
dataModel: dataModel
|
49
|
-
}),
|
50
|
-
// 出口链路id列表
|
51
45
|
relateTopoIdList: getRelateTopoIdList(dataModel)
|
52
46
|
};
|
53
47
|
} // 查询关联拓扑id列表
|
@@ -64,33 +58,6 @@ function getRelateTopoIdList(dataModel) {
|
|
64
58
|
|
65
59
|
return topoIds;
|
66
60
|
}, []);
|
67
|
-
} // 查询出口链路列表
|
68
|
-
|
69
|
-
|
70
|
-
function getExportLinkIdList(_ref) {
|
71
|
-
var topo = _ref.topo,
|
72
|
-
htTopo = _ref.htTopo,
|
73
|
-
dataModel = _ref.dataModel;
|
74
|
-
var exportLinkIdList = [];
|
75
|
-
var edges = getEdges(dataModel);
|
76
|
-
rlog.debug(' 查询出口链路列表-edges', edges, dataModel);
|
77
|
-
edges.forEach(function (edge) {
|
78
|
-
var edgeData = htTopo.getEdgeData(edge); // 有组无子连线返回null
|
79
|
-
|
80
|
-
if (edgeData) {
|
81
|
-
// eslint-disable-next-line no-underscore-dangle
|
82
|
-
var id = edgeData._attrObject.id;
|
83
|
-
|
84
|
-
if (id) {
|
85
|
-
var linkData = topo.dataModel.getDataById(id);
|
86
|
-
|
87
|
-
if (isExitLink(linkData) && !exportLinkIdList.includes(id)) {
|
88
|
-
exportLinkIdList.push(id);
|
89
|
-
}
|
90
|
-
}
|
91
|
-
}
|
92
|
-
});
|
93
|
-
return exportLinkIdList;
|
94
61
|
}
|
95
62
|
|
96
63
|
function getLayerDatas(dataModel) {
|
@@ -114,9 +81,9 @@ function getLayerDatas(dataModel) {
|
|
114
81
|
return layers;
|
115
82
|
}
|
116
83
|
|
117
|
-
function getGroupDatas(
|
118
|
-
var groupElements =
|
119
|
-
layers =
|
84
|
+
function getGroupDatas(_ref) {
|
85
|
+
var groupElements = _ref.groupElements,
|
86
|
+
layers = _ref.layers;
|
120
87
|
// 获得视图上的区域配置
|
121
88
|
var groups = groupElements.filter(function (node) {
|
122
89
|
return !node.getParent();
|
@@ -0,0 +1,19 @@
|
|
1
|
+
interface Options {
|
2
|
+
/**
|
3
|
+
* 是否属性缓存重新请求数据
|
4
|
+
*/
|
5
|
+
refreshCiCache: boolean;
|
6
|
+
}
|
7
|
+
/**
|
8
|
+
* 翻译ci列表引用属性名称
|
9
|
+
* @param ciDatas
|
10
|
+
* @returns
|
11
|
+
*/
|
12
|
+
export declare function translateCisRefAttributeName(ciDatas: Array<any>, options?: Options): Promise<Array<any>>;
|
13
|
+
/**
|
14
|
+
* 翻译ci引用属性名称
|
15
|
+
* @param ciData
|
16
|
+
* @returns
|
17
|
+
*/
|
18
|
+
export declare function translateCiRefAttributeName(ciData: any, options?: Options): Promise<any>;
|
19
|
+
export {};
|