@riil-frontend/component-topology 2.15.28 → 2.15.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/index.js +1 -1
- package/es/core/models/AttributeMetricDisplay.js +18 -12
- package/es/core/models/TopoApp.js +1 -1
- package/es/topoCenter/components/editor/propertyViews/edge/addLinkDrawer/AddLinkDrawer.js +10 -9
- package/lib/core/models/AttributeMetricDisplay.js +17 -12
- package/lib/core/models/TopoApp.js +1 -1
- package/lib/topoCenter/components/editor/propertyViews/edge/addLinkDrawer/AddLinkDrawer.js +10 -9
- package/package.json +3 -2
|
@@ -340,16 +340,20 @@ var AttributeMetricDisplay = /*#__PURE__*/function () {
|
|
|
340
340
|
/*#__PURE__*/
|
|
341
341
|
function () {
|
|
342
342
|
var _fetchData = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
|
343
|
-
var
|
|
344
|
-
|
|
345
|
-
var topo, _topo$store$getState$, resIdsList, nodeIdsList, codes, param, linkAdapter, result;
|
|
343
|
+
var topo, _topo$store$getState$, resIdsList, nodeIdsList, codes, param, transformLinkData, result;
|
|
346
344
|
|
|
347
345
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
348
346
|
while (1) {
|
|
349
347
|
switch (_context.prev = _context.next) {
|
|
350
348
|
case 0:
|
|
351
|
-
|
|
352
|
-
var
|
|
349
|
+
transformLinkData = function _transformLinkData(data) {
|
|
350
|
+
var _topo$dataModel$getDa = topo.dataModel.getData(),
|
|
351
|
+
links = _topo$dataModel$getDa.links,
|
|
352
|
+
linkGroups = _topo$dataModel$getDa.linkGroups;
|
|
353
|
+
|
|
354
|
+
var link = [].concat(links, linkGroups).find(function (item) {
|
|
355
|
+
return item.id === data.id;
|
|
356
|
+
});
|
|
353
357
|
|
|
354
358
|
if (!link) {
|
|
355
359
|
return data;
|
|
@@ -411,10 +415,12 @@ var AttributeMetricDisplay = /*#__PURE__*/function () {
|
|
|
411
415
|
return map;
|
|
412
416
|
};
|
|
413
417
|
|
|
414
|
-
var resultData =
|
|
418
|
+
var resultData = _extends({}, data, {
|
|
415
419
|
attributeMap: list2map(data.attributes),
|
|
416
420
|
metricMap: list2map(data.metrics)
|
|
417
|
-
})
|
|
421
|
+
});
|
|
422
|
+
|
|
423
|
+
resultData = transformLinkData(resultData); // 特殊处理:ipv6 从ipv6_address_list取第一个
|
|
418
424
|
|
|
419
425
|
// 特殊处理:ipv6 从ipv6_address_list取第一个
|
|
420
426
|
if (resultData.attributeMap.ipv6_address_list && !resultData.attributeMap.ipv6_address) {
|
|
@@ -507,7 +513,7 @@ var AttributeMetricDisplay = /*#__PURE__*/function () {
|
|
|
507
513
|
/*#__PURE__*/
|
|
508
514
|
function () {
|
|
509
515
|
var _translateRefAttribute = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3(ciDatas) {
|
|
510
|
-
var
|
|
516
|
+
var _this4 = this;
|
|
511
517
|
|
|
512
518
|
var refIdMap, ciRefAttributeMap, refIds, refCis, refCiMap;
|
|
513
519
|
return _regeneratorRuntime.wrap(function _callee3$(_context3) {
|
|
@@ -523,7 +529,7 @@ var AttributeMetricDisplay = /*#__PURE__*/function () {
|
|
|
523
529
|
attributeMap = ciData.attributeMap;
|
|
524
530
|
ciRefAttributeMap[id] = [];
|
|
525
531
|
|
|
526
|
-
var ciTypeMeta =
|
|
532
|
+
var ciTypeMeta = _this4.topo.ciTyeCache.getCiType(ciType);
|
|
527
533
|
|
|
528
534
|
if (ciTypeMeta) {
|
|
529
535
|
ciTypeMeta.attributes.filter(function (attributeMeta) {
|
|
@@ -677,7 +683,7 @@ var AttributeMetricDisplay = /*#__PURE__*/function () {
|
|
|
677
683
|
;
|
|
678
684
|
|
|
679
685
|
_proto.getEdgeGroupTagsAndTips = function getEdgeGroupTagsAndTips(data, ciConfigs) {
|
|
680
|
-
var
|
|
686
|
+
var _this5 = this;
|
|
681
687
|
|
|
682
688
|
// 查询没有关联链路的连线组及对应子链路列表
|
|
683
689
|
var _this$topo$dataModel$ = this.topo.dataModel.getData(),
|
|
@@ -776,7 +782,7 @@ var AttributeMetricDisplay = /*#__PURE__*/function () {
|
|
|
776
782
|
var edgeGroupsTagsTips = Object.keys(groupMap) // 过滤非连线组
|
|
777
783
|
.filter(function (groupId) {
|
|
778
784
|
var linkChildren = groupMap[groupId];
|
|
779
|
-
var edgeGroup = getEdgeGroupByNodeTags(
|
|
785
|
+
var edgeGroup = getEdgeGroupByNodeTags(_this5.topo.getDataModel(), linkChildren[0].source, linkChildren[0].target);
|
|
780
786
|
return !!edgeGroup;
|
|
781
787
|
}).map(function (groupId) {
|
|
782
788
|
var linkChildren = groupMap[groupId]; // 查询配置,过滤不在范围内的属性
|
|
@@ -817,7 +823,7 @@ var AttributeMetricDisplay = /*#__PURE__*/function () {
|
|
|
817
823
|
}); // console.error(groupId, {config, linkChildrenData, mergeData})
|
|
818
824
|
// 构造标注、悬浮框数据
|
|
819
825
|
|
|
820
|
-
var formatter = new AttributeFormatter(
|
|
826
|
+
var formatter = new AttributeFormatter(_this5.topo);
|
|
821
827
|
return {
|
|
822
828
|
type: 'edgeGroup',
|
|
823
829
|
edgeGroupId: groupId,
|
|
@@ -20,7 +20,7 @@ import { updateEdgeExpanded } from "../utils/edgeUtil";
|
|
|
20
20
|
import PluginManager from "./PluginManager";
|
|
21
21
|
import topoFactory from "./topoFactory"; // eslint-disable-next-line no-undef
|
|
22
22
|
|
|
23
|
-
var version = typeof "2.15.
|
|
23
|
+
var version = typeof "2.15.31" === 'string' ? "2.15.31" : null;
|
|
24
24
|
console.info("\u62D3\u6251\u7248\u672C: " + version);
|
|
25
25
|
/**
|
|
26
26
|
* 拓扑显示和编辑
|
|
@@ -341,15 +341,16 @@ function AddLinkDrawer(props) {
|
|
|
341
341
|
htTopo.toggleEdgeGroup(source, target, false);
|
|
342
342
|
} else {
|
|
343
343
|
// 物理、出口链路
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
htTopo.
|
|
344
|
+
// 有连线组无子连线时,设置连线数据,切换到连线并选中
|
|
345
|
+
// 注释代码,因为 createEdge 内置该逻辑
|
|
346
|
+
// const firstEdge = edgesInNodes[0]
|
|
347
|
+
// if (edgesInNodes.length === 1 && !htTopo.getEdgeData(firstEdge)) {
|
|
348
|
+
// htTopo.setEdgeData(firstEdge, linkData);
|
|
349
|
+
// } else {
|
|
350
|
+
// htTopo.createEdge(source, target, linkData);
|
|
351
|
+
// }
|
|
352
|
+
var edge = htTopo.createEdge(source, target, linkData);
|
|
353
|
+
console.error(edge); // htTopo.toggleEdgeGroup(source, target, true);
|
|
353
354
|
} // TODO 选中
|
|
354
355
|
|
|
355
356
|
|
|
@@ -359,16 +359,20 @@ var AttributeMetricDisplay = /*#__PURE__*/function () {
|
|
|
359
359
|
/*#__PURE__*/
|
|
360
360
|
function () {
|
|
361
361
|
var _fetchData = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee() {
|
|
362
|
-
var
|
|
363
|
-
|
|
364
|
-
var topo, _topo$store$getState$, resIdsList, nodeIdsList, codes, param, linkAdapter, result;
|
|
362
|
+
var topo, _topo$store$getState$, resIdsList, nodeIdsList, codes, param, transformLinkData, result;
|
|
365
363
|
|
|
366
364
|
return _regenerator["default"].wrap(function _callee$(_context) {
|
|
367
365
|
while (1) {
|
|
368
366
|
switch (_context.prev = _context.next) {
|
|
369
367
|
case 0:
|
|
370
|
-
|
|
371
|
-
var
|
|
368
|
+
transformLinkData = function _transformLinkData(data) {
|
|
369
|
+
var _topo$dataModel$getDa = topo.dataModel.getData(),
|
|
370
|
+
links = _topo$dataModel$getDa.links,
|
|
371
|
+
linkGroups = _topo$dataModel$getDa.linkGroups;
|
|
372
|
+
|
|
373
|
+
var link = [].concat(links, linkGroups).find(function (item) {
|
|
374
|
+
return item.id === data.id;
|
|
375
|
+
});
|
|
372
376
|
|
|
373
377
|
if (!link) {
|
|
374
378
|
return data;
|
|
@@ -430,10 +434,11 @@ var AttributeMetricDisplay = /*#__PURE__*/function () {
|
|
|
430
434
|
return map;
|
|
431
435
|
};
|
|
432
436
|
|
|
433
|
-
var resultData =
|
|
437
|
+
var resultData = (0, _extends2["default"])({}, data, {
|
|
434
438
|
attributeMap: list2map(data.attributes),
|
|
435
439
|
metricMap: list2map(data.metrics)
|
|
436
|
-
})
|
|
440
|
+
});
|
|
441
|
+
resultData = transformLinkData(resultData); // 特殊处理:ipv6 从ipv6_address_list取第一个
|
|
437
442
|
|
|
438
443
|
// 特殊处理:ipv6 从ipv6_address_list取第一个
|
|
439
444
|
if (resultData.attributeMap.ipv6_address_list && !resultData.attributeMap.ipv6_address) {
|
|
@@ -526,7 +531,7 @@ var AttributeMetricDisplay = /*#__PURE__*/function () {
|
|
|
526
531
|
/*#__PURE__*/
|
|
527
532
|
function () {
|
|
528
533
|
var _translateRefAttribute = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee3(ciDatas) {
|
|
529
|
-
var
|
|
534
|
+
var _this4 = this;
|
|
530
535
|
|
|
531
536
|
var refIdMap, ciRefAttributeMap, refIds, refCis, refCiMap;
|
|
532
537
|
return _regenerator["default"].wrap(function _callee3$(_context3) {
|
|
@@ -542,7 +547,7 @@ var AttributeMetricDisplay = /*#__PURE__*/function () {
|
|
|
542
547
|
attributeMap = ciData.attributeMap;
|
|
543
548
|
ciRefAttributeMap[id] = [];
|
|
544
549
|
|
|
545
|
-
var ciTypeMeta =
|
|
550
|
+
var ciTypeMeta = _this4.topo.ciTyeCache.getCiType(ciType);
|
|
546
551
|
|
|
547
552
|
if (ciTypeMeta) {
|
|
548
553
|
ciTypeMeta.attributes.filter(function (attributeMeta) {
|
|
@@ -697,7 +702,7 @@ var AttributeMetricDisplay = /*#__PURE__*/function () {
|
|
|
697
702
|
;
|
|
698
703
|
|
|
699
704
|
_proto.getEdgeGroupTagsAndTips = function getEdgeGroupTagsAndTips(data, ciConfigs) {
|
|
700
|
-
var
|
|
705
|
+
var _this5 = this;
|
|
701
706
|
|
|
702
707
|
// 查询没有关联链路的连线组及对应子链路列表
|
|
703
708
|
var _this$topo$dataModel$ = this.topo.dataModel.getData(),
|
|
@@ -796,7 +801,7 @@ var AttributeMetricDisplay = /*#__PURE__*/function () {
|
|
|
796
801
|
var edgeGroupsTagsTips = Object.keys(groupMap) // 过滤非连线组
|
|
797
802
|
.filter(function (groupId) {
|
|
798
803
|
var linkChildren = groupMap[groupId];
|
|
799
|
-
var edgeGroup = (0, _htElementUtils.getEdgeGroupByNodeTags)(
|
|
804
|
+
var edgeGroup = (0, _htElementUtils.getEdgeGroupByNodeTags)(_this5.topo.getDataModel(), linkChildren[0].source, linkChildren[0].target);
|
|
800
805
|
return !!edgeGroup;
|
|
801
806
|
}).map(function (groupId) {
|
|
802
807
|
var linkChildren = groupMap[groupId]; // 查询配置,过滤不在范围内的属性
|
|
@@ -837,7 +842,7 @@ var AttributeMetricDisplay = /*#__PURE__*/function () {
|
|
|
837
842
|
}); // console.error(groupId, {config, linkChildrenData, mergeData})
|
|
838
843
|
// 构造标注、悬浮框数据
|
|
839
844
|
|
|
840
|
-
var formatter = new _attributeFormatter["default"](
|
|
845
|
+
var formatter = new _attributeFormatter["default"](_this5.topo);
|
|
841
846
|
return {
|
|
842
847
|
type: 'edgeGroup',
|
|
843
848
|
edgeGroupId: groupId,
|
|
@@ -48,7 +48,7 @@ var _PluginManager = _interopRequireDefault(require("./PluginManager"));
|
|
|
48
48
|
var _topoFactory = _interopRequireDefault(require("./topoFactory"));
|
|
49
49
|
|
|
50
50
|
// eslint-disable-next-line no-undef
|
|
51
|
-
var version = typeof "2.15.
|
|
51
|
+
var version = typeof "2.15.31" === 'string' ? "2.15.31" : null;
|
|
52
52
|
console.info("\u62D3\u6251\u7248\u672C: " + version);
|
|
53
53
|
/**
|
|
54
54
|
* 拓扑显示和编辑
|
|
@@ -382,15 +382,16 @@ function AddLinkDrawer(props) {
|
|
|
382
382
|
htTopo.toggleEdgeGroup(source, target, false);
|
|
383
383
|
} else {
|
|
384
384
|
// 物理、出口链路
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
htTopo.
|
|
385
|
+
// 有连线组无子连线时,设置连线数据,切换到连线并选中
|
|
386
|
+
// 注释代码,因为 createEdge 内置该逻辑
|
|
387
|
+
// const firstEdge = edgesInNodes[0]
|
|
388
|
+
// if (edgesInNodes.length === 1 && !htTopo.getEdgeData(firstEdge)) {
|
|
389
|
+
// htTopo.setEdgeData(firstEdge, linkData);
|
|
390
|
+
// } else {
|
|
391
|
+
// htTopo.createEdge(source, target, linkData);
|
|
392
|
+
// }
|
|
393
|
+
var edge = htTopo.createEdge(source, target, linkData);
|
|
394
|
+
console.error(edge); // htTopo.toggleEdgeGroup(source, target, true);
|
|
394
395
|
} // TODO 选中
|
|
395
396
|
|
|
396
397
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@riil-frontend/component-topology",
|
|
3
|
-
"version": "2.15.
|
|
3
|
+
"version": "2.15.31",
|
|
4
4
|
"description": "拓扑",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"start": "build-scripts start",
|
|
@@ -43,6 +43,7 @@
|
|
|
43
43
|
"@ice/store": "^1.4.2",
|
|
44
44
|
"@riil-frontend/component-topo-icon-select": "^1.0.10",
|
|
45
45
|
"@riil-frontend/component-topology-utils": "^2.0.20-alpha.0",
|
|
46
|
+
"resize-observer-polyfill": "^1.5.1",
|
|
46
47
|
"classnames": "^2.2.3",
|
|
47
48
|
"prop-types": "^15.5.8",
|
|
48
49
|
"react-color": "^2.19.3",
|
|
@@ -110,6 +111,6 @@
|
|
|
110
111
|
"access": "public"
|
|
111
112
|
},
|
|
112
113
|
"license": "MIT",
|
|
113
|
-
"homepage": "https://unpkg.com/@riil-frontend/component-topology@2.15.
|
|
114
|
+
"homepage": "https://unpkg.com/@riil-frontend/component-topology@2.15.31/build/index.html",
|
|
114
115
|
"gitHead": "2da19ffccbb7ca60a8acf396e39f542c68bb33f5"
|
|
115
116
|
}
|