From 53a187f7c4c054ef9d85d76b33f0d027325ef9f5 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, 8 Sep 2025 14:58:23 +0800 Subject: [PATCH] =?UTF-8?q?=E6=89=93=E5=BC=80=E7=BC=96=E8=BE=91=E5=BC=B9?= =?UTF-8?q?=E7=AA=97=20=E9=87=8D=E6=96=B0=E7=94=9F=E6=88=90=E5=8A=9F?= =?UTF-8?q?=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/service/adapter/oldErrAdapter.ts | 4 +-- components/ui/shot-tab-content.tsx | 40 ++++++++++++++++++++++++---- 2 files changed, 37 insertions(+), 7 deletions(-) diff --git a/app/service/adapter/oldErrAdapter.ts b/app/service/adapter/oldErrAdapter.ts index 5fa328b..9809241 100644 --- a/app/service/adapter/oldErrAdapter.ts +++ b/app/service/adapter/oldErrAdapter.ts @@ -158,11 +158,11 @@ export class VideoSegmentEntityAdapter { // 创建VideoSegmentEntity const entity: VideoSegmentEntity = { - id: `video_mock_${index}`, // 生成临时ID,包含索引 + id: result.video_id, // 生成临时ID,包含索引 name: `video_${index}`, // 生成临时名称,包含索引 sketchUrl: "", // 后端数据中没有sketchUrl,设为空字符串 videoUrl: result.videos, - status: status, + status: result.video_status, lens: lens }; diff --git a/components/ui/shot-tab-content.tsx b/components/ui/shot-tab-content.tsx index 2e3ba85..2ea909e 100644 --- a/components/ui/shot-tab-content.tsx +++ b/components/ui/shot-tab-content.tsx @@ -2,7 +2,7 @@ import React, { useRef, useEffect, useState, forwardRef } from 'react'; import { motion, AnimatePresence } from 'framer-motion'; -import { RefreshCw, User, Loader2, X, Plus, Video, CircleX } from 'lucide-react'; +import { RefreshCw, User, Loader2, X, Download, Video, CircleX } from 'lucide-react'; import { cn } from '@/public/lib/utils'; import { PersonDetection, PersonDetectionScene } from './person-detection'; import { ShotsEditor } from './shot-editor/ShotsEditor'; @@ -13,6 +13,7 @@ import HorizontalScroller from './HorizontalScroller'; import { useEditData } from '@/components/pages/work-flow/use-edit-data'; import { RoleEntity, VideoSegmentEntity } from '@/app/service/domain/Entities'; import { ShotVideo } from '@/api/DTO/movieEdit'; +import { downloadVideo } from '@/utils/tools'; interface ShotTabContentProps { currentSketchIndex: number; @@ -61,6 +62,7 @@ export const ShotTabContent = forwardRef< const [nextToTabId, setNextToTabId] = useState(''); const [isRemindApplyUpdate, setIsRemindApplyUpdate] = useState(false); const [updateData, setUpdateData] = useState([]); + const [isLoadingDownloadBtn, setIsLoadingDownloadBtn] = useState(false); useEffect(() => { console.log('shotTabContent-----selectedSegment', selectedSegment); @@ -283,7 +285,7 @@ export const ShotTabContent = forwardRef< // 通过 video_id 找到对应的分镜 const selectedVideo = originalVideos[index]; const targetSegment = shotData.find(shot => - shot.videoUrl.some(url => url.video_id === selectedVideo.video_id) + shot.id === selectedVideo.video_id ); if (targetSegment) { setSelectedSegment(targetSegment); @@ -327,7 +329,20 @@ export const ShotTabContent = forwardRef< whileHover={{ scale: 1.02 }} whileTap={{ scale: 0.98 }} > - {shot.urls && shot.urls.length > 0 && ( + {/** 进行中 显示加载中 */} + {shot.video_status === 0 && ( +
+ +
+ )} + {/** 失败 显示失败 */} + {shot.video_status === 2 && ( +
+ +
+ )} + {/** 成功 显示视频 */} + {shot.video_status === 1 && shot.urls && shot.urls.length > 0 && (