fix(short-drama-agent-front): 修正分镜诊断状态与响应式布局
This commit is contained in:
1 parent
1da56e0d46
commit
b34dc02e39
23 files changed
+796
-273
No files matched your search
@@ -1,10 +1,11 @@
|
||||
<script setup lang="ts">
|
||||
import ContextNotice from '../../components/ui/ContextNotice.vue'
|
||||
import WorkspaceActionTooltip from '../../components/ui/WorkspaceActionTooltip.vue'
|
||||
|
||||
import { computed, h, inject, onScopeDispose, provide, ref, watch, watchEffect } from 'vue'
|
||||
import { useRoute, useRouter } from 'vue-router'
|
||||
import { Settings2 } from '@lucide/vue'
|
||||
import { NScrollbar, NButton, NPageHeader, NSpin, NEllipsis } from 'naive-ui'
|
||||
import { NScrollbar, NButton, NPageHeader, NSpin, NEllipsis, NSkeleton } from 'naive-ui'
|
||||
import { EmptyState, WorkspaceRefreshButton } from '../../components/ui'
|
||||
import { projectContextKey, useProjectData } from './context'
|
||||
import { getOperation, operationErrorText } from '../workflows/operations'
|
||||
@@ -256,20 +257,29 @@ onScopeDispose(() => {
|
||||
<template>
|
||||
<section class="project-frame">
|
||||
<header class="project-header">
|
||||
<!-- 以下是项目标题与全局配置入口模块,读取完成前标题留空 -->
|
||||
<!-- 以下是项目标题与全局配置入口模块,首次读取保留标题及两个操作的真实占位 -->
|
||||
<NPageHeader @back="router.push('/projects')">
|
||||
<template #title>
|
||||
<NEllipsis class="project-title" :tooltip="false">{{
|
||||
<div v-if="isProjectInitialLoading" class="project-title project-title-loading" aria-hidden="true"><NSkeleton :height="16" /></div>
|
||||
<NEllipsis v-else class="project-title" :tooltip="false">{{
|
||||
context.project.value?.title || context.project.value?.topic || ''
|
||||
}}</NEllipsis>
|
||||
</template>
|
||||
<template #extra>
|
||||
<!-- 以下是制作前检查入口,后续页面受限时仍可完成正式分镜审核 -->
|
||||
<div class="flex items-center gap-2">
|
||||
<StoryboardPreparation v-if="context.project.value?.id === id" :key="id" :project-id="id" :disabled="!!context.error.value" @changed="context.refresh()" />
|
||||
<NButton class="workspace-action-button" size="small" aria-label="项目配置" title="项目配置" :disabled="!context.project.value" @click="settingsOpen = true"
|
||||
><template #icon><Settings2 :size="15" aria-hidden="true" /></template><span class="project-config-label">项目配置</span></NButton
|
||||
>
|
||||
<div class="project-header-actions flex items-center gap-2">
|
||||
<template v-if="isProjectInitialLoading">
|
||||
<NSkeleton class="project-header-action-placeholder" aria-hidden="true" />
|
||||
<NSkeleton class="project-header-action-placeholder project-header-config-placeholder" aria-hidden="true" />
|
||||
</template>
|
||||
<template v-else>
|
||||
<StoryboardPreparation v-if="context.project.value?.id === id" :key="id" :project-id="id" :disabled="!!context.error.value" @changed="context.refresh()" />
|
||||
<WorkspaceActionTooltip label="项目配置" mobile-only>
|
||||
<NButton class="workspace-action-button" size="small" aria-label="项目配置" :disabled="!context.project.value" @click="settingsOpen = true"
|
||||
><template #icon><Settings2 :size="15" aria-hidden="true" /></template><span class="project-config-label">项目配置</span></NButton
|
||||
>
|
||||
</WorkspaceActionTooltip>
|
||||
</template>
|
||||
</div>
|
||||
</template>
|
||||
</NPageHeader>
|
||||
@@ -348,6 +358,21 @@ onScopeDispose(() => {
|
||||
.project-title {
|
||||
@apply block max-w-full text-base font-semibold leading-normal;
|
||||
}
|
||||
/* 首次读取只显示装饰性骨架,不展示未知项目名称或可点击的设置入口。 */
|
||||
.project-title-loading {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
width: min(128px, 30vw);
|
||||
min-height: 1.5em;
|
||||
}
|
||||
.project-header-action-placeholder {
|
||||
width: 120px;
|
||||
height: 34px;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
.project-header-config-placeholder {
|
||||
width: 104px;
|
||||
}
|
||||
.project-notices.n-scrollbar {
|
||||
@apply shrink-0 h-auto max-h-[min(24dvh,160px)] overflow-hidden;
|
||||
}
|
||||
@@ -382,6 +407,33 @@ onScopeDispose(() => {
|
||||
@apply items-start flex-col gap-2;
|
||||
}
|
||||
}
|
||||
/* 手机端隐藏文字后,两个项目入口共用方形点击区域并将图标居中。 */
|
||||
@media (max-width: 639px) {
|
||||
.project-frame {
|
||||
/* 顶部入口与标签栏图标共用紧凑尺寸。 */
|
||||
--app-toolbar-icon-size: 32px;
|
||||
}
|
||||
.project-header-actions > .n-button.workspace-action-button {
|
||||
width: var(--app-toolbar-icon-size);
|
||||
min-width: var(--app-toolbar-icon-size);
|
||||
height: var(--app-toolbar-icon-size);
|
||||
min-height: var(--app-toolbar-icon-size);
|
||||
padding: 0;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
.project-header-action-placeholder {
|
||||
width: var(--app-toolbar-icon-size);
|
||||
height: var(--app-toolbar-icon-size);
|
||||
}
|
||||
.project-header-actions > .n-button .n-button__icon {
|
||||
margin: 0;
|
||||
}
|
||||
}
|
||||
@media (prefers-reduced-motion: reduce) {
|
||||
.project-header .n-skeleton {
|
||||
animation: none;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
<style scoped>
|
||||
|
||||
Reference in new issue
Block a user