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

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,47 +103,73 @@ const MemberPage = () => {
key: "action", key: "action",
fixed: "right", fixed: "right",
width: 160, width: 160,
render: (_, record: any) => ( render: (_, record: any) => {
<Space size="small"> const items: MenuProps["items"] = [
<Link {
style={{ textDecoration: "none" }} key: "1",
to={`/member/learn?id=${record.id}`} label: (
> <PerButton
<PerButton type="link"
type="link" text="编辑"
text="学习" class="b-link c-red"
class="b-link c-red" icon={null}
icon={null} p="user-update"
p="user-learn" onClick={() => {
onClick={() => null} setMid(Number(record.id));
disabled={null} setUpdateVisible(true);
/> }}
</Link> disabled={null}
<div className="form-column"></div> />
<PerButton ),
type="link" },
text="编辑" {
class="b-link c-red" key: "2",
icon={null} label: (
p="user-update" <PerButton
onClick={() => { type="link"
setMid(Number(record.id)); text="删除"
setUpdateVisible(true); class="b-link c-red"
}} icon={null}
disabled={null} p="user-destroy"
/> onClick={() => delUser(record.id)}
<div className="form-column"></div> disabled={null}
<PerButton />
type="link" ),
text="删除" },
class="b-link c-red" ];
icon={null}
p="user-destroy" return (
onClick={() => delUser(record.id)} <Space size="small">
disabled={null} <Link
/> style={{ textDecoration: "none" }}
</Space> to={`/member/learn?id=${record.id}`}
), >
<PerButton
type="link"
text="学习"
class="b-link c-red"
icon={null}
p="user-learn"
onClick={() => null}
disabled={null}
/>
</Link>
<div className="form-column"></div>
<Dropdown menu={{ items }}>
<Button
type="link"
className="b-link c-red"
onClick={(e) => e.preventDefault()}
>
<Space size="small" align="center">
<DownOutlined />
</Space>
</Button>
</Dropdown>
</Space>
);
},
}, },
]; ];