From dcd1b5fbbacafa7bcbddbaec71fa6d7c372a8ddd Mon Sep 17 00:00:00 2001 From: xingyu4j Date: Mon, 21 Nov 2022 11:21:15 +0800 Subject: [PATCH] perf: user --- .../src/api/system/permission/index.ts | 21 ++++++++++---- .../src/api/system/permission/types.ts | 15 ---------- .../src/views/system/user/index.vue | 28 ++++++++++--------- 3 files changed, 31 insertions(+), 33 deletions(-) delete mode 100644 yudao-ui-admin-vue3/src/api/system/permission/types.ts diff --git a/yudao-ui-admin-vue3/src/api/system/permission/index.ts b/yudao-ui-admin-vue3/src/api/system/permission/index.ts index e7e87e7aa4..aa355dfcda 100644 --- a/yudao-ui-admin-vue3/src/api/system/permission/index.ts +++ b/yudao-ui-admin-vue3/src/api/system/permission/index.ts @@ -1,9 +1,20 @@ import request from '@/config/axios' -import type { - PermissionAssignRoleDataScopeReqVO, - PermissionAssignRoleMenuReqVO, - PermissionAssignUserRoleReqVO -} from './types' + +export interface PermissionAssignUserRoleReqVO { + userId: number + roleIds: number[] +} + +export interface PermissionAssignRoleMenuReqVO { + roleId: number + menuIds: number[] +} + +export interface PermissionAssignRoleDataScopeReqVO { + roleId: number + dataScope: number + dataScopeDeptIds: number[] +} // 查询角色拥有的菜单权限 export const listRoleMenusApi = async (roleId: number) => { diff --git a/yudao-ui-admin-vue3/src/api/system/permission/types.ts b/yudao-ui-admin-vue3/src/api/system/permission/types.ts deleted file mode 100644 index 1050c39e29..0000000000 --- a/yudao-ui-admin-vue3/src/api/system/permission/types.ts +++ /dev/null @@ -1,15 +0,0 @@ -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/views/system/user/index.vue b/yudao-ui-admin-vue3/src/views/system/user/index.vue index d7a94e82a7..96ecd10227 100644 --- a/yudao-ui-admin-vue3/src/views/system/user/index.vue +++ b/yudao-ui-admin-vue3/src/views/system/user/index.vue @@ -254,24 +254,26 @@ import { UploadInstance, UploadRawFile } from 'element-plus' -import { handleTree } from '@/utils/tree' -import { useI18n } from '@/hooks/web/useI18n' -import { FormExpose } from '@/components/Form' -import type { PostVO } from '@/api/system/post' -import type { PermissionAssignUserRoleReqVO } from '@/api/system/permission/types' -import { listSimpleDeptApi } from '@/api/system/dept' -import { listSimplePostsApi } from '@/api/system/post' -import { listSimpleRolesApi } from '@/api/system/role' -import { aassignUserRoleApi, listUserRolesApi } from '@/api/system/permission' -import { rules, allSchemas } from './user.data' -import * as UserApi from '@/api/system/user' -import download from '@/utils/download' import { useRouter } from 'vue-router' +import { VxeGridInstance } from 'vxe-table' +import { handleTree } from '@/utils/tree' +import download from '@/utils/download' import { CommonStatusEnum } from '@/utils/constants' import { getAccessToken, getTenantId } from '@/utils/auth' +import { useI18n } from '@/hooks/web/useI18n' import { useMessage } from '@/hooks/web/useMessage' -import { VxeGridInstance } from 'vxe-table' import { useVxeGrid } from '@/hooks/web/useVxeGrid' +import { FormExpose } from '@/components/Form' +import { rules, allSchemas } from './user.data' +import * as UserApi from '@/api/system/user' +import { listSimpleDeptApi } from '@/api/system/dept' +import { listSimplePostsApi, PostVO } from '@/api/system/post' +import { listSimpleRolesApi } from '@/api/system/role' +import { + aassignUserRoleApi, + listUserRolesApi, + PermissionAssignUserRoleReqVO +} from '@/api/system/permission' const { t } = useI18n() // 国际化 const message = useMessage() // 消息弹窗