@riil-frontend/component-topology 12.0.0-dev.9 → 12.1.0-dev.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 +1 -1
- package/build/index.css +1 -1
- package/build/index.js +14 -14
- package/es/components/TemplateButton/index.module.scss +1 -1
- package/es/core/components/AlarmListPanel/components/AlarmListItem.js +58 -3
- package/es/core/components/TopoView/topoView.js +5 -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/hooks/useKeyboardShortcut.js +3 -1
- package/es/core/editor/utils/copyElementUtil.js +12 -0
- package/es/core/editor/utils/edgeTypeStyleUtil.js +8 -30
- package/es/core/hooks/useAlarm.js +131 -81
- 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/useResourceConfig.js +1 -3
- package/es/core/hooks/useTopoEdit.js +31 -43
- package/es/core/models/Alarm.js +69 -142
- package/es/core/models/AttributeMetricDisplay.js +9 -3
- package/es/core/models/TopoApp.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/topoData.js +0 -1
- package/es/core/models/utils/linkUtils.js +20 -13
- package/es/core/services/topo/basic.js +2 -2
- package/es/core/store/models/topoConfig.js +7 -10
- package/es/core/store/models/topoMod.js +81 -134
- package/es/core/utils/edgeUtil.js +8 -0
- package/es/core/utils/metricUtil.js +8 -4
- package/es/core/utils/showGraphManageStatusUtil.js +3 -2
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/LinkTopoCard.js +2 -2
- 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/TopoView.js +6 -11
- package/es/networkTopo/hooks/useEdgeExpand.js +2 -3
- package/es/networkTopo/services/topo/basic.js +3 -3
- package/es/networkTopo/store/topoCenter.js +260 -223
- package/es/style.js +1 -1
- package/es/utils/ResourceConfigUtil.js +3 -36
- package/es/utils/ciRefAttributeTranslateUtil.d.ts +9 -2
- package/es/utils/ciRefAttributeTranslateUtil.js +8 -9
- package/es/utils/topoData.js +1 -1
- package/lib/components/TemplateButton/index.module.scss +1 -1
- package/lib/core/components/AlarmListPanel/components/AlarmListItem.js +60 -3
- package/lib/core/components/TopoView/topoView.js +5 -1
- 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/hooks/useKeyboardShortcut.js +2 -0
- package/lib/core/editor/utils/copyElementUtil.js +15 -0
- package/lib/core/editor/utils/edgeTypeStyleUtil.js +8 -31
- package/lib/core/hooks/useAlarm.js +130 -79
- 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/useResourceConfig.js +1 -3
- package/lib/core/hooks/useTopoEdit.js +30 -42
- package/lib/core/models/Alarm.js +69 -144
- package/lib/core/models/AttributeMetricDisplay.js +10 -2
- package/lib/core/models/TopoApp.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/topoData.js +0 -1
- package/lib/core/models/utils/linkUtils.js +21 -13
- package/lib/core/services/topo/basic.js +2 -2
- package/lib/core/store/models/topoConfig.js +7 -10
- package/lib/core/store/models/topoMod.js +81 -134
- package/lib/core/utils/edgeUtil.js +10 -0
- package/lib/core/utils/metricUtil.js +8 -4
- package/lib/core/utils/showGraphManageStatusUtil.js +3 -2
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/LinkTopoCard.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/TopoView.js +5 -14
- package/lib/networkTopo/hooks/useEdgeExpand.js +2 -3
- package/lib/networkTopo/services/topo/basic.js +3 -3
- package/lib/networkTopo/store/topoCenter.js +262 -225
- package/lib/style.js +1 -1
- package/lib/utils/ResourceConfigUtil.js +3 -38
- package/lib/utils/ciRefAttributeTranslateUtil.d.ts +9 -2
- package/lib/utils/ciRefAttributeTranslateUtil.js +8 -9
- package/lib/utils/topoData.js +1 -1
- package/package.json +2 -2
@@ -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
|
|
@@ -13,249 +13,286 @@ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends")
|
|
13
13
|
|
14
14
|
var _componentTopologyUtils = require("@riil-frontend/component-topology-utils");
|
15
15
|
|
16
|
+
var _topoData = require("../../utils/topoData");
|
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
|
+
}
|
package/lib/style.js
CHANGED
@@ -2,8 +2,8 @@ require('@riil-frontend/component-topology-graph/lib/style');
|
|
2
2
|
require('@alifd/next/lib/box/style');
|
3
3
|
require('@riil-frontend/component-topology-utils/lib/style');
|
4
4
|
require('@alifd/next/lib/message/style');
|
5
|
-
require('@riil-frontend/component-riil-event-emitter/lib/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');
|
@@ -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
|
-
_componentTopologyUtils.rlog.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();
|
@@ -1,12 +1,19 @@
|
|
1
|
+
interface Options {
|
2
|
+
/**
|
3
|
+
* 是否属性缓存重新请求数据
|
4
|
+
*/
|
5
|
+
refreshCiCache: boolean;
|
6
|
+
}
|
1
7
|
/**
|
2
8
|
* 翻译ci列表引用属性名称
|
3
9
|
* @param ciDatas
|
4
10
|
* @returns
|
5
11
|
*/
|
6
|
-
export declare function translateCisRefAttributeName(ciDatas: Array<any
|
12
|
+
export declare function translateCisRefAttributeName(ciDatas: Array<any>, options?: Options): Promise<Array<any>>;
|
7
13
|
/**
|
8
14
|
* 翻译ci引用属性名称
|
9
15
|
* @param ciData
|
10
16
|
* @returns
|
11
17
|
*/
|
12
|
-
export declare function translateCiRefAttributeName(ciData: any): Promise<any>;
|
18
|
+
export declare function translateCiRefAttributeName(ciData: any, options?: Options): Promise<any>;
|
19
|
+
export {};
|