From 823a54525e5582307e31680a8feb1903311a9c0c Mon Sep 17 00:00:00 2001 From: imeepos Date: Thu, 17 Jul 2025 12:39:57 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E6=94=B9=E5=AF=BC=E5=87=BA?= =?UTF-8?q?=E6=96=87=E4=BB=B6=E5=90=8D=E4=B8=BA=E5=9B=BA=E5=AE=9A=E7=9A=84?= =?UTF-8?q?draft=5Fcontent.json?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 将动态生成的文件名改为固定的draft_content.json - 更新前端默认保存文件名 - 简化导出相关的日志和提示信息 - 移除V1/V2版本标识,统一为导出功能 --- .../services/template_matching_result_service.rs | 4 ++-- .../commands/template_matching_result_commands.rs | 8 ++++---- .../src/components/TemplateMatchingResultCard.tsx | 12 +----------- .../src/components/TemplateMatchingResultManager.tsx | 8 ++++---- 4 files changed, 11 insertions(+), 21 deletions(-) diff --git a/apps/desktop/src-tauri/src/business/services/template_matching_result_service.rs b/apps/desktop/src-tauri/src/business/services/template_matching_result_service.rs index 6740e73..3025764 100644 --- a/apps/desktop/src-tauri/src/business/services/template_matching_result_service.rs +++ b/apps/desktop/src-tauri/src/business/services/template_matching_result_service.rs @@ -386,7 +386,7 @@ impl TemplateMatchingResultService { let output_file_path = if output_path.ends_with(".json") { output_path.to_string() } else { - format!("{}/draft_content_v2_{}.json", output_path, result_id) + format!("{}/draft_content.json", output_path) }; // 序列化并写入文件 @@ -396,7 +396,7 @@ impl TemplateMatchingResultService { std::fs::write(&output_file_path, json_content) .map_err(|e| anyhow!("写入文件失败 {}: {}", output_file_path, e))?; - println!("✅ V2导出成功: {}", output_file_path); + println!("✅ 导出成功: {}", output_file_path); Ok(output_file_path) } diff --git a/apps/desktop/src-tauri/src/presentation/commands/template_matching_result_commands.rs b/apps/desktop/src-tauri/src/presentation/commands/template_matching_result_commands.rs index bf1107d..42fb3e1 100644 --- a/apps/desktop/src-tauri/src/presentation/commands/template_matching_result_commands.rs +++ b/apps/desktop/src-tauri/src/presentation/commands/template_matching_result_commands.rs @@ -270,7 +270,7 @@ pub async fn export_matching_result_to_jianying_v2( output_path: String, database: State<'_, Arc>, ) -> Result { - println!("🎬 开始导出匹配结果到剪映格式 (V2)"); + println!("🎬 开始导出匹配结果到剪映格式"); println!("📋 导出参数:"); println!(" - 匹配结果ID: {}", result_id); println!(" - 输出路径: {}", output_path); @@ -283,12 +283,12 @@ pub async fn export_matching_result_to_jianying_v2( match service.export_to_jianying_v2(&result_id, &output_path, material_repository, template_service).await { Ok(file_path) => { - println!("✅ V2导出成功: {}", file_path); + println!("✅ 导出成功: {}", file_path); Ok(file_path) } Err(e) => { - eprintln!("❌ V2导出失败: {}", e); - Err(format!("V2导出失败: {}", e)) + eprintln!("❌ 导出失败: {}", e); + Err(format!("导出失败: {}", e)) } } } diff --git a/apps/desktop/src/components/TemplateMatchingResultCard.tsx b/apps/desktop/src/components/TemplateMatchingResultCard.tsx index de70d4b..5b506e8 100644 --- a/apps/desktop/src/components/TemplateMatchingResultCard.tsx +++ b/apps/desktop/src/components/TemplateMatchingResultCard.tsx @@ -15,7 +15,6 @@ export const TemplateMatchingResultCard: React.FC { // 格式化时长显示 @@ -190,22 +189,13 @@ export const TemplateMatchingResultCard: React.FC )} - {onExportToJianying && ( - - )} {onExportToJianyingV2 && ( )}