import request, { downloadExcelRequest } from '../../utils/request'; import { Result, ResultList, _Pager_Params } from '../../services'; export interface ConfigFields { searchValue: string; createBy: string; createTime: string; updateBy: string; updateTime: string; remark: string; params: Record; beginTime: string; endTime: string; configId: number; configName: string; configKey: string; configValue: string; configType: string; moduleFirst: string; appId: string; appName: string; } interface GetListProps extends _Pager_Params, ConfigFields {} export const getListApi = async (params?: Partial) => { return request>({ url: '/config/list', method: 'get', params, }); }; export const delApi = async (deleteKeys: ConfigFields['configId'][]) => { const deleteKeysString = deleteKeys.join(','); return await request({ url: `/config/delete/${deleteKeysString || ''}`, method: 'get', }); }; export const updateApi = async (data: Partial) => { return await request({ url: '/config/edit', method: 'post', data, }); }; export const addApi = async (data: Partial>) => { return await request({ url: '/config', method: 'post', data, }); }; // 导出 export const exportExcelApi = async (data: Partial) => { return await downloadExcelRequest( { url: '/config/export', method: 'post', data }, '参数设置列表', ); };