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

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

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

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

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 queryByParam = async (data) => {
  return await post('/basicdata/avmatCatalog/queryByParam', data)
}

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

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