diff --git a/src/api/codegen.api.ts b/src/api/codegen.api.ts index af592bae..b3b613fc 100644 --- a/src/api/codegen.api.ts +++ b/src/api/codegen.api.ts @@ -110,7 +110,7 @@ export interface TablePageVO { /** 代码生成配置表单 */ export interface GenConfigForm { /** 主键 */ - id?: number; + id?: string; /** 表名 */ tableName?: string; @@ -131,7 +131,7 @@ export interface GenConfigForm { author?: string; /** 上级菜单 */ - parentMenuId?: number; + parentMenuId?: string; /** 后端应用名 */ backendAppName?: string; @@ -145,7 +145,7 @@ export interface GenConfigForm { /** 字段配置 */ export interface FieldConfig { /** 主键 */ - id?: number; + id?: string; /** 列名 */ columnName?: string; diff --git a/src/api/system/config.api.ts b/src/api/system/config.api.ts index d05aa81f..f280ee1c 100644 --- a/src/api/system/config.api.ts +++ b/src/api/system/config.api.ts @@ -13,7 +13,7 @@ const ConfigAPI = { }, /** 系统配置表单数据 */ - getFormData(id: number) { + getFormData(id: string) { return request({ url: `${CONFIG_BASE_URL}/${id}/form`, method: "get", @@ -30,7 +30,7 @@ const ConfigAPI = { }, /** 更新系统配置 */ - update(id: number, data: ConfigForm) { + update(id: string, data: ConfigForm) { return request({ url: `${CONFIG_BASE_URL}/${id}`, method: "put", @@ -43,7 +43,7 @@ const ConfigAPI = { * * @param ids 系统配置ID */ - deleteById(id: number) { + deleteById(id: string) { return request({ url: `${CONFIG_BASE_URL}/${id}`, method: "delete", @@ -69,7 +69,7 @@ export interface ConfigPageQuery extends PageQuery { /** 系统配置表单对象 */ export interface ConfigForm { /** 主键 */ - id?: number; + id?: string; /** 配置名称 */ configName?: string; /** 配置键 */ @@ -83,7 +83,7 @@ export interface ConfigForm { /** 系统配置分页对象 */ export interface ConfigPageVO { /** 主键 */ - id?: number; + id?: string; /** 配置名称 */ configName?: string; /** 配置键 */ diff --git a/src/api/system/dept.api.ts b/src/api/system/dept.api.ts index a2124e92..200065d3 100644 --- a/src/api/system/dept.api.ts +++ b/src/api/system/dept.api.ts @@ -31,7 +31,7 @@ const DeptAPI = { * @param id 部门ID * @returns 部门表单数据 */ - getFormData(id: number) { + getFormData(id: string) { return request({ url: `${DEPT_BASE_URL}/${id}/form`, method: "get", @@ -98,13 +98,13 @@ export interface DeptVO { /** 创建时间 */ createTime?: Date; /** 部门ID */ - id?: number; + id?: string; /** 部门名称 */ name?: string; /** 部门编号 */ code?: string; /** 父部门ID */ - parentId?: number; + parentid?: string; /** 排序 */ sort?: number; /** 状态(1:启用;0:禁用) */ diff --git a/src/api/system/dict.api.ts b/src/api/system/dict.api.ts index 755ff062..3a3d4da9 100644 --- a/src/api/system/dict.api.ts +++ b/src/api/system/dict.api.ts @@ -39,7 +39,7 @@ const DictAPI = { * @param id 字典ID * @returns 字典表单数据 */ - getFormData(id: number) { + getFormData(id: string) { return request>({ url: `${DICT_BASE_URL}/${id}/form`, method: "get", @@ -65,7 +65,7 @@ const DictAPI = { * @param id 字典ID * @param data 字典表单数据 */ - update(id: number, data: DictForm) { + update(id: string, data: DictForm) { return request({ url: `${DICT_BASE_URL}/${id}`, method: "put", @@ -129,7 +129,7 @@ const DictAPI = { * @param id 字典项ID * @returns 字典项表单数据 */ - getDictItemFormData(dictCode: string, id: number) { + getDictItemFormData(dictCode: string, id: string) { return request>({ url: `${DICT_BASE_URL}/${dictCode}/items/${id}/form`, method: "get", @@ -139,7 +139,7 @@ const DictAPI = { /** * 修改字典项 */ - updateDictItem(dictCode: string, id: number, data: DictItemForm) { + updateDictItem(dictCode: string, id: string, data: DictItemForm) { return request({ url: `${DICT_BASE_URL}/${dictCode}/items/${id}`, method: "put", @@ -182,7 +182,7 @@ export interface DictPageVO { /** * 字典ID */ - id: number; + id: string; /** * 字典名称 */ @@ -204,7 +204,7 @@ export interface DictForm { /** * 字典ID */ - id?: number; + id?: string; /** * 字典名称 */ @@ -241,7 +241,7 @@ export interface DictItemPageVO { /** * 字典ID */ - id: number; + id: string; /** * 字典编码 */ @@ -271,7 +271,7 @@ export interface DictItemForm { /** * 字典ID */ - id?: number; + id?: string; /** * 字典编码 */ diff --git a/src/api/system/log.api.ts b/src/api/system/log.api.ts index 32dbc881..402478ad 100644 --- a/src/api/system/log.api.ts +++ b/src/api/system/log.api.ts @@ -61,7 +61,7 @@ export interface LogPageQuery extends PageQuery { */ export interface LogPageVO { /** 主键 */ - id: number; + id: string; /** 日志模块 */ module: string; /** 日志内容 */ diff --git a/src/api/system/menu.api.ts b/src/api/system/menu.api.ts index 65867ff5..06c11ed2 100644 --- a/src/api/system/menu.api.ts +++ b/src/api/system/menu.api.ts @@ -91,7 +91,7 @@ const MenuAPI = { * @param id 菜单ID * @returns 请求结果 */ - deleteById(id: number) { + deleteById(id: string) { return request({ url: `${MENU_BASE_URL}/${id}`, method: "delete", diff --git a/src/api/system/notice.api.ts b/src/api/system/notice.api.ts index 0ad16107..b5e65e79 100644 --- a/src/api/system/notice.api.ts +++ b/src/api/system/notice.api.ts @@ -15,10 +15,10 @@ const NoticeAPI = { /** * 获取通知公告表单数据 * - * @param id NoticeID - * @returns Notice表单数据 + * @param id 通知 + * @returns 通知表单数据 */ - getFormData(id: number) { + getFormData(id: string) { return request({ url: `${NOTICE_BASE_URL}/${id}/form`, method: "get", @@ -28,7 +28,7 @@ const NoticeAPI = { /** * 添加通知公告 * - * @param data Notice表单数据 + * @param data 通知表单数据 * @returns */ create(data: NoticeForm) { @@ -42,10 +42,10 @@ const NoticeAPI = { /** * 更新通知公告 * - * @param id NoticeID - * @param data Notice表单数据 + * @param id 通知ID + * @param data 通知表单数据 */ - update(id: number, data: NoticeForm) { + update(id: string, data: NoticeForm) { return request({ url: `${NOTICE_BASE_URL}/${id}`, method: "put", @@ -71,7 +71,7 @@ const NoticeAPI = { * @param id 被发布的通知公告id * @returns */ - publish(id: number) { + publish(id: string) { return request({ url: `${NOTICE_BASE_URL}/${id}/publish`, method: "put", @@ -84,7 +84,7 @@ const NoticeAPI = { * @param id 撤回的通知id * @returns */ - revoke(id: number) { + revoke(id: string) { return request({ url: `${NOTICE_BASE_URL}/${id}/revoke`, method: "put", @@ -134,7 +134,7 @@ export interface NoticePageQuery extends PageQuery { /** 通知公告表单对象 */ export interface NoticeForm { - id?: number; + id?: string; /** 通知标题 */ title?: string; /** 通知内容 */ diff --git a/src/api/system/role.api.ts b/src/api/system/role.api.ts index 44b4624a..be680229 100644 --- a/src/api/system/role.api.ts +++ b/src/api/system/role.api.ts @@ -25,8 +25,8 @@ const RoleAPI = { * @param roleId 角色ID * @returns 角色的菜单ID集合 */ - getRoleMenuIds(roleId: number) { - return request({ + getRoleMenuIds(roleId: string) { + return request({ url: `${ROLE_BASE_URL}/${roleId}/menuIds`, method: "get", }); @@ -38,7 +38,7 @@ const RoleAPI = { * @param roleId 角色ID * @param data 菜单ID集合 */ - updateRoleMenus(roleId: number, data: number[]) { + updateRoleMenus(roleId: string, data: number[]) { return request({ url: `${ROLE_BASE_URL}/${roleId}/menus`, method: "put", @@ -52,7 +52,7 @@ const RoleAPI = { * @param id 角色ID * @returns 角色表单数据 */ - getFormData(id: number) { + getFormData(id: string) { return request({ url: `${ROLE_BASE_URL}/${id}/form`, method: "get", @@ -74,7 +74,7 @@ const RoleAPI = { * @param id 角色ID * @param data 角色表单数据 */ - update(id: number, data: RoleForm) { + update(id: string, data: RoleForm) { return request({ url: `${ROLE_BASE_URL}/${id}`, method: "put", @@ -105,10 +105,10 @@ export interface RolePageQuery extends PageQuery { /** 角色分页对象 */ export interface RolePageVO { + /** 角色ID */ + id?: string; /** 角色编码 */ code?: string; - /** 角色ID */ - id?: number; /** 角色名称 */ name?: string; /** 排序 */ @@ -124,7 +124,7 @@ export interface RolePageVO { /** 角色表单对象 */ export interface RoleForm { /** 角色ID */ - id?: number; + id?: string; /** 角色编码 */ code?: string; /** 数据权限 */ diff --git a/src/api/system/user.api.ts b/src/api/system/user.api.ts index e9c69c1f..1d16fd1c 100644 --- a/src/api/system/user.api.ts +++ b/src/api/system/user.api.ts @@ -34,7 +34,7 @@ const UserAPI = { * @param userId 用户ID * @returns 用户表单详情 */ - getFormData(userId: number) { + getFormData(userId: string) { return request({ url: `${USER_BASE_URL}/${userId}/form`, method: "get", @@ -60,7 +60,7 @@ const UserAPI = { * @param id 用户ID * @param data 用户表单数据 */ - update(id: number, data: UserForm) { + update(id: string, data: UserForm) { return request({ url: `${USER_BASE_URL}/${id}`, method: "put", @@ -74,7 +74,7 @@ const UserAPI = { * @param id 用户ID * @param password 新密码 */ - resetPassword(id: number, password: string) { + resetPassword(id: string, password: string) { return request({ url: `${USER_BASE_URL}/${id}/password/reset`, method: "put", @@ -123,7 +123,7 @@ const UserAPI = { * @param deptId 部门ID * @param file 导入文件 */ - import(deptId: number, file: File) { + import(deptId: string, file: File) { const formData = new FormData(); formData.append("file", file); return request({ @@ -215,7 +215,7 @@ export default UserAPI; /** 登录用户信息 */ export interface UserInfo { /** 用户ID */ - userId?: number; + userId?: string; /** 用户名 */ username?: string; @@ -244,7 +244,7 @@ export interface UserPageQuery extends PageQuery { status?: number; /** 部门ID */ - deptId?: number; + deptId?: string; /** 开始时间 */ createTime?: [string, string]; @@ -253,7 +253,7 @@ export interface UserPageQuery extends PageQuery { /** 用户分页对象 */ export interface UserPageVO { /** 用户ID */ - id: number; + id: string; /** 用户头像URL */ avatar?: string; /** 创建时间 */ @@ -278,16 +278,16 @@ export interface UserPageVO { /** 用户表单类型 */ export interface UserForm { + /** 用户ID */ + id?: string; /** 用户头像 */ avatar?: string; /** 部门ID */ - deptId?: number; + deptId?: string; /** 邮箱 */ email?: string; /** 性别 */ gender?: number; - /** 用户ID */ - id?: number; /** 手机号 */ mobile?: string; /** 昵称 */ @@ -303,7 +303,7 @@ export interface UserForm { /** 个人中心用户信息 */ export interface UserProfileVO { /** 用户ID */ - id?: number; + id?: string; /** 用户名 */ username?: string; @@ -336,7 +336,7 @@ export interface UserProfileVO { /** 个人中心用户信息表单 */ export interface UserProfileForm { /** 用户ID */ - id?: number; + id?: string; /** 用户名 */ username?: string; diff --git a/src/views/demo/curd/config/content.ts b/src/views/demo/curd/config/content.ts index 3be52d3a..f4ce364c 100644 --- a/src/views/demo/curd/config/content.ts +++ b/src/views/demo/curd/config/content.ts @@ -20,7 +20,7 @@ const contentConfig: IContentConfig = { }, deleteAction: UserAPI.deleteByIds, importAction(file) { - return UserAPI.import(1, file); + return UserAPI.import("1", file); }, exportAction: UserAPI.export, importTemplate: UserAPI.downloadTemplate, diff --git a/src/views/demo/curd/config/edit.ts b/src/views/demo/curd/config/edit.ts index cef72cf8..bcbe1d90 100644 --- a/src/views/demo/curd/config/edit.ts +++ b/src/views/demo/curd/config/edit.ts @@ -12,7 +12,7 @@ const modalConfig: IModalConfig = { }, pk: "id", formAction: function (data) { - return UserAPI.update(data.id as number, data); + return UserAPI.update(data.id as string, data); }, beforeSubmit(data) { console.log("提交之前处理", data); diff --git a/src/views/demo/table-select/index.vue b/src/views/demo/table-select/index.vue index 6fd82c9d..0d7202c3 100644 --- a/src/views/demo/table-select/index.vue +++ b/src/views/demo/table-select/index.vue @@ -4,7 +4,7 @@ import selectConfig from "./config/select"; import { useDictStore } from "@/store"; const dictStore = useDictStore(); interface IUser { - id: number; + id: string; username: string; nickname: string; mobile: string; diff --git a/src/views/system/config/index.vue b/src/views/system/config/index.vue index ba7991b1..14e9da16 100644 --- a/src/views/system/config/index.vue +++ b/src/views/system/config/index.vue @@ -198,7 +198,7 @@ function handleSelectionChange(selection: any) { } // 打开系统配置弹窗 -function handleOpenDialog(id?: number) { +function handleOpenDialog(id?: string) { dialog.visible = true; if (id) { dialog.title = "修改系统配置"; @@ -259,7 +259,7 @@ function handleCloseDialog() { } // 删除系统配置 -function handleDelete(id: number) { +function handleDelete(id: string) { ElMessageBox.confirm("确认删除该项配置?", "警告", { confirmButtonText: "确定", cancelButtonText: "取消", diff --git a/src/views/system/dept/index.vue b/src/views/system/dept/index.vue index 7c7f4f13..ed926967 100644 --- a/src/views/system/dept/index.vue +++ b/src/views/system/dept/index.vue @@ -213,7 +213,7 @@ function handleSelectionChange(selection: any) { * @param parentId 父部门ID * @param deptId 部门ID */ -async function handleOpenDialog(parentId?: string, deptId?: number) { +async function handleOpenDialog(parentId?: string, deptId?: string) { // 加载部门下拉数据 const data = await DeptAPI.getOptions(); deptOptions.value = [ diff --git a/src/views/system/dict/index.vue b/src/views/system/dict/index.vue index 71f5132a..7de44c87 100644 --- a/src/views/system/dict/index.vue +++ b/src/views/system/dict/index.vue @@ -198,7 +198,7 @@ function handleAddClick() { * * @param id 字典ID */ -function handleEditClick(id: number) { +function handleEditClick(id: string) { dialog.visible = true; dialog.title = "修改字典"; DictAPI.getFormData(id).then((data) => { diff --git a/src/views/system/menu/index.vue b/src/views/system/menu/index.vue index ef25aca3..31a7e6d5 100644 --- a/src/views/system/menu/index.vue +++ b/src/views/system/menu/index.vue @@ -487,7 +487,7 @@ function handleSubmit() { } // 删除菜单 -function handleDelete(menuId: number) { +function handleDelete(menuId: string) { if (!menuId) { ElMessage.warning("请勾选删除项"); return false; diff --git a/src/views/system/notice/index.vue b/src/views/system/notice/index.vue index f96ed715..75cabbac 100644 --- a/src/views/system/notice/index.vue +++ b/src/views/system/notice/index.vue @@ -341,7 +341,7 @@ function handleSelectionChange(selection: any) { } // 打开通知公告弹窗 -function handleOpenDialog(id?: number) { +function handleOpenDialog(id?: string) { UserAPI.getOptions().then((data) => { userOptions.value = data; }); @@ -359,7 +359,7 @@ function handleOpenDialog(id?: number) { } // 发布通知公告 -function handlePublish(id: number) { +function handlePublish(id: string) { NoticeAPI.publish(id).then(() => { ElMessage.success("发布成功"); handleQuery(); @@ -367,7 +367,7 @@ function handlePublish(id: number) { } // 撤回通知公告 -function handleRevoke(id: number) { +function handleRevoke(id: string) { NoticeAPI.revoke(id).then(() => { ElMessage.success("撤回成功"); handleQuery(); diff --git a/src/views/system/role/index.vue b/src/views/system/role/index.vue index a070f9cc..00b1bed4 100644 --- a/src/views/system/role/index.vue +++ b/src/views/system/role/index.vue @@ -257,7 +257,7 @@ const rules = reactive({ // 选中的角色 interface CheckedRole { - id?: number; + id?: string; name?: string; } const checkedRole = ref({}); @@ -294,7 +294,7 @@ function handleSelectionChange(selection: any) { } // 打开角色弹窗 -function handleOpenDialog(roleId?: number) { +function handleOpenDialog(roleId?: string) { dialog.visible = true; if (roleId) { dialog.title = "修改角色"; diff --git a/src/views/system/user/components/DeptTree.vue b/src/views/system/user/components/DeptTree.vue index 8ae944a8..fca23070 100644 --- a/src/views/system/user/components/DeptTree.vue +++ b/src/views/system/user/components/DeptTree.vue @@ -24,7 +24,7 @@ import DeptAPI from "@/api/system/dept.api"; const props = defineProps({ modelValue: { - type: [Number], + type: [String, Number], default: undefined, }, }); diff --git a/src/views/system/user/components/UserImport.vue b/src/views/system/user/components/UserImport.vue index 4bc57bab..bcfb420e 100644 --- a/src/views/system/user/components/UserImport.vue +++ b/src/views/system/user/components/UserImport.vue @@ -163,7 +163,7 @@ const handleUpload = async () => { } try { - const result = await UserAPI.import(1, importFormData.files[0].raw as File); + const result = await UserAPI.import("1", importFormData.files[0].raw as File); if (result.code === ResultEnum.SUCCESS && result.invalidCount === 0) { ElMessage.success("导入成功,导入数据:" + result.validCount + "条"); emit("import-success"); diff --git a/src/views/system/user/index.vue b/src/views/system/user/index.vue index b7be3635..f94ad4c2 100644 --- a/src/views/system/user/index.vue +++ b/src/views/system/user/index.vue @@ -360,7 +360,7 @@ function hancleResetPassword(row: UserPageVO) { * * @param id 用户ID */ -async function handleOpenDialog(id?: number) { +async function handleOpenDialog(id?: string) { dialog.visible = true; // 加载角色下拉数据源 roleOptions.value = await RoleAPI.getOptions();