auto-save 2026-05-13 15:17 (~6)
This commit is contained in:
@@ -270,7 +270,7 @@ export const Dashboard = forwardRef<DashboardHandle, Props>(function Dashboard({
|
||||
<div
|
||||
className="fixed z-[100]"
|
||||
style={{
|
||||
left: 104,
|
||||
left: 24,
|
||||
top: 16,
|
||||
bottom: 16,
|
||||
width: drawerWidth,
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
"use client"
|
||||
import { useEffect, useRef, useState } from "react"
|
||||
import { createPortal } from "react-dom"
|
||||
import { LayoutGrid, ChevronDown, ChevronUp, Sparkle } from "lucide-react"
|
||||
import { type Job, type KeyFrame, cutoutUrl, effectiveFrameUrl, hasCutout } from "@/lib/api"
|
||||
import { LayoutGrid, ChevronDown, ChevronUp, Sparkle, X } from "lucide-react"
|
||||
import { type Job, type KeyFrame, cutoutUrl, effectiveFrameUrl, hasCutout, removeStoryboardImage } from "@/lib/api"
|
||||
import { toast } from "sonner"
|
||||
|
||||
interface Props {
|
||||
job: Job | null
|
||||
@@ -12,7 +13,7 @@ interface Props {
|
||||
onJobUpdate?: (j: Job) => void
|
||||
}
|
||||
|
||||
export function StoryboardBar({ job, selectedFrames, focusedFrame, onFocusFrame }: Props) {
|
||||
export function StoryboardBar({ job, selectedFrames, focusedFrame, onFocusFrame, onJobUpdate }: Props) {
|
||||
const [collapsed, setCollapsed] = useState(false)
|
||||
const [mounted, setMounted] = useState(false)
|
||||
useEffect(() => setMounted(true), [])
|
||||
@@ -40,21 +41,19 @@ export function StoryboardBar({ job, selectedFrames, focusedFrame, onFocusFrame
|
||||
? frames.findIndex((f) => f.index === focusFrame.index) + 1
|
||||
: 0
|
||||
|
||||
// 所有"已进入分镜阶段"的提取图(按分镜时间序展平)
|
||||
type Shot = { frameIdx: number; seq: number; elementId: string; elementName: string; cid: string; isLegacy: boolean }
|
||||
const allShots: Shot[] = []
|
||||
frames.forEach((f, i) => {
|
||||
const seq = i + 1
|
||||
;(f.elements ?? []).forEach((e) => {
|
||||
if (e.cutouts && e.cutouts.length > 0) {
|
||||
e.cutouts.forEach((cid) => allShots.push({
|
||||
frameIdx: f.index, seq, elementId: e.id, elementName: e.name_zh, cid, isLegacy: false,
|
||||
}))
|
||||
} else if (e.cutout_id) {
|
||||
allShots.push({ frameIdx: f.index, seq, elementId: e.id, elementName: e.name_zh, cid: e.cutout_id, isLegacy: true })
|
||||
}
|
||||
})
|
||||
})
|
||||
// 用户已"上推"到分镜头编排区的图片
|
||||
const pushedImages = job.storyboard_images ?? []
|
||||
const frameSeqByIdx: Record<number, number> = {}
|
||||
frames.forEach((f, i) => { frameSeqByIdx[f.index] = i + 1 })
|
||||
|
||||
const handleRemovePushed = async (refId: string) => {
|
||||
try {
|
||||
const updated = await removeStoryboardImage(job.id, refId)
|
||||
onJobUpdate?.(updated)
|
||||
} catch (e) {
|
||||
toast.error("移除失败:" + (e instanceof Error ? e.message : String(e)))
|
||||
}
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="relative z-20 flex-shrink-0 border-b border-white/5 bg-black/30 backdrop-blur-xl">
|
||||
|
||||
Reference in New Issue
Block a user