diff --git a/src/api/modules/system/index.ts b/src/api/modules/system/index.ts index 9118d21..662894f 100644 --- a/src/api/modules/system/index.ts +++ b/src/api/modules/system/index.ts @@ -6,7 +6,11 @@ import { StaffRoleFormType, AddFromType, AddStaffFromType, - StaffListParams + StaffListParams, + DictListParams, + AddDictFormType, + DictItemListParams, + AddDictItemFormType } from "./types"; // 获取菜单数据 @@ -251,3 +255,75 @@ export const getStaffByIdAPI = (staffId: string) => { params: { staffId } }); }; + +// 字典分页查询 +export const getDictListAPI = (params: DictListParams) => { + return axios({ + url: "staff/ebikeDic/page", + method: "get", + params + }); +}; + +// 添加字典表 +export const addDictAPI = (data: AddDictFormType) => { + return axios({ + url: "/staff/ebikeDic/save", + method: "post", + data + }); +}; + +// 根据主键更新字典表 +export const updateDictAPI = (data: AddDictFormType) => { + return axios({ + url: "/staff/ebikeDic/update", + method: "post", + data + }); +}; + +// 根据主键删除字典表 +export const delDictAPI = (dicId: string) => { + return axios({ + url: `/staff/ebikeDic/remove`, + method: "get", + params: { dicId } + }); +}; + +// 分页查询字典数据项 +export const getDictItemListAPI = (params: DictItemListParams) => { + return axios({ + url: "staff/ebikeDicValue/page", + method: "get", + params + }); +}; + +// 添加字典数据项 +export const addDictItemAPI = (data: AddDictItemFormType) => { + return axios({ + url: "/staff/ebikeDicValue/save", + method: "post", + data + }); +}; + +// 根据主键更新字典数据项 +export const updateDictItemAPI = (data: AddDictItemFormType) => { + return axios({ + url: "/staff/ebikeDicValue/update", + method: "post", + data + }); +}; + +// 根据主键删除字典数据项 +export const delDictItemAPI = (dicValueId: string) => { + return axios({ + url: `/staff/ebikeDicValue/remove`, + method: "get", + params: { dicValueId } + }); +}; diff --git a/src/api/modules/system/types.ts b/src/api/modules/system/types.ts index fb4e58a..312a2bb 100644 --- a/src/api/modules/system/types.ts +++ b/src/api/modules/system/types.ts @@ -1,43 +1,43 @@ -type ListType = { +interface ListType { pageNum: number; pageSize: number; -}; +} // 运营商列表查询参数 -export type OperatorListParams = ListType & { +export interface OperatorListParams extends ListType { operatorName?: string; -}; +} //添加运营商 -export type OperatorFormType = { +export interface OperatorFormType { operatorId?: string; operatorName: string; contactPhone: string; address: string; -}; +} // 员工角色表查询参数 -export type StaffRoleListParams = ListType & { +export interface StaffRoleListParams extends ListType { roleName?: string; -}; +} // 运营商员工查询参数 -export type StaffListParams = ListType & { +export interface StaffListParams extends ListType { username?: string; contactPhone?: string; -}; +} // 添加员工角色 -export type StaffRoleFormType = { +export interface StaffRoleFormType { roleId?: string; roleName: string; roleCode: string; operatorId: string; description?: string; -}; +} // 添加系统权限表 -export type AddFromType = { +export interface AddFromType { id?: string; // ID type: 1 | 2 | 3; // 1: 目录, 2: 菜单, 3: 按钮 parentId: string; // 父级ID @@ -50,10 +50,10 @@ export type AddFromType = { component: string; // 组件 permissionId: string; // 权限标识 buttonCode: string; // 按钮编码 -}; +} // 添加运营商员工 -export type AddStaffFromType = { +export interface AddStaffFromType { staffId?: string; // 员工ID username: string; // 用户名 password: string; // 密码 @@ -61,4 +61,30 @@ export type AddStaffFromType = { status: 1 | 2; // 状态 1: 启用, 2: 禁用 operatorId: string; // 运营商ID roleIds?: string[]; // 角色ID数组 -}; +} + +// 字典查询参数 +export interface DictListParams extends ListType { + dicName?: string; // 字典名称 + dicCode?: string; // 字典编码 +} + +// 添加字典表 +export interface AddDictFormType { + dicId?: string; // ID + dicName: string; // 字典名称 + dicCode: string; // 字典编码 +} + +// 分页查询字典数据项 +export interface DictItemListParams extends ListType { + dicCode: string; // 字典编码 +} + +// 添加字典数据项 +export interface AddDictItemFormType { + dicValueId?: string; // 数据项ID + dicValueName: string; // 数据项名称 + dicValue: string; // 数据项值 + dicId: string; // 字典ID +} diff --git a/src/views/system/dictionary/dictionary.vue b/src/views/system/dictionary/dictionary.vue index d45e3cf..b06d68d 100644 --- a/src/views/system/dictionary/dictionary.vue +++ b/src/views/system/dictionary/dictionary.vue @@ -4,11 +4,8 @@ -