feat(web): 账号列表试点,操作按钮迁入卡片右上角(对齐 ant-design-pro TableList 布局)

This commit is contained in:
2026-09-24 17:26:38 +08:00
parent 0d9d2ffe13
commit c4efe14e94
2 changed files with 15 additions and 15 deletions
+1
View File
@@ -0,0 +1 @@
{}
@@ -20,7 +20,6 @@ import { PlusOutlined, CloudUploadOutlined } from '@ant-design/icons';
import type { ColumnsType } from 'antd/es/table';
import { getList, remove, creatorAction, creatorUpdate } from '@/services/api';
import { conflictMessage, isCollectionAccount, platformLabel } from '@/utils/helpers';
import { usePageActions } from '@/components/PageActions';
// 语义对齐 web.archived/src/features/accounts/AccountsPage.jsx 的 AccountManagementList(mode: owned/monitoring)。
// 仅用 antd 默认组件:Table/Tag/Modal/Popconfirm/Select(tags)。
@@ -225,25 +224,25 @@ export default function AccountManagementList({ mode }: { mode: 'owned' | 'monit
},
];
usePageActions(
isMonitoring ? (
<Button type="primary" icon={<CloudUploadOutlined />} onClick={() => history.push('/accounts/import')}>
导入竞品账号
</Button>
) : (
<Button type="primary" icon={<PlusOutlined />} onClick={() => history.push('/accounts/new')}>
创建账号
</Button>
),
[isMonitoring],
const primaryAction = isMonitoring ? (
<Button type="primary" icon={<CloudUploadOutlined />} onClick={() => history.push('/accounts/import')}>
导入竞品账号
</Button>
) : (
<Button type="primary" icon={<PlusOutlined />} onClick={() => history.push('/accounts/new')}>
创建账号
</Button>
);
return (
<Card variant="outlined">
{contextHolder}
<Typography.Text type="secondary" style={{ display: 'block', marginBottom: 16 }}>
共 {rows.length} 个{isMonitoring ? '监控' : '自有'}账号
</Typography.Text>
<Flex justify="space-between" align="center" style={{ marginBottom: 16 }}>
<Typography.Text type="secondary">
共 {rows.length} 个{isMonitoring ? '监控' : '自有'}账号
</Typography.Text>
{primaryAction}
</Flex>
{error ? (
<Alert type="error" showIcon style={{ marginBottom: 16 }} title={error.message} action={<Button size="small" onClick={load}>重试</Button>} />
) : null}