import request from "@/utils/request";
// 查询隐患工单列表
export function listTrouble(query) {
  return request({
    url: "/mudu/trouble/list",
    method: "get",
    params: query,
  });
}

// 查询隐患工单详细
export function getTrouble(id) {
  return request({
    url: "/mudu/trouble/" + id,
    method: "get",
  });
}

// 新增隐患工单
export function addTrouble(data) {
  return request({
    url: "/mudu/trouble",
    method: "post",
    data: data,
  });
}

// 修改隐患工单
export function updateTrouble(data) {
  return request({
    url: "/mudu/trouble",
    method: "put",
    data: data,
  });
}

// 删除隐患工单
export function delTrouble(id) {
  return request({
    url: "/mudu/trouble/" + id,
    method: "delete",
  });
}

// 导出隐患工单
export function exportTrouble(data) {
  return request({
    url: "/mudu/trouble/export",
    method: "post",
    data,
  });
}

// 导入隐患工单
export function importTroubleTable(data) {
  return request({
    url: "/mudu/trouble/importExcel",
    method: "post",
    headers: {
      "Content-Type": "application/x-www-form-urlencoded; charset=UTF-8",
    },
    data,
  });
}
