From 60217ffe96c57aad72c5ed4bc1d4d25059a82293 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8C=97=E6=9E=B3?= <7854742+wang_rumeng@user.noreply.gitee.com> Date: Mon, 18 Aug 2025 23:25:56 +0800 Subject: [PATCH] =?UTF-8?q?=E9=87=8D=E6=96=B0=E7=94=9F=E6=88=90=E8=A7=86?= =?UTF-8?q?=E9=A2=91=E5=90=8E=E5=BC=80=E5=90=AF=E8=BD=AE=E8=AF=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/video_flow.ts | 13 ++++++- app/service/Interaction/ShotService.ts | 2 +- components/ui/edit-modal.tsx | 53 +++++++++++++++++++++++++- 3 files changed, 64 insertions(+), 4 deletions(-) diff --git a/api/video_flow.ts b/api/video_flow.ts index f24c9ac..89c7ec2 100644 --- a/api/video_flow.ts +++ b/api/video_flow.ts @@ -871,7 +871,18 @@ export const updateShotPrompt = async (request: { /** 镜头描述 */ shot_descriptions: task_item; }): Promise> => { - return post("/movie/update_shot_prompt", request); + // 过滤掉第一层的空字符串字段 + const filteredDesc = Object.entries(request.shot_descriptions).reduce>((acc, [key, value]) => { + if (value !== '') { + acc[key] = value; + } + return acc; + }, {}); + + return post("/movie/update_shot_prompt", { + ...request, + shot_descriptions: filteredDesc + }); }; /** diff --git a/app/service/Interaction/ShotService.ts b/app/service/Interaction/ShotService.ts index cb2dd10..1aeb607 100644 --- a/app/service/Interaction/ShotService.ts +++ b/app/service/Interaction/ShotService.ts @@ -211,7 +211,7 @@ export const useShotService = (): UseShotService => { ) ); } - + setIntervalIdHandler(projectId); // 返回当前选中的片段,因为现在API返回的是任务状态而不是完整的片段 return selectedSegment!; } catch (error) { diff --git a/components/ui/edit-modal.tsx b/components/ui/edit-modal.tsx index b8c6c4f..da429cf 100644 --- a/components/ui/edit-modal.tsx +++ b/components/ui/edit-modal.tsx @@ -58,6 +58,7 @@ export function EditModal({ // 添加一个状态来标记是否是从切换tab触发的提醒 const [pendingSwitchTabId, setPendingSwitchTabId] = useState(null); const [disabledBtn, setDisabledBtn] = useState(false); + const [isRemindCloseOpen, setIsRemindCloseOpen] = useState(false); useEffect(() => { setCurrentIndex(currentSketchIndex); @@ -166,6 +167,23 @@ export function EditModal({ setResetKey(resetKey + 1); } + const handleClickClose = () => { + // TODO 关闭前 检查 当前tab 下是否有更新 如果有更新 则提醒用户 是否确认应用 + // 暂时 默认弹出提醒 + setIsRemindCloseOpen(true); + } + + const handleConfirmApply = () => { + console.log('handleConfirmApply'); + setIsRemindCloseOpen(false); + handleConfirmGotoFallback(); + } + + const handleCloseRemindClosePanel = () => { + setIsRemindCloseOpen(false); + onClose(); + } + const renderTabContent = () => { switch (activeTab) { case '0': @@ -235,7 +253,6 @@ export function EditModal({ initial={{ opacity: 0 }} animate={{ opacity: 1 }} exit={{ opacity: 0 }} - onClick={onClose} /> {/* 弹窗内容 */} @@ -290,7 +307,7 @@ export function EditModal({ {/* 关闭按钮 */} @@ -407,6 +424,38 @@ export function EditModal({ + + {/* 提醒用户 关闭当前弹窗 是否确认应用 */} + +
+
+ +

If you have modified the content, closing it will lose the modified content. Do you want to apply the modifications?

+
+
+ + +
+
+
)}