@riil-frontend/component-topology 9.0.0-a.10 → 9.0.0-a.12
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 +2 -2
- package/build/2.js +1 -1
- package/build/index.css +1 -1
- package/build/index.js +17 -17
- package/es/components/VerticalIconTab/VerticalIconTab.module.scss +11 -5
- package/es/core/editor/components/BackgroundView/index.module.scss +3 -0
- package/es/core/editor/components/Sidebar/Sidebar.module.scss +7 -7
- package/es/core/editor/components/Sidebar/views/CanvasPanel/CanvasPanel.module.scss +1 -0
- package/es/core/editor/components/Sidebar/views/ComponentPanel.js +1 -1
- package/es/core/editor/components/Sidebar/views/ImagePanel/ImagePanel.js +2 -1
- package/es/core/editor/components/Sidebar/views/LinkPanel.js +1 -1
- package/es/core/editor/components/settings/core/updateElementProperty.js +6 -1
- package/es/core/editor/components/settings/propertyViews/node/data/BindIpInput.js +61 -0
- package/es/core/editor/components/settings/propertyViews/node/data/Data.js +27 -8
- package/es/core/hooks/useTopoEdit.js +133 -16
- package/es/core/models/TopoApp.js +1 -1
- package/es/core/models/utils/linkUtils.js +18 -0
- package/es/core/store/models/topoConfig.js +36 -7
- package/es/core/test/Test.js +52 -0
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/ResourceOverview.js +7 -78
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/hooks/useMetricPolling.js +27 -37
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/services/index.js +57 -1
- package/es/networkTopo/services/link.js +1 -1
- package/es/networkTopo/services/topo/basic.js +4 -3
- package/es/networkTopo/services/topo/networkLink.js +45 -3
- package/es/networkTopo/utils/exitLinkUtil.js +110 -0
- package/es/utils/htElementUtils.js +43 -21
- package/lib/components/VerticalIconTab/VerticalIconTab.module.scss +11 -5
- package/lib/core/editor/components/BackgroundView/index.module.scss +3 -0
- package/lib/core/editor/components/Sidebar/Sidebar.module.scss +7 -7
- package/lib/core/editor/components/Sidebar/views/CanvasPanel/CanvasPanel.module.scss +1 -0
- package/lib/core/editor/components/Sidebar/views/ComponentPanel.js +1 -1
- package/lib/core/editor/components/Sidebar/views/ImagePanel/ImagePanel.js +2 -1
- package/lib/core/editor/components/Sidebar/views/LinkPanel.js +1 -1
- package/lib/core/editor/components/settings/core/updateElementProperty.js +6 -1
- package/lib/core/editor/components/settings/propertyViews/node/data/BindIpInput.js +74 -0
- package/lib/core/editor/components/settings/propertyViews/node/data/Data.js +28 -8
- package/lib/core/hooks/useTopoEdit.js +133 -15
- package/lib/core/models/TopoApp.js +1 -1
- package/lib/core/models/utils/linkUtils.js +21 -1
- package/lib/core/store/models/topoConfig.js +37 -7
- package/lib/core/test/Test.js +52 -0
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/ResourceOverview.js +6 -78
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/hooks/useMetricPolling.js +27 -36
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/services/index.js +58 -1
- package/lib/networkTopo/services/topo/basic.js +5 -3
- package/lib/networkTopo/services/topo/networkLink.js +45 -3
- package/lib/networkTopo/utils/exitLinkUtil.js +115 -0
- package/lib/utils/htElementUtils.js +45 -21
- package/package.json +2 -2
@@ -10,6 +10,7 @@ exports.queryLastestValue = queryLastestValue;
|
|
10
10
|
exports.queryLatestMetrics = queryLatestMetrics;
|
11
11
|
exports.queryLinkInterfacesLatestMetrics = queryLinkInterfacesLatestMetrics;
|
12
12
|
exports.queryLinkLatestMetrics = queryLinkLatestMetrics;
|
13
|
+
exports.queryRetansRatioNetDelayRatio = queryRetansRatioNetDelayRatio;
|
13
14
|
|
14
15
|
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
15
16
|
|
@@ -276,7 +277,7 @@ function isOpenFlow(_x6) {
|
|
276
277
|
return _isOpenFlow.apply(this, arguments);
|
277
278
|
}
|
278
279
|
/**
|
279
|
-
* @name
|
280
|
+
* @name queryLastestValue 查指标值
|
280
281
|
* @returns
|
281
282
|
*/
|
282
283
|
|
@@ -319,4 +320,60 @@ function _queryLastestValue() {
|
|
319
320
|
}, _callee7);
|
320
321
|
}));
|
321
322
|
return _queryLastestValue.apply(this, arguments);
|
323
|
+
}
|
324
|
+
|
325
|
+
function queryRetansRatioNetDelayRatio(_x8, _x9) {
|
326
|
+
return _queryRetansRatioNetDelayRatio.apply(this, arguments);
|
327
|
+
}
|
328
|
+
|
329
|
+
function _queryRetansRatioNetDelayRatio() {
|
330
|
+
_queryRetansRatioNetDelayRatio = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee8(params, retansRatioNetDelayRatioCodes) {
|
331
|
+
var result, linkOther;
|
332
|
+
return _regenerator["default"].wrap(function _callee8$(_context8) {
|
333
|
+
while (1) {
|
334
|
+
switch (_context8.prev = _context8.next) {
|
335
|
+
case 0:
|
336
|
+
if (retansRatioNetDelayRatioCodes.length) {
|
337
|
+
_context8.next = 2;
|
338
|
+
break;
|
339
|
+
}
|
340
|
+
|
341
|
+
return _context8.abrupt("return", []);
|
342
|
+
|
343
|
+
case 2:
|
344
|
+
_context8.next = 4;
|
345
|
+
return queryLastestValue(params);
|
346
|
+
|
347
|
+
case 4:
|
348
|
+
result = _context8.sent;
|
349
|
+
linkOther = [];
|
350
|
+
|
351
|
+
if (retansRatioNetDelayRatioCodes.includes('netDelayRatio')) {
|
352
|
+
linkOther.push({
|
353
|
+
'code': 'netDelayRatio',
|
354
|
+
'name': '下行RTT时延',
|
355
|
+
'ts': result.time,
|
356
|
+
'value': (result.upNetDelayRatio * 1).toFixed() + ' ms' + '|' + (result.downNetDelayRatio * 1).toFixed() + ' ms'
|
357
|
+
});
|
358
|
+
}
|
359
|
+
|
360
|
+
if (retansRatioNetDelayRatioCodes.includes('retansRatio')) {
|
361
|
+
linkOther.push({
|
362
|
+
'code': 'retansRatio',
|
363
|
+
'name': '重传率',
|
364
|
+
'ts': result.time,
|
365
|
+
'value': (result.upRetransRatio * 1).toFixed() + ' %' + '|' + (result.downRetansRatio * 1).toFixed() + ' %'
|
366
|
+
});
|
367
|
+
}
|
368
|
+
|
369
|
+
return _context8.abrupt("return", linkOther);
|
370
|
+
|
371
|
+
case 9:
|
372
|
+
case "end":
|
373
|
+
return _context8.stop();
|
374
|
+
}
|
375
|
+
}
|
376
|
+
}, _callee8);
|
377
|
+
}));
|
378
|
+
return _queryRetansRatioNetDelayRatio.apply(this, arguments);
|
322
379
|
}
|
@@ -25,6 +25,8 @@ var _cmdb = require("../cmdb");
|
|
25
25
|
|
26
26
|
var _model = require("../model");
|
27
27
|
|
28
|
+
var _exitLinkUtil = require("../../utils/exitLinkUtil");
|
29
|
+
|
28
30
|
var _excluded = ["groups", "resources"];
|
29
31
|
var API_ROOT = _constants.TOPO_API_ROOT;
|
30
32
|
/**
|
@@ -432,13 +434,13 @@ var _default = (0, _extends2["default"])({
|
|
432
434
|
|
433
435
|
case 3:
|
434
436
|
result = _context12.sent;
|
435
|
-
return _context12.abrupt("return", (0, _extends2["default"])({}, result, {
|
437
|
+
return _context12.abrupt("return", (0, _exitLinkUtil.processExitLink)((0, _extends2["default"])({}, result, {
|
436
438
|
links: ((_result$links = result.links) !== null && _result$links !== void 0 ? _result$links : []).map(function (item) {
|
437
439
|
return (0, _extends2["default"])({}, item, {
|
438
440
|
ciType: 'network_link'
|
439
441
|
});
|
440
442
|
})
|
441
|
-
}));
|
443
|
+
})));
|
442
444
|
|
443
445
|
case 7:
|
444
446
|
_context12.prev = 7;
|
@@ -464,7 +466,7 @@ var _default = (0, _extends2["default"])({
|
|
464
466
|
* @param {Array} groups
|
465
467
|
* @returns
|
466
468
|
*/
|
467
|
-
getTopoDataByResource: function getTopoDataByResource(id, resources, groups, exportLinkIdList) {
|
469
|
+
getTopoDataByResource: function getTopoDataByResource(id, resources, groups, exportLinkIdList, ipNodes) {
|
468
470
|
return (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee13() {
|
469
471
|
var _result$links2;
|
470
472
|
|
@@ -17,9 +17,9 @@ var API_ROOT = _constants.TOPO_API_ROOT;
|
|
17
17
|
var _default = {
|
18
18
|
/**
|
19
19
|
* 批量查询ci类型是否可创建链路
|
20
|
-
*
|
21
|
-
* @param {*} typeCodes
|
22
|
-
* @returns
|
20
|
+
*
|
21
|
+
* @param {*} typeCodes
|
22
|
+
* @returns
|
23
23
|
*/
|
24
24
|
getCiTypesConnectable: function getCiTypesConnectable(typeCodes) {
|
25
25
|
return (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee() {
|
@@ -40,6 +40,48 @@ var _default = {
|
|
40
40
|
}
|
41
41
|
}, _callee);
|
42
42
|
}))();
|
43
|
+
},
|
44
|
+
|
45
|
+
/**
|
46
|
+
* 通过ip查询关联链路
|
47
|
+
*
|
48
|
+
* @param {array} ciIds
|
49
|
+
*/
|
50
|
+
queryLinksByIp: function queryLinksByIp(ids, ip) {
|
51
|
+
return (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee2() {
|
52
|
+
var stag, condition, parm, result;
|
53
|
+
return _regenerator["default"].wrap(function _callee2$(_context2) {
|
54
|
+
while (1) {
|
55
|
+
switch (_context2.prev = _context2.next) {
|
56
|
+
case 0:
|
57
|
+
stag = "'" + ids.join("','") + "'";
|
58
|
+
condition = "type('network_link') && network_link.destination_ipv4 = '" + ip + "' && network_link.source_device_id in [" + stag + "]";
|
59
|
+
parm = {
|
60
|
+
condition: condition,
|
61
|
+
sort: "name asc",
|
62
|
+
currentPage: 1,
|
63
|
+
pageSize: 999
|
64
|
+
};
|
65
|
+
_context2.prev = 3;
|
66
|
+
_context2.next = 6;
|
67
|
+
return _componentTopologyUtils.request.post("/mdc/v1/api/cmdb/commonQueryCiData", parm);
|
68
|
+
|
69
|
+
case 6:
|
70
|
+
result = _context2.sent;
|
71
|
+
return _context2.abrupt("return", result);
|
72
|
+
|
73
|
+
case 10:
|
74
|
+
_context2.prev = 10;
|
75
|
+
_context2.t0 = _context2["catch"](3);
|
76
|
+
rlog.error("通过ip查询关联链路", _context2.t0);
|
77
|
+
|
78
|
+
case 13:
|
79
|
+
case "end":
|
80
|
+
return _context2.stop();
|
81
|
+
}
|
82
|
+
}
|
83
|
+
}, _callee2, null, [[3, 10]]);
|
84
|
+
}))();
|
43
85
|
}
|
44
86
|
};
|
45
87
|
exports["default"] = _default;
|
@@ -0,0 +1,115 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
4
|
+
|
5
|
+
exports.__esModule = true;
|
6
|
+
exports.processExitLink = processExitLink;
|
7
|
+
|
8
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
9
|
+
|
10
|
+
function findPingNode(nodes, ip) {
|
11
|
+
return nodes.find(function (node) {
|
12
|
+
return node.ciType === 'ping' && node.ipAddress === ip;
|
13
|
+
});
|
14
|
+
}
|
15
|
+
|
16
|
+
function buildIpNode(ip) {
|
17
|
+
return {
|
18
|
+
'id': "ip_" + ip,
|
19
|
+
'name': ip,
|
20
|
+
bindType: 'ip',
|
21
|
+
// 绑定资源类型。关联资源 值为空,关联IP ip
|
22
|
+
// TODO 所属区域,从序列化拿
|
23
|
+
// 'groupId': null,
|
24
|
+
// 'groupTag': null,
|
25
|
+
'ipAddress': '1.1.1.1',
|
26
|
+
// 'attributes': [],
|
27
|
+
// 'metrics': [],
|
28
|
+
'type': 'node',
|
29
|
+
// 'dtype': 'device'
|
30
|
+
'operation': 'delete'
|
31
|
+
};
|
32
|
+
}
|
33
|
+
|
34
|
+
function getHtSerialize(serialize) {
|
35
|
+
if (serialize) {
|
36
|
+
return JSON.parse(serialize);
|
37
|
+
}
|
38
|
+
|
39
|
+
return null;
|
40
|
+
}
|
41
|
+
|
42
|
+
function isExitLink(link) {
|
43
|
+
return link.attributes.destination_type === 'ip';
|
44
|
+
}
|
45
|
+
|
46
|
+
function processExitLink(topoData) {
|
47
|
+
var nodes = topoData.nodes,
|
48
|
+
links = topoData.links;
|
49
|
+
var serialize = (0, _extends2["default"])({}, getHtSerialize(topoData.serialize)); // 出口链路目的端为IP节点时(非ping资源),IP构造为node节点
|
50
|
+
|
51
|
+
var ipNodes = [];
|
52
|
+
var newLinks = links.map(function (link) {
|
53
|
+
// 非出口链路不处理
|
54
|
+
if (!isExitLink(link)) {
|
55
|
+
return link;
|
56
|
+
} // 如果链路目的端在资源节点列表存在,则不处理
|
57
|
+
|
58
|
+
|
59
|
+
if (link.target && nodes.find(function (node) {
|
60
|
+
return node.id === link.target;
|
61
|
+
})) {
|
62
|
+
return link;
|
63
|
+
} // IP节点构造为node,链路作为标准链路处理
|
64
|
+
|
65
|
+
|
66
|
+
var destinationIp = link.attributes['network_link.destination_ipv4'];
|
67
|
+
var pingNode = findPingNode(nodes, destinationIp); // 目的端为非ping资源的IP节点时,构造为node
|
68
|
+
|
69
|
+
if (!pingNode && !ipNodes.find(function (item) {
|
70
|
+
return item.id === "ip_" + destinationIp;
|
71
|
+
})) {
|
72
|
+
var targetIpNode = buildIpNode(destinationIp);
|
73
|
+
ipNodes.push(targetIpNode);
|
74
|
+
} // 出口链路目的端为 ping资源 时,设置target为ping资源id
|
75
|
+
// 出口链路目的端为 IP节点 时,设置target为ip
|
76
|
+
|
77
|
+
|
78
|
+
var target = pingNode ? pingNode.id : "ip_" + destinationIp; // 序列化升级
|
79
|
+
|
80
|
+
if (!pingNode && serialize) {
|
81
|
+
// 1. 链路在序列化存在且目的端不是IP节点时,序列化升级
|
82
|
+
// 判断目的端节点是否是IP节点
|
83
|
+
var isIpNode = serialize.d.find(function (item) {
|
84
|
+
return item.p.tag === "ip_" + destinationIp;
|
85
|
+
}); // 序列化数据升级图片节点。
|
86
|
+
|
87
|
+
var linkSerialize = serialize.d.find(function (item) {
|
88
|
+
return item.a.id === link.id;
|
89
|
+
});
|
90
|
+
|
91
|
+
if (!isIpNode && linkSerialize) {
|
92
|
+
// 根据链路序列化数据找目的端节点
|
93
|
+
// eslint-disable-next-line no-underscore-dangle
|
94
|
+
var nodeSerialize = serialize.d.find(function (item) {
|
95
|
+
return item.i === linkSerialize.p.target.__i;
|
96
|
+
});
|
97
|
+
nodeSerialize.a = (0, _extends2["default"])({}, nodeSerialize.a, buildIpNode(destinationIp), {
|
98
|
+
isbinding: true
|
99
|
+
});
|
100
|
+
nodeSerialize.p.tag = "ip_" + destinationIp;
|
101
|
+
} // 如果有相同ip的ping资源和图片节点,图片节点消失(从序列化数据删除IP节点)
|
102
|
+
// TODO
|
103
|
+
|
104
|
+
}
|
105
|
+
|
106
|
+
return (0, _extends2["default"])({}, link, {
|
107
|
+
target: target
|
108
|
+
});
|
109
|
+
});
|
110
|
+
return (0, _extends2["default"])({}, topoData, {
|
111
|
+
nodes: [].concat(nodes, ipNodes),
|
112
|
+
links: newLinks,
|
113
|
+
serialize: serialize
|
114
|
+
});
|
115
|
+
}
|
@@ -32,6 +32,7 @@ exports.isGroup = isGroup;
|
|
32
32
|
exports.isLayer = isLayer;
|
33
33
|
exports.isNode = isNode;
|
34
34
|
exports.isText = isText;
|
35
|
+
exports.isUniqueIp = isUniqueIp;
|
35
36
|
exports.isValidEdge = isValidEdge;
|
36
37
|
exports.setElementRuntimeStyle = setElementRuntimeStyle;
|
37
38
|
|
@@ -55,7 +56,7 @@ function getElementData(element) {
|
|
55
56
|
styleMap: element.getStyleMap()
|
56
57
|
};
|
57
58
|
|
58
|
-
if (className ===
|
59
|
+
if (className === "ht.Edge") {
|
59
60
|
return (0, _extends3["default"])({}, commonData);
|
60
61
|
}
|
61
62
|
|
@@ -67,7 +68,7 @@ function getElementData(element) {
|
|
67
68
|
function isNode(element) {
|
68
69
|
// HT为了支持区域内无节点可展开增加了站位节点,因此 节点的layer等于container_blank的过滤掉就可以了
|
69
70
|
// eslint-disable-next-line no-underscore-dangle
|
70
|
-
return element instanceof ht.Node && !isLayer(element) && element._layer !==
|
71
|
+
return element instanceof ht.Node && !isLayer(element) && element._layer !== "container_blank";
|
71
72
|
}
|
72
73
|
|
73
74
|
function isEdge(element) {
|
@@ -80,7 +81,7 @@ function isValidEdge(element) {
|
|
80
81
|
}
|
81
82
|
|
82
83
|
if (!element.getSource() || !element.getTarget()) {
|
83
|
-
_rlog["default"].error(
|
84
|
+
_rlog["default"].error("isValidEdge 连线异常:源或目的为空", element);
|
84
85
|
|
85
86
|
return false;
|
86
87
|
}
|
@@ -97,7 +98,30 @@ function isLayer(element) {
|
|
97
98
|
}
|
98
99
|
|
99
100
|
function isText(element) {
|
100
|
-
return element instanceof ht.Text && element.a(
|
101
|
+
return element instanceof ht.Text && element.a("isText");
|
102
|
+
}
|
103
|
+
|
104
|
+
function isUniqueIp(dataModel, ip) {
|
105
|
+
console.log("isUniqueIp", ip);
|
106
|
+
var nodes = getNodes(dataModel);
|
107
|
+
var isUnique = true;
|
108
|
+
|
109
|
+
for (var i = 0; i < nodes.length; i++) {
|
110
|
+
var element = nodes[i];
|
111
|
+
var tagTxt = element.getTag();
|
112
|
+
console.log("isUniqueIp-element", tagTxt, ip);
|
113
|
+
|
114
|
+
if (tagTxt !== null && tagTxt !== void 0 && tagTxt.startsWith("ip_")) {
|
115
|
+
var ipTxt = tagTxt.replace("ip_", '');
|
116
|
+
|
117
|
+
if (ipTxt === ip) {
|
118
|
+
isUnique = false;
|
119
|
+
break;
|
120
|
+
}
|
121
|
+
}
|
122
|
+
}
|
123
|
+
|
124
|
+
return isUnique;
|
101
125
|
}
|
102
126
|
|
103
127
|
function getElements(dataModel) {
|
@@ -123,7 +147,7 @@ function getGroupDatas(dataModel) {
|
|
123
147
|
|
124
148
|
function getGroupElementByTag(dataModel, tag) {
|
125
149
|
return dataModel.getDataByTag(tag) || dataModel.getDatas().toArray().filter(function (item) {
|
126
|
-
return item.a(
|
150
|
+
return item.a("tag") === tag;
|
127
151
|
})[0];
|
128
152
|
}
|
129
153
|
|
@@ -135,14 +159,14 @@ function getGroupData(element) {
|
|
135
159
|
var parent = element.getParent();
|
136
160
|
var groupInfo = parent ? {
|
137
161
|
groupId: parent.getTag(),
|
138
|
-
groupTag: parent.a(
|
162
|
+
groupTag: parent.a("tag") // 父容器
|
139
163
|
|
140
164
|
} : {};
|
141
165
|
return (0, _extends3["default"])({
|
142
166
|
name: element.getStyleMap().label
|
143
167
|
}, element.getAttrObject(), {
|
144
168
|
id: element.getTag(),
|
145
|
-
tag: element.a(
|
169
|
+
tag: element.a("tag"),
|
146
170
|
image: element.getImage()
|
147
171
|
}, groupInfo);
|
148
172
|
}
|
@@ -159,7 +183,7 @@ function getNodeData(element) {
|
|
159
183
|
var parent = element.getParent();
|
160
184
|
var groupInfo = parent ? {
|
161
185
|
groupId: parent.getTag(),
|
162
|
-
groupTag: parent.a(
|
186
|
+
groupTag: parent.a("tag") // 父容器
|
163
187
|
|
164
188
|
} : {};
|
165
189
|
return (0, _extends3["default"])({}, element.getAttrObject(), {
|
@@ -173,12 +197,12 @@ function getEdges(dataModel) {
|
|
173
197
|
}
|
174
198
|
|
175
199
|
function isEdgeGroupExpanded(edge) {
|
176
|
-
return isEdge(edge) && edge.getEdgeGroup() && !!edge.s(
|
200
|
+
return isEdge(edge) && edge.getEdgeGroup() && !!edge.s("edge.expanded");
|
177
201
|
}
|
178
202
|
/**
|
179
203
|
* 是否连线组代理
|
180
|
-
* @param {*} edge
|
181
|
-
* @returns
|
204
|
+
* @param {*} edge
|
205
|
+
* @returns
|
182
206
|
*/
|
183
207
|
|
184
208
|
|
@@ -187,9 +211,9 @@ function isEdgeGroupAgent(edge) {
|
|
187
211
|
}
|
188
212
|
/**
|
189
213
|
* 获得两个节点间的连线列表
|
190
|
-
* @param {*} node1
|
191
|
-
* @param {*} node2
|
192
|
-
* @returns
|
214
|
+
* @param {*} node1
|
215
|
+
* @param {*} node2
|
216
|
+
* @returns
|
193
217
|
*/
|
194
218
|
|
195
219
|
|
@@ -212,7 +236,7 @@ function getEdgesBetweenNodes(node1, node2) {
|
|
212
236
|
}
|
213
237
|
/**
|
214
238
|
* 获得节点间的连线组,连线<=1时返回null
|
215
|
-
* @returns
|
239
|
+
* @returns
|
216
240
|
*/
|
217
241
|
|
218
242
|
|
@@ -232,7 +256,7 @@ function getEdgeGroupByNodes(node1, node2) {
|
|
232
256
|
}
|
233
257
|
/**
|
234
258
|
* 获得节点间的连线组,连线<=1时返回null
|
235
|
-
* @returns
|
259
|
+
* @returns
|
236
260
|
*/
|
237
261
|
|
238
262
|
|
@@ -241,7 +265,7 @@ function getEdgeGroupByNodeTags(dataModel, nodeTag1, nodeTag2) {
|
|
241
265
|
var node2 = dataModel.getDataByTag(nodeTag2);
|
242
266
|
|
243
267
|
if (!node1 || !node2) {
|
244
|
-
console.warn(
|
268
|
+
console.warn("getEdgeGroupByNodes 未找到节点", {
|
245
269
|
node1: node1,
|
246
270
|
node2: node2,
|
247
271
|
nodeTag1: nodeTag1,
|
@@ -328,7 +352,7 @@ function getGroupChildren(group) {
|
|
328
352
|
|
329
353
|
|
330
354
|
return group.getChildren().getArray().filter(function (node) {
|
331
|
-
return node._layer !==
|
355
|
+
return node._layer !== "container_blank";
|
332
356
|
});
|
333
357
|
}
|
334
358
|
/**
|
@@ -361,7 +385,7 @@ function getGroupChildrenData(group) {
|
|
361
385
|
function setElementRuntimeStyle(element, name, value) {
|
362
386
|
var _extends2;
|
363
387
|
|
364
|
-
var prevRuntimeStyle = element.a(
|
388
|
+
var prevRuntimeStyle = element.a("runtimeStyles") || {};
|
365
389
|
var runtimeStyle = (0, _extends3["default"])({}, prevRuntimeStyle, (_extends2 = {}, _extends2[name] = value, _extends2)); // if (prevRuntimeStyle[name] === undefined && value === undefined) {
|
366
390
|
// return
|
367
391
|
// }
|
@@ -370,7 +394,7 @@ function setElementRuntimeStyle(element, name, value) {
|
|
370
394
|
runtimeStyle[name] = undefined; // delete runtimeStyle[name]
|
371
395
|
}
|
372
396
|
|
373
|
-
element.a(
|
397
|
+
element.a("runtimeStyles", runtimeStyle);
|
374
398
|
}
|
375
399
|
/**
|
376
400
|
* 判断拓扑图是否存在元素
|
@@ -384,7 +408,7 @@ function isExistedElement(htTopo, dataModel, data) {
|
|
384
408
|
|
385
409
|
|
386
410
|
var element = getElements(dataModel).find(function (item) {
|
387
|
-
return data.tag && item.a(
|
411
|
+
return data.tag && item.a("tag") === data.tag;
|
388
412
|
});
|
389
413
|
|
390
414
|
if (element) {
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@riil-frontend/component-topology",
|
3
|
-
"version": "9.0.0-a.
|
3
|
+
"version": "9.0.0-a.12",
|
4
4
|
"description": "拓扑",
|
5
5
|
"scripts": {
|
6
6
|
"start": "build-scripts start",
|
@@ -116,6 +116,6 @@
|
|
116
116
|
"access": "public"
|
117
117
|
},
|
118
118
|
"license": "MIT",
|
119
|
-
"homepage": "https://unpkg.com/@riil-frontend/component-topology@9.0.0-a.
|
119
|
+
"homepage": "https://unpkg.com/@riil-frontend/component-topology@9.0.0-a.12/build/index.html",
|
120
120
|
"gitHead": "2da19ffccbb7ca60a8acf396e39f542c68bb33f5"
|
121
121
|
}
|