import request from '@/utils/request'

// 查询隐患排查列表
export function listAccident(query) {
  return request({
    url: '/production/accident/list',
    method: 'get',
    params: query
  })
}

// 首页统计
export function homeData(query) {
  return request({
    url: '/production/accident/homeData',
    method: 'get',
    params: query
  })
}

// 年份统计
export function yearData(query) {
  return request({
    url: '/production/accident/yearData',
    method: 'get',
    params: query
  })
}

// 状态统计
export function statusData(query) {
  return request({
    url: '/production/accident/statusData',
    method: 'get',
    params: query
  })
}

// 班组统计
export function teamData(query) {
  return request({
    url: '/production/accident/teamData',
    method: 'get',
    params: query
  })
}

// 隐患类型统计
export function accidentTypeData(query) {
  return request({
    url: '/production/accident/accidentTypeData',
    method: 'get',
    params: query
  })
}

// 隐患分级统计
export function confirmData(query) {
  return request({
    url: '/production/accident/confirmData',
    method: 'get',
    params: query
  })
}

// 查询隐患排查详细
export function getAccident(id) {
  return request({
    url: '/production/accident/' + id,
    method: 'get'
  })
}

// 新增隐患排查
export function addAccident(data) {
  return request({
    url: '/production/accident',
    method: 'post',
    data: data
  })
}

// 修改隐患排查
export function updateAccident(data) {
  return request({
    url: '/production/accident',
    method: 'put',
    data: data
  })
}

// 删除隐患排查
export function delAccident(id) {
  return request({
    url: '/production/accident/' + id,
    method: 'delete'
  })
}

// 导出隐患排查
export function exportAccident(query) {
  return request({
    url: '/production/accident/export',
    method: 'get',
    params: query
  })
}
