|
|
@@ -0,0 +1,59 @@
|
|
|
+import axiosInstance from '../utils/axios';
|
|
|
+
|
|
|
+// 分页参数类型
|
|
|
+export interface PageParam {
|
|
|
+ pageNo?: number;
|
|
|
+ pageSize?: number;
|
|
|
+ dictType?: string;
|
|
|
+ label?: string;
|
|
|
+ [key: string]: any;
|
|
|
+}
|
|
|
+
|
|
|
+// 分页响应类型
|
|
|
+export interface PageResponse<T> {
|
|
|
+ list: T[];
|
|
|
+ total: number;
|
|
|
+}
|
|
|
+
|
|
|
+// 字典数据 VO 类型
|
|
|
+export interface DictDataVO {
|
|
|
+ id?: number;
|
|
|
+ dictType: string;
|
|
|
+ label: string;
|
|
|
+ value: string;
|
|
|
+ sort: number;
|
|
|
+ status: number;
|
|
|
+ colorType?: string;
|
|
|
+ cssClass?: string;
|
|
|
+ remark?: string;
|
|
|
+ createTime?: Date | string;
|
|
|
+}
|
|
|
+
|
|
|
+// 字典数据管理 API
|
|
|
+export const dictDataApi = {
|
|
|
+ // 查询字典数据分页列表
|
|
|
+ getDictDataPage: (params: PageParam): Promise<PageResponse<DictDataVO>> => {
|
|
|
+ return axiosInstance.get('/system/dict-data/page', { params });
|
|
|
+ },
|
|
|
+
|
|
|
+ // 查询字典数据详情
|
|
|
+ getDictData: (id: number): Promise<DictDataVO> => {
|
|
|
+ return axiosInstance.get(`/system/dict-data/get?id=${id}`);
|
|
|
+ },
|
|
|
+
|
|
|
+ // 新增字典数据
|
|
|
+ createDictData: (data: DictDataVO): Promise<void> => {
|
|
|
+ return axiosInstance.post('/system/dict-data/create', data);
|
|
|
+ },
|
|
|
+
|
|
|
+ // 修改字典数据
|
|
|
+ updateDictData: (data: DictDataVO): Promise<void> => {
|
|
|
+ return axiosInstance.put('/system/dict-data/update', data);
|
|
|
+ },
|
|
|
+
|
|
|
+ // 删除字典数据
|
|
|
+ deleteDictData: (id: number): Promise<void> => {
|
|
|
+ return axiosInstance.delete(`/system/dict-data/delete?id=${id}`);
|
|
|
+ },
|
|
|
+};
|
|
|
+
|