perf(short-drama-agent-front): 优化制作工作台交互与移动端布局
This commit is contained in:
1 parent
b5eaed3981
commit
54a381ebd3
37 files changed
+1217
-426
No files matched your search
@@ -1,5 +1,5 @@
|
||||
import { reactive } from 'vue'
|
||||
import type { ProductionIssueCode, ProductionSession, ShotKeyframe, ShotVideo } from './types'
|
||||
import type { ProductionIssueCode, ProductionSession, ShotKeyframe, ShotVideo, ShotVideoQualityStatus } from './types'
|
||||
|
||||
/** 按项目隔离生产回执,切换页面后仍能查看上一次批量操作结果。 */
|
||||
const sessions = reactive<Record<string, ProductionSession>>({})
|
||||
@@ -34,6 +34,22 @@ export function primaryVideo(items: ShotVideo[]): ShotVideo | undefined {
|
||||
return items.find(item => item.isPrimary && item.status === 'completed' && item.videoUrl)
|
||||
}
|
||||
|
||||
/**
|
||||
* 只读取指定镜头与视频的持久化检查结论,不用流程整体状态代替单个视频结果。
|
||||
* @param qualityStatus 镜头质量流程记录,读取失败时为空
|
||||
* @param shotId 当前镜头 ID
|
||||
* @param videoId 当前视频 ID
|
||||
* @returns 对应视频的检查结论,没有记录或尚未检查时返回 null
|
||||
*/
|
||||
export function videoRecordedValidation(
|
||||
qualityStatus: ShotVideoQualityStatus | null,
|
||||
shotId: string,
|
||||
videoId: string
|
||||
): boolean | null {
|
||||
if (qualityStatus?.shotId !== shotId) return null
|
||||
return qualityStatus.chain.find(item => item.videoId === videoId)?.validationPassed ?? null
|
||||
}
|
||||
|
||||
/** 活动视频状态与后端重复任务保护保持一致。 */
|
||||
export function isActiveVideo(item: ShotVideo): boolean {
|
||||
return ['pending', 'queued', 'running'].includes(item.status)
|
||||
@@ -63,7 +79,11 @@ export function issueLabel(code: ProductionIssueCode): string {
|
||||
return labels[code] ?? '生成条件需要完善'
|
||||
}
|
||||
|
||||
/** 生产状态中文标签,未知值由状态组件回退显示原文。 */
|
||||
/**
|
||||
* 将生产任务状态转换为中文标签,包含首帧与视频的生成中状态。
|
||||
* @param status 后端返回的生产任务状态
|
||||
* @returns 状态对应的中文名称,未知状态保留原值
|
||||
*/
|
||||
export function productionStatusLabel(status: string): string {
|
||||
const labels: Record<string, string> = {
|
||||
ready: '已就绪',
|
||||
@@ -73,6 +93,7 @@ export function productionStatusLabel(status: string): string {
|
||||
pending: '等待提交',
|
||||
queued: '排队中',
|
||||
running: '生成中',
|
||||
generating: '生成中',
|
||||
completed: '已完成',
|
||||
failed: '失败',
|
||||
cancelled: '已取消',
|
||||
|
||||
Reference in new issue
Block a user