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>
<!-- 以下是当前项目图片与视频配置弹窗模块 -->