From dd936a8e06a55f2187c02d9c9dcee63b51c3de8a Mon Sep 17 00:00:00 2001 From: BabyBoy <2019108827@qq.com> Date: Mon, 8 Sep 2025 18:15:47 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BA=97=E9=93=BA=E8=B5=8B=E6=9D=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/system/role/types.ts | 3 +- src/api/system/user/index.ts | 29 +++++++++-- src/layout/components/Navbar.vue | 4 +- src/views/system/role/index.vue | 3 +- src/views/system/user/tenant.vue | 83 +++++++++++++------------------- 5 files changed, 65 insertions(+), 57 deletions(-) diff --git a/src/api/system/role/types.ts b/src/api/system/role/types.ts index 7dbb6ff..be5513e 100644 --- a/src/api/system/role/types.ts +++ b/src/api/system/role/types.ts @@ -24,8 +24,9 @@ export interface RoleVO extends BaseEntity { deptCheckStrictly: boolean; status: string; delFlag: string; + tenantId: string; remark?: any; - flag: boolean; + has: boolean; menuIds?: Array; deptIds?: Array; admin: boolean; diff --git a/src/api/system/user/index.ts b/src/api/system/user/index.ts index c33f5fe..374393d 100644 --- a/src/api/system/user/index.ts +++ b/src/api/system/user/index.ts @@ -1,9 +1,10 @@ import { DeptTreeVO, DeptVO } from './../dept/types'; -import { RoleVO } from '@/api/system/role/types'; -import request from '@/utils/request'; +import { UserForm, UserInfoVO, UserQuery, UserVO } from './types'; + import { AxiosPromise } from 'axios'; -import { UserForm, UserQuery, UserVO, UserInfoVO } from './types'; +import { RoleVO } from '@/api/system/role/types'; import { parseStrEmpty } from '@/utils/ruoyi'; +import request from '@/utils/request'; /** * 查询用户列表 @@ -175,6 +176,28 @@ export const getAuthRole = (userId: string | number): AxiosPromise<{ user: UserV method: 'get' }); }; +/** + * 查询授权租户 + * @param userId 用户ID + */ +export const gettenantList = (userId: string | number, type: number, data: any): AxiosPromise<{ total: number; records: RoleVO[] }> => { + return request({ + url: '/system/user/tenantList/' + userId + '/' + type, + method: 'get', + params: data + }); +}; +/** + * 保存授权租户 + * @param data 用户ID + */ +export const updateTenant = (data: { userId: string; tenantIds: any }) => { + return request({ + url: '/system/user/tenant', + method: 'post', + data: data + }); +}; /** * 保存授权角色 diff --git a/src/layout/components/Navbar.vue b/src/layout/components/Navbar.vue index 9fce148..4e623c9 100644 --- a/src/layout/components/Navbar.vue +++ b/src/layout/components/Navbar.vue @@ -20,13 +20,13 @@ - 设置默认租户 +
diff --git a/src/views/system/role/index.vue b/src/views/system/role/index.vue index c6d83b4..795fd73 100644 --- a/src/views/system/role/index.vue +++ b/src/views/system/role/index.vue @@ -233,6 +233,7 @@ const dataScopeRef = ref(); const menuRef = ref(); const deptRef = ref(); + const initForm: RoleForm = { roleId: undefined, roleSort: 1, @@ -242,7 +243,7 @@ const initForm: RoleForm = { menuCheckStrictly: true, deptCheckStrictly: true, remark: '', - dataScope: '1', + dataScope: '5', menuIds: [], deptIds: [] }; diff --git a/src/views/system/user/tenant.vue b/src/views/system/user/tenant.vue index 4a3a70d..314d262 100644 --- a/src/views/system/user/tenant.vue +++ b/src/views/system/user/tenant.vue @@ -1,33 +1,15 @@ - - - - - - - + + - +
提交 返回 @@ -58,10 +33,11 @@