feat(web): 自有账号监控接入——详情页账号数据/作品数据/采集状态/强制同步,列表作品统计列
- 账号详情页:账号状态卡加作品采集行(状态 Tag + 上次完成 + 下次窗口 + 最后错误);新增账号数据 Card(粉丝/关注/获赞/作品总数当前值 + 趋势折线);接入共享 WorksGallery(source_type='owned');页头槽加强制同步按钮 - 我的账号列表:改走 monitor-views 聚合接口,加作品数据列(作品数/最近发布)
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
// 我的账号列表(owned):语义对齐 web.archived AccountManagementList(mode="owned")。
|
||||
// 监控账号列表已拆分至 components/accounts/MonitoringAccountList.tsx(card list)。
|
||||
// 数据走 GET /creator/accounts/monitor-views(画像 + 作品数/最近发布聚合),对齐竞品列表画像形态。
|
||||
import { useCallback, useEffect, useState } from 'react';
|
||||
import { history } from '@umijs/max';
|
||||
import {
|
||||
@@ -19,8 +20,8 @@ import {
|
||||
} from 'antd';
|
||||
import { PlusOutlined } from '@ant-design/icons';
|
||||
import type { ColumnsType } from 'antd/es/table';
|
||||
import { getList, remove, creatorUpdate } from '@/services/api';
|
||||
import { conflictMessage } from '@/utils/helpers';
|
||||
import { remove, creatorUpdate, creatorGet } from '@/services/api';
|
||||
import { conflictMessage, dateTime } from '@/utils/helpers';
|
||||
import { usePageActions } from '@/components/PageActions';
|
||||
|
||||
// 仅用 antd 默认组件:Table/Tag/Modal/Popconfirm/Select(tags)。
|
||||
@@ -32,6 +33,8 @@ interface Row {
|
||||
tags?: string[];
|
||||
runtime_status?: string;
|
||||
authorization_status?: string;
|
||||
work_count?: number;
|
||||
latest_published_at?: string | null;
|
||||
}
|
||||
|
||||
export default function AccountManagementList() {
|
||||
@@ -48,9 +51,9 @@ export default function AccountManagementList() {
|
||||
setPending(true);
|
||||
setError(null);
|
||||
try {
|
||||
const result = await getList({ resource: 'accounts' });
|
||||
const rows = await creatorGet('/creator/accounts/monitor-views');
|
||||
setRows(
|
||||
(result.data ?? []).map((account: any) => ({
|
||||
(rows ?? []).map((account: any) => ({
|
||||
...account,
|
||||
name: account.name,
|
||||
tags: account.tags ?? [],
|
||||
@@ -115,6 +118,18 @@ export default function AccountManagementList() {
|
||||
),
|
||||
},
|
||||
{ title: '平台', dataIndex: 'platform', render: () => '抖音' },
|
||||
{
|
||||
title: '作品数据',
|
||||
dataIndex: 'work_count',
|
||||
render: (_, account) => (
|
||||
<Flex vertical>
|
||||
<Typography.Text>{account.work_count ?? 0} 个作品</Typography.Text>
|
||||
<Typography.Text type="secondary" style={{ fontSize: 12 }}>
|
||||
最近发布 {account.latest_published_at ? dateTime(account.latest_published_at) : '—'}
|
||||
</Typography.Text>
|
||||
</Flex>
|
||||
),
|
||||
},
|
||||
{
|
||||
title: '标签',
|
||||
dataIndex: 'tags',
|
||||
|
||||
Reference in New Issue
Block a user