@riil-frontend/component-topology 12.1.0-dev.8 → 13.0.0-dev.1
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 +6 -6
- package/es/core/components/AlarmListPanel/components/AlarmListItem.js +2 -2
- package/es/core/editor/components/Sidebar/views/ImagePanel/ImagePanel.js +11 -3
- package/es/core/editor/components/Toolbar/widgets/EdgeColorButton/EdgeColorButton.js +2 -2
- package/es/core/editor/components/Toolbar/widgets/EdgeTypeButton/LineType.js +15 -5
- package/es/core/editor/components/Toolbar/widgets/FontFamilyWidget.js +27 -2
- package/es/core/editor/components/Toolbar/widgets/FontSizeWidget.js +28 -3
- package/es/core/editor/components/Toolbar/widgets/FontStyleButton.js +52 -6
- package/es/core/editor/components/Toolbar/widgets/Layout/index.js +2 -2
- package/es/core/editor/utils/edgeTypeStyleUtil.js +32 -11
- package/es/core/hooks/useTopoEdit.js +4 -0
- package/es/core/models/Alarm.js +14 -15
- package/es/core/models/TopoApp.js +31 -23
- package/es/core/models/utils/linkUtils.js +28 -36
- package/es/core/utils/edgeUtil.js +1 -2
- package/es/core/viewer/components/plugins/ElementDetailDrawer/hooks/useElementDetailManager.js +2 -2
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/EventsCard.js +51 -13
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/LinkTopo.module.scss +1 -1
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/index.module.scss +8 -0
- package/es/networkTopo/models/EdgeGroupTagTipBuilder.js +7 -7
- package/es/networkTopo/utils/edgeGroupTagUtil.js +2 -2
- package/es/utils/htElementUtils.js +4 -36
- package/es/utils/topoData.js +1 -1
- package/lib/core/components/AlarmListPanel/components/AlarmListItem.js +2 -2
- package/lib/core/editor/components/Sidebar/views/ImagePanel/ImagePanel.js +12 -3
- package/lib/core/editor/components/Toolbar/widgets/EdgeColorButton/EdgeColorButton.js +2 -2
- package/lib/core/editor/components/Toolbar/widgets/EdgeTypeButton/LineType.js +14 -5
- package/lib/core/editor/components/Toolbar/widgets/FontFamilyWidget.js +28 -3
- package/lib/core/editor/components/Toolbar/widgets/FontSizeWidget.js +28 -3
- package/lib/core/editor/components/Toolbar/widgets/FontStyleButton.js +56 -6
- package/lib/core/editor/components/Toolbar/widgets/Layout/index.js +1 -1
- package/lib/core/editor/utils/edgeTypeStyleUtil.js +33 -10
- package/lib/core/hooks/useTopoEdit.js +4 -0
- package/lib/core/models/Alarm.js +14 -15
- package/lib/core/models/TopoApp.js +29 -22
- package/lib/core/models/utils/linkUtils.js +27 -36
- package/lib/core/utils/edgeUtil.js +1 -3
- package/lib/core/viewer/components/plugins/ElementDetailDrawer/hooks/useElementDetailManager.js +2 -3
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/EventsCard.js +52 -13
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/LinkTopo.module.scss +1 -1
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/index.module.scss +8 -0
- package/lib/networkTopo/models/EdgeGroupTagTipBuilder.js +6 -6
- package/lib/networkTopo/utils/edgeGroupTagUtil.js +2 -2
- package/lib/utils/htElementUtils.js +4 -40
- package/lib/utils/topoData.js +1 -1
- package/package.json +2 -2
- package/es/core/editor/components/Toolbar/widgets/components/FontFamilySelect.js +0 -29
- package/es/core/editor/components/Toolbar/widgets/components/FontSizeSelect.js +0 -29
- package/es/core/editor/components/Toolbar/widgets/components/FontStyleSelect.js +0 -71
- package/lib/core/editor/components/Toolbar/widgets/components/FontFamilySelect.js +0 -38
- package/lib/core/editor/components/Toolbar/widgets/components/FontSizeSelect.js +0 -38
- package/lib/core/editor/components/Toolbar/widgets/components/FontStyleSelect.js +0 -83
package/lib/core/models/Alarm.js
CHANGED
@@ -481,14 +481,14 @@ var Alarm = /*#__PURE__*/function () {
|
|
481
481
|
console.log("handleAlarmEvent-接收到推送的原始告警信息", alertData);
|
482
482
|
|
483
483
|
if (!((0, _utils.isAvailableArray)(alertData) && (0, _utils.isAvailableArray)(resIdsList))) {
|
484
|
-
_context8.next =
|
484
|
+
_context8.next = 25;
|
485
485
|
break;
|
486
486
|
}
|
487
487
|
|
488
488
|
sendAl = [];
|
489
489
|
idsList = [].concat(nodeIdsList, linkIdsList);
|
490
|
-
operations = [];
|
491
|
-
|
490
|
+
operations = []; // console.log('idsList---------', idsList)
|
491
|
+
|
492
492
|
idsList.forEach(function (idItem) {
|
493
493
|
if (idItem.operation === null) {
|
494
494
|
operations.push(idItem.ciId);
|
@@ -514,23 +514,22 @@ var Alarm = /*#__PURE__*/function () {
|
|
514
514
|
if (resIdsList.indexOf(ciId) >= 0 && operations.indexOf(ciId) < 0) {
|
515
515
|
sendAl.push(obj);
|
516
516
|
}
|
517
|
-
});
|
518
|
-
console.log("before-combAlarmData", sendAl, idsList);
|
517
|
+
}); // console.log("before-combAlarmData", sendAl, idsList);
|
519
518
|
|
520
519
|
if (!(sendAl.length > 0)) {
|
521
|
-
_context8.next =
|
520
|
+
_context8.next = 25;
|
522
521
|
break;
|
523
522
|
}
|
524
523
|
|
525
524
|
_componentTopologyUtils.rlog.debug('过滤掉非本拓扑的告警信息 告警开关-推送告警到ht-alarmIsOpened-sendAl', alarmIsOpened, sendAl);
|
526
525
|
|
527
|
-
_context8.prev =
|
528
|
-
_context8.next =
|
526
|
+
_context8.prev = 13;
|
527
|
+
_context8.next = 16;
|
529
528
|
return alarmDispatchers.combAlarmData({
|
530
529
|
alarmdata: sendAl
|
531
530
|
});
|
532
531
|
|
533
|
-
case
|
532
|
+
case 16:
|
534
533
|
_yield$alarmDispatche2 = _context8.sent;
|
535
534
|
eqFlag = _yield$alarmDispatche2.eqFlag;
|
536
535
|
alarmlist = _yield$alarmDispatche2.alarmlist;
|
@@ -551,20 +550,20 @@ var Alarm = /*#__PURE__*/function () {
|
|
551
550
|
}
|
552
551
|
}
|
553
552
|
|
554
|
-
_context8.next =
|
553
|
+
_context8.next = 25;
|
555
554
|
break;
|
556
555
|
|
557
|
-
case
|
558
|
-
_context8.prev =
|
559
|
-
_context8.t0 = _context8["catch"](
|
556
|
+
case 22:
|
557
|
+
_context8.prev = 22;
|
558
|
+
_context8.t0 = _context8["catch"](13);
|
560
559
|
|
561
560
|
_componentTopologyUtils.rlog.error('告警发送异常', _context8.t0);
|
562
561
|
|
563
|
-
case
|
562
|
+
case 25:
|
564
563
|
case "end":
|
565
564
|
return _context8.stop();
|
566
565
|
}
|
567
|
-
}, _callee8, this, [[
|
566
|
+
}, _callee8, this, [[13, 22]]);
|
568
567
|
}));
|
569
568
|
|
570
569
|
function handleAlarmEvent(_x6) {
|
@@ -54,7 +54,7 @@ var _SelectionModel = _interopRequireDefault(require("./SelectionModel"));
|
|
54
54
|
var _CiCache = _interopRequireDefault(require("./cache/CiCache"));
|
55
55
|
|
56
56
|
// eslint-disable-next-line no-undef
|
57
|
-
var version = typeof "
|
57
|
+
var version = typeof "13.0.0-dev.1" === 'string' ? "13.0.0-dev.1" : null;
|
58
58
|
console.info("\u62D3\u6251\u7248\u672C: " + version);
|
59
59
|
/**
|
60
60
|
* 拓扑显示和编辑
|
@@ -218,29 +218,37 @@ var Topo = /*#__PURE__*/function () {
|
|
218
218
|
|
219
219
|
_proto.getData = function getData() {
|
220
220
|
return {
|
221
|
-
groups:
|
222
|
-
nodes:
|
223
|
-
|
224
|
-
}).map(_htElementUtils.getNodeData),
|
221
|
+
groups: this.getGroups(),
|
222
|
+
nodes: this.getNodes(),
|
223
|
+
lines: this.getLines(),
|
225
224
|
customNodes: (0, _htElementUtils.getNodeDatas)(this.getDataModel()).filter(function (item) {
|
226
225
|
return !item.id;
|
227
226
|
}),
|
228
|
-
|
229
|
-
return !!item.id;
|
230
|
-
}),
|
231
|
-
customLines: (0, _htElementUtils.getEdgeDatas)(this.getDataModel()).filter(function (item) {
|
227
|
+
customLines: this.getEdges().filter(function (item) {
|
232
228
|
return !item.id;
|
233
229
|
})
|
234
230
|
};
|
235
|
-
}
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
231
|
+
};
|
232
|
+
|
233
|
+
_proto.getGroups = function getGroups() {
|
234
|
+
return (0, _htElementUtils.getGroupDatas)(this.getDataModel());
|
235
|
+
};
|
236
|
+
|
237
|
+
_proto.getNodes = function getNodes() {
|
238
|
+
var nodes = (0, _htElementUtils.getNodes)(this.getDataModel()).filter(function (node) {
|
239
|
+
return !!node.getTag();
|
240
|
+
});
|
241
|
+
return nodes.map(_htElementUtils.getNodeData);
|
242
|
+
};
|
241
243
|
|
242
244
|
_proto.getLines = function getLines() {
|
243
|
-
return this.
|
245
|
+
return this.getEdges().filter(function (item) {
|
246
|
+
return !!item.id;
|
247
|
+
});
|
248
|
+
};
|
249
|
+
|
250
|
+
_proto.getEdges = function getEdges() {
|
251
|
+
return (0, _htElementUtils.getEdgeDatas)(this.getDataModel());
|
244
252
|
}
|
245
253
|
/**
|
246
254
|
* 全量更新数据
|
@@ -299,19 +307,18 @@ var Topo = /*#__PURE__*/function () {
|
|
299
307
|
/*#__PURE__*/
|
300
308
|
function () {
|
301
309
|
var _addElements = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee5(elements) {
|
302
|
-
var
|
310
|
+
var data;
|
303
311
|
return _regenerator["default"].wrap(function _callee5$(_context5) {
|
304
312
|
while (1) switch (_context5.prev = _context5.next) {
|
305
313
|
case 0:
|
306
|
-
prevData = this.getData();
|
307
314
|
data = {
|
308
|
-
groups: [].concat(
|
309
|
-
nodes: [].concat(
|
310
|
-
lines: [].concat(
|
315
|
+
groups: [].concat(this.getGroups(), elements.groups || []),
|
316
|
+
nodes: [].concat(this.getNodes(), elements.nodes || []),
|
317
|
+
lines: [].concat(this.getLines(), elements.lines || [])
|
311
318
|
};
|
312
319
|
this.updateElements(data); // TODO 更新store,触发属性、指标模型加载,更新指标
|
313
320
|
|
314
|
-
case
|
321
|
+
case 2:
|
315
322
|
case "end":
|
316
323
|
return _context5.stop();
|
317
324
|
}
|
@@ -6,7 +6,6 @@ exports.__esModule = true;
|
|
6
6
|
exports.buildTopoLinkData = buildTopoLinkData;
|
7
7
|
exports.compatibleWith = void 0;
|
8
8
|
exports.getLinksDetail = getLinksDetail;
|
9
|
-
exports.isAggLink = isAggLink;
|
10
9
|
exports.isCrucialLink = isCrucialLink;
|
11
10
|
exports.isExitLink = isExitLink;
|
12
11
|
exports.mergeExportLinkData = void 0;
|
@@ -23,6 +22,8 @@ var _keyBy = _interopRequireDefault(require("lodash/keyBy"));
|
|
23
22
|
|
24
23
|
var _lodash = _interopRequireDefault(require("lodash"));
|
25
24
|
|
25
|
+
var _services = require("../../services");
|
26
|
+
|
26
27
|
var _htElementUtils = require("../../../utils/htElementUtils");
|
27
28
|
|
28
29
|
var _CiTypeCache = _interopRequireDefault(require("../cache/CiTypeCache"));
|
@@ -55,21 +56,7 @@ function isCrucialLink(link) {
|
|
55
56
|
|
56
57
|
|
57
58
|
function isExitLink(link) {
|
58
|
-
|
59
|
-
|
60
|
-
return (link === null || link === void 0 ? void 0 : (_link$attributes = link.attributes) === null || _link$attributes === void 0 ? void 0 : _link$attributes.destination_type) === "ip";
|
61
|
-
}
|
62
|
-
/**
|
63
|
-
* 是否聚合链路
|
64
|
-
* @param {*} link
|
65
|
-
* @returns
|
66
|
-
*/
|
67
|
-
|
68
|
-
|
69
|
-
function isAggLink(link) {
|
70
|
-
var _link$attributes2, _link$attributes3;
|
71
|
-
|
72
|
-
return (link === null || link === void 0 ? void 0 : (_link$attributes2 = link.attributes) === null || _link$attributes2 === void 0 ? void 0 : _link$attributes2.destination_type) === "network.agg_interface" && (link === null || link === void 0 ? void 0 : (_link$attributes3 = link.attributes) === null || _link$attributes3 === void 0 ? void 0 : _link$attributes3.source_type) === "network.agg_interface";
|
59
|
+
return (link === null || link === void 0 ? void 0 : link.attributes) && !(link !== null && link !== void 0 && link.attributes["destination_id"]);
|
73
60
|
}
|
74
61
|
|
75
62
|
function mergeLinksData(links, linkCis, nodes, interfaceCiMap, interfaceDoc) {
|
@@ -120,7 +107,7 @@ function _getLinksDetail() {
|
|
120
107
|
return _regenerator["default"].wrap(function _callee$(_context) {
|
121
108
|
while (1) switch (_context.prev = _context.next) {
|
122
109
|
case 0:
|
123
|
-
if (links
|
110
|
+
if (!(!links || !links.length)) {
|
124
111
|
_context.next = 2;
|
125
112
|
break;
|
126
113
|
}
|
@@ -128,6 +115,9 @@ function _getLinksDetail() {
|
|
128
115
|
return _context.abrupt("return", []);
|
129
116
|
|
130
117
|
case 2:
|
118
|
+
// const linkCis = await topoService.relation.batchQueryRelation(
|
119
|
+
// links.map((link) => link.id)
|
120
|
+
// );
|
131
121
|
linkCis = links;
|
132
122
|
interfaceIds = [].concat(linkCis.map(function (item) {
|
133
123
|
return item.attributes.source_id;
|
@@ -186,8 +176,7 @@ var plurals = {
|
|
186
176
|
2: ["phy"],
|
187
177
|
3: ["agg"],
|
188
178
|
4: ["phy", "agg"]
|
189
|
-
};
|
190
|
-
|
179
|
+
};
|
191
180
|
exports.plurals = plurals;
|
192
181
|
|
193
182
|
var showLinkByConfig = function showLinkByConfig(props) {
|
@@ -201,29 +190,31 @@ var showLinkByConfig = function showLinkByConfig(props) {
|
|
201
190
|
|
202
191
|
var gv = topo.getGraphView();
|
203
192
|
var dm = gv.getDataModel();
|
204
|
-
var edges = (0, _htElementUtils.getEdges)(dm).
|
205
|
-
return !(0, _htElementUtils.isEdgeGroup)(edge);
|
206
|
-
}); // console.log("edges", edges);
|
193
|
+
var edges = (0, _htElementUtils.getEdges)(dm); // console.log("edges", edges);
|
207
194
|
|
208
195
|
var showPhy = types.indexOf("phy") >= 0;
|
209
196
|
var showAgg = types.indexOf("agg") >= 0; // console.log("edges----types",showType, types,showPhy, showAgg);
|
210
197
|
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
var d = topo.dataModel.getDataById(edge.getTag()); // 判断是否聚合链路
|
218
|
-
|
219
|
-
if (isAggLink(d)) {
|
220
|
-
edge.s("x.visible", showAgg);
|
198
|
+
if (Array.isArray(edges) && edges.length > 0) {
|
199
|
+
edges.forEach(function (edge) {
|
200
|
+
if (showType === 1 || showType === true) {
|
201
|
+
// 单链路全部显示
|
202
|
+
// console.log("单链路全部显示", edge);
|
203
|
+
edge.s("2d.visible", true);
|
221
204
|
} else {
|
222
|
-
|
223
|
-
|
205
|
+
var _d$attributes, _d$attributes2;
|
206
|
+
|
207
|
+
var d = topo.dataModel.getDataById(edge.getTag()); // 判断是否聚合链路
|
208
|
+
|
209
|
+
if ((d === null || d === void 0 ? void 0 : (_d$attributes = d.attributes) === null || _d$attributes === void 0 ? void 0 : _d$attributes.destination_type) === "network.agg_interface" && (d === null || d === void 0 ? void 0 : (_d$attributes2 = d.attributes) === null || _d$attributes2 === void 0 ? void 0 : _d$attributes2.source_type) === "network.agg_interface") {
|
210
|
+
edge.s("2d.visible", showAgg);
|
211
|
+
} else {
|
212
|
+
// console.log("edge", edge, d, showAgg);
|
213
|
+
edge.s("2d.visible", showPhy);
|
214
|
+
}
|
224
215
|
}
|
225
|
-
}
|
226
|
-
}
|
216
|
+
});
|
217
|
+
}
|
227
218
|
};
|
228
219
|
|
229
220
|
exports.showLinkByConfig = showLinkByConfig;
|
@@ -10,14 +10,12 @@ var _rlog = _interopRequireDefault(require("@riil-frontend/component-topology-ut
|
|
10
10
|
|
11
11
|
var _linkUtils = require("../models/utils/linkUtils");
|
12
12
|
|
13
|
-
var _htElementUtils = require("../../utils/htElementUtils");
|
14
|
-
|
15
13
|
/**
|
16
14
|
* 是否手工连线
|
17
15
|
* @param {*} edge
|
18
16
|
*/
|
19
17
|
function isCustomEdge(edge) {
|
20
|
-
return !
|
18
|
+
return !edge.isEdgeGroupAgent() && (edge.a('type') == 'line' || !edge.a('type'));
|
21
19
|
}
|
22
20
|
/**
|
23
21
|
* 根据配置更新连线展开折叠状态
|
package/lib/core/viewer/components/plugins/ElementDetailDrawer/hooks/useElementDetailManager.js
CHANGED
@@ -9,8 +9,6 @@ var _react = _interopRequireWildcard(require("react"));
|
|
9
9
|
|
10
10
|
var _DefaultDetailContent = _interopRequireDefault(require("../../ResourceDetail/DefaultDetailContent"));
|
11
11
|
|
12
|
-
var _htElementUtils = require("../../../../../../utils/htElementUtils");
|
13
|
-
|
14
12
|
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); }
|
15
13
|
|
16
14
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
@@ -76,8 +74,9 @@ function useElementDetailManager(props) {
|
|
76
74
|
}
|
77
75
|
|
78
76
|
function openByHtElement(htElement) {
|
77
|
+
var isEdgeGroupAgent = htElement instanceof ht.Edge && htElement.isEdgeGroupAgent() && !htElement.s('edge.expanded');
|
79
78
|
open({
|
80
|
-
id:
|
79
|
+
id: isEdgeGroupAgent || !htElement.getTag() ? "ht:" + htElement.getId() : htElement.getTag(),
|
81
80
|
htElement: htElement
|
82
81
|
});
|
83
82
|
}
|
package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/EventsCard.js
CHANGED
@@ -27,31 +27,70 @@ var _overview = _interopRequireDefault(require("../../../../../../services/overv
|
|
27
27
|
|
28
28
|
var _indexModule = _interopRequireDefault(require("./index.module.scss"));
|
29
29
|
|
30
|
+
var _componentTopologyUtils = require("@riil-frontend/component-topology-utils");
|
31
|
+
|
30
32
|
function formatUrl(url) {
|
31
|
-
|
33
|
+
var _window, _window$location;
|
34
|
+
|
35
|
+
console.log(url);
|
36
|
+
var prefix = '/default/pagecenter';
|
37
|
+
|
38
|
+
if (((_window = window) === null || _window === void 0 ? void 0 : (_window$location = _window.location) === null || _window$location === void 0 ? void 0 : _window$location.pathname.indexOf(prefix)) === 0 && (url === null || url === void 0 ? void 0 : url.indexOf(prefix)) === 0) {
|
39
|
+
return url.split(prefix)[1];
|
40
|
+
} else {
|
41
|
+
return url;
|
42
|
+
}
|
32
43
|
}
|
33
44
|
|
34
45
|
function EventsCard(props) {
|
35
46
|
var alarmRiskList = props.alarmRiskList,
|
36
47
|
closeDetailDrawer = props.closeDetailDrawer,
|
37
|
-
onHandleAlarm = props.onHandleAlarm;
|
48
|
+
onHandleAlarm = props.onHandleAlarm;
|
49
|
+
|
50
|
+
var jumpTo = function jumpTo(url) {
|
51
|
+
closeDetailDrawer();
|
52
|
+
|
53
|
+
if (topo.viewProps.jumpto) {
|
54
|
+
topo.viewProps.jumpto(formatUrl(url));
|
55
|
+
} else {
|
56
|
+
(0, _componentTopologyUtils.getHistory)().push(formatUrl(url));
|
57
|
+
}
|
58
|
+
}; // 告警table列配置
|
59
|
+
|
38
60
|
|
39
61
|
var columns = [{
|
40
62
|
title: "描述",
|
41
63
|
dataIndex: "title",
|
42
64
|
key: "title",
|
43
65
|
cell: function cell(value, index, record) {
|
44
|
-
return
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
66
|
+
return (
|
67
|
+
/*#__PURE__*/
|
68
|
+
// <div
|
69
|
+
// className={styles["alarm-title"]}
|
70
|
+
// title={value}
|
71
|
+
// onClick={closeDetailDrawer}
|
72
|
+
// >
|
73
|
+
// <Icon
|
74
|
+
// type={record.icon}
|
75
|
+
// size="xs"
|
76
|
+
// className={`${styles["alarm-color-icon"]} ${record.className}`}
|
77
|
+
// />
|
78
|
+
// <Link to={formatUrl(record.link)}>{value}</Link>
|
79
|
+
// </div>
|
80
|
+
_react["default"].createElement("div", {
|
81
|
+
className: _indexModule["default"]['alarm-title'],
|
82
|
+
title: value,
|
83
|
+
onClick: function onClick() {
|
84
|
+
jumpTo(record.link);
|
85
|
+
}
|
86
|
+
}, /*#__PURE__*/_react["default"].createElement(_icon["default"], {
|
87
|
+
type: record.icon,
|
88
|
+
size: "xs",
|
89
|
+
className: _indexModule["default"]['alarm-color-icon'] + " " + record.className
|
90
|
+
}), /*#__PURE__*/_react["default"].createElement("span", {
|
91
|
+
className: _indexModule["default"].link
|
92
|
+
}, value))
|
93
|
+
);
|
55
94
|
}
|
56
95
|
}, {
|
57
96
|
title: "时间",
|
@@ -22,11 +22,11 @@ var EdgeGroupTagTipBuilder = /*#__PURE__*/function () {
|
|
22
22
|
|
23
23
|
var topo = this.topo;
|
24
24
|
var dm = this.topo.getDataModel();
|
25
|
-
var
|
26
|
-
|
27
|
-
|
28
|
-
var linkId = (0, _edgeGroupTagUtil.getEdgeGroupLinkIdConfig)(
|
29
|
-
var edgeGroupId = [
|
25
|
+
var edgeGroupsTagsTips = (0, _htElementUtils.getEdgeGroups)(dm).map(function (edgeGroup) {
|
26
|
+
var edge = edgeGroup.getEdges().getArray()[0]; // 获取配置的链路
|
27
|
+
|
28
|
+
var linkId = (0, _edgeGroupTagUtil.getEdgeGroupLinkIdConfig)(edge, topo);
|
29
|
+
var edgeGroupId = [edge.getSourceAgent().getId(), edge.getTargetAgent().getId()];
|
30
30
|
var data = {
|
31
31
|
tags: [],
|
32
32
|
tips: []
|
@@ -37,7 +37,7 @@ var EdgeGroupTagTipBuilder = /*#__PURE__*/function () {
|
|
37
37
|
}
|
38
38
|
|
39
39
|
return {
|
40
|
-
htId:
|
40
|
+
htId: edge.getId(),
|
41
41
|
edgeGroupId: edgeGroupId,
|
42
42
|
tags: data.tags,
|
43
43
|
tips: data.tips,
|
@@ -65,8 +65,8 @@ function getEdgeGroupLinkIdConfig(edgeGroup, topo) {
|
|
65
65
|
}
|
66
66
|
|
67
67
|
function getEdgeGroupConfigId(edgeGroup) {
|
68
|
-
var sourceNode = edgeGroup.
|
69
|
-
var targetNode = edgeGroup.
|
68
|
+
var sourceNode = edgeGroup.getSourceAgent();
|
69
|
+
var targetNode = edgeGroup.getTargetAgent();
|
70
70
|
var sourceId = sourceNode.a('uuid');
|
71
71
|
var targetId = targetNode.a('uuid');
|
72
72
|
return [sourceId, targetId].sort().join(',');
|
@@ -26,10 +26,8 @@ exports.getNodeDatas = getNodeDatas;
|
|
26
26
|
exports.getNodes = getNodes;
|
27
27
|
exports.getNodesByGroupIdOrTag = getNodesByGroupIdOrTag;
|
28
28
|
exports.isEdge = isEdge;
|
29
|
-
exports.isEdgeGroup = isEdgeGroup;
|
30
29
|
exports.isEdgeGroupAgent = isEdgeGroupAgent;
|
31
30
|
exports.isEdgeGroupExpanded = isEdgeGroupExpanded;
|
32
|
-
exports.isEdgeVisible = isEdgeVisible;
|
33
31
|
exports.isExistedElement = isExistedElement;
|
34
32
|
exports.isGroup = isGroup;
|
35
33
|
exports.isLayer = isLayer;
|
@@ -174,15 +172,9 @@ function getNodeData(element) {
|
|
174
172
|
function getEdges(dataModel) {
|
175
173
|
return getElements(dataModel).filter(isValidEdge);
|
176
174
|
}
|
177
|
-
/**
|
178
|
-
* 是否连线组
|
179
|
-
* @param {ht.Edge} edge
|
180
|
-
* @returns
|
181
|
-
*/
|
182
175
|
|
183
|
-
|
184
|
-
|
185
|
-
return isEdge(edge) && edge.a('x.edgegroup.isEdgeGroup');
|
176
|
+
function isEdgeGroupExpanded(edge) {
|
177
|
+
return isEdge(edge) && edge.getEdgeGroup() && !!edge.s("edge.expanded");
|
186
178
|
}
|
187
179
|
/**
|
188
180
|
* 是否连线组代理
|
@@ -192,21 +184,7 @@ function isEdgeGroup(edge) {
|
|
192
184
|
|
193
185
|
|
194
186
|
function isEdgeGroupAgent(edge) {
|
195
|
-
return
|
196
|
-
}
|
197
|
-
/**
|
198
|
-
* TODO
|
199
|
-
* @param {*} edge
|
200
|
-
* @returns
|
201
|
-
*/
|
202
|
-
|
203
|
-
|
204
|
-
function isEdgeGroupExpanded(edge) {
|
205
|
-
return isEdge(edge) && edge.getEdgeGroup() && !!edge.s("edge.expanded");
|
206
|
-
}
|
207
|
-
|
208
|
-
function isEdgeVisible(edge) {
|
209
|
-
return edge.s('2d.visible') || edge.s('2d.visible') === undefined;
|
187
|
+
return isEdge(edge) && edge.getEdgeGroup() && edge.isEdgeGroupAgent();
|
210
188
|
}
|
211
189
|
/**
|
212
190
|
* 获得两个节点间的连线列表
|
@@ -275,12 +253,6 @@ function getEdgeGroupByNodeTags(dataModel, nodeTag1, nodeTag2) {
|
|
275
253
|
|
276
254
|
return getEdgeGroupByNodes(node1, node2);
|
277
255
|
}
|
278
|
-
/**
|
279
|
-
* 获得连线组连线列表
|
280
|
-
* @param {*} dataModel
|
281
|
-
* @returns
|
282
|
-
*/
|
283
|
-
|
284
256
|
|
285
257
|
function getEdgeGroups(dataModel) {
|
286
258
|
var edgeGroups = [];
|
@@ -293,21 +265,13 @@ function getEdgeGroups(dataModel) {
|
|
293
265
|
});
|
294
266
|
return edgeGroups;
|
295
267
|
}
|
296
|
-
/**
|
297
|
-
* 获得连线组连线列表
|
298
|
-
* @param {*} dataModel
|
299
|
-
* @returns
|
300
|
-
*/
|
301
|
-
|
302
268
|
|
303
269
|
function getEdgeGroupAgents(dataModel) {
|
304
270
|
return getEdges(dataModel).filter(isEdgeGroupAgent);
|
305
271
|
}
|
306
272
|
|
307
273
|
function getEdgeDatas(dataModel) {
|
308
|
-
return getEdges(dataModel).
|
309
|
-
return !isEdgeGroup(edge);
|
310
|
-
}).map(function (element) {
|
274
|
+
return getEdges(dataModel).map(function (element) {
|
311
275
|
var _element$getSource, _element$getTarget;
|
312
276
|
|
313
277
|
return (0, _extends3["default"])({}, element.getAttrObject(), {
|
package/lib/utils/topoData.js
CHANGED
@@ -231,7 +231,7 @@ function buildGlobal(_ref2) {
|
|
231
231
|
// 是否可编辑----控制[编辑]按钮
|
232
232
|
moveable: true,
|
233
233
|
// 节点是否可移动
|
234
|
-
toggleGroupByDblClick:
|
234
|
+
toggleGroupByDblClick: false
|
235
235
|
}, (result === null || result === void 0 ? void 0 : (_result$global2 = result.global) === null || _result$global2 === void 0 ? void 0 : _result$global2.control) || {}, (result === null || result === void 0 ? void 0 : (_result$customGlobal = result.customGlobal) === null || _result$customGlobal === void 0 ? void 0 : _result$customGlobal.control) || {}),
|
236
236
|
topoDisplayConfig: (0, _extends2["default"])({
|
237
237
|
// alarmSwitch: (result.global || {}).alarmSwitch ?? true,
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@riil-frontend/component-topology",
|
3
|
-
"version": "
|
3
|
+
"version": "13.0.0-dev.1",
|
4
4
|
"description": "拓扑",
|
5
5
|
"scripts": {
|
6
6
|
"start": "build-scripts start",
|
@@ -123,6 +123,6 @@
|
|
123
123
|
"access": "public"
|
124
124
|
},
|
125
125
|
"license": "MIT",
|
126
|
-
"homepage": "https://unpkg.com/@riil-frontend/component-topology@
|
126
|
+
"homepage": "https://unpkg.com/@riil-frontend/component-topology@13.0.0-dev.1/build/index.html",
|
127
127
|
"gitHead": "2da19ffccbb7ca60a8acf396e39f542c68bb33f5"
|
128
128
|
}
|
@@ -1,29 +0,0 @@
|
|
1
|
-
import React from 'react';
|
2
|
-
import DropdownMenu from "./DropdownMenu";
|
3
|
-
|
4
|
-
function FontFamilySelect(props) {
|
5
|
-
var value = props.value,
|
6
|
-
onChange = props.onChange;
|
7
|
-
var items = ['宋体', '微软雅黑', '黑体', 'Arial'];
|
8
|
-
return /*#__PURE__*/React.createElement(DropdownMenu, {
|
9
|
-
value: (items.includes(value) ? value : null) || '',
|
10
|
-
valueRender: function valueRender(val) {
|
11
|
-
return /*#__PURE__*/React.createElement("div", {
|
12
|
-
style: {
|
13
|
-
width: 48
|
14
|
-
}
|
15
|
-
}, val || '微软雅黑');
|
16
|
-
},
|
17
|
-
onSelect: onChange
|
18
|
-
}, items.map(function (item) {
|
19
|
-
return /*#__PURE__*/React.createElement(DropdownMenu.Item, {
|
20
|
-
key: item
|
21
|
-
}, /*#__PURE__*/React.createElement("div", {
|
22
|
-
style: {
|
23
|
-
fontFamily: item
|
24
|
-
}
|
25
|
-
}, item));
|
26
|
-
}));
|
27
|
-
}
|
28
|
-
|
29
|
-
export default FontFamilySelect;
|
@@ -1,29 +0,0 @@
|
|
1
|
-
import React from 'react';
|
2
|
-
import DropdownMenu from "./DropdownMenu";
|
3
|
-
|
4
|
-
function FontSizeSelect(props) {
|
5
|
-
var value = props.value,
|
6
|
-
disabled = props.disabled,
|
7
|
-
onChange = props.onChange;
|
8
|
-
var items = [12, 14, 16, 18, 20, 24, 30, 36, 48, 60, 80];
|
9
|
-
return /*#__PURE__*/React.createElement(DropdownMenu, {
|
10
|
-
value: "" + (value || ''),
|
11
|
-
valueRender: function valueRender(val) {
|
12
|
-
return /*#__PURE__*/React.createElement("div", {
|
13
|
-
style: {
|
14
|
-
width: 18
|
15
|
-
}
|
16
|
-
}, val || 20);
|
17
|
-
},
|
18
|
-
disabled: disabled,
|
19
|
-
onSelect: function onSelect(val) {
|
20
|
-
return onChange(parseInt(val, 10));
|
21
|
-
}
|
22
|
-
}, items.map(function (item) {
|
23
|
-
return /*#__PURE__*/React.createElement(DropdownMenu.Item, {
|
24
|
-
key: item
|
25
|
-
}, item);
|
26
|
-
}));
|
27
|
-
}
|
28
|
-
|
29
|
-
export default FontSizeSelect;
|