import request from "@/utils/request";

// 查询故障记录列表
export function listFailure(query) {
  return request({
    url: "/system/failure/list",
    method: "get",
    params: query,
  });
}

// 查询故障记录详细
export function getFailure(id) {
  return request({
    url: "/system/failure/" + id,
    method: "get",
  });
}

// 新增故障记录
export function addFailure(data) {
  return request({
    url: "/system/failure",
    method: "post",
    data: data,
  });
}

// 修改故障记录
export function updateFailure(data) {
  return request({
    url: "/system/failure",
    method: "put",
    data: data,
  });
}

// 删除故障记录
export function delFailure(id) {
  return request({
    url: "/system/failure/" + id,
    method: "delete",
  });
}

// 获取专业
export function getMajorOption() {
  return request({
    url: "/system/failure/getMajorOption",
    method: "get",
  });
}
// 生成报告
export function generateReport(reportMonth, major) {
  return request({
    url: "/system/failure/generateReport",
    method: "get",
    params: {
      reportMonth,
      major,
    },
  });
}
