diff --git a/README.md b/README.md index eeba884f9..610695642 100644 --- a/README.md +++ b/README.md @@ -204,11 +204,11 @@ ps:核心功能已经实现,正在对接微信小程序中... | 框架 | 说明 | 版本 | |----------------------------------------------------------------------|------------------|--------| | [Vue](https://staging-cn.vuejs.org/) | Vue 框架 | 3.2.37 | -| [Vite](https://cn.vitejs.dev//) | 开发与构建工具 | 3.0.3 | -| [Element Plus](https://element-plus.org/zh-CN/) | Element Plus | 2.2.11 | +| [Vite](https://cn.vitejs.dev//) | 开发与构建工具 | 3.0.4 | +| [Element Plus](https://element-plus.org/zh-CN/) | Element Plus | 2.2.12 | | [TypeScript](https://www.typescriptlang.org/docs/) | TypeScript | 4.7.4 | | [pinia](https://pinia.vuejs.org/) | Vue 存储库 替代 vuex5 | 2.0.17 | -| [vue-i18n](https://kazupon.github.io/vue-i18n/zh/introduction.html/) | 国际化 | 9.1.10 | +| [vue-i18n](https://kazupon.github.io/vue-i18n/zh/introduction.html/) | 国际化 | 9.2.0 | | [windicss](https://cn.windicss.org/) | 下一代工具优先的 CSS 框架 | 3.5.6 | | [iconify](https://icon-sets.iconify.design/) | 在线图标库 | 2.2.1 | diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/permission/vo/permission/PermissionAssignUserRoleReqVO.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/permission/vo/permission/PermissionAssignUserRoleReqVO.java index 75671bcd2..93cc8ffa2 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/permission/vo/permission/PermissionAssignUserRoleReqVO.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/permission/vo/permission/PermissionAssignUserRoleReqVO.java @@ -12,8 +12,8 @@ import java.util.Set; @Data public class PermissionAssignUserRoleReqVO { - @ApiModelProperty(value = "角色编号", required = true, example = "1") - @NotNull(message = "角色编号不能为空") + @ApiModelProperty(value = "用户编号", required = true, example = "1") + @NotNull(message = "用户编号不能为空") private Long userId; @ApiModelProperty(value = "角色编号列表", example = "1,3,5") diff --git a/yudao-ui-admin-vue3/README.md b/yudao-ui-admin-vue3/README.md index a80a764f3..f898a6d9e 100644 --- a/yudao-ui-admin-vue3/README.md +++ b/yudao-ui-admin-vue3/README.md @@ -27,15 +27,15 @@ | 框架 | 说明 | 版本 | | --- | --- |--------| | [Vue](https://staging-cn.vuejs.org/) | vue 框架 | 3.2.37 | -| [Vite](https://cn.vitejs.dev//) | 开发与构建工具 | 3.0.3 | -| [Element Plus](https://element-plus.org/zh-CN/) | Element Plus | 2.2.11 | -| [TypeScript](https://www.typescriptlang.org/docs/) | JavaScript 的超集 | 4.7.4 | +| [Vite](https://cn.vitejs.dev//) | 开发与构建工具 | 3.0.4 | +| [Element Plus](https://element-plus.org/zh-CN/) | Element Plus | 2.2.12 | +| [TypeScript](https://www.typescriptlang.org/docs/) | JavaScript 的超集 | 4.7.4 | | [pinia](https://pinia.vuejs.org/) | Vue 存储库 替代 vuex5 | 2.0.17 | -| [vueuse](https://vueuse.org//) | 常用工具集 | 9.0.0 | -| [vue-i18n](https://kazupon.github.io/vue-i18n/zh/introduction.html/) | 国际化 | 9.1.10 | -| [vue-router](https://router.vuejs.org/) | vue 路由 | 4.1.3 | -| [windicss](https://cn.windicss.org/) | 下一代工具优先的 CSS 框架 | 3.5.6 | -| [iconify](https://icon-sets.iconify.design/) | 在线图标库 | 2.2.1 | +| [vueuse](https://vueuse.org//) | 常用工具集 | 9.0.2 | +| [vue-i18n](https://kazupon.github.io/vue-i18n/zh/introduction.html/) | 国际化 | 9.2.0 | +| [vue-router](https://router.vuejs.org/) | vue 路由 | 4.1.3 | +| [windicss](https://cn.windicss.org/) | 下一代工具优先的 CSS 框架 | 3.5.6 | +| [iconify](https://icon-sets.iconify.design/) | 在线图标库 | 2.2.1 | | [wangeditor](https://www.wangeditor.com/) | 富文本编辑器 | 5.1.14 | ### 推荐 VScode 开发,插件如下 diff --git a/yudao-ui-admin-vue3/package.json b/yudao-ui-admin-vue3/package.json index 22024f5f0..4e7ebb03e 100644 --- a/yudao-ui-admin-vue3/package.json +++ b/yudao-ui-admin-vue3/package.json @@ -26,7 +26,7 @@ }, "dependencies": { "@iconify/iconify": "^2.2.1", - "@vueuse/core": "^9.0.0", + "@vueuse/core": "^9.0.2", "@wangeditor/editor": "^5.1.14", "@wangeditor/editor-for-vue": "^5.1.10", "@zxcvbn-ts/core": "^2.0.3", @@ -35,7 +35,7 @@ "dayjs": "^1.11.4", "echarts": "^5.3.3", "echarts-wordcloud": "^2.0.0", - "element-plus": "2.2.11", + "element-plus": "2.2.12", "intro.js": "^6.0.0", "jsencrypt": "^3.2.1", "lodash-es": "^4.17.21", @@ -48,20 +48,20 @@ "url": "^0.11.0", "vue": "3.2.37", "vue-cropper": "^1.0.3", - "vue-i18n": "9.1.10", + "vue-i18n": "9.2.0", "vue-router": "^4.1.3", - "vue-types": "^4.2.0", + "vue-types": "^4.2.1", "web-storage-cache": "^1.1.1" }, "devDependencies": { "@commitlint/cli": "^17.0.3", "@commitlint/config-conventional": "^17.0.3", - "@iconify/json": "^2.1.85", + "@iconify/json": "^2.1.86", "@intlify/vite-plugin-vue-i18n": "^5.0.1", "@purge-icons/generated": "^0.8.1", "@types/intro.js": "^5.1.0", "@types/lodash-es": "^4.17.6", - "@types/node": "^18.6.2", + "@types/node": "^18.6.3", "@types/nprogress": "^0.2.0", "@types/qrcode": "^1.4.2", "@types/qs": "^6.9.7", @@ -70,9 +70,9 @@ "@vitejs/plugin-vue": "^3.0.1", "@vitejs/plugin-vue-jsx": "^2.0.0", "autoprefixer": "^10.4.8", - "eslint": "^8.20.0", + "eslint": "^8.21.0", "eslint-config-prettier": "^8.5.0", - "eslint-define-config": "^1.5.1", + "eslint-define-config": "^1.6.0", "eslint-plugin-prettier": "^4.2.1", "eslint-plugin-vue": "^9.3.0", "less": "^4.1.3", @@ -97,7 +97,7 @@ "vite-plugin-eslint": "^1.7.0", "vite-plugin-html": "^3.2.0", "vite-plugin-purge-icons": "^0.8.2", - "vite-plugin-style-import": "1.4.1", + "vite-plugin-style-import": "^2.0.0", "vite-plugin-svg-icons": "^2.0.1", "vite-plugin-windicss": "^1.8.7", "vue-tsc": "^0.39.4", diff --git a/yudao-ui-admin-vue3/src/api/system/permission/index.ts b/yudao-ui-admin-vue3/src/api/system/permission/index.ts new file mode 100644 index 000000000..f498826ea --- /dev/null +++ b/yudao-ui-admin-vue3/src/api/system/permission/index.ts @@ -0,0 +1,33 @@ +import { useAxios } from '@/hooks/web/useAxios' +import type { + PermissionAssignRoleDataScopeReqVO, + PermissionAssignRoleMenuReqVO, + PermissionAssignUserRoleReqVO +} from './types' + +const request = useAxios() + +// 查询角色拥有的菜单权限 +export const listRoleMenusApi = async (roleId: number) => { + return await request.get({ url: '/system/permission/list-role-resources?roleId=' + roleId }) +} + +// 赋予角色菜单权限 +export const assignRoleMenuApi = async (data: PermissionAssignRoleMenuReqVO) => { + return await request.post({ url: '/system/permission/assign-role-menu', data }) +} + +// 赋予角色数据权限 +export const assignRoleDataScopeApi = async (data: PermissionAssignRoleDataScopeReqVO) => { + return await request.post({ url: '/system/permission/assign-role-data-scope', data }) +} + +// 查询用户拥有的角色数组 +export const listUserRolesApi = async (userId: number) => { + return await request.get({ url: '/system/permission/list-user-roles?userId=' + userId }) +} + +// 赋予用户角色 +export const aassignUserRoleApi = async (data: PermissionAssignUserRoleReqVO) => { + return await request.post({ url: '/system/permission/assign-user-role', data }) +} diff --git a/yudao-ui-admin-vue3/src/api/system/permission/types.ts b/yudao-ui-admin-vue3/src/api/system/permission/types.ts new file mode 100644 index 000000000..1050c39e2 --- /dev/null +++ b/yudao-ui-admin-vue3/src/api/system/permission/types.ts @@ -0,0 +1,15 @@ +export type PermissionAssignUserRoleReqVO = { + userId: number + roleIds: number[] +} + +export type PermissionAssignRoleMenuReqVO = { + roleId: number + menuIds: number[] +} + +export type PermissionAssignRoleDataScopeReqVO = { + roleId: number + dataScope: number + dataScopeDeptIds: number[] +} diff --git a/yudao-ui-admin-vue3/src/api/system/role/index.ts b/yudao-ui-admin-vue3/src/api/system/role/index.ts index 99c8a2d93..c5b3589f0 100644 --- a/yudao-ui-admin-vue3/src/api/system/role/index.ts +++ b/yudao-ui-admin-vue3/src/api/system/role/index.ts @@ -4,31 +4,36 @@ import type { RoleVO } from './types' const request = useAxios() // 查询角色列表 -export const getRolePageApi = (params) => { - return request.get({ url: '/system/role/page', params }) +export const getRolePageApi = async (params) => { + return await request.get({ url: '/system/role/page', params }) +} + +// 查询角色(精简)列表 +export const listSimpleRolesApi = async () => { + return await request.get({ url: '/system/role/list-all-simple' }) } // 查询角色详情 -export const getRoleApi = (id: number) => { - return request.get({ url: '/system/role/get?id=' + id }) +export const getRoleApi = async (id: number) => { + return await request.get({ url: '/system/role/get?id=' + id }) } // 新增角色 -export const createRoleApi = (data: RoleVO) => { - return request.post({ url: '/system/role/create', data }) +export const createRoleApi = async (data: RoleVO) => { + return await request.post({ url: '/system/role/create', data }) } // 修改角色 -export const updateRoleApi = (data: RoleVO) => { - return request.put({ url: '/system/role/update', data }) +export const updateRoleApi = async (data: RoleVO) => { + return await request.put({ url: '/system/role/update', data }) } // 修改角色状态 -export const updateRoleStatusApi = (data: RoleVO) => { - return request.put({ url: '/system/role/update-status', data }) +export const updateRoleStatusApi = async (data: RoleVO) => { + return await request.put({ url: '/system/role/update-status', data }) } // 删除角色 -export const deleteRoleApi = (id: number) => { - return request.delete({ url: '/system/role/delete?id=' + id }) +export const deleteRoleApi = async (id: number) => { + return await request.delete({ url: '/system/role/delete?id=' + id }) } diff --git a/yudao-ui-admin-vue3/src/components/CountTo/src/CountTo.vue b/yudao-ui-admin-vue3/src/components/CountTo/src/CountTo.vue index 7d8d37b1e..cab8ea965 100644 --- a/yudao-ui-admin-vue3/src/components/CountTo/src/CountTo.vue +++ b/yudao-ui-admin-vue3/src/components/CountTo/src/CountTo.vue @@ -157,7 +157,7 @@ const count = (timestamp: number) => { } else { state.printVal = state.printVal > endVal ? endVal : state.printVal } - state.displayValue = formatNumber(state.printVal) + state.displayValue = formatNumber(state.printVal!) if (progress < (state.localDuration as number)) { state.rAF = requestAnimationFrame(count) } else { diff --git a/yudao-ui-admin-vue3/src/views/system/role/index.vue b/yudao-ui-admin-vue3/src/views/system/role/index.vue index 12e3f0eb6..dfae295b1 100644 --- a/yudao-ui-admin-vue3/src/views/system/role/index.vue +++ b/yudao-ui-admin-vue3/src/views/system/role/index.vue @@ -1,14 +1,6 @@