Files
syops/frontend/src/features/chat/components/ShippingBatchWorkspaceDrawer.vue
T
hugo 9c036c825b refactor(chat/shipping): 重构发货通知模块为统一UI State驱动模式
- 重构发货通知的状态与动作获取逻辑:移除从聊天文本解析HXOPS_SHIPPING_ACTIONS注释的旧逻辑,改为统一从后端shipping_ui_state获取任务状态、动作按钮与工作流步骤
- 新增SSE实时推送shipping_ui_state事件,支持前端即时更新聊天气泡与工作台的状态与按钮
- 优化路由与登录流程:调整根路径重定向逻辑,退出登录时跳转到登录页;移除chat路由不必要的props传参;将原路由守卫中的根路径判断迁移到路由配置中
- 完善库存RPA与本地导入流程:新增本地库存文件托管接口,优化RPA回调的文件落盘与任务关联逻辑
- 新增多组单元测试覆盖焦点切换、决策处理、SSE同步等核心场景
- 修复多语言显示逻辑,使用te方法判断翻译key是否存在,避免缺失翻译时的渲染异常
- 新增reparse_inventory菜单动作,支持静默重新解析库存且不追加额外聊天消息
- 重构工作流步骤渲染函数,优先使用后端返回的步骤数据, fallback到本地推导的旧逻辑
- 清理后端旧的chat-actions API接口,将相关逻辑迁移到统一的ui_state接口中
2026-07-02 01:55:19 +08:00

606 lines
25 KiB
Vue

<script setup lang="ts">
/**
* features/chat/components/ShippingBatchWorkspaceDrawer.vue
* 用途:发货通知 Agent 的右侧批次工作台抽屉,承载多批次切换、任务筛选、步骤诊断与恢复动作。
* 依赖:shippingStepper、shipping.api.types、vue-i18n、lucide-vue-next。
* 逻辑:上游传入会话级 workspace 与当前批次任务;本组件只做展示、筛选和事件抛出,执行动作仍由 useChatShipping 接管。
*/
import { computed, ref } from 'vue';
import { RefreshCw, Target, X } from 'lucide-vue-next';
import { useI18n } from 'vue-i18n';
import { resolveShippingWorkflowSteps, type ShippingWorkflowStepItem } from '@/features/chat/shipping';
import { hasShortageLines } from '@/features/chat/shipping/shippingShortageDetails';
import type {
ShippingBatchSummary,
ShippingConversationWorkspace,
ShippingTaskDetail,
ShippingTaskSummary,
} from '@/features/chat/api/shipping.api';
const props = defineProps<{
open: boolean;
conversationWorkspace: ShippingConversationWorkspace | null;
activeBatchNo: string;
focusedTaskNo: string;
batchSummary: ShippingBatchSummary | null;
batchTasks: ShippingTaskSummary[];
activeTaskDetail: ShippingTaskDetail | null;
retryingPending?: boolean;
}>();
const emit = defineEmits<{
'update:open': [value: boolean];
'switch-batch': [batchNo: string];
'focus-task': [taskNo: string];
'resume-task': [taskNo: string];
'retry-rpa': [taskNo: string];
'query-shortage': [taskNo: string];
'retry-pending': [];
}>();
const { t } = useI18n();
const activeFilter = ref<'all' | 'abnormal' | 'waitingHuman' | 'resumable' | 'completed'>('all');
const COMPLETED_PROCESS_STATUSES = new Set(['uploaded', 'completed', 'closed']);
const workspaceBatches = computed(() => props.conversationWorkspace?.batches || []);
const activeBatchNo = computed(() =>
String(props.activeBatchNo || props.batchSummary?.batch_no || workspaceBatches.value[0]?.batch_no || '').trim(),
);
const isFailedTask = (task: ShippingTaskSummary | ShippingTaskDetail) =>
task.upload_status === 'failed' || String(task.process_status || '').trim() === 'upload_failed';
const isCompletedTask = (task: ShippingTaskSummary | ShippingTaskDetail) =>
COMPLETED_PROCESS_STATUSES.has(String(task.process_status || '').trim());
const isAbnormalTask = (task: ShippingTaskSummary | ShippingTaskDetail) =>
!isCompletedTask(task)
&& (isFailedTask(task)
|| Boolean(task.review_status || task.pending_human_reason)
|| String(task.process_status || '').trim() === 'waiting_inventory');
const isWaitingHumanTask = (task: ShippingTaskSummary | ShippingTaskDetail) =>
!isCompletedTask(task) && !isFailedTask(task) && Boolean(task.review_status || task.pending_human_reason);
const isResumableTask = (task: ShippingTaskSummary | ShippingTaskDetail) =>
!isCompletedTask(task) && !isWaitingHumanTask(task) && (
isFailedTask(task)
|| ['created', 'parsed', 'inventory_ready', 'matched', 'waiting_upload'].includes(String(task.process_status || '').trim())
);
const canRetryInventoryRpa = (task: ShippingTaskSummary | ShippingTaskDetail) => {
const reason = String(task.pending_human_reason || '').trim().toLowerCase();
const status = String(task.process_status || '').trim().toLowerCase();
return status === 'waiting_inventory' && ['rpa_exhausted', 'rpa_pending', 'inv_unavail'].includes(reason);
};
const batchAbnormalCount = (batch: ShippingBatchSummary) => {
const summary = batch.process_summary || {};
return Number(summary.failed || 0) + Number((summary as { needs_human?: number }).needs_human || 0);
};
const batchCompletedCount = (batch: ShippingBatchSummary) =>
Number(batch.process_summary?.completed || 0);
const batchTotalCount = (batch: ShippingBatchSummary) =>
Number(batch.process_summary?.total || batch.file_count || 0);
const taskCounts = computed(() => {
const tasks = props.batchTasks || [];
const completed = tasks.filter(isCompletedTask).length;
const abnormal = tasks.filter(isAbnormalTask).length;
const waitingHuman = tasks.filter(isWaitingHumanTask).length;
const resumable = tasks.filter(isResumableTask).length;
return {
total: tasks.length,
abnormal,
waitingHuman,
resumable,
completed,
};
});
const filteredTasks = computed(() => {
const tasks = props.batchTasks || [];
if (activeFilter.value === 'abnormal') return tasks.filter(isAbnormalTask);
if (activeFilter.value === 'waitingHuman') return tasks.filter(isWaitingHumanTask);
if (activeFilter.value === 'resumable') return tasks.filter(isResumableTask);
if (activeFilter.value === 'completed') return tasks.filter(isCompletedTask);
return tasks;
});
const isCurrentTask = (taskNo?: string | null) =>
String(taskNo || '').trim().toUpperCase() === String(props.focusedTaskNo || props.activeTaskDetail?.task_no || '').trim().toUpperCase();
const resolveTaskStateMeta = (task: ShippingTaskSummary | ShippingTaskDetail) => {
if (isCompletedTask(task)) {
return { text: t('chat.shippingNoticeUi.completedState'), className: 'border-emerald-100 bg-emerald-50 text-emerald-700' };
}
if (isFailedTask(task)) {
return { text: t('chat.shippingNoticeUi.status.uploadFailed'), className: 'border-rose-100 bg-rose-50 text-rose-700' };
}
if (isAbnormalTask(task)) {
return { text: t('chat.shippingNoticeUi.pendingState'), className: 'border-amber-100 bg-amber-50 text-amber-700' };
}
return { text: t('chat.shippingNoticeUi.runningState'), className: 'border-sky-100 bg-sky-50 text-brand-700' };
};
const taskWorkflowSteps = (task: ShippingTaskSummary | ShippingTaskDetail) => (
resolveShippingWorkflowSteps(task)
);
const taskStepNumber = (task: ShippingTaskSummary | ShippingTaskDetail) =>
resolveActiveStep(taskWorkflowSteps(task)) + 1;
const taskStepHeadline = (task: ShippingTaskSummary | ShippingTaskDetail) => {
const steps = taskWorkflowSteps(task);
const index = resolveActiveStep(steps);
const step = steps[index];
return step ? t('chat.shippingNoticeUi.stepHeadline', {
current: index + 1,
total: steps.length,
label: step.label.startsWith('chat.') ? t(step.label) : step.label,
}) : t('chat.shippingNoticeUi.stepFraction', { current: index + 1, total: steps.length });
};
const currentStepProgress = (task: ShippingTaskSummary | ShippingTaskDetail) =>
task.step_payload?.current_step_progress || null;
const resolveTaskDiagnosis = (task: ShippingTaskSummary | ShippingTaskDetail) => {
const uiSummary = task.ui_state?.summary;
if (uiSummary?.title || uiSummary?.message || uiSummary?.error_message) {
return {
title: uiSummary.error_message || uiSummary.title || t('chat.shippingNoticeUi.diagnosisStepWaitingTitle', { step: taskStepNumber(task) }),
advice: uiSummary.message || t('chat.shippingNoticeUi.diagnosisStepWaitingAdvice'),
};
}
const reason = String(task.pending_human_reason || '').trim();
const reviewStatus = String(task.review_status || '').trim();
const processStatus = String(task.process_status || '').trim();
const explicitError = String(task.error_message || '').trim();
const progress = currentStepProgress(task);
const progressMessage = String(progress?.message || '').trim();
const progressDetail = String(progress?.detail || '').trim();
const step = taskStepNumber(task);
if (isCompletedTask(task)) {
return {
title: t('chat.shippingNoticeUi.diagnosisCompletedTitle'),
advice: t('chat.shippingNoticeUi.diagnosisCompletedAdvice'),
};
}
if (progressMessage && reason === 'rpa_pending') {
return {
title: progressMessage,
advice: progressDetail || t('chat.shippingNoticeUi.diagnosisInventoryRpaAdvice'),
};
}
if (explicitError) {
return {
title: explicitError,
advice: progressDetail || t('chat.shippingNoticeUi.diagnosisAdviceRetryOrFocus'),
};
}
if (progressMessage && (isAbnormalTask(task) || progress?.status === 'needs_human')) {
return {
title: progressMessage,
advice: progressDetail || t('chat.shippingNoticeUi.diagnosisStepWaitingAdvice'),
};
}
if (isFailedTask(task) || reason === 'upload_rpa_failed') {
return {
title: t('chat.shippingNoticeUi.diagnosisUploadFailedTitle'),
advice: t('chat.shippingNoticeUi.diagnosisUploadFailedAdvice'),
};
}
if (reason === 'shortage' || reason === 'shortage_review' || reviewStatus === 'shortage_review') {
return {
title: t('chat.shippingNoticeUi.diagnosisShortageTitle'),
advice: t('chat.shippingNoticeUi.diagnosisShortageAdvice'),
};
}
if (reason === 'rpa_exhausted' || reason === 'rpa_pending' || reason === 'inv_unavail') {
return {
title: t('chat.shippingNoticeUi.diagnosisInventoryRpaTitle'),
advice: t('chat.shippingNoticeUi.diagnosisInventoryRpaAdvice'),
};
}
if (reason === 'align_review' || reviewStatus === 'align_review') {
return {
title: t('chat.shippingNoticeUi.diagnosisAlignReviewTitle'),
advice: t('chat.shippingNoticeUi.diagnosisAlignReviewAdvice'),
};
}
if (reason === 'low_confidence' || reviewStatus === 'parse_review') {
return {
title: t('chat.shippingNoticeUi.diagnosisParseReviewTitle'),
advice: t('chat.shippingNoticeUi.diagnosisParseReviewAdvice'),
};
}
if (reason === 'rsv_required' || reviewStatus === 'rsv_required') {
return {
title: t('chat.shippingNoticeUi.diagnosisReservationRequiredTitle'),
advice: t('chat.shippingNoticeUi.diagnosisReservationRequiredAdvice'),
};
}
if (reason === 'map_infer' || processStatus === 'waiting_inventory') {
return {
title: t('chat.shippingNoticeUi.diagnosisInventoryWaitingTitle'),
advice: t('chat.shippingNoticeUi.diagnosisInventoryWaitingAdvice'),
};
}
return {
title: t('chat.shippingNoticeUi.diagnosisStepWaitingTitle', { step }),
advice: t('chat.shippingNoticeUi.diagnosisStepWaitingAdvice'),
};
};
const resolveSuggestedAction = (task: ShippingTaskSummary | ShippingTaskDetail) => {
if (task.ui_state?.action_buttons?.length) {
return task.ui_state.action_buttons.map((action) => action.label).join(' / ');
}
const reason = String(task.pending_human_reason || '').trim();
const reviewStatus = String(task.review_status || '').trim();
if (hasShortageLines(task) || reason === 'shortage' || reviewStatus === 'shortage_review') {
return t('chat.shippingNoticeUi.suggestShortageActions');
}
if (reason === 'align_review' || reviewStatus === 'align_review') {
return t('chat.shippingNoticeUi.suggestConfirmMapping');
}
if (reason === 'low_confidence' || reviewStatus === 'parse_review') {
return t('chat.shippingNoticeUi.suggestReviewParse');
}
if (isFailedTask(task)) {
return t('chat.shippingNoticeUi.suggestRetryStep');
}
if (isCompletedTask(task)) {
return t('chat.shippingNoticeUi.suggestViewOnly');
}
return t('chat.shippingNoticeUi.suggestContinue');
};
const resolveActiveStep = (steps: Array<ShippingWorkflowStepItem | { status: string }>) => {
const activeIndex = steps.findIndex((step) => step.status === 'current' || step.status === 'blocked');
return activeIndex >= 0 ? activeIndex : Math.max(0, steps.length - 1);
};
const handleSwitchBatch = (batchNo: string) => {
if (!batchNo || batchNo === activeBatchNo.value) return;
activeFilter.value = 'all';
emit('switch-batch', batchNo);
};
</script>
<template>
<aside
v-if="open"
class="hidden h-full w-[520px] shrink-0 flex-col border-l border-default bg-surface shadow-[-12px_0_40px_rgba(15,23,42,0.08)] xl:flex"
>
<header class="flex h-[92px] shrink-0 items-center justify-between border-b border-default px-6">
<div>
<div class="flex items-center gap-2 text-lg font-bold text-primary">
<span class="grid h-5 w-5 grid-cols-2 gap-0.5 text-brand-500">
<span class="rounded-sm bg-current"></span>
<span class="rounded-sm border border-current"></span>
<span class="rounded-sm border border-current"></span>
<span class="rounded-sm bg-current"></span>
</span>
{{ t('chat.shippingNoticeUi.batchWorkspaceTitle') }}
</div>
<p class="mt-1 text-[11px] text-muted">{{ t('chat.shippingNoticeUi.batchWorkspaceSubtitle') }}</p>
</div>
<button
type="button"
class="flex h-9 w-9 items-center justify-center rounded-full text-muted transition hover:bg-surface-soft hover:text-primary"
@click="emit('update:open', false)"
>
<X class="h-5 w-5" />
</button>
</header>
<div class="border-b border-default px-6 py-5">
<div class="flex gap-3 overflow-x-auto pb-1">
<button
v-for="batch in workspaceBatches"
:key="batch.batch_no"
type="button"
class="relative w-44 shrink-0 overflow-hidden rounded-xl border p-3 text-left transition-colors"
:class="batch.batch_no === activeBatchNo ? 'border-brand-300 bg-surface shadow-sm ring-1 ring-brand-100' : 'border-default bg-transparent hover:bg-surface-soft'"
@click="handleSwitchBatch(batch.batch_no)"
>
<div
v-if="batch.batch_no === activeBatchNo"
class="absolute left-0 top-0 h-1 w-full bg-brand-500"
></div>
<div class="mb-1 truncate font-mono text-xs font-bold text-primary">{{ batch.batch_no }}</div>
<div class="text-[10px] font-medium text-muted">
{{
batchAbnormalCount(batch) > 0
? t('chat.shippingNoticeUi.batchTabAbnormal', { completed: batchCompletedCount(batch), abnormal: batchAbnormalCount(batch) })
: t('chat.shippingNoticeUi.batchTabNormal', { total: batchTotalCount(batch) })
}}
</div>
</button>
</div>
</div>
<div class="flex-1 overflow-y-auto px-6 py-6">
<section class="rounded-lg border border-default bg-surface p-4 shadow-sm">
<h3 class="text-sm font-bold text-primary">{{ t('chat.shippingNoticeUi.taskQueueTitle') }}</h3>
<p class="mt-1 text-xs leading-5 text-muted">{{ t('chat.shippingNoticeUi.taskQueueHint') }}</p>
<div class="mt-4">
<button
type="button"
class="inline-flex w-full items-center justify-center gap-2 rounded-lg border border-default bg-white py-2 text-xs font-medium text-secondary transition hover:border-brand-300 hover:bg-brand-50 hover:text-brand-700 disabled:cursor-not-allowed disabled:opacity-60"
:disabled="retryingPending"
@click="emit('retry-pending')"
>
<RefreshCw class="h-3.5 w-3.5" :class="retryingPending ? 'animate-spin' : ''" />
{{ retryingPending ? t('chat.shippingNoticeUi.retrying') : t('chat.shippingNoticeUi.retryFailedTasks') }}
</button>
</div>
<div class="mt-3 rounded-lg border border-indigo-100 bg-indigo-50 p-3 text-xs leading-5 text-indigo-900/80">
{{ t('chat.shippingNoticeUi.batchActionSafetyNotice') }}
</div>
</section>
<section class="mt-6">
<div class="mb-3 flex items-center justify-between gap-3">
<h3 class="text-sm font-bold text-primary">
{{ t('chat.shippingNoticeUi.taskDetailCount', { count: filteredTasks.length }) }}
</h3>
<div class="flex flex-wrap rounded-lg bg-slate-100 p-1 text-xs">
<button
type="button"
class="rounded px-3 py-1 transition-colors"
:class="activeFilter === 'all' ? 'bg-white text-primary shadow-sm' : 'text-muted hover:text-secondary'"
@click="activeFilter = 'all'"
>
{{ t('chat.shippingNoticeUi.filterAll') }}
</button>
<button
type="button"
class="rounded px-3 py-1 transition-colors"
:class="activeFilter === 'abnormal' ? 'bg-white text-primary shadow-sm' : 'text-muted hover:text-secondary'"
@click="activeFilter = 'abnormal'"
>
{{ t('chat.shippingNoticeUi.filterAbnormal', { count: taskCounts.abnormal }) }}
</button>
<button
type="button"
class="rounded px-3 py-1 transition-colors"
:class="activeFilter === 'waitingHuman' ? 'bg-white text-primary shadow-sm' : 'text-muted hover:text-secondary'"
@click="activeFilter = 'waitingHuman'"
>
{{ t('chat.shippingNoticeUi.filterWaitingHuman', { count: taskCounts.waitingHuman }) }}
</button>
<button
type="button"
class="rounded px-3 py-1 transition-colors"
:class="activeFilter === 'resumable' ? 'bg-white text-primary shadow-sm' : 'text-muted hover:text-secondary'"
@click="activeFilter = 'resumable'"
>
{{ t('chat.shippingNoticeUi.filterResumable', { count: taskCounts.resumable }) }}
</button>
<button
type="button"
class="rounded px-3 py-1 transition-colors"
:class="activeFilter === 'completed' ? 'bg-white text-primary shadow-sm' : 'text-muted hover:text-secondary'"
@click="activeFilter = 'completed'"
>
{{ t('chat.shippingNoticeUi.filterCompleted', { count: taskCounts.completed }) }}
</button>
</div>
</div>
<div v-if="!filteredTasks.length" class="py-10 text-center text-sm text-muted">
{{ t('chat.shippingNoticeUi.emptyFilteredTasks') }}
</div>
<div v-else class="space-y-3">
<article
v-for="task in filteredTasks"
:key="task.task_no"
class="relative overflow-hidden rounded-lg border bg-white p-3 shadow-sm transition-colors"
:class="[
isFailedTask(task) ? 'border-rose-100' : isAbnormalTask(task) ? 'border-amber-100' : 'border-default',
isCurrentTask(task.task_no) ? 'ring-1 ring-brand-200' : '',
]"
>
<div
class="absolute left-0 top-0 h-full w-1"
:class="isFailedTask(task) ? 'bg-rose-500' : isAbnormalTask(task) ? 'bg-amber-500' : 'bg-emerald-500'"
></div>
<div class="flex items-start justify-between gap-3">
<div class="min-w-0">
<div class="truncate font-mono text-sm font-bold text-primary">{{ task.task_no }}</div>
<div class="mt-0.5 truncate text-xs text-muted">
{{ task.source_file_name || task.customer_name || t('chat.shippingNoticeUi.currentNotice') }}
</div>
<div class="mt-1 text-xs font-medium text-secondary">{{ taskStepHeadline(task) }}</div>
</div>
<span class="rounded border px-2 py-1 text-[10px] font-bold" :class="resolveTaskStateMeta(task).className">
{{ resolveTaskStateMeta(task).text }}
</span>
</div>
<div class="my-3">
<div class="scheme-stepper">
<template v-for="(step, index) in taskWorkflowSteps(task)" :key="step.id">
<div
class="scheme-step-node"
:class="{
done: step.status === 'completed',
active: step.status === 'current',
blocked: step.status === 'blocked',
}"
>
<div class="scheme-step-dot">
<span v-if="step.status === 'completed'">✓</span>
<X v-else-if="step.status === 'blocked' && isFailedTask(task)" class="h-3 w-3" />
<span v-else-if="step.status === 'blocked'">!</span>
<span v-else>{{ index + 1 }}</span>
</div>
<div class="scheme-step-label">{{ step.label.startsWith('chat.') ? t(step.label) : step.label }}</div>
</div>
</template>
</div>
</div>
<div
class="mb-2 rounded-lg border p-2.5 text-xs font-medium leading-5"
:class="isFailedTask(task) ? 'border-rose-100 bg-rose-50 text-rose-700' : isAbnormalTask(task) ? 'border-amber-100 bg-amber-50 text-amber-700' : 'border-emerald-100 bg-emerald-50 text-emerald-700'"
>
<div class="font-semibold">{{ resolveTaskDiagnosis(task).title }}</div>
<div class="mt-1 font-normal text-slate-600">{{ resolveTaskDiagnosis(task).advice }}</div>
</div>
<div class="mb-3 text-xs leading-5 text-muted">
<span class="font-semibold text-secondary">{{ t('chat.shippingNoticeUi.suggestedAction') }}</span>
{{ resolveSuggestedAction(task) }}
</div>
<div class="flex flex-wrap gap-2">
<button
v-if="hasShortageLines(task)"
type="button"
class="flex flex-1 items-center justify-center gap-1.5 rounded-lg border border-amber-100 bg-amber-50 py-1.5 text-xs font-medium text-amber-700 transition-colors hover:bg-amber-100"
@click="emit('query-shortage', task.task_no)"
>
{{ t('chat.shippingNoticeUi.queryShortageDetails') }}
</button>
<button
type="button"
class="flex flex-1 items-center justify-center gap-1.5 rounded-lg border border-transparent bg-surface-soft px-2 py-1.5 text-xs font-medium text-secondary transition-colors hover:border-brand-200 hover:bg-brand-50 hover:text-brand-600"
@click="emit('focus-task', task.task_no)"
>
<Target class="h-3.5 w-3.5" />
{{ t('chat.shippingNoticeUi.switchCurrentTask') }}
</button>
<button
type="button"
class="flex-1 rounded-lg border border-default bg-white px-2 py-1.5 text-xs font-medium text-secondary transition-colors hover:border-brand-300 hover:text-brand-700"
@click="canRetryInventoryRpa(task) ? emit('retry-rpa', task.task_no) : emit('resume-task', task.task_no)"
>
{{
isCompletedTask(task)
? t('chat.shippingNoticeUi.viewDetail')
: canRetryInventoryRpa(task)
? t('chat.shippingNoticeUi.retryRpa')
: t('chat.shippingNoticeUi.continueTask')
}}
</button>
</div>
</article>
</div>
</section>
</div>
</aside>
<div
v-if="open"
class="fixed inset-0 z-[90] bg-slate-900/30 backdrop-blur-sm xl:hidden"
@click="emit('update:open', false)"
>
<aside
class="ml-auto flex h-full w-[min(92vw,520px)] flex-col border-l border-default bg-surface shadow-2xl"
@click.stop
>
<header class="flex h-16 shrink-0 items-center justify-between border-b border-default px-4">
<div class="font-bold text-primary">{{ t('chat.shippingNoticeUi.batchWorkspaceTitle') }}</div>
<button type="button" class="rounded-full p-2 text-muted hover:bg-surface-soft" @click="emit('update:open', false)">
<X class="h-5 w-5" />
</button>
</header>
<div class="flex-1 overflow-y-auto p-4 text-sm text-muted">
{{ t('chat.shippingNoticeUi.mobileWorkspaceHint') }}
</div>
</aside>
</div>
</template>
<style scoped>
.scheme-stepper {
display: flex;
overflow-x: auto;
padding-bottom: 0.25rem;
}
.scheme-step-node {
position: relative;
flex: 1;
min-width: 52px;
text-align: center;
}
.scheme-step-node:not(:last-child)::after {
content: '';
position: absolute;
top: 10px;
left: calc(50% + 11px);
width: calc(100% - 22px);
height: 2px;
background: #e2e8f0;
z-index: 0;
}
.scheme-step-node.done:not(:last-child)::after {
background: #0284c7;
}
.scheme-step-node.active:not(:last-child)::after {
background: linear-gradient(90deg, #0284c7 50%, #e2e8f0 50%);
}
.scheme-step-dot {
position: relative;
z-index: 1;
display: grid;
place-items: center;
width: 20px;
height: 20px;
margin: 0 auto 0.25rem;
border: 2px solid #e2e8f0;
border-radius: 9999px;
background: #fff;
color: #64748b;
font-size: 0.55rem;
font-weight: 700;
}
.scheme-step-node.done .scheme-step-dot {
border-color: #0284c7;
background: #0284c7;
color: #fff;
}
.scheme-step-node.active .scheme-step-dot {
border-color: #0284c7;
box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.18);
color: #0284c7;
}
.scheme-step-node.blocked .scheme-step-dot {
border-color: #f59e0b;
background: #fff;
color: #f59e0b;
box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.18);
}
.scheme-step-node.blocked .scheme-step-label {
color: #d97706;
font-weight: 600;
}
.scheme-step-label {
color: #64748b;
font-size: 0.58rem;
line-height: 1.2;
}
.scheme-step-node.active .scheme-step-label {
color: #0284c7;
font-weight: 600;
}
</style>