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
@@ -4,9 +4,9 @@ import { NFormItem } from 'naive-ui'
|
||||
import { integerRule, fieldRule } from '../../lib/form-rules'
|
||||
import WorkspacePage from '../../components/ui/WorkspacePage.vue'
|
||||
import ActionMenu from '../../components/ui/ActionMenu.vue'
|
||||
import { NScrollbar, NAlert, NButton, NCheckbox, NInputNumber, NProgress, NTab, NTable, NTabs, NTag } from 'naive-ui'
|
||||
import { NScrollbar, NAlert, NButton, NCheckbox, NInputNumber, NProgress, NTab, NTable, NTabs } from 'naive-ui'
|
||||
import { computed, onScopeDispose, ref, watch } from 'vue'
|
||||
import { Layers, LoaderCircle, ArrowRight } from '@lucide/vue'
|
||||
import { Layers, LoaderCircle, ArrowRight, Settings2 } from '@lucide/vue'
|
||||
import { EmptyState, StatusBadge, WorkspaceTools } from '../../components/ui'
|
||||
import { useProjectContext } from '../projects/context'
|
||||
import { breakdownApi } from './api'
|
||||
@@ -159,7 +159,8 @@ const rules = {
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<WorkspacePage split compact class="breakdown-workspace-page">
|
||||
<!-- 以下是手机完成提示自然滚走、分类导航与设置入口吸顶的拆解工作区 -->
|
||||
<WorkspacePage split compact mobile-scroll class="breakdown-workspace-page">
|
||||
<template #notice>
|
||||
<!-- 以下是拆解完成后的下一步提示模块 -->
|
||||
<NAlert v-if="stageComplete" type="success" :show-icon="false">
|
||||
@@ -201,9 +202,9 @@ const rules = {
|
||||
集剧本。每个分组分别抽取所选模块,再生成主体与分镜。
|
||||
</p>
|
||||
</div>
|
||||
<NTag size="small" :bordered="false">来源:正式剧集</NTag>
|
||||
</div>
|
||||
<AppForm
|
||||
class="breakdown-settings-form"
|
||||
:model="formModel"
|
||||
:rules="rules"
|
||||
:disabled="operation.pending"
|
||||
@@ -449,17 +450,35 @@ const rules = {
|
||||
><NTab v-for="option in moduleOptions" :key="option.value" :name="option.value"
|
||||
>{{ option.label
|
||||
}}<span>{{ subjects.filter(item => item.module === option.value).length }}</span></NTab
|
||||
><NTab name="storyboard">分镜</NTab><NTab name="tasks">任务明细</NTab>
|
||||
><NTab name="storyboard">分镜</NTab
|
||||
><NTab name="tasks"
|
||||
><span class="breakdown-task-label-desktop">任务明细</span
|
||||
><span class="breakdown-task-label-mobile">任务</span></NTab
|
||||
>
|
||||
<template #suffix
|
||||
><div class="tabs-toolbar-actions">
|
||||
<ActionMenu
|
||||
label="拆解更多操作"
|
||||
:items="[
|
||||
{ key: 'history', label: showHistory ? '收起执行记录' : '执行记录' },
|
||||
{ key: 'export', label: '导出 JSON', disabled: !snapshot }
|
||||
]"
|
||||
@select="$event === 'history' ? (showHistory = !showHistory) : exportResult()"
|
||||
/></div
|
||||
<!-- 以下是手机分类导航中的拆解设置入口,共用原有设置弹窗 -->
|
||||
<NButton
|
||||
quaternary
|
||||
class="icon-button breakdown-mobile-tools"
|
||||
aria-label="拆解设置与恢复"
|
||||
title="拆解设置与恢复"
|
||||
aria-haspopup="dialog"
|
||||
:aria-expanded="toolsOpen"
|
||||
@click="toolsOpen = true"
|
||||
>
|
||||
<template #icon><Settings2 :size="15" /></template>
|
||||
</NButton>
|
||||
<!-- 以下是桌面低频操作入口,手机不显示省略号菜单 -->
|
||||
<span class="breakdown-more-actions"
|
||||
><ActionMenu
|
||||
label="拆解更多操作"
|
||||
:items="[
|
||||
{ key: 'history', label: showHistory ? '收起执行记录' : '执行记录' },
|
||||
{ key: 'export', label: '导出 JSON', disabled: !snapshot }
|
||||
]"
|
||||
@select="$event === 'history' ? (showHistory = !showHistory) : exportResult()"
|
||||
/></span></div
|
||||
></template>
|
||||
</NTabs>
|
||||
</div>
|
||||
@@ -566,6 +585,10 @@ const rules = {
|
||||
.breakdown-settings-panel {
|
||||
container: breakdown-settings / inline-size;
|
||||
}
|
||||
/* 说明与表单留出 16px,避免移除来源标签后紧贴首个字段。 */
|
||||
.breakdown-settings-form {
|
||||
margin-top: 16px;
|
||||
}
|
||||
.breakdown-config {
|
||||
@apply grid grid-cols-[180px_minmax(0,_1fr)_auto] items-start gap-y-4 gap-x-6;
|
||||
--breakdown-label-offset: 29px;
|
||||
@@ -588,7 +611,8 @@ const rules = {
|
||||
@apply m-0 p-0 border-0;
|
||||
}
|
||||
.breakdown-module-options {
|
||||
@apply w-full grid grid-cols-[repeat(3,_minmax(0,_1fr))] gap-y-3 gap-x-4;
|
||||
/* 模块内部收紧为 8px,说明到字段和字段之间仍保持 16px 的层级间距。 */
|
||||
@apply w-full grid grid-cols-[repeat(3,_minmax(0,_1fr))] gap-y-2 gap-x-4;
|
||||
}
|
||||
.breakdown-module-description {
|
||||
@apply mt-1 mx-0 mb-0 pl-6 text-muted text-[11px] leading-[18px] wrap-anywhere;
|
||||
@@ -619,27 +643,81 @@ const rules = {
|
||||
@apply inline-flex gap-1.5;
|
||||
}
|
||||
.breakdown-results-section {
|
||||
@apply flex flex-col flex-1 min-h-0 min-w-0 gap-2;
|
||||
@apply flex flex-col flex-1 min-h-0 min-w-0;
|
||||
/* 提示到导航、导航到搜索、搜索到列表共用同一个模块间距。 */
|
||||
gap: var(--app-content-gap);
|
||||
}
|
||||
.breakdown-results-section > .result-toolbar {
|
||||
@apply shrink-0;
|
||||
}
|
||||
.breakdown-results-section > .content-with-history {
|
||||
@apply flex-1 h-auto min-h-0 grid-rows-[minmax(0,_1fr)];
|
||||
}
|
||||
/* 亮色模式为结果正文增加浅灰背景,保持与页面底色的层次。 */
|
||||
:root:not([data-theme='dark']) .breakdown-results-section > .content-with-history {
|
||||
background: var(--app-subtle);
|
||||
/* 外层透明,搜索框和各条目使用自身背景,模块间距不再铺底色。 */
|
||||
background: transparent;
|
||||
}
|
||||
.breakdown-results-scroll .n-scrollbar-content {
|
||||
@apply wrap-anywhere;
|
||||
}
|
||||
.breakdown-result-pad {
|
||||
@apply p-4;
|
||||
/* 条目保留自身背景和内边距,外层不再重复缩进搜索和结果。 */
|
||||
@apply p-0;
|
||||
}
|
||||
.breakdown-result-pad .subject-list-toolbar {
|
||||
margin-bottom: var(--app-content-gap);
|
||||
}
|
||||
.breakdown-results-section > .content-with-history.history-hidden {
|
||||
@apply grid-cols-[minmax(0,_1fr)] grid-rows-[minmax(0,_1fr)];
|
||||
}
|
||||
.breakdown-workspace-page .breakdown-mobile-tools.n-button {
|
||||
display: none;
|
||||
}
|
||||
.breakdown-task-label-mobile {
|
||||
display: none;
|
||||
}
|
||||
@media (max-width: 760px) {
|
||||
/* 手机隐藏整行统计和旧设置入口,设置功能移到分类导航右侧。 */
|
||||
.breakdown-workspace-page .workspace-heading-scroll.n-scrollbar {
|
||||
display: none;
|
||||
}
|
||||
.breakdown-more-actions,
|
||||
.breakdown-task-label-desktop {
|
||||
display: none;
|
||||
}
|
||||
.breakdown-task-label-mobile {
|
||||
display: inline;
|
||||
}
|
||||
/* 缩短标签文字并收紧间距,让手机分类与设置图标完整显示在同一行。 */
|
||||
.breakdown-workspace-page .workspace-tabs.n-tabs .n-tabs-nav .n-tabs-tab {
|
||||
padding-inline: 8px;
|
||||
}
|
||||
.breakdown-workspace-page .breakdown-mobile-tools.n-button {
|
||||
display: inline-flex;
|
||||
width: 44px;
|
||||
min-width: 44px;
|
||||
height: 44px;
|
||||
padding: 0;
|
||||
}
|
||||
/* 分类导航与设置共用完整吸顶背景,正文不会从导航区域透出。 */
|
||||
.breakdown-workspace-page .breakdown-results-section > .result-toolbar {
|
||||
position: sticky;
|
||||
top: 0;
|
||||
z-index: 19;
|
||||
background: var(--app-body);
|
||||
}
|
||||
/* 正文交给项目内容区滚动,绿色提示随页面位置自然移出,不做透明度收起。 */
|
||||
.breakdown-workspace-page .breakdown-results-section {
|
||||
flex: none;
|
||||
overflow: visible;
|
||||
}
|
||||
.breakdown-workspace-page .content-with-history,
|
||||
.breakdown-workspace-page .content-with-history > main,
|
||||
.breakdown-workspace-page .breakdown-results-scroll,
|
||||
.breakdown-workspace-page .breakdown-results-scroll > .n-scrollbar-container {
|
||||
height: auto;
|
||||
max-height: none;
|
||||
overflow: visible;
|
||||
}
|
||||
}
|
||||
@media (max-width: 800px) {
|
||||
.breakdown-workspace-page .workspace-toolbar {
|
||||
@apply min-h-0 flex-nowrap gap-2;
|
||||
|
||||
Reference in new issue
Block a user