学员列表多余的操作按钮收缩到更多里

This commit is contained in:
禺狨 2023-04-20 10:28:37 +08:00
parent c9253af78f
commit e7a63c350f

View File

@ -8,10 +8,16 @@ import {
Table, Table,
message, message,
Image, Image,
Dropdown,
} from "antd"; } from "antd";
import type { MenuProps } from "antd";
import type { ColumnsType } from "antd/es/table"; import type { ColumnsType } from "antd/es/table";
// import styles from "./index.module.less"; // import styles from "./index.module.less";
import { PlusOutlined, ExclamationCircleFilled } from "@ant-design/icons"; import {
PlusOutlined,
DownOutlined,
ExclamationCircleFilled,
} from "@ant-design/icons";
import { user } from "../../api/index"; import { user } from "../../api/index";
import { dateFormat } from "../../utils/index"; import { dateFormat } from "../../utils/index";
import { Link, Navigate } from "react-router-dom"; import { Link, Navigate } from "react-router-dom";
@ -97,7 +103,42 @@ const MemberPage = () => {
key: "action", key: "action",
fixed: "right", fixed: "right",
width: 160, width: 160,
render: (_, record: any) => ( render: (_, record: any) => {
const items: MenuProps["items"] = [
{
key: "1",
label: (
<PerButton
type="link"
text="编辑"
class="b-link c-red"
icon={null}
p="user-update"
onClick={() => {
setMid(Number(record.id));
setUpdateVisible(true);
}}
disabled={null}
/>
),
},
{
key: "2",
label: (
<PerButton
type="link"
text="删除"
class="b-link c-red"
icon={null}
p="user-destroy"
onClick={() => delUser(record.id)}
disabled={null}
/>
),
},
];
return (
<Space size="small"> <Space size="small">
<Link <Link
style={{ textDecoration: "none" }} style={{ textDecoration: "none" }}
@ -114,30 +155,21 @@ const MemberPage = () => {
/> />
</Link> </Link>
<div className="form-column"></div> <div className="form-column"></div>
<PerButton <Dropdown menu={{ items }}>
<Button
type="link" type="link"
text="编辑" className="b-link c-red"
class="b-link c-red" onClick={(e) => e.preventDefault()}
icon={null} >
p="user-update" <Space size="small" align="center">
onClick={() => {
setMid(Number(record.id)); <DownOutlined />
setUpdateVisible(true);
}}
disabled={null}
/>
<div className="form-column"></div>
<PerButton
type="link"
text="删除"
class="b-link c-red"
icon={null}
p="user-destroy"
onClick={() => delUser(record.id)}
disabled={null}
/>
</Space> </Space>
), </Button>
</Dropdown>
</Space>
);
},
}, },
]; ];