/**
 * 工程管理页面 API
 */
import request from '@/utils/request'

/** 工程列表查询 */
export const queryProjListApi = (data) => {
  return request.get('/base/tbProject/list', {
    params: data
  })
}

/** 工程类型查询 */
export const queryProjTypeApi = (data) => {
  return request.get('/base/tbProDepart/getDataList', {
    params: data
  })
}

/** 工程名称查询 */
export const queryProjNameApi = (data) => {
  return request.get('/base/tbProject/getList', {
    params: data
  })
}

/** 电压等级查询 */
export const queryVolLevelApi = (data) => {
  return request.get('/base/tbProDepart/getDataList', {
    params: data
  })
}

/** 所属项目部查询 */
export const queryDeptApi = (data) => {
  return request.get('/base/tbProDepart/list', {
    params: data
  })
}

/** 杆塔列表查询 */
export const queryTowerListApi = (data) => {
  return request.get('/base/tbProPower/list', {
    params: data
  })
}

/** 新增杆塔查询 */
export const queryExistTowerApi = (data) => {
  return request.get('/base/tbProPower/getList', {
    params: data
  })
}

/** 新增工程 */
export const addProjApi = (data) => {
  return request.post('/base/tbProject', data)
}

/** 新增杆塔 */
export const addTowerApi = (data) => {
  return request.post('/base/tbProPower', data)
}

/** 修改工程 */
export const editProjApi = (data) => {
  return request.put('/base/tbProject', data)
}

/** 修改杆塔 */
export const editTowerApi = (data) => {
  return request.put('/base/tbProPower', data)
}

/** 删除工程 */
export const deleteProjApi = (id) => {
  return request.delete(`/base/tbProject/${id}`)
}

/** 删除杆塔 */
export const deleteTowerApi = (id) => {
  return request.delete(`/base/tbProPower/${id}`)
}

/** 文件上传 */
export const towerFileUpLoad = (data) => {
  /* const formData = new FormData()
  formData.append('file', param.fileData.file) */
  return request({
    url: '/base/tbProPower/importData',
    method: 'post',
    data
  })
}
