@riil-frontend/component-topology 12.0.0-dev.9 → 12.0.2

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 (94) 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 +59 -4
  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 +17 -3
  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 -7
  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 -39
  22. package/es/core/models/Alarm.js +68 -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/services/topo/basic.js +2 -2
  29. package/es/core/store/models/topoConfig.js +7 -10
  30. package/es/core/store/models/topoMod.js +81 -134
  31. package/es/core/utils/edgeUtil.js +8 -0
  32. package/es/core/utils/metricUtil.js +8 -4
  33. package/es/core/utils/showGraphManageStatusUtil.js +3 -2
  34. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/EventsCard.js +51 -13
  35. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/LinkTopo.module.scss +1 -1
  36. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/LinkTopoCard.js +2 -2
  37. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/index.module.scss +8 -0
  38. package/es/core/viewer/components/plugins/ViewerPlugin.js +3 -1
  39. package/es/core/viewer/components/titlebar/widgets/AlarmButton.js +1 -5
  40. package/es/networkTopo/components/TopoView.js +6 -11
  41. package/es/networkTopo/hooks/useEdgeExpand.js +2 -3
  42. package/es/networkTopo/services/topo/basic.js +3 -3
  43. package/es/networkTopo/store/topoCenter.js +260 -223
  44. package/es/style.js +1 -1
  45. package/es/utils/ResourceConfigUtil.js +3 -36
  46. package/es/utils/ciRefAttributeTranslateUtil.d.ts +9 -2
  47. package/es/utils/ciRefAttributeTranslateUtil.js +8 -9
  48. package/es/utils/topoData.js +1 -1
  49. package/lib/components/TemplateButton/index.module.scss +1 -1
  50. package/lib/core/components/AlarmListPanel/components/AlarmListItem.js +61 -4
  51. package/lib/core/components/TopoView/topoView.js +5 -1
  52. package/lib/core/editor/components/Toolbar/widgets/EdgeColorButton/EdgeColorButton.js +6 -12
  53. package/lib/core/editor/components/Toolbar/widgets/EdgeTypeButton/EdgeType.js +27 -9
  54. package/lib/core/editor/components/Toolbar/widgets/EdgeTypeButton/EdgeType.module.scss +21 -1
  55. package/lib/core/editor/components/Toolbar/widgets/EdgeTypeButton/LineType.js +8 -0
  56. package/lib/core/editor/components/Toolbar/widgets/EdgeTypeButton/index.js +1 -1
  57. package/lib/core/editor/components/Toolbar/widgets/Layout/index.js +16 -2
  58. package/lib/core/editor/hooks/useKeyboardShortcut.js +2 -0
  59. package/lib/core/editor/utils/copyElementUtil.js +15 -0
  60. package/lib/core/editor/utils/edgeTypeStyleUtil.js +8 -6
  61. package/lib/core/hooks/useAlarm.js +130 -79
  62. package/lib/core/hooks/useCmpLinkAlarm.js +166 -0
  63. package/lib/core/hooks/useEventData.js +1 -2
  64. package/lib/core/hooks/useGraphAlarmDisplay.js +91 -55
  65. package/lib/core/hooks/useResourceConfig.js +1 -3
  66. package/lib/core/hooks/useTopoEdit.js +30 -38
  67. package/lib/core/models/Alarm.js +68 -144
  68. package/lib/core/models/AttributeMetricDisplay.js +10 -2
  69. package/lib/core/models/TopoApp.js +1 -1
  70. package/lib/core/models/cache/CiCache.d.ts +1 -1
  71. package/lib/core/models/cache/CiCache.js +3 -3
  72. package/lib/core/models/topoData.js +0 -1
  73. package/lib/core/services/topo/basic.js +2 -2
  74. package/lib/core/store/models/topoConfig.js +7 -10
  75. package/lib/core/store/models/topoMod.js +81 -134
  76. package/lib/core/utils/edgeUtil.js +10 -0
  77. package/lib/core/utils/metricUtil.js +8 -4
  78. package/lib/core/utils/showGraphManageStatusUtil.js +3 -2
  79. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/EventsCard.js +52 -13
  80. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/LinkTopo.module.scss +1 -1
  81. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/LinkTopoCard.js +2 -2
  82. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/index.module.scss +8 -0
  83. package/lib/core/viewer/components/plugins/ViewerPlugin.js +3 -1
  84. package/lib/core/viewer/components/titlebar/widgets/AlarmButton.js +1 -5
  85. package/lib/networkTopo/components/TopoView.js +5 -14
  86. package/lib/networkTopo/hooks/useEdgeExpand.js +2 -3
  87. package/lib/networkTopo/services/topo/basic.js +3 -3
  88. package/lib/networkTopo/store/topoCenter.js +262 -225
  89. package/lib/style.js +1 -1
  90. package/lib/utils/ResourceConfigUtil.js +3 -38
  91. package/lib/utils/ciRefAttributeTranslateUtil.d.ts +9 -2
  92. package/lib/utils/ciRefAttributeTranslateUtil.js +8 -9
  93. package/lib/utils/topoData.js +1 -1
  94. package/package.json +2 -2
@@ -383,33 +383,26 @@ var useTopoEdit = function useTopoEdit(params) {
383
383
  var _ref4 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee4(node) {
384
384
  var _node$getEdges$toArra, _node$getEdges;
385
385
 
386
- var config, edges, exportLinkIdList;
386
+ var edges;
387
387
  return _regenerator["default"].wrap(function _callee4$(_context4) {
388
388
  while (1) switch (_context4.prev = _context4.next) {
389
389
  case 0:
390
- config = resourceConfig.getConfig(); // console.log("删除关联在节点上的出口链路- node, config", node, config);
390
+ // console.log("删除关联在节点上的出口链路- node, config", node, config);
391
+ edges = (_node$getEdges$toArra = (_node$getEdges = node.getEdges()) === null || _node$getEdges === void 0 ? void 0 : _node$getEdges.toArray()) !== null && _node$getEdges$toArra !== void 0 ? _node$getEdges$toArra : [];
391
392
 
392
- edges = (_node$getEdges$toArra = (_node$getEdges = node.getEdges()) === null || _node$getEdges === void 0 ? void 0 : _node$getEdges.toArray()) !== null && _node$getEdges$toArra !== void 0 ? _node$getEdges$toArra : []; // const exLink = [];
393
+ if (edges.length > 0) {
394
+ edges.map(function (edge) {
395
+ if (edge.getTag()) {
396
+ var link = topo.dataModel.getDataById(edge.getTag());
393
397
 
394
- if (!(edges.length > 0)) {
395
- _context4.next = 8;
396
- break;
398
+ if (link && (0, _linkUtils.isExitLink)(link)) {
399
+ topo.getGraphView().dm().remove(edge);
400
+ }
401
+ }
402
+ });
397
403
  }
398
404
 
399
- exportLinkIdList = [].concat(config.exportLinkIdList); //console.log("删除关联在节点上的出口链路- edges", edges,exportLinkIdList);
400
-
401
- edges.map(function (edge) {
402
- if (edge.a("dtype") === "link" && exportLinkIdList.indexOf(edge.getTag()) >= 0) {
403
- // exLink.push(edge);
404
- topo.getGraphView().dm().remove(edge);
405
- exportLinkIdList.splice(config.exportLinkIdList.indexOf(edge.getTag()), 1);
406
- }
407
- });
408
- config.exportLinkIdList = exportLinkIdList;
409
- _context4.next = 8;
410
- return resourceConfig.updateConfig(config);
411
-
412
- case 8:
405
+ case 2:
413
406
  case "end":
414
407
  return _context4.stop();
415
408
  }
@@ -873,7 +866,9 @@ var useTopoEdit = function useTopoEdit(params) {
873
866
  return _regenerator["default"].wrap(function _callee8$(_context8) {
874
867
  while (1) switch (_context8.prev = _context8.next) {
875
868
  case 0:
876
- dm = htTopo.getGraphView().dm(); // 创建
869
+ dm = htTopo.getGraphView().dm(); // 移除旧节点。先删除后创建,解决ip节点替换ping资源后链路丢失问题
870
+
871
+ dm.remove(node); // 创建
877
872
 
878
873
  newLinkElements = findUNExistedLinkElements(elements);
879
874
  createElementsData = null;
@@ -935,22 +930,13 @@ var useTopoEdit = function useTopoEdit(params) {
935
930
 
936
931
 
937
932
  sm = htTopo.getGraphView().sm();
938
- sm.setSelection([newElement]); // 移除旧节点
933
+ sm.setSelection([newElement]); // 临时放这里,仅拓扑中心有
939
934
 
940
- dm.remove(node); // saveBind(TopoEvent.DATA_TYPE_RESOURCE_SINGLE, newDatas);
941
- // node.a("customName", null);
942
- // 删除关联在节点上的出口链路
943
-
944
- _context8.next = 12;
945
- return deleteExLink(node);
946
-
947
- case 12:
948
- // 临时放这里,仅拓扑中心有
949
935
  if (topo.linkDynamicStyleExecutor) {
950
936
  topo.linkDynamicStyleExecutor.execute();
951
937
  }
952
938
 
953
- case 13:
939
+ case 11:
954
940
  case "end":
955
941
  return _context8.stop();
956
942
  }
@@ -1015,11 +1001,12 @@ var useTopoEdit = function useTopoEdit(params) {
1015
1001
  break;
1016
1002
  }
1017
1003
 
1004
+ topo.historyManager.endTransaction();
1005
+
1018
1006
  _message["default"].error("关联资源失败");
1019
1007
 
1020
- _rlog["default"].warn("关联资源失败");
1008
+ _rlog["default"].error("关联资源失败");
1021
1009
 
1022
- topo.historyManager.endTransaction();
1023
1010
  return _context9.abrupt("return", false);
1024
1011
 
1025
1012
  case 23:
@@ -1051,7 +1038,7 @@ var useTopoEdit = function useTopoEdit(params) {
1051
1038
 
1052
1039
  function _relateNodeIp() {
1053
1040
  _relateNodeIp = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee15(txtValue, nodeElement) {
1054
- var dm, isUnique, ip, configObj, configData, _elements2, newLinkElements, newLink, newLinkGroup, createElementsData, _htTopo;
1041
+ var dm, isUnique, ipNodeData, configObj, configData, _elements2, newLinkElements, newLink, newLinkGroup, createElementsData, _htTopo;
1055
1042
 
1056
1043
  return _regenerator["default"].wrap(function _callee15$(_context15) {
1057
1044
  while (1) switch (_context15.prev = _context15.next) {
@@ -1077,12 +1064,12 @@ var useTopoEdit = function useTopoEdit(params) {
1077
1064
  break;
1078
1065
  }
1079
1066
 
1080
- ip = (0, _exitLinkUtil.buildIpNode)(txtValue);
1067
+ ipNodeData = (0, _exitLinkUtil.buildIpNode)(txtValue);
1081
1068
  _context15.next = 8;
1082
1069
  return deleteExLink(nodeElement);
1083
1070
 
1084
1071
  case 8:
1085
- nodeElement.a(ip);
1072
+ nodeElement.a(ipNodeData);
1086
1073
  nodeElement.setName(txtValue);
1087
1074
  nodeElement.setTag("ip:" + txtValue); // 获取配置
1088
1075
 
@@ -1119,7 +1106,12 @@ var useTopoEdit = function useTopoEdit(params) {
1119
1106
  if ([].concat(newLink, newLinkGroup).length > 0) {
1120
1107
  _htTopo = topo.getHtTopo();
1121
1108
 
1122
- _htTopo.createElements(createElementsData);
1109
+ _htTopo.createElements(createElementsData); // 临时放这里,仅拓扑中心有
1110
+
1111
+
1112
+ if (topo.linkDynamicStyleExecutor) {
1113
+ topo.linkDynamicStyleExecutor.execute();
1114
+ }
1123
1115
  }
1124
1116
 
1125
1117
  case 24:
@@ -96,8 +96,7 @@ var Alarm = /*#__PURE__*/function () {
96
96
 
97
97
  _componentTopologyUtils.rlog.info('Alarm.open 打开告警通道', id);
98
98
 
99
- this.openTopoAlarm(id); // this.hmGetTopoAlarm(id);
100
-
99
+ this.openTopoAlarm(id);
101
100
  this.hmGetTopoAlarmByDoc(id);
102
101
  }
103
102
  /**
@@ -227,85 +226,6 @@ var Alarm = /*#__PURE__*/function () {
227
226
  }
228
227
 
229
228
  return hmGetTopoAlarmByDoc;
230
- }();
231
-
232
- _proto.hmGetTopoAlarm = /*#__PURE__*/function () {
233
- var _hmGetTopoAlarm = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee3(id) {
234
- var mainCiIdList, endTime, startTime, parms, result;
235
- return _regenerator["default"].wrap(function _callee3$(_context3) {
236
- while (1) switch (_context3.prev = _context3.next) {
237
- case 0:
238
- mainCiIdList = this.topo.dataModel.getDatas().filter(function (ci) {
239
- return !!ci.operation;
240
- }) // 过滤掉权限
241
- .map(function (ci) {
242
- return ci.id;
243
- });
244
-
245
- if (!(mainCiIdList.length === 0)) {
246
- _context3.next = 4;
247
- break;
248
- }
249
-
250
- this.updateState({
251
- alarmData: [],
252
- alarmPanelIsOpen: false
253
- });
254
- return _context3.abrupt("return");
255
-
256
- case 4:
257
- //rlog.debug("获取告警列表", mainCiIdList);
258
- endTime = null; // new Date().valueOf();
259
-
260
- startTime = null; // moment().subtract(1, "months").valueOf();
261
-
262
- parms = {
263
- mainCiIdList: mainCiIdList,
264
- alertStatusList: ['toDeal', 'dealing'],
265
- pageNum: 1,
266
- pageSize: 10,
267
- sortField: 'alertLevel',
268
- alertLevelList: [],
269
- orders: [{
270
- property: 'alertLevel',
271
- direction: 'ASC'
272
- }, {
273
- property: 'createTime',
274
- direction: 'DESC'
275
- }],
276
- createTime: {
277
- startTime: startTime,
278
- endTime: endTime
279
- }
280
- };
281
- _context3.next = 9;
282
- return _topo["default"].getAlarmByIds(parms);
283
-
284
- case 9:
285
- result = _context3.sent;
286
-
287
- _componentTopologyUtils.rlog.debug('getAlarmById-result', result); // if (alarmIsOpened) {
288
- // //this.topo.loadAlarm(result.datas);
289
- // this.handleAlarmEvent({ type: "alarm", data: result.datas });
290
- // }
291
- // this.updateState({
292
- // alarmData: result.datas.length > 0 ? result.datas : [],
293
- // alarmPanelIsOpen: result.datas.length > 0,
294
- // });
295
-
296
-
297
- case 11:
298
- case "end":
299
- return _context3.stop();
300
- }
301
- }, _callee3, this);
302
- }));
303
-
304
- function hmGetTopoAlarm(_x2) {
305
- return _hmGetTopoAlarm.apply(this, arguments);
306
- }
307
-
308
- return hmGetTopoAlarm;
309
229
  }()
310
230
  /**
311
231
  * 直接装载告警数据(可装载mock列表)
@@ -316,9 +236,9 @@ var Alarm = /*#__PURE__*/function () {
316
236
  _proto.setAlarmDataByMock =
317
237
  /*#__PURE__*/
318
238
  function () {
319
- var _setAlarmDataByMock = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee4(datas) {
320
- return _regenerator["default"].wrap(function _callee4$(_context4) {
321
- while (1) switch (_context4.prev = _context4.next) {
239
+ var _setAlarmDataByMock = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee3(datas) {
240
+ return _regenerator["default"].wrap(function _callee3$(_context3) {
241
+ while (1) switch (_context3.prev = _context3.next) {
322
242
  case 0:
323
243
  this.updateState({
324
244
  alarmData: datas.length > 0 ? datas : [],
@@ -327,12 +247,12 @@ var Alarm = /*#__PURE__*/function () {
327
247
 
328
248
  case 1:
329
249
  case "end":
330
- return _context4.stop();
250
+ return _context3.stop();
331
251
  }
332
- }, _callee4, this);
252
+ }, _callee3, this);
333
253
  }));
334
254
 
335
- function setAlarmDataByMock(_x3) {
255
+ function setAlarmDataByMock(_x2) {
336
256
  return _setAlarmDataByMock.apply(this, arguments);
337
257
  }
338
258
 
@@ -347,10 +267,10 @@ var Alarm = /*#__PURE__*/function () {
347
267
  _proto.switchAlarmPopPanel =
348
268
  /*#__PURE__*/
349
269
  function () {
350
- var _switchAlarmPopPanel = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee5(flag) {
270
+ var _switchAlarmPopPanel = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee4(flag) {
351
271
  var topoDispatchers;
352
- return _regenerator["default"].wrap(function _callee5$(_context5) {
353
- while (1) switch (_context5.prev = _context5.next) {
272
+ return _regenerator["default"].wrap(function _callee4$(_context4) {
273
+ while (1) switch (_context4.prev = _context4.next) {
354
274
  case 0:
355
275
  // console.log("switchAlarmPopPanel", flag);
356
276
  topoDispatchers = this.topo.store.getModelDispatchers('topoAlarm');
@@ -360,12 +280,12 @@ var Alarm = /*#__PURE__*/function () {
360
280
 
361
281
  case 2:
362
282
  case "end":
363
- return _context5.stop();
283
+ return _context4.stop();
364
284
  }
365
- }, _callee5, this);
285
+ }, _callee4, this);
366
286
  }));
367
287
 
368
- function switchAlarmPopPanel(_x4) {
288
+ function switchAlarmPopPanel(_x3) {
369
289
  return _switchAlarmPopPanel.apply(this, arguments);
370
290
  }
371
291
 
@@ -381,21 +301,21 @@ var Alarm = /*#__PURE__*/function () {
381
301
  _proto.openTopoAlarm =
382
302
  /*#__PURE__*/
383
303
  function () {
384
- var _openTopoAlarm = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee6(id) {
304
+ var _openTopoAlarm = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee5(id) {
385
305
  var _this$getState2, alarmOpening, topoAlarmIsOpen, alarmDispatchers;
386
306
 
387
- return _regenerator["default"].wrap(function _callee6$(_context6) {
388
- while (1) switch (_context6.prev = _context6.next) {
307
+ return _regenerator["default"].wrap(function _callee5$(_context5) {
308
+ while (1) switch (_context5.prev = _context5.next) {
389
309
  case 0:
390
310
  // 如果当前拓扑图开启中或已开启则退出
391
311
  _this$getState2 = this.getState(), alarmOpening = _this$getState2.alarmOpening, topoAlarmIsOpen = _this$getState2.topoAlarmIsOpen;
392
312
 
393
313
  if (!(this.currentTopoId === id && (topoAlarmIsOpen || alarmOpening))) {
394
- _context6.next = 3;
314
+ _context5.next = 3;
395
315
  break;
396
316
  }
397
317
 
398
- return _context6.abrupt("return");
318
+ return _context5.abrupt("return");
399
319
 
400
320
  case 3:
401
321
  this.currentTopoId = id;
@@ -403,16 +323,16 @@ var Alarm = /*#__PURE__*/function () {
403
323
  alarmOpening: true
404
324
  });
405
325
  alarmDispatchers = this.topo.store.getModelDispatchers('topoAlarm');
406
- _context6.next = 8;
326
+ _context5.next = 8;
407
327
  return alarmDispatchers.resetAlarmDoc();
408
328
 
409
329
  case 8:
410
- _context6.prev = 8;
411
- _context6.next = 11;
330
+ _context5.prev = 8;
331
+ _context5.next = 11;
412
332
  return this.topo.serverApi.openTopoAlarm(id);
413
333
 
414
334
  case 11:
415
- this.secretKey = _context6.sent;
335
+ this.secretKey = _context5.sent;
416
336
 
417
337
  _componentTopologyUtils.rlog.info('openTopoAlarm 打开拓扑告警推送-------------------开始');
418
338
 
@@ -420,12 +340,12 @@ var Alarm = /*#__PURE__*/function () {
420
340
  alarmOpening: false,
421
341
  alarmIsOpened: true
422
342
  });
423
- _context6.next = 20;
343
+ _context5.next = 20;
424
344
  break;
425
345
 
426
346
  case 16:
427
- _context6.prev = 16;
428
- _context6.t0 = _context6["catch"](8);
347
+ _context5.prev = 16;
348
+ _context5.t0 = _context5["catch"](8);
429
349
 
430
350
  _componentTopologyUtils.rlog.error('打开拓扑告警推送 失败');
431
351
 
@@ -435,12 +355,12 @@ var Alarm = /*#__PURE__*/function () {
435
355
 
436
356
  case 20:
437
357
  case "end":
438
- return _context6.stop();
358
+ return _context5.stop();
439
359
  }
440
- }, _callee6, this, [[8, 16]]);
360
+ }, _callee5, this, [[8, 16]]);
441
361
  }));
442
362
 
443
- function openTopoAlarm(_x5) {
363
+ function openTopoAlarm(_x4) {
444
364
  return _openTopoAlarm.apply(this, arguments);
445
365
  }
446
366
 
@@ -456,21 +376,21 @@ var Alarm = /*#__PURE__*/function () {
456
376
  _proto.closeTopoAlarm =
457
377
  /*#__PURE__*/
458
378
  function () {
459
- var _closeTopoAlarm = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee7(id) {
379
+ var _closeTopoAlarm = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee6(id) {
460
380
  var _this$getState3, alarmIsOpened, alarmOpening;
461
381
 
462
- return _regenerator["default"].wrap(function _callee7$(_context7) {
463
- while (1) switch (_context7.prev = _context7.next) {
382
+ return _regenerator["default"].wrap(function _callee6$(_context6) {
383
+ while (1) switch (_context6.prev = _context6.next) {
464
384
  case 0:
465
385
  // 如果未开启则退出
466
386
  _this$getState3 = this.getState(), alarmIsOpened = _this$getState3.alarmIsOpened, alarmOpening = _this$getState3.alarmOpening;
467
387
 
468
388
  if (!(!alarmIsOpened && !alarmOpening)) {
469
- _context7.next = 3;
389
+ _context6.next = 3;
470
390
  break;
471
391
  }
472
392
 
473
- return _context7.abrupt("return");
393
+ return _context6.abrupt("return");
474
394
 
475
395
  case 3:
476
396
  this.currentTopoId = null;
@@ -482,17 +402,17 @@ var Alarm = /*#__PURE__*/function () {
482
402
  alarmOpening: false,
483
403
  alarmPanelIsOpen: false
484
404
  });
485
- _context7.next = 8;
405
+ _context6.next = 8;
486
406
  return this.topo.serverApi.closeTopoAlarm(id, this.secretKey);
487
407
 
488
408
  case 8:
489
409
  case "end":
490
- return _context7.stop();
410
+ return _context6.stop();
491
411
  }
492
- }, _callee7, this);
412
+ }, _callee6, this);
493
413
  }));
494
414
 
495
- function closeTopoAlarm(_x6) {
415
+ function closeTopoAlarm(_x5) {
496
416
  return _closeTopoAlarm.apply(this, arguments);
497
417
  }
498
418
 
@@ -517,20 +437,20 @@ var Alarm = /*#__PURE__*/function () {
517
437
  _proto.restart =
518
438
  /*#__PURE__*/
519
439
  function () {
520
- var _restart = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee8() {
440
+ var _restart = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee7() {
521
441
  var id;
522
- return _regenerator["default"].wrap(function _callee8$(_context8) {
523
- while (1) switch (_context8.prev = _context8.next) {
442
+ return _regenerator["default"].wrap(function _callee7$(_context7) {
443
+ while (1) switch (_context7.prev = _context7.next) {
524
444
  case 0:
525
445
  id = this.currentTopoId;
526
- _context8.next = 3;
446
+ _context7.next = 3;
527
447
  return this.openTopoAlarm(id);
528
448
 
529
449
  case 3:
530
450
  case "end":
531
- return _context8.stop();
451
+ return _context7.stop();
532
452
  }
533
- }, _callee8, this);
453
+ }, _callee7, this);
534
454
  }));
535
455
 
536
456
  function restart() {
@@ -547,26 +467,28 @@ var Alarm = /*#__PURE__*/function () {
547
467
  _proto.handleAlarmEvent =
548
468
  /*#__PURE__*/
549
469
  function () {
550
- var _handleAlarmEvent = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee9(alertData) {
470
+ var _handleAlarmEvent = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee8(alertData) {
551
471
  var _this$getState4, alarmIsOpened, resAndMetrics, resIdsList, nodeIdsList, linkIdsList, alarmDispatchers, sendAl, idsList, operations, _yield$alarmDispatche2, eqFlag, alarmlist, _this$topo$viewProps, _this$topo$viewProps2;
552
472
 
553
- return _regenerator["default"].wrap(function _callee9$(_context9) {
554
- while (1) switch (_context9.prev = _context9.next) {
473
+ return _regenerator["default"].wrap(function _callee8$(_context8) {
474
+ while (1) switch (_context8.prev = _context8.next) {
555
475
  case 0:
556
476
  _this$getState4 = this.getState(), alarmIsOpened = _this$getState4.alarmIsOpened;
557
477
  resAndMetrics = this.topo.store.getState().topoMod.resAndMetrics;
558
478
  resIdsList = resAndMetrics.resIdsList, nodeIdsList = resAndMetrics.nodeIdsList, linkIdsList = resAndMetrics.linkIdsList;
559
479
  alarmDispatchers = this.topo.store.getModelDispatchers('topoAlarm'); // 添加事件
560
- // console.log("handleAlarmEvent-接收到推送的原始告警信息", alertData);
480
+
481
+ console.log("handleAlarmEvent-接收到推送的原始告警信息", alertData);
561
482
 
562
483
  if (!((0, _utils.isAvailableArray)(alertData) && (0, _utils.isAvailableArray)(resIdsList))) {
563
- _context9.next = 24;
484
+ _context8.next = 25;
564
485
  break;
565
486
  }
566
487
 
567
488
  sendAl = [];
568
489
  idsList = [].concat(nodeIdsList, linkIdsList);
569
- operations = [];
490
+ operations = []; // console.log('idsList---------', idsList)
491
+
570
492
  idsList.forEach(function (idItem) {
571
493
  if (idItem.operation === null) {
572
494
  operations.push(idItem.ciId);
@@ -576,6 +498,7 @@ var Alarm = /*#__PURE__*/function () {
576
498
  var _item$resourceId;
577
499
 
578
500
  var ciId = (_item$resourceId = item.resourceId) !== null && _item$resourceId !== void 0 ? _item$resourceId : item.ciId;
501
+ var isSub = false;
579
502
  var obj = {
580
503
  id: ciId,
581
504
  level: item.alertLevel,
@@ -584,7 +507,8 @@ var Alarm = /*#__PURE__*/function () {
584
507
  obj: item,
585
508
  info: item.alertType,
586
509
  ciCode: item === null || item === void 0 ? void 0 : item.ciCode,
587
- ruleId: item === null || item === void 0 ? void 0 : item.ruleId
510
+ ruleId: item === null || item === void 0 ? void 0 : item.ruleId,
511
+ isSub: isSub
588
512
  };
589
513
 
590
514
  if (resIdsList.indexOf(ciId) >= 0 && operations.indexOf(ciId) < 0) {
@@ -593,20 +517,20 @@ var Alarm = /*#__PURE__*/function () {
593
517
  }); // console.log("before-combAlarmData", sendAl, idsList);
594
518
 
595
519
  if (!(sendAl.length > 0)) {
596
- _context9.next = 24;
520
+ _context8.next = 25;
597
521
  break;
598
522
  }
599
523
 
600
524
  _componentTopologyUtils.rlog.debug('过滤掉非本拓扑的告警信息 告警开关-推送告警到ht-alarmIsOpened-sendAl', alarmIsOpened, sendAl);
601
525
 
602
- _context9.prev = 12;
603
- _context9.next = 15;
526
+ _context8.prev = 13;
527
+ _context8.next = 16;
604
528
  return alarmDispatchers.combAlarmData({
605
529
  alarmdata: sendAl
606
530
  });
607
531
 
608
- case 15:
609
- _yield$alarmDispatche2 = _context9.sent;
532
+ case 16:
533
+ _yield$alarmDispatche2 = _context8.sent;
610
534
  eqFlag = _yield$alarmDispatche2.eqFlag;
611
535
  alarmlist = _yield$alarmDispatche2.alarmlist;
612
536
 
@@ -626,23 +550,23 @@ var Alarm = /*#__PURE__*/function () {
626
550
  }
627
551
  }
628
552
 
629
- _context9.next = 24;
553
+ _context8.next = 25;
630
554
  break;
631
555
 
632
- case 21:
633
- _context9.prev = 21;
634
- _context9.t0 = _context9["catch"](12);
556
+ case 22:
557
+ _context8.prev = 22;
558
+ _context8.t0 = _context8["catch"](13);
635
559
 
636
- _componentTopologyUtils.rlog.error('告警发送异常', _context9.t0);
560
+ _componentTopologyUtils.rlog.error('告警发送异常', _context8.t0);
637
561
 
638
- case 24:
562
+ case 25:
639
563
  case "end":
640
- return _context9.stop();
564
+ return _context8.stop();
641
565
  }
642
- }, _callee9, this, [[12, 21]]);
566
+ }, _callee8, this, [[13, 22]]);
643
567
  }));
644
568
 
645
- function handleAlarmEvent(_x7) {
569
+ function handleAlarmEvent(_x6) {
646
570
  return _handleAlarmEvent.apply(this, arguments);
647
571
  }
648
572
 
@@ -539,7 +539,9 @@ var AttributeMetricDisplay = /*#__PURE__*/function () {
539
539
  return (0, _extends2["default"])({}, item, {
540
540
  tags: tags
541
541
  });
542
- }); // rlog.debug(`AttributeMetricDisplay.updateTagsTips ${new Date().toLocaleString()}`, elementTagsAndTips);
542
+ });
543
+
544
+ _componentTopologyUtils.rlog.debug('推送标注 => ht', elementTagsAndTips);
543
545
 
544
546
  var htTopo = topo.getHtTopo();
545
547
 
@@ -547,7 +549,13 @@ var AttributeMetricDisplay = /*#__PURE__*/function () {
547
549
  var _topo$historyManager, _topo$historyManager2;
548
550
 
549
551
  (_topo$historyManager = topo.historyManager) === null || _topo$historyManager === void 0 ? void 0 : _topo$historyManager.setDisabled(true, '加载标注');
550
- htTopo.loadTagAndTip(JSON.parse(JSON.stringify(elementTagsAndTips)));
552
+
553
+ try {
554
+ htTopo.loadTagAndTip(JSON.parse(JSON.stringify(elementTagsAndTips)));
555
+ } catch (error) {
556
+ _componentTopologyUtils.rlog.error('推送标注 => ht 失败', error);
557
+ }
558
+
551
559
  (_topo$historyManager2 = topo.historyManager) === null || _topo$historyManager2 === void 0 ? void 0 : _topo$historyManager2.setDisabled(false, '加载标注');
552
560
  }
553
561
  }
@@ -54,7 +54,7 @@ var _SelectionModel = _interopRequireDefault(require("./SelectionModel"));
54
54
  var _CiCache = _interopRequireDefault(require("./cache/CiCache"));
55
55
 
56
56
  // eslint-disable-next-line no-undef
57
- var version = typeof "12.0.0-dev.9" === 'string' ? "12.0.0-dev.9" : null;
57
+ var version = typeof "12.0.2" === 'string' ? "12.0.2" : null;
58
58
  console.info("\u62D3\u6251\u7248\u672C: " + version);
59
59
  /**
60
60
  * 拓扑显示和编辑
@@ -11,7 +11,7 @@ declare class CiCache {
11
11
  * @param ids {string[]}
12
12
  * @returns {Promise<Object>}
13
13
  */
14
- load(ids: string[]): Promise<Object>;
14
+ load(ids: string[], refreshCiCache?: boolean): Promise<Object>;
15
15
  getCi(id: string): Object;
16
16
  }
17
17
  declare const _default: CiCache;
@@ -32,14 +32,14 @@ var CiCache = /*#__PURE__*/function () {
32
32
  _proto.load =
33
33
  /*#__PURE__*/
34
34
  function () {
35
- var _load = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee(ids) {
35
+ var _load = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee(ids, refreshCiCache) {
36
36
  var _this = this;
37
37
 
38
38
  var unloadCiIds, cis, map;
39
39
  return _regenerator["default"].wrap(function _callee$(_context) {
40
40
  while (1) switch (_context.prev = _context.next) {
41
41
  case 0:
42
- unloadCiIds = ids.filter(function (id) {
42
+ unloadCiIds = refreshCiCache === true ? ids : ids.filter(function (id) {
43
43
  return !_this.ciMap[id];
44
44
  });
45
45
 
@@ -71,7 +71,7 @@ var CiCache = /*#__PURE__*/function () {
71
71
  }, _callee, this);
72
72
  }));
73
73
 
74
- function load(_x) {
74
+ function load(_x, _x2) {
75
75
  return _load.apply(this, arguments);
76
76
  }
77
77
 
@@ -124,7 +124,6 @@ function _saveTopo() {
124
124
  return topoService.bindResourceToTopo(topoId, {
125
125
  groups: groupInfo,
126
126
  linkIps: linkIps,
127
- // exportLinkIdList,
128
127
  relateTopoIdList: relateTopoIdList
129
128
  });
130
129
 
@@ -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: