import { http } from '@/utils/http/axios'; /** * @description: 字典列表 */ export function getDictList(params?) { return http.request({ url: '/admin/dict/page', method: 'GET', params, }); } /** * @description: 根据ID获取详情 */ export function getDictDetail(id) { return http.request({ url: '/admin/dict/detail/' + id, method: 'get', }); } /** * @description: 刷新缓存 */ export function refreshCache() { return http.request({ url: '/admin/dict/refreshCache', method: 'get', }); } /** * @description: 添加字典 */ export function dictAdd(data: any) { return http.request({ url: '/admin/dict/add', method: 'POST', data, }); } /** * @description: 更新字典 */ export function dictUpdate(data: any) { return http.request({ url: '/admin/dict/update', method: 'PUT', data, }); } /** * @description: 删除字典 */ export function dictDelete(id) { return http.request({ url: '/admin/dict/delete/' + id, method: 'DELETE', }); } /** * @description: 批量删除字典 */ export function dictBatchDelete(data: any) { return http.request({ url: '/admin/dict/batchDelete', method: 'DELETE', data, }); } /** * @description: 字典项列表 */ export function getDictItemList(params?) { return http.request({ url: '/admin/dict/item/page', method: 'GET', params, }); } /** * @description: 根据ID获取详情 */ export function getDictItemDetail(id) { return http.request({ url: '/admin/dict/item/detail/' + id, method: 'get', }); } /** * @description: 添加字典项 */ export function dictItemAdd(data: any) { return http.request({ url: '/admin/dict/item/add', method: 'POST', data, }); } /** * @description: 更新字典项 */ export function dictItemUpdate(data: any) { return http.request({ url: '/admin/dict/item/update', method: 'PUT', data, }); } /** * @description: 删除字典项 */ export function dictItemDelete(id) { return http.request({ url: '/admin/dict/item/delete/' + id, method: 'DELETE', }); } /** * @description: 批量删除字典项 */ export function dictItemBatchDelete(data: any) { return http.request({ url: '/admin/dict/item/batchDelete', method: 'DELETE', data, }); }