style(chat): 统一会话/批次中心/订单工作台颜色为语义令牌
This commit is contained in:
1 parent
1269e04116
commit
420f1a4abb
57 files changed
+1857
-1166
No files matched your search
+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>
|
||||
|
||||
Reference in new issue
Block a user