This commit is contained in:
2026-01-29 10:43:43 +08:00
commit 4a76df3391
426 changed files with 74975 additions and 0 deletions

61
api/system/dict/index.ts Normal file
View File

@@ -0,0 +1,61 @@
import request from '~/utils/request';
import type { ApiResult } from '@/api';
import type { Dict, DictParam } from './model';
import { SERVER_API_URL } from '@/config';
/**
* 查询字典列表
*/
export async function listDictionaries(params?: DictParam) {
const res = await request.get<ApiResult<Dict[]>>(
SERVER_API_URL + '/system/dict',
{
params
}
);
if (res.code === 0) {
return res.data;
}
return Promise.reject(new Error(res.message));
}
/**
* 添加字典
*/
export async function addDict(data: Dict) {
const res = await request.post<ApiResult<unknown>>(
SERVER_API_URL + '/system/dict',
data
);
if (res.code === 0) {
return res.message;
}
return Promise.reject(new Error(res.message));
}
/**
* 修改字典
*/
export async function updateDict(data: Dict) {
const res = await request.put<ApiResult<unknown>>(
SERVER_API_URL + '/system/dict',
data
);
if (res.code === 0) {
return res.message;
}
return Promise.reject(new Error(res.message));
}
/**
* 删除字典
*/
export async function removeDict(id?: number) {
const res = await request.del<ApiResult<unknown>>(
SERVER_API_URL + '/system/dict/' + id
);
if (res.code === 0) {
return res.message;
}
return Promise.reject(new Error(res.message));
}

View File

@@ -0,0 +1,29 @@
/**
* 字典
*/
export interface Dict {
// 字典id
dictId?: number;
// 字典标识
dictCode?: string;
// 字典名称
dictName?: string;
// 排序号
sortNumber?: number;
// 备注
comments?: string;
// 创建时间
createTime?: string;
type?: number;
tenantId?: number;
}
/**
* 字典搜索条件
*/
export interface DictParam {
dictCode?: string;
dictName?: string;
type?: number;
tenantId?: number;
}