You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
49 lines
1.2 KiB
49 lines
1.2 KiB
1 year ago
|
import type { GetDictChildListParams, GetDictListParams, SystemDict, SystemDictChild, SystemDictTree } from './types'
|
||
|
import { defHttp } from '@/utils/http/axios'
|
||
|
|
||
|
export function getDictList(params: GetDictListParams) {
|
||
|
return defHttp.get<PageResult<SystemDict>>({
|
||
|
url: '/baymax-system/dict/parent-list',
|
||
|
params,
|
||
|
})
|
||
|
}
|
||
|
|
||
|
export function detailDict(id: string) {
|
||
|
return defHttp.get<SystemDict>({
|
||
|
url: `/baymax-system/dict/detail?id=${id}`,
|
||
|
})
|
||
|
}
|
||
|
|
||
|
export function createDict(data: Partial<SystemDict>) {
|
||
|
return defHttp.post({
|
||
|
url: '/baymax-system/dict/submit',
|
||
|
data,
|
||
|
})
|
||
|
}
|
||
|
|
||
|
export function updateDict(data: Partial<SystemDict>) {
|
||
|
return defHttp.post({
|
||
|
url: '/baymax-system/dict/submit',
|
||
|
data,
|
||
|
})
|
||
|
}
|
||
|
|
||
|
export function deleteDict(ids: string[]) {
|
||
|
return defHttp.post({
|
||
|
url: `/baymax-system/dict/remove?ids=${ids}`,
|
||
|
})
|
||
|
}
|
||
|
|
||
|
export function dictTree(code: string) {
|
||
|
return defHttp.get<SystemDictTree>({
|
||
|
url: `/baymax-system/dict/tree?code=${code}`,
|
||
|
})
|
||
|
}
|
||
|
|
||
|
export function getDictChildList(params: GetDictChildListParams) {
|
||
|
return defHttp.get<PageResult<SystemDictChild>>({
|
||
|
url: '/baymax-system/dict/child-list',
|
||
|
params,
|
||
|
})
|
||
|
}
|