@riil-frontend/component-topology 4.0.13 → 4.0.14

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.
@@ -38,6 +38,7 @@ var Alarm = /*#__PURE__*/function () {
38
38
  var _open = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
39
39
  var _this = this;
40
40
 
41
+ var nodeCount;
41
42
  return _regeneratorRuntime.wrap(function _callee$(_context) {
42
43
  while (1) {
43
44
  switch (_context.prev = _context.next) {
@@ -50,23 +51,17 @@ var Alarm = /*#__PURE__*/function () {
50
51
  return _context.abrupt("return");
51
52
 
52
53
  case 2:
53
- this.confirmLargeResourceCount(function () {
54
- // 获得拓扑id
55
- var id = _this.topo.id;
56
-
57
- if (!id) {
58
- return;
59
- }
60
-
61
- rlog.info("Alarm.open 打开告警通道", id);
62
-
63
- _this.openTopoAlarm(id); // this.hmGetTopoAlarm(id);
64
-
65
-
66
- _this.hmGetTopoAlarmByDoc(id);
67
- });
54
+ nodeCount = this.topo.dataModel.getNodes().length;
55
+
56
+ if (nodeCount < 1500 || this.topo.isEditMode()) {
57
+ this.doOpen();
58
+ } else {
59
+ this.confirmOpenWhenLargeResource(function () {
60
+ _this.doOpen();
61
+ });
62
+ }
68
63
 
69
- case 3:
64
+ case 4:
70
65
  case "end":
71
66
  return _context.stop();
72
67
  }
@@ -79,7 +74,21 @@ var Alarm = /*#__PURE__*/function () {
79
74
  }
80
75
 
81
76
  return open;
82
- }()
77
+ }();
78
+
79
+ _proto.doOpen = function doOpen() {
80
+ // 获得拓扑id
81
+ var id = this.topo.id;
82
+
83
+ if (!id) {
84
+ return;
85
+ }
86
+
87
+ rlog.info("Alarm.open 打开告警通道", id);
88
+ this.openTopoAlarm(id); // this.hmGetTopoAlarm(id);
89
+
90
+ this.hmGetTopoAlarmByDoc(id);
91
+ }
83
92
  /**
84
93
  * 关闭告警。
85
94
  *
@@ -88,7 +97,14 @@ var Alarm = /*#__PURE__*/function () {
88
97
  ;
89
98
 
90
99
  _proto.close = function close() {
91
- // 获得拓扑id
100
+ this.updateState({
101
+ alarmPanelIsOpen: false,
102
+ alarmData: [],
103
+ alarmList: [],
104
+ risks: [],
105
+ alarmRecord: []
106
+ }); // 获得拓扑id
107
+
92
108
  var currentTopoId = this.currentTopoId;
93
109
 
94
110
  if (!currentTopoId) {
@@ -98,31 +114,22 @@ var Alarm = /*#__PURE__*/function () {
98
114
  rlog.info("关闭告警通道", currentTopoId); // 取消订阅告警推送
99
115
  // 关闭告警推送通道
100
116
 
101
- this.updateState({
102
- alarmData: [],
103
- alarmPanelIsOpen: false
104
- });
105
117
  this.closeTopoAlarm(currentTopoId);
106
118
  } // 资源数量多时确认是否开启
119
+ // eslint-disable-next-line class-methods-use-this
107
120
  ;
108
121
 
109
- _proto.confirmLargeResourceCount = function confirmLargeResourceCount(cb) {
110
- var nodeCount = this.topo.dataModel.getNodes().length;
111
-
112
- if (nodeCount < 1500 || this.topo.isEditMode()) {
113
- cb();
114
- } else {
115
- _Dialog.confirm({
116
- title: "提示",
117
- messageProps: {
118
- type: "warning"
119
- },
120
- content: "该拓扑图上节点较多,继续查询告警可能影响系统整体性能,是否暂不显示告警?",
121
- onCancel: function onCancel() {
122
- cb();
123
- }
124
- });
125
- }
122
+ _proto.confirmOpenWhenLargeResource = function confirmOpenWhenLargeResource(cb) {
123
+ _Dialog.confirm({
124
+ title: "提示",
125
+ messageProps: {
126
+ type: "warning"
127
+ },
128
+ content: "该拓扑图上节点较多,继续查询告警可能影响系统整体性能,是否暂不显示告警?",
129
+ onCancel: function onCancel() {
130
+ cb();
131
+ }
132
+ });
126
133
  }
127
134
  /**
128
135
  * 查询当前拓扑图有权限资源的告警列表
@@ -21,7 +21,7 @@ import PluginManager from "./PluginManager";
21
21
  import topoFactory from "./topoFactory";
22
22
  import ElementTagTipConfig from "./tagstips/ElementTagTipConfig"; // eslint-disable-next-line no-undef
23
23
 
24
- var version = typeof "4.0.13" === 'string' ? "4.0.13" : null;
24
+ var version = typeof "4.0.14" === 'string' ? "4.0.14" : null;
25
25
  console.info("\u62D3\u6251\u7248\u672C: " + version);
26
26
  /**
27
27
  * 拓扑显示和编辑
@@ -51,6 +51,7 @@ var Alarm = /*#__PURE__*/function () {
51
51
  var _open = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee() {
52
52
  var _this = this;
53
53
 
54
+ var nodeCount;
54
55
  return _regenerator["default"].wrap(function _callee$(_context) {
55
56
  while (1) {
56
57
  switch (_context.prev = _context.next) {
@@ -63,23 +64,17 @@ var Alarm = /*#__PURE__*/function () {
63
64
  return _context.abrupt("return");
64
65
 
65
66
  case 2:
66
- this.confirmLargeResourceCount(function () {
67
- // 获得拓扑id
68
- var id = _this.topo.id;
69
-
70
- if (!id) {
71
- return;
72
- }
73
-
74
- _rlog["default"].info("Alarm.open 打开告警通道", id);
75
-
76
- _this.openTopoAlarm(id); // this.hmGetTopoAlarm(id);
77
-
78
-
79
- _this.hmGetTopoAlarmByDoc(id);
80
- });
67
+ nodeCount = this.topo.dataModel.getNodes().length;
68
+
69
+ if (nodeCount < 1500 || this.topo.isEditMode()) {
70
+ this.doOpen();
71
+ } else {
72
+ this.confirmOpenWhenLargeResource(function () {
73
+ _this.doOpen();
74
+ });
75
+ }
81
76
 
82
- case 3:
77
+ case 4:
83
78
  case "end":
84
79
  return _context.stop();
85
80
  }
@@ -92,7 +87,22 @@ var Alarm = /*#__PURE__*/function () {
92
87
  }
93
88
 
94
89
  return open;
95
- }()
90
+ }();
91
+
92
+ _proto.doOpen = function doOpen() {
93
+ // 获得拓扑id
94
+ var id = this.topo.id;
95
+
96
+ if (!id) {
97
+ return;
98
+ }
99
+
100
+ _rlog["default"].info("Alarm.open 打开告警通道", id);
101
+
102
+ this.openTopoAlarm(id); // this.hmGetTopoAlarm(id);
103
+
104
+ this.hmGetTopoAlarmByDoc(id);
105
+ }
96
106
  /**
97
107
  * 关闭告警。
98
108
  *
@@ -101,7 +111,14 @@ var Alarm = /*#__PURE__*/function () {
101
111
  ;
102
112
 
103
113
  _proto.close = function close() {
104
- // 获得拓扑id
114
+ this.updateState({
115
+ alarmPanelIsOpen: false,
116
+ alarmData: [],
117
+ alarmList: [],
118
+ risks: [],
119
+ alarmRecord: []
120
+ }); // 获得拓扑id
121
+
105
122
  var currentTopoId = this.currentTopoId;
106
123
 
107
124
  if (!currentTopoId) {
@@ -112,31 +129,22 @@ var Alarm = /*#__PURE__*/function () {
112
129
  // 关闭告警推送通道
113
130
 
114
131
 
115
- this.updateState({
116
- alarmData: [],
117
- alarmPanelIsOpen: false
118
- });
119
132
  this.closeTopoAlarm(currentTopoId);
120
133
  } // 资源数量多时确认是否开启
134
+ // eslint-disable-next-line class-methods-use-this
121
135
  ;
122
136
 
123
- _proto.confirmLargeResourceCount = function confirmLargeResourceCount(cb) {
124
- var nodeCount = this.topo.dataModel.getNodes().length;
125
-
126
- if (nodeCount < 1500 || this.topo.isEditMode()) {
127
- cb();
128
- } else {
129
- _dialog["default"].confirm({
130
- title: "提示",
131
- messageProps: {
132
- type: "warning"
133
- },
134
- content: "该拓扑图上节点较多,继续查询告警可能影响系统整体性能,是否暂不显示告警?",
135
- onCancel: function onCancel() {
136
- cb();
137
- }
138
- });
139
- }
137
+ _proto.confirmOpenWhenLargeResource = function confirmOpenWhenLargeResource(cb) {
138
+ _dialog["default"].confirm({
139
+ title: "提示",
140
+ messageProps: {
141
+ type: "warning"
142
+ },
143
+ content: "该拓扑图上节点较多,继续查询告警可能影响系统整体性能,是否暂不显示告警?",
144
+ onCancel: function onCancel() {
145
+ cb();
146
+ }
147
+ });
140
148
  }
141
149
  /**
142
150
  * 查询当前拓扑图有权限资源的告警列表
@@ -50,7 +50,7 @@ var _topoFactory = _interopRequireDefault(require("./topoFactory"));
50
50
  var _ElementTagTipConfig = _interopRequireDefault(require("./tagstips/ElementTagTipConfig"));
51
51
 
52
52
  // eslint-disable-next-line no-undef
53
- var version = typeof "4.0.13" === 'string' ? "4.0.13" : null;
53
+ var version = typeof "4.0.14" === 'string' ? "4.0.14" : null;
54
54
  console.info("\u62D3\u6251\u7248\u672C: " + version);
55
55
  /**
56
56
  * 拓扑显示和编辑
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@riil-frontend/component-topology",
3
- "version": "4.0.13",
3
+ "version": "4.0.14",
4
4
  "description": "拓扑",
5
5
  "scripts": {
6
6
  "start": "build-scripts start",
@@ -114,6 +114,6 @@
114
114
  "access": "public"
115
115
  },
116
116
  "license": "MIT",
117
- "homepage": "https://unpkg.com/@riil-frontend/component-topology@4.0.13/build/index.html",
117
+ "homepage": "https://unpkg.com/@riil-frontend/component-topology@4.0.14/build/index.html",
118
118
  "gitHead": "2da19ffccbb7ca60a8acf396e39f542c68bb33f5"
119
119
  }