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
@@ -140,7 +140,7 @@ const rules = { concurrency: integerRule('批量并发'), maxRepairAttempts: int
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<WorkspacePage split compact class="storyboard-workspace-page">
|
||||
<WorkspacePage split compact mobile-scroll class="storyboard-workspace-page compact-shot-workspace">
|
||||
<template #notice>
|
||||
<NAlert v-if="episodeSourceUnavailable" type="info" :show-icon="false">
|
||||
本集镜头已重新生成。新标题和剧情详情尚未提供,当前只显示正式镜头编号;请按实际生成规格核对内容。
|
||||
@@ -452,7 +452,7 @@ const rules = { concurrency: integerRule('批量并发'), maxRepairAttempts: int
|
||||
</NScrollbar>
|
||||
</nav>
|
||||
<article class="storyboard-detail min-w-0">
|
||||
<NScrollbar v-if="shot" class="panel-scroll" content-class="p-5 lg:p-7">
|
||||
<NScrollbar v-if="shot" class="panel-scroll" content-class="shot-detail-content p-5 lg:p-7">
|
||||
<header class="mb-6">
|
||||
<p class="eyebrow">
|
||||
段落 {{ shot.beatNo }} · 镜头 {{ shot.shotNo }}
|
||||
@@ -562,23 +562,9 @@ const rules = { concurrency: integerRule('批量并发'), maxRepairAttempts: int
|
||||
@apply p-0;
|
||||
}
|
||||
@media (max-width: 760px) {
|
||||
/* 移动端按整行排列剧集、统计和操作,避免 flex 自动换行留下不规则空白。 */
|
||||
.storyboard-workspace-page .workspace-toolbar {
|
||||
@apply grid grid-cols-[minmax(0,_1fr)] gap-2;
|
||||
}
|
||||
.storyboard-workspace-page .toolbar-episode,
|
||||
.storyboard-workspace-page .toolbar-metrics,
|
||||
.storyboard-workspace-page .toolbar-actions {
|
||||
@apply w-full min-w-0 m-0;
|
||||
}
|
||||
.storyboard-workspace-page .toolbar-metrics {
|
||||
@apply justify-between;
|
||||
}
|
||||
.storyboard-workspace-page .toolbar-actions {
|
||||
@apply justify-start;
|
||||
}
|
||||
/* 手机目录按实际内容占高,避免没有状态或短标题时保留整块空白。 */
|
||||
.storyboard-workspace {
|
||||
@apply grid-cols-[minmax(0,_1fr)] grid-rows-[184px_minmax(0,_1fr)] gap-3;
|
||||
@apply grid-cols-[minmax(0,_1fr)] grid-rows-[auto_minmax(0,_1fr)] gap-2;
|
||||
}
|
||||
.storyboard-controls {
|
||||
@apply grid-cols-[minmax(0,_1fr)_minmax(0,_1fr)];
|
||||
|
||||
@@ -1,12 +1,25 @@
|
||||
<script setup lang="ts">
|
||||
import { computed, useId } from 'vue'
|
||||
import { computed, ref, useId } from 'vue'
|
||||
import { useDirectorySelection } from '../../../composables/useDirectorySelection'
|
||||
import { DirectoryItem } from '../../../components/ui'
|
||||
import type { DesignedShot } from '../types'
|
||||
|
||||
/** 分镜设计与镜头生产共用的两级目录;选择始终使用正式 Shot ID。 */
|
||||
const props = defineProps<{ shots: DesignedShot[]; activeId: string; itemClass: string }>()
|
||||
const props = defineProps<{
|
||||
/** 当前剧集的正式镜头列表。 */
|
||||
shots: DesignedShot[]
|
||||
/** 当前选中镜头的正式 ID。 */
|
||||
activeId: string
|
||||
/** 页面传入的目录条目样式。 */
|
||||
itemClass: string
|
||||
}>()
|
||||
/** 用户选择目录镜头时通知页面更新当前镜头。 */
|
||||
const emit = defineEmits<{ select: [shotId: string] }>()
|
||||
/** 两个镜头页面共用的目录根节点,用于定位当前选中的正式镜头。 */
|
||||
const directoryRoot = ref<HTMLDivElement | null>(null)
|
||||
/** 当前目录实例的唯一标识,关联各段落标题和目录组。 */
|
||||
const directoryId = useId()
|
||||
/** 将镜头按段落和镜头编号排序,供桌面分组与手机横向目录共用。 */
|
||||
const groups = computed(() => {
|
||||
const entries = new Map<number, DesignedShot[]>()
|
||||
for (const shot of props.shots) {
|
||||
@@ -21,37 +34,47 @@ const groups = computed(() => {
|
||||
shots: shots.toSorted((a, b) => a.shotNo - b.shotNo)
|
||||
}))
|
||||
})
|
||||
/** 主体、分镜和生产共用目录定位,镜头分组标题保留桌面置顶避让。 */
|
||||
useDirectorySelection(
|
||||
directoryRoot,
|
||||
() => props.activeId,
|
||||
() => props.shots.map(shot => shot.shotId),
|
||||
'.directory-group-heading'
|
||||
)
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div
|
||||
v-for="group in groups"
|
||||
:key="group.beatNo"
|
||||
class="beat-directory-group"
|
||||
role="group"
|
||||
:aria-labelledby="`${directoryId}-beat-${group.beatNo}`"
|
||||
>
|
||||
<h4 :id="`${directoryId}-beat-${group.beatNo}`" class="directory-group-heading">
|
||||
<span>段落 {{ String(group.beatNo).padStart(2, '0') }}</span>
|
||||
<span class="directory-group-count">{{ group.shots.length }} 镜</span>
|
||||
</h4>
|
||||
<div class="beat-directory-items">
|
||||
<DirectoryItem
|
||||
v-for="shot in group.shots"
|
||||
:key="shot.shotId"
|
||||
:active="activeId === shot.shotId"
|
||||
:class="itemClass"
|
||||
:aria-label="`段落 ${group.beatNo} · 镜头 ${shot.shotNo} · ${shot.title}`"
|
||||
@click="emit('select', shot.shotId)"
|
||||
>
|
||||
{{ shot.title }}
|
||||
<template #eyebrow>
|
||||
<!-- 窄屏目录变为横向条目时补回归属,桌面不重复显示分组编号。 -->
|
||||
<span class="directory-mobile-beat">段落 {{ String(group.beatNo).padStart(2, '0') }} / </span>
|
||||
<span class="directory-shot-number">镜头 {{ String(shot.shotNo).padStart(2, '0') }}</span>
|
||||
</template>
|
||||
<template #meta><slot name="meta" :shot="shot" /></template>
|
||||
</DirectoryItem>
|
||||
<!-- 以下是选中镜头自动定位的目录根模块,不新增布局占位 -->
|
||||
<div ref="directoryRoot" class="beat-shot-directory">
|
||||
<div
|
||||
v-for="group in groups"
|
||||
:key="group.beatNo"
|
||||
class="beat-directory-group"
|
||||
role="group"
|
||||
:aria-labelledby="`${directoryId}-beat-${group.beatNo}`"
|
||||
>
|
||||
<h4 :id="`${directoryId}-beat-${group.beatNo}`" class="directory-group-heading">
|
||||
<span>段落 {{ String(group.beatNo).padStart(2, '0') }}</span>
|
||||
<span class="directory-group-count">{{ group.shots.length }} 镜</span>
|
||||
</h4>
|
||||
<div class="beat-directory-items">
|
||||
<DirectoryItem
|
||||
v-for="shot in group.shots"
|
||||
:key="shot.shotId"
|
||||
:active="activeId === shot.shotId"
|
||||
:class="itemClass"
|
||||
:aria-label="`段落 ${group.beatNo} · 镜头 ${shot.shotNo} · ${shot.title}`"
|
||||
@click="emit('select', shot.shotId)"
|
||||
>
|
||||
{{ shot.title }}
|
||||
<template #eyebrow>
|
||||
<!-- 窄屏目录变为横向条目时补回归属,桌面不重复显示分组编号。 -->
|
||||
<span class="directory-mobile-beat">段落 {{ String(group.beatNo).padStart(2, '0') }} / </span>
|
||||
<span class="directory-shot-number">镜头 {{ String(shot.shotNo).padStart(2, '0') }}</span>
|
||||
</template>
|
||||
<template #meta><slot name="meta" :shot="shot" /></template>
|
||||
</DirectoryItem>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
@@ -59,6 +82,9 @@ const groups = computed(() => {
|
||||
<style>
|
||||
/* 本组件专属布局与 Naive 内部结构覆盖。 */
|
||||
@reference "../../../styles/styles.css";
|
||||
.beat-shot-directory {
|
||||
display: contents;
|
||||
}
|
||||
.directory-group-heading {
|
||||
@apply sticky top-0 z-[1] flex items-center justify-between gap-3 shrink-0 py-2.5 px-3.5 bg-(--app-control) font-mono font-semibold text-[11px] leading-[1.6] text-ink;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user