import request, { downloadExcelRequest } from '../../utils/request'; import { Result, ResultList, _Pager_Params } from '../../services'; // 字典类型 export interface DictTypeFields { searchValue: string; createBy: string; createTime: string; updateBy: string; updateTime: string; remark: string; params: Record; beginTime: string; endTime: string; dictId: number; dictName: string; dictType: string; status: string; } interface GetListProps extends _Pager_Params, DictTypeFields {} export const getListApi = async (params?: Partial) => { return request>({ url: '/dict/type/list', method: 'get', params, }); }; export const delApi = async (deleteKeys: DictTypeFields['dictId'][]) => { const deleteKeysString = deleteKeys.join(','); return await request({ url: `/dict/type/delete/${deleteKeysString || ''}`, method: 'get', }); }; export const updateApi = async (data: Partial) => { return await request({ url: '/dict/type/edit', method: 'post', data, }); }; export const addApi = async (data: Partial>) => { return await request({ url: '/dict/type', method: 'post', data, }); }; // 刷新缓存 export const refreshCacheApi = async () => { return await request({ url: '/dict/type/refreshCache', method: 'get', }); }; // 导出 export const exportApi = async (data: Partial) => { return await downloadExcelRequest( { url: '/dict/type/export', method: 'post', data }, '字典类型列表', ); }; // 导入 export const importApi = async (data: FormData) => { return await request({ url: '/dict/type/importData', method: 'post', data, }); };