import Axios from '@/utils/request'
// 获取项目名称
export function getList (params) {
  return Axios({
    url: '/app/doubledefense/danger/list',
    method: 'get',
    params
  })
}
// 获取字典信息
export function getDict (params) {
  return Axios({
    url: '/app/common/getDict',
    method: 'get',
    params
  })
}
// 获取区域数据
export function getAreaTree (params) {
  return Axios({
    url: '/app/common/getAreaTree',
    method: 'get',
    params
  })
}
// 查询待领取隐患信息列表
export function getUnclaimedList (params) {
  return Axios({
    url: '/app/doubledefense/danger/getUnclaimedList',
    method: 'get',
    params
  })
}
// 查询分析对象列表
export function getHazardList (params) {
  return Axios({
    url: '/app/doubledefense/hazard/list',
    method: 'get',
    params
  })
}
// 获取部门数据
export function getDeptTree (params) {
  return Axios({
    url: '/app/common/getDeptTree',
    method: 'get',
    params
  })
}
// 获取部门用户数据
export function getDeptUserTree (params) {
  return Axios({
    url: '/app/common/getDeptUserTree',
    method: 'get',
    params
  })
}
// url转base64
export function convertImageToBase64Str (params) {
  return Axios({
    url: '/app/common/convertImageToBase64Str',
    method: 'get',
    params
  })
}
// 获取隐患详情信息
export function getDangerItem (params) {
  return Axios({
    url: `/app/doubledefense/danger/${params}`,
    method: 'get'
  })
}
// 新增隐患信息
export function addDanger (data) {
  return Axios({
    url: '/app/doubledefense/danger',
    method: 'post',
    data: data
  })
}
// 隐患验收
export function checkDangerManage (data) {
  return Axios({
    url: '/app/doubledefense/danger/checkDangerManage',
    method: 'post',
    data: data
  })
}
// 提交整改
export function submitDangerManage (data) {
  return Axios({
    url: '/app/doubledefense/danger/submitDangerManage',
    method: 'post',
    data: data
  })
}
// 领取隐患
export function receiveDanger (data) {
  return Axios({
    url: `/app/doubledefense/danger/receiveDanger/${data}`,
    method: 'post'
  })
}
// 隐患审核
export function dangerReview (data) {
  return Axios({
    url: '/app/doubledefense/danger/dangerReview',
    method: 'post',
    data: data
  })
}
// 修改隐患信息
export function editDanger (data) {
  return Axios({
    url: '/app/doubledefense/danger',
    method: 'put',
    data: data
  })
}
// 上传
export function upload (data) {
  return Axios({
    url: '/app/common/upload',
    method: 'post',
    data
  })
}
// 承保商
export function getContractor (params) {
  return Axios({
    url: '/app/doubledefense/contractor/tree',
    method: 'get',
    params
  })
}
