import type { AxiosResponse } from 'axios' import type { PageInfo, Result } from '@cacp/ui' import request from '@/utils/request' import type {PackCatalog,PackCatalogQuery} from '@/types/base/PackCatalog' const contextPath = '/base/PackCatalog' // 查询包装种类目录列表 export async function getList(query: PackCatalogQuery): Promise>> { const res: AxiosResponse>> = await request.post(`${contextPath}/get-list`, query) return res.data } // 获取包装种类目录详情 export async function getDetail(ID: string): Promise> { const res: AxiosResponse> = await request.get(`${contextPath}/get-detail?ID=${ID}`) return res.data } // 新增包装种类目录 export async function insert(row: PackCatalog): Promise> { const res: AxiosResponse> = await request.post(`${contextPath}/insert-packCatalog`, row) return res.data } // 更新包装种类目录 export async function update(row: PackCatalog): Promise> { const res: AxiosResponse> = await request.post(`${contextPath}/update-packCatalog`, row) return res.data } // 删除包装种类目录 export async function remove(packCatalogs: string | string[]): Promise> { // 统一转换为数组格式 const ids = Array.isArray(packCatalogs) ? packCatalogs : [packCatalogs]; const res: AxiosResponse> = await request.post( `${contextPath}/delete-packCatalog?ids`,ids ) return res.data }