@riil-frontend/component-topology 8.0.0-a.1 → 8.0.0-a.11
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/index.css +1 -1
- package/build/index.js +13 -13
- package/es/core/common/icons/basicIcons.js +1 -1
- package/es/core/common/icons/icon.js +6 -2
- package/es/core/editor/components/Toolbar/widgets/EdgeTypeButton/EdgeType.js +42 -24
- package/es/core/editor/components/Toolbar/widgets/EdgeTypeButton/LineType.js +7 -2
- package/es/core/editor/components/Toolbar/widgets/EdgeTypeButton/LineType.module.scss +4 -0
- package/es/core/editor/components/Toolbar/widgets/EdgeTypeButton/index.js +1 -0
- package/es/core/editor/utils/edgeTypeStyleUtil.js +2 -3
- package/es/core/hooks/usePolling.js +3 -3
- package/es/core/models/TopoApp.js +2 -2
- package/es/core/models/tagstips/ElementTagTipConfig.js +1 -1
- package/es/core/models/topoData.js +9 -1
- package/es/core/models/utils/linkUtils.js +31 -63
- package/es/core/services/overview.js +33 -9
- package/es/core/services/topo/basic.js +34 -0
- package/es/core/services/topo/constants.js +1 -0
- package/es/core/services/topo/index.js +4 -0
- package/es/core/store/models/topoConfig.js +6 -1
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/ResourceOverview.js +124 -251
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/ResourceOverviewMetric.js +4 -2
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/hooks/useMetricPolling.js +2 -2
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/hooks/useAlarmAndRiskData.js +171 -0
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/hooks/useMetricModels.js +3 -3
- package/es/core/viewer/components/titlebar/widgets/SearchWidget.js +4 -0
- package/es/networkTopo/services/topo/basic.js +4 -2
- package/es/networkTopo/store/linkManager.js +0 -1
- package/es/networkTopo/store/topoCenter.js +0 -1
- package/es/networkTopo/store/topoLinkMod.js +0 -1
- package/lib/core/common/icons/basicIcons.js +1 -1
- package/lib/core/common/icons/icon.js +6 -2
- package/lib/core/editor/components/Toolbar/widgets/EdgeTypeButton/EdgeType.js +43 -24
- package/lib/core/editor/components/Toolbar/widgets/EdgeTypeButton/LineType.js +8 -2
- package/lib/core/editor/components/Toolbar/widgets/EdgeTypeButton/LineType.module.scss +4 -0
- package/lib/core/editor/components/Toolbar/widgets/EdgeTypeButton/index.js +1 -0
- package/lib/core/editor/utils/edgeTypeStyleUtil.js +2 -3
- package/lib/core/hooks/usePolling.js +3 -3
- package/lib/core/models/TopoApp.js +3 -3
- package/lib/core/models/tagstips/ElementTagTipConfig.js +2 -2
- package/lib/core/models/topoData.js +9 -1
- package/lib/core/models/utils/linkUtils.js +32 -67
- package/lib/core/services/overview.js +32 -8
- package/lib/core/services/topo/basic.js +46 -0
- package/lib/core/services/topo/constants.js +6 -0
- package/lib/core/services/topo/index.js +16 -0
- package/lib/core/store/models/topoConfig.js +6 -1
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/ResourceOverview.js +125 -251
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/ResourceOverviewMetric.js +4 -2
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/hooks/useMetricPolling.js +2 -2
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/hooks/useAlarmAndRiskData.js +184 -0
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/hooks/useMetricModels.js +3 -3
- package/lib/core/viewer/components/titlebar/widgets/SearchWidget.js +4 -0
- package/lib/networkTopo/services/topo/basic.js +4 -2
- package/lib/networkTopo/store/linkManager.js +0 -2
- package/lib/networkTopo/store/topoCenter.js +0 -2
- package/lib/networkTopo/store/topoLinkMod.js +0 -2
- package/package.json +2 -2
- /package/es/core/services/{topo.js → topo/tagtip.js} +0 -0
- /package/lib/core/services/{topo.js → topo/tagtip.js} +0 -0
@@ -21,7 +21,7 @@ export default function useMetricPolling(_ref) {
|
|
21
21
|
|
22
22
|
|
23
23
|
var queryLinkMetricsRequest = useRequest(queryLinkLatestMetrics, {
|
24
|
-
pollingInterval:
|
24
|
+
pollingInterval: 60 * 1000,
|
25
25
|
pollingWhenHidden: false,
|
26
26
|
debounceInterval: 200,
|
27
27
|
manual: true,
|
@@ -31,7 +31,7 @@ export default function useMetricPolling(_ref) {
|
|
31
31
|
}
|
32
32
|
});
|
33
33
|
var queryInterfaceMetricsRequest = useRequest(queryLinkInterfacesLatestMetrics, {
|
34
|
-
pollingInterval:
|
34
|
+
pollingInterval: 60 * 1000,
|
35
35
|
pollingWhenHidden: false,
|
36
36
|
debounceInterval: 200,
|
37
37
|
manual: true,
|
@@ -0,0 +1,171 @@
|
|
1
|
+
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
2
|
+
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
3
|
+
import { useRequest } from 'ahooks';
|
4
|
+
import { useEffect, useState } from 'react';
|
5
|
+
import alarmService from "../../../../../../../services/alarm";
|
6
|
+
import service from "../../../../../../../services/overview";
|
7
|
+
/**
|
8
|
+
* 概览指标定义
|
9
|
+
* @param {*} props
|
10
|
+
*/
|
11
|
+
|
12
|
+
var useAlarmAndRiskData = function useAlarmAndRiskData(props) {
|
13
|
+
var id = props.id,
|
14
|
+
isAppTopo = props.isAppTopo,
|
15
|
+
resourceOverviewProps = props.resourceOverviewProps,
|
16
|
+
childrenIds = props.childrenIds,
|
17
|
+
userId = props.userId;
|
18
|
+
|
19
|
+
var _useState = useState([]),
|
20
|
+
alarmRiskList = _useState[0],
|
21
|
+
setAlarmRiskList = _useState[1]; // 获取告警/风险信息
|
22
|
+
|
23
|
+
|
24
|
+
function getAlarmRiskData(_x) {
|
25
|
+
return _getAlarmRiskData.apply(this, arguments);
|
26
|
+
} // 轮询hooks
|
27
|
+
|
28
|
+
|
29
|
+
function _getAlarmRiskData() {
|
30
|
+
_getAlarmRiskData = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(id) {
|
31
|
+
var _alarmList, _yield$resourceOvervi, alarmList, _yield$alarmService$g, _alarmList2, AllComponentsByCiId, _yield$service$getRis, riskList;
|
32
|
+
|
33
|
+
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
34
|
+
while (1) {
|
35
|
+
switch (_context.prev = _context.next) {
|
36
|
+
case 0:
|
37
|
+
if (!isAppTopo) {
|
38
|
+
_context.next = 9;
|
39
|
+
break;
|
40
|
+
}
|
41
|
+
|
42
|
+
_context.next = 3;
|
43
|
+
return resourceOverviewProps === null || resourceOverviewProps === void 0 ? void 0 : resourceOverviewProps.getData({
|
44
|
+
id: id // metrics: topModelMetrics,
|
45
|
+
|
46
|
+
});
|
47
|
+
|
48
|
+
case 3:
|
49
|
+
_yield$resourceOvervi = _context.sent;
|
50
|
+
alarmList = _yield$resourceOvervi.alarms;
|
51
|
+
alarmList = ((_alarmList = alarmList) === null || _alarmList === void 0 ? void 0 : _alarmList.map(function (item) {
|
52
|
+
return {
|
53
|
+
type: 'alarm',
|
54
|
+
icon: 'gaojing-3',
|
55
|
+
className: "alarm-color-icon-lv" + item.alertLevel,
|
56
|
+
title: "[" + item.alertObject + "] " + item.alertTitle,
|
57
|
+
link: "/default/pagecenter/alertDetail/view/" + item.alertId + "?alertId=" + item.alertId + "&resId=" + item.ciId + "&title=" + item.alertObject + "&ruleId=" + item.ruleId,
|
58
|
+
time: item.createTime,
|
59
|
+
status: item.status,
|
60
|
+
params: [{
|
61
|
+
alertId: item.alertId,
|
62
|
+
status: 'dealing',
|
63
|
+
userId: userId,
|
64
|
+
isBaseAlert: false
|
65
|
+
}]
|
66
|
+
};
|
67
|
+
})) || [];
|
68
|
+
setAlarmRiskList(alarmList);
|
69
|
+
_context.next = 24;
|
70
|
+
break;
|
71
|
+
|
72
|
+
case 9:
|
73
|
+
_context.next = 11;
|
74
|
+
return alarmService.getAlarmByIds([id].concat(childrenIds), {
|
75
|
+
alertStatusList: ['toDeal', 'woDealing', 'dealing'],
|
76
|
+
// toDeal: 待处理, dealing:处理中
|
77
|
+
pageNum: 1,
|
78
|
+
pageSize: 10000,
|
79
|
+
sortField: 'alertLevel',
|
80
|
+
sortOrder: 'asc'
|
81
|
+
});
|
82
|
+
|
83
|
+
case 11:
|
84
|
+
_yield$alarmService$g = _context.sent;
|
85
|
+
_alarmList2 = _yield$alarmService$g.datas;
|
86
|
+
// 2022-07-16 后端不支持多列排序,暂通过前端实现,按创建时间倒序
|
87
|
+
_alarmList2 = _alarmList2.sort(function (a, b) {
|
88
|
+
return b.createTime - a.createTime;
|
89
|
+
});
|
90
|
+
_alarmList2 = _alarmList2.map(function (item) {
|
91
|
+
return {
|
92
|
+
type: 'alarm',
|
93
|
+
icon: 'gaojing-3',
|
94
|
+
className: "alarm-color-icon-lv" + item.alertLevel,
|
95
|
+
title: "" + item.alertObject + item.alertTitle,
|
96
|
+
link: "/default/pagecenter/alertDetail/view/" + item.alertId + "?alertId=" + item.alertId + "&resId=" + item.ciId + "&title=" + item.alertObject + "&ruleId=" + item.ruleId,
|
97
|
+
time: item.createTime,
|
98
|
+
status: item.status,
|
99
|
+
params: [{
|
100
|
+
alertId: item.alertId,
|
101
|
+
status: 'dealing',
|
102
|
+
userId: userId,
|
103
|
+
isBaseAlert: false
|
104
|
+
}]
|
105
|
+
};
|
106
|
+
}); // fix NEWITOM-33635【南昌大学】网络拓扑上双击设备拉开的抽屉中无法看到风险
|
107
|
+
|
108
|
+
_context.next = 17;
|
109
|
+
return service.queryAllComponentsByCiId(id);
|
110
|
+
|
111
|
+
case 17:
|
112
|
+
AllComponentsByCiId = _context.sent;
|
113
|
+
_context.next = 20;
|
114
|
+
return service.getRiskByIds({
|
115
|
+
ciIdList: [id].concat(childrenIds, AllComponentsByCiId.map(function (item) {
|
116
|
+
return item.id;
|
117
|
+
})),
|
118
|
+
statusList: ['toDeal', 'dealing'],
|
119
|
+
current: 1,
|
120
|
+
pageSize: 10000
|
121
|
+
});
|
122
|
+
|
123
|
+
case 20:
|
124
|
+
_yield$service$getRis = _context.sent;
|
125
|
+
riskList = _yield$service$getRis.content;
|
126
|
+
riskList = riskList.map(function (item) {
|
127
|
+
return {
|
128
|
+
type: 'risk',
|
129
|
+
icon: 'Overall_risk_full',
|
130
|
+
className: 'risk-icon',
|
131
|
+
title: "" + item.ciName + item.itemName,
|
132
|
+
link: "/default/inspectionTaskList/inspectionReport?title=" + item.ciName + "&reportId=" + item.executeId + "&reportTime=" + item.executeTime + "&reportType=" + item.viewType + "&reportName=" + item.reportName,
|
133
|
+
time: item.firstFoundTime
|
134
|
+
};
|
135
|
+
}); // console.log('告警和风险', alarmList, riskList);
|
136
|
+
|
137
|
+
setAlarmRiskList([].concat(_alarmList2, riskList));
|
138
|
+
|
139
|
+
case 24:
|
140
|
+
case "end":
|
141
|
+
return _context.stop();
|
142
|
+
}
|
143
|
+
}
|
144
|
+
}, _callee);
|
145
|
+
}));
|
146
|
+
return _getAlarmRiskData.apply(this, arguments);
|
147
|
+
}
|
148
|
+
|
149
|
+
var request = useRequest(getAlarmRiskData, {
|
150
|
+
pollingInterval: 1000 * 15,
|
151
|
+
pollingWhenHidden: false,
|
152
|
+
// debounceInterval: 200,
|
153
|
+
manual: true,
|
154
|
+
onSuccess: function onSuccess() {}
|
155
|
+
});
|
156
|
+
useEffect(function () {
|
157
|
+
setAlarmRiskList([]);
|
158
|
+
request.run(id);
|
159
|
+
return function () {
|
160
|
+
request.cancel();
|
161
|
+
};
|
162
|
+
}, [id]);
|
163
|
+
return {
|
164
|
+
alarmRiskList: alarmRiskList,
|
165
|
+
refreshAlarmData: function refreshAlarmData() {
|
166
|
+
request.run();
|
167
|
+
}
|
168
|
+
};
|
169
|
+
};
|
170
|
+
|
171
|
+
export default useAlarmAndRiskData;
|
@@ -92,9 +92,9 @@ var useMetricModels = function useMetricModels(props) {
|
|
92
92
|
}
|
93
93
|
|
94
94
|
var request = useRequest(fetchData, {
|
95
|
-
pollingInterval: 1000 *
|
96
|
-
|
97
|
-
// debounceInterval:
|
95
|
+
pollingInterval: 1000 * 60,
|
96
|
+
pollingWhenHidden: false,
|
97
|
+
// debounceInterval: 200,
|
98
98
|
manual: true,
|
99
99
|
onSuccess: function onSuccess(newMetricModels) {
|
100
100
|
var a = metricModels.map(function (item) {
|
@@ -532,7 +532,7 @@ export default _extends({
|
|
532
532
|
/**
|
533
533
|
* 保存拓扑绘制数据(第三方库内部结构,无需关心含义)
|
534
534
|
* @param {Number} id Topo ID
|
535
|
-
* @param {String} data
|
535
|
+
* @param {String} data ht拓扑序列化数据
|
536
536
|
* @returns
|
537
537
|
*/
|
538
538
|
saveSerializeData: function saveSerializeData(id, data) {
|
@@ -542,7 +542,9 @@ export default _extends({
|
|
542
542
|
switch (_context15.prev = _context15.next) {
|
543
543
|
case 0:
|
544
544
|
_context15.next = 2;
|
545
|
-
return request.post(API_ROOT + "/structure/" + id,
|
545
|
+
return request.post(API_ROOT + "/structure/" + id, {
|
546
|
+
data: data
|
547
|
+
});
|
546
548
|
|
547
549
|
case 2:
|
548
550
|
return _context15.abrupt("return", _context15.sent);
|
@@ -6,7 +6,6 @@ import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
6
6
|
* 链路新增、编辑 Model
|
7
7
|
*/
|
8
8
|
import rlog from '@riil-frontend/component-topology-utils/es/rlog';
|
9
|
-
import topoService from '@riil-frontend/component-topology-common/es/services/topo';
|
10
9
|
export default function (topoApp) {
|
11
10
|
return {
|
12
11
|
// 定义 model 的初始 state
|
@@ -8,7 +8,6 @@ import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
8
8
|
*
|
9
9
|
*/
|
10
10
|
import rlog from '@riil-frontend/component-topology-utils/es/rlog';
|
11
|
-
import topoService from '@riil-frontend/component-topology-common/es/services/topo';
|
12
11
|
export default {
|
13
12
|
// 定义 model 的初始 state
|
14
13
|
state: {
|
@@ -6,7 +6,6 @@ import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
6
6
|
* 拓扑链路相关 Model
|
7
7
|
*/
|
8
8
|
import rlog from "@riil-frontend/component-topology-utils/es/rlog";
|
9
|
-
import topoService from "@riil-frontend/component-topology-common/es/services/topo";
|
10
9
|
export default function (topoApp) {
|
11
10
|
return {
|
12
11
|
// 定义 model 的初始 state
|
@@ -62,11 +62,15 @@ function getResourceIcons(topo) {
|
|
62
62
|
|
63
63
|
|
64
64
|
function getBasicIcons(topo, containsGroupIcon) {
|
65
|
+
var nodeIcons = _manager["default"].iconLibManager.getNodeIcons().filter(function (icon) {
|
66
|
+
return !icon.ciType;
|
67
|
+
});
|
68
|
+
|
65
69
|
if (containsGroupIcon === false) {
|
66
|
-
return _basicIcons["default"];
|
70
|
+
return [].concat(nodeIcons, _basicIcons["default"]);
|
67
71
|
}
|
68
72
|
|
69
|
-
return [_manager["default"].iconLibManager.getGroupIcon()].concat(_basicIcons["default"]);
|
73
|
+
return [_manager["default"].iconLibManager.getGroupIcon()].concat(nodeIcons, _basicIcons["default"]);
|
70
74
|
}
|
71
75
|
|
72
76
|
function getGroupDefaultIcons(topo) {
|
@@ -13,6 +13,8 @@ var _form = _interopRequireDefault(require("@alifd/next/lib/form"));
|
|
13
13
|
|
14
14
|
var _react = _interopRequireWildcard(require("react"));
|
15
15
|
|
16
|
+
var _edgeTypeStyleUtil = require("../../../../utils/edgeTypeStyleUtil");
|
17
|
+
|
16
18
|
var _EdgeTypeModule = _interopRequireDefault(require("./EdgeType.module.scss"));
|
17
19
|
|
18
20
|
var _LineType = _interopRequireDefault(require("./LineType"));
|
@@ -77,43 +79,60 @@ var LINE_MOLD_OPTIONS = [{
|
|
77
79
|
icon: 'topo_lineMold_dotted_two'
|
78
80
|
}];
|
79
81
|
|
80
|
-
function
|
82
|
+
function getValuesByEdges(topo) {
|
83
|
+
function getStartPoint(edge) {
|
84
|
+
var icons = edge.s('icons') || {};
|
85
|
+
return ['sourceArrow', 'sourceSolidCircle', 'sourceNoneCircle'].filter(function (name) {
|
86
|
+
return icons[name];
|
87
|
+
})[0] || 'nil';
|
88
|
+
}
|
89
|
+
|
90
|
+
function getEndPoint(edge) {
|
91
|
+
var icons = edge.s('icons') || {};
|
92
|
+
return ['targetArrow', 'targetSolidCircle', 'targetNoneCircle'].filter(function (name) {
|
93
|
+
return icons[name];
|
94
|
+
})[0] || 'nil';
|
95
|
+
}
|
96
|
+
|
97
|
+
var selectionEdges = (0, _edgeTypeStyleUtil.getEdgesBySelection)(topo);
|
98
|
+
var edgeValues = [];
|
99
|
+
(0, _edgeTypeStyleUtil.loopEdgesAndChildren)(topo, selectionEdges, function (edge) {
|
100
|
+
edgeValues.push({
|
101
|
+
lineButton: edge.s('edge.type'),
|
102
|
+
startPoint: getStartPoint(edge),
|
103
|
+
endPoint: getEndPoint(edge),
|
104
|
+
lineMold: edge.a('lineMode') || 'solidLine'
|
105
|
+
});
|
106
|
+
});
|
81
107
|
var values = {
|
108
|
+
lineButton: undefined,
|
82
109
|
startPoint: undefined,
|
83
110
|
endPoint: undefined,
|
84
111
|
lineMold: undefined
|
85
|
-
};
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
values = {
|
90
|
-
startPoint: 'nil',
|
91
|
-
endPoint: 'nil',
|
92
|
-
lineMold: edge.a('lineMode') || 'solidLine'
|
93
|
-
};
|
94
|
-
var icons = edge.s('icons') || {};
|
95
|
-
['sourceArrow', 'sourceSolidCircle', 'sourceNoneCircle'].forEach(function (name) {
|
96
|
-
if (icons[name]) {
|
97
|
-
values.startPoint = name;
|
98
|
-
}
|
112
|
+
};
|
113
|
+
Object.keys(values).forEach(function (name) {
|
114
|
+
var vals = edgeValues.map(function (item) {
|
115
|
+
return item[name];
|
99
116
|
});
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
}
|
104
|
-
});
|
105
|
-
}
|
117
|
+
var isSame = vals.filter(function (val) {
|
118
|
+
return val === vals[0];
|
119
|
+
}).length === vals.length;
|
106
120
|
|
121
|
+
if (isSame) {
|
122
|
+
values[name] = vals[0];
|
123
|
+
}
|
124
|
+
});
|
107
125
|
return values;
|
108
126
|
}
|
109
127
|
|
110
128
|
function EdgeType(props) {
|
111
|
-
var
|
129
|
+
var topo = props.topo,
|
130
|
+
selection = props.selection,
|
112
131
|
_onChange = props.onChange;
|
113
132
|
|
114
133
|
var field = _field["default"].useField({
|
115
134
|
autoUnmount: false,
|
116
|
-
values:
|
135
|
+
values: getValuesByEdges(topo),
|
117
136
|
onChange: function onChange(name, value) {
|
118
137
|
if (['startPoint', 'endPoint'].includes(name) && value === 'nil') {
|
119
138
|
_onChange(name, null);
|
@@ -124,7 +143,7 @@ function EdgeType(props) {
|
|
124
143
|
});
|
125
144
|
|
126
145
|
(0, _react.useEffect)(function () {
|
127
|
-
field.setValues(
|
146
|
+
field.setValues(getValuesByEdges(topo));
|
128
147
|
}, [selection]);
|
129
148
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
130
149
|
className: _EdgeTypeModule["default"].lineBox
|
@@ -11,6 +11,8 @@ var _balloon = _interopRequireDefault(require("@alifd/next/lib/balloon"));
|
|
11
11
|
|
12
12
|
var _react = _interopRequireWildcard(require("react"));
|
13
13
|
|
14
|
+
var _classnames = _interopRequireDefault(require("classnames"));
|
15
|
+
|
14
16
|
var _LineTypeModule = _interopRequireDefault(require("./LineType.module.scss"));
|
15
17
|
|
16
18
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
@@ -41,11 +43,14 @@ var LINE_TYPE_OPTIONS = [{
|
|
41
43
|
}];
|
42
44
|
|
43
45
|
var LineType = /*#__PURE__*/_react["default"].forwardRef(function (props, ref) {
|
44
|
-
var
|
46
|
+
var value = props.value,
|
47
|
+
onChange = props.onChange;
|
45
48
|
|
46
49
|
function lineButton(item) {
|
50
|
+
var _classNames;
|
51
|
+
|
47
52
|
return /*#__PURE__*/_react["default"].createElement(_button["default"], {
|
48
|
-
className: ""
|
53
|
+
className: (0, _classnames["default"])(_LineTypeModule["default"].redioBtn, (_classNames = {}, _classNames[_LineTypeModule["default"].selected] = value === item.value, _classNames)),
|
49
54
|
onClick: function onClick() {
|
50
55
|
onChange(item.value);
|
51
56
|
}
|
@@ -67,5 +72,6 @@ var LineType = /*#__PURE__*/_react["default"].forwardRef(function (props, ref) {
|
|
67
72
|
}));
|
68
73
|
});
|
69
74
|
|
75
|
+
LineType.displayName = 'LineType';
|
70
76
|
var _default = LineType;
|
71
77
|
exports["default"] = _default;
|
@@ -24,8 +24,7 @@ function getEdgesBySelection(topo) {
|
|
24
24
|
return nodeIds;
|
25
25
|
};
|
26
26
|
|
27
|
-
var getSelectedEdges = function getSelectedEdges(
|
28
|
-
var gv = topo.getGraphView();
|
27
|
+
var getSelectedEdges = function getSelectedEdges(gv) {
|
29
28
|
var selection = gv.getSelectionModel().getSelection().toArray(); // 选中的连线
|
30
29
|
|
31
30
|
var edges = selection.filter(function (element) {
|
@@ -51,7 +50,7 @@ function getEdgesBySelection(topo) {
|
|
51
50
|
return edges;
|
52
51
|
};
|
53
52
|
|
54
|
-
return getSelectedEdges(topo);
|
53
|
+
return getSelectedEdges(topo.getGraphView());
|
55
54
|
}
|
56
55
|
/**
|
57
56
|
* 遍历连线及子连线
|
@@ -34,9 +34,9 @@ var usePolling = function usePolling(props) {
|
|
34
34
|
var resIdsList = resAndMetrics === null || resAndMetrics === void 0 ? void 0 : resAndMetrics.resIdsList; // 轮询hooks
|
35
35
|
|
36
36
|
var _useRequest = (0, _ahooks.useRequest)(refresh, {
|
37
|
-
pollingInterval:
|
38
|
-
|
39
|
-
// debounceInterval:
|
37
|
+
pollingInterval: 60 * 1000,
|
38
|
+
pollingWhenHidden: false,
|
39
|
+
// debounceInterval: 200,
|
40
40
|
manual: true,
|
41
41
|
onSuccess: function onSuccess(result) {
|
42
42
|
if (result) {
|
@@ -11,14 +11,14 @@ var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/
|
|
11
11
|
|
12
12
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
13
13
|
|
14
|
-
var _topo = _interopRequireDefault(require("@riil-frontend/component-topology-common/es/services/topo"));
|
15
|
-
|
16
14
|
var _componentTopologyUtils = require("@riil-frontend/component-topology-utils");
|
17
15
|
|
18
16
|
var _rlog = _interopRequireDefault(require("@riil-frontend/component-topology-utils/es/rlog"));
|
19
17
|
|
20
18
|
var _lodash = require("lodash");
|
21
19
|
|
20
|
+
var _topo = _interopRequireDefault(require("../services/topo"));
|
21
|
+
|
22
22
|
var _CiTypeCache = _interopRequireDefault(require("./cache/CiTypeCache"));
|
23
23
|
|
24
24
|
var _Alarm = _interopRequireDefault(require("./Alarm"));
|
@@ -54,7 +54,7 @@ var _ElementTagTipConfig = _interopRequireDefault(require("./tagstips/ElementTag
|
|
54
54
|
var _SelectionModel = _interopRequireDefault(require("./SelectionModel"));
|
55
55
|
|
56
56
|
// eslint-disable-next-line no-undef
|
57
|
-
var version = typeof "8.0.0-a.
|
57
|
+
var version = typeof "8.0.0-a.11" === 'string' ? "8.0.0-a.11" : null;
|
58
58
|
console.info("\u62D3\u6251\u7248\u672C: " + version);
|
59
59
|
/**
|
60
60
|
* 拓扑显示和编辑
|
@@ -13,7 +13,7 @@ var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/
|
|
13
13
|
|
14
14
|
var _utils = require("./utils");
|
15
15
|
|
16
|
-
var
|
16
|
+
var _tagtip = require("../../services/topo/tagtip");
|
17
17
|
|
18
18
|
var _rlog = _interopRequireDefault(require("@riil-frontend/component-topology-utils/lib/rlog"));
|
19
19
|
|
@@ -44,7 +44,7 @@ var ElementTagTipConfig = /*#__PURE__*/function () {
|
|
44
44
|
}
|
45
45
|
|
46
46
|
_context.next = 6;
|
47
|
-
return (0,
|
47
|
+
return (0, _tagtip.getMetricsByMonitorTemplateCodes)(this.mtCodes);
|
48
48
|
|
49
49
|
case 6:
|
50
50
|
this.mtMetricsMap = _context.sent;
|
@@ -18,8 +18,16 @@ var _topo = require("@riil-frontend/component-topology-common/es/services/topo")
|
|
18
18
|
var _rlog = _interopRequireDefault(require("@riil-frontend/component-topology-utils/es/rlog"));
|
19
19
|
|
20
20
|
function getLayoutId(layout) {
|
21
|
-
if (!layout
|
21
|
+
if (!layout) {
|
22
22
|
return layout;
|
23
|
+
} // 拖拽添加分层后点击保存ht传参不正确,临时适配
|
24
|
+
|
25
|
+
|
26
|
+
if (typeof layout === "string") {
|
27
|
+
return {
|
28
|
+
v: 'towardeast',
|
29
|
+
h: 'towardsouth'
|
30
|
+
}[layout] || layout;
|
23
31
|
}
|
24
32
|
|
25
33
|
var id = layout.id,
|