fix(web): 竞品作品卡片与详情不再展示发布状态标签,对齐监控账号作品列表

This commit is contained in:
2026-09-30 15:40:20 +08:00
parent 21a576ab20
commit 5401093818
+2 -17
View File
@@ -1,9 +1,9 @@
// 竞品分析:作品列表对齐 ant-design-pro card-list——antd Row/Col 响应式栅格 + Card 原样组合;
// 作品详情走 Drawer;日期筛选用 antd DatePicker;筛选自动刷新、手动翻页不变。
// 封面读本地缓存(/works/:id/cover,认证 fetch + blob);发布时间状态详情见 publishedAtStatusMeta 注释。
// 封面读本地缓存(/works/:id/cover,认证 fetch + blob)。发布状态仅用于筛选,不在卡片上展示(对齐监控账号作品列表)。
import { useEffect, useState } from 'react';
import { CommentOutlined, LikeOutlined, ShareAltOutlined } from '@ant-design/icons';
import { Alert, App, Button, Card, Col, DatePicker, Drawer, Empty, Flex, InputNumber, Row, Select, Space, Spin, Table, Tag, Tooltip, Typography } from 'antd';
import { Alert, App, Button, Card, Col, DatePicker, Drawer, Empty, Flex, InputNumber, Row, Select, Space, Spin, Table, Typography } from 'antd';
import type { Dayjs } from 'dayjs';
import { creatorGet, fetchCreatorBinary, getList } from '@/services/api';
import { conflictMessage, dateTime } from '@/utils/helpers';
@@ -15,13 +15,6 @@ const publishedAtStatusOptions = [
{ value: 'invalid', label: '无效时间' },
];
const publishedAtStatusMeta: Record<string, { color?: string; label: string; hint?: string }> = {
// verified:发布时间从平台原始数据中成功解析且已核验(非未来时间、非无效值)。
verified: { color: 'green', label: '已核验', hint: '发布时间已从平台数据成功解析核验' },
future: { color: 'orange', label: '未来时间', hint: '发布时间晚于当前时间,可能是定时发布' },
pending_verification: { label: '待核验', hint: '平台未返回发布时间,待后续采集补齐' },
invalid: { color: 'red', label: '无效时间', hint: '平台返回的发布时间无效(如 0 或负值)' } };
interface Filters {
minLikes?: number;
minComments?: number;
@@ -31,12 +24,6 @@ interface Filters {
publishedBefore?: Dayjs;
}
function statusTag(status?: string) {
const meta = publishedAtStatusMeta[status || ''] || { label: status || '—' };
const tag = <Tag color={meta.color}>{meta.label}</Tag>;
return meta.hint ? <Tooltip title={meta.hint}>{tag}</Tooltip> : tag;
}
// 作品封面:从本地缓存接口读取(认证 fetch + blob URL);缓存缺失时展示占位。
function WorkCover({ workID, title }: { workID: string; title?: string }) {
const [src, setSrc] = useState<string | null>(null);
@@ -188,7 +175,6 @@ export default function Page() {
作者:{work.author_name || '—'}
</Typography.Text>
<Space size={8} wrap>
{statusTag(work.published_at_status)}
<Typography.Text type="secondary" style={{ fontSize: 12 }}>
{work.published_at ? dateTime(work.published_at) : '—'}
</Typography.Text>
@@ -232,7 +218,6 @@ export default function Page() {
<Typography.Paragraph style={{ whiteSpace: 'pre-wrap', marginBottom: 0 }}>{workDetail.body || workDetail.title || '暂无正文'}</Typography.Paragraph>
<Space wrap>
<Typography.Text type="secondary">来源:{workDetail.source_type || '—'}</Typography.Text>
{statusTag(workDetail.published_at_status)}
{workDetail.original_url ? (
<Typography.Link href={workDetail.original_url} target="_blank">
打开原文