@riil-frontend/component-topology 12.0.0-dev.9 → 12.1.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.
Files changed (90) hide show
  1. package/build/1.js +1 -1
  2. package/build/index.css +1 -1
  3. package/build/index.js +14 -14
  4. package/es/components/TemplateButton/index.module.scss +1 -1
  5. package/es/core/components/AlarmListPanel/components/AlarmListItem.js +58 -3
  6. package/es/core/components/TopoView/topoView.js +5 -1
  7. package/es/core/editor/components/Toolbar/widgets/EdgeColorButton/EdgeColorButton.js +5 -12
  8. package/es/core/editor/components/Toolbar/widgets/EdgeTypeButton/EdgeType.js +27 -10
  9. package/es/core/editor/components/Toolbar/widgets/EdgeTypeButton/EdgeType.module.scss +21 -1
  10. package/es/core/editor/components/Toolbar/widgets/EdgeTypeButton/LineType.js +9 -0
  11. package/es/core/editor/components/Toolbar/widgets/EdgeTypeButton/index.js +2 -2
  12. package/es/core/editor/components/Toolbar/widgets/Layout/index.js +16 -2
  13. package/es/core/editor/hooks/useKeyboardShortcut.js +3 -1
  14. package/es/core/editor/utils/copyElementUtil.js +12 -0
  15. package/es/core/editor/utils/edgeTypeStyleUtil.js +8 -30
  16. package/es/core/hooks/useAlarm.js +131 -81
  17. package/es/core/hooks/useCmpLinkAlarm.js +153 -0
  18. package/es/core/hooks/useEventData.js +1 -2
  19. package/es/core/hooks/useGraphAlarmDisplay.js +91 -56
  20. package/es/core/hooks/useResourceConfig.js +1 -3
  21. package/es/core/hooks/useTopoEdit.js +31 -43
  22. package/es/core/models/Alarm.js +69 -142
  23. package/es/core/models/AttributeMetricDisplay.js +9 -3
  24. package/es/core/models/TopoApp.js +1 -1
  25. package/es/core/models/cache/CiCache.d.ts +1 -1
  26. package/es/core/models/cache/CiCache.js +3 -3
  27. package/es/core/models/topoData.js +0 -1
  28. package/es/core/models/utils/linkUtils.js +20 -13
  29. package/es/core/services/topo/basic.js +2 -2
  30. package/es/core/store/models/topoConfig.js +7 -10
  31. package/es/core/store/models/topoMod.js +81 -134
  32. package/es/core/utils/edgeUtil.js +8 -0
  33. package/es/core/utils/metricUtil.js +8 -4
  34. package/es/core/utils/showGraphManageStatusUtil.js +3 -2
  35. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/LinkTopoCard.js +2 -2
  36. package/es/core/viewer/components/plugins/ViewerPlugin.js +3 -1
  37. package/es/core/viewer/components/titlebar/widgets/AlarmButton.js +1 -5
  38. package/es/networkTopo/components/TopoView.js +6 -11
  39. package/es/networkTopo/hooks/useEdgeExpand.js +2 -3
  40. package/es/networkTopo/services/topo/basic.js +3 -3
  41. package/es/networkTopo/store/topoCenter.js +260 -223
  42. package/es/style.js +1 -1
  43. package/es/utils/ResourceConfigUtil.js +3 -36
  44. package/es/utils/ciRefAttributeTranslateUtil.d.ts +9 -2
  45. package/es/utils/ciRefAttributeTranslateUtil.js +8 -9
  46. package/es/utils/topoData.js +1 -1
  47. package/lib/components/TemplateButton/index.module.scss +1 -1
  48. package/lib/core/components/AlarmListPanel/components/AlarmListItem.js +60 -3
  49. package/lib/core/components/TopoView/topoView.js +5 -1
  50. package/lib/core/editor/components/Toolbar/widgets/EdgeColorButton/EdgeColorButton.js +6 -12
  51. package/lib/core/editor/components/Toolbar/widgets/EdgeTypeButton/EdgeType.js +27 -9
  52. package/lib/core/editor/components/Toolbar/widgets/EdgeTypeButton/EdgeType.module.scss +21 -1
  53. package/lib/core/editor/components/Toolbar/widgets/EdgeTypeButton/LineType.js +8 -0
  54. package/lib/core/editor/components/Toolbar/widgets/EdgeTypeButton/index.js +1 -1
  55. package/lib/core/editor/components/Toolbar/widgets/Layout/index.js +16 -2
  56. package/lib/core/editor/hooks/useKeyboardShortcut.js +2 -0
  57. package/lib/core/editor/utils/copyElementUtil.js +15 -0
  58. package/lib/core/editor/utils/edgeTypeStyleUtil.js +8 -31
  59. package/lib/core/hooks/useAlarm.js +130 -79
  60. package/lib/core/hooks/useCmpLinkAlarm.js +166 -0
  61. package/lib/core/hooks/useEventData.js +1 -2
  62. package/lib/core/hooks/useGraphAlarmDisplay.js +91 -55
  63. package/lib/core/hooks/useResourceConfig.js +1 -3
  64. package/lib/core/hooks/useTopoEdit.js +30 -42
  65. package/lib/core/models/Alarm.js +69 -144
  66. package/lib/core/models/AttributeMetricDisplay.js +10 -2
  67. package/lib/core/models/TopoApp.js +1 -1
  68. package/lib/core/models/cache/CiCache.d.ts +1 -1
  69. package/lib/core/models/cache/CiCache.js +3 -3
  70. package/lib/core/models/topoData.js +0 -1
  71. package/lib/core/models/utils/linkUtils.js +21 -13
  72. package/lib/core/services/topo/basic.js +2 -2
  73. package/lib/core/store/models/topoConfig.js +7 -10
  74. package/lib/core/store/models/topoMod.js +81 -134
  75. package/lib/core/utils/edgeUtil.js +10 -0
  76. package/lib/core/utils/metricUtil.js +8 -4
  77. package/lib/core/utils/showGraphManageStatusUtil.js +3 -2
  78. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/LinkTopoCard.js +2 -2
  79. package/lib/core/viewer/components/plugins/ViewerPlugin.js +3 -1
  80. package/lib/core/viewer/components/titlebar/widgets/AlarmButton.js +1 -5
  81. package/lib/networkTopo/components/TopoView.js +5 -14
  82. package/lib/networkTopo/hooks/useEdgeExpand.js +2 -3
  83. package/lib/networkTopo/services/topo/basic.js +3 -3
  84. package/lib/networkTopo/store/topoCenter.js +262 -225
  85. package/lib/style.js +1 -1
  86. package/lib/utils/ResourceConfigUtil.js +3 -38
  87. package/lib/utils/ciRefAttributeTranslateUtil.d.ts +9 -2
  88. package/lib/utils/ciRefAttributeTranslateUtil.js +8 -9
  89. package/lib/utils/topoData.js +1 -1
  90. package/package.json +2 -2
@@ -6,6 +6,7 @@ exports.__esModule = true;
6
6
  exports.buildTopoLinkData = buildTopoLinkData;
7
7
  exports.compatibleWith = void 0;
8
8
  exports.getLinksDetail = getLinksDetail;
9
+ exports.isAggLink = isAggLink;
9
10
  exports.isCrucialLink = isCrucialLink;
10
11
  exports.isExitLink = isExitLink;
11
12
  exports.mergeExportLinkData = void 0;
@@ -22,8 +23,6 @@ var _keyBy = _interopRequireDefault(require("lodash/keyBy"));
22
23
 
23
24
  var _lodash = _interopRequireDefault(require("lodash"));
24
25
 
25
- var _services = require("../../services");
26
-
27
26
  var _htElementUtils = require("../../../utils/htElementUtils");
28
27
 
29
28
  var _CiTypeCache = _interopRequireDefault(require("../cache/CiTypeCache"));
@@ -56,7 +55,21 @@ function isCrucialLink(link) {
56
55
 
57
56
 
58
57
  function isExitLink(link) {
59
- return (link === null || link === void 0 ? void 0 : link.attributes) && !(link !== null && link !== void 0 && link.attributes["destination_id"]);
58
+ var _link$attributes;
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";
60
73
  }
61
74
 
62
75
  function mergeLinksData(links, linkCis, nodes, interfaceCiMap, interfaceDoc) {
@@ -107,7 +120,7 @@ function _getLinksDetail() {
107
120
  return _regenerator["default"].wrap(function _callee$(_context) {
108
121
  while (1) switch (_context.prev = _context.next) {
109
122
  case 0:
110
- if (!(!links || !links.length)) {
123
+ if (links !== null && links !== void 0 && links.length) {
111
124
  _context.next = 2;
112
125
  break;
113
126
  }
@@ -115,9 +128,6 @@ function _getLinksDetail() {
115
128
  return _context.abrupt("return", []);
116
129
 
117
130
  case 2:
118
- // const linkCis = await topoService.relation.batchQueryRelation(
119
- // links.map((link) => link.id)
120
- // );
121
131
  linkCis = links;
122
132
  interfaceIds = [].concat(linkCis.map(function (item) {
123
133
  return item.attributes.source_id;
@@ -200,17 +210,15 @@ var showLinkByConfig = function showLinkByConfig(props) {
200
210
  if (showType === 1 || showType === true) {
201
211
  // 单链路全部显示
202
212
  // console.log("单链路全部显示", edge);
203
- edge.s("2d.visible", true);
213
+ edge.s("x.visible", true);
204
214
  } else {
205
- var _d$attributes, _d$attributes2;
206
-
207
215
  var d = topo.dataModel.getDataById(edge.getTag()); // 判断是否聚合链路
208
216
 
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);
217
+ if (isAggLink(d)) {
218
+ edge.s("x.visible", showAgg);
211
219
  } else {
212
220
  // console.log("edge", edge, d, showAgg);
213
- edge.s("2d.visible", showPhy);
221
+ edge.s("x.visible", showPhy);
214
222
  }
215
223
  }
216
224
  });
@@ -118,7 +118,7 @@ var _default = {
118
118
  * @param {Array} groups
119
119
  * @returns
120
120
  */
121
- getTopoDataByResource: function getTopoDataByResource(id, resources, groups, exportLinkIdList) {
121
+ getTopoDataByResource: function getTopoDataByResource(id, resources, groups) {
122
122
  return (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee() {
123
123
  var data, obj;
124
124
  return _regenerator["default"].wrap(function _callee$(_context) {
@@ -137,7 +137,7 @@ var _default = {
137
137
  obj = prepareGroupParams(data);
138
138
  _context.next = 5;
139
139
  return _componentTopologyUtils.request.post(API_ROOT + "/structure/byCondition/" + id, (0, _extends2["default"])({}, obj, {
140
- exportLinkIdList: exportLinkIdList
140
+ exportLinkIdList: []
141
141
  }));
142
142
 
143
143
  case 5:
@@ -53,7 +53,6 @@ var initialState = {
53
53
  "static": []
54
54
  },
55
55
  groups: [],
56
- exportLinkIdList: [],
57
56
  // config: {
58
57
  // view: null,
59
58
  // groups: [],
@@ -260,18 +259,17 @@ function _default(topoApp) {
260
259
  var _this2 = this;
261
260
 
262
261
  return (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee2() {
263
- var editState, resources, _editState$groups, groups, _editState$ipNodes, ipNodes, query, data;
262
+ var editState, resources, _editState$groups, groups, query, data;
264
263
 
265
264
  return _regenerator["default"].wrap(function _callee2$(_context2) {
266
265
  while (1) switch (_context2.prev = _context2.next) {
267
266
  case 0:
268
267
  editState = rootState.topoConfig;
269
- resources = editState.resources, _editState$groups = editState.groups, groups = _editState$groups === void 0 ? [] : _editState$groups, _editState$ipNodes = editState.ipNodes, ipNodes = _editState$ipNodes === void 0 ? [] : _editState$ipNodes;
268
+ resources = editState.resources, _editState$groups = editState.groups, groups = _editState$groups === void 0 ? [] : _editState$groups;
270
269
  query = {
271
270
  id: rootState.topoMod.topoId,
272
271
  resources: resources,
273
- groups: groups,
274
- ipNodes: ipNodes
272
+ groups: groups
275
273
  };
276
274
  _context2.next = 5;
277
275
  return _this2.getTopoByConditions(query);
@@ -322,14 +320,14 @@ function _default(topoApp) {
322
320
  var _this4 = this;
323
321
 
324
322
  return (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee4() {
325
- var topoId, resources, groups, exportLinkIdList, ipNodes, viewConditions, groupInfo, data, _yield$Promise$all, dataWithLinkDetail, _combTopoData, topoData, resAndMetrics, topoDataTrans;
323
+ var topoId, resources, groups, viewConditions, groupInfo, data, _yield$Promise$all, dataWithLinkDetail, _combTopoData, topoData, resAndMetrics, topoDataTrans;
326
324
 
327
325
  return _regenerator["default"].wrap(function _callee4$(_context4) {
328
326
  while (1) switch (_context4.prev = _context4.next) {
329
327
  case 0:
330
328
  _rlog["default"].debug("getTopoByConditions--------", params);
331
329
 
332
- topoId = params.id, resources = params.resources, groups = params.groups, exportLinkIdList = params.exportLinkIdList, ipNodes = params.ipNodes;
330
+ topoId = params.id, resources = params.resources, groups = params.groups;
333
331
  viewConditions = (0, _topoData2.resToConditions)(resources);
334
332
  groupInfo = (0, _utils.isAvailableArray)(groups) && groups.map(function (group) {
335
333
  return (0, _extends2["default"])({}, group, {
@@ -341,7 +339,7 @@ function _default(topoApp) {
341
339
  _rlog["default"].debug("getTopoByConditions--------", viewConditions, groupInfo);
342
340
 
343
341
  _context4.next = 7;
344
- return topoApp.serverApi.getTopoDataByResource(topoId, viewConditions, groupInfo, exportLinkIdList, ipNodes);
342
+ return topoApp.serverApi.getTopoDataByResource(topoId, viewConditions, groupInfo);
345
343
 
346
344
  case 7:
347
345
  data = _context4.sent;
@@ -484,8 +482,7 @@ function _default(topoApp) {
484
482
  return _regenerator["default"].wrap(function _callee8$(_context8) {
485
483
  while (1) switch (_context8.prev = _context8.next) {
486
484
  case 0:
487
- ids = data.ids, ip = data.ip; // console.log("queryAllLinkByIp", ids, ip);
488
-
485
+ ids = data.ids, ip = data.ip;
489
486
  _context8.next = 3;
490
487
  return _networkLink["default"].queryLinksByIp(ids, ip);
491
488
 
@@ -226,76 +226,23 @@ function _default(topoApp) {
226
226
  enterEditMode: function enterEditMode(playload, rootState) {
227
227
  topoApp.enterEditMode();
228
228
  },
229
- openDefaultTopoPage: function openDefaultTopoPage(conditions, rootState) {
230
- var _this3 = this;
231
-
229
+ refreshPermission: function refreshPermission() {
232
230
  return (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee3() {
233
- var topoId, treeData;
234
231
  return _regenerator["default"].wrap(function _callee3$(_context3) {
235
232
  while (1) switch (_context3.prev = _context3.next) {
236
233
  case 0:
237
- if (conditions === void 0) {
238
- conditions = {};
239
- }
240
-
241
- topoId = rootState.topoTreeMod.defId;
242
-
243
- if (!topoId) {
244
- // 查找第一个
245
- treeData = rootState.topoTreeMod.treeData;
246
- (0, _tree.loopTreeByKey)(treeData, 'type', 1, function (item, index, arr) {
247
- if (!topoId) {
248
- topoId = item.id;
249
- }
250
- });
251
- } // 右侧切换拓扑图
252
-
253
-
254
- _this3.openTopoPage({
255
- id: topoId
256
- });
257
-
258
- case 4:
259
- case "end":
260
- return _context3.stop();
261
- }
262
- }, _callee3);
263
- }))();
264
- },
265
- refreshPermission: function refreshPermission() {
266
- var _this4 = this;
267
-
268
- return (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee4() {
269
- return _regenerator["default"].wrap(function _callee4$(_context4) {
270
- while (1) switch (_context4.prev = _context4.next) {
271
- case 0:
272
- _context4.next = 2;
234
+ _context3.next = 2;
273
235
  return dispatch.functionAuth.refresh();
274
236
 
275
237
  case 2:
276
- _context4.next = 4;
277
- return _this4.refreshTopoTree();
278
-
279
- case 4:
280
- case "end":
281
- return _context4.stop();
282
- }
283
- }, _callee4);
284
- }))();
285
- },
286
- refreshTopoTree: function refreshTopoTree() {
287
- return (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee5() {
288
- return _regenerator["default"].wrap(function _callee5$(_context5) {
289
- while (1) switch (_context5.prev = _context5.next) {
290
- case 0:
291
- _context5.next = 2;
238
+ _context3.next = 4;
292
239
  return dispatch.topoTreeMod.refreshTree();
293
240
 
294
- case 2:
241
+ case 4:
295
242
  case "end":
296
- return _context5.stop();
243
+ return _context3.stop();
297
244
  }
298
- }, _callee5);
245
+ }, _callee3);
299
246
  }))();
300
247
  },
301
248
 
@@ -310,19 +257,19 @@ function _default(topoApp) {
310
257
  * @return {Promise<void>}
311
258
  */
312
259
  initTopoData: function initTopoData(props, state) {
313
- var _this5 = this;
260
+ var _this3 = this;
314
261
 
315
- return (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee6() {
262
+ return (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee4() {
316
263
  var _result$config;
317
264
 
318
265
  var startTime, topoId, data, linkToData, refresh, clear, linkTo, startState, permission, result, graphConfig, topoConfig, extraConfig, _combTopoData, topoData, resAndMetrics, _yield$Promise$all, newData, endTime;
319
266
 
320
- return _regenerator["default"].wrap(function _callee6$(_context6) {
321
- while (1) switch (_context6.prev = _context6.next) {
267
+ return _regenerator["default"].wrap(function _callee4$(_context4) {
268
+ while (1) switch (_context4.prev = _context4.next) {
322
269
  case 0:
323
270
  startTime = (0, _moment["default"])();
324
271
  topoId = props.topoId, data = props.data, linkToData = props.linkTo, refresh = props.refresh, clear = props.clear;
325
- _context6.next = 4;
272
+ _context4.next = 4;
326
273
  return topoApp.open(topoId);
327
274
 
328
275
  case 4:
@@ -345,7 +292,7 @@ function _default(topoApp) {
345
292
  });
346
293
  }
347
294
 
348
- _this5.update(startState);
295
+ _this3.update(startState);
349
296
 
350
297
  dispatch.topoBizMod.update({
351
298
  pollingSwitch: false
@@ -355,24 +302,24 @@ function _default(topoApp) {
355
302
  permission = 'write';
356
303
 
357
304
  if (!topoApp.options.usePermission) {
358
- _context6.next = 19;
305
+ _context4.next = 19;
359
306
  break;
360
307
  }
361
308
 
362
- _context6.next = 14;
363
- return _this5.getTopoPermission({
309
+ _context4.next = 14;
310
+ return _this3.getTopoPermission({
364
311
  id: topoId
365
312
  });
366
313
 
367
314
  case 14:
368
- permission = _context6.sent;
315
+ permission = _context4.sent;
369
316
 
370
317
  if (_topoPermissionUtil["default"].isReadable(permission)) {
371
- _context6.next = 19;
318
+ _context4.next = 19;
372
319
  break;
373
320
  }
374
321
 
375
- _this5.update({
322
+ _this3.update({
376
323
  loading: false,
377
324
  topoData: null,
378
325
  data: null,
@@ -381,26 +328,26 @@ function _default(topoApp) {
381
328
  });
382
329
 
383
330
  topoApp.options.onLoad();
384
- return _context6.abrupt("return");
331
+ return _context4.abrupt("return");
385
332
 
386
333
  case 19:
387
334
  if (!data) {
388
- _context6.next = 30;
335
+ _context4.next = 30;
389
336
  break;
390
337
  }
391
338
 
392
339
  graphConfig = {};
393
340
 
394
341
  if (!topoId) {
395
- _context6.next = 27;
342
+ _context4.next = 27;
396
343
  break;
397
344
  }
398
345
 
399
- _context6.next = 24;
346
+ _context4.next = 24;
400
347
  return _topo["default"].getTopoData(topoId);
401
348
 
402
349
  case 24:
403
- topoConfig = _context6.sent;
350
+ topoConfig = _context4.sent;
404
351
  if (!topoConfig) _componentTopologyUtils.rlog.error("\u672A\u67E5\u8BE2\u5230\u62D3\u6251id " + topoId + " \u7684\u6570\u636E\uFF0C\u8BF7\u68C0\u67E5");
405
352
  graphConfig = {
406
353
  global: topoConfig === null || topoConfig === void 0 ? void 0 : topoConfig.global,
@@ -410,23 +357,23 @@ function _default(topoApp) {
410
357
 
411
358
  case 27:
412
359
  result = (0, _extends2["default"])({}, data, graphConfig);
413
- _context6.next = 33;
360
+ _context4.next = 33;
414
361
  break;
415
362
 
416
363
  case 30:
417
- _context6.next = 32;
364
+ _context4.next = 32;
418
365
  return topoApp.options.loadData(topoId, topoApp.serverApi);
419
366
 
420
367
  case 32:
421
- result = _context6.sent;
368
+ result = _context4.sent;
422
369
 
423
370
  case 33:
424
371
  if (result) {
425
- _context6.next = 37;
372
+ _context4.next = 37;
426
373
  break;
427
374
  }
428
375
 
429
- _this5.update({
376
+ _this3.update({
430
377
  loading: false,
431
378
  data: null,
432
379
  globalConfig: null,
@@ -435,19 +382,19 @@ function _default(topoApp) {
435
382
  });
436
383
 
437
384
  topoApp.options.onLoad();
438
- return _context6.abrupt("return");
385
+ return _context4.abrupt("return");
439
386
 
440
387
  case 37:
441
388
  result = (0, _topoData.parseTopoData)(result);
442
389
 
443
390
  _componentTopologyUtils.rlog.debug('topoMod.initTopoData 查询数据完成', topoId, linkTo, result);
444
391
 
445
- _context6.next = 41;
392
+ _context4.next = 41;
446
393
  return dispatch.customIcon.loadCustomIcons();
447
394
 
448
395
  case 41:
449
396
  extraConfig = result.global.extraConfig;
450
- _context6.next = 44;
397
+ _context4.next = 44;
451
398
  return dispatch.displayConfig.setConfig((0, _extends2["default"])({}, extraConfig, {
452
399
  alarmSwitch: result.global.alarmSwitch,
453
400
  alarmListDefaultOpen: result.global.alarmListDefaultOpen
@@ -461,8 +408,8 @@ function _default(topoApp) {
461
408
  globalConfig: extraConfig
462
409
  }), topoData = _combTopoData.topoData, resAndMetrics = _combTopoData.resAndMetrics; // rlog.debug("topoMod.initTopoData combTopoData", { topoData, resAndMetrics, });
463
410
 
464
- _context6.next = 47;
465
- return _this5.update({
411
+ _context4.next = 47;
412
+ return _this3.update({
466
413
  currentTopo: topoData.config,
467
414
  data: result,
468
415
  globalConfig: extraConfig,
@@ -477,15 +424,15 @@ function _default(topoApp) {
477
424
 
478
425
  topoApp.alarm.open(); // 加载标注悬浮框数据
479
426
 
480
- _context6.next = 52;
427
+ _context4.next = 52;
481
428
  return Promise.all([(0, _getTopoData.addLinkData)(result), topoApp.ciTyeCache.load((0, _topoData.getCiTypes)(result)), topoApp.elementTagTipConfig.init(result) // 暂停新配置开发
482
429
  ]);
483
430
 
484
431
  case 52:
485
- _yield$Promise$all = _context6.sent;
432
+ _yield$Promise$all = _context4.sent;
486
433
  newData = _yield$Promise$all[0];
487
- _context6.next = 56;
488
- return _this5.update({
434
+ _context4.next = 56;
435
+ return _this3.update({
489
436
  data: newData
490
437
  });
491
438
 
@@ -500,15 +447,15 @@ function _default(topoApp) {
500
447
 
501
448
  topoApp.options.onLoad();
502
449
 
503
- _this5.update({
450
+ _this3.update({
504
451
  loading: false
505
452
  });
506
453
 
507
454
  case 62:
508
455
  case "end":
509
- return _context6.stop();
456
+ return _context4.stop();
510
457
  }
511
- }, _callee6);
458
+ }, _callee4);
512
459
  }))();
513
460
  },
514
461
 
@@ -516,21 +463,21 @@ function _default(topoApp) {
516
463
  * 刷新拓扑图
517
464
  */
518
465
  refreshTopo: function refreshTopo(payload, rootState) {
519
- var _this6 = this;
466
+ var _this4 = this;
520
467
 
521
- return (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee7() {
468
+ return (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee5() {
522
469
  var _payload, clear;
523
470
 
524
- return _regenerator["default"].wrap(function _callee7$(_context7) {
525
- while (1) switch (_context7.prev = _context7.next) {
471
+ return _regenerator["default"].wrap(function _callee5$(_context5) {
472
+ while (1) switch (_context5.prev = _context5.next) {
526
473
  case 0:
527
474
  if (payload === void 0) {
528
475
  payload = {};
529
476
  }
530
477
 
531
478
  _payload = payload, clear = _payload.clear;
532
- _context7.next = 4;
533
- return _this6.initTopoData({
479
+ _context5.next = 4;
480
+ return _this4.initTopoData({
534
481
  topoId: rootState.topoMod.topoId,
535
482
  refresh: true,
536
483
  clear: clear
@@ -538,18 +485,18 @@ function _default(topoApp) {
538
485
 
539
486
  case 4:
540
487
  case "end":
541
- return _context7.stop();
488
+ return _context5.stop();
542
489
  }
543
- }, _callee7);
490
+ }, _callee5);
544
491
  }))();
545
492
  },
546
493
  operationTopoPage: function operationTopoPage(conditions, state) {
547
- var _this7 = this;
494
+ var _this5 = this;
548
495
 
549
- return (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee8() {
496
+ return (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee6() {
550
497
  var td;
551
- return _regenerator["default"].wrap(function _callee8$(_context8) {
552
- while (1) switch (_context8.prev = _context8.next) {
498
+ return _regenerator["default"].wrap(function _callee6$(_context6) {
499
+ while (1) switch (_context6.prev = _context6.next) {
553
500
  case 0:
554
501
  if (conditions === void 0) {
555
502
  conditions = {};
@@ -557,7 +504,7 @@ function _default(topoApp) {
557
504
 
558
505
  if (conditions.id === state.topoMod.topoId) {
559
506
  if (conditions.type === 'delete') {
560
- _this7.update({
507
+ _this5.update({
561
508
  topoId: conditions.defId
562
509
  });
563
510
  }
@@ -569,7 +516,7 @@ function _default(topoApp) {
569
516
  })
570
517
  });
571
518
 
572
- _this7.update({
519
+ _this5.update({
573
520
  topoData: td
574
521
  });
575
522
  }
@@ -577,29 +524,29 @@ function _default(topoApp) {
577
524
 
578
525
  case 2:
579
526
  case "end":
580
- return _context8.stop();
527
+ return _context6.stop();
581
528
  }
582
- }, _callee8);
529
+ }, _callee6);
583
530
  }))();
584
531
  },
585
532
  openPermissionSetting: function openPermissionSetting(payload, rootState) {
586
- return (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee9() {
587
- return _regenerator["default"].wrap(function _callee9$(_context9) {
588
- while (1) switch (_context9.prev = _context9.next) {
533
+ return (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee7() {
534
+ return _regenerator["default"].wrap(function _callee7$(_context7) {
535
+ while (1) switch (_context7.prev = _context7.next) {
589
536
  case 0:
590
537
  dispatch.permissionSetting.open();
591
538
 
592
539
  case 1:
593
540
  case "end":
594
- return _context9.stop();
541
+ return _context7.stop();
595
542
  }
596
- }, _callee9);
543
+ }, _callee7);
597
544
  }))();
598
545
  },
599
546
  updateDelId: function updateDelId(conditions, state) {
600
- return (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee10() {
601
- return _regenerator["default"].wrap(function _callee10$(_context10) {
602
- while (1) switch (_context10.prev = _context10.next) {
547
+ return (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee8() {
548
+ return _regenerator["default"].wrap(function _callee8$(_context8) {
549
+ while (1) switch (_context8.prev = _context8.next) {
603
550
  case 0:
604
551
  if (conditions === void 0) {
605
552
  conditions = '';
@@ -609,53 +556,53 @@ function _default(topoApp) {
609
556
 
610
557
  case 2:
611
558
  case "end":
612
- return _context10.stop();
559
+ return _context8.stop();
613
560
  }
614
- }, _callee10);
561
+ }, _callee8);
615
562
  }))();
616
563
  },
617
564
  getTopoPermission: function getTopoPermission(playload, rootState) {
618
- var _this8 = this;
565
+ var _this6 = this;
619
566
 
620
- return (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee11() {
567
+ return (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee9() {
621
568
  var id, update, topoPermission;
622
- return _regenerator["default"].wrap(function _callee11$(_context11) {
623
- while (1) switch (_context11.prev = _context11.next) {
569
+ return _regenerator["default"].wrap(function _callee9$(_context9) {
570
+ while (1) switch (_context9.prev = _context9.next) {
624
571
  case 0:
625
572
  id = playload.id, update = playload.update;
626
- _context11.prev = 1;
627
- _context11.next = 4;
573
+ _context9.prev = 1;
574
+ _context9.next = 4;
628
575
  return topoApp.serverApi.auth.getTopoPermission(id);
629
576
 
630
577
  case 4:
631
- topoPermission = _context11.sent;
578
+ topoPermission = _context9.sent;
632
579
 
633
580
  _componentTopologyUtils.rlog.debug('查询拓扑权限', topoPermission);
634
581
 
635
- _context11.next = 11;
582
+ _context9.next = 11;
636
583
  break;
637
584
 
638
585
  case 8:
639
- _context11.prev = 8;
640
- _context11.t0 = _context11["catch"](1);
586
+ _context9.prev = 8;
587
+ _context9.t0 = _context9["catch"](1);
641
588
 
642
- _componentTopologyUtils.rlog.error("\u67E5\u8BE2\u62D3\u6251" + id + "\u7684\u6743\u9650\u5931\u8D25", _context11.t0); // 尚未区分拓扑图不存在还是接口请求报错
589
+ _componentTopologyUtils.rlog.error("\u67E5\u8BE2\u62D3\u6251" + id + "\u7684\u6743\u9650\u5931\u8D25", _context9.t0); // 尚未区分拓扑图不存在还是接口请求报错
643
590
 
644
591
 
645
592
  case 11:
646
593
  if (update !== false) {
647
- _this8.update({
594
+ _this6.update({
648
595
  topoPermission: topoPermission
649
596
  });
650
597
  }
651
598
 
652
- return _context11.abrupt("return", topoPermission);
599
+ return _context9.abrupt("return", topoPermission);
653
600
 
654
601
  case 13:
655
602
  case "end":
656
- return _context11.stop();
603
+ return _context9.stop();
657
604
  }
658
- }, _callee11, null, [[1, 8]]);
605
+ }, _callee9, null, [[1, 8]]);
659
606
  }))();
660
607
  }
661
608
  };
@@ -3,17 +3,27 @@
3
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
4
 
5
5
  exports.__esModule = true;
6
+ exports.isCustomEdge = isCustomEdge;
6
7
  exports.updateEdgeExpanded = void 0;
7
8
 
8
9
  var _rlog = _interopRequireDefault(require("@riil-frontend/component-topology-utils/es/rlog"));
9
10
 
10
11
  var _linkUtils = require("../models/utils/linkUtils");
11
12
 
13
+ /**
14
+ * 是否手工连线
15
+ * @param {*} edge
16
+ */
17
+ function isCustomEdge(edge) {
18
+ return !edge.isEdgeGroupAgent() && (edge.a('type') == 'line' || !edge.a('type'));
19
+ }
12
20
  /**
13
21
  * 根据配置更新连线展开折叠状态
14
22
  *
15
23
  * @param {*} topo
16
24
  */
25
+
26
+
17
27
  var updateEdgeExpanded = function updateEdgeExpanded(topo) {
18
28
  var _topo$historyManager, _topo$historyManager2;
19
29