@riil-frontend/component-topology 4.0.15 → 4.0.16
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/TopoApp.js +1 -1
- package/es/topoCenter/components/editor/propertyViews/edge/addLinkDrawer/AddLinkDrawer.js +18 -17
- package/es/topoCenter/getTopoData.js +2 -6
- package/es/topoCenter/hooks/editor/useDeleteEdges.js +6 -5
- package/lib/core/models/TopoApp.js +1 -1
- package/lib/topoCenter/components/editor/propertyViews/edge/addLinkDrawer/AddLinkDrawer.js +18 -17
- package/lib/topoCenter/getTopoData.js +2 -6
- package/lib/topoCenter/hooks/editor/useDeleteEdges.js +6 -5
- package/package.json +2 -2
|
@@ -21,7 +21,7 @@ import PluginManager from "./PluginManager";
|
|
|
21
21
|
import topoFactory from "./topoFactory";
|
|
22
22
|
import ElementTagTipConfig from "./tagstips/ElementTagTipConfig"; // eslint-disable-next-line no-undef
|
|
23
23
|
|
|
24
|
-
var version = typeof "4.0.
|
|
24
|
+
var version = typeof "4.0.16" === 'string' ? "4.0.16" : null;
|
|
25
25
|
console.info("\u62D3\u6251\u7248\u672C: " + version);
|
|
26
26
|
/**
|
|
27
27
|
* 拓扑显示和编辑
|
|
@@ -447,8 +447,9 @@ function AddLinkDrawer(props) {
|
|
|
447
447
|
try {
|
|
448
448
|
// 获取两个节点间的连线数据列表
|
|
449
449
|
var edgesInNodes = getEdgesBetweenNodes(source, target);
|
|
450
|
+
var _isGroup = false; // linkType === "agg"
|
|
450
451
|
|
|
451
|
-
if (
|
|
452
|
+
if (_isGroup) {
|
|
452
453
|
// 聚合链路
|
|
453
454
|
if (edgesInNodes.length === 0) {
|
|
454
455
|
htTopo.createEdge(source, target, linkData);
|
|
@@ -547,9 +548,8 @@ function AddLinkDrawer(props) {
|
|
|
547
548
|
result = _context5.sent;
|
|
548
549
|
|
|
549
550
|
case 13:
|
|
550
|
-
setLoading(false);
|
|
551
551
|
linkType = data["network_link.connect_type"];
|
|
552
|
-
_context5.prev =
|
|
552
|
+
_context5.prev = 14;
|
|
553
553
|
|
|
554
554
|
if (!result) {
|
|
555
555
|
_context5.next = 55;
|
|
@@ -559,7 +559,7 @@ function AddLinkDrawer(props) {
|
|
|
559
559
|
config = topo.resourceConfig.getConfigFromHt(); // 新建后显示到图上
|
|
560
560
|
|
|
561
561
|
if (!isAddMode) {
|
|
562
|
-
_context5.next =
|
|
562
|
+
_context5.next = 30;
|
|
563
563
|
break;
|
|
564
564
|
}
|
|
565
565
|
|
|
@@ -573,10 +573,10 @@ function AddLinkDrawer(props) {
|
|
|
573
573
|
exportLinkIdList: exportLinkIdList
|
|
574
574
|
})); // const linkType = data["network_link.connect_type"];
|
|
575
575
|
|
|
576
|
-
_context5.next =
|
|
576
|
+
_context5.next = 23;
|
|
577
577
|
return editDispatchers.fetchDataByConfig();
|
|
578
578
|
|
|
579
|
-
case
|
|
579
|
+
case 23:
|
|
580
580
|
_yield$editDispatcher = _context5.sent;
|
|
581
581
|
elements = _yield$editDispatcher.elements;
|
|
582
582
|
linkData = elements.find(function (element) {
|
|
@@ -591,12 +591,12 @@ function AddLinkDrawer(props) {
|
|
|
591
591
|
|
|
592
592
|
_Message.success("创建成功");
|
|
593
593
|
|
|
594
|
-
_context5.next =
|
|
594
|
+
_context5.next = 52;
|
|
595
595
|
break;
|
|
596
596
|
|
|
597
|
-
case
|
|
597
|
+
case 30:
|
|
598
598
|
if (!(linkType === "exit")) {
|
|
599
|
-
_context5.next =
|
|
599
|
+
_context5.next = 45;
|
|
600
600
|
break;
|
|
601
601
|
}
|
|
602
602
|
|
|
@@ -622,27 +622,28 @@ function AddLinkDrawer(props) {
|
|
|
622
622
|
topoDispatchers.update({
|
|
623
623
|
data: newData
|
|
624
624
|
});
|
|
625
|
-
_context5.next =
|
|
625
|
+
_context5.next = 51;
|
|
626
626
|
break;
|
|
627
627
|
|
|
628
|
-
case
|
|
628
|
+
case 45:
|
|
629
629
|
_config = topo.resourceConfig.getConfigFromHt();
|
|
630
630
|
topo.resourceConfig.updateConfig(_config);
|
|
631
|
-
_context5.next =
|
|
631
|
+
_context5.next = 49;
|
|
632
632
|
return editDispatchers.fetchDataByConfig();
|
|
633
633
|
|
|
634
|
-
case
|
|
634
|
+
case 49:
|
|
635
635
|
_yield$editDispatcher2 = _context5.sent;
|
|
636
636
|
_elements = _yield$editDispatcher2.elements;
|
|
637
637
|
|
|
638
|
-
case
|
|
638
|
+
case 51:
|
|
639
639
|
_Message.success("保存成功");
|
|
640
640
|
|
|
641
|
-
case
|
|
641
|
+
case 52:
|
|
642
642
|
editDispatchers.update({
|
|
643
643
|
addLinkIsOpen: false,
|
|
644
644
|
currentLink: null
|
|
645
645
|
});
|
|
646
|
+
setLoading(false);
|
|
646
647
|
topo.linkDynamicStyleExecutor.execute();
|
|
647
648
|
|
|
648
649
|
case 55:
|
|
@@ -651,7 +652,7 @@ function AddLinkDrawer(props) {
|
|
|
651
652
|
|
|
652
653
|
case 57:
|
|
653
654
|
_context5.prev = 57;
|
|
654
|
-
_context5.t0 = _context5["catch"](
|
|
655
|
+
_context5.t0 = _context5["catch"](14);
|
|
655
656
|
rlog.debug("保存链路信息异常", _context5.t0);
|
|
656
657
|
|
|
657
658
|
case 60:
|
|
@@ -659,7 +660,7 @@ function AddLinkDrawer(props) {
|
|
|
659
660
|
return _context5.stop();
|
|
660
661
|
}
|
|
661
662
|
}
|
|
662
|
-
}, _callee5, null, [[
|
|
663
|
+
}, _callee5, null, [[14, 57]]);
|
|
663
664
|
}));
|
|
664
665
|
|
|
665
666
|
return function onSave(_x4) {
|
|
@@ -34,12 +34,8 @@ function _addLinkData() {
|
|
|
34
34
|
case 3:
|
|
35
35
|
links = _context.sent;
|
|
36
36
|
return _context.abrupt("return", {
|
|
37
|
-
links: links
|
|
38
|
-
|
|
39
|
-
}),
|
|
40
|
-
linkGroups: links.filter(function (link) {
|
|
41
|
-
return link.attributes['network_link.connect_type'] === 'agg';
|
|
42
|
-
})
|
|
37
|
+
links: links,
|
|
38
|
+
linkGroups: []
|
|
43
39
|
});
|
|
44
40
|
|
|
45
41
|
case 5:
|
|
@@ -42,14 +42,15 @@ export default (function (_ref) {
|
|
|
42
42
|
|
|
43
43
|
var doDeleteLink = /*#__PURE__*/function () {
|
|
44
44
|
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(link, edge) {
|
|
45
|
-
var id,
|
|
45
|
+
var id, isGroup, success, htTopo, edgesInNodes, edgeGroupData, edgeData, _topo$store$getModel, topoState, topoDispatchers, _topoState$data, links, linkGroups;
|
|
46
46
|
|
|
47
47
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
48
48
|
while (1) {
|
|
49
49
|
switch (_context.prev = _context.next) {
|
|
50
50
|
case 0:
|
|
51
51
|
id = link.id;
|
|
52
|
-
|
|
52
|
+
isGroup = false; // isAggLink(link);
|
|
53
|
+
|
|
53
54
|
_context.next = 4;
|
|
54
55
|
return linkService.deleteLink(id);
|
|
55
56
|
|
|
@@ -73,7 +74,7 @@ export default (function (_ref) {
|
|
|
73
74
|
edgesInNodes = htTopo.getEdgeDatasInNodes(edge.getSource(), edge.getTarget());
|
|
74
75
|
|
|
75
76
|
if (edgesInNodes.length >= 2) {
|
|
76
|
-
if (
|
|
77
|
+
if (isGroup) {
|
|
77
78
|
htTopo.setEdgeGroupData(edge.getSource(), edge.getTarget(), null);
|
|
78
79
|
} else {
|
|
79
80
|
htTopo.deleteEdge(edge);
|
|
@@ -83,10 +84,10 @@ export default (function (_ref) {
|
|
|
83
84
|
edgeGroupData = htTopo.getEdgeGroupData(edge.getSource(), edge.getTarget());
|
|
84
85
|
edgeData = htTopo.getEdgeData(edge);
|
|
85
86
|
|
|
86
|
-
if (
|
|
87
|
+
if (isGroup && edgeData) {
|
|
87
88
|
// 当前是连线组代理 且 有连线数据,清空组数据
|
|
88
89
|
htTopo.setEdgeGroupData(edge.getSource(), edge.getTarget(), null);
|
|
89
|
-
} else if (!
|
|
90
|
+
} else if (!isGroup && edgeGroupData) {
|
|
90
91
|
htTopo.setEdgeData(edge, null);
|
|
91
92
|
} else {
|
|
92
93
|
htTopo.deleteEdge(edge);
|
|
@@ -50,7 +50,7 @@ var _topoFactory = _interopRequireDefault(require("./topoFactory"));
|
|
|
50
50
|
var _ElementTagTipConfig = _interopRequireDefault(require("./tagstips/ElementTagTipConfig"));
|
|
51
51
|
|
|
52
52
|
// eslint-disable-next-line no-undef
|
|
53
|
-
var version = typeof "4.0.
|
|
53
|
+
var version = typeof "4.0.16" === 'string' ? "4.0.16" : null;
|
|
54
54
|
console.info("\u62D3\u6251\u7248\u672C: " + version);
|
|
55
55
|
/**
|
|
56
56
|
* 拓扑显示和编辑
|
|
@@ -478,8 +478,9 @@ function AddLinkDrawer(props) {
|
|
|
478
478
|
try {
|
|
479
479
|
// 获取两个节点间的连线数据列表
|
|
480
480
|
var edgesInNodes = (0, _htElementUtils.getEdgesBetweenNodes)(source, target);
|
|
481
|
+
var _isGroup = false; // linkType === "agg"
|
|
481
482
|
|
|
482
|
-
if (
|
|
483
|
+
if (_isGroup) {
|
|
483
484
|
// 聚合链路
|
|
484
485
|
if (edgesInNodes.length === 0) {
|
|
485
486
|
htTopo.createEdge(source, target, linkData);
|
|
@@ -578,9 +579,8 @@ function AddLinkDrawer(props) {
|
|
|
578
579
|
result = _context5.sent;
|
|
579
580
|
|
|
580
581
|
case 13:
|
|
581
|
-
setLoading(false);
|
|
582
582
|
linkType = data["network_link.connect_type"];
|
|
583
|
-
_context5.prev =
|
|
583
|
+
_context5.prev = 14;
|
|
584
584
|
|
|
585
585
|
if (!result) {
|
|
586
586
|
_context5.next = 55;
|
|
@@ -590,7 +590,7 @@ function AddLinkDrawer(props) {
|
|
|
590
590
|
config = topo.resourceConfig.getConfigFromHt(); // 新建后显示到图上
|
|
591
591
|
|
|
592
592
|
if (!isAddMode) {
|
|
593
|
-
_context5.next =
|
|
593
|
+
_context5.next = 30;
|
|
594
594
|
break;
|
|
595
595
|
}
|
|
596
596
|
|
|
@@ -604,10 +604,10 @@ function AddLinkDrawer(props) {
|
|
|
604
604
|
exportLinkIdList: exportLinkIdList
|
|
605
605
|
})); // const linkType = data["network_link.connect_type"];
|
|
606
606
|
|
|
607
|
-
_context5.next =
|
|
607
|
+
_context5.next = 23;
|
|
608
608
|
return editDispatchers.fetchDataByConfig();
|
|
609
609
|
|
|
610
|
-
case
|
|
610
|
+
case 23:
|
|
611
611
|
_yield$editDispatcher = _context5.sent;
|
|
612
612
|
elements = _yield$editDispatcher.elements;
|
|
613
613
|
linkData = elements.find(function (element) {
|
|
@@ -622,12 +622,12 @@ function AddLinkDrawer(props) {
|
|
|
622
622
|
|
|
623
623
|
_message["default"].success("创建成功");
|
|
624
624
|
|
|
625
|
-
_context5.next =
|
|
625
|
+
_context5.next = 52;
|
|
626
626
|
break;
|
|
627
627
|
|
|
628
|
-
case
|
|
628
|
+
case 30:
|
|
629
629
|
if (!(linkType === "exit")) {
|
|
630
|
-
_context5.next =
|
|
630
|
+
_context5.next = 45;
|
|
631
631
|
break;
|
|
632
632
|
}
|
|
633
633
|
|
|
@@ -653,27 +653,28 @@ function AddLinkDrawer(props) {
|
|
|
653
653
|
topoDispatchers.update({
|
|
654
654
|
data: newData
|
|
655
655
|
});
|
|
656
|
-
_context5.next =
|
|
656
|
+
_context5.next = 51;
|
|
657
657
|
break;
|
|
658
658
|
|
|
659
|
-
case
|
|
659
|
+
case 45:
|
|
660
660
|
_config = topo.resourceConfig.getConfigFromHt();
|
|
661
661
|
topo.resourceConfig.updateConfig(_config);
|
|
662
|
-
_context5.next =
|
|
662
|
+
_context5.next = 49;
|
|
663
663
|
return editDispatchers.fetchDataByConfig();
|
|
664
664
|
|
|
665
|
-
case
|
|
665
|
+
case 49:
|
|
666
666
|
_yield$editDispatcher2 = _context5.sent;
|
|
667
667
|
_elements = _yield$editDispatcher2.elements;
|
|
668
668
|
|
|
669
|
-
case
|
|
669
|
+
case 51:
|
|
670
670
|
_message["default"].success("保存成功");
|
|
671
671
|
|
|
672
|
-
case
|
|
672
|
+
case 52:
|
|
673
673
|
editDispatchers.update({
|
|
674
674
|
addLinkIsOpen: false,
|
|
675
675
|
currentLink: null
|
|
676
676
|
});
|
|
677
|
+
setLoading(false);
|
|
677
678
|
topo.linkDynamicStyleExecutor.execute();
|
|
678
679
|
|
|
679
680
|
case 55:
|
|
@@ -682,7 +683,7 @@ function AddLinkDrawer(props) {
|
|
|
682
683
|
|
|
683
684
|
case 57:
|
|
684
685
|
_context5.prev = 57;
|
|
685
|
-
_context5.t0 = _context5["catch"](
|
|
686
|
+
_context5.t0 = _context5["catch"](14);
|
|
686
687
|
|
|
687
688
|
_rlog["default"].debug("保存链路信息异常", _context5.t0);
|
|
688
689
|
|
|
@@ -691,7 +692,7 @@ function AddLinkDrawer(props) {
|
|
|
691
692
|
return _context5.stop();
|
|
692
693
|
}
|
|
693
694
|
}
|
|
694
|
-
}, _callee5, null, [[
|
|
695
|
+
}, _callee5, null, [[14, 57]]);
|
|
695
696
|
}));
|
|
696
697
|
|
|
697
698
|
return function onSave(_x4) {
|
|
@@ -51,12 +51,8 @@ function _addLinkData() {
|
|
|
51
51
|
case 3:
|
|
52
52
|
links = _context.sent;
|
|
53
53
|
return _context.abrupt("return", {
|
|
54
|
-
links: links
|
|
55
|
-
|
|
56
|
-
}),
|
|
57
|
-
linkGroups: links.filter(function (link) {
|
|
58
|
-
return link.attributes['network_link.connect_type'] === 'agg';
|
|
59
|
-
})
|
|
54
|
+
links: links,
|
|
55
|
+
linkGroups: []
|
|
60
56
|
});
|
|
61
57
|
|
|
62
58
|
case 5:
|
|
@@ -57,14 +57,15 @@ var _default = function _default(_ref) {
|
|
|
57
57
|
|
|
58
58
|
var doDeleteLink = /*#__PURE__*/function () {
|
|
59
59
|
var _ref2 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee(link, edge) {
|
|
60
|
-
var id,
|
|
60
|
+
var id, isGroup, success, htTopo, edgesInNodes, edgeGroupData, edgeData, _topo$store$getModel, topoState, topoDispatchers, _topoState$data, links, linkGroups;
|
|
61
61
|
|
|
62
62
|
return _regenerator["default"].wrap(function _callee$(_context) {
|
|
63
63
|
while (1) {
|
|
64
64
|
switch (_context.prev = _context.next) {
|
|
65
65
|
case 0:
|
|
66
66
|
id = link.id;
|
|
67
|
-
|
|
67
|
+
isGroup = false; // isAggLink(link);
|
|
68
|
+
|
|
68
69
|
_context.next = 4;
|
|
69
70
|
return _link["default"].deleteLink(id);
|
|
70
71
|
|
|
@@ -88,7 +89,7 @@ var _default = function _default(_ref) {
|
|
|
88
89
|
edgesInNodes = htTopo.getEdgeDatasInNodes(edge.getSource(), edge.getTarget());
|
|
89
90
|
|
|
90
91
|
if (edgesInNodes.length >= 2) {
|
|
91
|
-
if (
|
|
92
|
+
if (isGroup) {
|
|
92
93
|
htTopo.setEdgeGroupData(edge.getSource(), edge.getTarget(), null);
|
|
93
94
|
} else {
|
|
94
95
|
htTopo.deleteEdge(edge);
|
|
@@ -98,10 +99,10 @@ var _default = function _default(_ref) {
|
|
|
98
99
|
edgeGroupData = htTopo.getEdgeGroupData(edge.getSource(), edge.getTarget());
|
|
99
100
|
edgeData = htTopo.getEdgeData(edge);
|
|
100
101
|
|
|
101
|
-
if (
|
|
102
|
+
if (isGroup && edgeData) {
|
|
102
103
|
// 当前是连线组代理 且 有连线数据,清空组数据
|
|
103
104
|
htTopo.setEdgeGroupData(edge.getSource(), edge.getTarget(), null);
|
|
104
|
-
} else if (!
|
|
105
|
+
} else if (!isGroup && edgeGroupData) {
|
|
105
106
|
htTopo.setEdgeData(edge, null);
|
|
106
107
|
} else {
|
|
107
108
|
htTopo.deleteEdge(edge);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@riil-frontend/component-topology",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.16",
|
|
4
4
|
"description": "拓扑",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"start": "build-scripts start",
|
|
@@ -114,6 +114,6 @@
|
|
|
114
114
|
"access": "public"
|
|
115
115
|
},
|
|
116
116
|
"license": "MIT",
|
|
117
|
-
"homepage": "https://unpkg.com/@riil-frontend/component-topology@4.0.
|
|
117
|
+
"homepage": "https://unpkg.com/@riil-frontend/component-topology@4.0.16/build/index.html",
|
|
118
118
|
"gitHead": "2da19ffccbb7ca60a8acf396e39f542c68bb33f5"
|
|
119
119
|
}
|