first commit
This commit is contained in:
92
src/apis/equipment/product.ts
Normal file
92
src/apis/equipment/product.ts
Normal file
@@ -0,0 +1,92 @@
|
||||
import http from '@/utils/http'
|
||||
|
||||
const BASE_URL = '/equipment/product'
|
||||
|
||||
export interface ProductResp {
|
||||
id: string
|
||||
avatar: string
|
||||
name: string
|
||||
version: string
|
||||
bigtype: string
|
||||
subtype: string
|
||||
genre: string
|
||||
describes: string
|
||||
network: string
|
||||
dataFormat: string
|
||||
scale: string
|
||||
attestation: string
|
||||
createUser: string
|
||||
createTime: string
|
||||
updateUser: string
|
||||
updateTime: string
|
||||
createUserString: string
|
||||
updateUserString: string
|
||||
disabled: boolean
|
||||
}
|
||||
export interface ProductDetailResp {
|
||||
id: string
|
||||
avatar: string
|
||||
name: string
|
||||
version: string
|
||||
bigtype: string
|
||||
subtype: string
|
||||
genre: string
|
||||
describes: string
|
||||
network: string
|
||||
dataFormat: string
|
||||
scale: string
|
||||
attestation: string
|
||||
createUser: string
|
||||
createTime: string
|
||||
updateUser: string
|
||||
updateTime: string
|
||||
createUserString: string
|
||||
updateUserString: string
|
||||
}
|
||||
export interface ProductQuery {
|
||||
name: string | undefined
|
||||
genre: string | undefined
|
||||
version: string | undefined
|
||||
sort: Array<string>
|
||||
}
|
||||
export interface ProductPageQuery extends ProductQuery, PageQuery {}
|
||||
|
||||
/** @desc 查询产品信息列表 */
|
||||
export function listProduct(query: ProductPageQuery) {
|
||||
return http.get<PageRes<ProductResp[]>>(`${BASE_URL}`, query)
|
||||
}
|
||||
|
||||
/** @desc 获取产品名称列表(下拉) */
|
||||
export function getProductNameList() {
|
||||
return http.get(`${BASE_URL}/getProductNameList`)
|
||||
}
|
||||
|
||||
/** @desc 查询产品信息详情 */
|
||||
export function getProduct(id: string) {
|
||||
return http.get<ProductDetailResp>(`${BASE_URL}/${id}`)
|
||||
}
|
||||
|
||||
/** @desc 新增产品信息 */
|
||||
export function addProduct(data: any) {
|
||||
return http.post(`${BASE_URL}`, data)
|
||||
}
|
||||
|
||||
/** @desc 修改产品信息 */
|
||||
export function updateProduct(data: any, id: string) {
|
||||
return http.put(`${BASE_URL}/${id}`, data)
|
||||
}
|
||||
|
||||
/** @desc 删除产品信息 */
|
||||
export function deleteProduct(id: string) {
|
||||
return http.del(`${BASE_URL}/${id}`)
|
||||
}
|
||||
|
||||
/** @desc 导出产品信息 */
|
||||
export function exportProduct(query: ProductQuery) {
|
||||
return http.download(`${BASE_URL}/export`, query)
|
||||
}
|
||||
|
||||
/** @desc 导出产品信息 */
|
||||
export function test(query: ProductQuery) {
|
||||
return http.download(`${BASE_URL}/test`, query)
|
||||
}
|
||||
Reference in New Issue
Block a user