feat(shipping-notice): 支持发货通知解析延后至 Dify 画布,优化任务创建流程

This commit is contained in:
hugo committed 2026-06-22 16:59:38 +08:00
1 parent d46d61bfa1
commit 70e8f700ff
38 files changed
+3215 -714

No files matched your search

@@ -30,6 +30,7 @@ import {
updateWorkspaceShippingNoticeLine,
workspaceShippingExportUrl,
type ShippingChatAction,
type ShippingCurrentStepProgress,
type ShippingNoticeHeader,
type ShippingNoticeLine,
type ShippingTaskDetail,
@@ -90,6 +91,12 @@ const statusBadge = (status: string) => {
};
const detailWorkflowSteps = computed(() => buildShippingWorkflowSteps(detail.value));
const detailStepProgress = computed<ShippingCurrentStepProgress | null>(() => {
const payload = detail.value?.step_payload;
if (!payload || typeof payload !== 'object') return null;
const progress = (payload as Record<string, unknown>).current_step_progress;
return progress && typeof progress === 'object' ? progress as ShippingCurrentStepProgress : null;
});
const loadCases = async () => {
loading.value = true;
@@ -413,6 +420,38 @@ onMounted(async () => {
<ShippingWorkflowStepper :steps="detailWorkflowSteps" />
<div
v-if="detailStepProgress"
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 class="text-muted">
{{ detailStepProgress.progress_percent ?? 0 }}%
</div>
</div>
<div class="mt-1 text-sm text-secondary">
{{ detailStepProgress.message || t('chat.shippingNoticeUi.processing') }}
</div>
<div v-if="detailStepProgress.detail" class="mt-1 text-xs text-muted">
{{ detailStepProgress.detail }}
</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 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 ?? 0}%` }"
/>
</div>
</div>
<dl class="grid gap-3 sm:grid-cols-2 text-sm">
<div><dt class="text-muted">{{ $t('workspace.shippingNotice.fields.status') }}</dt><dd>{{ detail.process_status }}</dd></div>
<div><dt class="text-muted">{{ $t('workspace.shippingNotice.fields.match') }}</dt><dd>{{ detail.match_status || '—' }}</dd></div>