style(chat): 统一会话/批次中心/订单工作台颜色为语义令牌
This commit is contained in:
1 parent
1269e04116
commit
420f1a4abb
57 files changed
+1857
-1166
No files matched your search
@@ -183,15 +183,15 @@ function loadMore() {
|
||||
data-testid="review-audit-trail-drawer"
|
||||
@click.self="emit('close')"
|
||||
>
|
||||
<aside class="flex h-full w-full max-w-xl flex-col bg-white shadow-xl dark:bg-slate-900">
|
||||
<header class="flex items-center justify-between gap-2 border-b border-slate-200 px-4 py-3 dark:border-slate-800">
|
||||
<aside class="flex h-full w-full max-w-xl flex-col bg-surface shadow-xl">
|
||||
<header class="flex items-center justify-between gap-2 border-b border-default px-4 py-3">
|
||||
<div>
|
||||
<h2 class="text-sm font-semibold">{{ t('chat.shippingOrderReview.auditTrail.title') }}</h2>
|
||||
<p class="text-[11px] text-muted">{{ t('chat.shippingOrderReview.auditTrail.subtitle') }}</p>
|
||||
</div>
|
||||
<button
|
||||
type="button"
|
||||
class="rounded border border-slate-300 px-2 py-1 text-xs hover:bg-slate-50 dark:border-slate-600 dark:hover:bg-slate-800"
|
||||
class="rounded border border-default px-2 py-1 text-xs hover-surface-soft"
|
||||
data-testid="review-audit-trail-close"
|
||||
@click="emit('close')"
|
||||
>
|
||||
@@ -209,7 +209,7 @@ function loadMore() {
|
||||
<li
|
||||
v-for="item in items"
|
||||
:key="item.id"
|
||||
class="rounded-lg border border-slate-200 bg-slate-50 px-3 py-2 text-xs dark:border-slate-800 dark:bg-slate-950/40"
|
||||
class="rounded-lg border border-default bg-surface-soft px-3 py-2 text-xs dark:bg-slate-950/40"
|
||||
:data-testid="`review-audit-item-${item.id}`"
|
||||
>
|
||||
<button
|
||||
@@ -239,7 +239,7 @@ function loadMore() {
|
||||
</div>
|
||||
<div
|
||||
v-if="expandedId === item.id"
|
||||
class="mt-2 space-y-2 border-t border-slate-200 pt-2 dark:border-slate-800"
|
||||
class="mt-2 space-y-2 border-t border-default pt-2"
|
||||
data-testid="review-audit-item-details"
|
||||
>
|
||||
<p v-if="item.sensitive_redacted" class="text-amber-800 dark:text-amber-200">
|
||||
@@ -254,7 +254,7 @@ function loadMore() {
|
||||
<li
|
||||
v-for="(row, idx) in normalizeDiffRows(item.diff)"
|
||||
:key="idx"
|
||||
class="rounded bg-white px-2 py-1.5 text-[11px] dark:bg-slate-900"
|
||||
class="rounded bg-surface px-2 py-1.5 text-[11px]"
|
||||
>
|
||||
<p class="font-medium text-primary">{{ diffFieldLabel(row) }}</p>
|
||||
<p class="mt-0.5 text-muted">
|
||||
@@ -271,39 +271,39 @@ function loadMore() {
|
||||
<p v-if="item.reason" class="text-[11px] text-secondary">
|
||||
{{ t('chat.shippingOrderReview.auditTrail.reason') }}:{{ item.reason }}
|
||||
</p>
|
||||
<details class="rounded border border-slate-200 dark:border-slate-800">
|
||||
<details class="rounded border border-default">
|
||||
<summary class="cursor-pointer px-2 py-1 text-[11px] text-muted">
|
||||
{{ t('chat.shippingOrderReview.auditTrail.technicalDetails') }}
|
||||
</summary>
|
||||
<div class="space-y-2 border-t border-slate-200 p-2 dark:border-slate-800">
|
||||
<div class="space-y-2 border-t border-default p-2">
|
||||
<div class="flex items-center justify-between gap-2">
|
||||
<p class="font-medium text-secondary">
|
||||
{{ t('chat.shippingOrderReview.auditTrail.before') }}
|
||||
</p>
|
||||
<button
|
||||
type="button"
|
||||
class="rounded border border-slate-300 px-1.5 py-0.5 text-[11px] hover:bg-slate-50 dark:border-slate-600 dark:hover:bg-slate-800"
|
||||
class="rounded border border-default px-1.5 py-0.5 text-[11px] hover-surface-soft"
|
||||
data-testid="review-audit-copy-before"
|
||||
@click="copyJson(item.before_snapshot)"
|
||||
>
|
||||
{{ t('chat.shippingOrderReview.auditTrail.copyJson') }}
|
||||
</button>
|
||||
</div>
|
||||
<pre class="max-h-32 overflow-auto rounded bg-white p-2 text-xs leading-relaxed dark:bg-slate-900">{{ formatJson(item.before_snapshot) }}</pre>
|
||||
<pre class="max-h-32 overflow-auto rounded bg-surface p-2 text-xs leading-relaxed">{{ formatJson(item.before_snapshot) }}</pre>
|
||||
<div class="flex items-center justify-between gap-2">
|
||||
<p class="font-medium text-secondary">
|
||||
{{ t('chat.shippingOrderReview.auditTrail.after') }}
|
||||
</p>
|
||||
<button
|
||||
type="button"
|
||||
class="rounded border border-slate-300 px-1.5 py-0.5 text-[11px] hover:bg-slate-50 dark:border-slate-600 dark:hover:bg-slate-800"
|
||||
class="rounded border border-default px-1.5 py-0.5 text-[11px] hover-surface-soft"
|
||||
data-testid="review-audit-copy-after"
|
||||
@click="copyJson(item.after_snapshot)"
|
||||
>
|
||||
{{ t('chat.shippingOrderReview.auditTrail.copyJson') }}
|
||||
</button>
|
||||
</div>
|
||||
<pre class="max-h-32 overflow-auto rounded bg-white p-2 text-xs leading-relaxed dark:bg-slate-900">{{ formatJson(item.after_snapshot) }}</pre>
|
||||
<pre class="max-h-32 overflow-auto rounded bg-surface p-2 text-xs leading-relaxed">{{ formatJson(item.after_snapshot) }}</pre>
|
||||
</div>
|
||||
</details>
|
||||
</template>
|
||||
@@ -313,7 +313,7 @@ function loadMore() {
|
||||
<button
|
||||
v-if="items.length < total"
|
||||
type="button"
|
||||
class="mt-3 w-full rounded border border-slate-300 px-2 py-1.5 text-xs hover:bg-slate-50 disabled:opacity-50 dark:border-slate-600 dark:hover:bg-slate-800"
|
||||
class="mt-3 w-full rounded border border-default px-2 py-1.5 text-xs hover-surface-soft disabled:opacity-50"
|
||||
data-testid="review-audit-trail-load-more"
|
||||
:disabled="loading"
|
||||
@click="loadMore"
|
||||
|
||||
+1
-1
@@ -66,7 +66,7 @@ function statusClass(status: string): string {
|
||||
<template>
|
||||
<section
|
||||
v-if="visible"
|
||||
class="rounded-xl border border-slate-200 bg-white p-3 shadow-sm dark:border-slate-800 dark:bg-slate-900"
|
||||
class="rounded-xl border border-default bg-surface p-3 shadow-sm"
|
||||
data-testid="review-automation-status-panel"
|
||||
>
|
||||
<header class="mb-2">
|
||||
|
||||
+17
-17
@@ -152,12 +152,12 @@ const hasDiagnosticDetails = computed(() => Boolean(
|
||||
data-testid="review-eligibility-details-drawer"
|
||||
@click.self="emit('close')"
|
||||
>
|
||||
<aside class="flex h-full w-full max-w-md flex-col bg-white shadow-xl dark:bg-slate-900">
|
||||
<header class="flex items-center justify-between gap-2 border-b border-slate-200 px-4 py-3 dark:border-slate-800">
|
||||
<aside class="flex h-full w-full max-w-md flex-col bg-surface shadow-xl">
|
||||
<header class="flex items-center justify-between gap-2 border-b border-default px-4 py-3">
|
||||
<h2 class="text-sm font-semibold">{{ t('chat.shippingOrderReview.workbench.fullChecksTitle') }}</h2>
|
||||
<button
|
||||
type="button"
|
||||
class="rounded border border-slate-300 px-2 py-1 text-xs hover:bg-slate-50 dark:border-slate-600 dark:hover:bg-slate-800"
|
||||
class="rounded border border-default px-2 py-1 text-xs hover-surface-soft"
|
||||
data-testid="review-eligibility-details-close"
|
||||
@click="emit('close')"
|
||||
>
|
||||
@@ -168,7 +168,7 @@ const hasDiagnosticDetails = computed(() => Boolean(
|
||||
<section
|
||||
class="rounded-lg border px-3 py-2 text-xs"
|
||||
:class="eligibility.can_build === null
|
||||
? 'border-slate-200 bg-slate-50 text-slate-800 dark:border-slate-700 dark:bg-slate-900 dark:text-slate-100'
|
||||
? 'border-default bg-surface-soft text-primary '
|
||||
: eligibility.can_build
|
||||
? 'border-emerald-200 bg-emerald-50 text-emerald-900 dark:border-emerald-900 dark:bg-emerald-950/30 dark:text-emerald-100'
|
||||
: 'border-amber-200 bg-amber-50 text-amber-900 dark:border-amber-900 dark:bg-amber-950/30 dark:text-amber-100'"
|
||||
@@ -176,8 +176,8 @@ const hasDiagnosticDetails = computed(() => Boolean(
|
||||
>
|
||||
<div class="flex flex-wrap items-center justify-between gap-2">
|
||||
<span class="font-semibold">{{ t('chat.shippingOrderReview.buildEligibility.overallResult') }}</span>
|
||||
<span class="text-slate-600 dark:text-slate-300">{{ t('chat.shippingOrderReview.buildEligibility.manualBuildLabel') }}</span>
|
||||
<span class="rounded-full px-2 py-0.5 font-medium" :class="eligibility.can_build === null ? 'bg-slate-100 text-slate-700 dark:bg-slate-800 dark:text-slate-100' : eligibility.can_build ? 'bg-emerald-100 text-emerald-800 dark:bg-emerald-900/60 dark:text-emerald-100' : 'bg-amber-100 text-amber-900 dark:bg-amber-900/60 dark:text-amber-100'">
|
||||
<span class="text-secondary">{{ t('chat.shippingOrderReview.buildEligibility.manualBuildLabel') }}</span>
|
||||
<span class="rounded-full px-2 py-0.5 font-medium" :class="eligibility.can_build === null ? 'bg-surface-strong text-secondary ' : eligibility.can_build ? 'bg-emerald-100 text-emerald-800 dark:bg-emerald-900/60 dark:text-emerald-100' : 'bg-amber-100 text-amber-900 dark:bg-amber-900/60 dark:text-amber-100'">
|
||||
<span data-testid="review-eligibility-manual-status">{{ eligibility.can_build === null
|
||||
? t('chat.shippingOrderReview.buildEligibility.notValidated')
|
||||
: eligibility.can_build
|
||||
@@ -186,7 +186,7 @@ const hasDiagnosticDetails = computed(() => Boolean(
|
||||
</span>
|
||||
</div>
|
||||
<div class="mt-2 flex flex-wrap items-center justify-between gap-2">
|
||||
<span class="text-slate-600 dark:text-slate-300">{{ t('chat.shippingOrderReview.buildEligibility.autoBuildLabel') }}</span>
|
||||
<span class="text-secondary">{{ t('chat.shippingOrderReview.buildEligibility.autoBuildLabel') }}</span>
|
||||
<span
|
||||
class="rounded-full px-2 py-0.5 font-medium"
|
||||
:class="eligibility.can_auto_create
|
||||
@@ -213,7 +213,7 @@ const hasDiagnosticDetails = computed(() => Boolean(
|
||||
</section>
|
||||
<section
|
||||
v-if="hasDiagnosticDetails"
|
||||
class="rounded-lg border border-slate-200 bg-slate-50 p-3 text-xs dark:border-slate-700 dark:bg-slate-950/40"
|
||||
class="rounded-lg border border-default bg-surface-soft p-3 text-xs dark:bg-slate-950/40"
|
||||
>
|
||||
<div v-if="eligibility.assessment?.missing_required_fields?.length" class="mt-2">
|
||||
<div class="font-medium">{{ t('chat.shippingOrderReview.workbench.requiredFields') }}</div>
|
||||
@@ -230,7 +230,7 @@ const hasDiagnosticDetails = computed(() => Boolean(
|
||||
<ul class="mt-1 list-disc pl-4">
|
||||
<li v-for="(issue, index) in nonConflictIssues" :key="index">
|
||||
{{ issueLabel(issue) }}
|
||||
<span v-if="issue.explainability?.message || issue.message" class="text-slate-600 dark:text-slate-300">
|
||||
<span v-if="issue.explainability?.message || issue.message" class="text-secondary">
|
||||
— {{ issue.explainability?.message || issue.message }}
|
||||
</span>
|
||||
</li>
|
||||
@@ -249,7 +249,7 @@ const hasDiagnosticDetails = computed(() => Boolean(
|
||||
<li
|
||||
v-for="conflict in props.fieldConflicts"
|
||||
:key="conflict.conflict_key"
|
||||
class="rounded border border-rose-200 bg-white px-2 py-1.5 dark:border-rose-900 dark:bg-slate-900"
|
||||
class="rounded border border-rose-200 bg-surface px-2 py-1.5 dark:border-rose-900"
|
||||
>
|
||||
<div class="font-semibold">
|
||||
<span v-if="conflict.line_index != null">{{ t('chat.shippingOrderReview.line', { index: conflict.line_index + 1 }) }} · </span>
|
||||
@@ -273,9 +273,9 @@ const hasDiagnosticDetails = computed(() => Boolean(
|
||||
</section>
|
||||
<article
|
||||
v-for="line in orderedLines"
|
||||
:key="String(line.line_key || line.line_index)"
|
||||
class="rounded-lg border border-slate-200 p-3 text-xs dark:border-slate-700"
|
||||
:data-testid="`review-eligibility-detail-line-${line.line_key || line.line_index}`"
|
||||
:key="String(line.line_no)"
|
||||
class="rounded-lg border border-default p-3 text-xs"
|
||||
:data-testid="`review-eligibility-detail-line-${line.line_no}`"
|
||||
>
|
||||
<div class="flex flex-wrap items-center justify-between gap-2">
|
||||
<button
|
||||
@@ -302,20 +302,20 @@ const hasDiagnosticDetails = computed(() => Boolean(
|
||||
</div>
|
||||
<dl class="mt-2 grid gap-1">
|
||||
<div>
|
||||
<dt class="inline text-slate-500">{{ t('chat.shippingOrderReview.buildEligibility.routingStatusLabel') }}:</dt>
|
||||
<dt class="inline text-muted">{{ t('chat.shippingOrderReview.buildEligibility.routingStatusLabel') }}:</dt>
|
||||
<dd class="inline">{{ routingStatusLabel(line.routing_status) }}</dd>
|
||||
</div>
|
||||
<div v-if="line.block_reason">
|
||||
<dt class="inline text-slate-500">{{ t('chat.shippingOrderReview.buildEligibility.blockReason') }}:</dt>
|
||||
<dt class="inline text-muted">{{ t('chat.shippingOrderReview.buildEligibility.blockReason') }}:</dt>
|
||||
<dd class="inline">{{ blockReasonLabel(line.block_reason) }}</dd>
|
||||
</div>
|
||||
<div v-if="line.candidate_inventory_source_codes?.length">
|
||||
<dt class="inline text-slate-500">{{ t('chat.shippingOrderReview.buildEligibility.candidates') }}:</dt>
|
||||
<dt class="inline text-muted">{{ t('chat.shippingOrderReview.buildEligibility.candidates') }}:</dt>
|
||||
<dd class="inline font-mono">{{ line.candidate_inventory_source_codes.join(', ') }}</dd>
|
||||
</div>
|
||||
</dl>
|
||||
</article>
|
||||
<p v-if="!orderedLines.length" class="text-xs text-slate-500">
|
||||
<p v-if="!orderedLines.length" class="text-xs text-muted">
|
||||
{{ t('chat.shippingOrderReview.workbench.noLineChecks') }}
|
||||
</p>
|
||||
</div>
|
||||
|
||||
+13
-13
@@ -87,13 +87,13 @@ const blockingSummary = computed(() => {
|
||||
/>
|
||||
<section
|
||||
v-if="eligibility"
|
||||
class="rounded-xl border border-slate-200 bg-white p-4 shadow-sm dark:border-slate-800 dark:bg-slate-900"
|
||||
class="rounded-xl border border-default bg-surface p-4 shadow-sm"
|
||||
data-testid="review-build-eligibility-panel"
|
||||
>
|
||||
<header class="mb-3 flex flex-wrap items-center justify-between gap-2">
|
||||
<div>
|
||||
<h2 class="text-sm font-semibold">{{ t('chat.shippingOrderReview.buildEligibility.title') }}</h2>
|
||||
<p class="mt-0.5 text-xs text-slate-500 dark:text-slate-400">
|
||||
<p class="mt-0.5 text-xs text-muted">
|
||||
{{ t('chat.shippingOrderReview.buildEligibility.subtitle') }}
|
||||
</p>
|
||||
</div>
|
||||
@@ -112,7 +112,7 @@ const blockingSummary = computed(() => {
|
||||
</span>
|
||||
</header>
|
||||
|
||||
<dl class="grid gap-2 text-xs text-slate-600 dark:text-slate-400 sm:grid-cols-2">
|
||||
<dl class="grid gap-2 text-xs text-secondary sm:grid-cols-2">
|
||||
<div>
|
||||
<dt class="inline font-medium">{{ t('chat.shippingOrderReview.buildEligibility.statusLabel') }}:</dt>
|
||||
<dd class="inline">{{ statusLabel(eligibility.status) }}</dd>
|
||||
@@ -134,14 +134,14 @@ const blockingSummary = computed(() => {
|
||||
</div>
|
||||
|
||||
<div v-if="eligibility.line_projections.length" class="mt-3 space-y-2">
|
||||
<div class="text-xs font-semibold text-slate-500 dark:text-slate-400">
|
||||
<div class="text-xs font-semibold text-muted">
|
||||
{{ t('chat.shippingOrderReview.buildEligibility.lineProjections') }}
|
||||
</div>
|
||||
<article
|
||||
v-for="line in eligibility.line_projections"
|
||||
:key="String(line.line_key || line.line_index)"
|
||||
class="rounded-lg border border-slate-200 p-3 text-xs dark:border-slate-700"
|
||||
:data-testid="`review-build-eligibility-line-${line.line_key || line.line_index}`"
|
||||
:key="String(line.line_no)"
|
||||
class="rounded-lg border border-default p-3 text-xs"
|
||||
:data-testid="`review-build-eligibility-line-${line.line_no}`"
|
||||
>
|
||||
<div class="flex flex-wrap items-center justify-between gap-2">
|
||||
<span class="font-medium">
|
||||
@@ -162,27 +162,27 @@ const blockingSummary = computed(() => {
|
||||
</div>
|
||||
<dl class="mt-2 grid gap-1 sm:grid-cols-2">
|
||||
<div>
|
||||
<dt class="inline text-slate-500">{{ t('chat.shippingOrderReview.buildEligibility.reservation') }}:</dt>
|
||||
<dt class="inline text-muted">{{ t('chat.shippingOrderReview.buildEligibility.reservation') }}:</dt>
|
||||
<dd class="inline font-mono">{{ line.effective_reservation_id || '—' }}</dd>
|
||||
</div>
|
||||
<div>
|
||||
<dt class="inline text-slate-500">{{ t('chat.shippingOrderReview.buildEligibility.routingStatusLabel') }}:</dt>
|
||||
<dt class="inline text-muted">{{ t('chat.shippingOrderReview.buildEligibility.routingStatusLabel') }}:</dt>
|
||||
<dd class="inline">{{ routingStatusLabel(line.routing_status) }}</dd>
|
||||
</div>
|
||||
<div v-if="line.inventory_source_hint" class="sm:col-span-2">
|
||||
<dt class="inline text-slate-500">{{ t('chat.shippingOrderReview.buildEligibility.sourceHint') }}:</dt>
|
||||
<dt class="inline text-muted">{{ t('chat.shippingOrderReview.buildEligibility.sourceHint') }}:</dt>
|
||||
<dd class="inline">{{ line.inventory_source_hint }}</dd>
|
||||
</div>
|
||||
<div v-if="line.candidate_inventory_source_codes?.length" class="sm:col-span-2">
|
||||
<dt class="inline text-slate-500">{{ t('chat.shippingOrderReview.buildEligibility.candidates') }}:</dt>
|
||||
<dt class="inline text-muted">{{ t('chat.shippingOrderReview.buildEligibility.candidates') }}:</dt>
|
||||
<dd class="inline font-mono">{{ line.candidate_inventory_source_codes.join(', ') }}</dd>
|
||||
</div>
|
||||
<div v-if="line.block_reason" class="sm:col-span-2">
|
||||
<dt class="inline text-slate-500">{{ t('chat.shippingOrderReview.buildEligibility.blockReason') }}:</dt>
|
||||
<dt class="inline text-muted">{{ t('chat.shippingOrderReview.buildEligibility.blockReason') }}:</dt>
|
||||
<dd class="inline">{{ blockReasonLabel(line.block_reason) }}</dd>
|
||||
</div>
|
||||
<div v-if="line.selection_mode === 'manual' && line.manual_reason" class="sm:col-span-2">
|
||||
<dt class="inline text-slate-500">{{ t('chat.shippingOrderReview.buildEligibility.manualReason') }}:</dt>
|
||||
<dt class="inline text-muted">{{ t('chat.shippingOrderReview.buildEligibility.manualReason') }}:</dt>
|
||||
<dd class="inline">{{ line.manual_reason }}</dd>
|
||||
</div>
|
||||
</dl>
|
||||
|
||||
+3
-3
@@ -206,7 +206,7 @@ const gateChecklist = computed(() => {
|
||||
<template>
|
||||
<section
|
||||
v-if="eligibility"
|
||||
class="rounded-xl border border-slate-200 bg-white p-3 shadow-sm dark:border-slate-800 dark:bg-slate-900"
|
||||
class="rounded-xl border border-default bg-surface p-3 shadow-sm"
|
||||
data-testid="review-build-eligibility-summary"
|
||||
>
|
||||
<header class="flex flex-wrap items-center justify-between gap-2">
|
||||
@@ -214,7 +214,7 @@ const gateChecklist = computed(() => {
|
||||
<span
|
||||
class="rounded-full px-2.5 py-1 text-xs font-medium"
|
||||
:class="eligibility.can_build === null
|
||||
? 'bg-slate-100 text-slate-700 dark:bg-slate-800 dark:text-slate-200'
|
||||
? 'bg-surface-strong text-secondary '
|
||||
: eligibility.can_build
|
||||
? 'bg-emerald-100 text-emerald-800 dark:bg-emerald-950 dark:text-emerald-100'
|
||||
: 'bg-amber-100 text-amber-900 dark:bg-amber-950 dark:text-amber-100'"
|
||||
@@ -325,7 +325,7 @@ const gateChecklist = computed(() => {
|
||||
|
||||
<button
|
||||
type="button"
|
||||
class="mt-2 w-full rounded border border-slate-300 px-2 py-1.5 text-xs hover:bg-slate-50 dark:border-slate-600 dark:hover:bg-slate-800"
|
||||
class="mt-2 w-full rounded border border-default px-2 py-1.5 text-xs hover-surface-soft"
|
||||
data-testid="review-open-eligibility-details"
|
||||
@click="emit('open-details')"
|
||||
>
|
||||
|
||||
+2
-2
@@ -56,7 +56,7 @@ async function onConfirm() {
|
||||
try {
|
||||
const result = await closeWorkspaceShippingOrderReviewLineFulfillment(props.caseNo, {
|
||||
reason: trimmed,
|
||||
line_keys: props.lineKeys.length ? props.lineKeys : undefined,
|
||||
draft_line_ids: props.lineKeys.length ? props.lineKeys : undefined,
|
||||
expected_draft_version: props.draftVersion ?? undefined,
|
||||
});
|
||||
showReviewResumeOutcome(
|
||||
@@ -92,7 +92,7 @@ function onCancel() {
|
||||
data-testid="review-close-fulfillment-dialog"
|
||||
@click.self="onCancel"
|
||||
>
|
||||
<div class="w-full max-w-md rounded-xl border border-slate-200 bg-white p-4 shadow-xl dark:border-slate-800 dark:bg-slate-900">
|
||||
<div class="w-full max-w-md rounded-xl border border-default bg-surface p-4 shadow-xl">
|
||||
<h2 class="text-sm font-semibold">{{ title }}</h2>
|
||||
<p class="mt-1 text-xs text-muted">{{ t('chat.shippingOrderReview.closeFulfillment.subtitle') }}</p>
|
||||
<label class="mt-3 block text-xs font-medium text-secondary">
|
||||
|
||||
+1
-1
@@ -36,7 +36,7 @@ function checkLabel(code: string): string {
|
||||
<template>
|
||||
<details
|
||||
v-if="visible"
|
||||
class="rounded-xl border border-slate-200 bg-white p-2 text-xs dark:border-slate-800 dark:bg-slate-900"
|
||||
class="rounded-xl border border-default bg-surface p-2 text-xs"
|
||||
:open="defaultOpen"
|
||||
data-testid="review-completed-checks"
|
||||
>
|
||||
|
||||
+20
-10
@@ -9,7 +9,8 @@
|
||||
(与投影同源或后端 automation 运行态),空态自然落到「待机/状态待确认」,
|
||||
禁止把读取占位误述为「系统处理中」,也不做骨架→真值的二次刷新;
|
||||
loading 仅在挂载期抑制可执行动作,等权威投影到达后再放行(fail-closed);
|
||||
由 ShippingOrderReviewView 在 mountCurrentProcessingCard 时挂载。
|
||||
由 ShippingOrderReviewView 在 mountCurrentProcessingCard 时挂载;
|
||||
v2 新增 statusDetail:状态块内嵌动态说明(隐藏裁决在视图侧,见 spec §5.2)。
|
||||
-->
|
||||
<script setup lang="ts">
|
||||
import { computed } from 'vue';
|
||||
@@ -61,10 +62,12 @@ const props = defineProps<{
|
||||
} | null;
|
||||
showRetry?: boolean;
|
||||
loading?: boolean;
|
||||
/** 状态块内嵌动态说明(Run 级 lifecycle_progress 解析结果);null/空文本不渲染,显隐裁决在视图侧。 */
|
||||
statusDetail?: { text: string } | null;
|
||||
}>();
|
||||
|
||||
const emit = defineEmits<{
|
||||
locate: [lineKey?: string | null, fieldId?: string | null];
|
||||
locate: [draftLineId?: string | null, fieldId?: string | null];
|
||||
action: [code: string, parameters?: Record<string, unknown>];
|
||||
}>();
|
||||
|
||||
@@ -312,20 +315,20 @@ function handleBusinessActionClick() {
|
||||
}
|
||||
|
||||
/**
|
||||
* 辅助导航「定位明细」:仅当后端在 primary_action.parameters 里提供 line_key 或 field_id 才显示。
|
||||
* 辅助导航「定位明细」:仅当后端在 primary_action.parameters 里提供 draft_line_id 或 field_id 才显示。
|
||||
*/
|
||||
const showLocateAction = computed(() => {
|
||||
if (props.loading) return false;
|
||||
if (props.taskMissing) return false;
|
||||
const params = (props.primaryAction?.parameters ?? {}) as Record<string, unknown>;
|
||||
const hasLineKey = typeof params.line_key === 'string' && params.line_key.length > 0;
|
||||
const hasDraftLineId = typeof params.draft_line_id === 'string' && params.draft_line_id.length > 0;
|
||||
const hasFieldId = typeof params.field_id === 'string' && params.field_id.length > 0;
|
||||
return hasLineKey || hasFieldId;
|
||||
return hasDraftLineId || hasFieldId;
|
||||
});
|
||||
|
||||
const locateTargetLineKey = computed(() => {
|
||||
const locateTargetDraftLineId = computed(() => {
|
||||
const params = (props.primaryAction?.parameters ?? {}) as Record<string, unknown>;
|
||||
return typeof params.line_key === 'string' ? params.line_key : null;
|
||||
return typeof params.draft_line_id === 'string' ? params.draft_line_id : null;
|
||||
});
|
||||
|
||||
const locateTargetFieldId = computed(() => {
|
||||
@@ -334,7 +337,7 @@ const locateTargetFieldId = computed(() => {
|
||||
});
|
||||
|
||||
function handleLocateClick() {
|
||||
emit('locate', locateTargetLineKey.value, locateTargetFieldId.value);
|
||||
emit('locate', locateTargetDraftLineId.value, locateTargetFieldId.value);
|
||||
}
|
||||
|
||||
type ReviewCurrentUserStatus =
|
||||
@@ -379,6 +382,13 @@ type ReviewCurrentUserStatus =
|
||||
/>
|
||||
{{ statusLabel }}
|
||||
</dd>
|
||||
<!-- v2:状态块内嵌动态说明(弱文本一行,不加标题/图标/区块;显隐裁决在视图侧)。 -->
|
||||
<p
|
||||
v-if="statusDetail?.text"
|
||||
class="w-full text-[11px] leading-4 text-muted"
|
||||
data-testid="review-current-task-status-detail"
|
||||
aria-live="polite"
|
||||
>{{ statusDetail.text }}</p>
|
||||
</div>
|
||||
</dl>
|
||||
|
||||
@@ -451,7 +461,7 @@ type ReviewCurrentUserStatus =
|
||||
v-for="action in recoveryActions"
|
||||
:key="action.code"
|
||||
type="button"
|
||||
class="inline-flex items-center gap-1 rounded-md border border-sky-300 bg-white px-2.5 py-1.5 text-xs font-medium text-sky-800 shadow-sm transition hover:bg-sky-50 disabled:opacity-50 dark:border-sky-700 dark:bg-sky-900 dark:text-sky-100 dark:hover:bg-sky-800"
|
||||
class="inline-flex items-center gap-1 rounded-md border border-sky-300 bg-surface px-2.5 py-1.5 text-xs font-medium text-sky-800 shadow-sm transition hover:bg-sky-50 disabled:opacity-50 dark:border-sky-700 dark:bg-sky-900 dark:text-sky-100 dark:hover:bg-sky-800"
|
||||
:data-testid="`review-current-task-recovery-${action.code}`"
|
||||
:disabled="retrying || locating"
|
||||
@click="$emit('action', action.code, action.parameters || {})"
|
||||
@@ -461,7 +471,7 @@ type ReviewCurrentUserStatus =
|
||||
<button
|
||||
v-if="showLocateAction"
|
||||
type="button"
|
||||
class="inline-flex items-center gap-1 rounded-md border border-sky-300 bg-white px-2.5 py-1.5 text-xs font-medium text-sky-800 shadow-sm transition hover:bg-sky-50 disabled:opacity-50 dark:border-sky-700 dark:bg-sky-900 dark:text-sky-100 dark:hover:bg-sky-800"
|
||||
class="inline-flex items-center gap-1 rounded-md border border-sky-300 bg-surface px-2.5 py-1.5 text-xs font-medium text-sky-800 shadow-sm transition hover:bg-sky-50 disabled:opacity-50 dark:border-sky-700 dark:bg-sky-900 dark:text-sky-100 dark:hover:bg-sky-800"
|
||||
data-testid="review-current-task-locate-action"
|
||||
:disabled="locating"
|
||||
@click="handleLocateClick"
|
||||
|
||||
+1
-1
@@ -175,7 +175,7 @@ async function onRetry() {
|
||||
|
||||
<template>
|
||||
<section
|
||||
class="rounded-xl border border-slate-200 bg-white p-3 shadow-sm dark:border-slate-800 dark:bg-slate-900"
|
||||
class="rounded-xl border border-default bg-surface p-3 shadow-sm"
|
||||
data-testid="review-customer-resolution-panel"
|
||||
:data-compact="compact && resolved ? 'true' : 'false'"
|
||||
>
|
||||
|
||||
+33
-33
@@ -240,13 +240,13 @@ const coordinateIssueLabels = computed(() => {
|
||||
const panelClass = computed(() => {
|
||||
if (props.docked) {
|
||||
return [
|
||||
'relative flex min-h-[320px] min-w-0 flex-col overflow-hidden rounded-xl border border-slate-200',
|
||||
'bg-white shadow-sm xl:min-h-[520px] dark:border-slate-800 dark:bg-slate-900',
|
||||
'relative flex min-h-[320px] min-w-0 flex-col overflow-hidden rounded-xl border border-default',
|
||||
'bg-surface shadow-sm xl:min-h-[520px] ',
|
||||
].join(' ');
|
||||
}
|
||||
return [
|
||||
'fixed z-30 flex flex-col overflow-hidden rounded-xl border border-slate-200',
|
||||
'bg-white shadow-2xl dark:border-slate-700 dark:bg-slate-900',
|
||||
'fixed z-30 flex flex-col overflow-hidden rounded-xl border border-default',
|
||||
'bg-surface shadow-2xl ',
|
||||
].join(' ');
|
||||
});
|
||||
|
||||
@@ -590,7 +590,7 @@ onBeforeUnmount(() => {
|
||||
:data-height="Math.round(geom.height)"
|
||||
>
|
||||
<div
|
||||
class="flex shrink-0 flex-col gap-1.5 border-b border-slate-200 px-3 py-2 dark:border-slate-800"
|
||||
class="flex shrink-0 flex-col gap-1.5 border-b border-default px-3 py-2"
|
||||
:class="docked ? '' : 'cursor-grab active:cursor-grabbing select-none'"
|
||||
data-testid="review-evidence-drag-handle"
|
||||
@pointerdown="onDragStart"
|
||||
@@ -599,16 +599,16 @@ onBeforeUnmount(() => {
|
||||
<div class="min-w-0">
|
||||
<div
|
||||
id="review-evidence-drawer-title"
|
||||
class="text-xs font-semibold text-slate-700 dark:text-slate-200"
|
||||
class="text-xs font-semibold text-secondary"
|
||||
>
|
||||
{{ t('chat.shippingOrderReview.evidenceDrawer.title') }}
|
||||
</div>
|
||||
<p class="truncate text-[11px] text-slate-500">{{ pageLabel }}</p>
|
||||
<p class="truncate text-[11px] text-muted">{{ pageLabel }}</p>
|
||||
</div>
|
||||
<button
|
||||
ref="closeButtonRef"
|
||||
type="button"
|
||||
class="rounded border border-slate-300 px-2 py-1 text-xs hover:bg-slate-50 dark:border-slate-600 dark:hover:bg-slate-800"
|
||||
class="rounded border border-default px-2 py-1 text-xs hover-surface-soft"
|
||||
data-testid="review-evidence-close"
|
||||
@click="emit('close')"
|
||||
>
|
||||
@@ -620,19 +620,19 @@ onBeforeUnmount(() => {
|
||||
<div class="flex items-center gap-1" data-testid="review-evidence-nav-group">
|
||||
<button
|
||||
type="button"
|
||||
class="rounded border border-slate-300 px-2 py-1 text-xs hover:bg-slate-50 dark:border-slate-600 dark:hover:bg-slate-800"
|
||||
class="rounded border border-default px-2 py-1 text-xs hover-surface-soft"
|
||||
data-testid="review-evidence-prev"
|
||||
:disabled="!canPrev"
|
||||
@click="emit('prev-evidence')"
|
||||
>
|
||||
{{ t('chat.shippingOrderReview.evidenceDrawer.prevEvidence') }}
|
||||
</button>
|
||||
<span class="text-[11px] text-slate-500" data-testid="review-evidence-ordinal">
|
||||
<span class="text-[11px] text-muted" data-testid="review-evidence-ordinal">
|
||||
{{ evidenceOrdinal }}/{{ evidenceList.length || 0 }}
|
||||
</span>
|
||||
<button
|
||||
type="button"
|
||||
class="rounded border border-slate-300 px-2 py-1 text-xs hover:bg-slate-50 dark:border-slate-600 dark:hover:bg-slate-800"
|
||||
class="rounded border border-default px-2 py-1 text-xs hover-surface-soft"
|
||||
data-testid="review-evidence-next"
|
||||
:disabled="!canNext"
|
||||
@click="emit('next-evidence')"
|
||||
@@ -645,7 +645,7 @@ onBeforeUnmount(() => {
|
||||
<button
|
||||
v-if="!docked"
|
||||
type="button"
|
||||
class="rounded border border-slate-300 px-2 py-1 text-xs hover:bg-slate-50 dark:border-slate-600 dark:hover:bg-slate-800"
|
||||
class="rounded border border-default px-2 py-1 text-xs hover-surface-soft"
|
||||
data-testid="review-evidence-toggle-expand"
|
||||
:title="expanded
|
||||
? t('chat.shippingOrderReview.workbench.collapsePdfHint')
|
||||
@@ -658,7 +658,7 @@ onBeforeUnmount(() => {
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
class="rounded border border-slate-300 px-2 py-1 text-xs hover:bg-slate-50 dark:border-slate-600 dark:hover:bg-slate-800"
|
||||
class="rounded border border-default px-2 py-1 text-xs hover-surface-soft"
|
||||
data-testid="review-evidence-toggle-dock"
|
||||
:title="docked
|
||||
? t('chat.shippingOrderReview.workbench.undockPdfHint')
|
||||
@@ -672,7 +672,7 @@ onBeforeUnmount(() => {
|
||||
<div class="relative">
|
||||
<button
|
||||
type="button"
|
||||
class="rounded border border-slate-300 px-2 py-1 text-xs hover:bg-slate-50 dark:border-slate-600 dark:hover:bg-slate-800"
|
||||
class="rounded border border-default px-2 py-1 text-xs hover-surface-soft"
|
||||
data-testid="review-evidence-more"
|
||||
:aria-expanded="moreOpen ? 'true' : 'false'"
|
||||
@click="moreOpen = !moreOpen"
|
||||
@@ -681,13 +681,13 @@ onBeforeUnmount(() => {
|
||||
</button>
|
||||
<div
|
||||
v-if="moreOpen"
|
||||
class="absolute right-0 z-40 mt-1 min-w-[10rem] rounded-md border border-slate-200 bg-white py-1 text-xs shadow-lg dark:border-slate-700 dark:bg-slate-900"
|
||||
class="absolute right-0 z-40 mt-1 min-w-[10rem] rounded-md border border-default bg-surface py-1 text-xs shadow-lg"
|
||||
data-testid="review-evidence-more-menu"
|
||||
>
|
||||
<button
|
||||
v-if="!docked"
|
||||
type="button"
|
||||
class="block w-full px-3 py-1.5 text-left hover:bg-slate-50 dark:hover:bg-slate-800"
|
||||
class="block w-full px-3 py-1.5 text-left hover-surface-soft"
|
||||
data-testid="review-evidence-toggle-side"
|
||||
@click="emit('toggle-side'); moreOpen = false"
|
||||
>
|
||||
@@ -697,7 +697,7 @@ onBeforeUnmount(() => {
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
class="block w-full px-3 py-1.5 text-left hover:bg-slate-50 dark:hover:bg-slate-800"
|
||||
class="block w-full px-3 py-1.5 text-left hover-surface-soft"
|
||||
data-testid="review-evidence-toggle-pin"
|
||||
@click="emit('toggle-pin'); moreOpen = false"
|
||||
>
|
||||
@@ -708,7 +708,7 @@ onBeforeUnmount(() => {
|
||||
<button
|
||||
v-if="showAiActions"
|
||||
type="button"
|
||||
class="block w-full px-3 py-1.5 text-left hover:bg-slate-50 dark:hover:bg-slate-800"
|
||||
class="block w-full px-3 py-1.5 text-left hover-surface-soft"
|
||||
data-testid="review-evidence-request-ai"
|
||||
@click="emit('request-ai'); moreOpen = false"
|
||||
>
|
||||
@@ -717,7 +717,7 @@ onBeforeUnmount(() => {
|
||||
<button
|
||||
v-if="showAiActions"
|
||||
type="button"
|
||||
class="block w-full px-3 py-1.5 text-left hover:bg-slate-50 dark:hover:bg-slate-800"
|
||||
class="block w-full px-3 py-1.5 text-left hover-surface-soft"
|
||||
data-testid="review-evidence-restore-machine"
|
||||
@click="emit('restore-machine'); moreOpen = false"
|
||||
>
|
||||
@@ -736,10 +736,10 @@ onBeforeUnmount(() => {
|
||||
sandbox=""
|
||||
referrerpolicy="no-referrer"
|
||||
:title="fieldLabel || t('chat.shippingOrderReview.evidenceDrawer.title')"
|
||||
class="min-h-0 h-full w-full border-0 bg-white"
|
||||
class="min-h-0 h-full w-full border-0 bg-surface"
|
||||
data-testid="review-email-evidence-html"
|
||||
/>
|
||||
<div v-else-if="emailPreview" class="min-h-0 overflow-auto whitespace-pre-wrap p-4 font-mono text-xs leading-6 text-slate-700 dark:text-slate-200" data-testid="review-email-evidence-preview">
|
||||
<div v-else-if="emailPreview" class="min-h-0 overflow-auto whitespace-pre-wrap p-4 font-mono text-xs leading-6 text-secondary" data-testid="review-email-evidence-preview">
|
||||
{{ emailPreview.text }}
|
||||
</div>
|
||||
<ReviewDocumentPreview
|
||||
@@ -754,48 +754,48 @@ onBeforeUnmount(() => {
|
||||
/>
|
||||
<div
|
||||
v-else
|
||||
class="flex min-h-[140px] items-center justify-center p-4 text-sm text-slate-500"
|
||||
class="flex min-h-[140px] items-center justify-center p-4 text-sm text-muted"
|
||||
>
|
||||
{{ t('chat.shippingOrderReview.previewUnavailable') }}
|
||||
</div>
|
||||
|
||||
<details
|
||||
class="shrink-0 border-t border-slate-200 text-xs dark:border-slate-800"
|
||||
class="shrink-0 border-t border-default text-xs"
|
||||
data-testid="review-evidence-details"
|
||||
:open="detailsOpen"
|
||||
@toggle="detailsOpen = ($event.target as HTMLDetailsElement).open"
|
||||
>
|
||||
<summary class="cursor-pointer px-3 py-2 font-medium text-slate-700 hover:bg-slate-50 dark:text-slate-200 dark:hover:bg-slate-800/60">
|
||||
<summary class="cursor-pointer px-3 py-2 font-medium text-secondary hover-surface-soft dark:hover:bg-slate-800/60">
|
||||
{{ t('chat.shippingOrderReview.evidenceDrawer.detailsToggle') }}
|
||||
<span v-if="fieldLabel" class="ml-1 font-normal text-slate-500">· {{ fieldLabel }}</span>
|
||||
<span v-if="fieldLabel" class="ml-1 font-normal text-muted">· {{ fieldLabel }}</span>
|
||||
</summary>
|
||||
<div class="space-y-2 px-3 pb-2">
|
||||
<div v-if="fieldLabel" class="font-medium text-slate-700 dark:text-slate-200">
|
||||
<div v-if="fieldLabel" class="font-medium text-secondary">
|
||||
{{ t('chat.shippingOrderReview.evidenceDrawer.field', { field: fieldLabel }) }}
|
||||
</div>
|
||||
<dl class="grid gap-1 text-slate-600 dark:text-slate-300">
|
||||
<dl class="grid gap-1 text-secondary">
|
||||
<div class="flex gap-2">
|
||||
<dt class="shrink-0 text-slate-500">{{ t('chat.shippingOrderReview.evidenceDrawer.currentValue') }}</dt>
|
||||
<dt class="shrink-0 text-muted">{{ t('chat.shippingOrderReview.evidenceDrawer.currentValue') }}</dt>
|
||||
<dd class="min-w-0 break-words">{{ draftValue || t('chat.shippingOrderReview.emptyValue') }}</dd>
|
||||
</div>
|
||||
<div class="flex gap-2">
|
||||
<dt class="shrink-0 text-slate-500">{{ t('chat.shippingOrderReview.evidenceDrawer.machineValue') }}</dt>
|
||||
<dt class="shrink-0 text-muted">{{ t('chat.shippingOrderReview.evidenceDrawer.machineValue') }}</dt>
|
||||
<dd class="min-w-0 break-words">{{ machineValue || t('chat.shippingOrderReview.emptyValue') }}</dd>
|
||||
</div>
|
||||
<div class="flex gap-2">
|
||||
<dt class="shrink-0 text-slate-500">{{ t('chat.shippingOrderReview.evidenceDrawer.highlightQuality') }}</dt>
|
||||
<dt class="shrink-0 text-muted">{{ t('chat.shippingOrderReview.evidenceDrawer.highlightQuality') }}</dt>
|
||||
<dd data-testid="review-evidence-highlight-quality">{{ highlightQualityLabel }}</dd>
|
||||
</div>
|
||||
<div class="flex gap-2">
|
||||
<dt class="shrink-0 text-slate-500">{{ t('chat.shippingOrderReview.evidenceDrawer.highlightSource') }}</dt>
|
||||
<dt class="shrink-0 text-muted">{{ t('chat.shippingOrderReview.evidenceDrawer.highlightSource') }}</dt>
|
||||
<dd data-testid="review-evidence-highlight-source">{{ highlightSourceLabel }}</dd>
|
||||
</div>
|
||||
<div v-if="valueSourceLabel" class="flex gap-2">
|
||||
<dt class="shrink-0 text-slate-500">{{ t('chat.shippingOrderReview.evidenceDrawer.source') }}</dt>
|
||||
<dt class="shrink-0 text-muted">{{ t('chat.shippingOrderReview.evidenceDrawer.source') }}</dt>
|
||||
<dd>{{ valueSourceLabel }}</dd>
|
||||
</div>
|
||||
<div v-if="evidence?.table_id || evidence?.cell_id" class="flex gap-2">
|
||||
<dt class="shrink-0 text-slate-500">{{ t('chat.shippingOrderReview.evidenceDrawer.layoutPath') }}</dt>
|
||||
<dt class="shrink-0 text-muted">{{ t('chat.shippingOrderReview.evidenceDrawer.layoutPath') }}</dt>
|
||||
<dd class="min-w-0 break-all font-mono text-[11px]">
|
||||
{{ [evidence?.table_id, evidence?.cell_id].filter(Boolean).join(' / ') }}
|
||||
</dd>
|
||||
|
||||
+16
-16
@@ -180,10 +180,10 @@ function onSelect(caseNo: string) {
|
||||
data-testid="review-document-navigation"
|
||||
:data-nav-mode="mode"
|
||||
:class="mode === 'tabs'
|
||||
? 'rounded-xl border border-slate-200 bg-white p-2 shadow-sm dark:border-slate-800 dark:bg-slate-900'
|
||||
? 'rounded-xl border border-default bg-surface p-2 shadow-sm '
|
||||
: mode === 'narrow'
|
||||
? ''
|
||||
: ['sticky top-3 flex max-h-[calc(100vh-6rem)] w-full shrink-0 flex-col rounded-xl border border-slate-200 bg-white shadow-sm transition-[width] duration-200 dark:border-slate-800 dark:bg-slate-900', collapsed ? 'lg:w-20' : 'lg:w-64']"
|
||||
: ['sticky top-3 flex max-h-[calc(100vh-6rem)] w-full shrink-0 flex-col rounded-xl border border-default bg-surface shadow-sm transition-[width] duration-200 ', collapsed ? 'lg:w-20' : 'lg:w-64']"
|
||||
>
|
||||
<!-- 2–4:顶部标签 -->
|
||||
<div
|
||||
@@ -198,7 +198,7 @@ function onSelect(caseNo: string) {
|
||||
class="inline-flex min-w-[9rem] max-w-[240px] shrink-0 flex-col gap-0.5 rounded-lg border px-2.5 py-1.5 text-left text-xs transition-colors"
|
||||
:class="activeCaseNo === item.case_no
|
||||
? 'border-sky-500 bg-sky-50 text-sky-950 ring-1 ring-sky-400 dark:border-sky-700 dark:bg-sky-950/40 dark:text-sky-100'
|
||||
: 'border-slate-200 text-slate-700 hover:bg-slate-50 dark:border-slate-700 dark:text-slate-300 dark:hover:bg-slate-800'"
|
||||
: 'border-default text-secondary hover-surface-soft '"
|
||||
:data-testid="`review-doc-nav-${item.case_no}`"
|
||||
@click="onSelect(item.case_no)"
|
||||
>
|
||||
@@ -220,12 +220,12 @@ function onSelect(caseNo: string) {
|
||||
/>
|
||||
<Circle
|
||||
v-else
|
||||
class="h-3 w-3 shrink-0 text-slate-400"
|
||||
class="h-3 w-3 shrink-0 text-muted"
|
||||
aria-hidden="true"
|
||||
/>
|
||||
<span class="truncate">{{ item.file_name || t('chat.shippingOrderReview.unnamedDocument') }}</span>
|
||||
</span>
|
||||
<span class="truncate text-[10px] text-slate-500 dark:text-slate-400">
|
||||
<span class="truncate text-[10px] text-muted">
|
||||
{{ [
|
||||
item.po_number,
|
||||
lifecycleStageLabel(item),
|
||||
@@ -238,13 +238,13 @@ function onSelect(caseNo: string) {
|
||||
|
||||
<!-- ≥5:左侧列表 -->
|
||||
<template v-else-if="mode === 'sidebar' || mode === 'sidebar_search'">
|
||||
<div class="flex items-center justify-between gap-2 border-b border-slate-100 px-2 py-2 dark:border-slate-800">
|
||||
<div class="flex items-center justify-between gap-2 border-b border-subtle px-2 py-2">
|
||||
<span class="text-xs font-semibold text-primary">
|
||||
{{ t('chat.shippingOrderReview.otNav.listTitle', { count: items.length }) }}
|
||||
</span>
|
||||
<button
|
||||
type="button"
|
||||
class="rounded p-1 text-muted hover:bg-slate-100 dark:hover:bg-slate-800"
|
||||
class="rounded p-1 text-muted hover-surface-strong"
|
||||
data-testid="review-doc-nav-collapse"
|
||||
:aria-label="collapsed ? t('chat.shippingOrderReview.documentNavigation') : t('chat.shippingOrderReview.documentNavigation')"
|
||||
@click="collapsed = !collapsed"
|
||||
@@ -262,21 +262,21 @@ function onSelect(caseNo: string) {
|
||||
|
||||
<div
|
||||
v-if="!collapsed && mode === 'sidebar_search'"
|
||||
class="space-y-2 border-b border-slate-100 px-2 py-2 dark:border-slate-800"
|
||||
class="space-y-2 border-b border-subtle px-2 py-2"
|
||||
>
|
||||
<label class="relative block">
|
||||
<Search class="pointer-events-none absolute left-2 top-1.5 h-3.5 w-3.5 text-muted" />
|
||||
<input
|
||||
v-model="searchQuery"
|
||||
type="search"
|
||||
class="w-full rounded-md border border-slate-200 bg-white py-1 pl-7 pr-2 text-[11px] dark:border-slate-700 dark:bg-slate-950"
|
||||
class="w-full rounded-md border border-default bg-surface py-1 pl-7 pr-2 text-[11px]"
|
||||
:placeholder="t('chat.shippingOrderReview.otNav.searchPlaceholder')"
|
||||
data-testid="review-doc-nav-search"
|
||||
>
|
||||
</label>
|
||||
<select
|
||||
v-model="statusFilter"
|
||||
class="w-full rounded-md border border-slate-200 bg-white px-2 py-1 text-[11px] dark:border-slate-700 dark:bg-slate-950"
|
||||
class="w-full rounded-md border border-default bg-surface px-2 py-1 text-[11px]"
|
||||
data-testid="review-doc-nav-filter"
|
||||
>
|
||||
<option value="all">{{ t('chat.shippingOrderReview.otNav.filterAll') }}</option>
|
||||
@@ -299,7 +299,7 @@ function onSelect(caseNo: string) {
|
||||
class="mb-1 flex w-full items-start gap-2 rounded-lg border px-2 py-1.5 text-left text-xs transition-colors"
|
||||
:class="activeCaseNo === item.case_no
|
||||
? 'border-sky-500 bg-sky-50 dark:border-sky-700 dark:bg-sky-950/40'
|
||||
: 'border-transparent hover:bg-slate-50 dark:hover:bg-slate-800'"
|
||||
: 'border-transparent hover-surface-soft '"
|
||||
:title="collapsed
|
||||
? `${item.file_name || item.case_no} · ${caseStatusLabel(item.status)}`
|
||||
: undefined"
|
||||
@@ -308,11 +308,11 @@ function onSelect(caseNo: string) {
|
||||
>
|
||||
<span
|
||||
v-if="collapsed"
|
||||
class="flex h-12 w-full min-w-0 flex-col items-center justify-center rounded-md bg-slate-100 px-1 text-[10px] dark:bg-slate-800"
|
||||
class="flex h-12 w-full min-w-0 flex-col items-center justify-center rounded-md bg-surface-strong px-1 text-[10px]"
|
||||
:title="`${index + 1}. ${item.file_name || item.case_no}`"
|
||||
>
|
||||
<span class="font-semibold">{{ index + 1 }}</span>
|
||||
<span class="mt-0.5 w-full truncate text-center text-[9px] font-medium text-slate-600 dark:text-slate-300">
|
||||
<span class="mt-0.5 w-full truncate text-center text-[9px] font-medium text-secondary">
|
||||
{{ (item.file_name || item.case_no).replace(/\.[^.]+$/, '').slice(0, 7) }}
|
||||
</span>
|
||||
</span>
|
||||
@@ -331,7 +331,7 @@ function onSelect(caseNo: string) {
|
||||
/>
|
||||
<Circle
|
||||
v-else
|
||||
class="mt-0.5 h-3 w-3 shrink-0 text-slate-400"
|
||||
class="mt-0.5 h-3 w-3 shrink-0 text-muted"
|
||||
/>
|
||||
<span class="min-w-0 flex-1">
|
||||
<span class="block truncate font-medium text-primary">
|
||||
@@ -354,7 +354,7 @@ function onSelect(caseNo: string) {
|
||||
<template v-else-if="mode === 'narrow'">
|
||||
<button
|
||||
type="button"
|
||||
class="inline-flex items-center gap-2 rounded-xl border border-slate-200 bg-white px-3 py-2 text-xs font-medium shadow-sm dark:border-slate-800 dark:bg-slate-900"
|
||||
class="inline-flex items-center gap-2 rounded-xl border border-default bg-surface px-3 py-2 text-xs font-medium shadow-sm"
|
||||
data-testid="review-doc-nav-narrow-trigger"
|
||||
@click="drawerOpen = true"
|
||||
>
|
||||
@@ -391,7 +391,7 @@ function onSelect(caseNo: string) {
|
||||
class="flex w-full flex-col rounded-lg border px-3 py-2 text-left text-xs"
|
||||
:class="activeCaseNo === item.case_no
|
||||
? 'border-sky-500 bg-sky-50'
|
||||
: 'border-slate-200'"
|
||||
: 'border-default'"
|
||||
:data-testid="`review-doc-nav-${item.case_no}`"
|
||||
@click="onSelect(item.case_no)"
|
||||
>
|
||||
|
||||
@@ -373,25 +373,25 @@ watch(
|
||||
|
||||
<template>
|
||||
<div
|
||||
class="relative flex flex-1 flex-col overflow-hidden bg-slate-100 dark:bg-slate-950"
|
||||
class="relative flex flex-1 flex-col overflow-hidden bg-surface-strong"
|
||||
:class="drawerMode ? 'min-h-[200px]' : 'min-h-[180px] xl:min-h-[360px]'"
|
||||
:data-drawer-mode="drawerMode ? 'true' : 'false'"
|
||||
>
|
||||
<div class="flex shrink-0 items-center justify-between gap-1 border-b border-slate-200 bg-white/95 px-2 py-1.5 text-xs dark:border-slate-800 dark:bg-slate-900/95">
|
||||
<div class="flex shrink-0 items-center justify-between gap-1 border-b border-default bg-white/95 px-2 py-1.5 text-xs dark:bg-slate-900/95">
|
||||
<div class="flex items-center gap-1">
|
||||
<button
|
||||
type="button"
|
||||
class="rounded border px-2 py-1 hover:bg-slate-50 disabled:opacity-40 dark:border-slate-700 dark:hover:bg-slate-800"
|
||||
class="rounded border px-2 py-1 hover-surface-soft disabled:opacity-40"
|
||||
data-testid="review-pdf-prev-page"
|
||||
:disabled="currentPage <= 1"
|
||||
@click="prevPage"
|
||||
>‹</button>
|
||||
<span class="min-w-16 text-center text-slate-600 dark:text-slate-300" data-testid="review-pdf-page-label">
|
||||
<span class="min-w-16 text-center text-secondary" data-testid="review-pdf-page-label">
|
||||
{{ currentPage }} / {{ pageCount || '—' }}
|
||||
</span>
|
||||
<button
|
||||
type="button"
|
||||
class="rounded border px-2 py-1 hover:bg-slate-50 disabled:opacity-40 dark:border-slate-700 dark:hover:bg-slate-800"
|
||||
class="rounded border px-2 py-1 hover-surface-soft disabled:opacity-40"
|
||||
data-testid="review-pdf-next-page"
|
||||
:disabled="!pageCount || currentPage >= pageCount"
|
||||
@click="nextPage"
|
||||
@@ -402,13 +402,13 @@ watch(
|
||||
type="number"
|
||||
min="1"
|
||||
:max="pageCount || undefined"
|
||||
class="w-12 rounded border border-slate-300 px-1 py-0.5 text-center dark:border-slate-700 dark:bg-slate-950"
|
||||
class="w-12 rounded border border-default px-1 py-0.5 text-center"
|
||||
data-testid="review-pdf-page-jump"
|
||||
:aria-label="t('chat.shippingOrderReview.previewZoom.jumpPage')"
|
||||
>
|
||||
<button
|
||||
type="submit"
|
||||
class="rounded border px-1.5 py-0.5 hover:bg-slate-50 dark:border-slate-700 dark:hover:bg-slate-800"
|
||||
class="rounded border px-1.5 py-0.5 hover-surface-soft"
|
||||
data-testid="review-pdf-page-jump-go"
|
||||
>{{ t('chat.shippingOrderReview.previewZoom.go') }}</button>
|
||||
</form>
|
||||
@@ -416,33 +416,33 @@ watch(
|
||||
<div class="flex flex-wrap items-center gap-1">
|
||||
<button
|
||||
type="button"
|
||||
class="rounded border px-1.5 py-1 hover:bg-slate-50 dark:border-slate-700 dark:hover:bg-slate-800"
|
||||
class="rounded border px-1.5 py-1 hover-surface-soft"
|
||||
data-testid="review-pdf-zoom-fit-width"
|
||||
:title="t('chat.shippingOrderReview.previewZoom.fitWidth')"
|
||||
@click="fitWidth"
|
||||
>{{ t('chat.shippingOrderReview.previewZoom.fitWidthShort') }}</button>
|
||||
<button
|
||||
type="button"
|
||||
class="rounded border px-1.5 py-1 hover:bg-slate-50 dark:border-slate-700 dark:hover:bg-slate-800"
|
||||
class="rounded border px-1.5 py-1 hover-surface-soft"
|
||||
data-testid="review-pdf-zoom-fit-page"
|
||||
:title="t('chat.shippingOrderReview.previewZoom.fitPage')"
|
||||
@click="fitPage"
|
||||
>{{ t('chat.shippingOrderReview.previewZoom.fitPageShort') }}</button>
|
||||
<button
|
||||
type="button"
|
||||
class="rounded border px-1.5 py-1 hover:bg-slate-50 dark:border-slate-700 dark:hover:bg-slate-800"
|
||||
class="rounded border px-1.5 py-1 hover-surface-soft"
|
||||
data-testid="review-pdf-zoom-actual"
|
||||
:title="t('chat.shippingOrderReview.previewZoom.actual')"
|
||||
@click="zoomActual"
|
||||
>100%</button>
|
||||
<button type="button" class="rounded border px-2 py-1 hover:bg-slate-50 dark:border-slate-700 dark:hover:bg-slate-800" data-testid="review-pdf-zoom-out" @click="zoomOut">−</button>
|
||||
<span class="min-w-12 text-center text-slate-600 dark:text-slate-300" data-testid="review-pdf-zoom-label">{{ zoomLabel }}</span>
|
||||
<button type="button" class="rounded border px-2 py-1 hover:bg-slate-50 dark:border-slate-700 dark:hover:bg-slate-800" data-testid="review-pdf-zoom-in" @click="zoomIn">+</button>
|
||||
<button type="button" class="rounded border px-2 py-1 hover-surface-soft" data-testid="review-pdf-zoom-out" @click="zoomOut">−</button>
|
||||
<span class="min-w-12 text-center text-secondary" data-testid="review-pdf-zoom-label">{{ zoomLabel }}</span>
|
||||
<button type="button" class="rounded border px-2 py-1 hover-surface-soft" data-testid="review-pdf-zoom-in" @click="zoomIn">+</button>
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
v-if="showCandidateBanner || showVerifiedLegend"
|
||||
class="flex shrink-0 flex-wrap items-center gap-2 border-b border-slate-200 bg-white/90 px-2 py-1 text-[11px] dark:border-slate-800 dark:bg-slate-900/90"
|
||||
class="flex shrink-0 flex-wrap items-center gap-2 border-b border-default bg-white/90 px-2 py-1 text-[11px] dark:bg-slate-900/90"
|
||||
data-testid="review-pdf-highlight-legend"
|
||||
>
|
||||
<span
|
||||
@@ -471,8 +471,8 @@ watch(
|
||||
@pointerdown="onPanStart"
|
||||
>
|
||||
<!-- Keep the canvas mounted while PDF.js is loading; otherwise nextTick cannot obtain a render target. -->
|
||||
<canvas ref="canvas" :aria-label="title" class="bg-white shadow select-none" :class="{ invisible: loading || failed }" />
|
||||
<span v-if="loading" class="absolute text-sm text-slate-500">{{ loadingText }}</span>
|
||||
<canvas ref="canvas" :aria-label="title" class="bg-surface shadow select-none" :class="{ invisible: loading || failed }" />
|
||||
<span v-if="loading" class="absolute text-sm text-muted">{{ loadingText }}</span>
|
||||
<span v-else-if="failed" class="absolute text-sm text-rose-600">{{ unavailableText }}</span>
|
||||
<div
|
||||
v-else-if="showCandidateBanner && !loading && !failed"
|
||||
|
||||
@@ -165,7 +165,7 @@ defineExpose({
|
||||
|
||||
<div
|
||||
v-if="primaryMatch"
|
||||
class="mt-2 rounded-lg border border-amber-200 bg-white/90 px-2.5 py-2 text-xs text-secondary dark:border-amber-900 dark:bg-slate-900"
|
||||
class="mt-2 rounded-lg border border-amber-200 bg-white/90 px-2.5 py-2 text-xs text-secondary dark:border-amber-900"
|
||||
data-testid="review-duplicate-match"
|
||||
>
|
||||
<div class="font-medium text-primary">
|
||||
|
||||
+1
-1
@@ -44,7 +44,7 @@ function fieldLabel(issue: FieldCompletenessIssue): string {
|
||||
<template>
|
||||
<section
|
||||
v-if="visible"
|
||||
class="rounded-xl border border-slate-200 bg-white p-3 shadow-sm dark:border-slate-800 dark:bg-slate-900"
|
||||
class="rounded-xl border border-default bg-surface p-3 shadow-sm"
|
||||
data-testid="review-field-completeness-panel"
|
||||
:data-status="status"
|
||||
>
|
||||
|
||||
@@ -24,7 +24,7 @@ const props = defineProps<{
|
||||
|
||||
const emit = defineEmits<{
|
||||
refreshed: [];
|
||||
'focus-conflict': [payload: { fieldCode: string; lineIndex: number | null; lineKey: string | null }];
|
||||
'focus-conflict': [payload: { fieldCode: string; lineIndex: number | null; draftLineId: string | null }];
|
||||
}>();
|
||||
|
||||
const { t, te } = useI18n();
|
||||
@@ -90,7 +90,7 @@ function onFocus(conflict: ShippingOrderReviewFieldConflict) {
|
||||
emit('focus-conflict', {
|
||||
fieldCode: conflict.field_code,
|
||||
lineIndex: conflict.line_index ?? null,
|
||||
lineKey: conflict.line_key ?? null,
|
||||
draftLineId: conflict.draft_line_id ?? null,
|
||||
});
|
||||
}
|
||||
|
||||
@@ -212,7 +212,7 @@ async function submitCustom(conflict: ShippingOrderReviewFieldConflict) {
|
||||
<li
|
||||
v-for="conflict in openConflicts"
|
||||
:key="conflict.conflict_key"
|
||||
class="rounded-lg border border-rose-200 bg-white/95 px-2.5 py-2 dark:border-rose-900 dark:bg-slate-900"
|
||||
class="rounded-lg border border-rose-200 bg-white/95 px-2.5 py-2 dark:border-rose-900"
|
||||
:data-testid="`review-field-conflict-${conflict.conflict_key}`"
|
||||
>
|
||||
<div class="flex flex-wrap items-center justify-between gap-2">
|
||||
@@ -247,7 +247,7 @@ async function submitCustom(conflict: ShippingOrderReviewFieldConflict) {
|
||||
class="rounded px-1 py-0.5 text-[10px] font-medium"
|
||||
:class="option.evidence_role === 'primary_pdf'
|
||||
? 'bg-sky-100 text-sky-800 dark:bg-sky-950 dark:text-sky-200'
|
||||
: 'bg-slate-100 text-slate-700 dark:bg-slate-800 dark:text-slate-200'"
|
||||
: 'bg-surface-strong text-secondary '"
|
||||
:data-testid="`review-field-conflict-evidence-role-${idx}`"
|
||||
:data-evidence-role="option.evidence_role"
|
||||
>
|
||||
@@ -315,7 +315,7 @@ async function submitCustom(conflict: ShippingOrderReviewFieldConflict) {
|
||||
<li
|
||||
v-for="issue in openEvidenceIssues"
|
||||
:key="`${issue.conflict_key}-${issue.reason}`"
|
||||
class="flex flex-wrap items-center justify-between gap-2 rounded border border-amber-200 bg-white/95 px-2.5 py-2 text-xs dark:border-amber-900 dark:bg-slate-900"
|
||||
class="flex flex-wrap items-center justify-between gap-2 rounded border border-amber-200 bg-white/95 px-2.5 py-2 text-xs dark:border-amber-900"
|
||||
>
|
||||
<span class="text-amber-950 dark:text-amber-50">
|
||||
<span class="text-muted">{{ scopeLabel(issue.scope) }} · </span>
|
||||
|
||||
+3
-3
@@ -5,12 +5,12 @@ import { useI18n } from 'vue-i18n';
|
||||
import type { ShippingOrderReviewLineFulfillment } from '@/features/chat/types/shipping.api.types';
|
||||
|
||||
const props = defineProps<{ caseNo: string; draftVersion: number | null | undefined; lineFulfillment: ShippingOrderReviewLineFulfillment | null | undefined; editable: boolean }>();
|
||||
const emit = defineEmits<{ refreshed: []; 'open-close-dialog': [lineKeys: string[]] }>();
|
||||
const emit = defineEmits<{ refreshed: []; 'open-close-dialog': [draftLineIds: string[]] }>();
|
||||
const { t } = useI18n();
|
||||
const TERMINAL_STATUSES = new Set(['task_created', 'fulfilled', 'closed_unfulfillable']);
|
||||
const openLines = computed(() => (props.lineFulfillment?.lines || []).filter((line) => !TERMINAL_STATUSES.has(String(line.line_status || ''))));
|
||||
const visible = computed(() => Boolean(props.lineFulfillment?.has_open_lines || props.lineFulfillment?.has_shortage));
|
||||
function onCloseRemaining() { emit('open-close-dialog', openLines.value.map((line) => line.line_key)); }
|
||||
function onCloseRemaining() { emit('open-close-dialog', openLines.value.map((line) => line.draft_line_id)); }
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@@ -25,6 +25,6 @@ function onCloseRemaining() { emit('open-close-dialog', openLines.value.map((lin
|
||||
<div class="rounded-lg bg-white/70 px-2.5 py-2 dark:bg-slate-900/50">{{ t('chat.shippingOrderReview.fulfillmentDecision.autoProgressCount', { count: lineFulfillment?.auto_progress_count ?? 0 }) }}</div>
|
||||
<div class="rounded-lg bg-white/70 px-2.5 py-2 dark:bg-slate-900/50">{{ t('chat.shippingOrderReview.fulfillmentDecision.summaryHint') }}</div>
|
||||
</div>
|
||||
<div v-if="editable && openLines.length" class="mt-3"><button type="button" class="rounded-xl border border-rose-300 bg-white px-3 py-1.5 text-sm text-rose-800 hover:bg-rose-50 dark:border-rose-800 dark:bg-slate-900 dark:text-rose-200" data-testid="review-fulfillment-close-remaining" @click="onCloseRemaining">{{ t('chat.shippingOrderReview.fulfillmentDecision.closeRemaining') }}</button></div>
|
||||
<div v-if="editable && openLines.length" class="mt-3"><button type="button" class="rounded-xl border border-rose-300 bg-surface px-3 py-1.5 text-sm text-rose-800 hover:bg-rose-50 dark:border-rose-800 dark:text-rose-200" data-testid="review-fulfillment-close-remaining" @click="onCloseRemaining">{{ t('chat.shippingOrderReview.fulfillmentDecision.closeRemaining') }}</button></div>
|
||||
</section>
|
||||
</template>
|
||||
@@ -47,7 +47,7 @@ watch(
|
||||
>
|
||||
<div
|
||||
v-if="loading"
|
||||
class="rounded-xl border border-dashed border-slate-300 bg-slate-50 p-4 text-sm text-slate-600 dark:border-slate-700 dark:bg-slate-900/40 dark:text-slate-300"
|
||||
class="rounded-xl border border-dashed border-default bg-surface-soft p-4 text-sm text-secondary dark:bg-slate-900/40"
|
||||
data-testid="intake-parse-loading"
|
||||
>
|
||||
{{ t('chat.shippingOrderReview.lifecycle.intakeParse.loading') }}
|
||||
@@ -70,38 +70,38 @@ watch(
|
||||
</div>
|
||||
|
||||
<template v-else-if="context">
|
||||
<section class="rounded-xl border border-slate-200 bg-white p-4 shadow-sm dark:border-slate-800 dark:bg-slate-900">
|
||||
<section class="rounded-xl border border-default bg-surface p-4 shadow-sm">
|
||||
<h2 class="text-sm font-semibold">{{ t('chat.shippingOrderReview.lifecycle.intakeParse.email') }}</h2>
|
||||
<template v-if="context.email">
|
||||
<p class="mt-1 text-xs text-slate-500">{{ context.email.filename }}</p>
|
||||
<p class="mt-1 text-xs text-muted">{{ context.email.filename }}</p>
|
||||
<iframe
|
||||
v-if="context.email.render_kind === 'safe_html' && context.email.preview_url"
|
||||
:src="context.email.preview_url"
|
||||
sandbox=""
|
||||
referrerpolicy="no-referrer"
|
||||
:title="t('chat.shippingOrderReview.lifecycle.intakeParse.emailPreviewTitle')"
|
||||
class="mt-3 h-72 w-full rounded border border-slate-200 bg-white dark:border-slate-700 dark:bg-slate-950"
|
||||
class="mt-3 h-72 w-full rounded border border-default bg-surface"
|
||||
data-testid="intake-parse-email-html"
|
||||
/>
|
||||
<pre
|
||||
v-else
|
||||
class="mt-3 max-h-72 overflow-auto whitespace-pre-wrap break-words rounded bg-slate-50 p-3 text-xs text-slate-700 dark:bg-slate-950/50 dark:text-slate-200"
|
||||
class="mt-3 max-h-72 overflow-auto whitespace-pre-wrap break-words rounded bg-surface-soft p-3 text-xs text-secondary dark:bg-slate-950/50"
|
||||
data-testid="intake-parse-email-body"
|
||||
>{{ context.email.text }}</pre>
|
||||
</template>
|
||||
<p
|
||||
v-else
|
||||
class="mt-2 text-sm text-slate-500"
|
||||
class="mt-2 text-sm text-muted"
|
||||
data-testid="intake-parse-no-email"
|
||||
>
|
||||
{{ t('chat.shippingOrderReview.lifecycle.intakeParse.noEmail') }}
|
||||
</p>
|
||||
</section>
|
||||
|
||||
<section class="rounded-xl border border-slate-200 bg-white p-4 shadow-sm dark:border-slate-800 dark:bg-slate-900">
|
||||
<section class="rounded-xl border border-default bg-surface p-4 shadow-sm">
|
||||
<h2 class="text-sm font-semibold" data-testid="intake-parse-attachment-heading">
|
||||
{{ t('chat.shippingOrderReview.lifecycle.intakeParse.attachment') }} ·
|
||||
<span class="font-normal text-slate-500 dark:text-slate-400">{{ context.attachment.filename }}</span>
|
||||
<span class="font-normal text-muted">{{ context.attachment.filename }}</span>
|
||||
</h2>
|
||||
|
||||
<div
|
||||
@@ -111,7 +111,7 @@ watch(
|
||||
>
|
||||
<p
|
||||
v-if="previewLoading"
|
||||
class="mt-2 text-sm text-slate-500"
|
||||
class="mt-2 text-sm text-muted"
|
||||
data-testid="intake-parse-preview-loading"
|
||||
>
|
||||
{{ t('chat.shippingOrderReview.lifecycle.intakeParse.previewLoading') }}
|
||||
@@ -120,12 +120,12 @@ watch(
|
||||
v-else-if="previewUrl"
|
||||
:src="previewUrl"
|
||||
:title="context.attachment.filename"
|
||||
class="mt-2 h-[32rem] w-full rounded border border-slate-200 dark:border-slate-700"
|
||||
class="mt-2 h-[32rem] w-full rounded border border-default"
|
||||
/>
|
||||
<button
|
||||
v-else
|
||||
type="button"
|
||||
class="mt-2 rounded border border-slate-300 px-2.5 py-1 text-xs hover:bg-slate-50 dark:border-slate-700 dark:hover:bg-slate-800"
|
||||
class="mt-2 rounded border border-default px-2.5 py-1 text-xs hover-surface-soft"
|
||||
data-testid="intake-parse-load-preview"
|
||||
@click="emit('load-preview')"
|
||||
>
|
||||
@@ -134,7 +134,7 @@ watch(
|
||||
</div>
|
||||
<p
|
||||
v-else
|
||||
class="mt-4 rounded bg-slate-50 p-3 text-sm text-slate-500 dark:bg-slate-950/50"
|
||||
class="mt-4 rounded bg-surface-soft p-3 text-sm text-muted dark:bg-slate-950/50"
|
||||
data-testid="intake-parse-preview-unsupported"
|
||||
>
|
||||
{{ t('chat.shippingOrderReview.lifecycle.intakeParse.previewUnsupported') }}
|
||||
|
||||
+16
-16
@@ -18,7 +18,7 @@ const props = defineProps<{
|
||||
}>();
|
||||
|
||||
const emit = defineEmits<{
|
||||
(e: 'reroute', lineKey?: string): void;
|
||||
(e: 'reroute', draftLineId?: string): void;
|
||||
}>();
|
||||
|
||||
const { t, te } = useI18n();
|
||||
@@ -84,8 +84,8 @@ function unavailableReasonLabel(line: ShippingOrderReviewBuildEligibilityLinePro
|
||||
* 触发行级重新匹配路由。
|
||||
*/
|
||||
function rerouteLine(line: ShippingOrderReviewBuildEligibilityLineProjection) {
|
||||
const lineKey = String(line.line_key || '').trim();
|
||||
emit('reroute', lineKey || undefined);
|
||||
const draftLineId = String(line.draft_line_id || '').trim();
|
||||
emit('reroute', draftLineId || undefined);
|
||||
}
|
||||
|
||||
</script>
|
||||
@@ -98,24 +98,24 @@ function rerouteLine(line: ShippingOrderReviewBuildEligibilityLineProjection) {
|
||||
>
|
||||
<header class="mb-3">
|
||||
<h2 class="text-sm font-semibold">{{ t('chat.shippingOrderReview.inventoryCandidates.title') }}</h2>
|
||||
<p class="mt-0.5 text-xs text-slate-600 dark:text-slate-400">
|
||||
<p class="mt-0.5 text-xs text-secondary">
|
||||
{{ t('chat.shippingOrderReview.inventoryCandidates.subtitle') }}
|
||||
</p>
|
||||
<p class="mt-1 text-xs text-slate-500 dark:text-slate-400">
|
||||
<p class="mt-1 text-xs text-muted">
|
||||
{{ t('chat.shippingOrderReview.inventoryRouting.rerouteHint') }}
|
||||
</p>
|
||||
</header>
|
||||
|
||||
<article
|
||||
v-for="line in lines"
|
||||
:key="String(line.line_key || line.line_index)"
|
||||
class="mb-3 rounded-lg border border-slate-200 bg-white p-3 last:mb-0 dark:border-slate-700 dark:bg-slate-900"
|
||||
:data-testid="`review-inventory-candidates-line-${line.line_key || line.line_index}`"
|
||||
:key="String(line.line_no)"
|
||||
class="mb-3 rounded-lg border border-default bg-surface p-3 last:mb-0"
|
||||
:data-testid="`review-inventory-candidates-line-${line.line_no}`"
|
||||
>
|
||||
<div class="flex flex-wrap items-center justify-between gap-2 text-sm">
|
||||
<span class="font-medium">
|
||||
{{ t('chat.shippingOrderReview.line', { index: (line.line_index ?? 0) + 1 }) }}
|
||||
<span v-if="line.effective_reservation_id" class="ml-1 text-xs text-slate-500">
|
||||
<span v-if="line.effective_reservation_id" class="ml-1 text-xs text-muted">
|
||||
{{ line.effective_reservation_id }}
|
||||
</span>
|
||||
</span>
|
||||
@@ -126,7 +126,7 @@ function rerouteLine(line: ShippingOrderReviewBuildEligibilityLineProjection) {
|
||||
|
||||
<p
|
||||
v-if="line.inventory_source_hint"
|
||||
class="mt-2 text-xs text-slate-600 dark:text-slate-300"
|
||||
class="mt-2 text-xs text-secondary"
|
||||
data-testid="review-inventory-routing-hint"
|
||||
>
|
||||
{{ t('chat.shippingOrderReview.inventoryRouting.hint') }}:
|
||||
@@ -138,14 +138,14 @@ function rerouteLine(line: ShippingOrderReviewBuildEligibilityLineProjection) {
|
||||
>{{ sourceCodeLabel(String(line.inventory_source_hint)) }}</span>
|
||||
</p>
|
||||
|
||||
<div class="mt-2 space-y-2 text-xs text-slate-600 dark:text-slate-300">
|
||||
<div class="mt-2 space-y-2 text-xs text-secondary">
|
||||
<div v-if="matchedRuleCodes(line).length" data-testid="review-inventory-matched-rules">
|
||||
<div class="font-medium">{{ t('chat.shippingOrderReview.inventoryRouting.matchedRules') }}</div>
|
||||
<div class="mt-1 flex flex-wrap gap-1.5">
|
||||
<span
|
||||
v-for="ruleCode in matchedRuleCodes(line)"
|
||||
:key="`rule-${ruleCode}`"
|
||||
class="rounded border border-slate-200 bg-slate-50 px-1.5 py-0.5 font-mono text-[11px] dark:border-slate-600 dark:bg-slate-800"
|
||||
class="rounded border border-default bg-surface-soft px-1.5 py-0.5 font-mono text-[11px]"
|
||||
>{{ ruleCode }}</span>
|
||||
</div>
|
||||
</div>
|
||||
@@ -155,11 +155,11 @@ function rerouteLine(line: ShippingOrderReviewBuildEligibilityLineProjection) {
|
||||
<div
|
||||
v-for="code in line.raw_rule_source_codes"
|
||||
:key="`raw-${code}`"
|
||||
class="rounded-md border border-slate-200 bg-white px-2 py-1.5 dark:border-slate-600 dark:bg-slate-950"
|
||||
class="rounded-md border border-default bg-surface px-2 py-1.5"
|
||||
>
|
||||
<div class="truncate font-medium text-slate-700 dark:text-slate-200">{{ sourceBusinessName(String(code)) }}</div>
|
||||
<div class="truncate font-medium text-secondary">{{ sourceBusinessName(String(code)) }}</div>
|
||||
<div
|
||||
class="mt-0.5 font-mono text-[11px] text-slate-500"
|
||||
class="mt-0.5 font-mono text-[11px] text-muted"
|
||||
:data-source-code="sourceCodeLabel(String(code))"
|
||||
>{{ sourceCodeLabel(String(code)) }}</div>
|
||||
</div>
|
||||
@@ -203,7 +203,7 @@ function rerouteLine(line: ShippingOrderReviewBuildEligibilityLineProjection) {
|
||||
<div class="mt-3 flex flex-wrap items-center justify-end gap-2">
|
||||
<button
|
||||
type="button"
|
||||
class="rounded border border-slate-300 bg-white px-3 py-1.5 text-xs text-slate-700 disabled:opacity-50 dark:border-slate-600 dark:bg-slate-950 dark:text-slate-200"
|
||||
class="rounded border border-default bg-surface px-3 py-1.5 text-xs text-secondary disabled:opacity-50"
|
||||
data-testid="review-inventory-routing-reroute"
|
||||
:disabled="!editable || saving"
|
||||
@click="rerouteLine(line)"
|
||||
|
||||
+1
-1
@@ -66,7 +66,7 @@ const reasonLabel = computed(() => {
|
||||
</p>
|
||||
<button
|
||||
type="button"
|
||||
class="mt-3 w-full rounded-xl border border-amber-300 bg-white px-3 py-1.5 text-sm text-amber-950 hover:bg-amber-100 disabled:opacity-50 dark:border-amber-800 dark:bg-slate-900 dark:text-amber-50"
|
||||
class="mt-3 w-full rounded-xl border border-amber-300 bg-surface px-3 py-1.5 text-sm text-amber-950 hover:bg-amber-100 disabled:opacity-50 dark:border-amber-800 dark:text-amber-50"
|
||||
data-testid="review-inventory-fallback-retry"
|
||||
:disabled="busy"
|
||||
@click="emit('retry-preparation')"
|
||||
|
||||
@@ -40,7 +40,7 @@ function blockReasonLabel(reason?: string | null): string {
|
||||
<template>
|
||||
<section
|
||||
v-if="lines.length"
|
||||
class="rounded-xl border border-slate-200 bg-white p-3 shadow-sm dark:border-slate-800 dark:bg-slate-900"
|
||||
class="rounded-xl border border-default bg-surface p-3 shadow-sm"
|
||||
data-testid="review-inventory-issue-list"
|
||||
>
|
||||
<header class="mb-2 flex items-center justify-between gap-2">
|
||||
@@ -58,9 +58,9 @@ function blockReasonLabel(reason?: string | null): string {
|
||||
<ul v-if="!summaryOnly" class="space-y-1.5">
|
||||
<li
|
||||
v-for="line in lines"
|
||||
:key="String(line.line_key || line.line_index)"
|
||||
:key="String(line.line_no)"
|
||||
class="rounded-lg border border-amber-200 bg-amber-50/70 px-2.5 py-2 text-xs dark:border-amber-900 dark:bg-amber-950/30"
|
||||
:data-testid="`review-inventory-issue-${line.line_key || line.line_index}`"
|
||||
:data-testid="`review-inventory-issue-${line.line_no}`"
|
||||
>
|
||||
<button
|
||||
type="button"
|
||||
|
||||
+3
-3
@@ -54,11 +54,11 @@ const showEnterInventory = computed(() => (
|
||||
<template>
|
||||
<section
|
||||
v-if="visible"
|
||||
class="rounded-xl border border-slate-200 bg-white p-3 shadow-sm dark:border-slate-800 dark:bg-slate-900"
|
||||
class="rounded-xl border border-default bg-surface p-3 shadow-sm"
|
||||
data-testid="review-line-fulfillment-aggregate-card"
|
||||
>
|
||||
<header class="mb-2">
|
||||
<h2 class="text-sm font-semibold text-slate-900 dark:text-slate-50">
|
||||
<h2 class="text-sm font-semibold text-primary dark:text-slate-50">
|
||||
{{ t('chat.shippingOrderReview.lineFulfillmentAggregate.title') }}
|
||||
</h2>
|
||||
<p class="mt-0.5 text-xs text-muted">
|
||||
@@ -104,7 +104,7 @@ const showEnterInventory = computed(() => (
|
||||
<button
|
||||
v-if="showEnterInventory"
|
||||
type="button"
|
||||
class="mt-3 w-full rounded-xl border border-slate-300 bg-slate-50 px-3 py-1.5 text-sm text-slate-900 hover:bg-slate-100 dark:border-slate-700 dark:bg-slate-950 dark:text-slate-50 dark:hover:bg-slate-800"
|
||||
class="mt-3 w-full rounded-xl border border-default bg-surface-soft px-3 py-1.5 text-sm text-primary hover-surface-strong dark:text-slate-50"
|
||||
data-testid="review-line-fulfillment-aggregate-enter-inventory"
|
||||
@click="emit('enter-inventory')"
|
||||
>
|
||||
|
||||
+6
-6
@@ -120,19 +120,19 @@ function formatTime(value: string | null | undefined): string {
|
||||
|
||||
<template>
|
||||
<div
|
||||
class="rounded-md border border-slate-200 bg-slate-50/80 px-3 py-2 text-xs dark:border-slate-700 dark:bg-slate-950/50"
|
||||
class="rounded-md border border-default bg-slate-50/80 px-3 py-2 text-xs dark:bg-slate-950/50"
|
||||
data-testid="review-line-fulfillment-summary"
|
||||
role="region"
|
||||
:aria-label="t('chat.shippingOrderReview.lineFulfillmentDetail.title')"
|
||||
>
|
||||
<div class="mb-2 flex items-center justify-between gap-2">
|
||||
<p class="font-medium text-slate-700 dark:text-slate-200">
|
||||
<p class="font-medium text-secondary">
|
||||
{{ t('chat.shippingOrderReview.lineFulfillmentDetail.title') }}
|
||||
</p>
|
||||
<div class="flex items-center gap-2">
|
||||
<button
|
||||
type="button"
|
||||
class="rounded border border-slate-300 px-2 py-0.5 text-[11px] text-sky-700 hover:bg-white dark:border-slate-600 dark:text-sky-300 dark:hover:bg-slate-900"
|
||||
class="rounded border border-default px-2 py-0.5 text-[11px] text-sky-700 hover:bg-white dark:text-sky-300"
|
||||
data-testid="review-line-fulfillment-open-audit"
|
||||
@click="emit('open-audit')"
|
||||
>
|
||||
@@ -140,7 +140,7 @@ function formatTime(value: string | null | undefined): string {
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
class="rounded px-2 py-0.5 text-[11px] text-slate-500 hover:bg-slate-100 dark:hover:bg-slate-800"
|
||||
class="rounded px-2 py-0.5 text-[11px] text-muted hover-surface-strong"
|
||||
data-testid="review-line-fulfillment-summary-close"
|
||||
@click="emit('close')"
|
||||
>
|
||||
@@ -155,9 +155,9 @@ function formatTime(value: string | null | undefined): string {
|
||||
class="min-w-0 rounded bg-white/70 px-2 py-1.5 dark:bg-slate-900/60"
|
||||
:data-testid="`review-line-fulfillment-field-${row.key}`"
|
||||
>
|
||||
<dt class="text-[10px] font-medium text-slate-500 dark:text-slate-400">{{ row.label }}</dt>
|
||||
<dt class="text-[10px] font-medium text-muted">{{ row.label }}</dt>
|
||||
<dd
|
||||
class="mt-0.5 break-words text-[11px] text-slate-800 dark:text-slate-100"
|
||||
class="mt-0.5 break-words text-[11px] text-primary"
|
||||
:class="row.emphasize ? 'font-medium text-rose-700 dark:text-rose-300' : ''"
|
||||
>
|
||||
{{ row.value }}
|
||||
|
||||
@@ -89,7 +89,7 @@ onBeforeUnmount(() => {
|
||||
v-if="showMore"
|
||||
ref="moreBtnRef"
|
||||
type="button"
|
||||
class="rounded p-1.5 hover:bg-slate-100 disabled:opacity-50 dark:hover:bg-slate-800"
|
||||
class="rounded p-1.5 hover-surface-strong disabled:opacity-50"
|
||||
data-testid="review-line-more-actions"
|
||||
:disabled="!editable || busy || taskRunning"
|
||||
:aria-label="t('chat.shippingOrderReview.lineOps.moreActions')"
|
||||
@@ -103,7 +103,7 @@ onBeforeUnmount(() => {
|
||||
<Teleport to="body">
|
||||
<div
|
||||
v-if="moreMenuOpen && showMore"
|
||||
class="rounded-md border border-slate-200 bg-white py-1 shadow-lg dark:border-slate-700 dark:bg-slate-900"
|
||||
class="rounded-md border border-default bg-surface py-1 shadow-lg"
|
||||
role="menu"
|
||||
data-testid="review-line-more-menu"
|
||||
:style="moreMenuStyle"
|
||||
|
||||
+9
-9
@@ -54,18 +54,18 @@ const verbatimOk = computed(() => {
|
||||
|
||||
<template>
|
||||
<div class="grid gap-3 md:grid-cols-3" data-testid="review-llm-evidence-comparison">
|
||||
<div class="rounded-lg border border-slate-200 bg-slate-50 p-3">
|
||||
<p class="text-xs font-medium uppercase tracking-wide text-slate-500">
|
||||
<div class="rounded-lg border border-default bg-surface-soft p-3">
|
||||
<p class="text-xs font-medium uppercase tracking-wide text-muted">
|
||||
{{ t('chat.shippingOrderReview.llmSuggestion.currentDraft') }}
|
||||
</p>
|
||||
<p class="mt-2 text-sm font-semibold text-slate-900">{{ props.fieldLabel }}</p>
|
||||
<p class="mt-1 text-sm text-slate-700">{{ draftDisplay }}</p>
|
||||
<p class="mt-2 text-sm font-semibold text-primary">{{ props.fieldLabel }}</p>
|
||||
<p class="mt-1 text-sm text-secondary">{{ draftDisplay }}</p>
|
||||
</div>
|
||||
<div class="rounded-lg border border-indigo-200 bg-indigo-50/60 p-3">
|
||||
<p class="text-xs font-medium uppercase tracking-wide text-indigo-600">
|
||||
{{ t('chat.shippingOrderReview.llmSuggestion.aiSuggestion') }}
|
||||
</p>
|
||||
<p class="mt-2 text-sm font-semibold text-slate-900">{{ suggestedValue }}</p>
|
||||
<p class="mt-2 text-sm font-semibold text-primary">{{ suggestedValue }}</p>
|
||||
<p class="mt-1 text-xs" :class="verbatimOk ? 'text-emerald-700' : 'text-amber-700'">
|
||||
{{
|
||||
verbatimOk
|
||||
@@ -74,12 +74,12 @@ const verbatimOk = computed(() => {
|
||||
}}
|
||||
</p>
|
||||
</div>
|
||||
<div class="rounded-lg border border-slate-200 bg-white p-3">
|
||||
<p class="text-xs font-medium uppercase tracking-wide text-slate-500">
|
||||
<div class="rounded-lg border border-default bg-surface p-3">
|
||||
<p class="text-xs font-medium uppercase tracking-wide text-muted">
|
||||
{{ t('chat.shippingOrderReview.llmSuggestion.sourceEvidence') }}
|
||||
</p>
|
||||
<p class="mt-2 text-sm text-slate-800">{{ evidenceQuote }}</p>
|
||||
<p class="mt-1 text-xs text-slate-500">{{ evidenceLocation }}</p>
|
||||
<p class="mt-2 text-sm text-primary">{{ evidenceQuote }}</p>
|
||||
<p class="mt-1 text-xs text-muted">{{ evidenceLocation }}</p>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
@@ -163,11 +163,11 @@ onBeforeUnmount(() => {
|
||||
>
|
||||
<div
|
||||
ref="panelRef"
|
||||
class="max-h-[80vh] w-full max-w-3xl overflow-auto rounded-lg bg-white p-4 shadow-lg dark:bg-slate-900"
|
||||
class="max-h-[80vh] w-full max-w-3xl overflow-auto rounded-lg bg-surface p-4 shadow-lg"
|
||||
data-testid="review-llm-suggestion-panel"
|
||||
>
|
||||
<h3 class="text-base font-semibold">{{ t('chat.shippingOrderReview.llmSuggestion.dialogTitle') }}</h3>
|
||||
<p class="mt-1 text-xs text-slate-500">
|
||||
<p class="mt-1 text-xs text-muted">
|
||||
{{ t('chat.shippingOrderReview.llmSuggestion.dialogHint') }}
|
||||
· {{ evidenceLevelText }}
|
||||
</p>
|
||||
@@ -199,12 +199,12 @@ onBeforeUnmount(() => {
|
||||
<input
|
||||
v-if="decision === 'modify'"
|
||||
v-model="modifiedValue"
|
||||
class="mt-2 w-full rounded border p-2 text-sm dark:border-slate-700 dark:bg-slate-950"
|
||||
class="mt-2 w-full rounded border p-2 text-sm"
|
||||
:placeholder="t('chat.shippingOrderReview.llmSuggestion.modifiedValue')"
|
||||
/>
|
||||
<textarea
|
||||
v-model="reason"
|
||||
class="mt-2 w-full rounded border p-2 text-sm dark:border-slate-700 dark:bg-slate-950"
|
||||
class="mt-2 w-full rounded border p-2 text-sm"
|
||||
rows="2"
|
||||
:placeholder="
|
||||
decision === 'accept'
|
||||
|
||||
@@ -46,12 +46,12 @@ const { t } = useI18n();
|
||||
data-testid="review-llm-suggestion-drawer"
|
||||
@click.self="emit('close')"
|
||||
>
|
||||
<aside class="flex h-full w-full max-w-lg flex-col bg-white shadow-xl dark:bg-slate-900">
|
||||
<header class="flex items-center justify-between gap-2 border-b border-slate-200 px-4 py-3 dark:border-slate-800">
|
||||
<aside class="flex h-full w-full max-w-lg flex-col bg-surface shadow-xl">
|
||||
<header class="flex items-center justify-between gap-2 border-b border-default px-4 py-3">
|
||||
<h2 class="text-sm font-semibold">{{ t('chat.shippingOrderReview.llmSuggestion.panelTitle') }}</h2>
|
||||
<button
|
||||
type="button"
|
||||
class="rounded border border-slate-300 px-2 py-1 text-xs hover:bg-slate-50 dark:border-slate-600 dark:hover:bg-slate-800"
|
||||
class="rounded border border-default px-2 py-1 text-xs hover-surface-soft"
|
||||
data-testid="review-llm-drawer-close"
|
||||
@click="emit('close')"
|
||||
>
|
||||
|
||||
+13
-13
@@ -3,7 +3,7 @@
|
||||
用途:AI 建议列表与裁决内容(布局重构后作为抽屉内容组件,非常驻主区大卡片)。
|
||||
依赖:vue-i18n、ReviewLlmSuggestionDialog、ShippingOrderReview* 类型。
|
||||
逻辑:由 ReviewLlmSuggestionDrawer 挂载;请求须用户主动触发;仅 validated 可接受;
|
||||
validation_failed 仅可拒绝;provider_unavailable 明示原因;证据按 field_id + line_key/line_index 绑定。
|
||||
validation_failed 仅可拒绝;provider_unavailable 明示原因;证据按 field_id + draft_line_id/line_index 绑定。
|
||||
-->
|
||||
<script setup lang="ts">
|
||||
import { computed, ref } from 'vue';
|
||||
@@ -130,8 +130,8 @@ function evidenceMatchesFieldLine(
|
||||
const selectedEvidence = computed(() => {
|
||||
const items = props.evidence || [];
|
||||
const fieldId = String(selected.value?.field_id || props.focusedFieldId || '');
|
||||
const lineKey = selected.value?.line_key ?? props.focusedLineKey;
|
||||
return items.find((item) => evidenceMatchesFieldLine(item, fieldId, lineKey)) || null;
|
||||
const draftLineId = selected.value?.draft_line_id ?? props.focusedLineKey;
|
||||
return items.find((item) => evidenceMatchesFieldLine(item, fieldId, draftLineId)) || null;
|
||||
});
|
||||
|
||||
/**
|
||||
@@ -153,12 +153,12 @@ function readContainerDraftValue(container: Record<string, unknown> | null | und
|
||||
*/
|
||||
const dialogDraftValue = computed(() => {
|
||||
const fieldId = String(selected.value?.field_id || props.focusedFieldId || '');
|
||||
const lineKey = selected.value?.line_key ?? props.focusedLineKey;
|
||||
const draftLineId = selected.value?.draft_line_id ?? props.focusedLineKey;
|
||||
const draft = props.activeCase?.draft;
|
||||
if (!draft || !fieldId) return props.draftValue ?? null;
|
||||
if (lineKey) {
|
||||
if (draftLineId) {
|
||||
const lines = Array.isArray(draft.lines) ? draft.lines : [];
|
||||
const line = lines.find((item) => String((item as { line_key?: string }).line_key || '') === String(lineKey));
|
||||
const line = lines.find((item) => String((item as { draft_line_id?: string }).draft_line_id || '') === String(draftLineId));
|
||||
return readContainerDraftValue(line as Record<string, unknown> | undefined, fieldId);
|
||||
}
|
||||
return readContainerDraftValue(draft.header_values as Record<string, unknown> | undefined, fieldId);
|
||||
@@ -180,8 +180,8 @@ function suggestionFieldLabel(item: ShippingOrderReviewLlmSuggestion): string {
|
||||
const fields = props.activeCase?.schema?.fields || [];
|
||||
const hit = fields.find((field) => String(field.field_id || '') === fieldId);
|
||||
const name = String(hit?.display_name || hit?.field_code || '').trim();
|
||||
if (name && item.line_key) {
|
||||
return `${name} · ${item.line_key}`;
|
||||
if (name && item.draft_line_id) {
|
||||
return `${name} · ${item.draft_line_id}`;
|
||||
}
|
||||
return name || t('chat.shippingOrderReview.unknownField');
|
||||
}
|
||||
@@ -214,11 +214,11 @@ function onDecide(payload: { decision: 'accept' | 'modify' | 'reject'; reason: s
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<section class="rounded-xl border border-slate-200 bg-white p-3 text-sm shadow-sm dark:border-slate-800 dark:bg-slate-900">
|
||||
<section class="rounded-xl border border-default bg-surface p-3 text-sm shadow-sm">
|
||||
<div class="flex flex-wrap items-center justify-between gap-2">
|
||||
<div>
|
||||
<div class="font-semibold">{{ t('chat.shippingOrderReview.llmSuggestion.panelTitle') }}</div>
|
||||
<div class="mt-1 text-xs text-slate-500">
|
||||
<div class="mt-1 text-xs text-muted">
|
||||
{{ t('chat.shippingOrderReview.llmSuggestion.panelHint') }}
|
||||
· {{ evidenceLevelLabel(selected?.evidence_level || 'L1_field') }}
|
||||
· {{ statusLabel }}
|
||||
@@ -289,7 +289,7 @@ function onDecide(payload: { decision: 'accept' | 'modify' | 'reject'; reason: s
|
||||
</div>
|
||||
<button
|
||||
type="button"
|
||||
class="shrink-0 rounded border border-sky-300 bg-white px-2 py-0.5 text-xs text-sky-700 dark:border-sky-700 dark:bg-slate-900 dark:text-sky-200"
|
||||
class="shrink-0 rounded border border-sky-300 bg-surface px-2 py-0.5 text-xs text-sky-700 dark:border-sky-700 dark:text-sky-200"
|
||||
:disabled="!canRequest"
|
||||
:aria-label="t('chat.shippingOrderReview.llmSuggestion.request')"
|
||||
@click="emit('requestSuggestion')"
|
||||
@@ -301,7 +301,7 @@ function onDecide(payload: { decision: 'accept' | 'modify' | 'reject'; reason: s
|
||||
</ul>
|
||||
<p
|
||||
v-if="!pendingSuggestions.length && !failedSuggestions.length && !unavailableSuggestions.length && !gatedFailedSuggestions.length"
|
||||
class="mt-3 text-xs text-slate-500"
|
||||
class="mt-3 text-xs text-muted"
|
||||
>
|
||||
{{ t('chat.shippingOrderReview.llmSuggestion.empty') }}
|
||||
</p>
|
||||
@@ -309,7 +309,7 @@ function onDecide(payload: { decision: 'accept' | 'modify' | 'reject'; reason: s
|
||||
<li
|
||||
v-for="item in pendingSuggestions"
|
||||
:key="item.suggestion_no"
|
||||
class="flex items-center justify-between gap-2 rounded border border-slate-200 px-2 py-1.5 dark:border-slate-700"
|
||||
class="flex items-center justify-between gap-2 rounded border border-default px-2 py-1.5"
|
||||
>
|
||||
<div class="min-w-0 truncate text-xs">
|
||||
<span class="font-medium">{{ suggestionFieldLabel(item) }}</span>
|
||||
|
||||
@@ -85,7 +85,7 @@ const selectedLabel = computed(() => {
|
||||
<template>
|
||||
<section
|
||||
v-if="visible"
|
||||
class="rounded-xl border border-slate-200 bg-white p-3 shadow-sm dark:border-slate-800 dark:bg-slate-900"
|
||||
class="rounded-xl border border-default bg-surface p-3 shadow-sm"
|
||||
data-testid="review-profile-match-panel"
|
||||
:data-status="String(profileMatch?.status || '')"
|
||||
>
|
||||
@@ -126,7 +126,7 @@ const selectedLabel = computed(() => {
|
||||
<template v-if="isAdminView && candidateCount">
|
||||
<button
|
||||
type="button"
|
||||
class="mt-3 flex w-full items-center justify-between rounded-lg border border-default bg-surface-soft px-2.5 py-2 text-left text-xs font-medium text-secondary transition-colors hover:bg-slate-50 dark:hover:bg-slate-800"
|
||||
class="mt-3 flex w-full items-center justify-between rounded-lg border border-default bg-surface-soft px-2.5 py-2 text-left text-xs font-medium text-secondary transition-colors hover-surface-soft"
|
||||
data-testid="review-profile-match-candidates-toggle"
|
||||
:aria-expanded="candidatesExpanded"
|
||||
@click="toggleCandidates"
|
||||
|
||||
@@ -110,7 +110,7 @@ async function onRevalidate() {
|
||||
<li
|
||||
v-for="(issue, idx) in issues"
|
||||
:key="`${issue.code}-${issue.line_index}-${idx}`"
|
||||
class="rounded border border-violet-200 bg-white/90 px-2 py-1 dark:border-violet-900 dark:bg-slate-900"
|
||||
class="rounded border border-violet-200 bg-white/90 px-2 py-1 dark:border-violet-900"
|
||||
>
|
||||
<span v-if="issue.line_index != null">#{{ issue.line_index + 1 }} · </span>
|
||||
{{ issue.message || issueLabel(issue.code) }}
|
||||
@@ -132,7 +132,7 @@ async function onRevalidate() {
|
||||
<tbody>
|
||||
<tr
|
||||
v-for="line in lines"
|
||||
:key="String(line.line_key || line.line_index)"
|
||||
:key="String(line.draft_line_id || line.line_index)"
|
||||
class="border-t border-violet-100 dark:border-violet-900"
|
||||
:class="line.needs_attention ? 'bg-amber-50/80 dark:bg-amber-950/20' : ''"
|
||||
>
|
||||
@@ -151,7 +151,7 @@ async function onRevalidate() {
|
||||
<div v-if="editable" class="mt-3 flex flex-wrap gap-2">
|
||||
<button
|
||||
type="button"
|
||||
class="rounded-xl border border-violet-300 bg-white px-3 py-1.5 text-sm text-violet-950 hover:bg-violet-100 disabled:opacity-60 dark:border-violet-800 dark:bg-slate-900 dark:text-violet-100 dark:hover:bg-violet-950"
|
||||
class="rounded-xl border border-violet-300 bg-surface px-3 py-1.5 text-sm text-violet-950 hover:bg-violet-100 disabled:opacity-60 dark:border-violet-800 dark:text-violet-100 dark:hover:bg-violet-950"
|
||||
data-testid="review-reservation-revalidate"
|
||||
:disabled="busy || draftVersion == null"
|
||||
@click="onRevalidate"
|
||||
|
||||
+3
-3
@@ -32,12 +32,12 @@ const { t } = useI18n();
|
||||
data-testid="review-version-history-drawer"
|
||||
@click.self="emit('close')"
|
||||
>
|
||||
<aside class="flex h-full w-full max-w-md flex-col bg-white shadow-xl dark:bg-slate-900">
|
||||
<header class="flex items-center justify-between gap-2 border-b border-slate-200 px-4 py-3 dark:border-slate-800">
|
||||
<aside class="flex h-full w-full max-w-md flex-col bg-surface shadow-xl">
|
||||
<header class="flex items-center justify-between gap-2 border-b border-default px-4 py-3">
|
||||
<h2 class="text-sm font-semibold">{{ t('chat.shippingOrderReview.versionHistory.title') }}</h2>
|
||||
<button
|
||||
type="button"
|
||||
class="rounded border border-slate-300 px-2 py-1 text-xs hover:bg-slate-50 dark:border-slate-600 dark:hover:bg-slate-800"
|
||||
class="rounded border border-default px-2 py-1 text-xs hover-surface-soft"
|
||||
data-testid="review-version-history-close"
|
||||
@click="emit('close')"
|
||||
>
|
||||
|
||||
+10
-10
@@ -52,25 +52,25 @@ function selectVersion(version: ShippingWorkflowItemVersion) {
|
||||
|
||||
<template>
|
||||
<section
|
||||
class="rounded-xl border border-slate-200 bg-white p-4 shadow-sm dark:border-slate-800 dark:bg-slate-900"
|
||||
class="rounded-xl border border-default bg-surface p-4 shadow-sm"
|
||||
data-testid="review-version-history-panel"
|
||||
:aria-label="t('chat.shippingOrderReview.versionHistory.title')"
|
||||
>
|
||||
<header class="mb-3 flex items-center justify-between gap-2">
|
||||
<div>
|
||||
<h2 class="text-sm font-semibold">{{ t('chat.shippingOrderReview.versionHistory.title') }}</h2>
|
||||
<p v-if="itemNo" class="mt-0.5 text-xs text-slate-500 dark:text-slate-400">
|
||||
<p v-if="itemNo" class="mt-0.5 text-xs text-muted">
|
||||
{{ t('chat.shippingOrderReview.versionHistory.itemNo', { itemNo }) }}
|
||||
</p>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<div v-if="loading" class="py-4 text-sm text-slate-500">{{ t('chat.shippingProcessing.loading') }}</div>
|
||||
<div v-if="loading" class="py-4 text-sm text-muted">{{ t('chat.shippingProcessing.loading') }}</div>
|
||||
<template v-else>
|
||||
<p class="mb-2 text-xs text-slate-500 dark:text-slate-400">
|
||||
<p class="mb-2 text-xs text-muted">
|
||||
{{ t('chat.shippingProcessing.versionHistoryNote') }}
|
||||
</p>
|
||||
<p v-if="!versions.length" class="py-4 text-sm text-slate-500">
|
||||
<p v-if="!versions.length" class="py-4 text-sm text-muted">
|
||||
{{ t('chat.shippingSessionWorkItem.noVersions') }}
|
||||
</p>
|
||||
|
||||
@@ -81,7 +81,7 @@ function selectVersion(version: ShippingWorkflowItemVersion) {
|
||||
class="rounded-lg border p-3 text-sm"
|
||||
:class="activeCaseNo === version.case_no
|
||||
? 'border-sky-500 bg-sky-50 dark:border-sky-700 dark:bg-sky-950/30'
|
||||
: 'border-slate-200 dark:border-slate-700'"
|
||||
: 'border-default '"
|
||||
:data-testid="`review-version-row-${version.case_no}`"
|
||||
>
|
||||
<div class="flex flex-wrap items-start justify-between gap-2">
|
||||
@@ -98,19 +98,19 @@ function selectVersion(version: ShippingWorkflowItemVersion) {
|
||||
</span>
|
||||
<span
|
||||
v-else-if="version.is_readonly"
|
||||
class="rounded-full bg-slate-100 px-2 py-0.5 text-[11px] text-slate-600 dark:bg-slate-800 dark:text-slate-300"
|
||||
class="rounded-full bg-surface-strong px-2 py-0.5 text-[11px] text-secondary"
|
||||
>
|
||||
{{ t('chat.shippingSessionWorkItem.readonlyVersion') }}
|
||||
</span>
|
||||
</div>
|
||||
<p class="mt-1 truncate text-xs text-slate-500 dark:text-slate-400">
|
||||
<p class="mt-1 truncate text-xs text-muted">
|
||||
{{ version.run_no || version.case_no }}
|
||||
</p>
|
||||
</div>
|
||||
<button
|
||||
v-if="activeCaseNo !== version.case_no"
|
||||
type="button"
|
||||
class="shrink-0 rounded border border-slate-200 px-2 py-1 text-xs hover:bg-slate-50 dark:border-slate-700 dark:hover:bg-slate-800"
|
||||
class="shrink-0 rounded border border-default px-2 py-1 text-xs hover-surface-soft"
|
||||
@click="selectVersion(version)"
|
||||
>
|
||||
{{ version.is_readonly
|
||||
@@ -119,7 +119,7 @@ function selectVersion(version: ShippingWorkflowItemVersion) {
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<dl class="mt-2 grid gap-1 text-xs text-slate-600 dark:text-slate-400 sm:grid-cols-2">
|
||||
<dl class="mt-2 grid gap-1 text-xs text-secondary sm:grid-cols-2">
|
||||
<div>
|
||||
<dt class="inline">{{ t('chat.shippingOrderReview.versionHistory.result') }}:</dt>
|
||||
<dd class="inline">{{ resultLabel(version.case_status) }}</dd>
|
||||
|
||||
@@ -97,7 +97,7 @@ const canWriteCaseActions = computed(() => props.actionsExecutable && !props.isR
|
||||
<template>
|
||||
<footer
|
||||
v-if="showFooter"
|
||||
class="sticky bottom-0 z-20 flex shrink-0 flex-col gap-3 border-t border-slate-200 bg-white/95 p-3 shadow-[0_-4px_12px_rgba(15,23,42,0.06)] backdrop-blur sm:flex-row sm:items-center sm:justify-between dark:border-slate-800 dark:bg-slate-900/95"
|
||||
class="sticky bottom-0 z-20 flex shrink-0 flex-col gap-3 border-t border-default bg-white/95 p-3 shadow-[0_-4px_12px_rgba(15,23,42,0.06)] backdrop-blur sm:flex-row sm:items-center sm:justify-between dark:bg-slate-900/95"
|
||||
data-testid="review-footer-actions"
|
||||
:data-automating="automating ? '1' : '0'"
|
||||
:data-flow-busy="flowBusy ? '1' : '0'"
|
||||
@@ -127,7 +127,7 @@ const canWriteCaseActions = computed(() => props.actionsExecutable && !props.isR
|
||||
v-if="showParseDispositions && hasAction('reparse')"
|
||||
type="button"
|
||||
:disabled="controlsBusy"
|
||||
class="inline-flex items-center gap-1 rounded border border-slate-300 px-3 py-2 text-sm text-slate-600 hover:bg-slate-50 disabled:opacity-50 dark:border-slate-700 dark:text-slate-300 dark:hover:bg-slate-800"
|
||||
class="inline-flex items-center gap-1 rounded border border-default px-3 py-2 text-sm text-secondary hover-surface-soft disabled:opacity-50"
|
||||
@click="emit('reparse')"
|
||||
>
|
||||
<RefreshCw class="h-4 w-4" />{{ t('chat.shippingOrderReview.reparse') }}
|
||||
@@ -139,7 +139,7 @@ const canWriteCaseActions = computed(() => props.actionsExecutable && !props.isR
|
||||
:key="`${item.intent}-${item.actionCode}`"
|
||||
type="button"
|
||||
:disabled="controlsBusy"
|
||||
class="rounded border border-slate-300 px-3 py-2 text-sm text-slate-700 hover:bg-slate-50 disabled:opacity-50 dark:border-slate-700 dark:text-slate-200 dark:hover:bg-slate-800"
|
||||
class="rounded border border-default px-3 py-2 text-sm text-secondary hover-surface-soft disabled:opacity-50"
|
||||
:data-testid="`review-footer-flow-${item.intent}`"
|
||||
:data-intent="item.intent"
|
||||
@click="emit('flow-action', item)"
|
||||
|
||||
@@ -31,10 +31,10 @@ const { t } = useI18n();
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<header class="flex shrink-0 items-center gap-3 border-b border-slate-200 bg-white px-4 py-3 dark:border-slate-800 dark:bg-slate-900">
|
||||
<header class="flex shrink-0 items-center gap-3 border-b border-default bg-surface px-4 py-3">
|
||||
<button
|
||||
type="button"
|
||||
class="rounded-md p-1 hover:bg-slate-100 dark:hover:bg-slate-800"
|
||||
class="rounded-md p-1 hover-surface-strong"
|
||||
:aria-label="t('chat.shippingOrderReview.backToSession')"
|
||||
@click="emit('back')"
|
||||
>
|
||||
@@ -44,14 +44,14 @@ const { t } = useI18n();
|
||||
<h1 class="text-base font-semibold">{{ t('chat.shippingOrderReview.title') }}</h1>
|
||||
<p
|
||||
v-if="selectedOrderSummary"
|
||||
class="truncate text-xs text-slate-600 dark:text-slate-300"
|
||||
class="truncate text-xs text-secondary"
|
||||
data-testid="review-selected-order-summary"
|
||||
>{{ selectedOrderSummary }}</p>
|
||||
</div>
|
||||
<button
|
||||
v-if="showAuditTrail"
|
||||
type="button"
|
||||
class="rounded border border-slate-200 px-2.5 py-1.5 text-xs hover:bg-slate-50 dark:border-slate-700 dark:hover:bg-slate-800"
|
||||
class="rounded border border-default px-2.5 py-1.5 text-xs hover-surface-soft"
|
||||
data-testid="review-open-audit-trail"
|
||||
@click="emit('open-audit-trail')"
|
||||
>
|
||||
@@ -60,7 +60,7 @@ const { t } = useI18n();
|
||||
<button
|
||||
v-if="showVersionHistory"
|
||||
type="button"
|
||||
class="rounded border border-slate-200 px-2.5 py-1.5 text-xs hover:bg-slate-50 dark:border-slate-700 dark:hover:bg-slate-800"
|
||||
class="rounded border border-default px-2.5 py-1.5 text-xs hover-surface-soft"
|
||||
data-testid="review-open-version-history"
|
||||
@click="emit('open-version-history')"
|
||||
>
|
||||
@@ -85,7 +85,7 @@ const { t } = useI18n();
|
||||
</span>
|
||||
<span
|
||||
v-if="isReadOnly"
|
||||
class="shrink-0 rounded-full bg-slate-100 px-2 py-0.5 text-xs text-slate-600 dark:bg-slate-800 dark:text-slate-300"
|
||||
class="shrink-0 rounded-full bg-surface-strong px-2 py-0.5 text-xs text-secondary"
|
||||
>
|
||||
{{ t('chat.shippingOrderReview.readOnly') }}
|
||||
</span>
|
||||
|
||||
@@ -38,11 +38,11 @@ function setMode(next: ReviewWorkbenchMode) {
|
||||
<template>
|
||||
<!-- 产品契约:工作台模式条始终可见,便于发现库存/证据模式入口。 -->
|
||||
<div
|
||||
class="flex flex-wrap items-center justify-between gap-2 rounded-lg border border-slate-200 bg-white px-3 py-2 text-xs dark:border-slate-800 dark:bg-slate-900"
|
||||
class="flex flex-wrap items-center justify-between gap-2 rounded-lg border border-default bg-surface px-3 py-2 text-xs"
|
||||
data-testid="review-workbench-mode"
|
||||
:data-workbench-mode="mode"
|
||||
>
|
||||
<span class="font-medium text-slate-600 dark:text-slate-300">
|
||||
<span class="font-medium text-secondary">
|
||||
{{ modeLabel }}
|
||||
</span>
|
||||
<div class="flex flex-wrap items-center gap-2">
|
||||
@@ -58,7 +58,7 @@ function setMode(next: ReviewWorkbenchMode) {
|
||||
<button
|
||||
v-if="mode === 'evidence' || mode === 'inventory'"
|
||||
type="button"
|
||||
class="rounded border border-slate-300 px-2 py-1 text-slate-700 hover:bg-slate-50 dark:border-slate-600 dark:text-slate-300 dark:hover:bg-slate-800"
|
||||
class="rounded border border-default px-2 py-1 text-secondary hover-surface-soft"
|
||||
data-testid="review-return-standard-mode"
|
||||
@click="setMode('standard')"
|
||||
>
|
||||
|
||||
Reference in new issue
Block a user