This commit is contained in:
2026-07-03 12:38:21 +08:00
parent 54410c7854
commit 94302719b2
3 changed files with 34 additions and 12 deletions
File diff suppressed because one or more lines are too long
+1 -1
View File
@@ -28,7 +28,7 @@
}
})();
</script>
<script type="module" crossorigin src="/assets/index-DQ1LXqt7.js"></script>
<script type="module" crossorigin src="/assets/index-By9oW19d.js"></script>
<link rel="stylesheet" crossorigin href="/assets/index-D7ShJUt4.css">
</head>
<body>
@@ -436,18 +436,33 @@ const AdminGenerationAiRecords: React.FC = () => {
},
},
{
title: '附件', key: 'references', width: 110,
title: '附件', key: 'references', width: 130,
render: (_: any, r: GenerationAITaskOut) => {
const refs = r.mediaReferences || [];
if (refs.length === 0) return <Typography.Text style={{ fontSize: 12, color: '#94a3b8' }}></Typography.Text>;
const imgCount = refs.filter((ref) => getReferenceType(ref) === 'image').length;
const vidCount = refs.filter((ref) => getReferenceType(ref) === 'video').length;
const otherCount = refs.length - imgCount - vidCount;
return (
<Space size={4} wrap>
{imgCount > 0 ? <Tag color="purple" icon={<FileImageOutlined />}>{imgCount} </Tag> : null}
{vidCount > 0 ? <Tag color="geekblue" icon={<VideoCameraOutlined />}>{vidCount} </Tag> : null}
{otherCount > 0 ? <Tag>{otherCount} </Tag> : null}
{refs.map((ref, idx) => {
const refUrl = getReferenceUrl(ref);
const refType = getReferenceType(ref);
const title = typeof ref.name === 'string' && ref.name ? ref.name : `附件 ${idx + 1}`;
if (!refUrl) return null;
return (
<Button
key={idx}
size="small"
icon={refType === 'video' ? <PlayCircleOutlined /> : <FileImageOutlined />}
type="link"
style={{ padding: 0, fontSize: 12 }}
onClick={(e) => {
e.stopPropagation();
handlePreviewResource(refUrl, refType === 'video' ? 'video' : 'image', title);
}}
>
{title}
</Button>
);
})}
</Space>
);
},
@@ -465,7 +480,7 @@ const AdminGenerationAiRecords: React.FC = () => {
icon={<PlayCircleOutlined />}
type="link"
style={{ padding: 0 }}
onClick={(e) => { e.stopPropagation(); handleOpenExternalResource(r.videoUrl, '视频'); }}
onClick={(e) => { e.stopPropagation(); handlePreviewResource(r.videoUrl!, 'video', '生成视频'); }}
>
</Button>
@@ -478,7 +493,7 @@ const AdminGenerationAiRecords: React.FC = () => {
icon={<FileImageOutlined />}
type="link"
style={{ padding: 0 }}
onClick={(e) => { e.stopPropagation(); handleOpenExternalResource(r.imageUrl, '图片'); }}
onClick={(e) => { e.stopPropagation(); handlePreviewResource(r.imageUrl!, 'image', '生成图片'); }}
>
</Button>
@@ -945,7 +960,14 @@ const AdminGenerationAiRecords: React.FC = () => {
/>
<RangePicker
value={createdRange}
onChange={(dates) => { setCreatedRange(dates); }}
onChange={(dates) => {
if (dates && dates[0] && dates[1]) {
// 自动将结束时间补到当天 23:59:59,确保选一天也能看到整天数据
setCreatedRange([dates[0].startOf('day'), dates[1].endOf('day')]);
} else {
setCreatedRange(dates);
}
}}
placeholder={['开始日期', '结束日期']}
/>
<Input