feat(short-drama-agent-front): 接入连续性状态签收与联合审核
This commit is contained in:
1 parent
0d58dd8c53
commit
10e008ca10
21 files changed
+1319
-25
No files matched your search
@@ -0,0 +1,405 @@
|
||||
<script setup lang="ts">
|
||||
import { computed, onScopeDispose, ref, shallowRef, watch } from 'vue'
|
||||
import { NButton, NCheckbox, NInput, NInputNumber } from 'naive-ui'
|
||||
import { AssetImage } from '../../../components/ui'
|
||||
import RawDataDetails from '../../../components/ui/RawDataDetails.vue'
|
||||
import { useQuery } from '../../../composables/useQuery'
|
||||
import { errorMessage } from '../../../lib/http'
|
||||
import { useActionMessage } from '../../../components/ui/useActionMessage'
|
||||
import { useWorkflowExecution } from '../../workflows/execution'
|
||||
import WorkflowExecutionPanel from '../../workflows/WorkflowExecutionPanel.vue'
|
||||
import { jointApi, type JointApproval, type JointPlan } from '../continuity-joint'
|
||||
import { continuityStatusLabels } from '../continuity'
|
||||
import type { ContinuityReview } from '../continuity.types'
|
||||
/** 原签收范围与项目写入锁。 */
|
||||
const props = defineProps<{
|
||||
/** 项目。 */ projectId: string
|
||||
/** 已存人工记录。 */ review: ContinuityReview
|
||||
/** 项目活动锁。 */ disabled: boolean
|
||||
}>()
|
||||
/** 把写入锁与变化交给原抽屉。 */
|
||||
const emit = defineEmits<{ busy: [boolean]; changed: [] }>()
|
||||
/** 当前免费计划。 */
|
||||
const plan = shallowRef<JointPlan | null>(null)
|
||||
/** 单次操作锁。 */
|
||||
const pending = ref(false)
|
||||
/** 写入结果未知时禁止再次执行。 */
|
||||
const uncertain = ref(false)
|
||||
/** 当前原任务。 */
|
||||
const taskId = ref('')
|
||||
/** 本次批准编号,不持久化或复用到别组。 */
|
||||
const authorization = ref('')
|
||||
/** 真实批准人。 */
|
||||
const approvedBy = ref('')
|
||||
/** 操作人。 */
|
||||
const operator = ref('')
|
||||
/** 真实批准材料摘要。 */
|
||||
const approvalSha256 = ref('')
|
||||
/** 估算下限,不预填报价。 */
|
||||
const estimatedMin = ref<number | null>(null)
|
||||
/** 估算上限。 */
|
||||
const estimatedMax = ref<number | null>(null)
|
||||
/** 明确审阅当前计划。 */
|
||||
const approved = ref(false)
|
||||
/** 执行或恢复另行明确确认。 */
|
||||
const executeApproved = ref(false)
|
||||
/** 绑定范围,关闭后取消旧查询。 */
|
||||
const scopeKey = computed(() => JSON.stringify([props.projectId, props.review.reviewId]))
|
||||
/** 任务回读按项目、签收和任务共同隔离。 */
|
||||
const taskKey = computed(() =>
|
||||
taskId.value ? JSON.stringify([props.projectId, props.review.reviewId, taskId.value]) : ''
|
||||
)
|
||||
/** 原业务状态,不以 Workflow completed 推断通过。 */
|
||||
const task = useQuery(taskKey, async (value, signal) => {
|
||||
if (!value) return null
|
||||
const [p, r, t] = JSON.parse(value) as string[]
|
||||
const result = await jointApi.task(p!, t!, signal)
|
||||
if (result.reviewId !== r || result.validationTaskId !== t) throw new Error('联合任务与当前签收不符。')
|
||||
return result
|
||||
})
|
||||
/** 沿用原 Workflow 的 GET/SSE 和刷新发现。 */
|
||||
const execution = useWorkflowExecution(
|
||||
computed(() => props.projectId),
|
||||
'shot-keyframe-continuity-validation',
|
||||
{ discover: true }
|
||||
)
|
||||
/** 所属签收任务的执行变化后回读业务结果。 */
|
||||
watch(
|
||||
() => execution.query.data.value,
|
||||
record => {
|
||||
if (record && record.id === task.data.value?.executionId) void task.refresh()
|
||||
}
|
||||
)
|
||||
/** 取得任务后沿原执行编号观察,不新建任务。 */
|
||||
watch(
|
||||
() => task.data.value?.executionId,
|
||||
id => {
|
||||
if (id) void execution.track(id, props.projectId)
|
||||
}
|
||||
)
|
||||
/** 原任务与执行都收口后才显示业务结论。 */
|
||||
const taskActive = computed(
|
||||
() =>
|
||||
!!task.data.value &&
|
||||
[task.data.value.taskStatus, task.data.value.workflowStatus].some(s => ['pending', 'running'].includes(s))
|
||||
)
|
||||
/** 消息层。 */
|
||||
const message = useActionMessage()
|
||||
/** 免费请求取消器。 */
|
||||
let controller: AbortController | undefined
|
||||
/** 撤销批准和未知结果的跨范围复用。 */
|
||||
watch(
|
||||
scopeKey,
|
||||
() => {
|
||||
controller?.abort()
|
||||
pending.value = false
|
||||
plan.value = null
|
||||
taskId.value = ''
|
||||
authorization.value = ''
|
||||
approved.value = false
|
||||
executeApproved.value = false
|
||||
uncertain.value = false
|
||||
},
|
||||
{ flush: 'sync' }
|
||||
)
|
||||
onScopeDispose(() => controller?.abort())
|
||||
/** 任何批准材料改变都撤销先前批准。 */
|
||||
watch([approvedBy, operator, approvalSha256, estimatedMin, estimatedMax], () => {
|
||||
approved.value = false
|
||||
authorization.value = ''
|
||||
executeApproved.value = false
|
||||
})
|
||||
/** 可登记批准,费用未知仍须用户提供真实估算范围。 */
|
||||
const canAuthorize = computed(
|
||||
() =>
|
||||
!pending.value &&
|
||||
!props.disabled &&
|
||||
!uncertain.value &&
|
||||
!props.review.invalidation &&
|
||||
plan.value?.status === 'ready' &&
|
||||
plan.value.executionAvailable &&
|
||||
plan.value.capability.verified &&
|
||||
approved.value &&
|
||||
!!approvedBy.value.trim() &&
|
||||
!!operator.value.trim() &&
|
||||
/^[a-f0-9]{64}$/.test(approvalSha256.value) &&
|
||||
estimatedMin.value !== null &&
|
||||
estimatedMin.value >= 0 &&
|
||||
estimatedMax.value !== null &&
|
||||
estimatedMax.value > 0 &&
|
||||
estimatedMin.value <= estimatedMax.value
|
||||
)
|
||||
/** 只有本次批准和单独确认才可执行。 */
|
||||
const canExecute = computed(
|
||||
() =>
|
||||
!pending.value &&
|
||||
!props.disabled &&
|
||||
!uncertain.value &&
|
||||
!taskActive.value &&
|
||||
plan.value?.status === 'ready' &&
|
||||
plan.value.executionAvailable &&
|
||||
!!authorization.value &&
|
||||
executeApproved.value
|
||||
)
|
||||
/** 恢复只依据原任务的正式开关,未知状态不推断。 */
|
||||
const canResume = computed(
|
||||
() =>
|
||||
!pending.value &&
|
||||
!props.disabled &&
|
||||
!task.loading.value &&
|
||||
!task.error.value &&
|
||||
task.data.value?.resumeAvailable === true &&
|
||||
task.data.value.current &&
|
||||
executeApproved.value
|
||||
)
|
||||
/**
|
||||
* 同一范围只执行一次,错误撤销批准,绝不自动重发。
|
||||
* @param work 用户要求的操作
|
||||
* @param writing 是否写入
|
||||
*/
|
||||
async function run(work: () => Promise<void>, writing = false) {
|
||||
if (pending.value) return
|
||||
const scope = scopeKey.value
|
||||
pending.value = true
|
||||
if (writing) emit('busy', true)
|
||||
try {
|
||||
await work()
|
||||
} catch (cause) {
|
||||
if (scope === scopeKey.value) {
|
||||
authorization.value = ''
|
||||
approved.value = false
|
||||
executeApproved.value = false
|
||||
if (writing) uncertain.value = true
|
||||
message?.error(errorMessage(cause))
|
||||
}
|
||||
} finally {
|
||||
if (scope === scopeKey.value) pending.value = false
|
||||
if (writing) emit('busy', false)
|
||||
}
|
||||
}
|
||||
/** 免费刷新,旧指纹冲突后清空计划,下次由用户重新审阅。 */
|
||||
async function preview() {
|
||||
const scope = scopeKey.value
|
||||
const expected = plan.value?.fingerprint
|
||||
authorization.value = ''
|
||||
approved.value = false
|
||||
executeApproved.value = false
|
||||
await run(async () => {
|
||||
controller?.abort()
|
||||
controller = new AbortController()
|
||||
try {
|
||||
const result = await jointApi.preview(props.projectId, props.review.reviewId, expected, controller.signal)
|
||||
if (scope !== scopeKey.value) return
|
||||
if (result.projectId !== props.projectId || result.reviewId !== props.review.reviewId)
|
||||
throw new Error('计划与当前签收不符。')
|
||||
plan.value = result
|
||||
taskId.value = result.reusableTaskId || result.latestTask?.validationTaskId || ''
|
||||
if (taskId.value) await task.refresh()
|
||||
} catch (cause) {
|
||||
if (scope === scopeKey.value) plan.value = null
|
||||
throw cause
|
||||
}
|
||||
})
|
||||
}
|
||||
/** 独立登记当前完整计划与真实批准材料,不启动模型。 */
|
||||
async function authorize() {
|
||||
if (!canAuthorize.value || !plan.value) return
|
||||
const p = props.projectId,
|
||||
r = props.review.reviewId,
|
||||
fingerprint = plan.value.fingerprint
|
||||
const input: JointApproval = {
|
||||
plan: { purpose: 'continuity', reviewId: r, fingerprint },
|
||||
approvedBy: approvedBy.value.trim(),
|
||||
operator: operator.value.trim(),
|
||||
approvalSha256: approvalSha256.value,
|
||||
feeScope: {
|
||||
currency: 'CNY',
|
||||
estimatedMin: estimatedMin.value!,
|
||||
estimatedMax: estimatedMax.value!,
|
||||
maxRequests: 1
|
||||
}
|
||||
}
|
||||
await run(async () => {
|
||||
const latest = await jointApi.preview(p, r, fingerprint)
|
||||
if (scopeKey.value !== JSON.stringify([p, r])) return
|
||||
if (latest.status !== 'ready' || !latest.executionAvailable) throw new Error('计划已不可执行,请重新免费预检。')
|
||||
const result = await jointApi.authorize(p, r, input)
|
||||
if (scopeKey.value !== JSON.stringify([p, r])) return
|
||||
if (result.planFingerprint !== fingerprint) throw new Error('批准范围已改变,请重新审阅。')
|
||||
authorization.value = result.authorizationId
|
||||
executeApproved.value = false
|
||||
}, true)
|
||||
}
|
||||
/** 用户主动执行一次,先消耗页面批准,断线后仅查原任务。 */
|
||||
async function execute() {
|
||||
if (!canExecute.value) return
|
||||
const p = props.projectId,
|
||||
r = props.review.reviewId,
|
||||
id = authorization.value
|
||||
authorization.value = ''
|
||||
executeApproved.value = false
|
||||
await run(async () => {
|
||||
const result = await jointApi.execute(p, r, id)
|
||||
if (scopeKey.value !== JSON.stringify([p, r])) return
|
||||
taskId.value = result.validationTaskId
|
||||
await task.refresh()
|
||||
emit('changed')
|
||||
}, true)
|
||||
}
|
||||
/** 用户明确恢复原任务,不申请新批准或替换任务。 */
|
||||
async function resume() {
|
||||
if (!canResume.value || !task.data.value) return
|
||||
const p = props.projectId,
|
||||
r = props.review.reviewId,
|
||||
original = task.data.value
|
||||
executeApproved.value = false
|
||||
await run(async () => {
|
||||
const result = await jointApi.resume(p, original.validationTaskId, original.planFingerprint)
|
||||
if (scopeKey.value !== JSON.stringify([p, r])) return
|
||||
if (result.validationTaskId !== original.validationTaskId) throw new Error('恢复任务不符,请刷新核对。')
|
||||
await task.refresh()
|
||||
}, true)
|
||||
}
|
||||
/**
|
||||
* 只使用原签收公开的原图地址,不猜测图片路径。
|
||||
* @param image 精确计划中的图片
|
||||
* @returns 原签收对应的公开原件地址
|
||||
*/
|
||||
function imageUrl(image: JointPlan['imageManifest'][number]) {
|
||||
for (const binding of image.bindings) {
|
||||
const frame = props.review.diagnosis.frames.find(f => f.shotId === binding.shotId)
|
||||
const url =
|
||||
binding.role === 'frame'
|
||||
? frame?.imageUrl
|
||||
: frame?.layoutReferences?.find(r => r.imageId === binding.imageId)?.imageUrl
|
||||
if (url) return url
|
||||
}
|
||||
return null
|
||||
}
|
||||
/** 原抽屉固定底栏复用本表单的明确操作。 */
|
||||
defineExpose({ canAuthorize, canExecute, canResume, authorize, execute, resume })
|
||||
</script>
|
||||
<template>
|
||||
<!-- 以下是原有序组签收的联合审核计划、批准与原任务观察 -->
|
||||
<section class="flex flex-col items-stretch gap-4 text-sm">
|
||||
<h3 class="font-medium">联合视觉审核</h3>
|
||||
<p class="text-muted">单镜质量、人工签收与联合机器结论分别核对,免费计划不表示已通过。</p>
|
||||
<NButton class="self-start" :loading="pending" @click="preview">查看/刷新联合审核免费计划</NButton>
|
||||
<template v-if="plan">
|
||||
<p>
|
||||
{{
|
||||
{ ready: '可准备本次批准', blocked: '暂不能执行', reusable: '已有同计划任务,请查看原结果' }[
|
||||
plan.status
|
||||
]
|
||||
}}
|
||||
· 模型 {{ plan.model }}
|
||||
</p>
|
||||
<p>
|
||||
执行费用:{{
|
||||
plan.feeEstimate.amount === null
|
||||
? '未知,需另行明确估算范围'
|
||||
: `${plan.feeEstimate.amount} ${plan.feeEstimate.currency}`
|
||||
}}。本次预检调用 {{ plan.paidCalls }} 次;最多拟请求 {{ plan.proposedMaximumProviderRequests }} 次。
|
||||
</p>
|
||||
<p>
|
||||
型号及输入:{{ plan.capability.verified ? '已核验' : '未核验,禁止执行' }}。{{ plan.capability.reason }}
|
||||
</p>
|
||||
<div v-for="image in plan.imageManifest" :key="image.imageNumber" class="space-y-1">
|
||||
<AssetImage
|
||||
v-if="imageUrl(image)"
|
||||
class="max-w-sm aspect-square"
|
||||
:src="imageUrl(image)"
|
||||
:alt="`联合计划图片 ${image.imageNumber}`"
|
||||
object-fit="contain"
|
||||
preview
|
||||
/>
|
||||
<p>
|
||||
图片 {{ image.imageNumber }} · {{ image.label }} · {{ image.pixels.width }} ×
|
||||
{{ image.pixels.height }}
|
||||
</p>
|
||||
<p v-for="(binding, i) in image.bindings" :key="i">
|
||||
{{ binding.shotId }} ·
|
||||
{{ binding.role === 'frame' ? '镜头首帧' : '空间参考(不代表人物或道具状态)' }}
|
||||
</p>
|
||||
</div>
|
||||
<RawDataDetails title="高级详情:最终脱敏请求、图片摘要与全部绑定" :value="plan" />
|
||||
<template
|
||||
v-if="plan.status === 'ready' && plan.executionAvailable && plan.capability.verified && !uncertain"
|
||||
>
|
||||
<NInput
|
||||
v-model:value="approvedBy"
|
||||
placeholder="真实批准人"
|
||||
aria-label="联合批准人"
|
||||
:disabled="pending"
|
||||
/>
|
||||
<NInput v-model:value="operator" placeholder="真实操作人" aria-label="联合操作人" :disabled="pending" />
|
||||
<NInput
|
||||
v-model:value="approvalSha256"
|
||||
placeholder="真实批准材料 SHA256"
|
||||
aria-label="联合批准摘要"
|
||||
:disabled="pending"
|
||||
/>
|
||||
<NInputNumber
|
||||
v-model:value="estimatedMin"
|
||||
:min="0"
|
||||
placeholder="费用估算下限"
|
||||
aria-label="联合费用下限"
|
||||
:disabled="pending"
|
||||
/>
|
||||
<NInputNumber
|
||||
v-model:value="estimatedMax"
|
||||
:min="0"
|
||||
placeholder="费用估算上限"
|
||||
aria-label="联合费用上限"
|
||||
:disabled="pending"
|
||||
/>
|
||||
<p>估算范围不是实际账单或模型服务的硬金额上限。</p>
|
||||
<NCheckbox v-model:checked="approved" :disabled="pending"
|
||||
>我已核对本次模型、全部图片、范围与真实费用批准材料</NCheckbox
|
||||
>
|
||||
</template>
|
||||
</template>
|
||||
<p v-if="uncertain" class="text-muted">请求结果待核查,请只读刷新计划与原任务;不能重新批准或重发。</p>
|
||||
<template v-if="task.data.value">
|
||||
<p>
|
||||
联合任务:{{
|
||||
taskActive ? '审核中,等待原执行收口' : (continuityStatusLabels[task.data.value.status] ?? '待核查')
|
||||
}}
|
||||
· {{ task.data.value.current ? '来源当前' : '来源已失效' }}
|
||||
</p>
|
||||
<p>{{ task.data.value.summary }}</p>
|
||||
<p>人工原签收和非阻断未知保持原样,机器新观察不会自动覆盖。</p>
|
||||
<RawDataDetails
|
||||
title="原机器评估、解析观察与用量(独立追溯)"
|
||||
:value="{
|
||||
diagnosis: task.data.value.diagnosis,
|
||||
machineObservation: task.data.value.machineObservation,
|
||||
step: task.data.value.step,
|
||||
feeScope: task.data.value.feeScope
|
||||
}"
|
||||
/>
|
||||
<WorkflowExecutionPanel
|
||||
v-if="execution.query.data.value?.id === task.data.value.executionId"
|
||||
:execution="execution.query.data.value"
|
||||
result-is-historical
|
||||
:loading="execution.query.loading.value"
|
||||
:error="execution.query.error.value"
|
||||
@refresh="execution.query.refresh"
|
||||
/>
|
||||
<NButton :loading="task.loading.value" @click="task.refresh">只读刷新原联合任务</NButton>
|
||||
</template>
|
||||
<p v-if="task.error.value" class="text-muted">{{ task.error.value }}</p>
|
||||
<NCheckbox
|
||||
v-if="authorization || task.data.value?.resumeAvailable"
|
||||
v-model:checked="executeApproved"
|
||||
:disabled="pending"
|
||||
>{{
|
||||
authorization
|
||||
? '明确执行本次已批准的一次联合审核'
|
||||
: task.data.value?.requiresNewProviderRequest
|
||||
? '继续原批准且此前未发出的一次请求,可能收费'
|
||||
: '免费解析原回执,不新增模型请求'
|
||||
}}</NCheckbox
|
||||
>
|
||||
</section>
|
||||
</template>
|
||||
@@ -1,4 +1,7 @@
|
||||
<script setup lang="ts">
|
||||
import ContinuityStateEditor from './ContinuityStateEditor.vue'
|
||||
import ContinuityJointReview from './ContinuityJointReview.vue'
|
||||
import { validStateChecks, stateDimensions } from '../continuity-state'
|
||||
import { computed, onScopeDispose, ref, watch } from 'vue'
|
||||
import { NButton, NCollapse, NCollapseItem, NInput, NSelect, NSkeleton } from 'naive-ui'
|
||||
import { AssetImage } from '../../../components/ui'
|
||||
@@ -44,6 +47,12 @@ const open = defineModel<boolean>('open', { default: false })
|
||||
const emit = defineEmits<{ changed: [] }>()
|
||||
/** 用户明确选择的镜头。 */
|
||||
const selected = ref<string[]>([])
|
||||
/** 显式人工范围,默认固定几何。 */
|
||||
const scope = ref<'fixed_geometry' | 'geometry_and_state'>('fixed_geometry')
|
||||
/** 联合审核表单通过公共底栏操作。 */
|
||||
const jointRef = ref<InstanceType<typeof ContinuityJointReview> | null>(null)
|
||||
/** 联合批准和执行请求锁。 */
|
||||
const jointBusy = ref(false)
|
||||
/** 当前共同场景形态。 */
|
||||
const sceneFormId = ref('')
|
||||
/** 最新诊断及原始依据。 */
|
||||
@@ -86,7 +95,7 @@ const reviewId = ref('')
|
||||
/** 用户输入后再显式读取,避免输入时反复请求。 */
|
||||
const requestedReviewId = ref('')
|
||||
/** 当前审核提交锁。 */
|
||||
const busy = computed(() => saving.value || layoutSaving.value)
|
||||
const busy = computed(() => saving.value || layoutSaving.value || jointBusy.value)
|
||||
/** 正式镜头选择约束。 */
|
||||
const selectionValid = computed(() =>
|
||||
continuitySelectionValid(
|
||||
@@ -180,7 +189,7 @@ const canSave = computed(
|
||||
!diagnosing.value
|
||||
)
|
||||
/** 与来源和参数绑定的诊断身份。 */
|
||||
const target = computed(() => JSON.stringify([context.value, selected.value, sceneFormId.value]))
|
||||
const target = computed(() => JSON.stringify([context.value, selected.value, sceneFormId.value, scope.value]))
|
||||
/** 请求代次防止切范围、关闭或编辑期间回填旧结果。 */
|
||||
let generation = 0
|
||||
/** 免费诊断取消控制器。 */
|
||||
@@ -236,6 +245,7 @@ function selectShots(ids: string[]) {
|
||||
*/
|
||||
function blankObservation(result: ContinuityDiagnosis): ContinuityObservation {
|
||||
return {
|
||||
...(scope.value === 'geometry_and_state' ? { stateChecks: [] } : {}),
|
||||
expectedFingerprint: result.fingerprint!,
|
||||
landmarks: ['', ''],
|
||||
frames: result.frames.map(frame => ({
|
||||
@@ -262,7 +272,12 @@ async function diagnose(withObservation = false) {
|
||||
sources.error.value
|
||||
)
|
||||
return
|
||||
if (withObservation && !validObservation(observation.value, selected.value)) {
|
||||
if (
|
||||
withObservation &&
|
||||
(!validObservation(observation.value, selected.value) ||
|
||||
(scope.value === 'geometry_and_state' &&
|
||||
!validStateChecks(observation.value?.stateChecks ?? [], diagnosis.value?.stateContext ?? [])))
|
||||
) {
|
||||
showActionFeedback(message, '请填写两个不同地标、逐镜观察依据及固定结构位置或数量。', 'warning')
|
||||
return
|
||||
}
|
||||
@@ -274,6 +289,7 @@ async function diagnose(withObservation = false) {
|
||||
JSON.stringify({
|
||||
shotIds: [...selected.value],
|
||||
sceneFormId: sceneFormId.value,
|
||||
...(scope.value === 'geometry_and_state' ? { scope: scope.value } : {}),
|
||||
...(withObservation ? { observation: observation.value } : {})
|
||||
})
|
||||
)
|
||||
@@ -379,11 +395,21 @@ function updateFrame(index: number, value: GeometryFrameObservation) {
|
||||
<!-- 以下是同场景连续镜头的全屏诊断与持久化审核模块 -->
|
||||
<AppDrawer
|
||||
v-model:open="open"
|
||||
title="跨镜固定几何审核"
|
||||
description="免费对照相邻两到三镜的固定结构,审核不会自动修改主首帧。"
|
||||
title="跨镜连续性审核"
|
||||
description="免费核对相邻两到三镜的固定结构与所选人工状态,各范围独立签收,不自动修改主首帧。"
|
||||
:busy="busy"
|
||||
>
|
||||
<div class="space-y-6">
|
||||
<!-- 以下是独立签收范围选择,切换后重新读取指纹 -->
|
||||
<NSelect
|
||||
v-model:value="scope"
|
||||
:disabled="busy || diagnosing"
|
||||
:options="[
|
||||
{ label: '固定几何(默认)', value: 'fixed_geometry' },
|
||||
{ label: '几何与状态(人工)', value: 'geometry_and_state' }
|
||||
]"
|
||||
aria-label="连续性签收范围"
|
||||
/>
|
||||
<section class="space-y-3">
|
||||
<WorkspaceSectionHeading
|
||||
title="选择审核范围"
|
||||
@@ -597,6 +623,12 @@ function updateFrame(index: number, value: GeometryFrameObservation) {
|
||||
/>
|
||||
</article>
|
||||
</div>
|
||||
<ContinuityStateEditor
|
||||
v-if="scope === 'geometry_and_state' && diagnosis?.stateContext && observation.stateChecks"
|
||||
v-model="observation.stateChecks"
|
||||
:contexts="diagnosis.stateContext"
|
||||
:disabled="busy || diagnosing"
|
||||
/>
|
||||
<NButton :loading="diagnosing" :disabled="busy" @click="diagnose(true)">免费诊断人工观察</NButton>
|
||||
</section>
|
||||
<!-- 以下是最新诊断结论及正式审核保存模块 -->
|
||||
@@ -608,6 +640,16 @@ function updateFrame(index: number, value: GeometryFrameObservation) {
|
||||
<p v-for="(item, index) in diagnosis.nonBlockingUnknowns" :key="'unknown-' + index">
|
||||
保留非阻断未知:{{ item.featureKey }} · {{ item.evidence }}(未核实通过)
|
||||
</p>
|
||||
<p v-for="(check, index) in diagnosis.stateChecks" :key="'state-' + index">
|
||||
{{ check.subjectRef }} · {{ stateDimensions[check.dimension] }}:{{ check.before ?? '未知' }} →
|
||||
{{ check.after ?? '未知' }} ·
|
||||
{{
|
||||
check.status === 'non_blocking_unknown'
|
||||
? '非阻断未知(仍未核实)'
|
||||
: continuityStatusLabels[check.status]
|
||||
}}
|
||||
· {{ check.evidence }}
|
||||
</p>
|
||||
<p v-if="!diagnosis.issues.length">本次提交的固定结构观察未发现冲突。</p>
|
||||
<NInput
|
||||
v-if="diagnosis.observation"
|
||||
@@ -677,6 +719,17 @@ function updateFrame(index: number, value: GeometryFrameObservation) {
|
||||
>
|
||||
</article>
|
||||
</section>
|
||||
<!-- 以下是已存有序组的联合审核计划与单次批准 -->
|
||||
<ContinuityJointReview
|
||||
ref="jointRef"
|
||||
v-if="reviewQuery.data.value && context"
|
||||
:key="reviewKey"
|
||||
:project-id="projectId"
|
||||
:review="reviewQuery.data.value"
|
||||
:disabled="disabled || saving || layoutSaving"
|
||||
@busy="jointBusy = $event"
|
||||
@changed="emit('changed')"
|
||||
/>
|
||||
<!-- 以下是布局补充与正式确认模块,确认后回读来源但不生成素材 -->
|
||||
<LayoutSupplementPanel
|
||||
ref="layoutPanelRef"
|
||||
@@ -693,6 +746,15 @@ function updateFrame(index: number, value: GeometryFrameObservation) {
|
||||
</div>
|
||||
<template #footer>
|
||||
<NButton :disabled="busy" @click="open = false">关闭</NButton>
|
||||
<NButton v-if="jointRef?.canAuthorize" type="primary" :disabled="busy" @click="jointRef.authorize"
|
||||
>登记联合审核费用批准</NButton
|
||||
>
|
||||
<NButton v-if="jointRef?.canExecute" type="primary" :disabled="busy" @click="jointRef.execute"
|
||||
>执行本次联合审核</NButton
|
||||
>
|
||||
<NButton v-if="jointRef?.canResume" type="primary" :disabled="busy" @click="jointRef.resume"
|
||||
>明确恢复原联合任务</NButton
|
||||
>
|
||||
<NButton
|
||||
v-if="diagnosis?.observation"
|
||||
type="primary"
|
||||
|
||||
@@ -0,0 +1,150 @@
|
||||
<script setup lang="ts">
|
||||
import { computed } from 'vue'
|
||||
import { NButton, NInput, NSelect } from 'naive-ui'
|
||||
import RawDataDetails from '../../../components/ui/RawDataDetails.vue'
|
||||
import { stateDimensions, type StateCheck, type StateContext } from '../continuity-state'
|
||||
/** 正式有序组与操作锁。 */
|
||||
const props = defineProps<{ /** 正式上下文。 */ contexts: StateContext[]; /** 操作锁。 */ disabled: boolean }>()
|
||||
/** 人工逐项观察,不预设通过。 */
|
||||
const checks = defineModel<StateCheck[]>({ required: true })
|
||||
/** 只列正式紧邻边界。 */
|
||||
const boundaries = computed(() =>
|
||||
props.contexts.slice(0, -1).map((c, i) => ({ label: `第 ${i + 1} 镜 → 第 ${i + 2} 镜`, value: c.shotId }))
|
||||
)
|
||||
/** 可观察维度。 */
|
||||
const dimensions = Object.entries(stateDimensions).map(([value, label]) => ({ label, value }))
|
||||
/** 意见须明确选择。 */
|
||||
const verdicts = [
|
||||
{ label: '一致或变化有据', value: 'consistent' },
|
||||
{ label: '存在冲突', value: 'conflict' },
|
||||
{ label: '未知/无法辨认', value: 'unknown' }
|
||||
]
|
||||
/**
|
||||
* 当前边界的正式依据。
|
||||
* @param check 人工项
|
||||
* @returns 两镜原始依据
|
||||
*/
|
||||
function sources(check: StateCheck) {
|
||||
return props.contexts.filter(c => [check.fromShotId, check.toShotId].includes(c.shotId)).flatMap(c => c.sources)
|
||||
}
|
||||
/** 添加空白项,主体、维度与意见由审核人选择。 */
|
||||
function add() {
|
||||
checks.value.push({
|
||||
fromShotId: '',
|
||||
toShotId: '',
|
||||
subjectRef: '',
|
||||
dimension: 'position',
|
||||
before: null,
|
||||
after: null,
|
||||
verdict: null,
|
||||
sourceIds: [],
|
||||
evidence: ''
|
||||
})
|
||||
}
|
||||
/**
|
||||
* 切换边界时清空旧主体和依据。
|
||||
* @param check 人工项
|
||||
* @param value 正式前镜编号
|
||||
*/
|
||||
function boundary(check: StateCheck, value: string) {
|
||||
check.fromShotId = value
|
||||
check.toShotId = props.contexts[props.contexts.findIndex(c => c.shotId === value) + 1]?.shotId ?? ''
|
||||
check.subjectRef = ''
|
||||
check.sourceIds = []
|
||||
}
|
||||
</script>
|
||||
<template>
|
||||
<!-- 以下是正式状态上下文及有界人工签收模块 -->
|
||||
<section class="space-y-4 text-sm">
|
||||
<h3 class="font-medium">几何与状态(人工)</h3>
|
||||
<p class="text-muted">
|
||||
逐项核对原图和正式依据。无法辨认留空;出画不等于主体消失。交接或开关变化须有前镜实际动作及后镜本主体状态支持,不能只凭勾选依据判为一致。
|
||||
</p>
|
||||
<RawDataDetails
|
||||
v-for="(context, i) in contexts"
|
||||
:key="context.shotId"
|
||||
:title="`第 ${i + 1} 镜正式状态与动作`"
|
||||
:value="context"
|
||||
/>
|
||||
<section v-for="(check, index) in checks" :key="index" class="space-y-3 bg-(--app-subtle) p-4">
|
||||
<NSelect
|
||||
:value="check.fromShotId || null"
|
||||
:options="boundaries"
|
||||
:disabled="disabled"
|
||||
placeholder="选择相邻镜头"
|
||||
aria-label="状态边界"
|
||||
@update:value="boundary(check, $event)"
|
||||
/>
|
||||
<NSelect
|
||||
v-model:value="check.subjectRef"
|
||||
:options="
|
||||
[
|
||||
...new Set(
|
||||
sources(check)
|
||||
.map(s => s.subjectRef)
|
||||
.filter((s): s is string => !!s)
|
||||
)
|
||||
].map(value => ({ label: value, value }))
|
||||
"
|
||||
:disabled="disabled"
|
||||
placeholder="选择正式主体"
|
||||
aria-label="状态主体"
|
||||
/>
|
||||
<NSelect v-model:value="check.dimension" :options="dimensions" :disabled="disabled" aria-label="状态维度" />
|
||||
<NInput
|
||||
v-model:value="check.before"
|
||||
:disabled="disabled"
|
||||
:maxlength="500"
|
||||
placeholder="前镜观察值,不可辨认留空"
|
||||
aria-label="前镜观察"
|
||||
@update:value="check.before = $event?.trim() ? $event : null"
|
||||
/>
|
||||
<NInput
|
||||
v-model:value="check.after"
|
||||
:disabled="disabled"
|
||||
:maxlength="500"
|
||||
placeholder="后镜观察值,不可辨认留空"
|
||||
aria-label="后镜观察"
|
||||
@update:value="check.after = $event?.trim() ? $event : null"
|
||||
/>
|
||||
<NSelect
|
||||
v-model:value="check.verdict"
|
||||
:options="verdicts"
|
||||
:disabled="disabled"
|
||||
placeholder="明确选择人工意见"
|
||||
aria-label="人工状态意见"
|
||||
/>
|
||||
<NSelect
|
||||
v-model:value="check.sourceIds"
|
||||
multiple
|
||||
:options="
|
||||
sources(check).map(s => ({
|
||||
value: s.id,
|
||||
label: `${s.shotId === check.fromShotId ? '前镜' : '后镜'} · ${s.subjectRef ?? '镜头'} · ${s.field} · ${s.text}${s.executable ? '(本镜实际执行)' : ''}`
|
||||
}))
|
||||
"
|
||||
:disabled="disabled"
|
||||
placeholder="选择原始正式依据"
|
||||
aria-label="正式状态依据"
|
||||
/>
|
||||
<NInput
|
||||
v-model:value="check.evidence"
|
||||
type="textarea"
|
||||
:maxlength="1000"
|
||||
:disabled="disabled"
|
||||
placeholder="说明像素观察如何与正式依据对应"
|
||||
aria-label="状态证据说明"
|
||||
/>
|
||||
<NInput
|
||||
:value="check.nonBlockingReason"
|
||||
:maxlength="500"
|
||||
:disabled="disabled"
|
||||
placeholder="非阻断未知的用途理由(可选,不豁免明确冲突)"
|
||||
aria-label="非阻断用途理由"
|
||||
@update:value="check.nonBlockingReason = $event.trim() || undefined"
|
||||
/>
|
||||
<NButton :disabled="disabled" @click="checks.splice(index, 1)">删除此项观察</NButton>
|
||||
</section>
|
||||
<NButton :disabled="disabled || checks.length >= 128" @click="add">添加状态观察</NButton>
|
||||
</section>
|
||||
</template>
|
||||
@@ -178,13 +178,11 @@ const canSelect = computed(
|
||||
</p>
|
||||
<IssueHint v-if="item.error" :messages="[productionMessage(item.error)]" type="error" />
|
||||
<!-- 以下是来源记录与独立的免费恢复入口 -->
|
||||
<NButton
|
||||
v-if="item.isPrimary && item.status === 'completed' && projectId"
|
||||
class="workspace-action-button mt-2"
|
||||
size="small"
|
||||
@click="sourceReviewOpen = true"
|
||||
>按当前来源人工复核</NButton
|
||||
>
|
||||
<div v-if="item.isPrimary && item.status === 'completed' && projectId" class="mt-4 mb-3">
|
||||
<NButton class="workspace-action-button" size="small" @click="sourceReviewOpen = true"
|
||||
>按当前来源人工复核</NButton
|
||||
>
|
||||
</div>
|
||||
<p v-if="item.inputSnapshotStatus" class="mt-2 text-xs text-muted">
|
||||
{{
|
||||
{ recorded: '已保存生成输入', 'not-recorded': '历史生成输入未记录', invalid: '生成输入证据已失效' }[
|
||||
@@ -215,8 +213,13 @@ const canSelect = computed(
|
||||
>恢复已生成图片</NButton
|
||||
>
|
||||
<p class="mt-2 text-[10px] text-muted">{{ formatDate(item.createdAt) }}</p>
|
||||
<div v-if="item.status === 'completed' && item.imageUrl" class="mt-2 flex flex-wrap items-center gap-3">
|
||||
<NButton v-if="!wrongCanvas && !stale" text size="small" @click="emit('quality')">
|
||||
<div v-if="item.status === 'completed' && item.imageUrl" class="mt-4 flex flex-wrap items-center gap-2">
|
||||
<NButton
|
||||
v-if="!wrongCanvas && !stale"
|
||||
class="workspace-action-button"
|
||||
size="small"
|
||||
@click="emit('quality')"
|
||||
>
|
||||
{{
|
||||
vision.state.value.active || vision.state.value.unknown || vision.uncertain.value
|
||||
? '查看审核进度'
|
||||
@@ -225,14 +228,18 @@ const canSelect = computed(
|
||||
</NButton>
|
||||
<NButton
|
||||
v-if="item.source !== 'provider_variant' && !wrongCanvas && !stale"
|
||||
text
|
||||
class="workspace-action-button"
|
||||
size="small"
|
||||
:disabled="blocked"
|
||||
:loading="editing"
|
||||
@click="emit('edit')"
|
||||
>编辑此首帧</NButton
|
||||
>
|
||||
<NButton v-if="item.status === 'completed'" text size="small" @click="emit('history')"
|
||||
<NButton
|
||||
v-if="item.status === 'completed'"
|
||||
class="workspace-action-button"
|
||||
size="small"
|
||||
@click="emit('history')"
|
||||
>查看首帧校验历史</NButton
|
||||
>
|
||||
<NButton v-if="canSelect" :disabled="blocked" text size="small" @click="emit('select')">
|
||||
|
||||
@@ -362,14 +362,11 @@ const optionsExpanded = ref<string[]>(['options'])
|
||||
v-if="validationPlan.data.value && action === 'validate'"
|
||||
:plan="validationPlan.data.value"
|
||||
/>
|
||||
<NButton
|
||||
v-if="visionKey"
|
||||
class="mt-3"
|
||||
:loading="validationPlan.loading.value"
|
||||
:disabled="pending"
|
||||
@click="validationPlan.refresh"
|
||||
>刷新免费审核计划</NButton
|
||||
>
|
||||
<div v-if="visionKey" class="py-4">
|
||||
<NButton :loading="validationPlan.loading.value" :disabled="pending" @click="validationPlan.refresh"
|
||||
>刷新免费审核计划</NButton
|
||||
>
|
||||
</div>
|
||||
<p v-if="validationPlan.error.value" class="mt-2 text-sm text-muted">
|
||||
{{ userFacingText(validationPlan.error.value) }}
|
||||
</p>
|
||||
@@ -545,6 +542,7 @@ const optionsExpanded = ref<string[]>(['options'])
|
||||
:keyframe-id="target.assetId"
|
||||
:observation="vision"
|
||||
:disabled="disabled || pending"
|
||||
class="mt-5"
|
||||
initial-open
|
||||
@reviewed="onReviewed"
|
||||
@busy="authorizationPending = $event"
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
<script setup lang="ts">
|
||||
import { RouterLink } from 'vue-router'
|
||||
import { videoOperationAllowed } from '../video-permissions'
|
||||
import FeedbackMessage from '../../../components/ui/FeedbackMessage.vue'
|
||||
|
||||
@@ -682,6 +683,19 @@ defineExpose({ inspectSpecs, inspecting })
|
||||
</ContextNotice>
|
||||
|
||||
<!-- 以下是项目制作中的视频提示词模块 -->
|
||||
<!-- 以下是连续性门禁的原审核处理入口 -->
|
||||
<RouterLink
|
||||
v-if="
|
||||
[
|
||||
...(keyframeReadiness?.issues ?? []),
|
||||
...(promptReadiness?.issues ?? []),
|
||||
...(videoReadiness?.issues ?? [])
|
||||
].some(issue => issue.code === 'continuity_review_required')
|
||||
"
|
||||
class="workspace-action-button"
|
||||
:to="`/projects/${projectId}/storyboard?action=continuity`"
|
||||
>复核连续性有序组</RouterLink
|
||||
>
|
||||
<div v-if="!keyframeOnly" class="production-stage">
|
||||
<div class="production-stage-heading">
|
||||
<div>
|
||||
|
||||
@@ -0,0 +1,155 @@
|
||||
import { request } from '../../lib/http'
|
||||
/** 一次明确批准的估算费用,不是账单或硬上限。 */
|
||||
export interface JointApproval {
|
||||
/** 精确用途及计划。 */ plan: {
|
||||
/** 固定用途。 */ purpose: 'continuity'
|
||||
/** 原签收。 */ reviewId: string
|
||||
/** 总计划摘要。 */ fingerprint: string
|
||||
}
|
||||
/** 批准人。 */ approvedBy: string
|
||||
/** 操作人。 */ operator: string
|
||||
/** 真实批准材料。 */ approvalSha256: string
|
||||
/** 原批准费用范围。 */ feeScope: {
|
||||
/** 币种。 */ currency: 'CNY'
|
||||
/** 最低估算。 */ estimatedMin: number
|
||||
/** 最高估算。 */ estimatedMax: number
|
||||
/** 请求次数。 */ maxRequests: 1
|
||||
}
|
||||
}
|
||||
/** 联合审核精确免费计划,不能替代单镜或人工签收。 */
|
||||
export interface JointPlan {
|
||||
/** 项目。 */ projectId: string
|
||||
/** 原签收。 */ reviewId: string
|
||||
/** 总计划摘要。 */ fingerprint: string
|
||||
/** 实际模型。 */ model: string
|
||||
/** 当前可执行状态。 */ status: 'ready' | 'blocked' | 'reusable'
|
||||
/** 仅模型输入核验通过。 */ executionAvailable: boolean
|
||||
/** 仍须逐次批准。 */ requiresExplicitApproval: boolean
|
||||
/** 本次免费请求的计费数。 */ paidCalls: number
|
||||
/** 最大拟请求次数。 */ proposedMaximumProviderRequests: number
|
||||
/** 新请求数。 */ additionalProviderRequests: number
|
||||
/** 费用估算。 */ feeEstimate: {
|
||||
/** 金额未知不是零元。 */ amount: number | null
|
||||
/** 原因。 */ reason: string
|
||||
/** 币种。 */ currency: string
|
||||
}
|
||||
/** 型号及输入核验。 */ capability: {
|
||||
/** 是否核验。 */ verified: boolean
|
||||
/** 说明。 */ reason: string
|
||||
/** 检查时间。 */ checkedAt?: string
|
||||
/** 容量。 */ requestBodyUpperBound?: number
|
||||
/** 文档。 */ documentation?: unknown
|
||||
}
|
||||
/** 刷新恢复用原任务。 */ latestTask: {
|
||||
/** 任务。 */ validationTaskId: string
|
||||
/** 原执行。 */ executionId: string | null
|
||||
/** 状态。 */ taskStatus: string
|
||||
} | null
|
||||
/** 可复用任务。 */ reusableTaskId: string | null
|
||||
/** 原始图片顺序与全部绑定。 */ imageManifest: Array<{
|
||||
/** 图号。 */ imageNumber: number
|
||||
/** 用途。 */ label: string
|
||||
/** 像素证据。 */ pixels: {
|
||||
/** 摘要。 */ sha256: string
|
||||
/** 宽。 */ width: number
|
||||
/** 高。 */ height: number
|
||||
}
|
||||
/** 全部绑定。 */ bindings: Array<{
|
||||
/** 镜头。 */ shotId: string
|
||||
/** 图像。 */ imageId: string
|
||||
/** 职责。 */ role: 'frame' | 'spatial_reference'
|
||||
/** 布局编号。 */ spatialLayoutId?: string
|
||||
/** 布局版本。 */ spatialLayoutVersion?: string
|
||||
}>
|
||||
}>
|
||||
/** 最终脱敏输入,原样追溯。 */ request: Record<string, unknown>
|
||||
/** 限制说明。 */ limitation?: string
|
||||
}
|
||||
/** 持久化联合任务,执行完成与业务通过独立。 */
|
||||
export interface JointTask {
|
||||
/** 任务。 */ validationTaskId: string
|
||||
/** 所属签收。 */ reviewId: string
|
||||
/** 原执行。 */ executionId: string
|
||||
/** 任务状态。 */ taskStatus: string
|
||||
/** 执行状态。 */ workflowStatus: string
|
||||
/** 当前业务结论。 */ status: string
|
||||
/** 来源当前性。 */ current: boolean
|
||||
/** 原计划。 */ planFingerprint: string
|
||||
/** 可显式恢复。 */ resumeAvailable: boolean
|
||||
/** 是否会发送此前未发请求。 */ requiresNewProviderRequest: boolean
|
||||
/** 固定禁止自动重试。 */ retryAutomatically: false
|
||||
/** 原机器业务评估。 */ diagnosis: unknown
|
||||
/** 机器原解析,不能冒充当前事实。 */ machineObservation: unknown
|
||||
/** 范围摘要。 */ summary: string | null
|
||||
/** 估算费用,非账单。 */ feeScope: JointApproval['feeScope']
|
||||
/** 步骤及用量。 */ step: unknown
|
||||
}
|
||||
/**
|
||||
* 联合审核原范围路径。
|
||||
* @param p 项目
|
||||
* @returns 项目下的连续性路径
|
||||
*/
|
||||
function root(p: string) {
|
||||
return `/projects/${encodeURIComponent(p)}/storyboard-keyframes/continuity`
|
||||
}
|
||||
/** 仅用户主动触发批准、执行和恢复;无重试中间层。 */
|
||||
export const jointApi = {
|
||||
/**
|
||||
* 免费精确预检。
|
||||
* @param p 项目
|
||||
* @param r 原签收
|
||||
* @param expected 已读计划
|
||||
* @param signal 取消信号
|
||||
* @returns 精确计划
|
||||
*/
|
||||
preview: (p: string, r: string, expected?: string, signal?: AbortSignal) =>
|
||||
request<JointPlan>(
|
||||
`${root(p)}/reviews/${encodeURIComponent(r)}/vision/preview${expected ? '?expectedFingerprint=' + encodeURIComponent(expected) : ''}`,
|
||||
{ signal, timeoutMs: 0 }
|
||||
),
|
||||
/**
|
||||
* 读取原任务。
|
||||
* @param p 项目
|
||||
* @param t 任务
|
||||
* @param signal 取消信号
|
||||
* @returns 原任务结果
|
||||
*/
|
||||
task: (p: string, t: string, signal?: AbortSignal) =>
|
||||
request<JointTask>(`${root(p)}/vision-tasks/${encodeURIComponent(t)}`, { signal }),
|
||||
/**
|
||||
* 独立登记批准,不执行。
|
||||
* @param p 项目
|
||||
* @param r 原签收
|
||||
* @param body 真实批准
|
||||
* @returns 本次批准编号
|
||||
*/
|
||||
authorize: (p: string, r: string, body: JointApproval) =>
|
||||
request<{ authorizationId: string; planFingerprint: string }>(
|
||||
`${root(p)}/reviews/${encodeURIComponent(r)}/vision/authorizations`,
|
||||
{ method: 'POST', body }
|
||||
),
|
||||
/**
|
||||
* 单次显式执行。
|
||||
* @param p 项目
|
||||
* @param r 原签收
|
||||
* @param authorizationId 本次批准
|
||||
* @returns 原任务句柄
|
||||
*/
|
||||
execute: (p: string, r: string, authorizationId: string) =>
|
||||
request<{ validationTaskId: string; executionId: string; status: string; reused: boolean }>(
|
||||
`${root(p)}/reviews/${encodeURIComponent(r)}/vision`,
|
||||
{ method: 'POST', body: { authorizationId } }
|
||||
),
|
||||
/**
|
||||
* 显式恢复原任务。
|
||||
* @param p 项目
|
||||
* @param t 原任务
|
||||
* @param expectedFingerprint 原任务精确计划
|
||||
* @returns 原任务句柄
|
||||
*/
|
||||
resume: (p: string, t: string, expectedFingerprint: string) =>
|
||||
request<{ validationTaskId: string; executionId: string }>(
|
||||
`${root(p)}/vision-tasks/${encodeURIComponent(t)}/resume`,
|
||||
{ method: 'POST', body: { expectedFingerprint } }
|
||||
)
|
||||
}
|
||||
@@ -0,0 +1,85 @@
|
||||
/** 人工签收的具体维度,不能扩大为所有连续性通过。 */
|
||||
export const stateDimensions = {
|
||||
identity: '身份',
|
||||
position: '位置',
|
||||
pose: '姿态',
|
||||
gaze: '视线',
|
||||
holder: '持有者',
|
||||
prop_position: '道具位置',
|
||||
openness: '开关状态',
|
||||
visibility: '出入画',
|
||||
camera: '机位',
|
||||
count: '数量',
|
||||
structure: '结构',
|
||||
topology: '连接关系',
|
||||
action: '动作'
|
||||
} as const
|
||||
/** 服务提供的正式状态上下文。 */
|
||||
export interface StateContext {
|
||||
/** 正式镜头。 */ shotId: string
|
||||
/** 正式编译事实。 */ generation: Record<string, unknown>
|
||||
/** 正式动作。 */ requiredActions?: Array<{
|
||||
/** 编号。 */ id: string
|
||||
/** 原文。 */ description: string
|
||||
/** 类型。 */ kind: string
|
||||
/** 是否本镜执行。 */ mustPerformInShot: boolean
|
||||
}>
|
||||
/** 可选择的正式依据。 */ sources: Array<{
|
||||
/** 原编号。 */ id: string
|
||||
/** 所属镜头。 */ shotId: string
|
||||
/** 类型。 */ kind: string
|
||||
/** 主体。 */ subjectRef: string | null
|
||||
/** 字段。 */ field: string
|
||||
/** 原文。 */ text: string
|
||||
/** 是否执行动作。 */ executable: boolean
|
||||
}>
|
||||
}
|
||||
/** 用户有界人工观察,空值表示不可辨认。 */
|
||||
export interface StateCheck {
|
||||
/** 前镜。 */ fromShotId: string
|
||||
/** 后镜。 */ toShotId: string
|
||||
/** 正式主体。 */ subjectRef: string
|
||||
/** 所选维度。 */ dimension: keyof typeof stateDimensions
|
||||
/** 前镜观察。 */ before: string | null
|
||||
/** 后镜观察。 */ after: string | null
|
||||
/** 人工意见,未选时为空。 */ verdict: 'consistent' | 'conflict' | 'unknown' | null
|
||||
/** 正式依据。 */ sourceIds: string[]
|
||||
/** 像素与依据的对应解释。 */ evidence: string
|
||||
/** 可选非阻断理由。 */ nonBlockingReason?: string
|
||||
}
|
||||
/**
|
||||
* 只检查输入完整性和正式归属,业务结论由服务端决定。
|
||||
* @param checks 用户观察
|
||||
* @param contexts 正式上下文
|
||||
* @returns 是否可提交免费诊断
|
||||
*/
|
||||
export function validStateChecks(checks: StateCheck[], contexts: StateContext[]) {
|
||||
const keys = checks.map(c => JSON.stringify([c.fromShotId, c.toShotId, c.subjectRef, c.dimension]))
|
||||
return (
|
||||
checks.length > 0 &&
|
||||
checks.length <= 128 &&
|
||||
new Set(keys).size === checks.length &&
|
||||
checks.every(c => {
|
||||
const index = contexts.findIndex(x => x.shotId === c.fromShotId)
|
||||
const pair = contexts.slice(index, index + 2)
|
||||
const sources = pair.flatMap(x => x.sources)
|
||||
return (
|
||||
index >= 0 &&
|
||||
contexts[index + 1]?.shotId === c.toShotId &&
|
||||
sources.some(s => s.subjectRef === c.subjectRef) &&
|
||||
c.dimension in stateDimensions &&
|
||||
!!c.verdict &&
|
||||
!!c.evidence.trim() &&
|
||||
c.evidence.length <= 1000 &&
|
||||
c.sourceIds.length <= 20 &&
|
||||
new Set(c.sourceIds).size === c.sourceIds.length &&
|
||||
c.sourceIds.every(id => sources.some(s => s.id === id)) &&
|
||||
[c.before, c.after].every(
|
||||
v =>
|
||||
v === null ||
|
||||
(!!v.trim() && v.length <= 500 && (c.dimension !== 'count' || /^(0|[1-9]\d*)$/.test(v)))
|
||||
)
|
||||
)
|
||||
})
|
||||
)
|
||||
}
|
||||
@@ -1,3 +1,4 @@
|
||||
import type { StateCheck, StateContext } from './continuity-state'
|
||||
import type { SpatialLayoutConstraint } from './layout-api'
|
||||
import type { ShotDirection } from '../storyboard/types'
|
||||
|
||||
@@ -20,12 +21,14 @@ export interface GeometryFrameObservation {
|
||||
}
|
||||
/** 绑定本次正式图组指纹的人工观察。 */
|
||||
export interface ContinuityObservation {
|
||||
/** 显式人工状态范围。 */ stateChecks?: StateCheck[]
|
||||
/** 最近一次诊断证据指纹。 */ expectedFingerprint: string
|
||||
/** 两个不同的稳定地标。 */ landmarks: [string, string]
|
||||
/** 按正式镜头顺序逐镜观察。 */ frames: GeometryFrameObservation[]
|
||||
}
|
||||
/** 同一场景形态下的相邻两到三镜请求。 */
|
||||
export interface ContinuityInput {
|
||||
/** 省略保持原固定几何范围。 */ scope?: 'geometry_and_state'
|
||||
/** 正式顺序的镜头编号。 */ shotIds: string[]
|
||||
/** 正式场景形态编号。 */ sceneFormId: string
|
||||
/** 第二次诊断时提交,不自动生成。 */ observation?: ContinuityObservation
|
||||
@@ -71,6 +74,10 @@ export interface ContinuityFrame {
|
||||
}
|
||||
/** 免费诊断结果,不修改单镜质量和 Primary。 */
|
||||
export interface ContinuityDiagnosis {
|
||||
/** 正式状态依据。 */ stateContext?: StateContext[]
|
||||
/** 人工逐项结果。 */ stateChecks?: Array<StateCheck & { /** 当前业务结论。 */ status: string }>
|
||||
/** 本次签收范围。 */ scope?: string
|
||||
/** 审阅方法。 */ reviewMethod?: string
|
||||
/** 项目归属。 */ projectId: string
|
||||
/** 场景形态范围。 */ sceneFormId: string
|
||||
/** 当前图组。 */ frames: ContinuityFrame[]
|
||||
|
||||
@@ -62,6 +62,7 @@ export function isActiveVideo(item: ShotVideo): boolean {
|
||||
*/
|
||||
export function issueLabel(code: ProductionIssueCode): string {
|
||||
const labels: Record<ProductionIssueCode, string> = {
|
||||
continuity_review_required: '连续性审核尚未解决',
|
||||
invalid_generation_spec: '生成规格不完整',
|
||||
missing_visual_style: '缺少视觉风格',
|
||||
missing_reference: '缺少主体参考图',
|
||||
|
||||
@@ -46,6 +46,9 @@ export function productionMessage(message: string): string {
|
||||
* @returns 页面展示的原因与处理建议
|
||||
*/
|
||||
export function productionIssueText(issue: ProductionIssue): string {
|
||||
if (issue.code === 'failed_keyframe_quality') return '首帧画面检查未通过,请重新生成或修复首帧。'
|
||||
if (issue.code === 'continuity_review_required')
|
||||
return productionMessage(issue.reason) || '连续性审核尚未解决,请复核对应有序组。'
|
||||
if (issue.code === 'failed_keyframe_quality')
|
||||
return productionMessage(issue.reason) || '首帧当前质量尚未满足要求,请核对审核状态。'
|
||||
return productionMessage(issue.reason) || issueLabel(issue.code)
|
||||
}
|
||||
@@ -6,6 +6,8 @@ export type ProductionReadinessStatus = 'ready' | 'skipped' | 'in_progress' | 'b
|
||||
|
||||
/** 三个阶段可能返回的正式问题代码。 */
|
||||
export type ProductionIssueCode =
|
||||
/** 已存有序组连续性尚未解决。 */
|
||||
| 'continuity_review_required'
|
||||
| 'invalid_generation_spec'
|
||||
| 'missing_visual_style'
|
||||
| 'missing_reference'
|
||||
|
||||
@@ -434,6 +434,11 @@ onScopeDispose(() => {
|
||||
@click="router.push(`/projects/${id}/${currentAccess.nextPath}`)"
|
||||
>{{ currentAccess.nextLabel || '前往上一步' }}</NButton
|
||||
>
|
||||
<NButton
|
||||
v-if="currentAccess?.reason.includes('连续性') && stageAccess.sections.value.storyboard.enabled"
|
||||
@click="router.push(`/projects/${id}/storyboard?action=continuity`)"
|
||||
>复核连续性有序组</NButton
|
||||
>
|
||||
<!-- 以下是手动刷新项目状态模块,图标位常驻以保持加载前后的按钮尺寸 -->
|
||||
<WorkspaceRefreshButton
|
||||
v-if="currentAccess"
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
<script setup lang="ts">
|
||||
import { inject } from 'vue'
|
||||
import { routeLocationKey } from 'vue-router'
|
||||
import ContinuityReviewDrawer from '../production/components/ContinuityReviewDrawer.vue'
|
||||
import WorkspaceActionTooltip from '../../components/ui/WorkspaceActionTooltip.vue'
|
||||
import { ScanEye } from '@lucide/vue'
|
||||
@@ -44,6 +46,15 @@ import type { ProjectDurationBudgetSummary } from '../projects/types'
|
||||
const detailTab = ref('design')
|
||||
/** 即使生产入口受来源门禁限制,也可免费核对连续性。 */
|
||||
const continuityOpen = ref(false)
|
||||
/** 连续性阻断入口只打开原审核界面,不自动诊断或签收。 */
|
||||
const continuityRoute = inject(routeLocationKey, undefined)
|
||||
watch(
|
||||
() => continuityRoute?.query.action,
|
||||
action => {
|
||||
if (action === 'continuity') continuityOpen.value = true
|
||||
},
|
||||
{ immediate: true }
|
||||
)
|
||||
/** 动作审计只能定位当前项目正式列表中的镜头。 */
|
||||
const feedback = useActionMessage()
|
||||
/**
|
||||
|
||||
Reference in new issue
Block a user