41 lines
1.1 KiB
TypeScript
41 lines
1.1 KiB
TypeScript
import request from '@/utils/http'
|
|
|
|
export function fetchCellProductList(params?: {
|
|
page?: number
|
|
pageSize?: number
|
|
keyword?: string
|
|
productStatus?: string
|
|
passage?: string
|
|
}) {
|
|
return request.get<{
|
|
list: any[]
|
|
total: number
|
|
page: number
|
|
pageSize: number
|
|
totalPages: number
|
|
}>({ url: '/web/admin/cell-products', params })
|
|
}
|
|
|
|
export function fetchCellProductDetail(id: string) {
|
|
return request.get<any>({ url: `/web/admin/cell-products/${id}` })
|
|
}
|
|
|
|
export function fetchCreateCellProduct(data: Record<string, any>) {
|
|
return request.post({ url: '/web/admin/cell-products', params: data })
|
|
}
|
|
|
|
export function fetchUpdateCellProduct(id: string, data: Record<string, any>) {
|
|
return request.put({ url: `/web/admin/cell-products/${id}`, params: data })
|
|
}
|
|
|
|
export function fetchDeleteCellProduct(id: string) {
|
|
return request.del({ url: `/web/admin/cell-products/${id}` })
|
|
}
|
|
|
|
export function fetchNextCellProductCode(count = 1) {
|
|
return request.get<{ code: string; codes?: string[] }>({
|
|
url: '/web/admin/cell-products/next-code',
|
|
params: count > 1 ? { count } : undefined
|
|
})
|
|
}
|