import { get, uget, post, upost } from '@/http/index'

// 查询飞行任务
export const queryFlyTask = async (data) => {
  return await post('/carryingtask/flyTask/queryFlyTask', data)
}

// 查询飞行任务树
export const queryFlyTaskTree = async (data) => {
  return await post('/carryingtask/flyTask/queryFlyTaskTree', data)
}

// 查询飞行任务主任务
export const queryFlyTaskMain = async () => {
  return await get('/carryingtask/flyTask/queryFlyTaskMain')
}

export const getTEnvFactorDict = async (data) => {
  return await get('/system/tEnvFactor/getTEnvFactorDict', data)
}

export const addFlyTask = async (data) => {
  return await post('/carryingtask/flyTask/addFlyTask', data)
}

export const updateFlyTask = async (data) => {
  return await post('/carryingtask/flyTask/updateFlyTask', data)
}

export const removeFlyTask = async (data) => {
  return await post('/carryingtask/flyTask/removeFlyTask', data)
}

//下载模板
export const downLoadFile = async (data) => {
  window.open(process.env.VUE_APP_BASE_API + '/carryingtask/flyTask/downLoadFile')
}
//导出
export const exportExcel = async (data) => {
  window.open(process.env.VUE_APP_BASE_API + `/carryingtask/flyTask/exportExcel?queryParam=${data.queryParam}&status=${data.status}`)
}

export const getFlyTaskAircraft = async (data) => {
  return await post('/carryingtask/flyTaskAircraft/getFlyTaskAircraft', data)
}

export const getAircaftTypeAndModelTree = async (data) => {
  return await get('/basicdata/aircaftCatalog/getAircaftTypeAndModelTree', data)
}

export const getAircraftsByCode = async (data) => {
  return await post('/carryingtask/flyTaskAircraft/getAircraftsByCode', data)
}

export const addFlyTaskAircraft = async (data) => {
  return await post('/carryingtask/flyTaskAircraft/addFlyTaskAircraft', data)
}

export const removeFlyTaskAircraft = async (data) => {
  return await post('/carryingtask/flyTaskAircraft/removeFlyTaskAircraft', data)
}
export const updateFlyTaskAircraft = async (data) => {
  return await post('/carryingtask/flyTaskAircraft/updateFlyTaskAircraft', data)
}

export const queryCarryingMainteOrgan = async (data) => {
  return await post('/basicdata/carryingMainteOrgan/queryCarryingMainteOrgan', data)
}
export const updateStatus = async (data) => {
  return await post('/carryingtask/flyTask/updateStatus', data)
}

export const autoMapping = async (data) => {
  return await get('/basicdata/carryingMainteOrgan/autoMapping', data)
}

export const queryPageCarryingAvmatUseRegister = async (data) => {
  return await post('/basicdata/carryingAvmatUseRegister/queryPageCarryingAvmatUseRegister', data)
}
export const batchAddCarryingAvmatUseRegister = async (data) => {
  return await post('/basicdata/carryingAvmatUseRegister/batchAddCarryingAvmatUseRegister', data)
}
export const removeAircaftCatalog = async (data) => {
  return await post('/basicdata/carryingAvmatUseRegister/removeAircaftCatalog', data)
}
export const basicdataQueryFlyTask = async (data) => {
  return await post('/basicdata/carryingAvmatUseRegister/queryFlyTask', data)
}

export const socialSecurityPage = async (data) => {
  return await post('/safeguard/socialSecurity/page', data)
}
export const socialSecurityAdd = async (data) => {
  return await post('/safeguard/socialSecurity/add', data)
}
export const socialSecurityEdit = async (data) => {
  return await post('/safeguard/socialSecurity/edit', data)
}
export const socialSecurityRemove = async (data) => {
  return await post('/safeguard/socialSecurity/remove', data)
}
export const socialSecurityDetailsPage = async (data) => {
  return await post('/safeguard/socialSecurityDetails/page', data)
}
export const generatePriceList = async (data) => {
  return await post('/safeguard/socialSecurityDetails/generatePriceList', data)
}
