@riil-frontend/component-topology 3.17.3 → 3.17.6

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.
@@ -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 "3.17.3" === 'string' ? "3.17.3" : null;
23
+ var version = typeof "3.17.6" === 'string' ? "3.17.6" : null;
24
24
  console.info("\u62D3\u6251\u7248\u672C: " + version);
25
25
  /**
26
26
  * 拓扑显示和编辑
@@ -16,6 +16,7 @@ import service from "./server";
16
16
  import { clone } from "../../../../../../utils/copyUtil";
17
17
  import { getInterfaceObject } from "../../../../../../core/models/utils/linkUtils";
18
18
  import { getEdgesBetweenNodes, getNodes } from "../../../../../../utils/htElementUtils";
19
+ import { getCiTypes } from "../../../../../../utils/topoData";
19
20
  var CollapsePanel = _Collapse.Panel;
20
21
 
21
22
  function AddLinkDrawer(props) {
@@ -72,8 +73,10 @@ function AddLinkDrawer(props) {
72
73
  while (1) {
73
74
  switch (_context.prev = _context.next) {
74
75
  case 0:
75
- if (!(id === null)) {
76
- _context.next = 2;
76
+ console.log("getPortsById", id, currentLink);
77
+
78
+ if (id) {
79
+ _context.next = 3;
77
80
  break;
78
81
  }
79
82
 
@@ -82,25 +85,25 @@ function AddLinkDrawer(props) {
82
85
  portsDoc: {}
83
86
  });
84
87
 
85
- case 2:
86
- _context.next = 4;
88
+ case 3:
89
+ _context.next = 5;
87
90
  return service.getPortsById(id);
88
91
 
89
- case 4:
92
+ case 5:
90
93
  result = _context.sent;
91
- _context.next = 7;
94
+ _context.next = 8;
92
95
  return service.queryLinksByNodeId(id);
93
96
 
94
- case 7:
97
+ case 8:
95
98
  links = _context.sent;
96
99
  ifTypes = result.map(function (item) {
97
100
  return item.type;
98
101
  }); // console.log("端口类型列表", ifTypes);
99
102
 
100
- _context.next = 11;
103
+ _context.next = 12;
101
104
  return getInterfaceObject(ifTypes);
102
105
 
103
- case 11:
106
+ case 12:
104
107
  ifDoc = _context.sent;
105
108
  // console.log("端口类型字典", ifDoc);
106
109
  usedPorts = [];
@@ -134,7 +137,7 @@ function AddLinkDrawer(props) {
134
137
  portsDoc: portsDoc
135
138
  });
136
139
 
137
- case 18:
140
+ case 19:
138
141
  case "end":
139
142
  return _context.stop();
140
143
  }
@@ -299,15 +302,16 @@ function AddLinkDrawer(props) {
299
302
 
300
303
  var getCiTypesConnectable = /*#__PURE__*/function () {
301
304
  var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee4() {
302
- var ciTypesConnectable, nodes, ciIds, ciNodes;
305
+ var ciTypes, ciTypesConnectable, nodes, ciIds, ciNodes;
303
306
  return _regeneratorRuntime.wrap(function _callee4$(_context4) {
304
307
  while (1) {
305
308
  switch (_context4.prev = _context4.next) {
306
309
  case 0:
307
- _context4.next = 2;
308
- return topoService.networkLink.getCiTypesConnectable(RESOURCE_LIMIT_TYPES);
310
+ ciTypes = getCiTypes(topo.dataModel.getData());
311
+ _context4.next = 3;
312
+ return topoService.networkLink.getCiTypesConnectable(ciTypes);
309
313
 
310
- case 2:
314
+ case 3:
311
315
  ciTypesConnectable = _context4.sent;
312
316
  nodes = getNodes(topo.getDataModel());
313
317
  ciIds = [];
@@ -325,7 +329,7 @@ function AddLinkDrawer(props) {
325
329
  setCiIdsConnectable(ciIds);
326
330
  return _context4.abrupt("return", ciNodes);
327
331
 
328
- case 10:
332
+ case 11:
329
333
  case "end":
330
334
  return _context4.stop();
331
335
  }
@@ -58,7 +58,15 @@ var LinkTagsTipsBuilder = /*#__PURE__*/function () {
58
58
  var _proto = LinkTagsTipsBuilder.prototype;
59
59
 
60
60
  _proto.getExtElementTagsAndTips = function getExtElementTagsAndTips() {
61
- return this.getEdgeGroupTagsAndTips();
61
+ var data = [];
62
+
63
+ try {
64
+ data = this.getEdgeGroupTagsAndTips();
65
+ } catch (error) {
66
+ rlog.error('getExtElementTagsAndTips 失败', error);
67
+ }
68
+
69
+ return data;
62
70
  }
63
71
  /**
64
72
  * 获得未关联聚合链路的连线组标注和悬浮框数据
@@ -97,7 +105,12 @@ var LinkTagsTipsBuilder = /*#__PURE__*/function () {
97
105
  function getGroupInfo(group) {
98
106
  var edges = group.getEdges().toArray();
99
107
  var edge = edges[0];
100
- var edgeGroupData = topo.getHtTopo().getEdgeGroupData(edge.getSource(), edge.getTarget()); // eslint-disable-next-line no-underscore-dangle
108
+ var edgeGroupData = topo.getHtTopo().getEdgeGroupData(edge.getSource(), edge.getTarget());
109
+
110
+ if (!edgeGroupData || !edgeGroupData.data) {
111
+ return null;
112
+ } // eslint-disable-next-line no-underscore-dangle
113
+
101
114
 
102
115
  var linkId = edgeGroupData.data._attrObject.id;
103
116
 
@@ -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 "3.17.3" === 'string' ? "3.17.3" : null;
51
+ var version = typeof "3.17.6" === 'string' ? "3.17.6" : null;
52
52
  console.info("\u62D3\u6251\u7248\u672C: " + version);
53
53
  /**
54
54
  * 拓扑显示和编辑
@@ -41,6 +41,8 @@ var _linkUtils = require("../../../../../../core/models/utils/linkUtils");
41
41
 
42
42
  var _htElementUtils = require("../../../../../../utils/htElementUtils");
43
43
 
44
+ var _topoData = require("../../../../../../utils/topoData");
45
+
44
46
  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); }
45
47
 
46
48
  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; }
@@ -101,8 +103,10 @@ function AddLinkDrawer(props) {
101
103
  while (1) {
102
104
  switch (_context.prev = _context.next) {
103
105
  case 0:
104
- if (!(id === null)) {
105
- _context.next = 2;
106
+ console.log("getPortsById", id, currentLink);
107
+
108
+ if (id) {
109
+ _context.next = 3;
106
110
  break;
107
111
  }
108
112
 
@@ -111,25 +115,25 @@ function AddLinkDrawer(props) {
111
115
  portsDoc: {}
112
116
  });
113
117
 
114
- case 2:
115
- _context.next = 4;
118
+ case 3:
119
+ _context.next = 5;
116
120
  return _server["default"].getPortsById(id);
117
121
 
118
- case 4:
122
+ case 5:
119
123
  result = _context.sent;
120
- _context.next = 7;
124
+ _context.next = 8;
121
125
  return _server["default"].queryLinksByNodeId(id);
122
126
 
123
- case 7:
127
+ case 8:
124
128
  links = _context.sent;
125
129
  ifTypes = result.map(function (item) {
126
130
  return item.type;
127
131
  }); // console.log("端口类型列表", ifTypes);
128
132
 
129
- _context.next = 11;
133
+ _context.next = 12;
130
134
  return (0, _linkUtils.getInterfaceObject)(ifTypes);
131
135
 
132
- case 11:
136
+ case 12:
133
137
  ifDoc = _context.sent;
134
138
  // console.log("端口类型字典", ifDoc);
135
139
  usedPorts = [];
@@ -163,7 +167,7 @@ function AddLinkDrawer(props) {
163
167
  portsDoc: portsDoc
164
168
  });
165
169
 
166
- case 18:
170
+ case 19:
167
171
  case "end":
168
172
  return _context.stop();
169
173
  }
@@ -330,15 +334,16 @@ function AddLinkDrawer(props) {
330
334
 
331
335
  var getCiTypesConnectable = /*#__PURE__*/function () {
332
336
  var _ref4 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee4() {
333
- var ciTypesConnectable, nodes, ciIds, ciNodes;
337
+ var ciTypes, ciTypesConnectable, nodes, ciIds, ciNodes;
334
338
  return _regenerator["default"].wrap(function _callee4$(_context4) {
335
339
  while (1) {
336
340
  switch (_context4.prev = _context4.next) {
337
341
  case 0:
338
- _context4.next = 2;
339
- return _topo["default"].networkLink.getCiTypesConnectable(_ResourceTypeLimit.RESOURCE_LIMIT_TYPES);
342
+ ciTypes = (0, _topoData.getCiTypes)(topo.dataModel.getData());
343
+ _context4.next = 3;
344
+ return _topo["default"].networkLink.getCiTypesConnectable(ciTypes);
340
345
 
341
- case 2:
346
+ case 3:
342
347
  ciTypesConnectable = _context4.sent;
343
348
  nodes = (0, _htElementUtils.getNodes)(topo.getDataModel());
344
349
  ciIds = [];
@@ -356,7 +361,7 @@ function AddLinkDrawer(props) {
356
361
  setCiIdsConnectable(ciIds);
357
362
  return _context4.abrupt("return", ciNodes);
358
363
 
359
- case 10:
364
+ case 11:
360
365
  case "end":
361
366
  return _context4.stop();
362
367
  }
@@ -68,7 +68,15 @@ var LinkTagsTipsBuilder = /*#__PURE__*/function () {
68
68
  var _proto = LinkTagsTipsBuilder.prototype;
69
69
 
70
70
  _proto.getExtElementTagsAndTips = function getExtElementTagsAndTips() {
71
- return this.getEdgeGroupTagsAndTips();
71
+ var data = [];
72
+
73
+ try {
74
+ data = this.getEdgeGroupTagsAndTips();
75
+ } catch (error) {
76
+ _rlog["default"].error('getExtElementTagsAndTips 失败', error);
77
+ }
78
+
79
+ return data;
72
80
  }
73
81
  /**
74
82
  * 获得未关联聚合链路的连线组标注和悬浮框数据
@@ -107,7 +115,12 @@ var LinkTagsTipsBuilder = /*#__PURE__*/function () {
107
115
  function getGroupInfo(group) {
108
116
  var edges = group.getEdges().toArray();
109
117
  var edge = edges[0];
110
- var edgeGroupData = topo.getHtTopo().getEdgeGroupData(edge.getSource(), edge.getTarget()); // eslint-disable-next-line no-underscore-dangle
118
+ var edgeGroupData = topo.getHtTopo().getEdgeGroupData(edge.getSource(), edge.getTarget());
119
+
120
+ if (!edgeGroupData || !edgeGroupData.data) {
121
+ return null;
122
+ } // eslint-disable-next-line no-underscore-dangle
123
+
111
124
 
112
125
  var linkId = edgeGroupData.data._attrObject.id;
113
126
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@riil-frontend/component-topology",
3
- "version": "3.17.3",
3
+ "version": "3.17.6",
4
4
  "description": "拓扑",
5
5
  "scripts": {
6
6
  "start": "build-scripts start",
@@ -110,6 +110,6 @@
110
110
  "access": "public"
111
111
  },
112
112
  "license": "MIT",
113
- "homepage": "https://unpkg.com/@riil-frontend/component-topology@3.17.3/build/index.html",
113
+ "homepage": "https://unpkg.com/@riil-frontend/component-topology@3.17.6/build/index.html",
114
114
  "gitHead": "2da19ffccbb7ca60a8acf396e39f542c68bb33f5"
115
115
  }