提交 | 用户 | 时间
|
e7c126
|
1 |
import request from '@/config/axios'
|
H |
2 |
|
|
3 |
export interface CategoryVO {
|
|
4 |
id: number
|
|
5 |
name: string
|
|
6 |
parentId: number
|
|
7 |
}
|
|
8 |
|
|
9 |
// 查询分类列表
|
|
10 |
export const getCategoryList = async (params) => {
|
|
11 |
return await request.get({ url: `/infra/category/list`, params })
|
|
12 |
}
|
|
13 |
|
|
14 |
// 查询分类详情
|
|
15 |
export const getCategory = async (id: number) => {
|
|
16 |
return await request.get({ url: `/infra/category/get?id=` + id })
|
|
17 |
}
|
|
18 |
|
|
19 |
// 新增分类
|
|
20 |
export const createCategory = async (data: CategoryVO) => {
|
|
21 |
return await request.post({ url: `/infra/category/create`, data })
|
|
22 |
}
|
|
23 |
|
|
24 |
// 修改分类
|
|
25 |
export const updateCategory = async (data: CategoryVO) => {
|
|
26 |
return await request.put({ url: `/infra/category/update`, data })
|
|
27 |
}
|
|
28 |
|
|
29 |
// 删除分类
|
|
30 |
export const deleteCategory = async (id: number) => {
|
|
31 |
return await request.delete({ url: `/infra/category/delete?id=` + id })
|
|
32 |
}
|
|
33 |
|
|
34 |
// 导出分类 Excel
|
|
35 |
export const exportCategory = async (params) => {
|
|
36 |
return await request.download({ url: `/infra/category/export-excel`, params })
|
|
37 |
}
|