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

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

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

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

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

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

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

// --------------------------
export const addAircaftType = async (data) => {
  return await post('/basicdata/aircaftType/addAircaftType', data)
}

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

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

//下载模板
export const downLoadAircaftTypeFile = async (data) => {
  window.open(process.env.VUE_APP_BASE_API + '/basicdata/aircaftType/downLoadFile')
}
//导出
export const exportAircaftTypeExcel = async (data) => {
  window.open(process.env.VUE_APP_BASE_API + `/basicdata/aircaftType/exportExcel?queryParam=${data.queryParam}`)
}

// --------------------------------------------------------------------------------------------
export const getAvmatCategoriesTree = async (data) => {
  return await get('/basicdata/avmatcategories/getAvmatCategoriesTree', data)
}

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

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

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