fix(ads/compliance/tencent): 调整导出按钮功能与文案,仅导出失败素材

修改了图片和视频导出按钮的文本与导出逻辑,现在只会导出审核状态为REJECTED的失败素材,同时更新了对应的提示信息和导出文件名
This commit is contained in:
2026-05-15 11:22:30 +08:00
parent 4d23052e66
commit aca0fda28a

View File

@@ -89,7 +89,7 @@
<el-icon><Refresh /></el-icon> 刷新检测结果 <el-icon><Refresh /></el-icon> 刷新检测结果
</el-button> </el-button>
<el-button type="warning" plain @click="exportImageUrls"> <el-button type="warning" plain @click="exportImageUrls">
<el-icon><Download /></el-icon> 导出 <el-icon><Download /></el-icon> 导出失败素材
</el-button> </el-button>
</div> </div>
@@ -172,7 +172,7 @@
<el-icon><Refresh /></el-icon> 刷新检测结果 <el-icon><Refresh /></el-icon> 刷新检测结果
</el-button> </el-button>
<el-button type="warning" plain @click="exportVideoUrls"> <el-button type="warning" plain @click="exportVideoUrls">
<el-icon><Download /></el-icon> 导出 <el-icon><Download /></el-icon> 导出失败素材
</el-button> </el-button>
</div> </div>
@@ -646,14 +646,15 @@ const pollVideoResults = () => {
}); });
}; };
// 导出 // 导出失败素材
const exportImageUrls = () => { const exportImageUrls = () => {
if (!imageList.value.length) { const failedImages = imageList.value.filter((item) => item.verifyStatus === 'REJECTED');
ElMessage.warning('没有可导出的图片'); if (!failedImages.length) {
ElMessage.warning('没有失败的图片素材');
return; return;
} }
const rows = [['ID', '图片ID', '账户ID', '用途', '预览URL', '状态', '描述']]; const rows = [['ID', '图片ID', '账户ID', '用途', '预览URL', '状态', '描述']];
imageList.value.forEach((item) => { failedImages.forEach((item) => {
rows.push([ rows.push([
item.id, item.id,
item.imageId, item.imageId,
@@ -664,19 +665,20 @@ const exportImageUrls = () => {
item.description || '-', item.description || '-',
]); ]);
}); });
downloadCsv('图片列表.csv', rows); downloadCsv('图片失败素材.csv', rows);
}; };
const exportVideoUrls = () => { const exportVideoUrls = () => {
if (!videoList.value.length) { const failedVideos = videoList.value.filter((item) => item.verifyStatus === 'REJECTED');
ElMessage.warning('没有可导出的视频'); if (!failedVideos.length) {
ElMessage.warning('没有失败的视频素材');
return; return;
} }
const rows = [['ID', '视频ID', '账户ID', '预览URL', '状态', '描述']]; const rows = [['ID', '视频ID', '账户ID', '预览URL', '状态', '描述']];
videoList.value.forEach((item) => { failedVideos.forEach((item) => {
rows.push([item.id, item.videoId, item.accountId, item.previewUrl || '-', getStatusText(item.verifyStatus), item.description || '-']); rows.push([item.id, item.videoId, item.accountId, item.previewUrl || '-', getStatusText(item.verifyStatus), item.description || '-']);
}); });
downloadCsv('视频列表.csv', rows); downloadCsv('视频失败素材.csv', rows);
}; };
const downloadCsv = (filename: string, rows: string[][]) => { const downloadCsv = (filename: string, rows: string[][]) => {