@riil-frontend/component-topology 12.0.0-dev.8 → 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 (98) 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 +51 -58
  22. package/es/core/models/Alarm.js +69 -142
  23. package/es/core/models/AttributeMetricDisplay.js +14 -5
  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/cache/CiTypeCache.js +4 -0
  28. package/es/core/models/topoData.js +0 -1
  29. package/es/core/models/utils/linkUtils.js +20 -13
  30. package/es/core/services/index.js +1 -1
  31. package/es/core/services/topo/basic.js +2 -2
  32. package/es/core/store/models/topoConfig.js +7 -10
  33. package/es/core/store/models/topoMod.js +81 -134
  34. package/es/core/utils/edgeUtil.js +8 -0
  35. package/es/core/utils/metricUtil.js +8 -4
  36. package/es/core/utils/showGraphManageStatusUtil.js +3 -2
  37. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/EventsCard.js +12 -13
  38. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/LinkTopoCard.js +2 -2
  39. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/hooks/useAlarmAndRiskData.js +20 -18
  40. package/es/core/viewer/components/plugins/ViewerPlugin.js +3 -1
  41. package/es/core/viewer/components/titlebar/widgets/AlarmButton.js +1 -5
  42. package/es/networkTopo/components/TopoView.js +6 -11
  43. package/es/networkTopo/hooks/useEdgeExpand.js +2 -3
  44. package/es/networkTopo/services/topo/basic.js +3 -3
  45. package/es/networkTopo/store/topoCenter.js +260 -223
  46. package/es/style.js +1 -1
  47. package/es/utils/ResourceConfigUtil.js +3 -36
  48. package/es/utils/ciRefAttributeTranslateUtil.d.ts +19 -0
  49. package/es/utils/ciRefAttributeTranslateUtil.js +155 -0
  50. package/es/utils/topoData.js +4 -2
  51. package/lib/components/TemplateButton/index.module.scss +1 -1
  52. package/lib/core/components/AlarmListPanel/components/AlarmListItem.js +60 -3
  53. package/lib/core/components/TopoView/topoView.js +5 -1
  54. package/lib/core/editor/components/Toolbar/widgets/EdgeColorButton/EdgeColorButton.js +6 -12
  55. package/lib/core/editor/components/Toolbar/widgets/EdgeTypeButton/EdgeType.js +27 -9
  56. package/lib/core/editor/components/Toolbar/widgets/EdgeTypeButton/EdgeType.module.scss +21 -1
  57. package/lib/core/editor/components/Toolbar/widgets/EdgeTypeButton/LineType.js +8 -0
  58. package/lib/core/editor/components/Toolbar/widgets/EdgeTypeButton/index.js +1 -1
  59. package/lib/core/editor/components/Toolbar/widgets/Layout/index.js +16 -2
  60. package/lib/core/editor/hooks/useKeyboardShortcut.js +2 -0
  61. package/lib/core/editor/utils/copyElementUtil.js +15 -0
  62. package/lib/core/editor/utils/edgeTypeStyleUtil.js +8 -31
  63. package/lib/core/hooks/useAlarm.js +130 -79
  64. package/lib/core/hooks/useCmpLinkAlarm.js +166 -0
  65. package/lib/core/hooks/useEventData.js +1 -2
  66. package/lib/core/hooks/useGraphAlarmDisplay.js +91 -55
  67. package/lib/core/hooks/useResourceConfig.js +1 -3
  68. package/lib/core/hooks/useTopoEdit.js +50 -57
  69. package/lib/core/models/Alarm.js +69 -144
  70. package/lib/core/models/AttributeMetricDisplay.js +16 -4
  71. package/lib/core/models/TopoApp.js +1 -1
  72. package/lib/core/models/cache/CiCache.d.ts +1 -1
  73. package/lib/core/models/cache/CiCache.js +3 -3
  74. package/lib/core/models/cache/CiTypeCache.js +4 -0
  75. package/lib/core/models/topoData.js +0 -1
  76. package/lib/core/models/utils/linkUtils.js +21 -13
  77. package/lib/core/services/index.js +1 -1
  78. package/lib/core/services/topo/basic.js +2 -2
  79. package/lib/core/store/models/topoConfig.js +7 -10
  80. package/lib/core/store/models/topoMod.js +81 -134
  81. package/lib/core/utils/edgeUtil.js +10 -0
  82. package/lib/core/utils/metricUtil.js +8 -4
  83. package/lib/core/utils/showGraphManageStatusUtil.js +3 -2
  84. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/EventsCard.js +12 -13
  85. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/LinkTopoCard.js +2 -2
  86. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/hooks/useAlarmAndRiskData.js +20 -18
  87. package/lib/core/viewer/components/plugins/ViewerPlugin.js +3 -1
  88. package/lib/core/viewer/components/titlebar/widgets/AlarmButton.js +1 -5
  89. package/lib/networkTopo/components/TopoView.js +5 -14
  90. package/lib/networkTopo/hooks/useEdgeExpand.js +2 -3
  91. package/lib/networkTopo/services/topo/basic.js +3 -3
  92. package/lib/networkTopo/store/topoCenter.js +262 -225
  93. package/lib/style.js +1 -1
  94. package/lib/utils/ResourceConfigUtil.js +3 -38
  95. package/lib/utils/ciRefAttributeTranslateUtil.d.ts +19 -0
  96. package/lib/utils/ciRefAttributeTranslateUtil.js +168 -0
  97. package/lib/utils/topoData.js +4 -2
  98. package/package.json +3 -3
@@ -208,76 +208,23 @@ export default function (topoApp) {
208
208
  enterEditMode: function enterEditMode(playload, rootState) {
209
209
  topoApp.enterEditMode();
210
210
  },
211
- openDefaultTopoPage: function openDefaultTopoPage(conditions, rootState) {
212
- var _this3 = this;
213
-
211
+ refreshPermission: function refreshPermission() {
214
212
  return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3() {
215
- var topoId, treeData;
216
213
  return _regeneratorRuntime.wrap(function _callee3$(_context3) {
217
214
  while (1) switch (_context3.prev = _context3.next) {
218
215
  case 0:
219
- if (conditions === void 0) {
220
- conditions = {};
221
- }
222
-
223
- topoId = rootState.topoTreeMod.defId;
224
-
225
- if (!topoId) {
226
- // 查找第一个
227
- treeData = rootState.topoTreeMod.treeData;
228
- loopTreeByKey(treeData, 'type', 1, function (item, index, arr) {
229
- if (!topoId) {
230
- topoId = item.id;
231
- }
232
- });
233
- } // 右侧切换拓扑图
234
-
235
-
236
- _this3.openTopoPage({
237
- id: topoId
238
- });
239
-
240
- case 4:
241
- case "end":
242
- return _context3.stop();
243
- }
244
- }, _callee3);
245
- }))();
246
- },
247
- refreshPermission: function refreshPermission() {
248
- var _this4 = this;
249
-
250
- return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee4() {
251
- return _regeneratorRuntime.wrap(function _callee4$(_context4) {
252
- while (1) switch (_context4.prev = _context4.next) {
253
- case 0:
254
- _context4.next = 2;
216
+ _context3.next = 2;
255
217
  return dispatch.functionAuth.refresh();
256
218
 
257
219
  case 2:
258
- _context4.next = 4;
259
- return _this4.refreshTopoTree();
260
-
261
- case 4:
262
- case "end":
263
- return _context4.stop();
264
- }
265
- }, _callee4);
266
- }))();
267
- },
268
- refreshTopoTree: function refreshTopoTree() {
269
- return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee5() {
270
- return _regeneratorRuntime.wrap(function _callee5$(_context5) {
271
- while (1) switch (_context5.prev = _context5.next) {
272
- case 0:
273
- _context5.next = 2;
220
+ _context3.next = 4;
274
221
  return dispatch.topoTreeMod.refreshTree();
275
222
 
276
- case 2:
223
+ case 4:
277
224
  case "end":
278
- return _context5.stop();
225
+ return _context3.stop();
279
226
  }
280
- }, _callee5);
227
+ }, _callee3);
281
228
  }))();
282
229
  },
283
230
 
@@ -292,19 +239,19 @@ export default function (topoApp) {
292
239
  * @return {Promise<void>}
293
240
  */
294
241
  initTopoData: function initTopoData(props, state) {
295
- var _this5 = this;
242
+ var _this3 = this;
296
243
 
297
- return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee6() {
244
+ return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee4() {
298
245
  var _result$config;
299
246
 
300
247
  var startTime, topoId, data, linkToData, refresh, clear, linkTo, startState, permission, result, graphConfig, topoConfig, extraConfig, _combTopoData, topoData, resAndMetrics, _yield$Promise$all, newData, endTime;
301
248
 
302
- return _regeneratorRuntime.wrap(function _callee6$(_context6) {
303
- while (1) switch (_context6.prev = _context6.next) {
249
+ return _regeneratorRuntime.wrap(function _callee4$(_context4) {
250
+ while (1) switch (_context4.prev = _context4.next) {
304
251
  case 0:
305
252
  startTime = moment();
306
253
  topoId = props.topoId, data = props.data, linkToData = props.linkTo, refresh = props.refresh, clear = props.clear;
307
- _context6.next = 4;
254
+ _context4.next = 4;
308
255
  return topoApp.open(topoId);
309
256
 
310
257
  case 4:
@@ -327,7 +274,7 @@ export default function (topoApp) {
327
274
  });
328
275
  }
329
276
 
330
- _this5.update(startState);
277
+ _this3.update(startState);
331
278
 
332
279
  dispatch.topoBizMod.update({
333
280
  pollingSwitch: false
@@ -337,24 +284,24 @@ export default function (topoApp) {
337
284
  permission = 'write';
338
285
 
339
286
  if (!topoApp.options.usePermission) {
340
- _context6.next = 19;
287
+ _context4.next = 19;
341
288
  break;
342
289
  }
343
290
 
344
- _context6.next = 14;
345
- return _this5.getTopoPermission({
291
+ _context4.next = 14;
292
+ return _this3.getTopoPermission({
346
293
  id: topoId
347
294
  });
348
295
 
349
296
  case 14:
350
- permission = _context6.sent;
297
+ permission = _context4.sent;
351
298
 
352
299
  if (topoPermissonUtil.isReadable(permission)) {
353
- _context6.next = 19;
300
+ _context4.next = 19;
354
301
  break;
355
302
  }
356
303
 
357
- _this5.update({
304
+ _this3.update({
358
305
  loading: false,
359
306
  topoData: null,
360
307
  data: null,
@@ -363,26 +310,26 @@ export default function (topoApp) {
363
310
  });
364
311
 
365
312
  topoApp.options.onLoad();
366
- return _context6.abrupt("return");
313
+ return _context4.abrupt("return");
367
314
 
368
315
  case 19:
369
316
  if (!data) {
370
- _context6.next = 30;
317
+ _context4.next = 30;
371
318
  break;
372
319
  }
373
320
 
374
321
  graphConfig = {};
375
322
 
376
323
  if (!topoId) {
377
- _context6.next = 27;
324
+ _context4.next = 27;
378
325
  break;
379
326
  }
380
327
 
381
- _context6.next = 24;
328
+ _context4.next = 24;
382
329
  return topoService.getTopoData(topoId);
383
330
 
384
331
  case 24:
385
- topoConfig = _context6.sent;
332
+ topoConfig = _context4.sent;
386
333
  if (!topoConfig) rlog.error("\u672A\u67E5\u8BE2\u5230\u62D3\u6251id " + topoId + " \u7684\u6570\u636E\uFF0C\u8BF7\u68C0\u67E5");
387
334
  graphConfig = {
388
335
  global: topoConfig === null || topoConfig === void 0 ? void 0 : topoConfig.global,
@@ -392,23 +339,23 @@ export default function (topoApp) {
392
339
 
393
340
  case 27:
394
341
  result = _extends({}, data, graphConfig);
395
- _context6.next = 33;
342
+ _context4.next = 33;
396
343
  break;
397
344
 
398
345
  case 30:
399
- _context6.next = 32;
346
+ _context4.next = 32;
400
347
  return topoApp.options.loadData(topoId, topoApp.serverApi);
401
348
 
402
349
  case 32:
403
- result = _context6.sent;
350
+ result = _context4.sent;
404
351
 
405
352
  case 33:
406
353
  if (result) {
407
- _context6.next = 37;
354
+ _context4.next = 37;
408
355
  break;
409
356
  }
410
357
 
411
- _this5.update({
358
+ _this3.update({
412
359
  loading: false,
413
360
  data: null,
414
361
  globalConfig: null,
@@ -417,17 +364,17 @@ export default function (topoApp) {
417
364
  });
418
365
 
419
366
  topoApp.options.onLoad();
420
- return _context6.abrupt("return");
367
+ return _context4.abrupt("return");
421
368
 
422
369
  case 37:
423
370
  result = parseTopoData(result);
424
371
  rlog.debug('topoMod.initTopoData 查询数据完成', topoId, linkTo, result);
425
- _context6.next = 41;
372
+ _context4.next = 41;
426
373
  return dispatch.customIcon.loadCustomIcons();
427
374
 
428
375
  case 41:
429
376
  extraConfig = result.global.extraConfig;
430
- _context6.next = 44;
377
+ _context4.next = 44;
431
378
  return dispatch.displayConfig.setConfig(_extends({}, extraConfig, {
432
379
  alarmSwitch: result.global.alarmSwitch,
433
380
  alarmListDefaultOpen: result.global.alarmListDefaultOpen
@@ -441,8 +388,8 @@ export default function (topoApp) {
441
388
  globalConfig: extraConfig
442
389
  }), topoData = _combTopoData.topoData, resAndMetrics = _combTopoData.resAndMetrics; // rlog.debug("topoMod.initTopoData combTopoData", { topoData, resAndMetrics, });
443
390
 
444
- _context6.next = 47;
445
- return _this5.update({
391
+ _context4.next = 47;
392
+ return _this3.update({
446
393
  currentTopo: topoData.config,
447
394
  data: result,
448
395
  globalConfig: extraConfig,
@@ -457,15 +404,15 @@ export default function (topoApp) {
457
404
 
458
405
  topoApp.alarm.open(); // 加载标注悬浮框数据
459
406
 
460
- _context6.next = 52;
407
+ _context4.next = 52;
461
408
  return Promise.all([addLinkData(result), topoApp.ciTyeCache.load(getCiTypes(result)), topoApp.elementTagTipConfig.init(result) // 暂停新配置开发
462
409
  ]);
463
410
 
464
411
  case 52:
465
- _yield$Promise$all = _context6.sent;
412
+ _yield$Promise$all = _context4.sent;
466
413
  newData = _yield$Promise$all[0];
467
- _context6.next = 56;
468
- return _this5.update({
414
+ _context4.next = 56;
415
+ return _this3.update({
469
416
  data: newData
470
417
  });
471
418
 
@@ -478,15 +425,15 @@ export default function (topoApp) {
478
425
  rlog.info('topoMod.initTopoData 初始化拓扑图数据完成. 耗时: ', endTime.diff(startTime, 'seconds', true));
479
426
  topoApp.options.onLoad();
480
427
 
481
- _this5.update({
428
+ _this3.update({
482
429
  loading: false
483
430
  });
484
431
 
485
432
  case 62:
486
433
  case "end":
487
- return _context6.stop();
434
+ return _context4.stop();
488
435
  }
489
- }, _callee6);
436
+ }, _callee4);
490
437
  }))();
491
438
  },
492
439
 
@@ -494,21 +441,21 @@ export default function (topoApp) {
494
441
  * 刷新拓扑图
495
442
  */
496
443
  refreshTopo: function refreshTopo(payload, rootState) {
497
- var _this6 = this;
444
+ var _this4 = this;
498
445
 
499
- return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee7() {
446
+ return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee5() {
500
447
  var _payload, clear;
501
448
 
502
- return _regeneratorRuntime.wrap(function _callee7$(_context7) {
503
- while (1) switch (_context7.prev = _context7.next) {
449
+ return _regeneratorRuntime.wrap(function _callee5$(_context5) {
450
+ while (1) switch (_context5.prev = _context5.next) {
504
451
  case 0:
505
452
  if (payload === void 0) {
506
453
  payload = {};
507
454
  }
508
455
 
509
456
  _payload = payload, clear = _payload.clear;
510
- _context7.next = 4;
511
- return _this6.initTopoData({
457
+ _context5.next = 4;
458
+ return _this4.initTopoData({
512
459
  topoId: rootState.topoMod.topoId,
513
460
  refresh: true,
514
461
  clear: clear
@@ -516,18 +463,18 @@ export default function (topoApp) {
516
463
 
517
464
  case 4:
518
465
  case "end":
519
- return _context7.stop();
466
+ return _context5.stop();
520
467
  }
521
- }, _callee7);
468
+ }, _callee5);
522
469
  }))();
523
470
  },
524
471
  operationTopoPage: function operationTopoPage(conditions, state) {
525
- var _this7 = this;
472
+ var _this5 = this;
526
473
 
527
- return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee8() {
474
+ return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee6() {
528
475
  var td;
529
- return _regeneratorRuntime.wrap(function _callee8$(_context8) {
530
- while (1) switch (_context8.prev = _context8.next) {
476
+ return _regeneratorRuntime.wrap(function _callee6$(_context6) {
477
+ while (1) switch (_context6.prev = _context6.next) {
531
478
  case 0:
532
479
  if (conditions === void 0) {
533
480
  conditions = {};
@@ -535,7 +482,7 @@ export default function (topoApp) {
535
482
 
536
483
  if (conditions.id === state.topoMod.topoId) {
537
484
  if (conditions.type === 'delete') {
538
- _this7.update({
485
+ _this5.update({
539
486
  topoId: conditions.defId
540
487
  });
541
488
  }
@@ -547,7 +494,7 @@ export default function (topoApp) {
547
494
  })
548
495
  });
549
496
 
550
- _this7.update({
497
+ _this5.update({
551
498
  topoData: td
552
499
  });
553
500
  }
@@ -555,29 +502,29 @@ export default function (topoApp) {
555
502
 
556
503
  case 2:
557
504
  case "end":
558
- return _context8.stop();
505
+ return _context6.stop();
559
506
  }
560
- }, _callee8);
507
+ }, _callee6);
561
508
  }))();
562
509
  },
563
510
  openPermissionSetting: function openPermissionSetting(payload, rootState) {
564
- return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee9() {
565
- return _regeneratorRuntime.wrap(function _callee9$(_context9) {
566
- while (1) switch (_context9.prev = _context9.next) {
511
+ return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee7() {
512
+ return _regeneratorRuntime.wrap(function _callee7$(_context7) {
513
+ while (1) switch (_context7.prev = _context7.next) {
567
514
  case 0:
568
515
  dispatch.permissionSetting.open();
569
516
 
570
517
  case 1:
571
518
  case "end":
572
- return _context9.stop();
519
+ return _context7.stop();
573
520
  }
574
- }, _callee9);
521
+ }, _callee7);
575
522
  }))();
576
523
  },
577
524
  updateDelId: function updateDelId(conditions, state) {
578
- return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee10() {
579
- return _regeneratorRuntime.wrap(function _callee10$(_context10) {
580
- while (1) switch (_context10.prev = _context10.next) {
525
+ return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee8() {
526
+ return _regeneratorRuntime.wrap(function _callee8$(_context8) {
527
+ while (1) switch (_context8.prev = _context8.next) {
581
528
  case 0:
582
529
  if (conditions === void 0) {
583
530
  conditions = '';
@@ -587,49 +534,49 @@ export default function (topoApp) {
587
534
 
588
535
  case 2:
589
536
  case "end":
590
- return _context10.stop();
537
+ return _context8.stop();
591
538
  }
592
- }, _callee10);
539
+ }, _callee8);
593
540
  }))();
594
541
  },
595
542
  getTopoPermission: function getTopoPermission(playload, rootState) {
596
- var _this8 = this;
543
+ var _this6 = this;
597
544
 
598
- return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee11() {
545
+ return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee9() {
599
546
  var id, update, topoPermission;
600
- return _regeneratorRuntime.wrap(function _callee11$(_context11) {
601
- while (1) switch (_context11.prev = _context11.next) {
547
+ return _regeneratorRuntime.wrap(function _callee9$(_context9) {
548
+ while (1) switch (_context9.prev = _context9.next) {
602
549
  case 0:
603
550
  id = playload.id, update = playload.update;
604
- _context11.prev = 1;
605
- _context11.next = 4;
551
+ _context9.prev = 1;
552
+ _context9.next = 4;
606
553
  return topoApp.serverApi.auth.getTopoPermission(id);
607
554
 
608
555
  case 4:
609
- topoPermission = _context11.sent;
556
+ topoPermission = _context9.sent;
610
557
  rlog.debug('查询拓扑权限', topoPermission);
611
- _context11.next = 11;
558
+ _context9.next = 11;
612
559
  break;
613
560
 
614
561
  case 8:
615
- _context11.prev = 8;
616
- _context11.t0 = _context11["catch"](1);
617
- rlog.error("\u67E5\u8BE2\u62D3\u6251" + id + "\u7684\u6743\u9650\u5931\u8D25", _context11.t0); // 尚未区分拓扑图不存在还是接口请求报错
562
+ _context9.prev = 8;
563
+ _context9.t0 = _context9["catch"](1);
564
+ rlog.error("\u67E5\u8BE2\u62D3\u6251" + id + "\u7684\u6743\u9650\u5931\u8D25", _context9.t0); // 尚未区分拓扑图不存在还是接口请求报错
618
565
 
619
566
  case 11:
620
567
  if (update !== false) {
621
- _this8.update({
568
+ _this6.update({
622
569
  topoPermission: topoPermission
623
570
  });
624
571
  }
625
572
 
626
- return _context11.abrupt("return", topoPermission);
573
+ return _context9.abrupt("return", topoPermission);
627
574
 
628
575
  case 13:
629
576
  case "end":
630
- return _context11.stop();
577
+ return _context9.stop();
631
578
  }
632
- }, _callee11, null, [[1, 8]]);
579
+ }, _callee9, null, [[1, 8]]);
633
580
  }))();
634
581
  }
635
582
  };
@@ -1,5 +1,13 @@
1
1
  import rlog from "@riil-frontend/component-topology-utils/es/rlog";
2
2
  import { showLinkByConfig } from "../models/utils/linkUtils";
3
+ /**
4
+ * 是否手工连线
5
+ * @param {*} edge
6
+ */
7
+
8
+ export function isCustomEdge(edge) {
9
+ return !edge.isEdgeGroupAgent() && (edge.a('type') == 'line' || !edge.a('type'));
10
+ }
3
11
  /**
4
12
  * 根据配置更新连线展开折叠状态
5
13
  *
@@ -1,3 +1,4 @@
1
+ import _extends from "@babel/runtime/helpers/extends";
1
2
  import { metricValueFormat } from '@riil-frontend/utils';
2
3
  import DictCache from "../models/cache/DictCache";
3
4
  /**
@@ -15,16 +16,19 @@ export function formatMetric(val, metricModel) {
15
16
  if (metricModel) {
16
17
  var _result$value;
17
18
 
18
- // 分级字典特殊处理
19
- if (metricModel.dict && !DictCache.getDictObject()[metricModel.code]) {
20
- val = metricModel.dict[val];
19
+ var dictObject = _extends({}, DictCache.getDictObject()); // 分级字典特殊处理
20
+
21
+
22
+ if (metricModel.dict) {
23
+ // val = metricModel.dict[val]
24
+ dictObject[metricModel.code] = metricModel.dict;
21
25
  }
22
26
 
23
27
  var result = metricValueFormat({
24
28
  value: val,
25
29
  dataType: metricModel.dataType,
26
30
  changeValue: metricModel.changeValue,
27
- dict: DictCache.getDictObject(),
31
+ dict: dictObject,
28
32
  unit: metricModel.unit,
29
33
  code: metricModel.code
30
34
  });
@@ -4,6 +4,7 @@ export function showManageStatus(options) {
4
4
  var topo = options.topo,
5
5
  resources = options.resources,
6
6
  graphLoaded = options.graphLoaded,
7
+ alarmSwitch = options.alarmSwitch,
7
8
  cisEventLevel = options.cisEventLevel;
8
9
 
9
10
  var hasAlarm = function hasAlarm(id) {
@@ -20,9 +21,9 @@ export function showManageStatus(options) {
20
21
  manageStatus = resource.manageStatus,
21
22
  permission = resource.permission;
22
23
  var isNotMonite = manageStatus === 0;
23
- var readable = !!(permission !== null && permission !== void 0 && permission.readable); // 没有告警且有查看权限,才显示未监控状态
24
+ var readable = !!(permission !== null && permission !== void 0 && permission.readable); // 未监控 && 有查看权限 && (告警静默 || 没有告警),才显示未监控状态
24
25
 
25
- var showUnMoniteStatus = !hasAlarm(id) && isNotMonite && readable;
26
+ var showUnMoniteStatus = isNotMonite && readable && (alarmSwitch === false || !hasAlarm(id));
26
27
  var element = topo.getDataModel().getDataByTag(id);
27
28
  if (!element) return; // ht元素设置是否显示监控状态,是否展示,用于缩小色块时显示未监控颜色
28
29
 
@@ -20,32 +20,31 @@ function EventsCard(props) {
20
20
  onHandleAlarm = props.onHandleAlarm; // 告警table列配置
21
21
 
22
22
  var columns = [{
23
- title: '描述',
24
- dataIndex: 'title',
25
- key: 'title',
23
+ title: "描述",
24
+ dataIndex: "title",
25
+ key: "title",
26
26
  cell: function cell(value, index, record) {
27
27
  return /*#__PURE__*/React.createElement("div", {
28
- className: styles['alarm-title'],
28
+ className: styles["alarm-title"],
29
29
  title: value,
30
30
  onClick: closeDetailDrawer
31
31
  }, /*#__PURE__*/React.createElement(_Icon, {
32
32
  type: record.icon,
33
33
  size: "xs",
34
- className: styles['alarm-color-icon'] + " " + record.className
35
- }), /*#__PURE__*/React.createElement("a", {
36
- className: styles.link,
37
- href: formatUrl(record.link)
34
+ className: styles["alarm-color-icon"] + " " + record.className
35
+ }), /*#__PURE__*/React.createElement(Link, {
36
+ to: formatUrl(record.link)
38
37
  }, value));
39
38
  }
40
39
  }, {
41
- title: '时间',
42
- dataIndex: 'time',
43
- key: 'time',
40
+ title: "时间",
41
+ dataIndex: "time",
42
+ key: "time",
44
43
  width: 144,
45
44
  cell: function cell(value, index, record) {
46
45
  return /*#__PURE__*/React.createElement("div", {
47
- title: moment(value).format('YYYY-MM-DD HH:mm:ss')
48
- }, moment(value).format('YYYY-MM-DD HH:mm:ss'));
46
+ title: moment(value).format("YYYY-MM-DD HH:mm:ss")
47
+ }, moment(value).format("YYYY-MM-DD HH:mm:ss"));
49
48
  }
50
49
  } // 临时屏蔽告警操作列,后续版本按权限显示 2023-3-6 20:23:45
51
50
  // {
@@ -23,8 +23,8 @@ export default function LinkTopoCard(props) {
23
23
  openFlow = _useState[0],
24
24
  setOpenFlow = _useState[1];
25
25
 
26
- var analysisUrl = "../../default/trafficControl/linkConfigure?id=" + data.attributes.name + "&num=0";
27
- var linkDetailsUrl = "/default/pagecenter/linkDetail/view/" + data.id + "?resId=" + data.id + "&domainCode=network&title=" + data.attributes.name + "&ciCode=network_link&tabByComType=uicbb-res-crucial-link-flow";
26
+ var analysisUrl = "../../default/trafficControl/linkConfigure?id=" + encodeURIComponent(data.attributes.display_name) + "&num=0";
27
+ var linkDetailsUrl = "/default/pagecenter/linkDetail/view/" + data.id + "?resId=" + data.id + "&domainCode=network&title=" + encodeURIComponent(data.attributes.display_name) + "&ciCode=network_link&tabByComType=uicbb-res-crucial-link-flow";
28
28
 
29
29
  var isOpenFlows = /*#__PURE__*/function () {
30
30
  var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {