@riil-frontend/component-topology 12.0.0-dev.25 → 12.0.0-dev.27

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 (36) hide show
  1. package/build/index.js +10 -10
  2. package/es/core/editor/components/Toolbar/widgets/Layout/index.js +2 -2
  3. package/es/core/editor/utils/edgeTypeStyleUtil.js +0 -23
  4. package/es/core/hooks/useAlarm.js +131 -81
  5. package/es/core/hooks/useCmpLinkAlarm.js +153 -0
  6. package/es/core/hooks/useEventData.js +1 -2
  7. package/es/core/hooks/useGraphAlarmDisplay.js +36 -23
  8. package/es/core/hooks/useTopoEdit.js +0 -4
  9. package/es/core/models/Alarm.js +60 -145
  10. package/es/core/models/AttributeMetricDisplay.js +1 -1
  11. package/es/core/models/TopoApp.js +1 -1
  12. package/es/core/models/utils/linkUtils.js +20 -13
  13. package/es/core/utils/metricUtil.js +8 -4
  14. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/ResourceOverview.js +11 -5
  15. package/es/core/viewer/components/titlebar/widgets/AlarmButton.js +1 -5
  16. package/es/networkTopo/store/topoCenter.js +260 -223
  17. package/es/style.js +1 -1
  18. package/es/utils/ciRefAttributeTranslateUtil.js +1 -1
  19. package/lib/core/editor/components/Toolbar/widgets/Layout/index.js +1 -1
  20. package/lib/core/editor/utils/edgeTypeStyleUtil.js +0 -25
  21. package/lib/core/hooks/useAlarm.js +130 -79
  22. package/lib/core/hooks/useCmpLinkAlarm.js +166 -0
  23. package/lib/core/hooks/useEventData.js +1 -2
  24. package/lib/core/hooks/useGraphAlarmDisplay.js +36 -22
  25. package/lib/core/hooks/useTopoEdit.js +0 -4
  26. package/lib/core/models/Alarm.js +60 -147
  27. package/lib/core/models/AttributeMetricDisplay.js +1 -1
  28. package/lib/core/models/TopoApp.js +1 -1
  29. package/lib/core/models/utils/linkUtils.js +21 -13
  30. package/lib/core/utils/metricUtil.js +8 -4
  31. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/ResourceOverview.js +13 -5
  32. package/lib/core/viewer/components/titlebar/widgets/AlarmButton.js +1 -5
  33. package/lib/networkTopo/store/topoCenter.js +262 -225
  34. package/lib/style.js +1 -1
  35. package/lib/utils/ciRefAttributeTranslateUtil.js +1 -1
  36. package/package.json +2 -2
@@ -83,8 +83,7 @@ var Alarm = /*#__PURE__*/function () {
83
83
  }
84
84
 
85
85
  rlog.info('Alarm.open 打开告警通道', id);
86
- this.openTopoAlarm(id); // this.hmGetTopoAlarm(id);
87
-
86
+ this.openTopoAlarm(id);
88
87
  this.hmGetTopoAlarmByDoc(id);
89
88
  }
90
89
  /**
@@ -211,83 +210,6 @@ var Alarm = /*#__PURE__*/function () {
211
210
  }
212
211
 
213
212
  return hmGetTopoAlarmByDoc;
214
- }();
215
-
216
- _proto.hmGetTopoAlarm = /*#__PURE__*/function () {
217
- var _hmGetTopoAlarm = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3(id) {
218
- var mainCiIdList, endTime, startTime, parms, result;
219
- return _regeneratorRuntime.wrap(function _callee3$(_context3) {
220
- while (1) switch (_context3.prev = _context3.next) {
221
- case 0:
222
- mainCiIdList = this.topo.dataModel.getDatas().filter(function (ci) {
223
- return !!ci.operation;
224
- }) // 过滤掉权限
225
- .map(function (ci) {
226
- return ci.id;
227
- });
228
-
229
- if (!(mainCiIdList.length === 0)) {
230
- _context3.next = 4;
231
- break;
232
- }
233
-
234
- this.updateState({
235
- alarmData: [],
236
- alarmPanelIsOpen: false
237
- });
238
- return _context3.abrupt("return");
239
-
240
- case 4:
241
- //rlog.debug("获取告警列表", mainCiIdList);
242
- endTime = null; // new Date().valueOf();
243
-
244
- startTime = null; // moment().subtract(1, "months").valueOf();
245
-
246
- parms = {
247
- mainCiIdList: mainCiIdList,
248
- alertStatusList: ['toDeal', 'dealing'],
249
- pageNum: 1,
250
- pageSize: 10,
251
- sortField: 'alertLevel',
252
- alertLevelList: [],
253
- orders: [{
254
- property: 'alertLevel',
255
- direction: 'ASC'
256
- }, {
257
- property: 'createTime',
258
- direction: 'DESC'
259
- }],
260
- createTime: {
261
- startTime: startTime,
262
- endTime: endTime
263
- }
264
- };
265
- _context3.next = 9;
266
- return topoService.getAlarmByIds(parms);
267
-
268
- case 9:
269
- result = _context3.sent;
270
- rlog.debug('getAlarmById-result', result); // if (alarmIsOpened) {
271
- // //this.topo.loadAlarm(result.datas);
272
- // this.handleAlarmEvent({ type: "alarm", data: result.datas });
273
- // }
274
- // this.updateState({
275
- // alarmData: result.datas.length > 0 ? result.datas : [],
276
- // alarmPanelIsOpen: result.datas.length > 0,
277
- // });
278
-
279
- case 11:
280
- case "end":
281
- return _context3.stop();
282
- }
283
- }, _callee3, this);
284
- }));
285
-
286
- function hmGetTopoAlarm(_x2) {
287
- return _hmGetTopoAlarm.apply(this, arguments);
288
- }
289
-
290
- return hmGetTopoAlarm;
291
213
  }()
292
214
  /**
293
215
  * 直接装载告警数据(可装载mock列表)
@@ -298,9 +220,9 @@ var Alarm = /*#__PURE__*/function () {
298
220
  _proto.setAlarmDataByMock =
299
221
  /*#__PURE__*/
300
222
  function () {
301
- var _setAlarmDataByMock = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee4(datas) {
302
- return _regeneratorRuntime.wrap(function _callee4$(_context4) {
303
- while (1) switch (_context4.prev = _context4.next) {
223
+ var _setAlarmDataByMock = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3(datas) {
224
+ return _regeneratorRuntime.wrap(function _callee3$(_context3) {
225
+ while (1) switch (_context3.prev = _context3.next) {
304
226
  case 0:
305
227
  this.updateState({
306
228
  alarmData: datas.length > 0 ? datas : [],
@@ -309,12 +231,12 @@ var Alarm = /*#__PURE__*/function () {
309
231
 
310
232
  case 1:
311
233
  case "end":
312
- return _context4.stop();
234
+ return _context3.stop();
313
235
  }
314
- }, _callee4, this);
236
+ }, _callee3, this);
315
237
  }));
316
238
 
317
- function setAlarmDataByMock(_x3) {
239
+ function setAlarmDataByMock(_x2) {
318
240
  return _setAlarmDataByMock.apply(this, arguments);
319
241
  }
320
242
 
@@ -329,10 +251,10 @@ var Alarm = /*#__PURE__*/function () {
329
251
  _proto.switchAlarmPopPanel =
330
252
  /*#__PURE__*/
331
253
  function () {
332
- var _switchAlarmPopPanel = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee5(flag) {
254
+ var _switchAlarmPopPanel = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee4(flag) {
333
255
  var topoDispatchers;
334
- return _regeneratorRuntime.wrap(function _callee5$(_context5) {
335
- while (1) switch (_context5.prev = _context5.next) {
256
+ return _regeneratorRuntime.wrap(function _callee4$(_context4) {
257
+ while (1) switch (_context4.prev = _context4.next) {
336
258
  case 0:
337
259
  // console.log("switchAlarmPopPanel", flag);
338
260
  topoDispatchers = this.topo.store.getModelDispatchers('topoAlarm');
@@ -342,12 +264,12 @@ var Alarm = /*#__PURE__*/function () {
342
264
 
343
265
  case 2:
344
266
  case "end":
345
- return _context5.stop();
267
+ return _context4.stop();
346
268
  }
347
- }, _callee5, this);
269
+ }, _callee4, this);
348
270
  }));
349
271
 
350
- function switchAlarmPopPanel(_x4) {
272
+ function switchAlarmPopPanel(_x3) {
351
273
  return _switchAlarmPopPanel.apply(this, arguments);
352
274
  }
353
275
 
@@ -363,21 +285,21 @@ var Alarm = /*#__PURE__*/function () {
363
285
  _proto.openTopoAlarm =
364
286
  /*#__PURE__*/
365
287
  function () {
366
- var _openTopoAlarm = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee6(id) {
288
+ var _openTopoAlarm = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee5(id) {
367
289
  var _this$getState2, alarmOpening, topoAlarmIsOpen, alarmDispatchers;
368
290
 
369
- return _regeneratorRuntime.wrap(function _callee6$(_context6) {
370
- while (1) switch (_context6.prev = _context6.next) {
291
+ return _regeneratorRuntime.wrap(function _callee5$(_context5) {
292
+ while (1) switch (_context5.prev = _context5.next) {
371
293
  case 0:
372
294
  // 如果当前拓扑图开启中或已开启则退出
373
295
  _this$getState2 = this.getState(), alarmOpening = _this$getState2.alarmOpening, topoAlarmIsOpen = _this$getState2.topoAlarmIsOpen;
374
296
 
375
297
  if (!(this.currentTopoId === id && (topoAlarmIsOpen || alarmOpening))) {
376
- _context6.next = 3;
298
+ _context5.next = 3;
377
299
  break;
378
300
  }
379
301
 
380
- return _context6.abrupt("return");
302
+ return _context5.abrupt("return");
381
303
 
382
304
  case 3:
383
305
  this.currentTopoId = id;
@@ -385,27 +307,27 @@ var Alarm = /*#__PURE__*/function () {
385
307
  alarmOpening: true
386
308
  });
387
309
  alarmDispatchers = this.topo.store.getModelDispatchers('topoAlarm');
388
- _context6.next = 8;
310
+ _context5.next = 8;
389
311
  return alarmDispatchers.resetAlarmDoc();
390
312
 
391
313
  case 8:
392
- _context6.prev = 8;
393
- _context6.next = 11;
314
+ _context5.prev = 8;
315
+ _context5.next = 11;
394
316
  return this.topo.serverApi.openTopoAlarm(id);
395
317
 
396
318
  case 11:
397
- this.secretKey = _context6.sent;
319
+ this.secretKey = _context5.sent;
398
320
  rlog.info('openTopoAlarm 打开拓扑告警推送-------------------开始');
399
321
  this.updateState({
400
322
  alarmOpening: false,
401
323
  alarmIsOpened: true
402
324
  });
403
- _context6.next = 20;
325
+ _context5.next = 20;
404
326
  break;
405
327
 
406
328
  case 16:
407
- _context6.prev = 16;
408
- _context6.t0 = _context6["catch"](8);
329
+ _context5.prev = 16;
330
+ _context5.t0 = _context5["catch"](8);
409
331
  rlog.error('打开拓扑告警推送 失败');
410
332
  this.updateState({
411
333
  alarmOpening: false
@@ -413,12 +335,12 @@ var Alarm = /*#__PURE__*/function () {
413
335
 
414
336
  case 20:
415
337
  case "end":
416
- return _context6.stop();
338
+ return _context5.stop();
417
339
  }
418
- }, _callee6, this, [[8, 16]]);
340
+ }, _callee5, this, [[8, 16]]);
419
341
  }));
420
342
 
421
- function openTopoAlarm(_x5) {
343
+ function openTopoAlarm(_x4) {
422
344
  return _openTopoAlarm.apply(this, arguments);
423
345
  }
424
346
 
@@ -434,21 +356,21 @@ var Alarm = /*#__PURE__*/function () {
434
356
  _proto.closeTopoAlarm =
435
357
  /*#__PURE__*/
436
358
  function () {
437
- var _closeTopoAlarm = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee7(id) {
359
+ var _closeTopoAlarm = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee6(id) {
438
360
  var _this$getState3, alarmIsOpened, alarmOpening;
439
361
 
440
- return _regeneratorRuntime.wrap(function _callee7$(_context7) {
441
- while (1) switch (_context7.prev = _context7.next) {
362
+ return _regeneratorRuntime.wrap(function _callee6$(_context6) {
363
+ while (1) switch (_context6.prev = _context6.next) {
442
364
  case 0:
443
365
  // 如果未开启则退出
444
366
  _this$getState3 = this.getState(), alarmIsOpened = _this$getState3.alarmIsOpened, alarmOpening = _this$getState3.alarmOpening;
445
367
 
446
368
  if (!(!alarmIsOpened && !alarmOpening)) {
447
- _context7.next = 3;
369
+ _context6.next = 3;
448
370
  break;
449
371
  }
450
372
 
451
- return _context7.abrupt("return");
373
+ return _context6.abrupt("return");
452
374
 
453
375
  case 3:
454
376
  this.currentTopoId = null;
@@ -458,17 +380,17 @@ var Alarm = /*#__PURE__*/function () {
458
380
  alarmOpening: false,
459
381
  alarmPanelIsOpen: false
460
382
  });
461
- _context7.next = 8;
383
+ _context6.next = 8;
462
384
  return this.topo.serverApi.closeTopoAlarm(id, this.secretKey);
463
385
 
464
386
  case 8:
465
387
  case "end":
466
- return _context7.stop();
388
+ return _context6.stop();
467
389
  }
468
- }, _callee7, this);
390
+ }, _callee6, this);
469
391
  }));
470
392
 
471
- function closeTopoAlarm(_x6) {
393
+ function closeTopoAlarm(_x5) {
472
394
  return _closeTopoAlarm.apply(this, arguments);
473
395
  }
474
396
 
@@ -493,20 +415,20 @@ var Alarm = /*#__PURE__*/function () {
493
415
  _proto.restart =
494
416
  /*#__PURE__*/
495
417
  function () {
496
- var _restart = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee8() {
418
+ var _restart = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee7() {
497
419
  var id;
498
- return _regeneratorRuntime.wrap(function _callee8$(_context8) {
499
- while (1) switch (_context8.prev = _context8.next) {
420
+ return _regeneratorRuntime.wrap(function _callee7$(_context7) {
421
+ while (1) switch (_context7.prev = _context7.next) {
500
422
  case 0:
501
423
  id = this.currentTopoId;
502
- _context8.next = 3;
424
+ _context7.next = 3;
503
425
  return this.openTopoAlarm(id);
504
426
 
505
427
  case 3:
506
428
  case "end":
507
- return _context8.stop();
429
+ return _context7.stop();
508
430
  }
509
- }, _callee8, this);
431
+ }, _callee7, this);
510
432
  }));
511
433
 
512
434
  function restart() {
@@ -523,11 +445,11 @@ var Alarm = /*#__PURE__*/function () {
523
445
  _proto.handleAlarmEvent =
524
446
  /*#__PURE__*/
525
447
  function () {
526
- var _handleAlarmEvent = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee9(alertData) {
448
+ var _handleAlarmEvent = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee8(alertData) {
527
449
  var _this$getState4, alarmIsOpened, resAndMetrics, resIdsList, nodeIdsList, linkIdsList, alarmDispatchers, sendAl, idsList, operations, _yield$alarmDispatche2, eqFlag, alarmlist, _this$topo$viewProps, _this$topo$viewProps2;
528
450
 
529
- return _regeneratorRuntime.wrap(function _callee9$(_context9) {
530
- while (1) switch (_context9.prev = _context9.next) {
451
+ return _regeneratorRuntime.wrap(function _callee8$(_context8) {
452
+ while (1) switch (_context8.prev = _context8.next) {
531
453
  case 0:
532
454
  _this$getState4 = this.getState(), alarmIsOpened = _this$getState4.alarmIsOpened;
533
455
  resAndMetrics = this.topo.store.getState().topoMod.resAndMetrics;
@@ -537,7 +459,7 @@ var Alarm = /*#__PURE__*/function () {
537
459
  console.log("handleAlarmEvent-接收到推送的原始告警信息", alertData);
538
460
 
539
461
  if (!(isAvailableArray(alertData) && isAvailableArray(resIdsList))) {
540
- _context9.next = 27;
462
+ _context8.next = 27;
541
463
  break;
542
464
  }
543
465
 
@@ -551,16 +473,10 @@ var Alarm = /*#__PURE__*/function () {
551
473
  }
552
474
  });
553
475
  alertData.forEach(function (item, index) {
554
- var _item$resourceId, _item$alertCode;
476
+ var _item$resourceId;
555
477
 
556
478
  var ciId = (_item$resourceId = item.resourceId) !== null && _item$resourceId !== void 0 ? _item$resourceId : item.ciId;
557
479
  var isSub = false;
558
-
559
- if ((_item$alertCode = item.alertCode) !== null && _item$alertCode !== void 0 && _item$alertCode.startsWith("cmp")) {
560
- ciId = "sub:" + item.mainCiId;
561
- isSub = true;
562
- }
563
-
564
480
  var obj = {
565
481
  id: ciId,
566
482
  level: item.alertLevel,
@@ -575,25 +491,24 @@ var Alarm = /*#__PURE__*/function () {
575
491
 
576
492
  if (resIdsList.indexOf(ciId) >= 0 && operations.indexOf(ciId) < 0) {
577
493
  sendAl.push(obj);
578
- } // const ciId = `${isSub}+${item.resourceId ?? item.ciId}`;
579
-
494
+ }
580
495
  });
581
496
  console.log("before-combAlarmData", sendAl, idsList);
582
497
 
583
498
  if (!(sendAl.length > 0)) {
584
- _context9.next = 27;
499
+ _context8.next = 27;
585
500
  break;
586
501
  }
587
502
 
588
503
  rlog.debug('过滤掉非本拓扑的告警信息 告警开关-推送告警到ht-alarmIsOpened-sendAl', alarmIsOpened, sendAl);
589
- _context9.prev = 15;
590
- _context9.next = 18;
504
+ _context8.prev = 15;
505
+ _context8.next = 18;
591
506
  return alarmDispatchers.combAlarmData({
592
507
  alarmdata: sendAl
593
508
  });
594
509
 
595
510
  case 18:
596
- _yield$alarmDispatche2 = _context9.sent;
511
+ _yield$alarmDispatche2 = _context8.sent;
597
512
  eqFlag = _yield$alarmDispatche2.eqFlag;
598
513
  alarmlist = _yield$alarmDispatche2.alarmlist;
599
514
 
@@ -613,22 +528,22 @@ var Alarm = /*#__PURE__*/function () {
613
528
  }
614
529
  }
615
530
 
616
- _context9.next = 27;
531
+ _context8.next = 27;
617
532
  break;
618
533
 
619
534
  case 24:
620
- _context9.prev = 24;
621
- _context9.t0 = _context9["catch"](15);
622
- rlog.error('告警发送异常', _context9.t0);
535
+ _context8.prev = 24;
536
+ _context8.t0 = _context8["catch"](15);
537
+ rlog.error('告警发送异常', _context8.t0);
623
538
 
624
539
  case 27:
625
540
  case "end":
626
- return _context9.stop();
541
+ return _context8.stop();
627
542
  }
628
- }, _callee9, this, [[15, 24]]);
543
+ }, _callee8, this, [[15, 24]]);
629
544
  }));
630
545
 
631
- function handleAlarmEvent(_x7) {
546
+ function handleAlarmEvent(_x6) {
632
547
  return _handleAlarmEvent.apply(this, arguments);
633
548
  }
634
549
 
@@ -526,7 +526,7 @@ var AttributeMetricDisplay = /*#__PURE__*/function () {
526
526
  tags: tags
527
527
  });
528
528
  });
529
- rlog.debug('推送标注 => ht 失败', elementTagsAndTips);
529
+ rlog.debug('推送标注 => ht', elementTagsAndTips);
530
530
  var htTopo = topo.getHtTopo();
531
531
 
532
532
  if (htTopo) {
@@ -24,7 +24,7 @@ import ElementTagTipConfig from "./tagstips/ElementTagTipConfig";
24
24
  import SelectionModel from "./SelectionModel";
25
25
  import CiCache from "./cache/CiCache"; // eslint-disable-next-line no-undef
26
26
 
27
- var version = typeof "12.0.0-dev.25" === 'string' ? "12.0.0-dev.25" : null;
27
+ var version = typeof "12.0.0-dev.27" === 'string' ? "12.0.0-dev.27" : null;
28
28
  console.info("\u62D3\u6251\u7248\u672C: " + version);
29
29
  /**
30
30
  * 拓扑显示和编辑
@@ -2,8 +2,7 @@ import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
2
2
  import _extends from "@babel/runtime/helpers/extends";
3
3
  import _regeneratorRuntime from "@babel/runtime/regenerator";
4
4
  import keyBy from "lodash/keyBy";
5
- import _ from "lodash";
6
- import { queryCisByIds, queryModelAsset } from "../../services"; // 查询所有连线
5
+ import _ from "lodash"; // 查询所有连线
7
6
 
8
7
  import { getEdges } from "../../../utils/htElementUtils";
9
8
  import CiTypeCache from "../cache/CiTypeCache";
@@ -32,7 +31,20 @@ export function isCrucialLink(link) {
32
31
  */
33
32
 
34
33
  export function isExitLink(link) {
35
- return (link === null || link === void 0 ? void 0 : link.attributes) && !(link !== null && link !== void 0 && link.attributes["destination_id"]);
34
+ var _link$attributes;
35
+
36
+ return (link === null || link === void 0 ? void 0 : (_link$attributes = link.attributes) === null || _link$attributes === void 0 ? void 0 : _link$attributes.destination_type) === "ip";
37
+ }
38
+ /**
39
+ * 是否聚合链路
40
+ * @param {*} link
41
+ * @returns
42
+ */
43
+
44
+ export function isAggLink(link) {
45
+ var _link$attributes2, _link$attributes3;
46
+
47
+ 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";
36
48
  }
37
49
  export function mergeLinksData(links, linkCis, nodes, interfaceCiMap, interfaceDoc) {
38
50
  var linkCiMap = keyBy(links, "id");
@@ -83,7 +95,7 @@ function _getLinksDetail() {
83
95
  return _regeneratorRuntime.wrap(function _callee$(_context) {
84
96
  while (1) switch (_context.prev = _context.next) {
85
97
  case 0:
86
- if (!(!links || !links.length)) {
98
+ if (links !== null && links !== void 0 && links.length) {
87
99
  _context.next = 2;
88
100
  break;
89
101
  }
@@ -91,9 +103,6 @@ function _getLinksDetail() {
91
103
  return _context.abrupt("return", []);
92
104
 
93
105
  case 2:
94
- // const linkCis = await topoService.relation.batchQueryRelation(
95
- // links.map((link) => link.id)
96
- // );
97
106
  linkCis = links;
98
107
  interfaceIds = [].concat(linkCis.map(function (item) {
99
108
  return item.attributes.source_id;
@@ -171,17 +180,15 @@ export var showLinkByConfig = function showLinkByConfig(props) {
171
180
  if (showType === 1 || showType === true) {
172
181
  // 单链路全部显示
173
182
  // console.log("单链路全部显示", edge);
174
- edge.s("2d.visible", true);
183
+ edge.s("x.visible", true);
175
184
  } else {
176
- var _d$attributes, _d$attributes2;
177
-
178
185
  var d = topo.dataModel.getDataById(edge.getTag()); // 判断是否聚合链路
179
186
 
180
- 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") {
181
- edge.s("2d.visible", showAgg);
187
+ if (isAggLink(d)) {
188
+ edge.s("x.visible", showAgg);
182
189
  } else {
183
190
  // console.log("edge", edge, d, showAgg);
184
- edge.s("2d.visible", showPhy);
191
+ edge.s("x.visible", showPhy);
185
192
  }
186
193
  }
187
194
  });
@@ -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
  });
@@ -15,6 +15,7 @@ import moment from 'moment';
15
15
  import React, { useEffect, useMemo, useState } from 'react';
16
16
  import { rlog } from '@riil-frontend/component-topology-utils/lib/rlog';
17
17
  import Link from "../../../../../../../components/Link";
18
+ import { getHistory } from '@riil-frontend/component-topology-utils';
18
19
  import { queryCisByIds, commonQueryCiData } from "../../../../../../services";
19
20
  import service from "../../../../../../services/overview";
20
21
  import BaseInfoBlock from "./BaseInfoBlock";
@@ -153,7 +154,13 @@ export default function ResourceOverview(props) {
153
154
  window.topo_overview_metric_timer = null;
154
155
  }
155
156
  };
156
- }, []); // 跳转前调用关闭操作
157
+ }, []);
158
+
159
+ var jumpTo = function jumpTo(url) {
160
+ getHistory.push(url);
161
+ onClose();
162
+ }; // 跳转前调用关闭操作
163
+
157
164
 
158
165
  function onClose() {
159
166
  isAppTopo && resourceOverviewProps.onClose && resourceOverviewProps.onClose();
@@ -332,14 +339,13 @@ export default function ResourceOverview(props) {
332
339
  return /*#__PURE__*/React.createElement("div", {
333
340
  className: styles['alarm-title'],
334
341
  title: value,
335
- onClick: onClose
342
+ onClick: jumpTo(record.link)
336
343
  }, /*#__PURE__*/React.createElement(_Icon, {
337
344
  type: record.icon,
338
345
  size: "xs",
339
346
  className: styles['alarm-color-icon'] + " " + record.className
340
- }), /*#__PURE__*/React.createElement(Link, {
341
- className: styles.link,
342
- to: formatUrl(record.link)
347
+ }), /*#__PURE__*/React.createElement("span", {
348
+ className: styles.link
343
349
  }, value));
344
350
  }
345
351
  }, {
@@ -5,11 +5,7 @@ import useEventData from "../../../../hooks/useEventData";
5
5
 
6
6
  function AlarmButton(props) {
7
7
  var topo = props.topo;
8
-
9
- var _topo$store$useModel = topo.store.useModel("topoAlarm"),
10
- alarmState = _topo$store$useModel[0],
11
- alarmDispatchers = _topo$store$useModel[1];
12
-
8
+ var alarmState = topo.store.useModelState("topoAlarm");
13
9
  var alarmPanelIsOpen = alarmState.alarmPanelIsOpen;
14
10
  var alarmData = useEventData({
15
11
  topo: topo