import { MyButtons, MyColumns, MyPageContainer, MyProTableProps, usePageTabs, } from '@/common'; import { Apis } from '@/gen/Apis'; import { ProTable } from '@ant-design/pro-components'; import { Space, Tag } from 'antd'; import Create from './modals/Create'; import EditPermissions from './modals/EditPermissions'; import Update from './modals/Update'; export default function Index({ title = '角色' }) { // 注册当前页面为标签页 usePageTabs({ tabKey: 'system-roles', tabLabel: title, }); return ( MyProTableProps.request(params, sort, Apis.Permission.SysRoles.List) } toolBarRender={(action) => [ , ]} columns={[ MyColumns.ID(), // { dataIndex: 'guard_name', title: 'guard_name', search: false }, { dataIndex: 'name', title: '名称' }, { title: '颜色', dataIndex: 'color', hideInSearch: true, renderText: (color) => {color}, }, { title: '配置角色权限', hideInSearch: true, render: (_, item, index, action) => ( ), }, MyColumns.CreatedAt(), MyColumns.Option({ render: (_, item: any, index, action) => ( Apis.Permission.SysRoles.Delete({ id: item.id }).then(() => action?.reload(), ) } /> ), }), ]} /> ); }