feat: 同步动作与首帧编辑能力并统一工作区反馈

接入动作时间轴、密度审计、人工视线目标和后台首帧编辑;独立读取已保存提示词,并在首帧晋升前重新核对持久化质量状态。
统一 NMessage 结果反馈、局部 loading 和业务说明间距,保留真实长任务进度与部分失败语义。
验证:pnpm check(49 个文件、393 项测试)、pnpm build;当前环境无法完成 localhost 浏览器验收及真实后端联调。
This commit is contained in:
GouJ committed 2026-10-12 20:05:03 +08:00
1 parent 83482a70c5
commit 7a60db3ced
76 files changed
+2485 -457

No files matched your search

+8 -28
View File
@@ -1,8 +1,9 @@
<script setup lang="ts">
import ContextNotice from '../../components/ui/ContextNotice.vue'
import { computed, h, inject, onScopeDispose, provide, ref, watch, watchEffect } from 'vue'
import { useRoute, useRouter } from 'vue-router'
import { NScrollbar, NAlert, NButton, NPageHeader, NSpin, NEllipsis } from 'naive-ui'
import type { MessageReactive } from 'naive-ui'
import { NScrollbar, NButton, NPageHeader, NSpin, NEllipsis } from 'naive-ui'
import { EmptyState } from '../../components/ui'
import { projectContextKey, useProjectData } from './context'
import { getOperation } from '../workflows/operations'
@@ -155,34 +156,11 @@ const operationGuide = computed<OperationGuide | null>(() => {
/** 操作结果只在当前项目收到新响应后通知,不在进入工作区时重放旧提示。 */
const actionMessage = useActionMessage()
/** 当前请求的加载消息,完成或离开工作区后销毁。 */
let pendingMessage: MessageReactive | null = null
/** 新操作用短消息反馈,页面切换不重放后台任务提示。 */
watch(
() => [id.value, currentSection.value, operation.value.pending, operation.value.label] as const,
([projectId, section, pending, label], [previousId, previousSection, previousPending, previousLabel]) => {
pendingMessage?.destroy()
pendingMessage = null
if (projectId !== previousId || section !== previousSection || !pending) return
if (previousPending && label === previousLabel) return
pendingMessage =
actionMessage?.loading(`${label || '后台任务执行中'},请稍候…`, {
duration: section === 'subject-identity' ? 0 : 4000,
closable: true
}) ?? null
}
)
/** 关闭页面时清理未完成请求的加载消息。 */
onScopeDispose(() => pendingMessage?.destroy())
/** 只通知仍在当前项目的真实新结果,不把任务提交当作素材生成完成。 */
watch(
() => [id.value, operation.value.error, operation.value.notice] as const,
([projectId, error, notice], [previousProject, previousError, previousNotice]) => {
if (projectId !== previousProject) return
if ((error && error !== previousError) || (notice && notice !== previousNotice)) {
pendingMessage?.destroy()
pendingMessage = null
}
if (error && error !== previousError) {
const guide = operationGuide.value
const content =
@@ -220,7 +198,9 @@ watch(
actionMessage?.success('身份文本已生成并保存。', { duration: 3000, closable: true })
else if (operation.value.label === '保存主体身份')
actionMessage?.success('主体身份已保存。', { duration: 3000, closable: true })
else if (/生成|提交/.test(operation.value.label))
else if (/刷新|读取|查询|预览/.test(operation.value.label)) {
// 成功的只读刷新由当前位置恢复内容反馈,不额外弹成功消息。
} else if (/生成|提交/.test(operation.value.label))
actionMessage?.info('任务已提交,完成后会显示结果。', { duration: 4000 })
else actionMessage?.success('操作已完成。', { duration: 3000 })
// 身份页已消费的反馈立即清除,切换主体或其它工作区都不会遗留旧横幅。
@@ -284,11 +264,11 @@ onScopeDispose(() => {
</NPageHeader>
</header>
<NScrollbar v-if="context.error.value" class="project-notices" content-class="project-notices-content">
<NAlert v-if="context.error.value" type="error" :show-icon="false"
<ContextNotice v-if="context.error.value" type="error" :show-icon="false"
>{{ context.error.value }}<span v-if="context.project.value"> 当前保留上次成功读取的数据。</span>
<NButton text class="ml-3" :loading="context.loading.value" @click="context.refresh"
>重试读取</NButton
></NAlert
></ContextNotice
>
</NScrollbar>
<!-- 以下是当前项目图片与视频配置弹窗模块 -->
+4 -3
View File
@@ -1,8 +1,9 @@
<script setup lang="ts">
import ContextNotice from '../../components/ui/ContextNotice.vue'
import { computed, h, nextTick, ref, watch } from 'vue'
import { RouterLink, useRouter } from 'vue-router'
import {
NAlert,
NButton,
NDataTable,
NInput,
@@ -176,8 +177,8 @@ function clearFilters() {
</div>
</div>
</template>
<NAlert v-if="query.error.value" type="error" :show-icon="false"
>{{ query.error.value }}<NButton text class="ml-3" @click="query.refresh">重新连接</NButton></NAlert
<ContextNotice v-if="query.error.value" type="error" :show-icon="false"
>{{ query.error.value }}<NButton text class="ml-3" @click="query.refresh">重新连接</NButton></ContextNotice
>
<EditProjectDialog v-model:open="editOpen" :project="managedProject" @changed="query.refresh" />
<DeleteProjectDialog v-model:open="deleteOpen" :project="managedProject" @deleted="query.refresh" />
@@ -1,8 +1,10 @@
<script setup lang="ts">
import FeedbackMessage from '../../../components/ui/FeedbackMessage.vue'
import AppForm from '../../../components/ui/AppForm.vue'
import { NFormItem } from 'naive-ui'
import { requiredTextRule, integerRule } from '../../../lib/form-rules'
import { NAlert, NButton, NInput, NInputNumber } from 'naive-ui'
import { NButton, NInput, NInputNumber } from 'naive-ui'
import { reactive, ref } from 'vue'
import { ArrowRight, LoaderCircle, Plus } from '@lucide/vue'
import { AppDialog } from '../../../components/ui'
@@ -118,7 +120,7 @@ const rules = {
<p class="text-xs leading-5 text-muted">
建议先用 1 集验证生成效果。生成会实际调用后端模型,产生相应费用。
</p>
<NAlert v-if="error" role="alert" type="error" :show-icon="false" class=" ">{{ error }}</NAlert>
<FeedbackMessage v-if="error" :message="error" />
</AppForm>
<template #footer>
<NButton :disabled="busy" @click="open = false">取消</NButton>
@@ -1,6 +1,10 @@
<script setup lang="ts">
import FeedbackMessage from '../../../components/ui/FeedbackMessage.vue'
import ContextNotice from '../../../components/ui/ContextNotice.vue'
import { computed, reactive, ref, watch } from 'vue'
import { NAlert, NButton, NInput } from 'naive-ui'
import { NButton, NInput } from 'naive-ui'
import { AppDialog } from '../../../components/ui'
import { errorMessage } from '../../../lib/http'
import { projectsApi } from '../api'
@@ -52,17 +56,19 @@ async function remove() {
</script>
<template>
<AppDialog v-model:open="open" :title="`永久删除 · ${expected}`" description="删除后无法恢复。">
<NAlert type="error" :show-icon="false" class="mt-4">
<ContextNotice type="error" :show-icon="false" class="mt-4">
会永久删除剧本、主体、身份、形态、分镜、首帧、视频、工作流记录,以及本地 Storage
中属于该项目的图片、视频和上传素材。
</NAlert>
<NAlert v-if="readinessPending" type="info" :show-icon="false" class="mt-3">正在检查项目后台任务…</NAlert>
<NAlert v-else-if="readiness && !readiness.canDelete" type="warning" :show-icon="false" class="mt-3">
</ContextNotice>
<ContextNotice v-if="readinessPending" type="info" :show-icon="false" class="mt-3"
>正在检查项目后台任务…</ContextNotice
>
<ContextNotice v-else-if="readiness && !readiness.canDelete" type="warning" :show-icon="false" class="mt-3">
当前有
{{ readiness.totalActiveTasks }}
个后台任务正在执行,暂不能删除。请等待图片、首帧、视频或工作流任务结束后再试。
</NAlert>
<NAlert v-if="state.error" type="error" :show-icon="false" class="mt-3">{{ state.error }}</NAlert>
</ContextNotice>
<FeedbackMessage v-if="state.error" :message="state.error" />
<p class="mt-5 text-xs">
请输入 <strong>{{ expected }}</strong> 确认删除:
</p>
@@ -1,12 +1,14 @@
<script setup lang="ts">
import FeedbackMessage from '../../../components/ui/FeedbackMessage.vue'
import { computed, reactive, watch } from 'vue'
import { NAlert, NButton, NInput } from 'naive-ui'
import { NButton, NInput } from 'naive-ui'
import { AppDialog } from '../../../components/ui'
import { errorMessage } from '../../../lib/http'
import { projectsApi } from '../api'
import type { Project } from '../types'
/** 编辑项目基础信息;不会触发已有剧本或 Production 资产重生成。 */
/** 编辑项目基础信息;不会触发已有剧本或制作资产重生成。 */
const props = defineProps<{ project: Project | null }>()
const open = defineModel<boolean>('open', { default: false })
const emit = defineEmits<{ changed: [] }>()
@@ -61,9 +63,9 @@ async function save() {
<AppDialog
v-model:open="open"
:title="`编辑项目 · ${project?.title || project?.topic || ''}`"
description="仅更新项目基础信息,不自动重生成剧本或 Production 资产。"
description="仅更新项目基础信息,不自动重生成剧本或制作资产。"
>
<NAlert v-if="state.error" type="error" :show-icon="false" class="mt-4">{{ state.error }}</NAlert>
<FeedbackMessage v-if="state.error" :message="state.error" />
<section class="dialog-form-stack">
<label class="block text-xs">项目名称<NInput v-model:value="form.title" class="mt-2" /></label>
<label class="block text-xs"