增加角色批量授权用户

(cherry picked commit from <gitee.com//lxy0722/django-vue3-admin/commit/702eb7d7aeb2a9c30416a8ebb503a4b8e3367492>
This commit is contained in:
lxy
2025-01-08 11:20:47 +08:00
committed by lxy
parent 1fe0a89338
commit ffc6246105
10 changed files with 761 additions and 7 deletions

View File

@@ -3,6 +3,7 @@ import * as api from './api';
import { dictionary } from '/@/utils/dictionary';
import { successMessage } from '../../../utils/message';
import { auth } from '/@/utils/authFunction';
import { nextTick, computed } from 'vue';
/**
*
@@ -46,7 +47,12 @@ export const createCrudOptions = function ({ crudExpose, context }: CreateCrudOp
rowHandle: {
//固定右侧
fixed: 'right',
width: 320,
width: computed(() => {
if (auth('role:AuthorizedAdd') || auth('role:AuthorizedSearch')){
return 420;
}
return 320;
}),
buttons: {
view: {
show: true,
@@ -57,6 +63,19 @@ export const createCrudOptions = function ({ crudExpose, context }: CreateCrudOp
remove: {
show: auth('role:Delete'),
},
assignment: {
type: 'primary',
text: '授权用户',
show: auth('role:AuthorizedAdd') || auth('role:AuthorizedSearch'),
click: (ctx: any) => {
const { row } = ctx;
context!.RoleUserDrawer.handleDrawerOpen(row);
nextTick(() => {
context!.RoleUserRef.value.setSearchFormData({ form: { role_id: row.id } });
context!.RoleUserRef.value.doRefresh();
});
},
},
permission: {
type: 'primary',
text: '权限配置',