import React from 'react';
import { Card, Typography, Button, Table, Tag, Space, Modal, Form, Input, Checkbox, message, Tree } from 'antd';
import { PlusOutlined, SafetyOutlined } from '@ant-design/icons';
const { Title, Paragraph } = Typography;
const RolesPage: React.FC = () => {
const [loading] = React.useState(false);
const [modalVisible, setModalVisible] = React.useState(false);
const [form] = Form.useForm();
const permissionTree = [
{
title: '项目管理',
key: 'project',
children: [
{ title: '查看项目', key: 'project:view' },
{ title: '创建项目', key: 'project:create' },
{ title: '编辑项目', key: 'project:edit' },
{ title: '删除项目', key: 'project:delete' },
],
},
{
title: '财务管理',
key: 'finance',
children: [
{ title: '查看财务', key: 'finance:view' },
{ title: '预支审批', key: 'finance:advance' },
{ title: '报销审批', key: 'finance:reimburse' },
{ title: '付款审批', key: 'finance:payment' },
],
},
{
title: '采购管理',
key: 'procurement',
children: [
{ title: '查看采购', key: 'procurement:view' },
{ title: '创建采购', key: 'procurement:create' },
{ title: '审批采购', key: 'procurement:approve' },
],
},
{
title: '系统设置',
key: 'system',
children: [
{ title: '用户管理', key: 'system:users' },
{ title: '角色管理', key: 'system:roles' },
{ title: '系统配置', key: 'system:config' },
],
},
];
const columns = [
{ title: '角色ID', dataIndex: 'id', key: 'id', width: 100 },
{ title: '角色名称', dataIndex: 'name', key: 'name', width: 150 },
{ title: '角色描述', dataIndex: 'description', key: 'description' },
{
title: '权限数量',
dataIndex: 'permissionCount',
key: 'permissionCount',
width: 100,
render: (v: number) =>