mirror of
https://github.com/m-xlsea/ruoyi-plus-soybean.git
synced 2025-09-24 07:49:47 +08:00
feat: 封装数据字典
This commit is contained in:
@ -1,3 +1,4 @@
|
||||
export * from './auth';
|
||||
export * from './route';
|
||||
export * from './system';
|
||||
export * from './tool';
|
||||
|
9
src/service/api/system/dict.ts
Normal file
9
src/service/api/system/dict.ts
Normal 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'
|
||||
});
|
||||
}
|
@ -1 +1,2 @@
|
||||
export * from './menu';
|
||||
export * from './dict';
|
||||
|
42
src/service/api/tool/gen.ts
Normal file
42
src/service/api/tool/gen.ts
Normal 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'
|
||||
});
|
||||
}
|
1
src/service/api/tool/index.ts
Normal file
1
src/service/api/tool/index.ts
Normal file
@ -0,0 +1 @@
|
||||
export * from './gen';
|
Reference in New Issue
Block a user