feat(short-drama-agent-front): 接入联合修订与图片费用审计
This commit is contained in:
1 parent
87427d9d43
commit
f6edc4eb70
52 files changed
+5060
-516
No files matched your search
@@ -171,7 +171,9 @@ export const productionApi = {
|
||||
/** 按本次请求选择的图片模型与参数预览最终输入,不创建首帧任务。 */
|
||||
previewKeyframe: (
|
||||
shotId: string,
|
||||
input: Pick<GenerateKeyframeInput, 'provider' | 'generationOptions' | 'width' | 'height'>,
|
||||
input: Pick<GenerateKeyframeInput, 'provider' | 'width' | 'height'> & {
|
||||
/** 已保存草案中的原模型参数。 */ generationOptions?: Record<string, unknown>
|
||||
},
|
||||
signal?: AbortSignal
|
||||
) =>
|
||||
request<KeyframeGenerationPreview>(`${shotPath(shotId)}/keyframe/preview`, {
|
||||
@@ -179,8 +181,15 @@ export const productionApi = {
|
||||
signal,
|
||||
body: input
|
||||
}),
|
||||
generateKeyframe: (shotId: string, input: GenerateKeyframeInput) =>
|
||||
request<ShotKeyframe | null>(`${shotPath(shotId)}/keyframe`, {
|
||||
/**
|
||||
* 提交用户确认的单镜首帧,追加许可显式绑定原项目。
|
||||
* @param shotId 正式镜头
|
||||
* @param input 已核对的模型参数及可选人工许可
|
||||
* @param projectId 原项目范围
|
||||
* @returns 原候选回执
|
||||
*/
|
||||
generateKeyframe: (shotId: string, input: GenerateKeyframeInput, projectId?: string) =>
|
||||
request<ShotKeyframe | null>(keyframeScope(`${shotPath(shotId)}/keyframe`, projectId), {
|
||||
method: 'POST',
|
||||
body: input,
|
||||
timeoutMs: 0
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
<script setup lang="ts">
|
||||
import { useQuery } from '../../../composables/useQuery'
|
||||
import { imageAuthorizationApi } from '../../image-authorization/api'
|
||||
import { formatMicros } from '../../image-authorization/model'
|
||||
import { NSelect } from 'naive-ui'
|
||||
import KeyframePreviewChecks from './KeyframePreviewChecks.vue'
|
||||
import ImageGenerationPreview from '../../subject-images/components/ImageGenerationPreview.vue'
|
||||
import { useImageGenerationPreview, type ImageGenerationSubmission } from '../../subject-images/generation-preview'
|
||||
@@ -28,6 +32,8 @@ const props = defineProps<{
|
||||
shotTitle: string
|
||||
projectId: string
|
||||
disabled: boolean
|
||||
/** 原镜头条件仍有效时允许免费核对追加许可,不放开普通未知重发。 */
|
||||
additionalAllowed?: boolean
|
||||
replacePrimary?: boolean
|
||||
/** 当前镜头的正式摄影设计。 */
|
||||
direction?: ShotDirection | null
|
||||
@@ -35,6 +41,8 @@ const props = defineProps<{
|
||||
visualState?: ShotVisualState | null
|
||||
/** 提交前已有候选,用于区分下载恢复与历史候选。 */
|
||||
previousCandidateIds?: readonly string[]
|
||||
/** 免费查看经当前预览核实的已有完整候选,不产生POST。 */
|
||||
reuseExisting?: (fingerprint: string) => Promise<boolean>
|
||||
/** 仅发送已经确认的当前快照。 */
|
||||
submitGeneration: (input: GenerateKeyframeInput) => Promise<ImageGenerationSubmission>
|
||||
}>()
|
||||
@@ -69,6 +77,58 @@ const generationCatalog = ref<GenerationModelCatalog | null>(null)
|
||||
const generationCatalogError = ref('')
|
||||
/** 实际项目及镜头配置解析后的模型。 */
|
||||
const imageProvider = ref('')
|
||||
/** 当前用户主动选择的许可,重新打开或切换范围后不保留默认选择。 */
|
||||
const additionalId = ref<string | null>(null)
|
||||
/** 人工追加只属于OpenAI,不改变其它供应方的未知请求保护。 */
|
||||
const canInspectAdditional = computed(() => !!props.additionalAllowed && imageProvider.value === 'openai-image')
|
||||
/** 仅需要核对原失败请求时读取已有许可,不自动创建。 */
|
||||
const additionalKey = computed(() =>
|
||||
open.value && canInspectAdditional.value ? JSON.stringify([props.projectId, props.shotId]) : ''
|
||||
)
|
||||
/** 当前原项目的有限许可和原unknown历史。 */
|
||||
const additionalQuery = useQuery(additionalKey, async (value, signal) => {
|
||||
if (!value) return null
|
||||
const [projectId] = JSON.parse(value) as [string, string]
|
||||
const result = await imageAuthorizationApi.list(projectId, signal)
|
||||
if (!result || !Array.isArray(result.requests) || !Array.isArray(result.authorizations))
|
||||
throw new Error('原请求与授权记录读取不完整,请重新核对。')
|
||||
return result
|
||||
})
|
||||
/** 只列原镜头已有且未撤销、尚有次数的许可,不自动选中。 */
|
||||
const additionalOptions = computed(() =>
|
||||
(additionalQuery.data.value?.additionalAuthorizations ?? [])
|
||||
.filter(
|
||||
permit =>
|
||||
permit.status === 'approved' &&
|
||||
permit.remainingRequests > 0 &&
|
||||
additionalQuery.data.value?.requests.some(
|
||||
row =>
|
||||
row.id === permit.input.parentRequestId &&
|
||||
row.input.projectId === props.projectId &&
|
||||
row.input.targetId === props.shotId &&
|
||||
row.input.scope === 'keyframe'
|
||||
)
|
||||
)
|
||||
.map(permit => ({
|
||||
label: `${permit.input.approvedBy} · 已用 ${permit.usedRequests} / 剩余 ${permit.remainingRequests} 次`,
|
||||
value: permit.id
|
||||
}))
|
||||
)
|
||||
/** 已选许可及其原unknown,不改写原范围或金额。 */
|
||||
const additionalPermit = computed(() =>
|
||||
additionalQuery.data.value?.additionalAuthorizations?.find(permit => permit.id === additionalId.value)
|
||||
)
|
||||
/** 原未知费用与预留保持显示。 */
|
||||
const additionalParent = computed(() =>
|
||||
additionalQuery.data.value?.requests.find(row => row.id === additionalPermit.value?.input.parentRequestId)
|
||||
)
|
||||
watch(
|
||||
[() => props.projectId, () => props.shotId, open],
|
||||
() => {
|
||||
additionalId.value = null
|
||||
},
|
||||
{ flush: 'sync' }
|
||||
)
|
||||
/** 本次明确参数。 */
|
||||
const imageGenerationOptions = ref<GenerationOptions>({})
|
||||
/** 项目画幅。 */
|
||||
@@ -76,7 +136,8 @@ const projectAspectRatio = ref<CreativeProfileAspectRatio>('9:16')
|
||||
/** 预览和生成复用当前请求字段,生成时再附加版本及候选标记。 */
|
||||
const generationInput = computed(() => ({
|
||||
provider: imageProvider.value || undefined,
|
||||
generationOptions: imageGenerationOptions.value
|
||||
generationOptions: imageGenerationOptions.value,
|
||||
...(additionalId.value ? { additionalAuthorizationId: additionalId.value } : {})
|
||||
}))
|
||||
/** 首帧与主体图片使用同一套预览确认与未知费用保护。 */
|
||||
const {
|
||||
@@ -84,6 +145,7 @@ const {
|
||||
acknowledged,
|
||||
requiresCostConfirmation,
|
||||
chargeNotice,
|
||||
reusableResult,
|
||||
loading,
|
||||
submitting,
|
||||
error,
|
||||
@@ -100,17 +162,32 @@ const {
|
||||
targetId: props.shotId,
|
||||
exactPreview: true
|
||||
}),
|
||||
recoveryTarget: () => (props.shotId ? 'keyframe:' + props.shotId : ''),
|
||||
additionalAuthorizationId: () => additionalId.value ?? undefined,
|
||||
recoveryTarget: () =>
|
||||
props.shotId
|
||||
? additionalId.value && additionalPermit.value
|
||||
? `keyframe:${props.projectId}:${props.shotId}:additional:${additionalId.value}:used:${additionalPermit.value.usedRequests}`
|
||||
: 'keyframe:' + props.shotId
|
||||
: '',
|
||||
previousCandidateIds: () => props.previousCandidateIds,
|
||||
target: () => JSON.stringify([props.shotId, props.direction, props.visualState]),
|
||||
target: () => JSON.stringify([props.projectId, props.shotId, props.direction, props.visualState]),
|
||||
input: () => generationInput.value,
|
||||
disabled: () => props.disabled || !imageProvider.value,
|
||||
disabled: () =>
|
||||
(props.disabled && !canInspectAdditional.value) ||
|
||||
!imageProvider.value ||
|
||||
(!!additionalId.value &&
|
||||
(imageProvider.value !== 'openai-image' || additionalQuery.loading.value || !!additionalQuery.error.value)),
|
||||
load: async (input, signal) => {
|
||||
const shotId = props.shotId
|
||||
const result = await productionApi.previewKeyframe(shotId, input, signal)
|
||||
const result = await productionApi.previewKeyframe(
|
||||
shotId,
|
||||
{ provider: input.provider, generationOptions: input.generationOptions },
|
||||
signal
|
||||
)
|
||||
if (result?.shotId !== shotId) throw new Error('预览结果与当前镜头不匹配。')
|
||||
return result
|
||||
},
|
||||
reuseResult: props.reuseExisting ? result => props.reuseExisting!(result.previewFingerprint) : undefined,
|
||||
generate: input => props.submitGeneration({ ...input, setPrimary: false })
|
||||
})
|
||||
|
||||
@@ -169,7 +246,7 @@ watch(
|
||||
<AppForm
|
||||
ref="formRef"
|
||||
:model="imageGenerationOptions"
|
||||
:disabled="disabled || submitting"
|
||||
:disabled="(disabled && !canInspectAdditional) || submitting"
|
||||
:reset-key="`${open}:${shotId}`"
|
||||
validate-on-change
|
||||
@submit="submit"
|
||||
@@ -196,6 +273,31 @@ watch(
|
||||
<ContextNotice v-else-if="generationCatalogError" type="warning" :show-icon="false" class="mt-5 text-xs">
|
||||
生成模型目录读取失败:{{ generationCatalogError }}
|
||||
</ContextNotice>
|
||||
<!-- 以下是用户主动选择的原精确计划追加许可,普通unknown不放行。 -->
|
||||
<section v-if="canInspectAdditional" class="workspace-section-stack mt-5">
|
||||
<p class="text-sm">
|
||||
原请求和费用仍未知。只可使用已单独批准的有限许可,重新预览核对精确计划;不会自动追加或消费剩余次数。
|
||||
</p>
|
||||
<NSelect
|
||||
v-model:value="additionalId"
|
||||
clearable
|
||||
:options="additionalOptions"
|
||||
:disabled="submitting || additionalQuery.loading.value"
|
||||
placeholder="主动选择已有人工追加许可(可不选,仅免费预览)"
|
||||
aria-label="本次人工追加许可"
|
||||
/><NButton
|
||||
:loading="additionalQuery.loading.value"
|
||||
:disabled="submitting"
|
||||
@click="additionalQuery.refresh"
|
||||
>刷新追加许可与原请求</NButton
|
||||
>
|
||||
<p v-if="additionalQuery.error.value" role="alert">{{ additionalQuery.error.value }}</p>
|
||||
<p v-if="additionalParent" class="text-sm">
|
||||
原镜头 {{ additionalParent.input.targetId }} · 原型号 {{ additionalParent.input.model }} · 原预留
|
||||
{{ formatMicros(additionalParent.input.reservedMicros) }} · 原账单
|
||||
{{ formatMicros(additionalParent.output?.actualBilledMicros) }}
|
||||
</p>
|
||||
</section>
|
||||
<!-- 以下是正式摄影设计与画面状态 -->
|
||||
<NCollapse v-if="direction || visualState" class="mt-5">
|
||||
<NCollapseItem v-if="direction" name="direction" title="当前镜头设计">
|
||||
@@ -261,7 +363,7 @@ watch(
|
||||
:loading="submitting"
|
||||
@click="formRef?.validate(submit)"
|
||||
type="primary"
|
||||
>确认生成首帧</NButton
|
||||
>{{ reusableResult ? '查看已有同计划候选' : '确认生成首帧' }}</NButton
|
||||
>
|
||||
</template>
|
||||
</AppDialog>
|
||||
|
||||
@@ -403,6 +403,17 @@ const canGenerateKeyframe = computed(
|
||||
!!props.keyframeReadiness &&
|
||||
props.keyframeReadiness.issues.length === 0
|
||||
)
|
||||
/** 原镜头、来源和活动任务条件仍满足时,只允许重新免费预览及受控追加,不放行普通重发。 */
|
||||
const canUseAdditional = computed(
|
||||
() =>
|
||||
!assetBlocked.value &&
|
||||
!query.loading.value &&
|
||||
!!query.data.value &&
|
||||
!keyframes.value.some(item => ['pending', 'generating'].includes(item.status)) &&
|
||||
!!props.keyframeReadiness &&
|
||||
props.keyframeReadiness.issues.length === 0 &&
|
||||
keyframes.value.some(item => item.recoveryRequired)
|
||||
)
|
||||
const canGenerateVideo = computed(
|
||||
() =>
|
||||
!assetBlocked.value &&
|
||||
@@ -513,17 +524,54 @@ async function generatePrompt() {
|
||||
await refreshAll()
|
||||
}
|
||||
|
||||
/**
|
||||
* 从正式GET候选中查看精确预览对应的完整结果,不重新POST或修改主图。
|
||||
* @param fingerprint 当前正式首帧预览指纹
|
||||
* @returns 是否已经定位到完整同计划候选
|
||||
*/
|
||||
async function reuseExistingKeyframe(fingerprint: string) {
|
||||
const projectId = props.projectId,
|
||||
shotId = props.shot.shotId
|
||||
await query.refresh()
|
||||
if (disposed || props.projectId !== projectId || props.shot.shotId !== shotId || query.error.value) return false
|
||||
const candidate = keyframes.value.find(
|
||||
item =>
|
||||
item.shotId === props.shot.shotId &&
|
||||
item.status === 'completed' &&
|
||||
!!item.imageUrl &&
|
||||
item.recoveryRequired === false &&
|
||||
item.providerInputFingerprint === fingerprint
|
||||
)
|
||||
if (!candidate) return false
|
||||
actionMessage?.info('已读取已有同计划候选,没有新增模型请求;质量与主图资格仍需分别核对。')
|
||||
return true
|
||||
}
|
||||
|
||||
/**
|
||||
* 提交已确认的首帧输入,并刷新该镜头候选。
|
||||
* @param input 预览绑定的生成参数
|
||||
* @returns 真实提交结果与可能的冲突
|
||||
*/
|
||||
async function generateKeyframe(input: GenerateKeyframeInput) {
|
||||
if (!canGenerateKeyframe.value || !input.expectedPreviewFingerprint) return { accepted: false }
|
||||
if (
|
||||
(!canGenerateKeyframe.value &&
|
||||
!(
|
||||
input.additionalAuthorizationId &&
|
||||
input.provider === 'openai-image' &&
|
||||
input.setPrimary === false &&
|
||||
canUseAdditional.value
|
||||
)) ||
|
||||
!input.expectedPreviewFingerprint
|
||||
)
|
||||
return { accepted: false }
|
||||
const shotId = props.shot.shotId
|
||||
const projectId = props.projectId
|
||||
const accepted = await runOperation(projectId, `生成镜头 ${props.shot.shotNo} 首帧`, async () => {
|
||||
const result = await productionApi.generateKeyframe(shotId, input)
|
||||
const result = await productionApi.generateKeyframe(
|
||||
shotId,
|
||||
input,
|
||||
input.additionalAuthorizationId ? projectId : undefined
|
||||
)
|
||||
if (
|
||||
!result?.id ||
|
||||
result.shotId !== shotId ||
|
||||
@@ -1256,8 +1304,10 @@ defineExpose({ inspectSpecs, inspecting })
|
||||
:direction="shot.direction"
|
||||
:visual-state="shot.visualState"
|
||||
:disabled="!canGenerateKeyframe"
|
||||
:additional-allowed="canUseAdditional"
|
||||
:previous-candidate-ids="keyframes.map(item => item.id)"
|
||||
:submit-generation="generateKeyframe"
|
||||
:reuse-existing="reuseExistingKeyframe"
|
||||
/>
|
||||
</section>
|
||||
</template>
|
||||
|
||||
@@ -1,16 +1,15 @@
|
||||
<script setup lang="ts">
|
||||
import BillingEvidenceFields from '../../billing-audit/BillingEvidenceFields.vue'
|
||||
import type { BillingFacts } from '../../billing-audit/types'
|
||||
import { computed, watch } from 'vue'
|
||||
import { NButton, NCheckbox, NCollapse, NCollapseItem, NInput, NInputNumber, NSelect } from 'naive-ui'
|
||||
import { Trash2 } from '@lucide/vue'
|
||||
import { NButton, NCheckbox, NCollapse, NCollapseItem, NInput, NSelect } from 'naive-ui'
|
||||
import RawDataDetails from '../../../components/ui/RawDataDetails.vue'
|
||||
import WorkspaceActionTooltip from '../../../components/ui/WorkspaceActionTooltip.vue'
|
||||
import WorkspaceSectionHeading from '../../../components/ui/WorkspaceSectionHeading.vue'
|
||||
import { formatDate } from '../../../lib/format'
|
||||
import { useVideoAudit } from '../useVideoAudit'
|
||||
import {
|
||||
auditArtifactLabels,
|
||||
auditFindingLabels,
|
||||
auditOutcomeLabels,
|
||||
auditFindingLabels,
|
||||
auditStatusLabels,
|
||||
auditRequestStatusLabels,
|
||||
auditStepLabels
|
||||
@@ -31,6 +30,31 @@ const form = useVideoAudit(props, () => emit('changed'))
|
||||
const audit = computed(() => form.query.data.value?.audit)
|
||||
/** 原任务质量和费用保持原输出。 */
|
||||
const original = computed(() => form.query.data.value?.original)
|
||||
/** 原ref表单映射至共享证据字段,保留已有视频审计状态和接口。 */
|
||||
const evidenceFacts = computed<BillingFacts>({
|
||||
get: () => ({
|
||||
correlation: form.correlation.value,
|
||||
providerRequestId: form.providerRequestId.value || null,
|
||||
artifacts: form.artifacts.value,
|
||||
execution: { outcome: form.outcome.value, evidenceIds: form.executionIds.value },
|
||||
billing: {
|
||||
finding: form.finding.value,
|
||||
amount: form.amount.value,
|
||||
currency: audit.value?.currency ?? '',
|
||||
evidenceIds: form.billingIds.value
|
||||
}
|
||||
}),
|
||||
set: value => {
|
||||
form.correlation.value = value.correlation
|
||||
form.providerRequestId.value = value.providerRequestId ?? ''
|
||||
form.artifacts.value = value.artifacts
|
||||
form.outcome.value = value.execution.outcome
|
||||
form.executionIds.value = value.execution.evidenceIds
|
||||
form.finding.value = value.billing.finding
|
||||
form.amount.value = value.billing.amount
|
||||
form.billingIds.value = value.billing.evidenceIds
|
||||
}
|
||||
})
|
||||
/** 真实步骤选项。 */
|
||||
const stepOptions = computed(
|
||||
() =>
|
||||
@@ -44,12 +68,6 @@ const evidenceOptions = computed(
|
||||
value: row.id
|
||||
})) ?? []
|
||||
)
|
||||
/** 下拉选项保留实际枚举值。 */
|
||||
const artifactKinds = Object.entries(auditArtifactLabels).map(([value, label]) => ({ value, label }))
|
||||
/** 执行结果选项。 */
|
||||
const outcomeOptions = Object.entries(auditOutcomeLabels).map(([value, label]) => ({ value, label }))
|
||||
/** 费用结果选项。 */
|
||||
const findingOptions = Object.entries(auditFindingLabels).map(([value, label]) => ({ value, label }))
|
||||
watch(form.saving, value => emit('busy', value), { flush: 'sync' })
|
||||
/** 主操作由原抽屉固定 footer 提供。 */
|
||||
defineExpose({ canSubmit: form.canSubmit, saving: form.saving, submit: form.submit, submitLabel: form.submitLabel })
|
||||
@@ -190,140 +208,12 @@ defineExpose({ canSubmit: form.canSubmit, saving: form.saving, submit: form.subm
|
||||
/>
|
||||
</div>
|
||||
<!-- 以下是外部原件登记表单,默认未知,原件引用不执行 URL -->
|
||||
<section v-if="form.action.value === 'evidence'" class="workspace-section-stack">
|
||||
<p class="text-sm text-muted">
|
||||
请保存原件并填写非敏感定位说明。真实供应方请求号与本地请求、LangSmith
|
||||
编号分别记录,不能互相代用。
|
||||
</p>
|
||||
<label class="workspace-form-field"
|
||||
><span>登记人</span
|
||||
><NInput v-model:value="form.operator.value" :maxlength="120" :disabled="form.saving.value"
|
||||
/></label>
|
||||
<div class="grid grid-cols-1 gap-(--app-field-gap) sm:grid-cols-2">
|
||||
<div class="workspace-form-field">
|
||||
<span>与原请求的关联</span
|
||||
><NSelect
|
||||
aria-label="与原请求的关联"
|
||||
v-model:value="form.correlation.value"
|
||||
:disabled="form.saving.value"
|
||||
:options="[
|
||||
{ label: '尚未核实', value: 'unverified' },
|
||||
{ label: '关联有歧义', value: 'ambiguous' },
|
||||
{ label: '已唯一关联', value: 'unique' }
|
||||
]"
|
||||
/>
|
||||
</div>
|
||||
<label class="workspace-form-field"
|
||||
><span>真实供应方请求号(未知留空)</span
|
||||
><NInput
|
||||
v-model:value="form.providerRequestId.value"
|
||||
:maxlength="200"
|
||||
:disabled="form.saving.value"
|
||||
/></label>
|
||||
</div>
|
||||
<article
|
||||
v-for="(item, index) in form.artifacts.value"
|
||||
:key="index"
|
||||
class="surface-inset p-4 workspace-section-stack min-w-0"
|
||||
>
|
||||
<div class="flex items-center justify-between gap-3">
|
||||
<h3 class="font-semibold">原件 {{ index + 1 }}</h3>
|
||||
<WorkspaceActionTooltip label="删除原件"
|
||||
><NButton
|
||||
class="workspace-action-button icon-button"
|
||||
:disabled="form.saving.value"
|
||||
aria-label="删除原件"
|
||||
@click="form.removeArtifact(index)"
|
||||
><Trash2 :size="16" /></NButton
|
||||
></WorkspaceActionTooltip>
|
||||
</div>
|
||||
<div class="grid grid-cols-1 gap-(--app-field-gap) sm:grid-cols-2">
|
||||
<label class="workspace-form-field"
|
||||
><span>包内引用键</span
|
||||
><NInput v-model:value="item.id" :maxlength="120" :disabled="form.saving.value"
|
||||
/></label>
|
||||
<div class="workspace-form-field">
|
||||
<span>原件来源</span
|
||||
><NSelect
|
||||
aria-label="原件来源"
|
||||
v-model:value="item.kind"
|
||||
:options="artifactKinds"
|
||||
:disabled="form.saving.value"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<label class="workspace-form-field"
|
||||
><span>原件记录编号</span
|
||||
><NInput v-model:value="item.recordId" :maxlength="200" :disabled="form.saving.value"
|
||||
/></label>
|
||||
<label class="workspace-form-field"
|
||||
><span>原件 SHA256</span
|
||||
><NInput v-model:value="item.sha256" :maxlength="64" :disabled="form.saving.value"
|
||||
/></label>
|
||||
<label class="workspace-form-field"
|
||||
><span>非敏感原件定位说明</span
|
||||
><NInput
|
||||
v-model:value="item.reference"
|
||||
type="textarea"
|
||||
:maxlength="1000"
|
||||
:disabled="form.saving.value"
|
||||
/></label>
|
||||
</article>
|
||||
<NButton
|
||||
:disabled="form.saving.value || form.artifacts.value.length >= 20"
|
||||
@click="form.addArtifact"
|
||||
>添加原件</NButton
|
||||
>
|
||||
<div class="grid grid-cols-1 gap-(--app-field-gap) sm:grid-cols-2">
|
||||
<div class="workspace-form-field">
|
||||
<span>供应方执行结果</span
|
||||
><NSelect
|
||||
aria-label="供应方执行结果"
|
||||
v-model:value="form.outcome.value"
|
||||
:options="outcomeOptions"
|
||||
:disabled="form.saving.value"
|
||||
/>
|
||||
</div>
|
||||
<div class="workspace-form-field">
|
||||
<span>执行依据原件</span
|
||||
><NSelect
|
||||
aria-label="执行依据原件"
|
||||
v-model:value="form.executionIds.value"
|
||||
multiple
|
||||
:options="form.artifactOptions.value"
|
||||
:disabled="form.saving.value"
|
||||
/>
|
||||
</div>
|
||||
<div class="workspace-form-field">
|
||||
<span>原始费用结论</span
|
||||
><NSelect
|
||||
aria-label="原始费用结论"
|
||||
v-model:value="form.finding.value"
|
||||
:options="findingOptions"
|
||||
:disabled="form.saving.value"
|
||||
/>
|
||||
</div>
|
||||
<div class="workspace-form-field">
|
||||
<span>费用依据原件</span
|
||||
><NSelect
|
||||
aria-label="费用依据原件"
|
||||
v-model:value="form.billingIds.value"
|
||||
multiple
|
||||
:options="form.artifactOptions.value"
|
||||
:disabled="form.saving.value"
|
||||
/>
|
||||
</div>
|
||||
<label class="workspace-form-field"
|
||||
><span>实际金额({{ audit.currency }},未知留空)</span
|
||||
><NInputNumber
|
||||
v-model:value="form.amount.value"
|
||||
:min="0"
|
||||
clearable
|
||||
:disabled="form.saving.value"
|
||||
/></label>
|
||||
</div>
|
||||
</section>
|
||||
<!-- 以下是独立人工复核表单,资料不足时保留阻断 -->
|
||||
<BillingEvidenceFields
|
||||
v-if="form.action.value === 'evidence'"
|
||||
v-model="evidenceFacts"
|
||||
v-model:operator="form.operator.value"
|
||||
:disabled="form.saving.value"
|
||||
/>
|
||||
<section v-else class="workspace-section-stack">
|
||||
<div class="workspace-form-field">
|
||||
<span>选择已登记证据包</span
|
||||
|
||||
@@ -348,6 +348,8 @@ export interface GenerateKeyframesInput {
|
||||
|
||||
/** 单镜头首帧生成参数。 */
|
||||
export interface GenerateKeyframeInput {
|
||||
/** 用户主动选择的人工有限追加许可,只作用于原精确OpenAI首帧计划。 */
|
||||
additionalAuthorizationId?: string
|
||||
/** 用户确认的最终输入版本。 */
|
||||
expectedPreviewFingerprint?: string
|
||||
/** 单镜头生成总是先生成候选。 */ setPrimary: boolean
|
||||
|
||||
@@ -1,22 +1,8 @@
|
||||
import { billingEvidenceIssues } from '../billing-audit/evidence'
|
||||
import type { VideoAuditEvidence, VideoAuditStep, VideoAuditView } from './video-audit.types'
|
||||
|
||||
/** 原件来源使用中文选项,提交保留原枚举。 */
|
||||
export const auditArtifactLabels = {
|
||||
'provider-execution': '供应方执行原件',
|
||||
'provider-billing': '供应方账单原件',
|
||||
'provider-support': '供应方官方支持材料',
|
||||
langsmith: 'LangSmith 观测记录',
|
||||
'client-log': '客户端日志'
|
||||
}
|
||||
/** 原执行结论不替代质量结论。 */
|
||||
export const auditOutcomeLabels = {
|
||||
'not-received': '供应方未接收',
|
||||
succeeded: '供应方执行完成',
|
||||
failed: '供应方执行失败',
|
||||
unknown: '执行结果未知'
|
||||
}
|
||||
/** 原收费结论不以零 Token 推断。 */
|
||||
export const auditFindingLabels = { charged: '已收费', 'no-charge': '未收费', unknown: '费用未知' }
|
||||
/** 图片与视频复用原件、执行和费用选项,保留原导出路径。 */
|
||||
export { auditArtifactLabels, auditOutcomeLabels, auditFindingLabels } from '../billing-audit/labels'
|
||||
/** 费用审计状态中文。 */
|
||||
export const auditStatusLabels = { unreviewed: '等待人工核查', blocked: '保留费用阻断', released: '此步骤费用已核清' }
|
||||
/** 原请求步骤名称。 */
|
||||
@@ -35,39 +21,12 @@ export const auditStepLabels: Record<string, string> = {
|
||||
* @returns 校验问题
|
||||
*/
|
||||
export function auditEvidenceIssues(evidence: VideoAuditEvidence): string[] {
|
||||
const issues: string[] = []
|
||||
const ids = evidence.artifacts.map(item => item.id)
|
||||
if (!ids.length || ids.length > 20 || new Set(ids).size !== ids.length)
|
||||
issues.push('请提供 1~20 项原件,引用键不能重复。')
|
||||
if (
|
||||
evidence.artifacts.some(
|
||||
item =>
|
||||
!item.id.trim() ||
|
||||
item.id.length > 120 ||
|
||||
!item.recordId.trim() ||
|
||||
item.recordId.length > 200 ||
|
||||
!/^[a-f0-9]{64}$/.test(item.sha256) ||
|
||||
!item.reference.trim() ||
|
||||
item.reference.length > 1000
|
||||
)
|
||||
)
|
||||
issues.push('请填写每项原件的引用键、记录编号、64 位小写 SHA256 及定位说明。')
|
||||
if ([...evidence.execution.evidenceIds, ...evidence.billing.evidenceIds].some(id => !ids.includes(id)))
|
||||
issues.push('执行或费用引用的原件已不存在,请重新选择。')
|
||||
if (evidence.billing.amount !== null && (!Number.isFinite(evidence.billing.amount) || evidence.billing.amount < 0))
|
||||
issues.push('实际金额需为非负数,未知请留空。')
|
||||
if (
|
||||
evidence.providerRequestId &&
|
||||
([
|
||||
evidence.identity.requestId,
|
||||
evidence.identity.taskId,
|
||||
evidence.identity.workflowExecutionId,
|
||||
evidence.identity.videoId
|
||||
].includes(evidence.providerRequestId) ||
|
||||
evidence.artifacts.some(item => item.kind === 'langsmith' && item.recordId === evidence.providerRequestId))
|
||||
)
|
||||
issues.push('本地任务、请求或 LangSmith 编号不能作为供应方请求号。')
|
||||
return issues
|
||||
return billingEvidenceIssues(evidence, [
|
||||
evidence.identity.requestId,
|
||||
evidence.identity.taskId,
|
||||
evidence.identity.workflowExecutionId,
|
||||
evidence.identity.videoId
|
||||
])
|
||||
}
|
||||
/**
|
||||
* 资料不完整时禁用核清,最终真实性与唯一认领仍由人工及服务端核验。
|
||||
|
||||
Reference in new issue
Block a user