1:用户管理页面优化 2:角色管理页面优化 3:分配角色权限优化
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import React, { useEffect, useState } from 'react';
|
||||
import React, { useEffect, useState } from 'react';
|
||||
import { Modal, Tree, message } from 'antd';
|
||||
import { roleApi } from '@/services/role';
|
||||
import { buildTree } from '@/utils/tree';
|
||||
@@ -29,20 +29,20 @@ const AssignAuth: React.FC<AssignAuthProps> = ({ roleId, tenantId, open, onClose
|
||||
|
||||
const handleOk = async () => {
|
||||
if (!roleId) return;
|
||||
const hide = message.loading('淇濆瓨涓?..');
|
||||
const hide = message.loading('保存中...');
|
||||
try {
|
||||
await roleApi.assignMenu({ roleId, menuIds: checkedKeys });
|
||||
message.success('鏉冮檺鍒嗛厤鎴愬姛');
|
||||
message.success('权限分配成功');
|
||||
onClose();
|
||||
} catch (e) {
|
||||
message.error('鏉冮檺鍒嗛厤澶辫触');
|
||||
message.error('权限分配失败');
|
||||
} finally {
|
||||
hide();
|
||||
}
|
||||
};
|
||||
|
||||
return (
|
||||
<Modal title="鏉冮檺鍒嗛厤" open={open} destroyOnClose onOk={handleOk} onCancel={onClose}>
|
||||
<Modal title="权限分配" open={open} destroyOnClose onOk={handleOk} onCancel={onClose}>
|
||||
<Tree
|
||||
defaultExpandAll
|
||||
checkable
|
||||
@@ -56,4 +56,3 @@ const AssignAuth: React.FC<AssignAuthProps> = ({ roleId, tenantId, open, onClose
|
||||
|
||||
export default AssignAuth;
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user