fix(short-drama-agent-front): 优化拆解引导与质量规则配置

This commit is contained in:
GJ committed 2026-10-28 19:57:02 +08:00
1 parent c6ef595a8e
commit 2db8549818
13 files changed
+626 -225

No files matched your search

+53 -3
View File
@@ -90,6 +90,10 @@ const subjects = computed(() => result.value?.subjectCandidates ?? [])
const forms = computed(() => result.value?.subjectForms ?? [])
const plans = computed(() => result.value?.storyboardPlans ?? [])
const shots = computed(() => result.value?.storyboardEpisodeShots ?? [])
/** 主体、分镜及任务记录构成已有结果,搜索筛选不影响是否存在数据。 */
const hasBreakdownResults = computed(
() => !!(subjects.value.length || plans.value.length || shots.value.length || snapshot.value?.tasks?.length)
)
const summary = computed(() => snapshot.value?.taskSummary)
/** 候选审核读取完成前不展示旧错误。 */
const validation = computed(() =>
@@ -554,11 +558,24 @@ const rules = {
groupSize: integerRule('每组集数'),
modules: fieldRule(value => Array.isArray(value) && value.length > 0, '请至少选择一个抽取模块', true)
}
/** 首次空页面收起重复工具栏;存在任务、历史记录或读取错误时继续显示真实状态。 */
const isInitialEmpty = computed(
() =>
!hasBreakdownResults.value &&
!records.value.length &&
!backgroundExecution.query.data.value &&
!backgroundExecution.active.value &&
!backgroundExecution.discovering.value &&
!backgroundExecution.discoveryError.value &&
!backgroundExecution.query.error.value &&
!operation.value.pending &&
!error.value
)
</script>
<template>
<!-- 以下是手机完成提示自然滚走、分类导航与设置入口吸顶的拆解工作区 -->
<WorkspacePage split compact mobile-scroll class="breakdown-workspace-page">
<WorkspacePage split compact mobile-scroll class="breakdown-workspace-page" :header-visible="!isInitialEmpty">
<template #header>
<!-- 以下是拆解状态与设置 -->
<div class="workspace-toolbar">
@@ -868,7 +885,7 @@ const rules = {
<p v-if="sourceLabel" class="text-xs text-muted" role="status">
{{ sourceLabel }}<span v-if="quality.loading"> · 正在读取当前质量审核…</span>
</p>
<div class="result-toolbar tabs-toolbar">
<div v-if="!isInitialEmpty" class="result-toolbar tabs-toolbar">
<NTabs v-model:value="tab" class="workspace-tabs" type="line" size="small" aria-label="拆解结果"
><!-- 以下是仅显示分类名称的拆解标签模块,主体数量保留在搜索统计中 -->
<NTab v-for="option in moduleOptions" :key="option.value" :name="option.value">{{
@@ -918,8 +935,30 @@ const rules = {
</div>
<div class="breakdown-content panel">
<main class="min-w-0 min-h-0 overflow-hidden">
<!-- 以下是首次无任务空页面的居中入口,已有任务时恢复原分类内容 -->
<NScrollbar
v-if="isInitialEmpty"
class="panel-scroll breakdown-results-scroll"
content-class="breakdown-empty-scroll-content"
>
<EmptyState
class="breakdown-initial-empty"
title="还没有拆解结果"
description="点击“拆解设置”,选择需要的模块和分组,预览后再确认生成。"
>
<NButton
type="primary"
aria-label="拆解设置"
aria-haspopup="dialog"
:aria-expanded="toolsOpen"
@click="toolsOpen = true"
><template #icon><Settings2 :size="16" aria-hidden="true" /></template
>拆解设置</NButton
>
</EmptyState>
</NScrollbar>
<!-- 所有结果标签共用有界的内容滚动;切换标签回到顶部,不继承上一列表的位置。 -->
<NScrollbar :key="tab" class="panel-scroll breakdown-results-scroll">
<NScrollbar v-else :key="tab" class="panel-scroll breakdown-results-scroll">
<template v-for="option in moduleOptions" :key="option.value"
><div v-if="tab === option.value" class="breakdown-result-pad">
<SubjectList
@@ -1213,6 +1252,13 @@ const rules = {
.breakdown-results-scroll .n-scrollbar-content {
@apply wrap-anywhere;
}
/* 空数据引导使用正文剩余高度居中,短视口仍由原有滚动容器承接。 */
.breakdown-empty-scroll-content {
min-height: 100%;
display: flex;
flex-direction: column;
justify-content: center;
}
.breakdown-result-pad {
/* 条目保留自身背景和内边距,外层不再重复缩进搜索和结果。 */
@apply p-0;
@@ -1283,6 +1329,10 @@ const rules = {
max-height: none;
overflow: visible;
}
/* 手机正文自然滚动,同时为首次操作保留清晰的居中区域。 */
.breakdown-empty-scroll-content {
min-height: min(55dvh, 420px);
}
}
@media (max-width: 800px) {
.breakdown-workspace-page .workspace-toolbar {