|
@@ -59,53 +59,62 @@ const lineDetail = (props) => { |
|
@@ -59,53 +59,62 @@ const lineDetail = (props) => { |
59
|
* 作者: Wang
|
59
|
* 作者: Wang
|
60
|
* 时间:2021/12/15 19:59
|
60
|
* 时间:2021/12/15 19:59
|
61
|
*/
|
61
|
*/
|
62
|
-const alarmDialog = () => {
|
62
|
+const alarmDialog = (props) => {
|
63
|
const {proxy} = Vue.getCurrentInstance();
|
63
|
const {proxy} = Vue.getCurrentInstance();
|
64
|
let alarmFlg = Vue.ref(false);
|
64
|
let alarmFlg = Vue.ref(false);
|
65
|
|
65
|
|
66
|
let alarmList = Vue.ref({
|
66
|
let alarmList = Vue.ref({
|
67
|
- columns: [/*{
|
67
|
+ columns: [{
|
68
|
prop: "resId",
|
68
|
prop: "resId",
|
69
|
label: "资源ID",
|
69
|
label: "资源ID",
|
70
|
- },*/ {
|
70
|
+ width:120
|
|
|
71
|
+ }, {
|
71
|
prop: "kpiId",
|
72
|
prop: "kpiId",
|
72
|
label: "指标ID",
|
73
|
label: "指标ID",
|
|
|
74
|
+ width:120
|
73
|
}, {
|
75
|
}, {
|
74
|
prop: "flag",
|
76
|
prop: "flag",
|
75
|
label: "FLAG",
|
77
|
label: "FLAG",
|
76
|
- }, /*{
|
|
|
77
|
- prop: "id",
|
|
|
78
|
- label: "告警ID",
|
|
|
79
|
- },*/ {
|
|
|
80
|
- prop: "alarmTime",
|
|
|
81
|
- label: "首次告警时间",
|
78
|
+ width:120
|
82
|
}, {
|
79
|
}, {
|
|
|
80
|
+ prop: "alarmId",
|
|
|
81
|
+ label: "告警ID",
|
|
|
82
|
+ width:120
|
|
|
83
|
+ },{
|
83
|
prop: "alarmContent",
|
84
|
prop: "alarmContent",
|
84
|
label: "告警内容",
|
85
|
label: "告警内容",
|
|
|
86
|
+ width:250
|
|
|
87
|
+ }, {
|
|
|
88
|
+ prop: "firstAlarmTime",
|
|
|
89
|
+ label: "首次告警时间",
|
|
|
90
|
+ width:120
|
85
|
}, {
|
91
|
}, {
|
86
|
- prop: "noticeTime",
|
|
|
87
|
- label: "通知时间",
|
92
|
+ prop: "recentAlarmTime",
|
|
|
93
|
+ label: "最近告警时间",
|
|
|
94
|
+ width:120
|
88
|
}, {
|
95
|
}, {
|
89
|
prop: "alarmRepeatCnt",
|
96
|
prop: "alarmRepeatCnt",
|
90
|
label: "告警次数",
|
97
|
label: "告警次数",
|
91
|
- },/* {
|
|
|
92
|
- prop: "alarmContent",
|
98
|
+ width:80
|
|
|
99
|
+ }, {
|
|
|
100
|
+ prop: "noticeContent",
|
93
|
label: "通知内容",
|
101
|
label: "通知内容",
|
94
|
- },*/ {
|
102
|
+ width:300
|
|
|
103
|
+ }, {
|
95
|
prop: "alarmLevel",
|
104
|
prop: "alarmLevel",
|
96
|
label: "告警级别",
|
105
|
label: "告警级别",
|
|
|
106
|
+ width:80,
|
97
|
render: function (row) {
|
107
|
render: function (row) {
|
98
|
-
|
|
|
99
|
let obj = proxy.$global.getAlarmLevel(row.alarmLevel);
|
108
|
let obj = proxy.$global.getAlarmLevel(row.alarmLevel);
|
100
|
if (obj) {
|
109
|
if (obj) {
|
101
|
return `<span style="color: ${obj.color}">${obj.name}</span>`
|
110
|
return `<span style="color: ${obj.color}">${obj.name}</span>`
|
102
|
}
|
111
|
}
|
103
|
return '';
|
112
|
return '';
|
104
|
}
|
113
|
}
|
105
|
- }, {
|
|
|
106
|
- prop: "durationStr",
|
|
|
107
|
- label: "持续时长",
|
|
|
108
|
- }],
|
114
|
+ }/*, {
|
|
|
115
|
+ prop: "firstAlarmTime",
|
|
|
116
|
+ label: "时间戳",
|
|
|
117
|
+ }*/],
|
109
|
dataList: [],
|
118
|
dataList: [],
|
110
|
total: 0
|
119
|
total: 0
|
111
|
});
|
120
|
});
|
|
@@ -117,7 +126,14 @@ const alarmDialog = () => { |
|
@@ -117,7 +126,14 @@ const alarmDialog = () => { |
117
|
let openAlarmDialog = (row) => {
|
126
|
let openAlarmDialog = (row) => {
|
118
|
showAlarmDialog(true);
|
127
|
showAlarmDialog(true);
|
119
|
// 获取告警列表
|
128
|
// 获取告警列表
|
120
|
- proxy.$http.get(`/api-web/home/alarm/alarmListPage?page=1&limit=10000&resId=${row.resId}`, {}, function (res) {
|
129
|
+ let params ={
|
|
|
130
|
+ faultNo: props.faultNo,
|
|
|
131
|
+ targetType: props.targetType,
|
|
|
132
|
+ resId: row.resId,
|
|
|
133
|
+ kpiId: row.kpiId,
|
|
|
134
|
+ flag: row.flg
|
|
|
135
|
+ }
|
|
|
136
|
+ proxy.$http.get(`/api-web/fault/result/findAlarmList`, params, function (res) {
|
121
|
if (res && res.success) {
|
137
|
if (res && res.success) {
|
122
|
if (res.data) {
|
138
|
if (res.data) {
|
123
|
alarmList.value.dataList = res.data;
|
139
|
alarmList.value.dataList = res.data;
|
|
@@ -145,6 +161,10 @@ const alarmDialog = () => { |
|
@@ -145,6 +161,10 @@ const alarmDialog = () => { |
145
|
*/
|
161
|
*/
|
146
|
const colTypes = (props, list,openLine,openAlarmDialog) => {
|
162
|
const colTypes = (props, list,openLine,openAlarmDialog) => {
|
147
|
|
163
|
|
|
|
164
|
+ let widths ={
|
|
|
165
|
+ errcode:150
|
|
|
166
|
+ }
|
|
|
167
|
+
|
148
|
// 展示折线图指标
|
168
|
// 展示折线图指标
|
149
|
let lineKpiIds = ['point_succ', 'count', 'response_rate', 'success_rate'];
|
169
|
let lineKpiIds = ['point_succ', 'count', 'response_rate', 'success_rate'];
|
150
|
|
170
|
|
|
@@ -231,7 +251,7 @@ const colTypes = (props, list,openLine,openAlarmDialog) => { |
|
@@ -231,7 +251,7 @@ const colTypes = (props, list,openLine,openAlarmDialog) => { |
231
|
let colInfo = {
|
251
|
let colInfo = {
|
232
|
prop: prop,
|
252
|
prop: prop,
|
233
|
label: v.kpiName,
|
253
|
label: v.kpiName,
|
234
|
- width: 50
|
254
|
+ width: widths[prop] == undefined ? 50 : 100
|
235
|
};
|
255
|
};
|
236
|
|
256
|
|
237
|
if (lineKpiIds.indexOf(prop) != -1) {
|
257
|
if (lineKpiIds.indexOf(prop) != -1) {
|
|
@@ -283,11 +303,17 @@ const colTypes = (props, list,openLine,openAlarmDialog) => { |
|
@@ -283,11 +303,17 @@ const colTypes = (props, list,openLine,openAlarmDialog) => { |
283
|
}, {
|
303
|
}, {
|
284
|
prop: "normal",
|
304
|
prop: "normal",
|
285
|
width:80,
|
305
|
width:80,
|
286
|
- label: "正常数"
|
306
|
+ label: "正常数",
|
|
|
307
|
+ render: function (row) {
|
|
|
308
|
+ return `<span >${row.normal == undefined ? 0 : row.normal }</span>`
|
|
|
309
|
+ }
|
287
|
}, {
|
310
|
}, {
|
288
|
prop: "abnormal",
|
311
|
prop: "abnormal",
|
289
|
width:80,
|
312
|
width:80,
|
290
|
label: "异常出",
|
313
|
label: "异常出",
|
|
|
314
|
+ render: function (row) {
|
|
|
315
|
+ return `<span >${row.abnormal == undefined ? 0 : row.abnormal }</span>`
|
|
|
316
|
+ }
|
291
|
}, {
|
317
|
}, {
|
292
|
prop: "alarm",
|
318
|
prop: "alarm",
|
293
|
width:80,
|
319
|
width:80,
|
|
@@ -296,15 +322,7 @@ const colTypes = (props, list,openLine,openAlarmDialog) => { |
|
@@ -296,15 +322,7 @@ const colTypes = (props, list,openLine,openAlarmDialog) => { |
296
|
openAlarmDialog(row);
|
322
|
openAlarmDialog(row);
|
297
|
},
|
323
|
},
|
298
|
render: function (row) {
|
324
|
render: function (row) {
|
299
|
- try {
|
|
|
300
|
- let html = eval(prop + '(' + row[prop] + ')');
|
|
|
301
|
- if(html){
|
|
|
302
|
- return html;
|
|
|
303
|
- }
|
|
|
304
|
- }catch (e){
|
|
|
305
|
-
|
|
|
306
|
- }
|
|
|
307
|
- return `<span style="text-decoration: underline;color: blue;">${row.alarm}</span>`
|
325
|
+ return `<span style="text-decoration: underline;color: blue;">${row.alarm == undefined ? 0 : row.alarm }</span>`
|
308
|
}
|
326
|
}
|
309
|
}];
|
327
|
}];
|
310
|
|
328
|
|
|
@@ -328,6 +346,7 @@ const colTypes = (props, list,openLine,openAlarmDialog) => { |
|
@@ -328,6 +346,7 @@ const colTypes = (props, list,openLine,openAlarmDialog) => { |
328
|
dataList.push(item);
|
346
|
dataList.push(item);
|
329
|
index++;
|
347
|
index++;
|
330
|
}
|
348
|
}
|
|
|
349
|
+
|
331
|
// 设置数据
|
350
|
// 设置数据
|
332
|
list.value.dataList = dataList;
|
351
|
list.value.dataList = dataList;
|
333
|
list.value.columns = col;
|
352
|
list.value.columns = col;
|
|
@@ -481,7 +500,7 @@ export default { |
|
@@ -481,7 +500,7 @@ export default { |
481
|
openAlarmDialog,
|
500
|
openAlarmDialog,
|
482
|
alarmList,
|
501
|
alarmList,
|
483
|
alarmFlg
|
502
|
alarmFlg
|
484
|
- } = alarmDialog();
|
503
|
+ } = alarmDialog(props);
|
485
|
|
504
|
|
486
|
// 数据统计方式
|
505
|
// 数据统计方式
|
487
|
const {dataTypeByKpi, dataTypeByFlag} = colTypes(props, list,openLine,openAlarmDialog);
|
506
|
const {dataTypeByKpi, dataTypeByFlag} = colTypes(props, list,openLine,openAlarmDialog);
|