+
当前质量:{{ effectiveQualityLabels[quality.status.value] }}
@@ -109,45 +145,56 @@ const statusLabels: Record = {
@click="form.loadPreview"
>免费预检当前来源
-
- 回读人工记录
+
+
+
+ 回读人工记录
+
-
-
- 原件 SHA:{{ form.preview.value.originalPixels.sha256 }}
-
- {{
- JSON.stringify(
- {
- originalProviderInput: form.preview.value.originalProviderInput,
- historicalVision: form.preview.value.historicalVision,
- sourceChanges: form.preview.value.sourceChanges
- },
- null,
- 2
- )
- }}
-
+
+
+
+
+
+
+ 已读取当前有效的原观察和依据,无需重复填写或保存;只需修改变化项,未知仍保持未知。
+
+
+
+
= {
:value="form.preview.value.applicabilityBasis.facts"
/>
-
+
+
- 比较参考 {{ observation.imageNumber }}
-
-
- {{ binding.subjectRef }} · {{ userFacingText(binding.role) }} {{ binding.viewDescription }}
- {{ binding.spatialLayoutVersion }}
-
-
-
{{ label }}
-
+ 比较参考 {{ observation.imageNumber }}
+
+
+ {{ summary }}
+
+
+
+
+
+
+
+
+
+ {{ sourceFindingLabels[field] }}
+
+
+
+
+
-
= {
}}
-
-
-
-
-
- 明确批准上述完整计划和费用范围
-
- 本次授权编号:{{ form.authorizationId.value }}
-
- 明确执行本次独立审核,可能产生上述费用
+
+
+
+
+
+
明确批准上述完整计划和费用范围
+
+ 本次授权编号:{{ form.authorizationId.value }}
+
+
明确执行本次独立审核,可能产生上述费用
+
-
-
+
+
参考 {{ item.imageNumber }} ·
{{
sourceFindingLabels[item.dimension as keyof typeof sourceFindingLabels] ?? item.dimension
@@ -374,6 +459,7 @@ const statusLabels: Record = {
-
-
- 独立新来源审核 · 人工记录 {{ record.sourceReviewId }} · 原任务 {{ record.id }} ·
- {{ userFacingText(record.status) }}
-
-
-
{{ resultLabel }}
-
- {{
- JSON.stringify(form.result.value, null, 2)
- }}
+
+
+
+
+ 独立新来源审核 · 人工记录 {{ record.sourceReviewId }} · 原任务 {{ record.id }} ·
+ {{ userFacingText(record.status) }}
+
+
+
+
+ {{
+ JSON.stringify(form.result.value, null, 2)
+ }}
+
- 只读刷新审核历史
+ 只读刷新审核历史
关闭
= {
>保存人工观察(免费)
= {
+
+
diff --git a/src/features/production/quality-api.ts b/src/features/production/quality-api.ts
index c6c8dea..e47c65a 100644
--- a/src/features/production/quality-api.ts
+++ b/src/features/production/quality-api.ts
@@ -176,14 +176,35 @@ export const qualityApi = {
`/storyboard-shots/${encodeURIComponent(shotId)}/keyframes/${encodeURIComponent(keyframeId)}/quality-review/reject`,
{ method: 'POST', body }
),
- keyframeHistory: (shotId: string, keyframeId: string, signal?: AbortSignal, projectId?: string) =>
- request
(
+ /**
+ * 读取公开审核历史,把正式 output 中的来源关联补充到现有消费字段。
+ * @param shotId 正式镜头
+ * @param keyframeId 当前候选
+ * @param signal 取消信号
+ * @param projectId 项目范围
+ * @returns 保留原始输出的审核历史
+ */
+ keyframeHistory: async (shotId: string, keyframeId: string, signal?: AbortSignal, projectId?: string) => {
+ const records = await request(
keyframeScope(
`/storyboard-shots/${encodeURIComponent(shotId)}/keyframes/${encodeURIComponent(keyframeId)}/validations`,
projectId
),
{ signal }
- ),
+ )
+ return records.map(record => {
+ const output = record.output && typeof record.output === 'object' ? record.output : null
+ return {
+ ...record,
+ ...(typeof output?.sourceReviewId === 'string' && output.sourceReviewId.trim()
+ ? { sourceReviewId: record.sourceReviewId ?? output.sourceReviewId }
+ : {}),
+ ...(typeof output?.evidenceKind === 'string'
+ ? { evidenceKind: record.evidenceKind ?? output.evidenceKind }
+ : {})
+ }
+ })
+ },
/**
* 启动后台首帧质量生成,不把任务开始当作视觉通过。
* @param projectId 正式项目 ID
diff --git a/src/features/production/useSourceReview.ts b/src/features/production/useSourceReview.ts
index 39b271d..61ea516 100644
--- a/src/features/production/useSourceReview.ts
+++ b/src/features/production/useSourceReview.ts
@@ -39,6 +39,21 @@ export function useSourceReview(key: Ref) {
const observations = ref([])
/** 人工证据范围,不默认豁免未知。 */
const assessments = ref([])
+ /** 仅从仍有效的正式记录恢复原观察,不新增人工结论。 */
+ const restored = ref(false)
+ /** 原记录未变化时不再要求重复保存,只有编辑后才显示保存入口。 */
+ const needsSave = computed(
+ () =>
+ !restored.value ||
+ !record.value ||
+ JSON.stringify([reviewer.value, reason.value, observations.value, assessments.value]) !==
+ JSON.stringify([
+ record.value.review.reviewer,
+ record.value.review.reason,
+ record.value.review.observations,
+ record.value.review.applicability?.assessments ?? []
+ ])
+ )
/** 正式授权只在本次页面内保留。 */
const authorizationId = ref('')
/** 批准人。 */
@@ -84,6 +99,7 @@ export function useSourceReview(key: Ref) {
targetMatched.value = false
plan.value = null
reviewId.value = ''
+ restored.value = false
reviewer.value = ''
reason.value = ''
observations.value = []
@@ -112,6 +128,7 @@ export function useSourceReview(key: Ref) {
watch(
reviewId,
() => {
+ restored.value = false
targetMatched.value = false
record.value = null
plan.value = null
@@ -144,6 +161,7 @@ export function useSourceReview(key: Ref) {
} catch (cause) {
if (valid()) {
if (cause instanceof ApiError && cause.status === 409) {
+ restored.value = false
plan.value = null
authorizationId.value = ''
approved.value = false
@@ -156,9 +174,40 @@ export function useSourceReview(key: Ref) {
if (target === key.value && cycle === epoch) pending.value = ''
}
}
+ /**
+ * 只恢复与当前来源及参考范围完全一致的原人工观察,未知保持原值。
+ * @param saved 正式回读的记录
+ * @param comparison 当前免费比较计划
+ * @returns 是否恢复了有效原稿
+ */
+ function restoreRecord(saved: SourceReviewRecord, comparison: SourceReviewPreview) {
+ const [shot, image, project] = JSON.parse(key.value) as string[]
+ const numbers = comparison.currentReferenceInput.references.map(r => r.imageNumber).toSorted()
+ targetMatched.value =
+ saved.current &&
+ comparison.projectId === project &&
+ comparison.shotId === shot &&
+ comparison.keyframeId === image &&
+ comparison.fingerprint === saved.review.expectedFingerprint &&
+ JSON.stringify(saved.review.observations.map(o => o.imageNumber).toSorted()) === JSON.stringify(numbers) &&
+ (!saved.review.applicability ||
+ saved.review.applicability.expectedBasisFingerprint === comparison.applicabilityBasis?.fingerprint)
+ restored.value = false
+ if (!targetMatched.value) return false
+ observations.value = JSON.parse(JSON.stringify(saved.review.observations)) as SourceObservation[]
+ assessments.value = JSON.parse(
+ JSON.stringify(saved.review.applicability?.assessments ?? [])
+ ) as EvidenceAssessment[]
+ reviewer.value = saved.review.reviewer
+ reason.value = saved.review.reason
+ restored.value = true
+ return true
+ }
/** 免费预检;只有用户操作才编译参考。 */
async function loadPreview() {
await run('preview', async ([s, k, p], signal, valid) => {
+ const existingReviewId = reviewId.value.trim()
+ restored.value = false
preview.value = null
assessments.value = []
plan.value = null
@@ -171,6 +220,8 @@ export function useSourceReview(key: Ref) {
throw new Error('比较计划不属于当前首帧。')
reviewId.value = ''
preview.value = data
+ reviewer.value = ''
+ reason.value = ''
record.value = null
plan.value = null
observations.value = data.currentReferenceInput.references.map(reference => ({
@@ -184,16 +235,32 @@ export function useSourceReview(key: Ref) {
},
note: ''
}))
+ // 只读寻找原任务关联的最近来源记录;没有正式记录时继续保留空白未知。
+ if (!vision.history.data.value && !vision.history.error.value) await vision.history.refresh()
+ if (!valid()) return
+ const savedId =
+ existingReviewId || vision.history.data.value?.find(item => item.sourceReviewId)?.sourceReviewId
+ if (savedId) {
+ reviewId.value = savedId
+ const saved = await sourceReviewApi.get(p!, savedId, signal)
+ if (!valid()) return
+ record.value = saved
+ restoreRecord(saved, data)
+ }
})
+ if (restored.value) await loadPlan()
}
/** 免费回读原人工记录;原结论保持不变。 */
async function readRecord() {
+ restored.value = false
await run('read', async ([, , p], signal, valid) => {
const data = await sourceReviewApi.get(p!, reviewId.value.trim(), signal)
if (!valid()) return
const [s, k] = JSON.parse(key.value) as string[]
record.value = data
preview.value = null
+ reviewer.value = ''
+ reason.value = ''
observations.value = []
assessments.value = []
targetMatched.value = false
@@ -212,15 +279,12 @@ export function useSourceReview(key: Ref) {
},
note: ''
}))
- targetMatched.value =
- comparison.projectId === p &&
- comparison.shotId === s &&
- comparison.keyframeId === k &&
- comparison.fingerprint === data.review.expectedFingerprint
+ restoreRecord(data, comparison)
plan.value = null
authorizationId.value = ''
}
})
+ if (restored.value) await loadPlan()
}
/** 保存全部人工观察,既有生产徽标不会据此变更。 */
async function save() {
@@ -273,7 +337,7 @@ export function useSourceReview(key: Ref) {
!controller?.signal.aborted
) {
record.value = next
- targetMatched.value = true
+ if (preview.value) restoreRecord(next, preview.value)
authorizationId.value = ''
plan.value = null
void vision.history.refresh()
@@ -379,6 +443,8 @@ export function useSourceReview(key: Ref) {
})
}
return {
+ needsSave,
+ restored,
targetMatched,
vision,
preview,
diff --git a/src/features/storyboard/StoryboardPage.vue b/src/features/storyboard/StoryboardPage.vue
index 926aa01..2c2929c 100644
--- a/src/features/storyboard/StoryboardPage.vue
+++ b/src/features/storyboard/StoryboardPage.vue
@@ -715,7 +715,7 @@ const rules = { concurrency: integerRule('批量并发'), maxRepairAttempts: int
>设计与状态参考图与提示词动作与视线首帧
-
+
-
-
- 正在检查本镜生成条件…
-
+
-
+
-
+
-
+
-
+
{
it('业务面板、列表分组和标签以背景区分,保留键盘焦点与选中指示', () => {
// happy-dom 不计算布局;此项保护 CSS 契约,不能替代浏览器视觉验收。
const css = readAllStyles()
- expect(css).not.toMatch(/border-radius:\s*[1-9]/)
+ // 用户明确确认的首帧状态圆章是唯一例外,普通面板、按钮和标签仍必须保持直角。
+ const roundedRules = [...css.matchAll(/([^{}]+)\{([^{}]*)\}/g)].filter(([, , declarations]) =>
+ /border-radius:\s*[1-9]/.test(declarations!)
+ )
+ expect(roundedRules.map(([, selector]) => selector!.replace(/\/\*[\s\S]*?\*\//g, '').trim())).toEqual([
+ '.production-condition-seal'
+ ])
+ expect(roundedRules[0]?.[2]).toMatch(/border-radius:\s*50%;/)
// 主体身份的新流程用单条分隔线区分下一步操作,普通业务面板仍保持平面表面。
const separators = [...css.matchAll(/([^{}]+)\{([^{}]*)\}/g)]
.filter(([, , declarations]) =>
diff --git a/tests/features/production/source-review.test.ts b/tests/features/production/source-review.test.ts
index b30d094..80e7c10 100644
--- a/tests/features/production/source-review.test.ts
+++ b/tests/features/production/source-review.test.ts
@@ -298,3 +298,116 @@ it('当前非阻断来源可查看独立计划,服务端明确拒绝时关闭
expect(mock.calls.length).toBe(before)
expect(form.plan.value).toBeNull()
})
+
+/** 当前有效记录可以复用原观察,不把未知改成通过或自动批准。 */
+it('回读有效记录保留未知和原理由,未编辑无需重复保存', async () => {
+ const mock = sourceMock('non_blocking_unknown')
+ Object.assign(mock.record, { validationEligible: true })
+ mock.record.review.observations[0]!.finding.structure = 'unknown'
+ vi.stubGlobal('fetch', mock.fetcher)
+ const form = scope.run(() => useSourceReview(ref(JSON.stringify(['s', 'k', 'p']))))!
+ await flushPromises()
+ form.reviewId.value = 'r'
+ await form.readRecord()
+ expect(form.restored.value).toBe(true)
+ expect(form.observations.value).toEqual(mock.record.review.observations)
+ expect(form.observations.value[0]!.finding.structure).toBe('unknown')
+ expect(form.reviewer.value).toBe('审核人')
+ expect(form.reason.value).toBe('理由')
+ expect(form.needsSave.value).toBe(false)
+ expect(form.plan.value?.reviewId).toBe('r')
+ expect(mock.calls.every(call => call.body === null)).toBe(true)
+ expect(form.approved.value).toBe(false)
+ expect(form.executeApproved.value).toBe(false)
+ form.observations.value[0]!.note = '补充当前可见证据'
+ expect(form.needsSave.value).toBe(true)
+})
+
+it.each(['stale', 'fingerprint', 'references'] as const)('%s 的旧观察不得回填到当前表单', async kind => {
+ const mock = sourceMock()
+ if (kind === 'stale') mock.record.current = false
+ if (kind === 'fingerprint') mock.record.review.expectedFingerprint = 'b'.repeat(64)
+ if (kind === 'references') mock.record.review.observations = []
+ vi.stubGlobal('fetch', mock.fetcher)
+ const form = scope.run(() => useSourceReview(ref(JSON.stringify(['s', 'k', 'p']))))!
+ await flushPromises()
+ form.reviewId.value = 'r'
+ await form.readRecord()
+ expect(form.restored.value).toBe(false)
+ expect(form.targetMatched.value).toBe(false)
+ expect(Object.values(form.observations.value[0]!.finding)).toEqual(Array(5).fill('unknown'))
+ expect(form.observations.value[0]!.note).toBe('')
+ expect(form.plan.value).toBeNull()
+ expect(mock.calls.every(call => call.body === null)).toBe(true)
+})
+
+it('显式免费预检会只读回查已有来源记录,匹配后直接恢复观察', async () => {
+ const mock = sourceMock()
+ vi.stubGlobal('fetch', mock.fetcher)
+ const form = scope.run(() => useSourceReview(ref(JSON.stringify(['s', 'k', 'p']))))!
+ await flushPromises()
+ form.reviewId.value = 'r'
+ await form.loadPreview()
+ expect(form.restored.value).toBe(true)
+ expect(form.needsSave.value).toBe(false)
+ expect(form.observations.value).toEqual(mock.record.review.observations)
+ expect(mock.calls.every(call => call.body === null)).toBe(true)
+})
+
+it('免费预检从原审核历史关联来源记录,无需手工输入编号', async () => {
+ const mock = sourceMock()
+ vi.stubGlobal('fetch', async (url: RequestInfo | URL, init?: RequestInit) => {
+ if (String(url).includes('/validations'))
+ return new Response(
+ JSON.stringify({
+ data: [
+ {
+ id: 'v',
+ status: 'completed',
+ output: { passed: true, sourceReviewId: 'r', evidenceKind: 'independent-source-vision' },
+ error: null,
+ steps: [],
+ startedAt: null,
+ finishedAt: null,
+ createdAt: '2026-11-09'
+ }
+ ]
+ })
+ )
+ return mock.fetcher(url, init)
+ })
+ const form = scope.run(() => useSourceReview(ref(JSON.stringify(['s', 'k', 'p']))))!
+ await flushPromises()
+ expect(form.reviewId.value).toBe('')
+ await form.loadPreview()
+ expect(form.reviewId.value).toBe('r')
+ expect(form.restored.value).toBe(true)
+ expect(form.needsSave.value).toBe(false)
+ expect(mock.calls.every(call => call.body === null)).toBe(true)
+})
+
+it('回查原记录期间切换镜头,不接收迟到观察或发起批准', async () => {
+ const mock = sourceMock()
+ let finish!: (value: Response) => void
+ vi.stubGlobal('fetch', (url: RequestInfo | URL, init?: RequestInit) =>
+ String(url).endsWith('/source-reviews/r')
+ ? new Promise(resolve => {
+ finish = resolve
+ })
+ : mock.fetcher(url, init)
+ )
+ const key = ref(JSON.stringify(['s', 'k', 'p']))
+ const form = scope.run(() => useSourceReview(key))!
+ await flushPromises()
+ form.reviewId.value = 'r'
+ const loading = form.loadPreview()
+ await flushPromises()
+ key.value = JSON.stringify(['s2', 'k2', 'p2'])
+ finish(new Response(JSON.stringify({ data: mock.record })))
+ await loading
+ expect(form.preview.value).toBeNull()
+ expect(form.restored.value).toBe(false)
+ expect(form.observations.value).toEqual([])
+ expect(form.reviewer.value).toBe('')
+ expect(mock.calls.every(call => call.body === null)).toBe(true)
+})