@riil-frontend/component-topology 9.0.12 → 9.0.16

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.
@@ -166,6 +166,7 @@ var Alarm = /*#__PURE__*/function () {
166
166
  }).sort(function (a, b) {
167
167
  return a.level > b.level ? 1 : -1;
168
168
  });
169
+ console.log("getAlarms-sb", alarms);
169
170
  return alarms;
170
171
  };
171
172
 
@@ -542,7 +543,7 @@ var Alarm = /*#__PURE__*/function () {
542
543
  // console.log("handleAlarmEvent-接收到推送的原始告警信息", alertData);
543
544
 
544
545
  if (!(isAvailableArray(alertData) && isAvailableArray(resIdsList))) {
545
- _context9.next = 24;
546
+ _context9.next = 27;
546
547
  break;
547
548
  }
548
549
 
@@ -574,26 +575,29 @@ var Alarm = /*#__PURE__*/function () {
574
575
  }
575
576
 
576
577
  return obj;
577
- }); // rlog.debug("before-combAlarmData", al, bizState);
578
+ });
579
+ console.log("before-combAlarmData", sendAl, idsList);
578
580
 
579
581
  if (!(sendAl.length > 0)) {
580
- _context9.next = 24;
582
+ _context9.next = 27;
581
583
  break;
582
584
  }
583
585
 
584
586
  rlog.debug("过滤掉非本拓扑的告警信息 告警开关-推送告警到ht-alarmIsOpened-sendAl", alarmIsOpened, sendAl);
585
- _context9.prev = 12;
586
- _context9.next = 15;
587
+ _context9.prev = 13;
588
+ _context9.next = 16;
587
589
  return alarmDispatchers.combAlarmData({
588
590
  alarmdata: sendAl
589
591
  });
590
592
 
591
- case 15:
593
+ case 16:
592
594
  _yield$alarmDispatche = _context9.sent;
593
595
  eqFlag = _yield$alarmDispatche.eqFlag;
594
596
  alarmlist = _yield$alarmDispatche.alarmlist;
597
+ console.log("handleAlarmEvent", alarmIsOpened, eqFlag);
598
+ console.log("handleAlarmEvent-topo.viewProps", this.topo.viewProps);
595
599
 
596
- if (alarmIsOpened && !eqFlag) {
600
+ if (alarmIsOpened) {
597
601
  this.hmGetTopoAlarmByDoc(); // 通知所有告警
598
602
 
599
603
  if ((_this$topo$viewProps = this.topo.viewProps) !== null && _this$topo$viewProps !== void 0 && _this$topo$viewProps.onAlarm) {
@@ -607,20 +611,20 @@ var Alarm = /*#__PURE__*/function () {
607
611
  }
608
612
  }
609
613
 
610
- _context9.next = 24;
614
+ _context9.next = 27;
611
615
  break;
612
616
 
613
- case 21:
614
- _context9.prev = 21;
615
- _context9.t0 = _context9["catch"](12);
617
+ case 24:
618
+ _context9.prev = 24;
619
+ _context9.t0 = _context9["catch"](13);
616
620
  rlog.error("告警发送异常", _context9.t0);
617
621
 
618
- case 24:
622
+ case 27:
619
623
  case "end":
620
624
  return _context9.stop();
621
625
  }
622
626
  }
623
- }, _callee9, this, [[12, 21]]);
627
+ }, _callee9, this, [[13, 24]]);
624
628
  }));
625
629
 
626
630
  function handleAlarmEvent(_x7) {
@@ -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 "9.0.12" === 'string' ? "9.0.12" : null;
27
+ var version = typeof "9.0.16" === 'string' ? "9.0.16" : null;
28
28
  console.info("\u62D3\u6251\u7248\u672C: " + version);
29
29
  /**
30
30
  * 拓扑显示和编辑
@@ -25,7 +25,7 @@ export default function NetworkBaseInfo(props) {
25
25
  name = data.name;
26
26
  var edge = topo.dataModel.getDataById(id);
27
27
 
28
- var _useState = useState(!!topo.dataModel.getDataById(data.id).attributes['network_link.is_crucial']),
28
+ var _useState = useState(!!edge.attributes['network_link.is_crucial']),
29
29
  defaultChecked = _useState[0],
30
30
  setDefaultChecked = _useState[1];
31
31
 
@@ -34,7 +34,7 @@ export default function NetworkBaseInfo(props) {
34
34
  }
35
35
 
36
36
  var onChanges = function onChanges(checked) {
37
- var defaultCheck = topo.topoCrucialLinkFn([data.id], !checked, setDefaultChecked);
37
+ var defaultCheck = topo.topoCrucialLinkFn([data.id], !checked);
38
38
  };
39
39
 
40
40
  var creatCruialSwitch = function creatCruialSwitch() {
@@ -47,17 +47,17 @@ export default function NetworkBaseInfo(props) {
47
47
 
48
48
  useEffect(function () {
49
49
  setDefaultChecked(!!topo.dataModel.getDataById(data.id).attributes['network_link.is_crucial']);
50
- }, [id, topo.dataModel.getDataById(data.id).attributes['network_link.is_crucial']]);
50
+ }, [id, edge.attributes['network_link.is_crucial']]);
51
51
  var crucialLinkField = null;
52
52
 
53
53
  if (edge) {
54
54
  var targetNode = topo.dataModel.getDataById(edge.target);
55
55
  var sourceNode = topo.dataModel.getDataById(edge.source);
56
- var updateCrucialPermission = sourceNode.permission.writeable && (isExitLink(edge) ? true : targetNode.permission.writeable);
56
+ var updateCrucialPermission = !!!edge.attributes['network_link.is_crucial'] && sourceNode.permission.writeable && (isExitLink(edge) ? true : targetNode.permission.writeable) || !!edge.attributes['network_link.is_crucial'] && edge.permission.deleteable;
57
57
 
58
58
  if (updateCrucialPermission) {
59
59
  crucialLinkField = {
60
- contentTitle: topo.dataModel.getDataById(data.id).attributes['network_link.is_crucial'] ? '是' : '否',
60
+ contentTitle: edge.attributes['network_link.is_crucial'] ? '是' : '否',
61
61
  dataIndex: 'isCrucial',
62
62
  disabledHide: false,
63
63
  hidden: false,
@@ -182,6 +182,7 @@ var Alarm = /*#__PURE__*/function () {
182
182
  }).sort(function (a, b) {
183
183
  return a.level > b.level ? 1 : -1;
184
184
  });
185
+ console.log("getAlarms-sb", alarms);
185
186
  return alarms;
186
187
  };
187
188
 
@@ -564,7 +565,7 @@ var Alarm = /*#__PURE__*/function () {
564
565
  // console.log("handleAlarmEvent-接收到推送的原始告警信息", alertData);
565
566
 
566
567
  if (!((0, _utils.isAvailableArray)(alertData) && (0, _utils.isAvailableArray)(resIdsList))) {
567
- _context9.next = 24;
568
+ _context9.next = 27;
568
569
  break;
569
570
  }
570
571
 
@@ -596,27 +597,30 @@ var Alarm = /*#__PURE__*/function () {
596
597
  }
597
598
 
598
599
  return obj;
599
- }); // rlog.debug("before-combAlarmData", al, bizState);
600
+ });
601
+ console.log("before-combAlarmData", sendAl, idsList);
600
602
 
601
603
  if (!(sendAl.length > 0)) {
602
- _context9.next = 24;
604
+ _context9.next = 27;
603
605
  break;
604
606
  }
605
607
 
606
608
  _rlog["default"].debug("过滤掉非本拓扑的告警信息 告警开关-推送告警到ht-alarmIsOpened-sendAl", alarmIsOpened, sendAl);
607
609
 
608
- _context9.prev = 12;
609
- _context9.next = 15;
610
+ _context9.prev = 13;
611
+ _context9.next = 16;
610
612
  return alarmDispatchers.combAlarmData({
611
613
  alarmdata: sendAl
612
614
  });
613
615
 
614
- case 15:
616
+ case 16:
615
617
  _yield$alarmDispatche = _context9.sent;
616
618
  eqFlag = _yield$alarmDispatche.eqFlag;
617
619
  alarmlist = _yield$alarmDispatche.alarmlist;
620
+ console.log("handleAlarmEvent", alarmIsOpened, eqFlag);
621
+ console.log("handleAlarmEvent-topo.viewProps", this.topo.viewProps);
618
622
 
619
- if (alarmIsOpened && !eqFlag) {
623
+ if (alarmIsOpened) {
620
624
  this.hmGetTopoAlarmByDoc(); // 通知所有告警
621
625
 
622
626
  if ((_this$topo$viewProps = this.topo.viewProps) !== null && _this$topo$viewProps !== void 0 && _this$topo$viewProps.onAlarm) {
@@ -630,21 +634,21 @@ var Alarm = /*#__PURE__*/function () {
630
634
  }
631
635
  }
632
636
 
633
- _context9.next = 24;
637
+ _context9.next = 27;
634
638
  break;
635
639
 
636
- case 21:
637
- _context9.prev = 21;
638
- _context9.t0 = _context9["catch"](12);
640
+ case 24:
641
+ _context9.prev = 24;
642
+ _context9.t0 = _context9["catch"](13);
639
643
 
640
644
  _rlog["default"].error("告警发送异常", _context9.t0);
641
645
 
642
- case 24:
646
+ case 27:
643
647
  case "end":
644
648
  return _context9.stop();
645
649
  }
646
650
  }
647
- }, _callee9, this, [[12, 21]]);
651
+ }, _callee9, this, [[13, 24]]);
648
652
  }));
649
653
 
650
654
  function handleAlarmEvent(_x7) {
@@ -56,7 +56,7 @@ var _SelectionModel = _interopRequireDefault(require("./SelectionModel"));
56
56
  var _CiCache = _interopRequireDefault(require("./cache/CiCache"));
57
57
 
58
58
  // eslint-disable-next-line no-undef
59
- var version = typeof "9.0.12" === 'string' ? "9.0.12" : null;
59
+ var version = typeof "9.0.16" === 'string' ? "9.0.16" : null;
60
60
  console.info("\u62D3\u6251\u7248\u672C: " + version);
61
61
  /**
62
62
  * 拓扑显示和编辑
@@ -42,7 +42,7 @@ function NetworkBaseInfo(props) {
42
42
  name = data.name;
43
43
  var edge = topo.dataModel.getDataById(id);
44
44
 
45
- var _useState = (0, _react.useState)(!!topo.dataModel.getDataById(data.id).attributes['network_link.is_crucial']),
45
+ var _useState = (0, _react.useState)(!!edge.attributes['network_link.is_crucial']),
46
46
  defaultChecked = _useState[0],
47
47
  setDefaultChecked = _useState[1];
48
48
 
@@ -51,7 +51,7 @@ function NetworkBaseInfo(props) {
51
51
  }
52
52
 
53
53
  var onChanges = function onChanges(checked) {
54
- var defaultCheck = topo.topoCrucialLinkFn([data.id], !checked, setDefaultChecked);
54
+ var defaultCheck = topo.topoCrucialLinkFn([data.id], !checked);
55
55
  };
56
56
 
57
57
  var creatCruialSwitch = function creatCruialSwitch() {
@@ -64,17 +64,17 @@ function NetworkBaseInfo(props) {
64
64
 
65
65
  (0, _react.useEffect)(function () {
66
66
  setDefaultChecked(!!topo.dataModel.getDataById(data.id).attributes['network_link.is_crucial']);
67
- }, [id, topo.dataModel.getDataById(data.id).attributes['network_link.is_crucial']]);
67
+ }, [id, edge.attributes['network_link.is_crucial']]);
68
68
  var crucialLinkField = null;
69
69
 
70
70
  if (edge) {
71
71
  var targetNode = topo.dataModel.getDataById(edge.target);
72
72
  var sourceNode = topo.dataModel.getDataById(edge.source);
73
- var updateCrucialPermission = sourceNode.permission.writeable && (isExitLink(edge) ? true : targetNode.permission.writeable);
73
+ var updateCrucialPermission = !!!edge.attributes['network_link.is_crucial'] && sourceNode.permission.writeable && (isExitLink(edge) ? true : targetNode.permission.writeable) || !!edge.attributes['network_link.is_crucial'] && edge.permission.deleteable;
74
74
 
75
75
  if (updateCrucialPermission) {
76
76
  crucialLinkField = {
77
- contentTitle: topo.dataModel.getDataById(data.id).attributes['network_link.is_crucial'] ? '是' : '否',
77
+ contentTitle: edge.attributes['network_link.is_crucial'] ? '是' : '否',
78
78
  dataIndex: 'isCrucial',
79
79
  disabledHide: false,
80
80
  hidden: false,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@riil-frontend/component-topology",
3
- "version": "9.0.12",
3
+ "version": "9.0.16",
4
4
  "description": "拓扑",
5
5
  "scripts": {
6
6
  "start": "build-scripts start",
@@ -116,6 +116,6 @@
116
116
  "access": "public"
117
117
  },
118
118
  "license": "MIT",
119
- "homepage": "https://unpkg.com/@riil-frontend/component-topology@9.0.12/build/index.html",
119
+ "homepage": "https://unpkg.com/@riil-frontend/component-topology@9.0.16/build/index.html",
120
120
  "gitHead": "2da19ffccbb7ca60a8acf396e39f542c68bb33f5"
121
121
  }