feat(shipping-notice): 落地字段资产治理与唯一 Schema,自动建单随版本冻结

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
hugoandCursor committed 2026-07-29 16:23:15 +08:00
1 parent b7307fc573
commit 3a1dbf7ce5
144 files changed
+15167 -4480

No files matched your search

@@ -1,9 +1,9 @@
<script setup lang="ts">
/**
* features/workspace/views/ShippingNoticeView.vue
* 用途:货代发货任务工作台,提供任务筛选、履约审计与跳转对话入口。
* 用途:遗留货代任务列表视图;主写入口已迁至 shipping-task-center 工作台。
* 依赖:ShippingWorkflowStepper、ShippingMatchResultCard、ShippingTaskParsedResultCard、shipping.api。
* 逻辑:先拉取任务列表与详情,再展示步骤、匹配结果、解析行和事件记录;所有用户写操作仅由对话界面执行。
* 逻辑:保留只读审计浏览;履约写操作请使用 ShippingTaskCenterPage / ShippingTaskWorkbench。
*/
import { computed, onMounted, ref, watch } from 'vue';
import { useRouter } from 'vue-router';
@@ -125,9 +125,6 @@ const detailStepProgress = computed<ShippingCurrentStepProgress | null>(() => {
const progress = (payload as Record<string, unknown>).current_step_progress;
return progress && typeof progress === 'object' ? progress as ShippingCurrentStepProgress : null;
});
const detailStepHasPercent = computed(() =>
typeof detailStepProgress.value?.progress_percent === 'number',
);
const detailStepMessage = computed(() =>
sanitizeShippingRuntimeStatusText(String(detailStepProgress.value?.message || '').trim()),
);
@@ -153,10 +150,6 @@ const detailTodoMessage = computed(() => (
|| detailIssues.value[0]
|| t('workspace.shippingNotice.todo.noActionMessage')
));
const detailTodoActionLabel = computed(() => (
String(detail.value?.ui_state?.action_buttons?.[0]?.label || '').trim()
));
const detailHasTodo = computed(() => !!detailTodoActionLabel.value);
const inventorySnapshotLabel = (triggerType?: string | null) => {
const key = String(triggerType || 'on_demand');
@@ -253,6 +246,9 @@ const resolveChatAgent = async () => {
}
};
/**
* 可选深链:打开 Chat 会话查看上下文(非履约写入口)。
*/
const openInChat = (taskNo: string, conversationId?: string | null, batchNo?: string | null) => {
if (!chatAgentId.value) return;
const query: Record<string, string> = { task_id: taskNo };
@@ -434,23 +430,16 @@ onMounted(async () => {
</div>
<section class="rounded-2xl border border-brand-200 bg-brand-50/50 p-4">
<div class="flex flex-wrap items-start justify-between gap-4">
<div class="min-w-0">
<div class="text-xs font-semibold uppercase tracking-wide text-brand-700">
{{ $t('workspace.shippingNotice.todo.label') }}
</div>
<h3 class="mt-1 text-base font-semibold text-primary">{{ detailTodoTitle }}</h3>
<p class="mt-1 text-sm text-secondary">{{ detailTodoMessage }}</p>
<div class="min-w-0">
<div class="text-xs font-semibold uppercase tracking-wide text-brand-700">
{{ $t('workspace.shippingNotice.todo.currentTodo') }}
</div>
<button
v-if="chatAgentId && detailHasTodo"
type="button"
class="inline-flex shrink-0 items-center gap-1 rounded-xl bg-brand-600 px-3 py-2 text-sm font-medium text-white hover:bg-brand-700"
@click="openInChat(detail.task_no, detail.conversation_id, detail.batch_no)"
>
<ExternalLink class="h-3.5 w-3.5" />
{{ $t('workspace.shippingNotice.todo.handleInChat', { action: detailTodoActionLabel }) }}
</button>
<h3 class="mt-1 text-base font-semibold text-primary">{{ detailTodoTitle }}</h3>
<p class="mt-1 text-sm text-secondary">{{ detailTodoMessage }}</p>
<p class="mt-2 text-xs text-muted">
{{ $t('workspace.shippingNotice.myTodos.openTask') }}:
{{ $t('workspace.shippingNotice.subtitle') }}
</p>
</div>
</section>
@@ -462,38 +451,18 @@ onMounted(async () => {
</section>
<div
v-if="detailStepProgress"
v-if="detailStepProgress && (detailStepMessage || detailStepDetail)"
class="rounded-2xl border border-default/80 bg-surface px-4 py-3"
>
<div class="flex items-center justify-between gap-3 text-xs">
<div class="font-medium text-primary">
{{ detailStepProgress.step_title || t('chat.shippingNoticeUi.stepDetail.title') }}
</div>
<div v-if="detailStepHasPercent" class="text-muted">
{{ detailStepProgress.progress_percent }}%
</div>
<div class="text-xs font-medium text-primary">
{{ detailStepProgress.step_title || t('chat.shippingNoticeUi.stepDetail.title') }}
</div>
<div class="mt-1 text-sm text-secondary">
{{ detailStepMessage || t('chat.shippingNoticeUi.processing') }}
<div v-if="detailStepMessage" class="mt-1 text-sm text-secondary">
{{ detailStepMessage }}
</div>
<div v-if="detailStepDetail" class="mt-1 text-xs text-muted">
{{ detailStepDetail }}
</div>
<div
v-if="detailStepProgress.current && detailStepProgress.total"
class="mt-1 text-xs text-muted"
>
{{ t('chat.shippingNoticeUi.stepDetail.counter', { current: detailStepProgress.current, total: detailStepProgress.total }) }}
</div>
<div
v-if="detailStepHasPercent"
class="mt-2 h-2 overflow-hidden rounded-full bg-slate-200"
>
<div
class="h-full rounded-full bg-sky-500 transition-all"
:style="{ width: `${detailStepProgress.progress_percent}%` }"
/>
</div>
</div>
<section class="rounded-2xl border border-default/80 bg-surface px-4 py-3">