feat(short-drama-agent-front): 接入空间母版恢复与修订
This commit is contained in:
1 parent
c808a58a3f
commit
7e149a10c0
18 files changed
+2732
-12
No files matched your search
@@ -0,0 +1,149 @@
|
||||
<script setup lang="ts">
|
||||
import { formatDate } from '../../../lib/format'
|
||||
import { computed } from 'vue'
|
||||
import { NButton, NCheckbox, NCollapse, NCollapseItem, NInput, NSelect } from 'naive-ui'
|
||||
import { AssetImage } from '../../../components/ui'
|
||||
import WorkspaceSectionHeading from '../../../components/ui/WorkspaceSectionHeading.vue'
|
||||
import GenerationModelControls from '../../generation-config/components/GenerationModelControls.vue'
|
||||
import ImageGenerationPreview from '../../subject-images/components/ImageGenerationPreview.vue'
|
||||
import { useMasterGeneration } from '../useMasterGeneration'
|
||||
import type { MasterGenerationReceipt, SceneMaster, SpatialLayout } from '../types'
|
||||
|
||||
/** 正式母版免费预检与单次生成表单,主要操作由抽屉固定底栏提供。 */
|
||||
const props = defineProps<{
|
||||
/** 当前项目。 */ projectId: string
|
||||
/** 当前正式布局。 */ layout: SpatialLayout
|
||||
/** 保留的历史及草稿资产。 */ masters: SceneMaster[]
|
||||
/** 上游任务或活动任务锁。 */ disabled: boolean
|
||||
}>()
|
||||
/** 生成只登记草稿,来源冲突只通知刷新。 */
|
||||
const emit = defineEmits<{ generated: [receipt: MasterGenerationReceipt]; stale: [] }>()
|
||||
const form = useMasterGeneration(
|
||||
props,
|
||||
receipt => emit('generated', receipt),
|
||||
() => emit('stale')
|
||||
)
|
||||
/** 固定底栏共用同一套生成门禁。 */
|
||||
defineExpose({
|
||||
canSubmit: form.canSubmit,
|
||||
submitting: form.submitting,
|
||||
acknowledged: form.acknowledged,
|
||||
submit: form.submit
|
||||
})
|
||||
/** 选项明确区分旧版确认图和当前草稿,用户自定义名称不翻译。 */
|
||||
const options = computed(() =>
|
||||
form.references.value.map(master => ({
|
||||
value: master.id,
|
||||
label: `${master.status === 'draft' ? '当前草稿' : master.spatialLayoutVersion === props.layout.version ? '当前版本已确认参考' : '历史版本已确认参考'} · ${master.subjectFormId ? '形态专属机位' : '全局布局'} · ${formatDate(master.createdAt)}`
|
||||
}))
|
||||
)
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<!-- 以下是同布局的历史原件选择与显式图片修订,不改变正式布局 -->
|
||||
<section class="space-y-4">
|
||||
<WorkspaceSectionHeading
|
||||
title="历史母版恢复与图片修订"
|
||||
description="历史母版仅作参考;当前版本草稿须填写明确修订要求。生成结果仍是草稿,不会自动确认。"
|
||||
/>
|
||||
<NCheckbox v-model:checked="form.revisionMode.value" :disabled="form.submitting.value"
|
||||
>显式修订参考图片</NCheckbox
|
||||
>
|
||||
<NSelect
|
||||
v-model:value="form.referenceId.value"
|
||||
:options="options"
|
||||
clearable
|
||||
:disabled="form.submitting.value"
|
||||
aria-label="母版历史参考"
|
||||
placeholder="选择已有母版;留空时使用正式共享参考"
|
||||
/>
|
||||
<section v-if="form.selectedReference.value" class="space-y-2">
|
||||
<AssetImage
|
||||
class="max-w-sm aspect-square"
|
||||
:src="form.selectedReference.value.imageUrl"
|
||||
alt="本次选中的母版原始图片"
|
||||
preview
|
||||
object-fit="contain"
|
||||
/>
|
||||
<p class="wrap-anywhere text-xs text-muted">
|
||||
参考母版:{{ form.selectedReference.value.id }} · 原版本:{{
|
||||
form.selectedReference.value.spatialLayoutVersion
|
||||
}}
|
||||
</p>
|
||||
<p class="text-sm">
|
||||
{{
|
||||
form.selectedReference.value.status === 'draft'
|
||||
? '待修订草稿,尚未确认'
|
||||
: '历史确认图,仅作本次恢复参考'
|
||||
}}
|
||||
</p>
|
||||
</section>
|
||||
<NInput
|
||||
v-if="form.revisionMode.value"
|
||||
v-model:value="form.instruction.value"
|
||||
type="textarea"
|
||||
:maxlength="2000"
|
||||
:disabled="form.submitting.value"
|
||||
placeholder="填写本次限定图片修订;其余结构沿用参考"
|
||||
:input-props="{ 'aria-label': '母版修订要求' }"
|
||||
/>
|
||||
<!-- 以下是复用现有真实模型目录和本次参数的控件模块 -->
|
||||
<GenerationModelControls
|
||||
v-if="form.config.data.value?.profile"
|
||||
v-model:provider="form.provider.value"
|
||||
v-model:options="form.options.value"
|
||||
type="image"
|
||||
:catalog="form.config.data.value.catalog"
|
||||
:aspect-ratio="form.config.data.value.profile.aspectRatio"
|
||||
:disabled="form.submitting.value"
|
||||
/>
|
||||
<p v-else class="text-sm text-muted">
|
||||
{{ form.config.loading.value ? '正在读取项目图片模型配置…' : '请先保存有效的项目图片模型配置。' }}
|
||||
</p>
|
||||
<NButton
|
||||
:loading="form.loading.value"
|
||||
:disabled="!form.valid.value || form.submitting.value"
|
||||
@click="form.loadPreview"
|
||||
>免费预检母版输入</NButton
|
||||
>
|
||||
<!-- 以下是实际 Prompt、参数、原始参考和版本指纹,只展示最终输入 -->
|
||||
<ImageGenerationPreview
|
||||
:preview="form.preview.value"
|
||||
:loading="form.loading.value"
|
||||
display-only
|
||||
error=""
|
||||
stale-notice=""
|
||||
/>
|
||||
<section v-if="form.preview.value" class="space-y-2 text-sm">
|
||||
<p>预计费用:预检接口未提供报价,请在提交前核对所选模型报价;本次仅生成 1 张图片,可能收费。</p>
|
||||
<p>
|
||||
已核对 {{ form.preview.value.preflight.verifiedSceneCount }} 个场景,实际参考
|
||||
{{ form.preview.value.preflight.referenceCount }} 张。
|
||||
</p>
|
||||
<NCollapse
|
||||
><NCollapseItem name="reference-evidence" title="参考图摘要与预览指纹"
|
||||
><p class="wrap-anywhere text-xs">预览指纹:{{ form.preview.value.previewFingerprint }}</p>
|
||||
<dl
|
||||
v-for="reference in form.preview.value.preflight.references"
|
||||
:key="reference.imageId"
|
||||
class="mt-3 space-y-1 wrap-anywhere text-xs text-muted"
|
||||
>
|
||||
<div>参考编号:{{ reference.imageId }}</div>
|
||||
<div>角色:{{ reference.role === 'layout-master' ? '布局母版参考' : '共享主体身份参考' }}</div>
|
||||
<div v-if="reference.sourceMasterStatus">
|
||||
原状态:{{ reference.sourceMasterStatus === 'draft' ? '待修订草稿' : '历史已确认' }}
|
||||
</div>
|
||||
<div v-if="reference.sourceLayoutVersion">原布局版本:{{ reference.sourceLayoutVersion }}</div>
|
||||
<div v-if="reference.sha256">原件摘要:{{ reference.sha256 }}</div>
|
||||
</dl></NCollapseItem
|
||||
></NCollapse
|
||||
>
|
||||
</section>
|
||||
<p v-if="form.recoveryNotice.value" class="text-sm text-muted" role="status">
|
||||
{{ form.recoveryNotice.value }}只读刷新任务记录,不要再次生图。
|
||||
</p>
|
||||
<p v-if="form.submitting.value" class="text-sm text-muted" role="status">
|
||||
正在生成一张母版草稿,请勿重复提交。
|
||||
</p>
|
||||
</section>
|
||||
</template>
|
||||
@@ -0,0 +1,192 @@
|
||||
<script setup lang="ts">
|
||||
import { computed } from 'vue'
|
||||
import { NButton, NCollapse, NCollapseItem } from 'naive-ui'
|
||||
import { AssetImage } from '../../../components/ui'
|
||||
import WorkspaceSectionHeading from '../../../components/ui/WorkspaceSectionHeading.vue'
|
||||
import { useQuery } from '../../../composables/useQuery'
|
||||
import { userFacingText } from '../../../lib/user-facing-text'
|
||||
import { impactVisionLabel } from '../model'
|
||||
import { spatialMasterApi } from '../api'
|
||||
|
||||
/** 来源影响只在所属标签被打开后读取,原件可读不等于来源当前。 */
|
||||
const props = defineProps<{
|
||||
/** 当前项目。 */ projectId: string
|
||||
/** 当前布局。 */ layoutId: string
|
||||
}>()
|
||||
/** 项目与布局共同构成查询身份。 */
|
||||
const key = computed(() => JSON.stringify([props.projectId, props.layoutId]))
|
||||
/** 正式只读影响分析,不创建修复任务或清除 Primary。 */
|
||||
const query = useQuery(key, async (value, signal) => {
|
||||
const [projectId, layoutId] = JSON.parse(value) as [string, string]
|
||||
const result = await spatialMasterApi.impact(projectId, layoutId, signal)
|
||||
if (result.projectId !== projectId || result.layoutId !== layoutId) throw new Error('来源影响与当前布局不匹配。')
|
||||
return result
|
||||
})
|
||||
/** 原件证据与旧审核的字节关系。 */
|
||||
const imageLabels = {
|
||||
matches_review: '原件与原审核一致',
|
||||
readable_unbound: '原件可读,缺少审核字节绑定',
|
||||
changed: '原件与原审核不一致',
|
||||
unavailable: '原件不可读取'
|
||||
}
|
||||
/** 来源当前性不由像素完整推断。 */
|
||||
const sourceLabels = {
|
||||
current: '来源当前',
|
||||
layout_version_changed: '布局版本已变化',
|
||||
stale_or_unverified: '来源过期或未核实',
|
||||
unknown: '来源当前性待核验'
|
||||
}
|
||||
/** 汇总按正式结果显示,不在客户端估算待重生数量。 */
|
||||
const summaries = computed(() =>
|
||||
query.data.value
|
||||
? [
|
||||
['关联镜头', query.data.value.summary.affectedShots],
|
||||
['历史主图镜头', query.data.value.summary.primaryShots],
|
||||
['历史候选', query.data.value.summary.candidateCount],
|
||||
['主图待重新核验', query.data.value.summary.primaryRevalidationShots],
|
||||
['无首帧镜头', query.data.value.summary.shotsWithoutAssets]
|
||||
]
|
||||
: []
|
||||
)
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<!-- 以下是布局当前母版及真实恢复范围,不将图片完整性当来源有效 -->
|
||||
<section class="space-y-4">
|
||||
<WorkspaceSectionHeading
|
||||
title="母版恢复与来源影响"
|
||||
description="图片原件有效 ≠ 来源当前有效。历史主图和旧审核保留,来源变化不等于图片损坏。"
|
||||
><template #actions
|
||||
><NButton :loading="query.loading.value" @click="query.refresh">重新读取影响</NButton></template
|
||||
></WorkspaceSectionHeading
|
||||
>
|
||||
<p v-if="query.loading.value && !query.data.value" class="text-sm text-muted" role="status">
|
||||
正在逐项核对图片原件与来源…
|
||||
</p>
|
||||
<p v-if="query.error.value" class="text-sm text-muted">{{ query.error.value }}</p>
|
||||
<template v-if="query.data.value">
|
||||
<p class="wrap-anywhere text-xs text-muted">当前布局版本:{{ query.data.value.layoutVersion }}</p>
|
||||
<p class="text-sm">
|
||||
当前母版:{{
|
||||
query.data.value.currentMaster
|
||||
? '当前版本已人工确认;机器结论请在母版审核中另行核对'
|
||||
: '暂无当前版本已确认母版'
|
||||
}}
|
||||
</p>
|
||||
<AssetImage
|
||||
v-if="query.data.value.currentMaster"
|
||||
class="max-w-sm"
|
||||
:src="query.data.value.currentMaster.imageUrl"
|
||||
alt="当前布局母版"
|
||||
object-fit="contain"
|
||||
preview
|
||||
/>
|
||||
<dl class="grid gap-4 sm:grid-cols-3 lg:grid-cols-5">
|
||||
<div v-for="[label, count] in summaries" :key="label">
|
||||
<dt class="text-xs text-muted">{{ label }}</dt>
|
||||
<dd class="mt-1 text-lg font-semibold">{{ count }}</dd>
|
||||
</div>
|
||||
</dl>
|
||||
<p class="text-sm text-muted">
|
||||
是否重新生图须结合画面证据判断;此处仅列出需核验资产,不安排批量重生或修改主图。
|
||||
</p>
|
||||
<!-- 以下是旧身份锚图和旧形态主图,原图可读与当前来源分别呈现 -->
|
||||
<NCollapse
|
||||
><NCollapseItem
|
||||
v-for="scene in query.data.value.assets"
|
||||
:key="scene.subjectId"
|
||||
:name="scene.subjectId"
|
||||
:title="`${scene.ref} ${scene.name} · 旧身份锚图与形态`"
|
||||
>
|
||||
<div class="grid gap-(--app-content-gap) sm:grid-cols-2 lg:grid-cols-3">
|
||||
<article v-for="anchor in scene.anchors" :key="anchor.id" class="space-y-2">
|
||||
<h4 class="text-sm font-medium">原身份锚图(Anchor)</h4>
|
||||
<AssetImage :src="anchor.imageUrl" alt="历史场景身份锚图" object-fit="contain" preview />
|
||||
<p class="text-sm">
|
||||
图片完整性:{{ anchor.fileStatus === 'readable' ? '原件可读取' : '原件不可读取' }}
|
||||
</p>
|
||||
<p class="text-sm text-muted">来源当前性:需重新核验;接口未给出当前通过结论。</p>
|
||||
</article>
|
||||
<template v-for="form in scene.forms" :key="form.id"
|
||||
><article v-for="image in form.primaryImages" :key="image.id" class="space-y-2">
|
||||
<h4 class="text-sm font-medium">原形态主图 · {{ form.name }}</h4>
|
||||
<AssetImage
|
||||
:src="image.imageUrl"
|
||||
:alt="`${form.name} 原形态主图`"
|
||||
object-fit="contain"
|
||||
preview
|
||||
/>
|
||||
<p class="text-sm">
|
||||
图片完整性:{{ image.fileStatus === 'readable' ? '原件可读取' : '原件不可读取' }}
|
||||
</p>
|
||||
<p class="text-sm">
|
||||
来源当前性:{{
|
||||
image.currentness.current
|
||||
? '当前有效'
|
||||
: userFacingText(image.currentness.reason, '来源待重新核验')
|
||||
}}
|
||||
</p>
|
||||
</article>
|
||||
<p v-if="!form.primaryImages.length" class="text-sm text-muted">
|
||||
{{ form.name }} 暂无原形态主图。
|
||||
</p></template
|
||||
>
|
||||
</div>
|
||||
</NCollapseItem></NCollapse
|
||||
>
|
||||
<!-- 以下是正式镜头历史 Primary 和候选,仅展示只读核验建议 -->
|
||||
<NCollapse
|
||||
><NCollapseItem
|
||||
v-for="shot in query.data.value.shots"
|
||||
:key="shot.shotId"
|
||||
:name="shot.shotId"
|
||||
:title="`第 ${shot.episodeNo} 集 · ${shot.beatNo}.${shot.shotNo} ${shot.title} · ${shot.primaryCount ? '有历史主图' : '无历史主图'}`"
|
||||
>
|
||||
<p v-if="!shot.candidates.length" class="text-sm text-muted">暂无首帧资产,不代表图片损坏。</p>
|
||||
<div class="grid gap-(--app-content-gap) sm:grid-cols-2 lg:grid-cols-3">
|
||||
<article v-for="candidate in shot.candidates" :key="candidate.id" class="space-y-2">
|
||||
<p class="font-medium text-sm">
|
||||
{{ candidate.isPrimary ? '历史主首帧(Primary)' : '历史候选' }} ·
|
||||
{{ candidate.action === 'retain' ? '可保留' : '需要重新核验' }}
|
||||
</p>
|
||||
<AssetImage
|
||||
:src="candidate.imageUrl"
|
||||
:style="{
|
||||
aspectRatio:
|
||||
candidate.width && candidate.height
|
||||
? `${candidate.width}/${candidate.height}`
|
||||
: '1/1'
|
||||
}"
|
||||
alt="历史镜头首帧"
|
||||
object-fit="contain"
|
||||
preview
|
||||
/>
|
||||
<p class="text-sm">图片完整性:{{ imageLabels[candidate.imageIntegrity] }}</p>
|
||||
<p class="text-sm">来源当前性:{{ sourceLabels[candidate.sourceStatus] }}</p>
|
||||
<p v-if="candidate.sourceReason" class="text-xs text-muted">
|
||||
{{ userFacingText(candidate.sourceReason) }}
|
||||
</p>
|
||||
<p v-if="candidate.latestVision" class="text-sm">
|
||||
{{ candidate.latestVision.historical ? '历史审核' : '当前审核' }}:{{
|
||||
impactVisionLabel(candidate.latestVision)
|
||||
}}{{ candidate.latestVision.historical ? ',不等于当前来源通过' : '' }}
|
||||
</p>
|
||||
<NCollapse
|
||||
><NCollapseItem name="evidence" title="高级来源详情"
|
||||
><p class="wrap-anywhere text-xs">
|
||||
候选编号:{{ candidate.id }} · 生成指纹:{{
|
||||
candidate.providerInputFingerprint || '未记录'
|
||||
}}
|
||||
</p>
|
||||
<pre class="whitespace-pre-wrap break-words text-xs">{{
|
||||
JSON.stringify(candidate.referenceEvidence, null, 2)
|
||||
}}</pre>
|
||||
</NCollapseItem></NCollapse
|
||||
>
|
||||
</article>
|
||||
</div>
|
||||
</NCollapseItem></NCollapse
|
||||
>
|
||||
</template>
|
||||
</section>
|
||||
</template>
|
||||
@@ -0,0 +1,301 @@
|
||||
<script setup lang="ts">
|
||||
import { computed, onScopeDispose, ref, watch } from 'vue'
|
||||
import { NCollapse, NCollapseItem, NInput, NSelect } from 'naive-ui'
|
||||
import { useQuery } from '../../../composables/useQuery'
|
||||
import { useActionMessage, showActionFeedback } from '../../../components/ui/useActionMessage'
|
||||
import WorkspaceSectionHeading from '../../../components/ui/WorkspaceSectionHeading.vue'
|
||||
import { ApiError } from '../../../lib/http'
|
||||
import { getOperation, runOperation } from '../../workflows/operations'
|
||||
import { imageRequestNotice, runGuardedImageRequest } from '../../subject-images/image-request-guard'
|
||||
import { spatialMasterApi } from '../api'
|
||||
import { masterReviewLabels } from '../model'
|
||||
import type { MasterHumanResult, SceneMaster, SpatialLayout } from '../types'
|
||||
|
||||
/** 当前母版的正式人工审核和独立 Vision,不把确认状态混成 AI 通过。 */
|
||||
const props = defineProps<{
|
||||
/** 正式项目。 */ projectId: string
|
||||
/** 当前布局版本。 */ layout: SpatialLayout
|
||||
/** 当前用户选中母版。 */ master: SceneMaster
|
||||
/** 上游活动任务或来源限制。 */ disabled: boolean
|
||||
}>()
|
||||
/** 只通知刷新来源,不自动生成后续素材。 */
|
||||
const emit = defineEmits<{ changed: []; stale: [] }>()
|
||||
/** 同一原件和版本的审核材料身份。 */
|
||||
const key = computed(() =>
|
||||
JSON.stringify([
|
||||
props.projectId,
|
||||
props.layout.id,
|
||||
props.master.id,
|
||||
props.layout.version,
|
||||
props.master.imageUrl,
|
||||
props.master.status
|
||||
])
|
||||
)
|
||||
/** 免费正式审核清单,切母版会中止旧请求。 */
|
||||
const query = useQuery(key, async (value, signal) => {
|
||||
const [projectId, layoutId, masterId] = JSON.parse(value) as string[]
|
||||
const result = await spatialMasterApi.review(projectId!, layoutId!, masterId!, signal)
|
||||
if (!result || result.masterId !== masterId || result.layoutId !== layoutId)
|
||||
throw new Error('审核材料与当前母版不匹配。')
|
||||
return result
|
||||
})
|
||||
/** 人工逐项结果,不能从 Vision 通过自动填成通过。 */
|
||||
const results = ref<MasterHumanResult[]>([])
|
||||
/** 人工总依据。 */
|
||||
const evidence = ref('')
|
||||
/** 真实确认人,打开不默认填充。 */
|
||||
const confirmedBy = ref('')
|
||||
/** 单独确认本次 Vision 可能收费。 */
|
||||
const visionAcknowledged = ref(false)
|
||||
/** 当前正式操作,本地加载不会误锁关闭。 */
|
||||
const pending = ref<'vision' | 'confirm' | null>(null)
|
||||
/** 未知 Vision 结果保留独立费用保护。 */
|
||||
const guardTarget = computed(
|
||||
() => `scene-layout-master-vision:${props.projectId}:${props.layout.id}:${props.master.id}`
|
||||
)
|
||||
/** 未知回执不可盲目重审。 */
|
||||
const recoveryNotice = computed(() => (pending.value ? '' : imageRequestNotice(guardTarget.value)))
|
||||
/** 四类状态分别展示,不把人工作为机器证据。 */
|
||||
const labels = computed(() => (query.data.value ? masterReviewLabels(query.data.value) : null))
|
||||
/** 当前原件和正式版本均允许发起操作。 */
|
||||
const current = computed(
|
||||
() =>
|
||||
!!query.data.value?.currentVersion &&
|
||||
query.data.value.layoutVersion === props.layout.version &&
|
||||
props.master.spatialLayoutVersion === props.layout.version &&
|
||||
query.data.value.imageUrl === props.master.imageUrl
|
||||
)
|
||||
/** 独立 Vision 不要求人工表单先填完,但必须单独确认费用。 */
|
||||
const canValidate = computed(
|
||||
() =>
|
||||
current.value &&
|
||||
props.master.status === 'draft' &&
|
||||
visionAcknowledged.value &&
|
||||
!props.disabled &&
|
||||
!pending.value &&
|
||||
!query.loading.value &&
|
||||
!query.error.value &&
|
||||
!recoveryNotice.value
|
||||
)
|
||||
/** 逐项人工证据完整后才能正式确认,Vision 不能代填。 */
|
||||
const canConfirm = computed(
|
||||
() =>
|
||||
current.value &&
|
||||
!!query.data.value?.canConfirm &&
|
||||
!!evidence.value.trim() &&
|
||||
!!confirmedBy.value.trim() &&
|
||||
results.value.length === query.data.value.checklist.length &&
|
||||
results.value.every(item => item.result === 'passed' && !!item.evidence.trim()) &&
|
||||
!props.disabled &&
|
||||
!pending.value &&
|
||||
!query.loading.value &&
|
||||
!query.error.value
|
||||
)
|
||||
/** 抽屉固定底栏复用同一门禁与局部 loading。 */
|
||||
defineExpose({ canValidate, canConfirm, visionAcknowledged, pending, validate, confirm, refresh: query.refresh })
|
||||
/** 短反馈统一走 NMessage。 */
|
||||
const message = useActionMessage()
|
||||
/** 卸载后忽略旧操作的结果。 */
|
||||
let disposed = false
|
||||
/** 离开并返回相同目标后,也拒绝旧预读结果提交。 */
|
||||
let cycle = 0
|
||||
onScopeDispose(() => {
|
||||
disposed = true
|
||||
})
|
||||
watch(
|
||||
key,
|
||||
() => {
|
||||
cycle++
|
||||
results.value = []
|
||||
evidence.value = ''
|
||||
confirmedBy.value = ''
|
||||
visionAcknowledged.value = false
|
||||
},
|
||||
{ flush: 'sync' }
|
||||
)
|
||||
watch(
|
||||
() => query.data.value,
|
||||
review => {
|
||||
if (!review) return
|
||||
if (results.value.length !== review.checklist.length)
|
||||
results.value = review.checklist.map(item => ({ index: item.index, result: 'needs_review', evidence: '' }))
|
||||
}
|
||||
)
|
||||
/**
|
||||
* 单独提交一次 Vision,回执只保存机器结论,不确认母版。
|
||||
* @returns 付费请求结算及只读刷新通知
|
||||
*/
|
||||
async function validate() {
|
||||
if (!canValidate.value) return
|
||||
const identity = key.value
|
||||
const requestCycle = cycle
|
||||
const projectId = props.projectId
|
||||
const layoutId = props.layout.id
|
||||
const masterId = props.master.id
|
||||
const target = guardTarget.value
|
||||
pending.value = 'vision'
|
||||
visionAcknowledged.value = false
|
||||
const ok = await runOperation(projectId, '空间母版 AI 视觉审核', async () => {
|
||||
const review = await spatialMasterApi.review(projectId, layoutId, masterId)
|
||||
if (
|
||||
disposed ||
|
||||
identity !== key.value ||
|
||||
requestCycle !== cycle ||
|
||||
!review.currentVersion ||
|
||||
review.status !== 'draft' ||
|
||||
review.layoutVersion !== props.layout.version
|
||||
)
|
||||
throw new Error('母版或布局已变化,本次未提交 AI 审核。')
|
||||
return runGuardedImageRequest(target, async () => {
|
||||
const receipt = await spatialMasterApi.validate(projectId, layoutId, masterId)
|
||||
if (
|
||||
!receipt ||
|
||||
receipt.masterId !== masterId ||
|
||||
receipt.layoutId !== layoutId ||
|
||||
typeof receipt.persisted !== 'boolean' ||
|
||||
typeof receipt.automatedVisionPassed !== 'boolean'
|
||||
)
|
||||
throw new Error('审核回执不完整,请只读刷新记录,勿重复审核。')
|
||||
return receipt
|
||||
})
|
||||
})
|
||||
pending.value = null
|
||||
if (disposed || identity !== key.value || requestCycle !== cycle) return
|
||||
if (ok) {
|
||||
showActionFeedback(message, 'AI 审核已结束,请查看独立机器结论;仍须人工逐项确认。', 'info')
|
||||
void query.refresh()
|
||||
emit('changed')
|
||||
} else {
|
||||
showActionFeedback(message, getOperation(projectId).error, 'error')
|
||||
void query.refresh()
|
||||
emit('stale')
|
||||
}
|
||||
}
|
||||
/**
|
||||
* 正式确认只发送当前人工逐项结果,版本变化时不自动套用新版。
|
||||
* @returns 人工确认完成通知
|
||||
*/
|
||||
async function confirm() {
|
||||
if (!canConfirm.value) return
|
||||
const identity = key.value
|
||||
const requestCycle = cycle
|
||||
const projectId = props.projectId
|
||||
const layoutId = props.layout.id
|
||||
const masterId = props.master.id
|
||||
const input = {
|
||||
expectedVersion: props.layout.version,
|
||||
evidence: evidence.value.trim(),
|
||||
confirmedBy: confirmedBy.value.trim(),
|
||||
reviewResults: results.value.map(item => ({ ...item, evidence: item.evidence.trim() }))
|
||||
}
|
||||
pending.value = 'confirm'
|
||||
const ok = await runOperation(projectId, '正式确认空间母版', async () => {
|
||||
const review = await spatialMasterApi.review(projectId, layoutId, masterId)
|
||||
if (disposed || identity !== key.value || requestCycle !== cycle) return
|
||||
if (!review.currentVersion || review.layoutVersion !== input.expectedVersion || !review.canConfirm)
|
||||
throw new ApiError('母版来源或状态已变化,请重新核对。', 409)
|
||||
const result = await spatialMasterApi.confirm(projectId, layoutId, masterId, input)
|
||||
if (
|
||||
result.id !== masterId ||
|
||||
result.projectId !== projectId ||
|
||||
result.spatialLayoutId !== layoutId ||
|
||||
result.status !== 'confirmed'
|
||||
)
|
||||
throw new Error('未取得正式确认回执,请刷新来源核对。')
|
||||
})
|
||||
pending.value = null
|
||||
if (disposed || identity !== key.value || requestCycle !== cycle) return
|
||||
if (ok) {
|
||||
showActionFeedback(message, '母版已人工确认,AI 原审核结论保持独立。请重新核对相关来源。', 'success')
|
||||
void query.refresh()
|
||||
emit('changed')
|
||||
} else {
|
||||
showActionFeedback(message, getOperation(projectId).error, 'error')
|
||||
emit('stale')
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<!-- 以下是独立的资产、人工、机器及来源状态模块 -->
|
||||
<section class="space-y-4">
|
||||
<WorkspaceSectionHeading
|
||||
title="母版质量与正式确认"
|
||||
description="人工确认不会代做 AI 审核;AI 通过也不会自动确认母版。"
|
||||
/>
|
||||
<p v-if="query.loading.value && !query.data.value" class="text-sm text-muted" role="status">
|
||||
正在读取审核清单…
|
||||
</p>
|
||||
<p v-if="query.error.value" class="text-sm text-muted">{{ query.error.value }}</p>
|
||||
<div v-if="labels" class="flex flex-wrap gap-x-6 gap-y-2 text-sm" role="status">
|
||||
<span>资产:{{ labels.asset }}</span
|
||||
><span>人工:{{ labels.human }}</span
|
||||
><span>机器:{{ labels.vision }}</span
|
||||
><span>来源:{{ current ? '当前版本' : '版本已变化,需重新核对' }}</span>
|
||||
</div>
|
||||
<template v-if="query.data.value">
|
||||
<p v-if="!query.data.value.currentVersion" class="text-sm text-muted">
|
||||
此图绑定旧布局版本,不能按当前版本确认或重新运行 AI 审核。可在恢复与修订中显式选择为历史参考。
|
||||
</p>
|
||||
<!-- 以下是原有逐项规则的人工核对表单,初始不默认通过 -->
|
||||
<section v-if="query.data.value.canConfirm && current" class="space-y-4">
|
||||
<div v-for="(item, index) in query.data.value.checklist" :key="item.index" class="space-y-2">
|
||||
<p class="text-sm font-medium">{{ item.index }}. {{ item.requirement }}</p>
|
||||
<p class="text-xs text-muted">验收依据:{{ item.acceptance }}</p>
|
||||
<NSelect
|
||||
v-if="results[index]"
|
||||
v-model:value="results[index]!.result"
|
||||
:disabled="disabled || !!pending"
|
||||
:aria-label="`第 ${item.index} 项人工结论`"
|
||||
:options="[
|
||||
{ label: '待核对', value: 'needs_review' },
|
||||
{ label: '通过', value: 'passed' },
|
||||
{ label: '未通过', value: 'failed' }
|
||||
]"
|
||||
/>
|
||||
<NInput
|
||||
v-if="results[index]"
|
||||
v-model:value="results[index]!.evidence"
|
||||
:disabled="disabled || !!pending"
|
||||
type="textarea"
|
||||
placeholder="填写本项实际看到的画面依据"
|
||||
:input-props="{ 'aria-label': `第 ${item.index} 项人工依据` }"
|
||||
/>
|
||||
</div>
|
||||
<NInput
|
||||
v-model:value="evidence"
|
||||
type="textarea"
|
||||
:disabled="disabled || !!pending"
|
||||
placeholder="填写本次人工确认的完整依据"
|
||||
:input-props="{ 'aria-label': '母版人工确认依据' }"
|
||||
/>
|
||||
<NInput
|
||||
v-model:value="confirmedBy"
|
||||
:disabled="disabled || !!pending"
|
||||
placeholder="填写真实确认人"
|
||||
:input-props="{ 'aria-label': '母版确认人' }"
|
||||
/>
|
||||
</section>
|
||||
<NCollapse v-if="query.data.value.humanReviewEvidence || query.data.value.automatedVisionReview"
|
||||
><NCollapseItem name="review-record" title="已有审核记录"
|
||||
><p v-if="query.data.value.humanReviewEvidence" class="whitespace-pre-wrap text-sm">
|
||||
{{ query.data.value.humanReviewEvidence.summary }}
|
||||
</p>
|
||||
<p
|
||||
v-for="item in query.data.value.humanReviewEvidence?.compositionReviews"
|
||||
:key="item.index"
|
||||
class="mt-2 text-sm"
|
||||
>
|
||||
第 {{ item.index }} 项:{{ item.evidence }}
|
||||
</p>
|
||||
<p v-if="typeof query.data.value.automatedVisionReview?.summary === 'string'" class="mt-2 text-sm">
|
||||
AI 摘要:{{ query.data.value.automatedVisionReview.summary }}
|
||||
</p></NCollapseItem
|
||||
></NCollapse
|
||||
>
|
||||
</template>
|
||||
<p v-if="recoveryNotice" class="text-sm text-muted" role="status">
|
||||
{{ recoveryNotice }}请读取已有审核记录,不要重复付费。
|
||||
</p>
|
||||
</section>
|
||||
</template>
|
||||
@@ -0,0 +1,366 @@
|
||||
<script setup lang="ts">
|
||||
import { computed, nextTick, ref, watch } from 'vue'
|
||||
import { NButton, NCheckbox, NCollapse, NCollapseItem, NTab, NTabs } from 'naive-ui'
|
||||
import AppDrawer from '../../../components/ui/AppDrawer.vue'
|
||||
import { AssetImage } from '../../../components/ui'
|
||||
import WorkspaceSectionHeading from '../../../components/ui/WorkspaceSectionHeading.vue'
|
||||
import { useActionMessage, showActionFeedback } from '../../../components/ui/useActionMessage'
|
||||
import { useQuery } from '../../../composables/useQuery'
|
||||
import { usePolling } from '../../../composables/usePolling'
|
||||
import { formatDate } from '../../../lib/format'
|
||||
import { getOperation } from '../../workflows/operations'
|
||||
import { spatialMasterApi } from '../api'
|
||||
import type { MasterGenerationReceipt } from '../types'
|
||||
import MasterGenerationForm from './MasterGenerationForm.vue'
|
||||
import MasterReviewForm from './MasterReviewForm.vue'
|
||||
import MasterRecoveryImpact from './MasterRecoveryImpact.vue'
|
||||
|
||||
/** 从原场景几何入口增量展开的正式母版管理,不另建生成或质量体系。 */
|
||||
const props = withDefaults(
|
||||
defineProps<{
|
||||
/** 当前项目。 */ projectId: string
|
||||
/** 用户从已有场景选择的布局。 */ layoutId: string
|
||||
/** 上游活动操作仅限制写入,读取仍可使用。 */ disabled?: boolean
|
||||
}>(),
|
||||
{ disabled: false }
|
||||
)
|
||||
/** 全屏内容级滚动,正式操作由固定底栏提供。 */
|
||||
const open = defineModel<boolean>('open', { default: false })
|
||||
/** 母版正式操作反馈沿用应用消息层。 */
|
||||
const message = useActionMessage()
|
||||
/** 正式资产变化后通知原图库只读刷新。 */
|
||||
const emit = defineEmits<{ changed: [] }>()
|
||||
/** 关闭时取消全部读取,切换项目/布局拒绝旧结果。 */
|
||||
const key = computed(() =>
|
||||
open.value && props.projectId && props.layoutId ? JSON.stringify([props.projectId, props.layoutId]) : ''
|
||||
)
|
||||
/** 当前真实布局、完整母版历史与正式已确认母版。 */
|
||||
const query = useQuery(key, async (value, signal) => {
|
||||
if (!value) return null
|
||||
const [projectId, layoutId] = JSON.parse(value) as [string, string]
|
||||
const [layouts, masters, confirmed] = await Promise.all([
|
||||
spatialMasterApi.layouts(projectId, signal),
|
||||
spatialMasterApi.masters(projectId, layoutId, signal),
|
||||
spatialMasterApi.confirmed(projectId, layoutId, signal)
|
||||
])
|
||||
const layout = layouts.find(item => item.id === layoutId)
|
||||
if (
|
||||
!layout ||
|
||||
(layout.projectId && layout.projectId !== projectId) ||
|
||||
masters.some(item => item.projectId !== projectId || item.spatialLayoutId !== layoutId) ||
|
||||
(confirmed &&
|
||||
(confirmed.projectId !== projectId ||
|
||||
confirmed.spatialLayoutId !== layoutId ||
|
||||
confirmed.spatialLayoutVersion !== layout.version ||
|
||||
confirmed.status !== 'confirmed'))
|
||||
)
|
||||
throw new Error('母版或布局与当前项目不匹配,请重新读取。')
|
||||
return { layout, masters, confirmed }
|
||||
})
|
||||
/** 后端为同步持久化母版任务,使用正式 GET 观察,不伪造 SSE 或百分比。 */
|
||||
const jobs = usePolling(
|
||||
key,
|
||||
async (value, signal) => {
|
||||
if (!value) return []
|
||||
const [projectId, layoutId] = JSON.parse(value) as [string, string]
|
||||
const rows = await spatialMasterApi.jobs(projectId, layoutId, signal)
|
||||
if (rows.some(item => item.projectId !== projectId || item.spatialLayoutId !== layoutId))
|
||||
throw new Error('任务记录与当前布局不匹配。')
|
||||
return rows
|
||||
},
|
||||
computed(() => (key.value ? 5000 : false))
|
||||
)
|
||||
/** 当前功能标签;未打开恢复影响时不发全布局检查。 */
|
||||
const tab = ref('masters')
|
||||
/** 用户主动查看审核时定位到对应表单,不让长图库挡住正文。 */
|
||||
const reviewSection = ref<HTMLElement | null>(null)
|
||||
/** 用户选择的正式母版;默认仅查看服务端当前记录。 */
|
||||
const selectedId = ref('')
|
||||
/** 选中图片只来自当前列表。 */
|
||||
const selected = computed(() => query.data.value?.masters.find(item => item.id === selectedId.value))
|
||||
/** 生成表单公开底栏操作。 */
|
||||
const generationRef = ref<InstanceType<typeof MasterGenerationForm> | null>(null)
|
||||
/** 审核表单公开底栏操作。 */
|
||||
const reviewRef = ref<InstanceType<typeof MasterReviewForm> | null>(null)
|
||||
/** 仅真正提交期间锁定关闭,普通查询不锁定。 */
|
||||
const busy = computed(() => !!generationRef.value?.submitting || !!reviewRef.value?.pending)
|
||||
/** 已有任务或未知费用阻止新付费/正式确认,不影响只读。 */
|
||||
const activeJob = computed(() => jobs.data.value?.some(item => !['completed', 'failed'].includes(item.status)))
|
||||
/** 复用项目全局活动锁,防止从另一入口并行写入。 */
|
||||
const blocked = computed(
|
||||
() =>
|
||||
props.disabled ||
|
||||
getOperation(props.projectId).pending ||
|
||||
!!activeJob.value ||
|
||||
!jobs.data.value ||
|
||||
!!jobs.error.value ||
|
||||
!!query.error.value
|
||||
)
|
||||
/** 最近任务公开状态。 */
|
||||
const jobLabels: Record<string, string> = {
|
||||
pending: '等待执行',
|
||||
running: '执行中',
|
||||
interrupted: '结果或费用待核查',
|
||||
completed: '已生成草稿',
|
||||
failed: '执行失败'
|
||||
}
|
||||
watch(
|
||||
key,
|
||||
() => {
|
||||
tab.value = 'masters'
|
||||
selectedId.value = ''
|
||||
},
|
||||
{ flush: 'sync' }
|
||||
)
|
||||
watch(
|
||||
() => query.data.value,
|
||||
data => {
|
||||
if (data && !data.masters.some(item => item.id === selectedId.value))
|
||||
selectedId.value = data.confirmed?.id ?? data.masters[0]?.id ?? ''
|
||||
}
|
||||
)
|
||||
/** 任务在其他入口完成后,只读恢复母版列表,旧项目事件不会回填。 */
|
||||
watch(
|
||||
() => jobs.data.value,
|
||||
(rows, previous) => {
|
||||
if (!key.value || !rows || !previous) return
|
||||
if (
|
||||
rows.some(
|
||||
item =>
|
||||
['completed', 'failed', 'interrupted'].includes(item.status) &&
|
||||
previous.some(old => old.id === item.id && ['pending', 'running'].includes(old.status))
|
||||
)
|
||||
)
|
||||
void query.refresh()
|
||||
}
|
||||
)
|
||||
/**
|
||||
* 同步读取当前布局与任务;失败保持数据但暂停写入。
|
||||
* @returns 当前刷新完成
|
||||
*/
|
||||
async function refresh() {
|
||||
await Promise.all([query.refresh(), jobs.refresh(), reviewRef.value?.refresh()])
|
||||
}
|
||||
/**
|
||||
* 在同一只读范围选择母版并定位审核表单,不触发审核或确认。
|
||||
* @param masterId 用户选中的正式资产编号
|
||||
* @returns 正文定位完成
|
||||
*/
|
||||
async function selectMaster(masterId: string) {
|
||||
if (busy.value) return
|
||||
const target = key.value
|
||||
selectedId.value = masterId
|
||||
await nextTick()
|
||||
if (target === key.value) reviewSection.value?.scrollIntoView({ block: 'start' })
|
||||
}
|
||||
/**
|
||||
* 新草稿回执仅定位展示,不自动审核或确认。
|
||||
* @param receipt 已验证的正式生成回执
|
||||
*/
|
||||
function generated(receipt: MasterGenerationReceipt) {
|
||||
showActionFeedback(message, '已生成母版草稿,尚未完成质量审核与人工确认。', 'info')
|
||||
selectedId.value = receipt.masterId
|
||||
tab.value = 'masters'
|
||||
void query.refresh()
|
||||
void jobs.refresh()
|
||||
emit('changed')
|
||||
}
|
||||
/** 人工确认或机器审核后只读回查正式来源,不生成下游素材。 */
|
||||
function reviewed() {
|
||||
void query.refresh()
|
||||
void jobs.refresh()
|
||||
emit('changed')
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<!-- 以下是母版历史、独立质量、恢复影响和任务的全屏管理模块 -->
|
||||
<AppDrawer
|
||||
v-model:open="open"
|
||||
title="空间母版管理"
|
||||
description="历史原图、来源版本与人工/机器审核分别核对。所有生成和 AI 审核均须独立确认费用。"
|
||||
:busy="busy"
|
||||
>
|
||||
<div class="space-y-(--app-content-gap)">
|
||||
<div class="flex flex-wrap items-start justify-between gap-3">
|
||||
<div>
|
||||
<h3 class="text-base font-semibold">{{ query.data.value?.layout.name || '当前空间布局' }}</h3>
|
||||
<p v-if="query.data.value" class="mt-2 wrap-anywhere text-xs text-muted">
|
||||
当前布局版本:{{ query.data.value.layout.version }}
|
||||
</p>
|
||||
</div>
|
||||
<NButton :loading="query.loading.value || jobs.loading.value" :disabled="busy" @click="refresh"
|
||||
>刷新母版与任务</NButton
|
||||
>
|
||||
</div>
|
||||
<p v-if="query.loading.value && !query.data.value" class="text-sm text-muted" role="status">
|
||||
正在读取布局与母版记录…
|
||||
</p>
|
||||
<p v-if="query.error.value" class="text-sm text-muted">{{ query.error.value }}</p>
|
||||
<p v-if="activeJob" class="text-sm text-muted" role="status">
|
||||
已有生成任务执行中或结果待核查,请在任务记录中核对;不会自动再次生图。
|
||||
</p>
|
||||
<NTabs v-model:value="tab" type="line" aria-label="空间母版功能"
|
||||
><NTab :disabled="busy" name="masters">母版与审核</NTab
|
||||
><NTab :disabled="busy" name="generate">恢复与修订</NTab
|
||||
><NTab :disabled="busy" name="impact">来源影响</NTab
|
||||
><NTab :disabled="busy" name="jobs">任务记录</NTab></NTabs
|
||||
>
|
||||
<template v-if="query.data.value">
|
||||
<!-- 以下是保留原图的全部母版历史,确认状态不冒充机器通过 -->
|
||||
<section v-if="tab === 'masters'" class="space-y-(--app-content-gap)">
|
||||
<WorkspaceSectionHeading
|
||||
title="母版历史"
|
||||
:description="
|
||||
query.data.value.confirmed
|
||||
? '当前版本已有正式确认母版;旧图和草稿继续保留。'
|
||||
: '暂无当前版本已确认母版。历史确认图不能自动作为当前母版。'
|
||||
"
|
||||
/>
|
||||
<p v-if="!query.data.value.masters.length" class="text-sm text-muted">
|
||||
暂无母版记录,可在恢复与修订中免费预检。
|
||||
</p>
|
||||
<div
|
||||
class="grid grid-cols-1 items-start gap-(--app-content-gap) sm:grid-cols-[repeat(auto-fill,minmax(220px,260px))]"
|
||||
>
|
||||
<article v-for="master in query.data.value.masters" :key="master.id" class="min-w-0 space-y-2">
|
||||
<AssetImage
|
||||
:src="master.imageUrl"
|
||||
:style="{ aspectRatio: '1/1' }"
|
||||
alt="空间母版原图"
|
||||
object-fit="contain"
|
||||
preview
|
||||
/>
|
||||
<p class="text-sm font-semibold">
|
||||
{{
|
||||
master.status === 'confirmed'
|
||||
? '已确认'
|
||||
: master.status === 'draft'
|
||||
? '草稿'
|
||||
: '状态待核对'
|
||||
}}{{ master.id === query.data.value.confirmed?.id ? ' · 当前全局母版' : '' }}
|
||||
</p>
|
||||
<p class="text-xs text-muted">
|
||||
{{
|
||||
master.spatialLayoutVersion === query.data.value.layout.version
|
||||
? '绑定当前布局'
|
||||
: '绑定历史布局'
|
||||
}}
|
||||
· {{ master.subjectFormId ? '形态专属机位' : '全局布局' }} ·
|
||||
{{ formatDate(master.createdAt) }}
|
||||
</p>
|
||||
<p v-if="master.confirmedBy" class="text-xs text-muted">
|
||||
人工确认:{{ master.confirmedBy }} ·
|
||||
{{ master.confirmedAt ? formatDate(master.confirmedAt) : '时间未记录' }}
|
||||
</p>
|
||||
<NButton
|
||||
class="workspace-action-button"
|
||||
:disabled="busy"
|
||||
@click="selectMaster(master.id)"
|
||||
>{{ selectedId === master.id ? '正在查看审核' : '查看审核与确认' }}</NButton
|
||||
>
|
||||
</article>
|
||||
</div>
|
||||
<section v-if="selected" ref="reviewSection">
|
||||
<MasterReviewForm
|
||||
ref="reviewRef"
|
||||
:key="selected.id"
|
||||
:project-id="projectId"
|
||||
:layout="query.data.value.layout"
|
||||
:master="selected"
|
||||
:disabled="blocked"
|
||||
@changed="reviewed"
|
||||
@stale="refresh"
|
||||
/>
|
||||
</section>
|
||||
</section>
|
||||
<!-- 以下是独立的免费输入预检与单次生成表单,结果只登记草稿 -->
|
||||
<MasterGenerationForm
|
||||
v-if="tab === 'generate'"
|
||||
ref="generationRef"
|
||||
:project-id="projectId"
|
||||
:layout="query.data.value.layout"
|
||||
:masters="query.data.value.masters"
|
||||
:disabled="blocked"
|
||||
@generated="generated"
|
||||
@stale="refresh"
|
||||
/>
|
||||
<MasterRecoveryImpact v-if="tab === 'impact'" :project-id="projectId" :layout-id="layoutId" />
|
||||
<!-- 以下是真实任务状态,无本次请求也可发现,不自动恢复或重复生图 -->
|
||||
<section v-if="tab === 'jobs'" class="space-y-4">
|
||||
<WorkspaceSectionHeading
|
||||
title="母版生成任务"
|
||||
description="完成仅代表草稿生成;中断可能已计费,应先核对原结果,不自动重试。"
|
||||
/>
|
||||
<p v-if="jobs.error.value" class="text-sm text-muted">{{ jobs.error.value }}</p>
|
||||
<p v-if="!jobs.data.value?.length" class="text-sm text-muted">暂无生成任务。</p>
|
||||
<article v-for="job in jobs.data.value" :key="job.id" class="space-y-2">
|
||||
<p class="text-sm font-semibold">
|
||||
{{ jobLabels[job.status] || '状态待核查' }} · {{ formatDate(job.updatedAt) }}
|
||||
</p>
|
||||
<p class="wrap-anywhere text-xs text-muted">
|
||||
任务编号:{{ job.id }} · {{ job.provider }} / {{ job.model }}
|
||||
</p>
|
||||
<p v-if="job.status === 'interrupted'" class="text-sm">原结果或费用待核查,请勿重新生图。</p>
|
||||
<NCollapse
|
||||
><NCollapseItem name="job" title="任务输入详情"
|
||||
><p class="wrap-anywhere text-xs">布局版本:{{ job.spatialLayoutVersion }}</p>
|
||||
<pre class="mt-2 whitespace-pre-wrap break-words text-xs">{{ job.prompt }}</pre>
|
||||
<pre class="mt-2 whitespace-pre-wrap break-words text-xs">{{
|
||||
JSON.stringify(job.generationOptions, null, 2)
|
||||
}}</pre>
|
||||
<p class="mt-2 text-xs">原任务参考摘要</p>
|
||||
<pre class="whitespace-pre-wrap break-words text-xs">{{
|
||||
job.referenceSnapshot ? JSON.stringify(job.referenceSnapshot, null, 2) : '未记录'
|
||||
}}</pre>
|
||||
</NCollapseItem></NCollapse
|
||||
>
|
||||
</article>
|
||||
</section>
|
||||
</template>
|
||||
</div>
|
||||
<!-- 以下是固定底栏中的独立费用确认、人工确认与关闭入口 -->
|
||||
<template #footer>
|
||||
<div class="flex w-full flex-wrap items-center justify-end gap-3">
|
||||
<NCheckbox
|
||||
v-if="tab === 'generate' && generationRef"
|
||||
v-model:checked="generationRef.acknowledged"
|
||||
:disabled="busy || blocked"
|
||||
class="mr-auto"
|
||||
>已核对本次费用,确认仅生成一张草稿</NCheckbox
|
||||
>
|
||||
<NCheckbox
|
||||
v-if="tab === 'masters' && selected?.status === 'draft' && reviewRef"
|
||||
v-model:checked="reviewRef.visionAcknowledged"
|
||||
:disabled="busy || blocked"
|
||||
class="mr-auto"
|
||||
>单独确认本次 AI 视觉审核可能收费</NCheckbox
|
||||
>
|
||||
<NButton :disabled="busy" @click="open = false">关闭</NButton>
|
||||
<NButton
|
||||
v-if="tab === 'generate' && generationRef"
|
||||
type="primary"
|
||||
:loading="generationRef.submitting"
|
||||
:disabled="!generationRef.canSubmit"
|
||||
@click="generationRef.submit()"
|
||||
>确认费用并生成一张草稿</NButton
|
||||
>
|
||||
<NButton
|
||||
v-if="tab === 'masters' && selected?.status === 'draft' && reviewRef"
|
||||
:loading="reviewRef.pending === 'vision'"
|
||||
:disabled="!reviewRef.canValidate"
|
||||
@click="reviewRef.validate()"
|
||||
>AI 视觉审核</NButton
|
||||
>
|
||||
<NButton
|
||||
v-if="tab === 'masters' && selected?.status === 'draft' && reviewRef"
|
||||
type="primary"
|
||||
:loading="reviewRef.pending === 'confirm'"
|
||||
:disabled="!reviewRef.canConfirm"
|
||||
@click="reviewRef.confirm()"
|
||||
>正式人工确认母版</NButton
|
||||
>
|
||||
</div>
|
||||
</template>
|
||||
</AppDrawer>
|
||||
</template>
|
||||
Reference in new issue
Block a user