import request from '@/utils/request'
// 分析单元列表
export function unitList(params) {
  return request({
    url: `/doubledefense/unit/list`,
    method: "get",
    params
  });
}

// 设备设施列表
export function eventList(params) {
  return request({
    url: `/doubledefense/event/list`,
    method: "get",
    params
  });
}
// 隐患排查任务列表
export function taskList(params) {
  return request({
    url: `/doubledefense/task/list`,
    method: "get",
    params
  });
}

// 分析对象的下拉菜单
export function hazardList(params) {
  return request({
    url: `/doubledefense/hazard/list`,
    method: "get",
    params
  });
}
// 分析对象的下拉菜单
export function getList(params) {
  return request({
    url: `/doubledefense/taskInventoryRecord/list`,
    method: "get",
    params
  });
}
// 查询区域树
export function areaTree(params) {
  return request({
    url: `/system/area/tree`,
    method: "get",
    params
  });
}
// PC查询部门树结构接口
export function deptTree(params) {
  return request({
    url: `/system/user/deptTree `,
    method: "get",
    params
  });
}

// 新增分析单元
export function saveUnit(data) {
  return request({
    url: `/doubledefense/unit`,
    method: "post",
    data
  });
}
// 新增风险管控措施
export function saveMeasure(data) {
  return request({
    url: `/doubledefense/measure`,
    method: "post",
    data
  });
}
// 新增风险分级管控
export function saveTask(data) {
  return request({
    url: `/doubledefense/task`,
    method: "post",
    data
  });
}
// 修改设备设施
export function editUnit(data) {
  return request({
    url: `/doubledefense/unit`,
    method: "put",
    data
  });
}
// 修改风险管控措施
export function editMeasure(data) {
  return request({
    url: `/doubledefense/measure`,
    method: "put",
    data
  });
}
// 修改风险分级管控
export function editTask(data) {
  return request({
    url: `/doubledefense/task`,
    method: "put",
    data
  });
}

// 删除
export function delUnit(data) {
  return request({
    url: `/doubledefense/unit/${data}`,
    method: "delete",
  });
}
// 删除风险管控措施
export function delMeasure(data) {
  return request({
    url: `/doubledefense/measure/${data}`,
    method: "delete",
  });
}
// 删除风险分级管控
export function delTask(data) {
  return request({
    url: `/doubledefense/task/${data}`,
    method: "delete",
  });
}

// 查询风险管控措施列表
export function measureList(params) {
  return request({
    url: `/doubledefense/measure/list`,
    method: "get",
    params
  });
}

// 岗位的接口
export function postList(params) {
  return request({
    url: `/system/post/list?pageNum=1&pageSize=1000`,
    method: "get",
    params
  });
}

// 获取隐患排查任务详细信息
export function lookTask(params) {
  return request({
    url: `/doubledefense/task/${params}`,
    method: "get",
  });
}
