feat: 封装数据字典

This commit is contained in:
xlsea
2024-09-04 09:11:04 +08:00
parent 0130688265
commit 3d426fb8e1
20 changed files with 421 additions and 24 deletions

View File

@ -1,3 +1,4 @@
export * from './auth';
export * from './route';
export * from './system';
export * from './tool';

View File

@ -0,0 +1,9 @@
import { request } from '@/service/request';
/** 根据字典类型查询字典数据信息 */
export function fetchGetDictDataByType(dictType: string) {
return request<Array<Api.System.DictData>>({
url: `/system/dict/data/type/${dictType}`,
method: 'get'
});
}

View File

@ -1 +1,2 @@
export * from './menu';
export * from './dict';

View File

@ -0,0 +1,42 @@
import { request } from '@/service/request';
/** 查询代码生成列表 */
export function fetchGetGenTableList(params?: Api.Tool.GenTableSearchParams) {
return request<Api.Tool.GenTableList>({
url: '/tool/gen/list',
method: 'get',
params
});
}
/**
* 导入表结构
*
* @param tables 表名称
* @param dataName 数据源名称
*/
export function fetchImportGenTable(tables: Array<string>, dataName: string) {
return request<boolean>({
url: '/tool/gen/importTable',
method: 'post',
data: { tables, dataName }
});
}
/** 修改代码生成 */
export function fetchUpdateGenTable(data: Api.System.MenuOperateParams) {
return request<boolean>({
url: '/tool/gen',
method: 'put',
data
});
}
/** 批量删除代码生成 */
export function fetchBatchDeleteGenTable(tableIds: Array<CommonType.IdType>) {
const ids = tableIds.join(',');
return request<boolean>({
url: `/system/menu/${ids}`,
method: 'delete'
});
}

View File

@ -0,0 +1 @@
export * from './gen';