fix(ads/compliance/tencent): 调整导出按钮功能与文案,仅导出失败素材
修改了图片和视频导出按钮的文本与导出逻辑,现在只会导出审核状态为REJECTED的失败素材,同时更新了对应的提示信息和导出文件名
This commit is contained in:
@@ -89,7 +89,7 @@
|
||||
<el-icon><Refresh /></el-icon> 刷新检测结果
|
||||
</el-button>
|
||||
<el-button type="warning" plain @click="exportImageUrls">
|
||||
<el-icon><Download /></el-icon> 导出
|
||||
<el-icon><Download /></el-icon> 导出失败素材
|
||||
</el-button>
|
||||
</div>
|
||||
|
||||
@@ -172,7 +172,7 @@
|
||||
<el-icon><Refresh /></el-icon> 刷新检测结果
|
||||
</el-button>
|
||||
<el-button type="warning" plain @click="exportVideoUrls">
|
||||
<el-icon><Download /></el-icon> 导出
|
||||
<el-icon><Download /></el-icon> 导出失败素材
|
||||
</el-button>
|
||||
</div>
|
||||
|
||||
@@ -646,14 +646,15 @@ const pollVideoResults = () => {
|
||||
});
|
||||
};
|
||||
|
||||
// 导出
|
||||
// 导出失败素材
|
||||
const exportImageUrls = () => {
|
||||
if (!imageList.value.length) {
|
||||
ElMessage.warning('没有可导出的图片');
|
||||
const failedImages = imageList.value.filter((item) => item.verifyStatus === 'REJECTED');
|
||||
if (!failedImages.length) {
|
||||
ElMessage.warning('没有失败的图片素材');
|
||||
return;
|
||||
}
|
||||
const rows = [['ID', '图片ID', '账户ID', '用途', '预览URL', '状态', '描述']];
|
||||
imageList.value.forEach((item) => {
|
||||
failedImages.forEach((item) => {
|
||||
rows.push([
|
||||
item.id,
|
||||
item.imageId,
|
||||
@@ -664,19 +665,20 @@ const exportImageUrls = () => {
|
||||
item.description || '-',
|
||||
]);
|
||||
});
|
||||
downloadCsv('图片列表.csv', rows);
|
||||
downloadCsv('图片失败素材.csv', rows);
|
||||
};
|
||||
|
||||
const exportVideoUrls = () => {
|
||||
if (!videoList.value.length) {
|
||||
ElMessage.warning('没有可导出的视频');
|
||||
const failedVideos = videoList.value.filter((item) => item.verifyStatus === 'REJECTED');
|
||||
if (!failedVideos.length) {
|
||||
ElMessage.warning('没有失败的视频素材');
|
||||
return;
|
||||
}
|
||||
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 || '-']);
|
||||
});
|
||||
downloadCsv('视频列表.csv', rows);
|
||||
downloadCsv('视频失败素材.csv', rows);
|
||||
};
|
||||
|
||||
const downloadCsv = (filename: string, rows: string[][]) => {
|
||||
|
||||
Reference in New Issue
Block a user