import request from '@/utils/request';

/**
 * 工单信息
 */
export async function listInspection(data) {
  const res = await request.get('/eam/workorder/listInspection?type='+data.type);
  if (res.data.code == 0) {
    return Promise.resolve(res.data.data)
  }
  return Promise.reject(new Error(res.data.message));
}
/**
 * 设备状态
 */
 export async function queryRunStatus(data) {
  const res = await request.get('/eam/workorder/queryRunStatus');
  if (res.data.code == 0) {
    return Promise.resolve(res.data.data)
  }
  return Promise.reject(new Error(res.data.message));
}
/**
 * 部门故障统计率
 */
 export async function queryGroupName(data) {
  const res = await request.get('/eam/workorder/queryGroupName');
  if (res.data.code == 0) {
    return Promise.resolve(res.data.data)
  }
  return Promise.reject(new Error(res.data.message));
}
/**
 * 设备故障数统计
 */
 export async function queryDevice(data) {
  const res = await request.get('/eam/workorder/queryDevice');
  if (res.data.code == 0) {
    return Promise.resolve(res.data.data)
  }
  return Promise.reject(new Error(res.data.message));
}