feat(web): 监控账号详情页承载作品列表,点击作品弹出统计 Drawer
This commit is contained in:
@@ -22,8 +22,8 @@ import {
|
||||
message,
|
||||
} from 'antd';
|
||||
import { CloudUploadOutlined, ReloadOutlined } from '@ant-design/icons';
|
||||
import { getList, remove, creatorAction, creatorUpdate } from '@/services/api';
|
||||
import { conflictMessage, dateTime, isCollectionAccount, platformLabel } from '@/utils/helpers';
|
||||
import { getList, remove, creatorAction, creatorUpdate, syncCompetitorAuto } from '@/services/api';
|
||||
import { conflictMessage, dateTime, platformLabel } from '@/utils/helpers';
|
||||
|
||||
interface CompetitorRow {
|
||||
id: string;
|
||||
@@ -88,14 +88,7 @@ export default function MonitoringAccountList() {
|
||||
async function syncCompetitor(competitor: CompetitorRow) {
|
||||
setActionBusy(competitor.id);
|
||||
try {
|
||||
const result = await getList({ resource: 'creator-accounts' });
|
||||
const account = (result.data ?? []).find(
|
||||
(candidate: any) => candidate.platform === competitor.platform && isCollectionAccount(candidate),
|
||||
);
|
||||
if (!account) {
|
||||
throw new Error(`没有可用于同步${platformLabel(competitor.platform)}监控账号的已登录自有账号。`);
|
||||
}
|
||||
await creatorAction(`/creator/competitors/${encodeURIComponent(competitor.id)}/sync`, { account_id: account.id });
|
||||
await syncCompetitorAuto(competitor);
|
||||
messageApi.success('监测账号同步任务已提交。');
|
||||
await load();
|
||||
} catch (actionError) {
|
||||
@@ -177,7 +170,10 @@ export default function MonitoringAccountList() {
|
||||
itemRender={(row) => {
|
||||
const meta = syncStatusMeta[row.sync_status ?? ''] || { label: row.sync_status || '—' };
|
||||
return (
|
||||
<div style={{ padding: '16px 0', borderBottom: '1px solid rgba(5,5,5,0.06)' }}>
|
||||
<div
|
||||
style={{ padding: '16px 0', borderBottom: '1px solid rgba(5,5,5,0.06)', cursor: 'pointer' }}
|
||||
onClick={() => history.push(`/accounts/monitoring/${row.id}`)}
|
||||
>
|
||||
<Flex justify="space-between" align="flex-start" gap={16}>
|
||||
<Flex align="flex-start" gap={12}>
|
||||
<Avatar size={44} src={row.avatar_url || undefined}>
|
||||
@@ -197,7 +193,7 @@ export default function MonitoringAccountList() {
|
||||
</Typography.Paragraph>
|
||||
</div>
|
||||
</Flex>
|
||||
<Space wrap>
|
||||
<Space wrap onClick={(e) => e.stopPropagation()}>
|
||||
<Button size="small" onClick={() => openTags(row)}>
|
||||
编辑标签
|
||||
</Button>
|
||||
|
||||
Reference in New Issue
Block a user