refactor(shipping-notice): 重构货代发货通知状态管理,移除废弃的process_status字段
统一货代发货通知的业务阶段为四个标准阶段:接收解析、订单复核、发货准备、上传完成 设置 ui_state 为前端唯一状态数据源,不再依赖 process_status 驱动业务流程 删除 shipping_notices 表的废弃 process_status 列及对应复合索引,新增数据库迁移脚本 替换全栈代码中所有对 process_status 的引用为生命周期、上传状态等领域字段 更新相关文档、测试用例与前端展示逻辑适配新的状态管理规则
This commit is contained in:
1 parent
6684e7181a
commit
5ef8329bd8
178 files changed
+5091
-1734
No files matched your search
+221
-45
@@ -1,6 +1,6 @@
|
||||
/**
|
||||
* features/chat/components/shipping/ShippingConversationProcessingCard.vue
|
||||
* 用途:右侧「本次处理中」顶层任务卡——needs_action / processing / 处理记录。
|
||||
* 用途:右侧「批次进度中心」顶层任务卡——needs_action / processing / 处理记录。
|
||||
* 依赖:vue-i18n、ConversationProcessingProjection、conversationProcessingState、
|
||||
* conversationProcessingDisplay、actionPresentation、shippingProcessingLabels、SidebarProgressInline。
|
||||
* 逻辑:由 ShippingWorkflowTimeline 嵌入;只消费统一 projection / workItems;
|
||||
@@ -33,7 +33,8 @@ import {
|
||||
resolveShippingProcessingStatusLabel,
|
||||
shippingProcessingStageKey,
|
||||
} from '@/features/chat/shipping/shippingProcessingLabels';
|
||||
import { resolveConversationTaskActionPresentation } from '@/features/shipping-progress/actionPresentation';
|
||||
import { flattenBusinessFileProjections } from '@/features/chat/shipping/conversationProcessingProjection';
|
||||
import { resolveConversationTaskActionPresentation, resolveProcessingActionPresentation } from '@/features/shipping-progress/actionPresentation';
|
||||
import SidebarProgressInline from '@/features/shipping-progress/components/SidebarProgressInline.vue';
|
||||
import type { ActionPresentation, ActionPresentationItem } from '@/features/shipping-progress/types';
|
||||
|
||||
@@ -45,6 +46,8 @@ const props = defineProps<{
|
||||
conversationId?: string | null;
|
||||
/** 后端截断提示:history 还有未返回内容时在处理记录底部展示 */
|
||||
hasMoreHistory?: boolean;
|
||||
/** 批次中心按状态 → EML → 文件展示,不再嵌入任务级 15 节点进度。 */
|
||||
workbenchMode?: boolean;
|
||||
}>();
|
||||
|
||||
const emit = defineEmits<{
|
||||
@@ -65,6 +68,17 @@ const uiState = createConversationProcessingUiState();
|
||||
/** 处理记录整组默认折叠。 */
|
||||
const historySectionExpanded = ref(false);
|
||||
|
||||
/** 批次中心文件叶子行;EML 仅是聚合容器,文件状态、原因与动作必须取叶子自身投影。 */
|
||||
type WorkbenchFileRow = {
|
||||
kind: 'document';
|
||||
object_key: string;
|
||||
label: string;
|
||||
filename?: string | null;
|
||||
document_id?: number | null;
|
||||
status_label?: string | null;
|
||||
projection?: ShippingProcessingProjection;
|
||||
};
|
||||
|
||||
/** 唯一进度源:统一 conversation_processing / work_items 合成投影。 */
|
||||
const activeProjection = computed((): ConversationProcessingProjection | null => (
|
||||
props.projection || null
|
||||
@@ -185,6 +199,7 @@ function canExpandFileDetails(task: ConversationProcessingUserTask): boolean {
|
||||
* 处理记录(completed/history)永不展实时进度。
|
||||
*/
|
||||
function progressModeForTask(task: ConversationProcessingUserTask): 'full' | 'compact' | 'hidden' {
|
||||
if (props.workbenchMode) return 'hidden';
|
||||
if (!projectionForTask(task)) return 'hidden';
|
||||
const group = String(task.group || '').trim();
|
||||
if (group === 'completed' || group === 'history') return 'hidden';
|
||||
@@ -202,6 +217,137 @@ function taskLabel(_task: ConversationProcessingUserTask): string {
|
||||
return t('chat.shippingProcessing.multiPdfTaskTitle');
|
||||
}
|
||||
|
||||
/** EML 聚合标题优先使用后端邮件文件名,普通文件则显示主文件名。 */
|
||||
function groupTitle(task: ConversationProcessingUserTask): string {
|
||||
const projection = projectionForTask(task);
|
||||
const children = task.aggregateChildren || [];
|
||||
const projectionFilename = String(projection?.sourceSummary?.filename || '').trim();
|
||||
const emlChild = children.find((child) => (
|
||||
String(child.sourceSummary?.filename || '').trim().toLowerCase().endsWith('.eml')
|
||||
));
|
||||
const emailChild = children.find((child) => Boolean(child.sourceSummary?.emailSubject));
|
||||
const isEml = projection?.sourceType === 'eml'
|
||||
&& Boolean(
|
||||
emlChild
|
||||
|| emailChild
|
||||
|| projection?.sourceSummary?.emailSubject
|
||||
|| projectionFilename.toLowerCase().endsWith('.eml'),
|
||||
);
|
||||
if (!isEml) return projection?.sourceSummary?.filename || task.title || taskLabel(task);
|
||||
// 后端在 EML 聚合根 sourceSummary 写入 Intake 原始邮件资产名;子附件列表不含
|
||||
// 邮件本体时仍必须显示该 .eml,不能回退成 Intake 编号或任一 PDF 文件名。
|
||||
if (projectionFilename.toLowerCase().endsWith('.eml')) return projectionFilename;
|
||||
if (emlChild?.sourceSummary?.filename) return emlChild.sourceSummary.filename;
|
||||
if (projection?.sourceSummary?.emailSubject) return `EML · ${projection.sourceSummary.emailSubject}`;
|
||||
if (emailChild?.sourceSummary?.emailSubject) return `EML · ${emailChild.sourceSummary.emailSubject}`;
|
||||
if (task.aggregateSummary?.intakeNo) {
|
||||
return `EML · ${task.aggregateSummary?.intakeNo || task.user_task_no}`;
|
||||
}
|
||||
return task.title || taskLabel(task);
|
||||
}
|
||||
|
||||
/** 工作台文件行:只展示后端 document objects,避免用任务标题冒充文件。 */
|
||||
function workbenchFileRows(task: ConversationProcessingUserTask): WorkbenchFileRow[] {
|
||||
const children = task.aggregateChildren || [];
|
||||
if (children.length) {
|
||||
return flattenBusinessFileProjections(children).map((child, index) => {
|
||||
const filename = String(child.sourceSummary?.filename || '').trim();
|
||||
const documentId = Number(child.sourceSummary?.documentId || 0) || 0;
|
||||
return {
|
||||
kind: 'document' as const,
|
||||
object_key: documentId ? `DOC-${documentId}` : `${task.user_task_no}-aggregate-${child.workItemNo || index}`,
|
||||
label: filename || child.workItemNo || `文件 ${index + 1}`,
|
||||
filename: filename || child.workItemNo || `文件 ${index + 1}`,
|
||||
status_label: String(child.uiState?.status || child.userStatus || child.status || ''),
|
||||
projection: child,
|
||||
};
|
||||
});
|
||||
}
|
||||
const documents = (task.objects || []).filter((item) => (
|
||||
item.kind === 'document'
|
||||
&& !String(item.filename || item.label || '').trim().toLowerCase().endsWith('.eml')
|
||||
));
|
||||
if (documents.length) {
|
||||
// direct_pdf 没有 EML aggregate_children;将唯一根 work_item 绑定到其文件行,
|
||||
// 使状态、原因和操作仍然来自同一份后端 ui_state,而不是丢失操作或回退 legacy 字段。
|
||||
const directFileProjection = projectionForTask(task);
|
||||
return documents.map((item) => ({
|
||||
kind: 'document' as const,
|
||||
object_key: item.object_key,
|
||||
label: item.label,
|
||||
filename: item.filename,
|
||||
document_id: item.document_id,
|
||||
status_label: item.status_label,
|
||||
projection: directFileProjection?.sourceType === 'direct_pdf'
|
||||
? directFileProjection
|
||||
: undefined,
|
||||
}));
|
||||
}
|
||||
const taskName = String(task.title || '').trim().toLowerCase();
|
||||
if (taskName.endsWith('.eml') || task.aggregateSummary?.intakeNo) return [];
|
||||
return (task.document_names || []).map((filename, index) => ({
|
||||
kind: 'document' as const,
|
||||
object_key: `${task.user_task_no}-document-${index}`,
|
||||
label: filename,
|
||||
filename,
|
||||
status_label: task.status_label,
|
||||
}));
|
||||
}
|
||||
|
||||
/** 状态组标题按文件计数,与批次总览保持同一口径。 */
|
||||
function groupFileCount(tasks: ConversationProcessingUserTask[]): number {
|
||||
const seen = new Set<string>();
|
||||
return tasks.reduce((total, task) => total + workbenchFileRows(task).reduce((count, file) => {
|
||||
const filename = String(file.filename || file.label || '').trim().toLowerCase();
|
||||
if (filename.endsWith('.eml')) return count;
|
||||
const key = String(('document_id' in file ? file.document_id : undefined)
|
||||
|| file.object_key || file.filename || file.label || '').trim();
|
||||
if (!key || seen.has(key)) return count;
|
||||
seen.add(key);
|
||||
return count + 1;
|
||||
}, 0), 0);
|
||||
}
|
||||
|
||||
function workbenchFileStatus(file: WorkbenchFileRow, task: ConversationProcessingUserTask): string {
|
||||
const status = file.projection
|
||||
? (file.projection.uiState?.status || file.projection.userStatus || file.projection.status)
|
||||
: (file.status_label || task.status_label || '');
|
||||
return resolveShippingProcessingStatusLabel(String(status), te, t);
|
||||
}
|
||||
|
||||
function workbenchFileReason(file: WorkbenchFileRow, task: ConversationProcessingUserTask): string {
|
||||
if (file.projection) {
|
||||
const reason = file.projection.uiState
|
||||
? file.projection.uiState.blocking_reason
|
||||
: file.projection.blockingReason;
|
||||
if (!reason) return '';
|
||||
const key = String(reason.i18nKey || '').trim();
|
||||
return key && te(key) ? t(key) : String(reason.code || '').trim();
|
||||
}
|
||||
return taskReasonLabel(task);
|
||||
}
|
||||
|
||||
/** 附件阶段来自叶子 ui_state;EML 父阶段只适用于 EML 卡,不得复制到不同状态的附件。 */
|
||||
function workbenchFileStage(file: WorkbenchFileRow, task: ConversationProcessingUserTask): string {
|
||||
const stage = file.projection
|
||||
? (file.projection.uiState?.stage || file.projection.userStage || file.projection.stage)
|
||||
: stageLabel(task);
|
||||
const key = shippingProcessingStageKey(String(stage || ''));
|
||||
return key && te(key) ? t(key) : String(stage || '');
|
||||
}
|
||||
|
||||
/** 叶子文件动作由自身 ui_state 裁决;没有叶子投影时不伪造可操作按钮。 */
|
||||
function filePrimaryActionItem(file: WorkbenchFileRow): ActionPresentationItem | null {
|
||||
return file.projection
|
||||
? resolveProcessingActionPresentation(file.projection, { surface: 'right' }).primary
|
||||
: null;
|
||||
}
|
||||
|
||||
function onFileProjectionAction(file: WorkbenchFileRow) {
|
||||
const action = filePrimaryActionItem(file);
|
||||
if (file.projection && action) emit('projectionAction', { projection: file.projection, item: action });
|
||||
}
|
||||
|
||||
/**
|
||||
* 主文件副标题:有主文件名时渲染「主文件:{name}」。
|
||||
*/
|
||||
@@ -227,7 +373,11 @@ function fileCountLabel(task: ConversationProcessingUserTask): string {
|
||||
* 任务状态文案:优先统一 shippingProcessing,回退 shippingWorkflow。
|
||||
*/
|
||||
function statusLabel(task: ConversationProcessingUserTask): string {
|
||||
return resolveShippingProcessingStatusLabel(String(task.status_label || ''), te, t);
|
||||
return resolveShippingProcessingStatusLabel(
|
||||
String(task.uiState?.status || task.userStatus || task.status_label || ''),
|
||||
te,
|
||||
t,
|
||||
);
|
||||
}
|
||||
|
||||
/** 展示统一投影的真实履约阶段;识别候选不再冒充最终完成。 */
|
||||
@@ -237,17 +387,16 @@ function stageLabel(task: ConversationProcessingUserTask): string {
|
||||
return intakeStageLabel(projection);
|
||||
}
|
||||
|
||||
/** 展示后端统一投影的阻断/失败原因,不从状态码自行猜测。 */
|
||||
/** 展示后端 ui_state 已裁决的阻断原因;i18n 仅负责翻译,不映射或猜测业务原因。 */
|
||||
function taskReasonLabel(task: ConversationProcessingUserTask): string {
|
||||
const code = String(task.blockingReason?.code || task.aggregateSummary?.reasonCodes[0] || '').trim();
|
||||
if (!code) return '';
|
||||
const messages: Record<string, string> = {
|
||||
'SHIPPING_NOTICE.CANDIDATE_REVIEW_REQUIRED': '识别结果需要人工确认,请进入订单处理继续。',
|
||||
'generic_extraction_disabled': '当前文件暂不支持自动解析,请人工处理或更换文件。',
|
||||
'SHIPPING_NOTICE.INTAKE_PARSE_FAILED': '邮件或附件解析失败,请检查文件后重试。',
|
||||
'upload_rpa_failed': '上传货代系统失败,请稍后重试。',
|
||||
};
|
||||
return messages[code] || '文件处理需要人工确认,请进入订单处理查看。';
|
||||
const reason = task.uiState
|
||||
? task.uiState.blocking_reason
|
||||
: task.blockingReason;
|
||||
if (!reason) return '';
|
||||
const key = String(reason.i18nKey || '').trim();
|
||||
if (key && te(key)) return t(key);
|
||||
// 未升级响应没有 i18n_key 时仅透传后端原因码,不根据文件名、状态或动作伪造说明。
|
||||
return String(reason.code || '').trim();
|
||||
}
|
||||
|
||||
/** 同一 EML 聚合卡状态计数;仅用后端下发的 aggregateSummary,不从 UI 状态推导。 */
|
||||
@@ -300,10 +449,14 @@ function currentNeedLabel(task: ConversationProcessingUserTask): string {
|
||||
primaryAction?: { code?: string } | null;
|
||||
};
|
||||
const action = String(
|
||||
typedTask.primaryAction?.code
|
||||
?? task.primary_action
|
||||
?? task.available_actions?.[0]
|
||||
?? '',
|
||||
task.uiState
|
||||
? (task.uiState.primary_action?.code
|
||||
?? task.uiState.secondary_actions.find((item) => item.enabled)?.code
|
||||
?? '')
|
||||
: (typedTask.primaryAction?.code
|
||||
?? task.primary_action
|
||||
?? task.available_actions?.[0]
|
||||
?? ''),
|
||||
).trim().toLowerCase();
|
||||
const labels: Record<string, string> = {
|
||||
confirm_customer: 'chat.shippingProcessing.currentNeed.confirmCustomer',
|
||||
@@ -356,6 +509,7 @@ function shouldShowOverflowActions(_task: ConversationProcessingUserTask): boole
|
||||
* 是否渲染任务级主/次动作区(不含「展开文件详情」文件控制)。
|
||||
*/
|
||||
function shouldShowTaskLevelActions(task: ConversationProcessingUserTask): boolean {
|
||||
if (props.workbenchMode) return Boolean(primaryActionItem(task));
|
||||
if (projectionForTask(task)) return false;
|
||||
return Boolean(primaryActionItem(task) || secondaryActionItem(task));
|
||||
}
|
||||
@@ -441,7 +595,7 @@ function intakeStageLabel(item: ShippingProcessingProjection): string {
|
||||
data-testid="shipping-processing-group-failed"
|
||||
>
|
||||
<div class="mb-1.5 text-[11px] font-semibold uppercase tracking-wide text-amber-700 dark:text-amber-300">
|
||||
{{ t('chat.shippingProcessing.groupFailed', { count: failedTasks.length }) }}
|
||||
{{ t('chat.shippingProcessing.batchWorkbench.groups.failed', { count: groupFileCount(failedTasks) }) }}
|
||||
</div>
|
||||
<div class="space-y-2">
|
||||
<article
|
||||
@@ -463,15 +617,13 @@ function intakeStageLabel(item: ShippingProcessingProjection): string {
|
||||
@click="onSelectTask(task)"
|
||||
>
|
||||
<div class="text-sm font-semibold text-primary">
|
||||
{{ resolveShippingProcessingMessage('taskTitle', te, t, { label: taskLabel(task) }) }}
|
||||
{{ workbenchMode ? groupTitle(task) : resolveShippingProcessingMessage('taskTitle', te, t, { label: taskLabel(task) }) }}
|
||||
</div>
|
||||
<div class="mt-0.5 flex flex-wrap gap-x-2 gap-y-0.5 text-[11px] text-secondary">
|
||||
<div v-if="!workbenchMode" class="mt-0.5 flex flex-wrap gap-x-2 gap-y-0.5 text-[11px] text-secondary">
|
||||
<span v-if="fileCountLabel(task)">{{ fileCountLabel(task) }}</span>
|
||||
<span>{{ statusLabel(task) }}</span>
|
||||
<span v-if="stageLabel(task)">· {{ stageLabel(task) }}</span>
|
||||
</div>
|
||||
<div
|
||||
v-if="primaryFileLabel(task)"
|
||||
v-if="!workbenchMode && primaryFileLabel(task)"
|
||||
class="mt-0.5 truncate text-[11px] text-muted"
|
||||
data-testid="shipping-processing-task-primary-file"
|
||||
>
|
||||
@@ -496,15 +648,18 @@ function intakeStageLabel(item: ShippingProcessingProjection): string {
|
||||
{{ resolveShippingProcessingMessage('justCreated', te, t) }}
|
||||
</div>
|
||||
</button>
|
||||
<div
|
||||
v-if="task.group === 'needs_action' && currentNeedLabel(task)"
|
||||
class="mt-1 text-[11px] text-secondary"
|
||||
data-testid="shipping-processing-current-need"
|
||||
>
|
||||
{{ t('chat.shippingProcessing.progress.currentNeedLabel') }}{{ currentNeedLabel(task) }}
|
||||
<div v-if="workbenchMode" class="mt-3 space-y-2 border-t border-rose-200/70 pt-2">
|
||||
<div v-for="file in workbenchFileRows(task)" :key="file.object_key" class="flex items-center gap-3 rounded-md bg-white/70 px-2 py-2 dark:bg-slate-950/30">
|
||||
<div class="min-w-0 flex-1">
|
||||
<div class="truncate text-xs font-medium text-primary">{{ file.filename || file.label }}</div>
|
||||
<div v-if="workbenchFileReason(file, task)" class="mt-0.5 truncate text-[11px] text-rose-600 dark:text-rose-300">{{ workbenchFileReason(file, task) }}</div>
|
||||
</div>
|
||||
<span class="shrink-0 rounded-full bg-rose-100 px-2 py-0.5 text-[11px] font-medium text-rose-700">{{ workbenchFileStatus(file, task) || t('chat.shippingProcessing.batchWorkbench.groups.failedFallback') }}</span>
|
||||
<button v-if="filePrimaryActionItem(file)" type="button" class="shrink-0 rounded-md border border-rose-300 px-2.5 py-1 text-[11px] font-medium text-rose-700 hover:bg-rose-50" @click="onFileProjectionAction(file)">{{ presentationActionLabel(task, filePrimaryActionItem(file)!) }}</button>
|
||||
</div>
|
||||
</div>
|
||||
<SidebarProgressInline
|
||||
v-if="progressModeForTask(task) !== 'hidden' && projectionForTask(task)"
|
||||
v-if="!workbenchMode && progressModeForTask(task) !== 'hidden' && projectionForTask(task)"
|
||||
class="mt-1.5 border-t border-current/10 pt-1.5"
|
||||
:projection="projectionForTask(task)!"
|
||||
:compact="progressModeForTask(task) === 'compact'"
|
||||
@@ -516,7 +671,7 @@ function intakeStageLabel(item: ShippingProcessingProjection): string {
|
||||
data-testid="shipping-processing-task-actions"
|
||||
>
|
||||
<button
|
||||
v-if="!projectionForTask(task) && primaryActionItem(task)"
|
||||
v-if="(!workbenchMode && !projectionForTask(task)) && primaryActionItem(task)"
|
||||
type="button"
|
||||
class="rounded-md border border-brand-300 bg-brand-600 px-2.5 py-1 text-[11px] font-medium text-white hover:bg-brand-700 dark:border-brand-700 dark:bg-brand-700 dark:hover:bg-brand-600"
|
||||
:data-testid="`shipping-processing-action-${primaryActionItem(task)!.actionCode}`"
|
||||
@@ -535,7 +690,7 @@ function intakeStageLabel(item: ShippingProcessingProjection): string {
|
||||
data-testid="shipping-processing-group-waiting_human"
|
||||
>
|
||||
<div class="mb-1.5 text-[11px] font-semibold uppercase tracking-wide text-amber-700 dark:text-amber-300">
|
||||
{{ t('chat.shippingProcessing.groupWaitingHuman', { count: waitingHumanTasks.length }) }}
|
||||
{{ t('chat.shippingProcessing.batchWorkbench.groups.waitingHuman', { count: groupFileCount(waitingHumanTasks) }) }}
|
||||
</div>
|
||||
<div class="space-y-2">
|
||||
<article
|
||||
@@ -546,23 +701,38 @@ function intakeStageLabel(item: ShippingProcessingProjection): string {
|
||||
:data-focused="focusedTaskNo === task.user_task_no ? '1' : '0'"
|
||||
>
|
||||
<button type="button" class="w-full text-left" @click="onSelectTask(task)">
|
||||
<div class="text-sm font-semibold text-primary">{{ resolveShippingProcessingMessage('taskTitle', te, t, { label: taskLabel(task) }) }}</div>
|
||||
<div class="mt-0.5 flex flex-wrap gap-x-2 gap-y-0.5 text-[11px] text-secondary">
|
||||
<div class="text-sm font-semibold text-primary">{{ workbenchMode ? groupTitle(task) : resolveShippingProcessingMessage('taskTitle', te, t, { label: taskLabel(task) }) }}</div>
|
||||
<div v-if="!workbenchMode" class="mt-0.5 flex flex-wrap gap-x-2 gap-y-0.5 text-[11px] text-secondary">
|
||||
<span v-if="fileCountLabel(task)">{{ fileCountLabel(task) }}</span>
|
||||
<span>{{ statusLabel(task) }}</span>
|
||||
<span v-if="stageLabel(task)">· {{ stageLabel(task) }}</span>
|
||||
</div>
|
||||
<div v-if="taskReasonLabel(task)" class="mt-1 text-[11px] text-rose-600 dark:text-rose-300">{{ taskReasonLabel(task) }}</div>
|
||||
<div v-if="aggregateStatusLabel(task)" class="mt-1 text-[11px] text-secondary">{{ aggregateStatusLabel(task) }}</div>
|
||||
</button>
|
||||
<div v-if="currentNeedLabel(task)" class="mt-1 text-[11px] text-secondary">{{ t('chat.shippingProcessing.progress.currentNeedLabel') }}{{ currentNeedLabel(task) }}</div>
|
||||
<div v-if="workbenchMode" class="mt-3 space-y-2 border-t border-amber-200/70 pt-2">
|
||||
<div v-for="file in workbenchFileRows(task)" :key="file.object_key" class="flex items-center gap-3 rounded-md bg-white/70 px-2 py-2 dark:bg-slate-950/30">
|
||||
<div class="min-w-0 flex-1">
|
||||
<div class="truncate text-xs font-medium text-primary">{{ file.filename || file.label }}</div>
|
||||
<div v-if="workbenchFileReason(file, task)" class="mt-0.5 truncate text-[11px] text-rose-600 dark:text-rose-300">{{ workbenchFileReason(file, task) }}</div>
|
||||
</div>
|
||||
<span class="shrink-0 rounded-full bg-amber-100 px-2 py-0.5 text-[11px] font-medium text-amber-800">{{ workbenchFileStatus(file, task) || t('chat.shippingProcessing.batchWorkbench.groups.waitingFallback') }}</span>
|
||||
<button v-if="filePrimaryActionItem(file)" type="button" class="shrink-0 rounded-md bg-brand-600 px-2.5 py-1 text-[11px] font-medium text-white hover:bg-brand-700" @click="onFileProjectionAction(file)">{{ presentationActionLabel(task, filePrimaryActionItem(file)!) }}</button>
|
||||
</div>
|
||||
</div>
|
||||
<SidebarProgressInline
|
||||
v-if="projectionForTask(task)"
|
||||
v-if="!workbenchMode && projectionForTask(task)"
|
||||
class="mt-1.5 border-t border-current/10 pt-1.5"
|
||||
:projection="projectionForTask(task)!"
|
||||
:compact="false"
|
||||
@action="(item) => emit('projectionAction', { projection: projectionForTask(task)!, item })"
|
||||
/>
|
||||
<button
|
||||
v-if="!workbenchMode && primaryActionItem(task)"
|
||||
type="button"
|
||||
class="mt-2 rounded-md bg-brand-600 px-2.5 py-1.5 text-[11px] font-medium text-white hover:bg-brand-700"
|
||||
@click="onTaskAction(task, primaryActionItem(task)!.actionCode)"
|
||||
>
|
||||
{{ presentationActionLabel(task, primaryActionItem(task)!) }}
|
||||
</button>
|
||||
</article>
|
||||
</div>
|
||||
</section>
|
||||
@@ -572,7 +742,7 @@ function intakeStageLabel(item: ShippingProcessingProjection): string {
|
||||
data-testid="shipping-processing-group-processing"
|
||||
>
|
||||
<div class="mb-1.5 text-[11px] font-semibold uppercase tracking-wide text-sky-700 dark:text-sky-300">
|
||||
{{ resolveShippingProcessingMessage('groupProcessing', te, t, { count: processingTasks.length }) }}
|
||||
{{ t('chat.shippingProcessing.batchWorkbench.groups.processing', { count: groupFileCount(processingTasks) }) }}
|
||||
</div>
|
||||
<div class="space-y-2">
|
||||
<article
|
||||
@@ -591,14 +761,13 @@ function intakeStageLabel(item: ShippingProcessingProjection): string {
|
||||
@click="onSelectTask(task)"
|
||||
>
|
||||
<div class="text-sm font-semibold text-primary">
|
||||
{{ resolveShippingProcessingMessage('taskTitle', te, t, { label: taskLabel(task) }) }}
|
||||
{{ workbenchMode ? groupTitle(task) : resolveShippingProcessingMessage('taskTitle', te, t, { label: taskLabel(task) }) }}
|
||||
</div>
|
||||
<div class="mt-0.5 flex flex-wrap gap-x-2 gap-y-0.5 text-[11px] text-secondary">
|
||||
<div v-if="!workbenchMode" class="mt-0.5 flex flex-wrap gap-x-2 gap-y-0.5 text-[11px] text-secondary">
|
||||
<span v-if="fileCountLabel(task)">{{ fileCountLabel(task) }}</span>
|
||||
<span>{{ statusLabel(task) }}</span>
|
||||
</div>
|
||||
<div
|
||||
v-if="primaryFileLabel(task)"
|
||||
v-if="!workbenchMode && primaryFileLabel(task)"
|
||||
class="mt-0.5 truncate text-[11px] text-muted"
|
||||
data-testid="shipping-processing-task-primary-file"
|
||||
>
|
||||
@@ -620,8 +789,15 @@ function intakeStageLabel(item: ShippingProcessingProjection): string {
|
||||
{{ resolveShippingProcessingMessage('justCreated', te, t) }}
|
||||
</div>
|
||||
</button>
|
||||
<div v-if="workbenchMode" class="mt-3 space-y-2 border-t border-sky-200/70 pt-2">
|
||||
<div v-for="file in workbenchFileRows(task)" :key="file.object_key" class="flex items-center gap-3 rounded-md bg-surface-muted/40 px-2 py-2">
|
||||
<div class="min-w-0 flex-1"><div class="truncate text-xs font-medium text-primary">{{ file.filename || file.label }}</div><div class="mt-0.5 text-[11px] text-secondary">{{ workbenchFileStage(file, task) || t('chat.shippingProcessing.batchWorkbench.fileProcessing') }}</div></div>
|
||||
<span class="shrink-0 rounded-full bg-sky-100 px-2 py-0.5 text-[11px] font-medium text-sky-700">{{ workbenchFileStatus(file, task) || t('chat.shippingProcessing.batchWorkbench.groups.processingFallback') }}</span>
|
||||
<button v-if="filePrimaryActionItem(file)" type="button" class="shrink-0 rounded-md border border-brand-300 px-2.5 py-1 text-[11px] font-medium text-brand-700 hover:bg-brand-50" @click="onFileProjectionAction(file)">{{ presentationActionLabel(task, filePrimaryActionItem(file)!) }}</button>
|
||||
</div>
|
||||
</div>
|
||||
<SidebarProgressInline
|
||||
v-if="progressModeForTask(task) !== 'hidden' && projectionForTask(task)"
|
||||
v-if="!workbenchMode && progressModeForTask(task) !== 'hidden' && projectionForTask(task)"
|
||||
class="mt-1.5 border-t border-current/10 pt-1.5"
|
||||
:projection="projectionForTask(task)!"
|
||||
:compact="progressModeForTask(task) === 'compact'"
|
||||
@@ -633,7 +809,7 @@ function intakeStageLabel(item: ShippingProcessingProjection): string {
|
||||
data-testid="shipping-processing-task-actions"
|
||||
>
|
||||
<button
|
||||
v-if="!projectionForTask(task) && primaryActionItem(task)"
|
||||
v-if="!workbenchMode && !projectionForTask(task) && primaryActionItem(task)"
|
||||
type="button"
|
||||
class="rounded-md border border-brand-300 bg-brand-600 px-2.5 py-1 text-[11px] font-medium text-white hover:bg-brand-700 dark:border-brand-700 dark:bg-brand-700 dark:hover:bg-brand-600"
|
||||
:data-testid="`shipping-processing-action-${primaryActionItem(task)!.actionCode}`"
|
||||
|
||||
Reference in new issue
Block a user