diff --git a/web/src/pages/accounts/$id/index.tsx b/web/src/pages/accounts/$id/index.tsx index 4eb8975..f6d4da3 100644 --- a/web/src/pages/accounts/$id/index.tsx +++ b/web/src/pages/accounts/$id/index.tsx @@ -18,7 +18,8 @@ import { message, } from 'antd'; import { accountAction, createDraft, getOne, getList } from '@/services/api'; -import { accountReadiness, conflictMessage, dateTime } from '@/utils/helpers'; +import { accountReadiness, conflictMessage, dateTime, platformLabel } from '@/utils/helpers'; +import { usePageActions } from '@/components/PageActions'; export default function Page() { const { id = '' } = useParams<{ id: string }>(); @@ -34,6 +35,17 @@ export default function Page() { const [draftBusy, setDraftBusy] = useState(false); const [messageApi, contextHolder] = message.useMessage(); + // 页头动作槽:编辑/返回注册到 Layout 页头 content 槽(标题下方右侧),不在卡片内重复渲染。 + usePageActions( + account ? ( + + + + + ) : null, + [account?.id], + ); + const readiness = account ? accountReadiness(account, binding, browsersError) : null; const loadAll = useCallback(async () => { @@ -119,14 +131,9 @@ export default function Page() { key: 'status', label: '账号状态', children: ( -
- -
{statusTag}
- - {account.authorization_status === 'authorized' ? '已授权' : '已撤销'} - {`${account.runtime_status === 'active' ? '启用' : '暂停'} · 版本 ${account.version}`} - {account.tags?.join('、') || '无'} - + + + {statusTag} - -
+ + {account.authorization_status === 'authorized' ? '已授权' : '已撤销'} + {`${account.runtime_status === 'active' ? '启用' : '暂停'} · 版本 ${account.version}`} + {account.tags?.join('、') || '无'} + + + ), }, { @@ -181,44 +193,41 @@ export default function Page() { key: 'drafts', label: '文本草稿', children: ( -
- - 仅支持单用户 Phase A Mock 文本;内部 ID 与版本由系统生成。 -
- - - - -
- 尚无草稿时无需处理;创建后请进入草稿核对。 - {drafts.map((draft) => ( - -
-
- 草稿版本 {draft.version} - - {draft.content} - -
- history.push(`/drafts/${draft.id}`)} style={{ flexShrink: 0 }}> - 核对草稿 - + + 仅支持单用户 Phase A Mock 文本;内部 ID 与版本由系统生成。 +
+ + + + +
+ {drafts.map((draft) => ( + + +
+ 草稿版本 {draft.version} + + {draft.content} +
-
- ))} -
-
+ history.push(`/drafts/${draft.id}`)} style={{ flexShrink: 0 }}> + 核对草稿 + +
+ + ))} + ), }, ]; @@ -226,21 +235,14 @@ export default function Page() { return (
{contextHolder} -
-
- - {account.name} - - - {account.platform_account_key} · {account.platform} - -
- - - - + {/* 实体标识行:账号名 + 平台明细(动态数据,非页面标题);操作按钮在页头槽。 */} +
+ + {account.name} + + + {account.platform_account_key} · {platformLabel(account.platform)} +