...
|
...
|
@@ -281,13 +281,18 @@ const faultEvent = () => { |
|
|
* @param global
|
|
|
* @param arr [[{指标对象},{指标对象},....].[{指标对象},{指标对象},....]]
|
|
|
*/
|
|
|
const sendEventMoreDialog = (emit, global, arr, option) => {
|
|
|
const sendEventMoreDialog = (emit, global, arr, title) => {
|
|
|
if (!arr || arr.length == 0) {
|
|
|
global.showMsg("暂无数据!", "warning");
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
if (!title) {
|
|
|
title = '更多';
|
|
|
}
|
|
|
|
|
|
var obj = {
|
|
|
title: title,
|
|
|
columns: [{
|
|
|
prop: 'taskName',
|
|
|
width: 220,
|
...
|
...
|
@@ -295,8 +300,10 @@ const faultEvent = () => { |
|
|
}],
|
|
|
data: []
|
|
|
}
|
|
|
if (arr.length == undefined) {
|
|
|
arr = [];
|
|
|
}
|
|
|
|
|
|
// TODO 数据需要适配
|
|
|
arr.forEach(function (list) {
|
|
|
var dataItem = {};
|
|
|
list.forEach(function (listItem) {
|
...
|
...
|
@@ -326,6 +333,80 @@ const faultEvent = () => { |
|
|
emit('openDialog', 'more', {}, obj);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 打开正常/异常诊断项
|
|
|
* @param emit
|
|
|
* @param global
|
|
|
* @param arr [[{指标对象},{指标对象},....].[{指标对象},{指标对象},....]]
|
|
|
*/
|
|
|
const sendEventNormalDialog = (emit, global, faultNo, targetType, resClass, type) => {
|
|
|
// if (!arr || arr.length == 0) {
|
|
|
// global.showMsg("暂无数据!", "warning");
|
|
|
// return;
|
|
|
// }
|
|
|
|
|
|
var title = type == 'normal' ? '诊断项(正常)' : '诊断项(异常)';
|
|
|
if (!title) {
|
|
|
title = '更多';
|
|
|
}
|
|
|
|
|
|
var obj = {
|
|
|
title: title,
|
|
|
columns: [{
|
|
|
prop: 'taskName',
|
|
|
width: 120,
|
|
|
label: '名称',
|
|
|
}, {
|
|
|
prop: 'kpiName',
|
|
|
width: 120,
|
|
|
label: '指标名称',
|
|
|
}, {
|
|
|
prop: 'diagnosisResult',
|
|
|
width: 80,
|
|
|
label: '诊断值',
|
|
|
}, {
|
|
|
prop: 'isAbnormal',
|
|
|
width: 80,
|
|
|
label: '诊断结果',
|
|
|
render: function (row) {
|
|
|
if (row) {
|
|
|
if (row.isAbnormal === 1) {
|
|
|
return `<span style="color: red;">异常</span>`
|
|
|
} else {
|
|
|
return `<span style="color: blue;">正常</span>`
|
|
|
}
|
|
|
}
|
|
|
return '';
|
|
|
}
|
|
|
|
|
|
}],
|
|
|
data: []
|
|
|
}
|
|
|
|
|
|
var isAbnormal = '';
|
|
|
// 正常
|
|
|
if (type == 'normal') {
|
|
|
isAbnormal = 0;
|
|
|
} else {
|
|
|
isAbnormal = 1;
|
|
|
}
|
|
|
|
|
|
store.dispatch('getFaultDiagnosticItemList', {
|
|
|
isAbnormal: isAbnormal,
|
|
|
resClass: resClass,
|
|
|
targetType: targetType,
|
|
|
faultNo: faultNo
|
|
|
}).then((res) => {
|
|
|
if (res && res.success) {
|
|
|
obj.data = res.data;
|
|
|
emit('openDialog', 'more', {}, obj);
|
|
|
} else {
|
|
|
global.showMsg(res.msg, "warning");
|
|
|
}
|
|
|
});
|
|
|
|
|
|
emit('openDialog', 'more', {}, obj);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 诊断业务场景
|
...
|
...
|
@@ -406,7 +487,8 @@ const faultEvent = () => { |
|
|
sendEventLineDialog,
|
|
|
sendEventMoreDialog,
|
|
|
sendEventDiagnoseBusinessScenarios,
|
|
|
sendEventDiagnoseKpiList
|
|
|
sendEventDiagnoseKpiList,
|
|
|
sendEventNormalDialog
|
|
|
|
|
|
}
|
|
|
|
...
|
...
|
|