import { ElMessage } from 'element-plus';
|
import request from '/@/utils/request';
|
|
/**
|
* @summary 获取状态KPI信息
|
*/
|
export const GetStatusKpiInfoStd = async (req: any = request) => {
|
return req({
|
url: '/Phm/Status/Preview/GetStatusKpiInfo@V1.0',
|
method: 'GET',
|
});
|
};
|
|
/**
|
* 获取状态KPI信息
|
* 报错时返回 undefined
|
* @returns
|
*/
|
export const getStatusKpiInfoStd = async (req: any = request) => {
|
const res = await GetStatusKpiInfoStd(req).catch(() => {
|
return undefined;
|
});
|
|
if (res?.Code === 0) {
|
const resData = res.Data as any;
|
return resData;
|
} else {
|
ElMessage.error('获取KPI信息失败' + (res?.Message ? `,${JSON.stringify(res.Message)}` : ''));
|
return undefined;
|
}
|
};
|
|
/**
|
* @summary 获取设备状态列表
|
*/
|
export const GetEquipmentStatusListStd = async (params, req: any = request) => {
|
return req({
|
url: '/Phm/Status/Preview/GetEquipmentStatusList@V1.0',
|
method: 'GET',
|
params,
|
});
|
};
|
|
/**
|
* 获取设备状态列表
|
* 报错时返回 undefined
|
* @returns
|
*/
|
export const getEquipmentStatusListStd = async (params, req: any = request) => {
|
const res = await GetEquipmentStatusListStd(params, req).catch(() => {
|
return undefined;
|
});
|
|
if (res?.Code === 0) {
|
const resData = (res.Data || []) as any[];
|
return resData;
|
} else {
|
ElMessage.error('获取设备状态失败' + (res?.Message ? `,${JSON.stringify(res.Message)}` : ''));
|
return undefined;
|
}
|
};
|
|
/**
|
* @summary 获取预警数量
|
*/
|
export const GetTrendAlarmCountListStd = async (params, req: any = request) => {
|
return req({
|
url: '/Phm/Status/Preview/GetTrendAlarmCountList@V1.0',
|
method: 'GET',
|
params,
|
});
|
};
|
|
/**
|
* 获取预警数量
|
* 报错时返回 undefined
|
* @returns
|
*/
|
export const getTrendAlarmCountListStd = async (params, req: any = request) => {
|
const res = await GetTrendAlarmCountListStd(params, req).catch(() => {
|
return undefined;
|
});
|
|
if (res?.Code === 0) {
|
const resData = (res.Data || []) as any[];
|
return resData;
|
} else {
|
ElMessage.error('获取预警数量失败' + (res?.Message ? `,${JSON.stringify(res.Message)}` : ''));
|
return undefined;
|
}
|
};
|
|
/**
|
* @summary 获取故障报警列表
|
*/
|
export const GetFaultAlarmCountListStd = async (params, req: any = request) => {
|
return req({
|
url: '/Phm/Status/Preview/GetFaultAlarmCountList@V1.0',
|
method: 'GET',
|
params,
|
});
|
};
|
|
/**
|
* 获取故障报警列表
|
* 报错时返回 undefined
|
* @returns
|
*/
|
export const getFaultAlarmCountListStd = async (params, req: any = request) => {
|
const res = await GetFaultAlarmCountListStd(params, req).catch(() => {
|
return undefined;
|
});
|
|
if (res?.Code === 0) {
|
const resData = (res.Data || []) as any[];
|
return resData;
|
} else {
|
ElMessage.error('获取故障报警列表失败' + (res?.Message ? `,${JSON.stringify(res.Message)}` : ''));
|
return undefined;
|
}
|
};
|
|
/**
|
* @summary 获取故障诊断数量列表
|
*/
|
export const GetFaultDiagnosisCountListStd = async (params, req: any = request) => {
|
return req({
|
url: '/Phm/Status/Preview/GetFaultDiagnosisCountList@V1.0',
|
method: 'GET',
|
params,
|
});
|
};
|
|
/**
|
* 获取故障诊断数量列表
|
* 报错时返回 undefined
|
* @returns
|
*/
|
export const getFaultDiagnosisCountListStd = async (params, req: any = request) => {
|
const res = await GetFaultDiagnosisCountListStd(params, req).catch(() => {
|
return undefined;
|
});
|
|
if (res?.Code === 0) {
|
const resData = (res.Data || []) as any[];
|
return resData;
|
} else {
|
ElMessage.error('获取故障诊断数量失败' + (res?.Message ? `,${JSON.stringify(res.Message)}` : ''));
|
return undefined;
|
}
|
};
|