Showing
33 changed files
with
928 additions
and
645 deletions

1.61 KB

1.96 KB

1.73 KB

1.85 KB

1.07 KB

2.13 KB

2.17 KB

1.93 KB

1.96 KB

2.01 KB

2.04 KB

1.83 KB

1.86 KB

1.89 KB

1.97 KB

1.77 KB
1 | +<div> | ||
2 | + <div style="padding: 2px 0px 6px 10px"> | ||
3 | + <div> | ||
4 | + {{detailInfo.info}} | ||
5 | + </div> | ||
6 | + <el-progress :text-inside="true" :stroke-width="26" :percentage="detailInfo.rate*100" :status="detailInfo.rate*100 == 0 ? 'exception' : 'success'"> | ||
7 | + <span style="color: black">正常占比:{{detailInfo.rate*100}}%</span> | ||
8 | + </el-progress> | ||
9 | + </div> | ||
10 | + <div> | ||
11 | + <cm-table-page v-if="list.columns.length > 0" :columns="list.columns" | ||
12 | + :dataList="list.dataList" | ||
13 | + @loaddata="getPageInfo" | ||
14 | + :showIndex="true" | ||
15 | + :showBorder="true" | ||
16 | + :showPage="false" | ||
17 | + :showTools="showDetail" | ||
18 | + :maxWidth="width" | ||
19 | + size="mini" | ||
20 | + :height="300"> | ||
21 | + <template #tools="{scope}"> | ||
22 | + <el-button type="text" size="small" @click.prevent="handleClick(scope.row,scope.$index)"> | ||
23 | + 明细 | ||
24 | + </el-button> | ||
25 | + </template> | ||
26 | + </cm-table-page> | ||
27 | + </div> | ||
28 | + | ||
29 | + <!-- 弹框区域 --> | ||
30 | + <!-- 曲线图 --> | ||
31 | + <cm-dialog top="3vh" title="曲线图" width="1000px" :showDialogVisible="showLineDialog" | ||
32 | + @hidedialog="closeLineDialog" :showFooter="false"> | ||
33 | + <template v-slot> | ||
34 | + <div style="height: 300px" v-if="dataSet.length > 0"> | ||
35 | + <echarts-line :sourceData="dataSet" height="300px" width="980px" /> | ||
36 | + </div> | ||
37 | + </template> | ||
38 | + </cm-dialog> | ||
39 | + | ||
40 | + <!-- 资源明细 --> | ||
41 | + <cm-dialog top="3vh" title="资源明细" width="80%" :showDialogVisible="resListDialog" | ||
42 | + @hidedialog="showResListDialog" :showFooter="false"> | ||
43 | + <template v-slot> | ||
44 | + <div> | ||
45 | + <cm-table-page v-if="resList.columns.length > 0" :columns="resList.columns" | ||
46 | + :dataList="resList.dataList" | ||
47 | + :showIndex="true" | ||
48 | + :showBorder="true" | ||
49 | + @loaddata="loadPage" | ||
50 | + :showPage="false" | ||
51 | + :height="500" | ||
52 | + :showTools="false"> | ||
53 | + </cm-table-page> | ||
54 | + </div> | ||
55 | + </template> | ||
56 | + </cm-dialog> | ||
57 | + | ||
58 | + <!-- 告警列表 --> | ||
59 | + <cm-dialog top="3vh" title="告警列表" width="90%" :showDialogVisible="alarmFlg" | ||
60 | + @hidedialog="showAlarmDialog" :showFooter="false"> | ||
61 | + <template v-slot> | ||
62 | + <div style="height:720px;max-height:720px;overflow-y: auto;"> | ||
63 | + <cm-table-page v-if="alarmList.columns.length > 0" :columns="alarmList.columns" | ||
64 | + :dataList="alarmList.dataList" | ||
65 | + :showIndex="true" | ||
66 | + :showBorder="true" | ||
67 | + @loaddata="loadPage" | ||
68 | + :showPage="false" | ||
69 | + :height="720" | ||
70 | + :showTools="false"> | ||
71 | + </cm-table-page> | ||
72 | + </div> | ||
73 | + </template> | ||
74 | + </cm-dialog> | ||
75 | +</div> |
1 | +/** | ||
2 | + * 折线图 | ||
3 | + * <p> | ||
4 | + * 作者: Wang | ||
5 | + * 时间:2021/12/15 19:59 | ||
6 | + */ | ||
7 | +const lineDetail = (props) => { | ||
8 | + const {proxy} = Vue.getCurrentInstance(); | ||
9 | + let showLineDialog = Vue.ref(false); | ||
10 | + let dataSet = Vue.ref([]); | ||
11 | + let closeLineDialog = (flg) => { | ||
12 | + showLineDialog.value = flg; | ||
13 | + } | ||
14 | + | ||
15 | + let openLine = (row) => { | ||
16 | + closeLineDialog(true); | ||
17 | + getLineData(row); | ||
18 | + } | ||
19 | + | ||
20 | + let getLineData = (row) =>{ | ||
21 | + let params = { | ||
22 | + faultNo: props.faultNo, | ||
23 | + targetType: props.targetType, | ||
24 | + resId: row.resId, | ||
25 | + kpiId: row.kpiId, | ||
26 | + flag: row.flag | ||
27 | + } | ||
28 | + proxy.$http.get('/api-web/fault/result/findLineData', params, function (res) { | ||
29 | + if (res && res.success) { | ||
30 | + if (res.data) { | ||
31 | + let arr = []; | ||
32 | + arr.push(['product',res.data[0].resName ]); | ||
33 | + | ||
34 | + res.data.forEach(function (v){ | ||
35 | + let time = v.collTime; | ||
36 | + let val = v.kpiValue; | ||
37 | + arr.push([time,val ]); | ||
38 | + }) | ||
39 | + dataSet.value = arr; | ||
40 | + } | ||
41 | + } else { | ||
42 | + proxy.$global.showMsg(res.msg, "warning"); | ||
43 | + } | ||
44 | + }); | ||
45 | + } | ||
46 | + | ||
47 | + | ||
48 | + return { | ||
49 | + showLineDialog, | ||
50 | + closeLineDialog, | ||
51 | + openLine, | ||
52 | + dataSet | ||
53 | + } | ||
54 | +} | ||
55 | + | ||
56 | +/** | ||
57 | + * 告警列表 | ||
58 | + * <p> | ||
59 | + * 作者: Wang | ||
60 | + * 时间:2021/12/15 19:59 | ||
61 | + */ | ||
62 | +const alarmDialog = (props) => { | ||
63 | + const {proxy} = Vue.getCurrentInstance(); | ||
64 | + let alarmFlg = Vue.ref(false); | ||
65 | + | ||
66 | + let alarmList = Vue.ref({ | ||
67 | + columns: [{ | ||
68 | + prop: "resId", | ||
69 | + label: "资源ID", | ||
70 | + width:120 | ||
71 | + }, { | ||
72 | + prop: "kpiId", | ||
73 | + label: "指标ID", | ||
74 | + width:120 | ||
75 | + }, { | ||
76 | + prop: "flag", | ||
77 | + label: "指标标识", | ||
78 | + width:120 | ||
79 | + }, { | ||
80 | + prop: "alarmId", | ||
81 | + label: "告警ID", | ||
82 | + width:120 | ||
83 | + },{ | ||
84 | + prop: "alarmContent", | ||
85 | + label: "告警内容", | ||
86 | + width:250 | ||
87 | + }, { | ||
88 | + prop: "firstAlarmTime", | ||
89 | + label: "首次告警时间", | ||
90 | + width:120 | ||
91 | + }, { | ||
92 | + prop: "recentAlarmTime", | ||
93 | + label: "最近告警时间", | ||
94 | + width:120 | ||
95 | + }, { | ||
96 | + prop: "alarmRepeatCnt", | ||
97 | + label: "告警次数", | ||
98 | + width:80 | ||
99 | + }, { | ||
100 | + prop: "noticeContent", | ||
101 | + label: "通知内容", | ||
102 | + width:300 | ||
103 | + }, { | ||
104 | + prop: "alarmLevel", | ||
105 | + label: "告警级别", | ||
106 | + width:80, | ||
107 | + render: function (row) { | ||
108 | + let obj = proxy.$global.getAlarmLevel(row.alarmLevel); | ||
109 | + if (obj) { | ||
110 | + return `<span style="color: ${obj.color}">${obj.name}</span>` | ||
111 | + } | ||
112 | + return ''; | ||
113 | + } | ||
114 | + }/*, { | ||
115 | + prop: "firstAlarmTime", | ||
116 | + label: "时间戳", | ||
117 | + }*/], | ||
118 | + dataList: [], | ||
119 | + total: 0 | ||
120 | + }); | ||
121 | + | ||
122 | + let showAlarmDialog = (flg) => { | ||
123 | + alarmFlg.value = flg; | ||
124 | + } | ||
125 | + | ||
126 | + let openAlarmDialog = (row) => { | ||
127 | + showAlarmDialog(true); | ||
128 | + // 获取告警列表 | ||
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) { | ||
137 | + if (res && res.success) { | ||
138 | + if (res.data) { | ||
139 | + alarmList.value.dataList = res.data; | ||
140 | + } | ||
141 | + } else { | ||
142 | + proxy.$global.showMsg(res.msg ? res.msg : '暂无告警数据!', "warning"); | ||
143 | + } | ||
144 | + }); | ||
145 | + } | ||
146 | + | ||
147 | + | ||
148 | + return { | ||
149 | + showAlarmDialog, | ||
150 | + openAlarmDialog, | ||
151 | + alarmList, | ||
152 | + alarmFlg | ||
153 | + } | ||
154 | +} | ||
155 | + | ||
156 | +/** | ||
157 | + * 数据转换 | ||
158 | + * <p> | ||
159 | + * 作者: Wang | ||
160 | + * 时间:2021/12/15 18:08 | ||
161 | + */ | ||
162 | +const colTypes = (props, list,openLine,openAlarmDialog) => { | ||
163 | + | ||
164 | + let widths ={ | ||
165 | + errcode:150 | ||
166 | + } | ||
167 | + | ||
168 | + // 展示折线图指标 | ||
169 | + let lineKpiIds = ['point_succ', 'count', 'response_rate', 'success_rate']; | ||
170 | + | ||
171 | + /** | ||
172 | + * 拨测 | ||
173 | + * @param row | ||
174 | + * @returns {`<span style="${string}">${string}</span>`} | ||
175 | + */ | ||
176 | + let point_succ = (val) =>{ | ||
177 | + let css = "text-decoration: underline;"; | ||
178 | + if(val != undefined && val === 0){ | ||
179 | + css += "color: red;"; | ||
180 | + } else { | ||
181 | + css += "color: blue;"; | ||
182 | + } | ||
183 | + return `<span style="${css}">${val}</span>`; | ||
184 | + } | ||
185 | + | ||
186 | + /** | ||
187 | + * NPM 成功率 | ||
188 | + * @param row | ||
189 | + * @returns {`<span style="${string}">${string}</span>`} | ||
190 | + */ | ||
191 | + let success_rate = (val) =>{ | ||
192 | + let css = "text-decoration: underline;"; | ||
193 | + if(val != undefined && val === 100){ | ||
194 | + css += "color: blue;"; | ||
195 | + } else { | ||
196 | + css += "color: red;"; | ||
197 | + } | ||
198 | + return `<span style="${css}">${val}</span>`; | ||
199 | + } | ||
200 | + | ||
201 | + /** | ||
202 | + * NPM 响应率 | ||
203 | + * @param row | ||
204 | + * @returns {`<span style="${string}">${string}</span>`} | ||
205 | + */ | ||
206 | + let response_rate = (val) =>{ | ||
207 | + let css = "text-decoration: underline;"; | ||
208 | + if(val != undefined && val === 100){ | ||
209 | + css += "color: blue;"; | ||
210 | + } else { | ||
211 | + css += "color: red;"; | ||
212 | + } | ||
213 | + return `<span style="${css}">${val}</span>`; | ||
214 | + } | ||
215 | + | ||
216 | + | ||
217 | + let getItem = (v) => { | ||
218 | + let item = {}; | ||
219 | + item.resId = v.resId; | ||
220 | + item.resName = v.resName; | ||
221 | + item.kpiName = v.kpiName; | ||
222 | + item.bizId = v.bizId; | ||
223 | + item.bizName = v.bizName; | ||
224 | + item.kpiId = v.kpiId; | ||
225 | + item.flag = v.flag; | ||
226 | + return item; | ||
227 | + } | ||
228 | + /** | ||
229 | + * KPI数据处理方式 | ||
230 | + * <p> | ||
231 | + * 作者: Wang | ||
232 | + * 时间:2021/12/15 16:12 | ||
233 | + */ | ||
234 | + let dataTypeByKpi = (data) => { | ||
235 | + let dataList = []; | ||
236 | + let col = [{ | ||
237 | + prop: 'resName', | ||
238 | + label: props.itemName, | ||
239 | + width: 150 | ||
240 | + }]; | ||
241 | + | ||
242 | + let index = 0; | ||
243 | + for (let resId in data) { | ||
244 | + let list = data[resId]; | ||
245 | + let item = getItem(list[0]); | ||
246 | + list.forEach(function (v) { | ||
247 | + item[v.kpiId] = v.kpiValue; | ||
248 | + item.kpiName = v.kpiName; | ||
249 | + if (index == 0) { | ||
250 | + let prop = v.kpiId; | ||
251 | + let colInfo = { | ||
252 | + prop: prop, | ||
253 | + label: v.kpiName, | ||
254 | + width: widths[prop] == undefined ? 50 : 100 | ||
255 | + }; | ||
256 | + | ||
257 | + if (lineKpiIds.indexOf(prop) != -1) { | ||
258 | + colInfo['click'] = function (row) { | ||
259 | + row.kpiId = prop; | ||
260 | + row.flag = v.flag; | ||
261 | + openLine(row); | ||
262 | + } | ||
263 | + | ||
264 | + colInfo['render'] = function (row) { | ||
265 | + try { | ||
266 | + | ||
267 | + if(row && Object.keys(row).length > 0 && prop){ | ||
268 | + let html = eval(prop + '(' + row[prop] + ')'); | ||
269 | + if(html){ | ||
270 | + return html; | ||
271 | + } | ||
272 | + } | ||
273 | + }catch (e){ | ||
274 | + | ||
275 | + } | ||
276 | + return `<span style="text-decoration: underline;color: blue;">${row[v.kpiId]}</span>`;; | ||
277 | + } | ||
278 | + | ||
279 | + } | ||
280 | + | ||
281 | + col.push(colInfo) | ||
282 | + } | ||
283 | + }); | ||
284 | + dataList.push(item); | ||
285 | + index++; | ||
286 | + } | ||
287 | + // 设置数据 | ||
288 | + list.value.dataList = dataList; | ||
289 | + list.value.columns = col; | ||
290 | + } | ||
291 | + | ||
292 | + /** | ||
293 | + * KPI数据处理方式 | ||
294 | + * <p> | ||
295 | + * 作者: Wang | ||
296 | + * 时间:2021/12/15 16:12 | ||
297 | + */ | ||
298 | + let dataTypeByFlag = (data) => { | ||
299 | + let flags = [{ | ||
300 | + prop: "count", | ||
301 | + width:80, | ||
302 | + label: "检测项目数", | ||
303 | + }, { | ||
304 | + prop: "normal", | ||
305 | + width:80, | ||
306 | + label: "正常数", | ||
307 | + render: function (row) { | ||
308 | + return `<span >${row.normal == undefined ? 0 : row.normal }</span>` | ||
309 | + } | ||
310 | + }, { | ||
311 | + prop: "abnormal", | ||
312 | + width:80, | ||
313 | + label: "异常出", | ||
314 | + render: function (row) { | ||
315 | + return `<span >${row.abnormal == undefined ? 0 : row.abnormal }</span>` | ||
316 | + } | ||
317 | + }, { | ||
318 | + prop: "alarm", | ||
319 | + width:80, | ||
320 | + label: "告警", | ||
321 | + click: function (row) { | ||
322 | + openAlarmDialog(row); | ||
323 | + }, | ||
324 | + render: function (row) { | ||
325 | + return `<span style="text-decoration: underline;color: blue;">${row.alarm == undefined ? 0 : row.alarm }</span>` | ||
326 | + } | ||
327 | + }]; | ||
328 | + | ||
329 | + let dataList = []; | ||
330 | + let col = [{ | ||
331 | + prop: 'kpiName', | ||
332 | + label: props.itemName, | ||
333 | + width: 150 | ||
334 | + }]; | ||
335 | + | ||
336 | + flags.forEach(function (item) { | ||
337 | + col.push(item) | ||
338 | + }) | ||
339 | + let index = 0; | ||
340 | + for (let resId in data) { | ||
341 | + let list = data[resId]; | ||
342 | + let item = getItem(list[0]); | ||
343 | + list.forEach(function (v) { | ||
344 | + item[v.flag] = v.kpiValue; | ||
345 | + }); | ||
346 | + dataList.push(item); | ||
347 | + index++; | ||
348 | + } | ||
349 | + | ||
350 | + // 设置数据 | ||
351 | + list.value.dataList = dataList; | ||
352 | + list.value.columns = col; | ||
353 | + } | ||
354 | + | ||
355 | + return {dataTypeByKpi, dataTypeByFlag} | ||
356 | +} | ||
357 | + | ||
358 | +const resDetail = (props,openLine) => { | ||
359 | + const {proxy} = Vue.getCurrentInstance(); | ||
360 | + let resListDialog = Vue.ref(false); | ||
361 | + let resList = Vue.ref({ | ||
362 | + columns: [{ | ||
363 | + prop: "resType", | ||
364 | + label: "资源类型", | ||
365 | + }, { | ||
366 | + prop: "resName", | ||
367 | + label: "资源名称", | ||
368 | + }, { | ||
369 | + prop: "kpiName", | ||
370 | + label: "指标名称", | ||
371 | + }, { | ||
372 | + prop: "kpiValue", | ||
373 | + label: "指标值", | ||
374 | + click:function (row){ | ||
375 | + openLine(row); | ||
376 | + }, | ||
377 | + render:function (row){ | ||
378 | + return `<span style="text-decoration: underline;color: blue;">${row.kpiValue}</span>` | ||
379 | + } | ||
380 | + }, { | ||
381 | + prop: "collTime", | ||
382 | + label: "采集时间", | ||
383 | + }], | ||
384 | + dataList: [], | ||
385 | + total: 0 | ||
386 | + }); | ||
387 | + | ||
388 | + let showResListDialog = (flg) => { | ||
389 | + resListDialog.value = flg; | ||
390 | + } | ||
391 | + | ||
392 | + let handleClick = (row, index) => { | ||
393 | + | ||
394 | + showResListDialog(true); | ||
395 | + getResListPage(row); | ||
396 | + } | ||
397 | + | ||
398 | + let getResListPage = (row) => { | ||
399 | + let params = { | ||
400 | + faultNo: props.faultNo, | ||
401 | + targetType: props.targetType, | ||
402 | + resId: row.resId, | ||
403 | + kpiId: row.kpiId, | ||
404 | + flag: row.flag | ||
405 | + } | ||
406 | + proxy.$http.get('/api-web/fault/result/findResList', params, function (res) { | ||
407 | + if (res && res.success) { | ||
408 | + if (res.data) { | ||
409 | + resList.value.dataList = res.data; | ||
410 | + } | ||
411 | + } else { | ||
412 | + proxy.$global.showMsg(res.msg, "warning"); | ||
413 | + } | ||
414 | + }); | ||
415 | + } | ||
416 | + | ||
417 | + let loadPage = () => { | ||
418 | + | ||
419 | + } | ||
420 | + | ||
421 | + return { | ||
422 | + resList, | ||
423 | + resListDialog, | ||
424 | + showResListDialog, | ||
425 | + getResListPage, | ||
426 | + loadPage, | ||
427 | + handleClick | ||
428 | + } | ||
429 | +} | ||
430 | + | ||
431 | + | ||
432 | +export default { | ||
433 | + name: 'resultItemIndex', | ||
434 | + template: '', | ||
435 | + components: { | ||
436 | + 'echarts-line': Vue.defineAsyncComponent( | ||
437 | + () => myImport('components/common/echarts/line/index') | ||
438 | + ) | ||
439 | + }, | ||
440 | + data() { | ||
441 | + return {} | ||
442 | + }, | ||
443 | + props: { | ||
444 | + targetType: { | ||
445 | + type: String, | ||
446 | + default: '' | ||
447 | + }, | ||
448 | + faultNo: { | ||
449 | + type: String, | ||
450 | + default: '' | ||
451 | + }, | ||
452 | + itemName: { | ||
453 | + type: String, | ||
454 | + default: '' | ||
455 | + }, | ||
456 | + // 展示详情页 | ||
457 | + showDetail: { | ||
458 | + type: String, | ||
459 | + default: '' | ||
460 | + }, | ||
461 | + // 数据转行方式 | ||
462 | + colType: { | ||
463 | + type: String, | ||
464 | + default: 'kpi' | ||
465 | + }, | ||
466 | + }, | ||
467 | + setup(props, {attrs, slots, emit}) { | ||
468 | + let width = Vue.ref(window.innerWidth * 0.8 - 220); | ||
469 | + const {proxy} = Vue.getCurrentInstance(); | ||
470 | + let list = Vue.ref({ | ||
471 | + columns: [], | ||
472 | + dataList: [], | ||
473 | + total: 0 | ||
474 | + }); | ||
475 | + | ||
476 | + let detailInfo = Vue.ref({ | ||
477 | + rate: 0, | ||
478 | + info: '' | ||
479 | + }); | ||
480 | + | ||
481 | + const { | ||
482 | + showLineDialog, | ||
483 | + closeLineDialog, | ||
484 | + openLine, | ||
485 | + dataSet | ||
486 | + } = lineDetail(props); | ||
487 | + | ||
488 | + | ||
489 | + const { | ||
490 | + resList, | ||
491 | + resListDialog, | ||
492 | + showResListDialog, | ||
493 | + getResListPage, | ||
494 | + loadPage, | ||
495 | + handleClick | ||
496 | + } = resDetail(props,openLine); | ||
497 | + | ||
498 | + const { | ||
499 | + showAlarmDialog, | ||
500 | + openAlarmDialog, | ||
501 | + alarmList, | ||
502 | + alarmFlg | ||
503 | + } = alarmDialog(props); | ||
504 | + | ||
505 | + // 数据统计方式 | ||
506 | + const {dataTypeByKpi, dataTypeByFlag} = colTypes(props, list,openLine,openAlarmDialog); | ||
507 | + | ||
508 | + /** | ||
509 | + * 获取表格数据 | ||
510 | + * <p> | ||
511 | + * 作者: Wang | ||
512 | + * 时间:2021/12/15 17:26 | ||
513 | + */ | ||
514 | + let getPage = () => { | ||
515 | + let params = { | ||
516 | + faultNo: props.faultNo, | ||
517 | + targetType: props.targetType | ||
518 | + } | ||
519 | + proxy.$http.get('/api-web/fault/result/findResult', params, function (res) { | ||
520 | + if (res && res.success) { | ||
521 | + if (res.map) { | ||
522 | + callback(res.map); | ||
523 | + } | ||
524 | + } else { | ||
525 | + proxy.$global.showMsg(res.msg, "warning"); | ||
526 | + } | ||
527 | + }); | ||
528 | + | ||
529 | + // 设置数据 | ||
530 | + let callback = (data) => { | ||
531 | + | ||
532 | + switch (props.colType) { | ||
533 | + case 'kpi': | ||
534 | + dataTypeByKpi(data); | ||
535 | + break; | ||
536 | + case 'flag': | ||
537 | + dataTypeByFlag(data); | ||
538 | + break; | ||
539 | + } | ||
540 | + } | ||
541 | + } | ||
542 | + | ||
543 | + /** | ||
544 | + * 获取统计信息 | ||
545 | + */ | ||
546 | + let findCountInfo = () => { | ||
547 | + let params = { | ||
548 | + faultNo: props.faultNo, | ||
549 | + targetType: props.targetType | ||
550 | + } | ||
551 | + proxy.$http.get('/api-web/fault/result/findCountInfo', params, function (res) { | ||
552 | + if (res && res.success) { | ||
553 | + if (res.map) { | ||
554 | + detailInfo.value = res.map; | ||
555 | + } | ||
556 | + } else { | ||
557 | + proxy.$global.showMsg(res.msg, "warning"); | ||
558 | + } | ||
559 | + }); | ||
560 | + } | ||
561 | + | ||
562 | + // 监听编辑状态 | ||
563 | + Vue.watch(() => props.faultNo, (newValue, oldVlaue) => { | ||
564 | + getPage(); | ||
565 | + }); | ||
566 | + | ||
567 | + // 挂载完 | ||
568 | + Vue.onMounted(() => { | ||
569 | + getPage(); | ||
570 | + findCountInfo(); | ||
571 | + }) | ||
572 | + | ||
573 | + return { | ||
574 | + width, | ||
575 | + list, | ||
576 | + detailInfo, | ||
577 | + | ||
578 | + // 折线图 | ||
579 | + showLineDialog, | ||
580 | + closeLineDialog, | ||
581 | + openLine, | ||
582 | + dataSet, | ||
583 | + | ||
584 | + | ||
585 | + // 资源详情 | ||
586 | + resList, | ||
587 | + resListDialog, | ||
588 | + showResListDialog, | ||
589 | + getResListPage, | ||
590 | + loadPage, | ||
591 | + handleClick, | ||
592 | + | ||
593 | + // 告警弹框 | ||
594 | + showAlarmDialog, | ||
595 | + openAlarmDialog, | ||
596 | + alarmList, | ||
597 | + alarmFlg | ||
598 | + } | ||
599 | + } | ||
600 | +} |
1 | <div> | 1 | <div> |
2 | - <div style="padding: 2px 0px 6px 10px"> | ||
3 | - <div> | ||
4 | - {{detailInfo.info}} | 2 | + <div class="d-flex"> |
3 | + <img src="../src/style/img/fault/base.gif"> | ||
4 | + <h3 style="margin-left: 10px">基础资源</h3> | ||
5 | + <div style="width: calc(100% - 200px);line-height: 54px" class="align-right"> | ||
6 | + <a class="m-r-20" @click="allCard()">更多</a> | ||
7 | + <a @click="closeCard()">收起</a> | ||
5 | </div> | 8 | </div> |
6 | - <el-progress :text-inside="true" :stroke-width="26" :percentage="detailInfo.rate*100" :status="detailInfo.rate*100 == 0 ? 'exception' : 'success'"> | ||
7 | - <span style="color: black">正常占比:{{detailInfo.rate*100}}%</span> | ||
8 | - </el-progress> | ||
9 | </div> | 9 | </div> |
10 | + <el-divider/> | ||
11 | + <div class="d-flex" v-model="dialTest"> | ||
12 | + <div style="width: 300px;text-align: center;"><a>汇总信息</a></div> | ||
10 | <div> | 13 | <div> |
11 | - <cm-table-page v-if="list.columns.length > 0" :columns="list.columns" | ||
12 | - :dataList="list.dataList" | ||
13 | - @loaddata="getPageInfo" | ||
14 | - :showIndex="true" | ||
15 | - :showBorder="true" | ||
16 | - :showPage="false" | ||
17 | - :showTools="showDetail" | ||
18 | - :maxWidth="width" | ||
19 | - size="mini" | ||
20 | - :height="300"> | ||
21 | - <template #tools="{scope}"> | ||
22 | - <el-button type="text" size="small" @click.prevent="handleClick(scope.row,scope.$index)"> | ||
23 | - 明细 | ||
24 | - </el-button> | ||
25 | - </template> | ||
26 | - </cm-table-page> | 14 | + <div class="d-flex align-left"> |
15 | + <div style="width: 200px;margin-left: 20px;display: flex;align-self: center;"> | ||
16 | + <img src="../src/style/img/disRes.png"> | ||
17 | + <span style="margin: 0px 6px 0px 6px;width: 95px">诊断资源</span> | ||
18 | + <h>{{dialTest && dialTest.diagnosticResources ?dialTest.diagnosticResources:0}}</h> | ||
27 | </div> | 19 | </div> |
28 | - | ||
29 | - <!-- 弹框区域 --> | ||
30 | - <!-- 曲线图 --> | ||
31 | - <cm-dialog top="3vh" title="曲线图" width="1000px" :showDialogVisible="showLineDialog" | ||
32 | - @hidedialog="closeLineDialog" :showFooter="false"> | ||
33 | - <template v-slot> | ||
34 | - <div style="height: 300px" v-if="dataSet.length > 0"> | ||
35 | - <echarts-line :sourceData="dataSet" height="300px" width="980px" /> | 20 | + | |
21 | + <div style="width: 200px;margin-left: 20px;display: flex;align-self: center;"> | ||
22 | + <img src="../src/style/img/disKpi.png"> | ||
23 | + <span style="margin: 0px 6px 0px 6px;width: 95px">诊断指标</span> | ||
24 | + <h>{{dialTest && dialTest.diagnosticIndicators ?dialTest.diagnosticIndicators:0}}</h> | ||
36 | </div> | 25 | </div> |
37 | - </template> | ||
38 | - </cm-dialog> | ||
39 | - | ||
40 | - <!-- 资源明细 --> | ||
41 | - <cm-dialog top="3vh" title="资源明细" width="80%" :showDialogVisible="resListDialog" | ||
42 | - @hidedialog="showResListDialog" :showFooter="false"> | ||
43 | - <template v-slot> | ||
44 | - <div> | ||
45 | - <cm-table-page v-if="resList.columns.length > 0" :columns="resList.columns" | ||
46 | - :dataList="resList.dataList" | ||
47 | - :showIndex="true" | ||
48 | - :showBorder="true" | ||
49 | - @loaddata="loadPage" | ||
50 | - :showPage="false" | ||
51 | - :height="500" | ||
52 | - :showTools="false"> | ||
53 | - </cm-table-page> | 26 | + | |
27 | + <div style="width: 200px;margin-left: 20px;display: flex;align-self: center;"> | ||
28 | + <img src="../src/style/img/disItem.png"> | ||
29 | + <span style="margin: 0px 6px 0px 6px;width: 95px">诊断项</span> | ||
30 | + <h>{{dialTest && dialTest.diagnosticItem ?dialTest.diagnosticItem:0}}</h> | ||
31 | + </div> | ||
32 | + </div> | ||
33 | + <div style="text-align: left;display: flex;margin-top: 10px;"> | ||
34 | + <div style="width: 200px;margin-left: 20px;display: flex;align-self: center;color: yellowgreen"> | ||
35 | + <img src="../src/style/img/success.png"> | ||
36 | + <span style="margin: 0px 6px 0px 6px;width: 95px;">正常</span> | ||
37 | + <h style="font-size: 20px">{{dialTest && dialTest.normal ?dialTest.normal:0}}</h> | ||
38 | + </div> | ||
39 | + | | ||
40 | + <div style="width: 200px;margin-left: 20px;display: flex;align-self: center;color: #f8d305"> | ||
41 | + <img src="../src/style/img/error.png"> | ||
42 | + <span style="margin: 0px 6px 0px 6px;width: 95px;"> 异常</span> | ||
43 | + <h style="font-size: 20px">{{dialTest && dialTest.abnormal ?dialTest.abnormal:0}}</h> | ||
54 | </div> | 44 | </div> |
55 | - </template> | ||
56 | - </cm-dialog> | ||
57 | - | ||
58 | - <!-- 告警列表 --> | ||
59 | - <cm-dialog top="3vh" title="告警列表" width="90%" :showDialogVisible="alarmFlg" | ||
60 | - @hidedialog="showAlarmDialog" :showFooter="false"> | ||
61 | - <template v-slot> | ||
62 | - <div style="height:720px;max-height:720px;overflow-y: auto;"> | ||
63 | - <cm-table-page v-if="alarmList.columns.length > 0" :columns="alarmList.columns" | ||
64 | - :dataList="alarmList.dataList" | ||
65 | - :showIndex="true" | ||
66 | - :showBorder="true" | ||
67 | - @loaddata="loadPage" | ||
68 | - :showPage="false" | ||
69 | - :height="720" | ||
70 | - :showTools="false"> | ||
71 | - </cm-table-page> | ||
72 | </div> | 45 | </div> |
73 | - </template> | ||
74 | - </cm-dialog> | 46 | + </div> |
47 | + <div class="d-flex" style="flex: 1"> | ||
48 | + <div>正常占比</div> | ||
49 | + <div class="progress-con"> | ||
50 | + <el-progress :text-inside="true" :stroke-width="26" | ||
51 | + :percentage="dialTest && dialTest.normalProportion?dialTest.normalProportion*100:0" | ||
52 | + color="#64A64C"/> | ||
53 | + </div> | ||
54 | + </div> | ||
55 | + </div> | ||
56 | + | ||
57 | + | ||
58 | + <res-item /> | ||
59 | + | ||
75 | </div> | 60 | </div> |
1 | -/** | ||
2 | - * 折线图 | ||
3 | - * <p> | ||
4 | - * 作者: Wang | ||
5 | - * 时间:2021/12/15 19:59 | ||
6 | - */ | ||
7 | -const lineDetail = (props) => { | ||
8 | - const {proxy} = Vue.getCurrentInstance(); | ||
9 | - let showLineDialog = Vue.ref(false); | ||
10 | - let dataSet = Vue.ref([]); | ||
11 | - let closeLineDialog = (flg) => { | ||
12 | - showLineDialog.value = flg; | ||
13 | - } | ||
14 | - | ||
15 | - let openLine = (row) => { | ||
16 | - closeLineDialog(true); | ||
17 | - getLineData(row); | ||
18 | - } | ||
19 | - | ||
20 | - let getLineData = (row) =>{ | ||
21 | - let params = { | ||
22 | - faultNo: props.faultNo, | ||
23 | - targetType: props.targetType, | ||
24 | - resId: row.resId, | ||
25 | - kpiId: row.kpiId, | ||
26 | - flag: row.flag | ||
27 | - } | ||
28 | - proxy.$http.get('/api-web/fault/result/findLineData', params, function (res) { | ||
29 | - if (res && res.success) { | ||
30 | - if (res.data) { | ||
31 | - let arr = []; | ||
32 | - arr.push(['product',res.data[0].resName ]); | ||
33 | - | ||
34 | - res.data.forEach(function (v){ | ||
35 | - let time = v.collTime; | ||
36 | - let val = v.kpiValue; | ||
37 | - arr.push([time,val ]); | ||
38 | - }) | ||
39 | - dataSet.value = arr; | ||
40 | - } | ||
41 | - } else { | ||
42 | - proxy.$global.showMsg(res.msg, "warning"); | ||
43 | - } | ||
44 | - }); | ||
45 | - } | ||
46 | - | ||
47 | - | ||
48 | - return { | ||
49 | - showLineDialog, | ||
50 | - closeLineDialog, | ||
51 | - openLine, | ||
52 | - dataSet | ||
53 | - } | ||
54 | -} | ||
55 | - | ||
56 | -/** | ||
57 | - * 告警列表 | ||
58 | - * <p> | ||
59 | - * 作者: Wang | ||
60 | - * 时间:2021/12/15 19:59 | ||
61 | - */ | ||
62 | -const alarmDialog = (props) => { | ||
63 | - const {proxy} = Vue.getCurrentInstance(); | ||
64 | - let alarmFlg = Vue.ref(false); | ||
65 | - | ||
66 | - let alarmList = Vue.ref({ | ||
67 | - columns: [{ | ||
68 | - prop: "resId", | ||
69 | - label: "资源ID", | ||
70 | - width:120 | ||
71 | - }, { | ||
72 | - prop: "kpiId", | ||
73 | - label: "指标ID", | ||
74 | - width:120 | ||
75 | - }, { | ||
76 | - prop: "flag", | ||
77 | - label: "指标标识", | ||
78 | - width:120 | ||
79 | - }, { | ||
80 | - prop: "alarmId", | ||
81 | - label: "告警ID", | ||
82 | - width:120 | ||
83 | - },{ | ||
84 | - prop: "alarmContent", | ||
85 | - label: "告警内容", | ||
86 | - width:250 | ||
87 | - }, { | ||
88 | - prop: "firstAlarmTime", | ||
89 | - label: "首次告警时间", | ||
90 | - width:120 | ||
91 | - }, { | ||
92 | - prop: "recentAlarmTime", | ||
93 | - label: "最近告警时间", | ||
94 | - width:120 | ||
95 | - }, { | ||
96 | - prop: "alarmRepeatCnt", | ||
97 | - label: "告警次数", | ||
98 | - width:80 | ||
99 | - }, { | ||
100 | - prop: "noticeContent", | ||
101 | - label: "通知内容", | ||
102 | - width:300 | ||
103 | - }, { | ||
104 | - prop: "alarmLevel", | ||
105 | - label: "告警级别", | ||
106 | - width:80, | ||
107 | - render: function (row) { | ||
108 | - let obj = proxy.$global.getAlarmLevel(row.alarmLevel); | ||
109 | - if (obj) { | ||
110 | - return `<span style="color: ${obj.color}">${obj.name}</span>` | ||
111 | - } | ||
112 | - return ''; | ||
113 | - } | ||
114 | - }/*, { | ||
115 | - prop: "firstAlarmTime", | ||
116 | - label: "时间戳", | ||
117 | - }*/], | ||
118 | - dataList: [], | ||
119 | - total: 0 | ||
120 | - }); | ||
121 | - | ||
122 | - let showAlarmDialog = (flg) => { | ||
123 | - alarmFlg.value = flg; | ||
124 | - } | ||
125 | - | ||
126 | - let openAlarmDialog = (row) => { | ||
127 | - showAlarmDialog(true); | ||
128 | - // 获取告警列表 | ||
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) { | ||
137 | - if (res && res.success) { | ||
138 | - if (res.data) { | ||
139 | - alarmList.value.dataList = res.data; | ||
140 | - } | ||
141 | - } else { | ||
142 | - proxy.$global.showMsg(res.msg ? res.msg : '暂无告警数据!', "warning"); | ||
143 | - } | ||
144 | - }); | ||
145 | - } | ||
146 | - | ||
147 | - | ||
148 | - return { | ||
149 | - showAlarmDialog, | ||
150 | - openAlarmDialog, | ||
151 | - alarmList, | ||
152 | - alarmFlg | ||
153 | - } | ||
154 | -} | ||
155 | - | ||
156 | -/** | ||
157 | - * 数据转换 | ||
158 | - * <p> | ||
159 | - * 作者: Wang | ||
160 | - * 时间:2021/12/15 18:08 | ||
161 | - */ | ||
162 | -const colTypes = (props, list,openLine,openAlarmDialog) => { | ||
163 | - | ||
164 | - let widths ={ | ||
165 | - errcode:150 | ||
166 | - } | ||
167 | - | ||
168 | - // 展示折线图指标 | ||
169 | - let lineKpiIds = ['point_succ', 'count', 'response_rate', 'success_rate']; | ||
170 | - | ||
171 | - /** | ||
172 | - * 拨测 | ||
173 | - * @param row | ||
174 | - * @returns {`<span style="${string}">${string}</span>`} | ||
175 | - */ | ||
176 | - let point_succ = (val) =>{ | ||
177 | - let css = "text-decoration: underline;"; | ||
178 | - if(val != undefined && val === 0){ | ||
179 | - css += "color: red;"; | ||
180 | - } else { | ||
181 | - css += "color: blue;"; | ||
182 | - } | ||
183 | - return `<span style="${css}">${val}</span>`; | ||
184 | - } | ||
185 | - | ||
186 | - /** | ||
187 | - * NPM 成功率 | ||
188 | - * @param row | ||
189 | - * @returns {`<span style="${string}">${string}</span>`} | ||
190 | - */ | ||
191 | - let success_rate = (val) =>{ | ||
192 | - let css = "text-decoration: underline;"; | ||
193 | - if(val != undefined && val === 100){ | ||
194 | - css += "color: blue;"; | ||
195 | - } else { | ||
196 | - css += "color: red;"; | ||
197 | - } | ||
198 | - return `<span style="${css}">${val}</span>`; | ||
199 | - } | ||
200 | - | ||
201 | - /** | ||
202 | - * NPM 响应率 | ||
203 | - * @param row | ||
204 | - * @returns {`<span style="${string}">${string}</span>`} | ||
205 | - */ | ||
206 | - let response_rate = (val) =>{ | ||
207 | - let css = "text-decoration: underline;"; | ||
208 | - if(val != undefined && val === 100){ | ||
209 | - css += "color: blue;"; | ||
210 | - } else { | ||
211 | - css += "color: red;"; | ||
212 | - } | ||
213 | - return `<span style="${css}">${val}</span>`; | ||
214 | - } | ||
215 | - | ||
216 | - | ||
217 | - let getItem = (v) => { | ||
218 | - let item = {}; | ||
219 | - item.resId = v.resId; | ||
220 | - item.resName = v.resName; | ||
221 | - item.kpiName = v.kpiName; | ||
222 | - item.bizId = v.bizId; | ||
223 | - item.bizName = v.bizName; | ||
224 | - item.kpiId = v.kpiId; | ||
225 | - item.flag = v.flag; | ||
226 | - return item; | ||
227 | - } | ||
228 | - /** | ||
229 | - * KPI数据处理方式 | ||
230 | - * <p> | ||
231 | - * 作者: Wang | ||
232 | - * 时间:2021/12/15 16:12 | ||
233 | - */ | ||
234 | - let dataTypeByKpi = (data) => { | ||
235 | - let dataList = []; | ||
236 | - let col = [{ | ||
237 | - prop: 'resName', | ||
238 | - label: props.itemName, | ||
239 | - width: 150 | ||
240 | - }]; | ||
241 | - | ||
242 | - let index = 0; | ||
243 | - for (let resId in data) { | ||
244 | - let list = data[resId]; | ||
245 | - let item = getItem(list[0]); | ||
246 | - list.forEach(function (v) { | ||
247 | - item[v.kpiId] = v.kpiValue; | ||
248 | - item.kpiName = v.kpiName; | ||
249 | - if (index == 0) { | ||
250 | - let prop = v.kpiId; | ||
251 | - let colInfo = { | ||
252 | - prop: prop, | ||
253 | - label: v.kpiName, | ||
254 | - width: widths[prop] == undefined ? 50 : 100 | ||
255 | - }; | ||
256 | - | ||
257 | - if (lineKpiIds.indexOf(prop) != -1) { | ||
258 | - colInfo['click'] = function (row) { | ||
259 | - row.kpiId = prop; | ||
260 | - row.flag = v.flag; | ||
261 | - openLine(row); | ||
262 | - } | ||
263 | - | ||
264 | - colInfo['render'] = function (row) { | ||
265 | - try { | ||
266 | - | ||
267 | - if(row && Object.keys(row).length > 0 && prop){ | ||
268 | - let html = eval(prop + '(' + row[prop] + ')'); | ||
269 | - if(html){ | ||
270 | - return html; | ||
271 | - } | ||
272 | - } | ||
273 | - }catch (e){ | ||
274 | - | ||
275 | - } | ||
276 | - return `<span style="text-decoration: underline;color: blue;">${row[v.kpiId]}</span>`;; | ||
277 | - } | ||
278 | - | ||
279 | - } | ||
280 | - | ||
281 | - col.push(colInfo) | ||
282 | - } | ||
283 | - }); | ||
284 | - dataList.push(item); | ||
285 | - index++; | ||
286 | - } | ||
287 | - // 设置数据 | ||
288 | - list.value.dataList = dataList; | ||
289 | - list.value.columns = col; | ||
290 | - } | ||
291 | - | ||
292 | - /** | ||
293 | - * KPI数据处理方式 | ||
294 | - * <p> | ||
295 | - * 作者: Wang | ||
296 | - * 时间:2021/12/15 16:12 | ||
297 | - */ | ||
298 | - let dataTypeByFlag = (data) => { | ||
299 | - let flags = [{ | ||
300 | - prop: "count", | ||
301 | - width:80, | ||
302 | - label: "检测项目数", | ||
303 | - }, { | ||
304 | - prop: "normal", | ||
305 | - width:80, | ||
306 | - label: "正常数", | ||
307 | - render: function (row) { | ||
308 | - return `<span >${row.normal == undefined ? 0 : row.normal }</span>` | ||
309 | - } | ||
310 | - }, { | ||
311 | - prop: "abnormal", | ||
312 | - width:80, | ||
313 | - label: "异常出", | ||
314 | - render: function (row) { | ||
315 | - return `<span >${row.abnormal == undefined ? 0 : row.abnormal }</span>` | ||
316 | - } | ||
317 | - }, { | ||
318 | - prop: "alarm", | ||
319 | - width:80, | ||
320 | - label: "告警", | ||
321 | - click: function (row) { | ||
322 | - openAlarmDialog(row); | ||
323 | - }, | ||
324 | - render: function (row) { | ||
325 | - return `<span style="text-decoration: underline;color: blue;">${row.alarm == undefined ? 0 : row.alarm }</span>` | ||
326 | - } | ||
327 | - }]; | ||
328 | - | ||
329 | - let dataList = []; | ||
330 | - let col = [{ | ||
331 | - prop: 'kpiName', | ||
332 | - label: props.itemName, | ||
333 | - width: 150 | ||
334 | - }]; | ||
335 | - | ||
336 | - flags.forEach(function (item) { | ||
337 | - col.push(item) | ||
338 | - }) | ||
339 | - let index = 0; | ||
340 | - for (let resId in data) { | ||
341 | - let list = data[resId]; | ||
342 | - let item = getItem(list[0]); | ||
343 | - list.forEach(function (v) { | ||
344 | - item[v.flag] = v.kpiValue; | ||
345 | - }); | ||
346 | - dataList.push(item); | ||
347 | - index++; | ||
348 | - } | ||
349 | - | ||
350 | - // 设置数据 | ||
351 | - list.value.dataList = dataList; | ||
352 | - list.value.columns = col; | ||
353 | - } | ||
354 | - | ||
355 | - return {dataTypeByKpi, dataTypeByFlag} | ||
356 | -} | ||
357 | - | ||
358 | -const resDetail = (props,openLine) => { | ||
359 | - const {proxy} = Vue.getCurrentInstance(); | ||
360 | - let resListDialog = Vue.ref(false); | ||
361 | - let resList = Vue.ref({ | ||
362 | - columns: [{ | ||
363 | - prop: "resType", | ||
364 | - label: "资源类型", | ||
365 | - }, { | ||
366 | - prop: "resName", | ||
367 | - label: "资源名称", | ||
368 | - }, { | ||
369 | - prop: "kpiName", | ||
370 | - label: "指标名称", | ||
371 | - }, { | ||
372 | - prop: "kpiValue", | ||
373 | - label: "指标值", | ||
374 | - click:function (row){ | ||
375 | - openLine(row); | ||
376 | - }, | ||
377 | - render:function (row){ | ||
378 | - return `<span style="text-decoration: underline;color: blue;">${row.kpiValue}</span>` | ||
379 | - } | ||
380 | - }, { | ||
381 | - prop: "collTime", | ||
382 | - label: "采集时间", | ||
383 | - }], | ||
384 | - dataList: [], | ||
385 | - total: 0 | ||
386 | - }); | ||
387 | - | ||
388 | - let showResListDialog = (flg) => { | ||
389 | - resListDialog.value = flg; | ||
390 | - } | ||
391 | - | ||
392 | - let handleClick = (row, index) => { | ||
393 | - | ||
394 | - showResListDialog(true); | ||
395 | - getResListPage(row); | ||
396 | - } | ||
397 | - | ||
398 | - let getResListPage = (row) => { | ||
399 | - let params = { | ||
400 | - faultNo: props.faultNo, | ||
401 | - targetType: props.targetType, | ||
402 | - resId: row.resId, | ||
403 | - kpiId: row.kpiId, | ||
404 | - flag: row.flag | ||
405 | - } | ||
406 | - proxy.$http.get('/api-web/fault/result/findResList', params, function (res) { | ||
407 | - if (res && res.success) { | ||
408 | - if (res.data) { | ||
409 | - resList.value.dataList = res.data; | ||
410 | - } | ||
411 | - } else { | ||
412 | - proxy.$global.showMsg(res.msg, "warning"); | ||
413 | - } | ||
414 | - }); | ||
415 | - } | ||
416 | - | ||
417 | - let loadPage = () => { | ||
418 | - | ||
419 | - } | ||
420 | - | ||
421 | - return { | ||
422 | - resList, | ||
423 | - resListDialog, | ||
424 | - showResListDialog, | ||
425 | - getResListPage, | ||
426 | - loadPage, | ||
427 | - handleClick | ||
428 | - } | ||
429 | -} | ||
430 | - | 1 | +import store from '/vue3/src/store/index.js'; |
431 | 2 | ||
432 | export default { | 3 | export default { |
433 | - name: 'resultItemIndex', | 4 | + name: 'faultDialTest', |
434 | template: '', | 5 | template: '', |
435 | components: { | 6 | components: { |
436 | - 'echarts-line': Vue.defineAsyncComponent( | ||
437 | - () => myImport('components/common/echarts/line/index') | ||
438 | - ) | ||
439 | - }, | ||
440 | - data() { | ||
441 | - return {} | 7 | + 'res-item': Vue.defineAsyncComponent( |
8 | + () => myImport('components/page/faultDiagnosis/result/item/resItem/index') | ||
9 | + ), | ||
442 | }, | 10 | }, |
443 | props: { | 11 | props: { |
444 | - targetType: { | ||
445 | - type: String, | ||
446 | - default: '' | ||
447 | - }, | ||
448 | faultNo: { | 12 | faultNo: { |
449 | type: String, | 13 | type: String, |
450 | default: '' | 14 | default: '' |
15 | + } | ||
451 | }, | 16 | }, |
452 | - itemName: { | ||
453 | - type: String, | ||
454 | - default: '' | ||
455 | - }, | ||
456 | - // 展示详情页 | ||
457 | - showDetail: { | ||
458 | - type: String, | ||
459 | - default: '' | ||
460 | - }, | ||
461 | - // 数据转行方式 | ||
462 | - colType: { | ||
463 | - type: String, | ||
464 | - default: 'kpi' | ||
465 | - }, | 17 | + data() { |
18 | + return {} | ||
466 | }, | 19 | }, |
467 | setup(props, {attrs, slots, emit}) { | 20 | setup(props, {attrs, slots, emit}) { |
468 | - let width = Vue.ref(window.innerWidth * 0.8 - 220); | ||
469 | const {proxy} = Vue.getCurrentInstance(); | 21 | const {proxy} = Vue.getCurrentInstance(); |
470 | - let list = Vue.ref({ | ||
471 | - columns: [], | ||
472 | - dataList: [], | ||
473 | - total: 0 | ||
474 | - }); | ||
475 | - | ||
476 | - let detailInfo = Vue.ref({ | ||
477 | - rate: 0, | ||
478 | - info: '' | ||
479 | - }); | ||
480 | - | ||
481 | - const { | ||
482 | - showLineDialog, | ||
483 | - closeLineDialog, | ||
484 | - openLine, | ||
485 | - dataSet | ||
486 | - } = lineDetail(props); | ||
487 | - | ||
488 | - | ||
489 | - const { | ||
490 | - resList, | ||
491 | - resListDialog, | ||
492 | - showResListDialog, | ||
493 | - getResListPage, | ||
494 | - loadPage, | ||
495 | - handleClick | ||
496 | - } = resDetail(props,openLine); | ||
497 | - | ||
498 | - const { | ||
499 | - showAlarmDialog, | ||
500 | - openAlarmDialog, | ||
501 | - alarmList, | ||
502 | - alarmFlg | ||
503 | - } = alarmDialog(props); | ||
504 | 22 | ||
505 | - // 数据统计方式 | ||
506 | - const {dataTypeByKpi, dataTypeByFlag} = colTypes(props, list,openLine,openAlarmDialog); | ||
507 | - | ||
508 | - /** | ||
509 | - * 获取表格数据 | ||
510 | - * <p> | ||
511 | - * 作者: Wang | ||
512 | - * 时间:2021/12/15 17:26 | ||
513 | - */ | ||
514 | - let getPage = () => { | ||
515 | - let params = { | ||
516 | - faultNo: props.faultNo, | ||
517 | - targetType: props.targetType | ||
518 | - } | ||
519 | - proxy.$http.get('/api-web/fault/result/findResult', params, function (res) { | ||
520 | - if (res && res.success) { | ||
521 | - if (res.map) { | ||
522 | - callback(res.map); | ||
523 | - } | ||
524 | - } else { | ||
525 | - proxy.$global.showMsg(res.msg, "warning"); | ||
526 | - } | ||
527 | - }); | ||
528 | - | ||
529 | - // 设置数据 | ||
530 | - let callback = (data) => { | ||
531 | - | ||
532 | - switch (props.colType) { | ||
533 | - case 'kpi': | ||
534 | - dataTypeByKpi(data); | ||
535 | - break; | ||
536 | - case 'flag': | ||
537 | - dataTypeByFlag(data); | ||
538 | - break; | ||
539 | - } | 23 | + let dialTest = Vue.ref(); |
24 | + let card = Vue.ref({}) | ||
25 | + let cardOpen = Vue.ref(false); | ||
26 | + let allCard = () => { | ||
27 | + cardOpen.value = true; | ||
540 | } | 28 | } |
29 | + let closeCard = () => { | ||
30 | + cardOpen.value = false; | ||
541 | } | 31 | } |
542 | - | ||
543 | - /** | ||
544 | - * 获取统计信息 | ||
545 | - */ | ||
546 | - let findCountInfo = () => { | 32 | + let getDialtestList = () => { |
547 | let params = { | 33 | let params = { |
548 | faultNo: props.faultNo, | 34 | faultNo: props.faultNo, |
549 | - targetType: props.targetType | ||
550 | - } | ||
551 | - proxy.$http.get('/api-web/fault/result/findCountInfo', params, function (res) { | ||
552 | - if (res && res.success) { | ||
553 | - if (res.map) { | ||
554 | - detailInfo.value = res.map; | 35 | + targetType: "dialtest" |
555 | } | 36 | } |
556 | - } else { | ||
557 | - proxy.$global.showMsg(res.msg, "warning"); | 37 | + |
38 | + store.dispatch('getFaultList', params).then((res) => { | ||
39 | + if (res.data && res.success) { | ||
40 | + dialTest.value = res.data[0]; | ||
41 | + card.value = dialTest.value.faultFixInfoList[0]; | ||
558 | } | 42 | } |
559 | - }); | 43 | + }).catch(e => { |
44 | + console.log(e); | ||
45 | + }) | ||
560 | } | 46 | } |
561 | 47 | ||
562 | - // 监听编辑状态 | ||
563 | - Vue.watch(() => props.faultNo, (newValue, oldVlaue) => { | ||
564 | - getPage(); | ||
565 | - }); | ||
566 | - | ||
567 | // 挂载完 | 48 | // 挂载完 |
568 | Vue.onMounted(() => { | 49 | Vue.onMounted(() => { |
569 | - getPage(); | ||
570 | - findCountInfo(); | 50 | + getDialtestList(); |
571 | }) | 51 | }) |
572 | 52 | ||
573 | return { | 53 | return { |
574 | - width, | ||
575 | - list, | ||
576 | - detailInfo, | ||
577 | - | ||
578 | - // 折线图 | ||
579 | - showLineDialog, | ||
580 | - closeLineDialog, | ||
581 | - openLine, | ||
582 | - dataSet, | ||
583 | - | ||
584 | - | ||
585 | - // 资源详情 | ||
586 | - resList, | ||
587 | - resListDialog, | ||
588 | - showResListDialog, | ||
589 | - getResListPage, | ||
590 | - loadPage, | ||
591 | - handleClick, | ||
592 | - | ||
593 | - // 告警弹框 | ||
594 | - showAlarmDialog, | ||
595 | - openAlarmDialog, | ||
596 | - alarmList, | ||
597 | - alarmFlg | 54 | + card, |
55 | + allCard, | ||
56 | + closeCard, | ||
57 | + cardOpen, | ||
58 | + dialTest | ||
598 | } | 59 | } |
599 | } | 60 | } |
600 | } | 61 | } |
1 | +<el-divider/> | ||
2 | +<div class="d-flex" v-model="dialTest"> | ||
3 | + <div class="d-flex align-center" style="width: 300px;justify-content: center;"> | ||
4 | + <span style="width: 10px;height: 10px;background-color: red;border-radius: 50%"> </span> | ||
5 | + <img class="m-l-6" src="../src/style/img/fault/base/resType/数据库.png"> | ||
6 | + <a class="m-l-6">数据库</a> | ||
7 | + </div> | ||
8 | + <div> | ||
9 | + <div class="d-flex align-left"> | ||
10 | + <div style="width: 200px;margin-left: 20px;display: flex;align-self: center;"> | ||
11 | + <img src="../src/style/img/disRes.png"> | ||
12 | + <span style="margin: 0px 6px 0px 6px;width: 95px">诊断资源</span> | ||
13 | + <h>{{dialTest && dialTest.diagnosticResources ?dialTest.diagnosticResources:0}}</h> | ||
14 | + </div> | ||
15 | + | | ||
16 | + <div style="width: 200px;margin-left: 20px;display: flex;align-self: center;"> | ||
17 | + <img src="../src/style/img/disKpi.png"> | ||
18 | + <span style="margin: 0px 6px 0px 6px;width: 95px">诊断指标</span> | ||
19 | + <h>{{dialTest && dialTest.diagnosticIndicators ?dialTest.diagnosticIndicators:0}}</h> | ||
20 | + </div> | ||
21 | + | | ||
22 | + <div style="width: 200px;margin-left: 20px;display: flex;align-self: center;"> | ||
23 | + <img src="../src/style/img/disItem.png"> | ||
24 | + <span style="margin: 0px 6px 0px 6px;width: 95px">诊断项</span> | ||
25 | + <h>{{dialTest && dialTest.diagnosticItem ?dialTest.diagnosticItem:0}}</h> | ||
26 | + </div> | ||
27 | + </div> | ||
28 | + <div style="text-align: left;display: flex;margin-top: 10px;"> | ||
29 | + <div style="width: 200px;margin-left: 20px;display: flex;align-self: center;color: yellowgreen"> | ||
30 | + <img src="../src/style/img/success.png"> | ||
31 | + <span style="margin: 0px 6px 0px 6px;width: 95px;">正常</span> | ||
32 | + <h style="font-size: 20px">{{dialTest && dialTest.normal ?dialTest.normal:0}}</h> | ||
33 | + </div> | ||
34 | + | | ||
35 | + <div style="width: 200px;margin-left: 20px;display: flex;align-self: center;color: #f8d305"> | ||
36 | + <img src="../src/style/img/error.png"> | ||
37 | + <span style="margin: 0px 6px 0px 6px;width: 95px;"> 异常</span> | ||
38 | + <h style="font-size: 20px">{{dialTest && dialTest.abnormal ?dialTest.abnormal:0}}</h> | ||
39 | + </div> | ||
40 | + | | ||
41 | + <div style="width: 200px;margin-left: 20px;display: flex;align-self: center;color: red"> | ||
42 | + <img src="../src/style/img/fault/base/alarm.png"> | ||
43 | + <span style="margin: 0px 6px 0px 6px;width: 95px;"> 告警</span> | ||
44 | + <h style="font-size: 20px">{{dialTest && dialTest.abnormal ?dialTest.abnormal:0}}</h> | ||
45 | + </div> | ||
46 | + </div> | ||
47 | + </div> | ||
48 | + <div class="align-center" style="flex: 1"> | ||
49 | + <a class="m-r-20" @click="allCard()">更多</a> | ||
50 | + <a @click="closeCard()">收起</a> | ||
51 | + </div> | ||
52 | +</div> | ||
53 | +<div v-if="cardOpen" | ||
54 | + style="margin-top: 10px;background-color: whitesmoke;display: flex;justify-content: flex-start;flex-wrap: wrap;padding: 6px;"> | ||
55 | + <div v-for="item in 10" style="width: 25%"> | ||
56 | + <div style="min-width: 338px;height: 160px;background: url(../src/style/img/fault/base/bg.png) no-repeat;background-size: 100% 100%;padding-top: 10px;"> | ||
57 | + <el-row style="height: 70px;padding: 10px 30px;"> | ||
58 | + <el-col :span="4" style="line-height: 55px;"> | ||
59 | + <img src="../src/style/img/fault/base/基础-数据库-黄.png"> | ||
60 | + </el-col> | ||
61 | + <el-col :span="16"> | ||
62 | + 资源名称xxxxxx<br> | ||
63 | + 127.0.0.0.111111 | ||
64 | + </el-col> | ||
65 | + <el-col :span="4"> | ||
66 | + <i class="iconfont">more</i> | ||
67 | + </el-col> | ||
68 | + </el-row> | ||
69 | + | ||
70 | + <el-row style="height: 70px;padding: 10px 30px;"> | ||
71 | + <el-col :span="4"> | ||
72 | + <img src="../src/style/img/fault/base/连接失败.png"> | ||
73 | + </el-col> | ||
74 | + <el-col :span="1" style="line-height: 36px"> | ||
75 | + | | ||
76 | + </el-col> | ||
77 | + <el-col :span="4"> | ||
78 | + <img src="../src/style/img/fault/base/CPU-绿.png"><br/> | ||
79 | + 21% | ||
80 | + </el-col> | ||
81 | + <el-col :span="1" style="line-height: 36px"> | ||
82 | + | | ||
83 | + </el-col> | ||
84 | + <el-col :span="4"> | ||
85 | + <img src="../src/style/img/fault/base/内存.png"><br/> | ||
86 | + 21% | ||
87 | + </el-col> | ||
88 | + <el-col :span="1" style="line-height: 36px"> | ||
89 | + | | ||
90 | + </el-col> | ||
91 | + <el-col :span="4"> | ||
92 | + <img src="../src/style/img/fault/base/alarm.png"><br/> | ||
93 | + 21% | ||
94 | + </el-col> | ||
95 | + <el-col :span="1" style="line-height: 36px"> | ||
96 | + | | ||
97 | + </el-col> | ||
98 | + <el-col :span="4"> | ||
99 | + <img src="../src/style/img/fault/base/时间-绿.png"><br/> | ||
100 | + 30分钟 | ||
101 | + </el-col> | ||
102 | + </el-row> | ||
103 | + </div> | ||
104 | + </div> | ||
105 | +</div> |
1 | +import store from '/vue3/src/store/index.js'; | ||
2 | + | ||
3 | +export default { | ||
4 | + name: 'faultDialTest', | ||
5 | + template: '', | ||
6 | + components: {}, | ||
7 | + props: { | ||
8 | + faultNo: { | ||
9 | + type: String, | ||
10 | + default: '' | ||
11 | + } | ||
12 | + }, | ||
13 | + data() { | ||
14 | + return {} | ||
15 | + }, | ||
16 | + setup(props, {attrs, slots, emit}) { | ||
17 | + const {proxy} = Vue.getCurrentInstance(); | ||
18 | + | ||
19 | + let dialTest = Vue.ref(); | ||
20 | + let card = Vue.ref({}) | ||
21 | + let cardOpen = Vue.ref(false); | ||
22 | + let allCard = () => { | ||
23 | + cardOpen.value = true; | ||
24 | + } | ||
25 | + let closeCard = () => { | ||
26 | + cardOpen.value = false; | ||
27 | + } | ||
28 | + let getDialtestList = () => { | ||
29 | + let params = { | ||
30 | + faultNo: props.faultNo, | ||
31 | + targetType: "dialtest" | ||
32 | + } | ||
33 | + | ||
34 | + store.dispatch('getFaultList', params).then((res) => { | ||
35 | + if (res.data && res.success) { | ||
36 | + dialTest.value = res.data[0]; | ||
37 | + card.value = dialTest.value.faultFixInfoList[0]; | ||
38 | + } | ||
39 | + }).catch(e => { | ||
40 | + console.log(e); | ||
41 | + }) | ||
42 | + } | ||
43 | + | ||
44 | + // 挂载完 | ||
45 | + Vue.onMounted(() => { | ||
46 | + getDialtestList(); | ||
47 | + }) | ||
48 | + | ||
49 | + return { | ||
50 | + card, | ||
51 | + allCard, | ||
52 | + closeCard, | ||
53 | + cardOpen, | ||
54 | + dialTest | ||
55 | + } | ||
56 | + } | ||
57 | +} |
@@ -2,9 +2,9 @@ export default { | @@ -2,9 +2,9 @@ export default { | ||
2 | name: 'resIndex', | 2 | name: 'resIndex', |
3 | template: '', | 3 | template: '', |
4 | components: { | 4 | components: { |
5 | - // 'result-item': Vue.defineAsyncComponent( | ||
6 | - // () => myImport('components/page/faultDiagnosis/result/item/index') | ||
7 | - // ), | 5 | + 'result-item': Vue.defineAsyncComponent( |
6 | + () => myImport('components/page/faultDiagnosis/result/item/index') | ||
7 | + ), | ||
8 | 'dialtest-item': Vue.defineAsyncComponent( | 8 | 'dialtest-item': Vue.defineAsyncComponent( |
9 | () => myImport('components/page/faultDiagnosis/result/dialtest/index') | 9 | () => myImport('components/page/faultDiagnosis/result/dialtest/index') |
10 | ), | 10 | ), |
@@ -29,7 +29,7 @@ export default { | @@ -29,7 +29,7 @@ export default { | ||
29 | components: 'netLinks', | 29 | components: 'netLinks', |
30 | color: '#409EFF', | 30 | color: '#409EFF', |
31 | detail:true, | 31 | detail:true, |
32 | - state:'1' | 32 | + state:'0' |
33 | },{ | 33 | },{ |
34 | faultType: 'DIALTEST', | 34 | faultType: 'DIALTEST', |
35 | faultTypeName: '拨测', | 35 | faultTypeName: '拨测', |
@@ -38,7 +38,7 @@ export default { | @@ -38,7 +38,7 @@ export default { | ||
38 | itemName: '场景名称', | 38 | itemName: '场景名称', |
39 | detail: false, | 39 | detail: false, |
40 | colType: 'kpi', | 40 | colType: 'kpi', |
41 | - state:'1' | 41 | + state:'0' |
42 | }, { | 42 | }, { |
43 | faultType: 'NPM', | 43 | faultType: 'NPM', |
44 | faultTypeName: 'NPM', | 44 | faultTypeName: 'NPM', |
@@ -47,7 +47,7 @@ export default { | @@ -47,7 +47,7 @@ export default { | ||
47 | itemName: '链路(流名称)', | 47 | itemName: '链路(流名称)', |
48 | detail: false, | 48 | detail: false, |
49 | colType: 'kpi', | 49 | colType: 'kpi', |
50 | - state:'1' | 50 | + state:'0' |
51 | }, { | 51 | }, { |
52 | faultType: 'BASE', | 52 | faultType: 'BASE', |
53 | faultTypeName: '基础', | 53 | faultTypeName: '基础', |
@@ -56,7 +56,7 @@ export default { | @@ -56,7 +56,7 @@ export default { | ||
56 | itemName: '检测指标', | 56 | itemName: '检测指标', |
57 | detail: true, | 57 | detail: true, |
58 | colType: 'flag', | 58 | colType: 'flag', |
59 | - state:'1' | 59 | + state:'0' |
60 | }, { | 60 | }, { |
61 | faultType: 'APM', | 61 | faultType: 'APM', |
62 | faultTypeName: 'APM', | 62 | faultTypeName: 'APM', |
@@ -65,7 +65,7 @@ export default { | @@ -65,7 +65,7 @@ export default { | ||
65 | itemName: '检测指标', | 65 | itemName: '检测指标', |
66 | detail: true, | 66 | detail: true, |
67 | colType: 'flag', | 67 | colType: 'flag', |
68 | - state:'1' | 68 | + state:'0' |
69 | }, { | 69 | }, { |
70 | faultType: 'faultHis', | 70 | faultType: 'faultHis', |
71 | faultTypeName: '知识库', | 71 | faultTypeName: '知识库', |
@@ -74,7 +74,7 @@ export default { | @@ -74,7 +74,7 @@ export default { | ||
74 | itemName: '知识库', | 74 | itemName: '知识库', |
75 | detail: true, | 75 | detail: true, |
76 | colType: 'flag', | 76 | colType: 'flag', |
77 | - state:'1' | 77 | + state:'0' |
78 | }] | 78 | }] |
79 | }); | 79 | }); |
80 | 80 |
-
Please register or login to post a comment