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

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

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

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

export const getAvmatCatalog = async (data) => {
  return await post('/basicdata/avmatCatalog/getAvmatCatalog', data)
}

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

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

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

export const getEnableList = async (data) => {
  return await post('/carryingtask/calculationModel/getEnableList', data)
}
export const formulaCalculateByTaskId = async (data) => {
  return await post('/basicdata/carryingMainteOrgan/formulaCalculateByTaskId', data)
}
export const PredictAlg = async (data) => {
  return await post('/alg/PredictAlg', data)
}
//下载模板
export const downLoadFile = async (data) => {
  window.open(process.env.VUE_APP_BASE_API + '/basicdata/carryingMainteOrgan/downLoadFile')
}
//航材清单导出
export const exportExcel = async (data) => {
  window.open(process.env.VUE_APP_BASE_API + `/basicdata/carryingMainteOrgan/exportExcel?avmatType=${data.avmatType}&taskId=${data.taskId}&flyTaskAircaftId=${data.flyTaskAircaftId}&queryParam=${data.queryParam}`)
}
//下载航材使用登记模板
export const downLoadUseRegisterFile = async (data) => {
  window.open(process.env.VUE_APP_BASE_API + '/carryingtask/taskExecondRegister/downLoadUseRegisterFile')
}
//航材使用登记导出
export const exportUseRegisterExcel = async (data) => {
  window.open(process.env.VUE_APP_BASE_API + `/carryingtask/taskExecondRegister/exportUseRegisterExcel?taskId=${data.taskId}&queryParam=${data.queryParam}`)
}
