forked from 77media/video-flow
重新生成视频后开启轮询
This commit is contained in:
parent
b7fe03d5ee
commit
60217ffe96
@ -871,7 +871,18 @@ export const updateShotPrompt = async (request: {
|
|||||||
/** 镜头描述 */
|
/** 镜头描述 */
|
||||||
shot_descriptions: task_item;
|
shot_descriptions: task_item;
|
||||||
}): Promise<ApiResponse<any>> => {
|
}): Promise<ApiResponse<any>> => {
|
||||||
return post("/movie/update_shot_prompt", request);
|
// 过滤掉第一层的空字符串字段
|
||||||
|
const filteredDesc = Object.entries(request.shot_descriptions).reduce<Record<string, any>>((acc, [key, value]) => {
|
||||||
|
if (value !== '') {
|
||||||
|
acc[key] = value;
|
||||||
|
}
|
||||||
|
return acc;
|
||||||
|
}, {});
|
||||||
|
|
||||||
|
return post("/movie/update_shot_prompt", {
|
||||||
|
...request,
|
||||||
|
shot_descriptions: filteredDesc
|
||||||
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -211,7 +211,7 @@ export const useShotService = (): UseShotService => {
|
|||||||
)
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
setIntervalIdHandler(projectId);
|
||||||
// 返回当前选中的片段,因为现在API返回的是任务状态而不是完整的片段
|
// 返回当前选中的片段,因为现在API返回的是任务状态而不是完整的片段
|
||||||
return selectedSegment!;
|
return selectedSegment!;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
|||||||
@ -58,6 +58,7 @@ export function EditModal({
|
|||||||
// 添加一个状态来标记是否是从切换tab触发的提醒
|
// 添加一个状态来标记是否是从切换tab触发的提醒
|
||||||
const [pendingSwitchTabId, setPendingSwitchTabId] = useState<string | null>(null);
|
const [pendingSwitchTabId, setPendingSwitchTabId] = useState<string | null>(null);
|
||||||
const [disabledBtn, setDisabledBtn] = useState(false);
|
const [disabledBtn, setDisabledBtn] = useState(false);
|
||||||
|
const [isRemindCloseOpen, setIsRemindCloseOpen] = useState(false);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
setCurrentIndex(currentSketchIndex);
|
setCurrentIndex(currentSketchIndex);
|
||||||
@ -166,6 +167,23 @@ export function EditModal({
|
|||||||
setResetKey(resetKey + 1);
|
setResetKey(resetKey + 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const handleClickClose = () => {
|
||||||
|
// TODO 关闭前 检查 当前tab 下是否有更新 如果有更新 则提醒用户 是否确认应用
|
||||||
|
// 暂时 默认弹出提醒
|
||||||
|
setIsRemindCloseOpen(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
const handleConfirmApply = () => {
|
||||||
|
console.log('handleConfirmApply');
|
||||||
|
setIsRemindCloseOpen(false);
|
||||||
|
handleConfirmGotoFallback();
|
||||||
|
}
|
||||||
|
|
||||||
|
const handleCloseRemindClosePanel = () => {
|
||||||
|
setIsRemindCloseOpen(false);
|
||||||
|
onClose();
|
||||||
|
}
|
||||||
|
|
||||||
const renderTabContent = () => {
|
const renderTabContent = () => {
|
||||||
switch (activeTab) {
|
switch (activeTab) {
|
||||||
case '0':
|
case '0':
|
||||||
@ -235,7 +253,6 @@ export function EditModal({
|
|||||||
initial={{ opacity: 0 }}
|
initial={{ opacity: 0 }}
|
||||||
animate={{ opacity: 1 }}
|
animate={{ opacity: 1 }}
|
||||||
exit={{ opacity: 0 }}
|
exit={{ opacity: 0 }}
|
||||||
onClick={onClose}
|
|
||||||
/>
|
/>
|
||||||
|
|
||||||
{/* 弹窗内容 */}
|
{/* 弹窗内容 */}
|
||||||
@ -290,7 +307,7 @@ export function EditModal({
|
|||||||
{/* 关闭按钮 */}
|
{/* 关闭按钮 */}
|
||||||
<motion.button
|
<motion.button
|
||||||
className="p-2 rounded-full hover:bg-white/10 transition-colors"
|
className="p-2 rounded-full hover:bg-white/10 transition-colors"
|
||||||
onClick={onClose}
|
onClick={handleClickClose}
|
||||||
whileHover={{ rotate: 90 }}
|
whileHover={{ rotate: 90 }}
|
||||||
whileTap={{ scale: 0.9 }}
|
whileTap={{ scale: 0.9 }}
|
||||||
>
|
>
|
||||||
@ -407,6 +424,38 @@ export function EditModal({
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</FloatingGlassPanel>
|
</FloatingGlassPanel>
|
||||||
|
|
||||||
|
{/* 提醒用户 关闭当前弹窗 是否确认应用 */}
|
||||||
|
<FloatingGlassPanel
|
||||||
|
open={isRemindCloseOpen}
|
||||||
|
width='500px'
|
||||||
|
clickMaskClose={false}
|
||||||
|
>
|
||||||
|
<div className="flex flex-col items-center gap-4 text-white py-4">
|
||||||
|
<div className="flex items-center gap-3">
|
||||||
|
<TriangleAlert className="w-6 h-6 text-yellow-400" />
|
||||||
|
<p className="text-lg font-medium">If you have modified the content, closing it will lose the modified content. Do you want to apply the modifications?</p>
|
||||||
|
</div>
|
||||||
|
<div className="flex gap-3 mt-2">
|
||||||
|
<button
|
||||||
|
onClick={() => handleConfirmApply()}
|
||||||
|
data-alt="confirm-replace-button"
|
||||||
|
className="px-4 py-2 bg-blue-600 hover:bg-blue-700 rounded-md transition-colors duration-200 flex items-center gap-2"
|
||||||
|
>
|
||||||
|
<Undo2 className="w-4 h-4" />
|
||||||
|
Apply
|
||||||
|
</button>
|
||||||
|
<button
|
||||||
|
onClick={() => handleCloseRemindClosePanel()}
|
||||||
|
data-alt="ignore-button"
|
||||||
|
className="px-4 py-2 bg-gray-600 hover:bg-gray-700 rounded-md transition-colors duration-200 flex items-center gap-2"
|
||||||
|
>
|
||||||
|
<X className="w-4 h-4" />
|
||||||
|
Ignore
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</FloatingGlassPanel>
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
</AnimatePresence>
|
</AnimatePresence>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user