Merge branch 'hugo-shipping-notice' into dev

# Conflicts:
#	frontend/src/features/chat/components/ChatViewContent.vue
This commit is contained in:
hugo committed 2026-09-17 16:29:10 +08:00
commit 80d78130f8
121 files changed
+9621 -1263

No files matched your search

@@ -8,7 +8,8 @@
* 逻辑:本文件只做页面结构编排;货代 Chat 仅上传/进度通知,履约写操作不在本页;
* 右侧「本次处理」由 conversationId 驱动 Workflow projection,extractionRunNo 仅作进度装饰;
* 订单复核工作台异步分包,避免普通对话首屏拉取 PDF.js;合同付款预警、立账凭证 Agent 用 Tab 作业面替换消息列表与输入框。
* 订单复核工作台异步分包,避免普通对话首屏拉取 PDF.js;合同付款预警、立账凭证 Agent 用 Tab 作业面替换消息列表与输入框;
* 货代会话主区域:有会话即全屏批次进度中心(常驻),无会话为欢迎页+输入框,会话标题取自侧栏历史并传给中心。
*/
@@ -34,6 +35,8 @@ import ChatBrowserPanel from '@/features/chat/components/ChatBrowserPanel.vue';
import ShippingWorkflowTimeline from '@/features/chat/components/shipping/ShippingWorkflowTimeline.vue';
import { shouldShowShippingWorkbench } from '@/features/chat/shipping/shippingWorkbenchLayout';
import TrainingWorkspacePanel from '@/features/chat/components/TrainingWorkspacePanel.vue';
import LedgerConfigPanel from '@/features/maintenance/components/LedgerConfigPanel.vue';
@@ -135,38 +138,19 @@ const hideTaskChatSessionUi = computed(() => isContractPaymentAgentPage.value ||
const transferFlowActive = ref(false);
watch(isInTransitTransferAgent, (isTransfer) => { if (!isTransfer) transferFlowActive.value = false; });
/** 批次进度工作台按需打开;关闭时不占用对话区右侧布局。 */
const batchWorkbenchOpen = ref(false);
const showShippingWorkflowTimeline = computed(() => (
page.isShippingNoticeAgent
&& batchWorkbenchOpen.value
&& Boolean(activeShippingConversationId.value)
));
const compactShippingProgress = computed(() => batchWorkbenchOpen.value);
function openBatchWorkbench() {
batchWorkbenchOpen.value = true;
}
function closeBatchWorkbench() {
batchWorkbenchOpen.value = false;
}
/**
* 批次中心只服务于用户主动打开时所在的会话。切换历史会话或 Agent 后必须关闭,
* 否则旧会话的右侧投影会短暂占用新会话的对话区并造成“本次处理”串批错觉。
* 货代发货会话主区域规则(方案 A):
* 有会话 ID → 全屏批次进度中心(常驻不可关闭);无会话 → 欢迎页 + 输入框(唯一提交入口)。
*/
watch(
() => [activeShippingConversationId.value, Number(page.currentAgentId || 0)] as const,
(next, previous) => {
if (!previous || next[0] === previous[0] && next[1] === previous[1]) return;
batchWorkbenchOpen.value = false;
},
);
const showShippingWorkflowTimeline = computed(() => shouldShowShippingWorkbench({
isShippingNoticeAgent: page.isShippingNoticeAgent,
conversationId: activeShippingConversationId.value,
}));
/** 侧栏历史项中的会话标题;批次中心头部直接复用,保持侧栏与中心一致。 */
const activeShippingConversationTitle = computed(() => (
page.displayHistory.find((item) => item.conversation_id === activeShippingConversationId.value)?.title || ''
));
const embeddedIframeSrc = computed(() => {
@@ -498,9 +482,10 @@ watch(() => page.currentAgentId, () => {
<VoucherCheckChatPanel v-else-if="isVoucherCheckAgentPage" />
<div v-else class="flex min-h-0 min-w-0 flex-1" :class="showShippingWorkflowTimeline ? 'shipping-workbench-layout' : ''">
<div v-else class="flex min-h-0 min-w-0 flex-1">
<div class="flex min-h-0 min-w-0 flex-1 flex-col" :class="showShippingWorkflowTimeline ? 'shipping-chat-column' : ''">
<!-- 中心展示时对话列整体隐藏(含输入框),新文件提交走新建对话(spec 方案 A 硬性决策)。 -->
<div v-show="!showShippingWorkflowTimeline" class="flex min-h-0 min-w-0 flex-1 flex-col">
<TrainingWorkspacePanel
@@ -580,8 +565,6 @@ watch(() => page.currentAgentId, () => {
:scroll-container-holder="page.scrollContainerHolder"
:compact-shipping-progress="compactShippingProgress"
@copy="page.copyToClipboard($event.message, $event.index)"
@edit="page.input = $event"
@@ -602,8 +585,6 @@ watch(() => page.currentAgentId, () => {
@maintenance-create-record-for-device="openMaintenanceRecordCreate"
@open-batch-workbench="openBatchWorkbench"
@transfer-flow-active="transferFlowActive = $event"
/>
@@ -692,10 +673,9 @@ watch(() => page.currentAgentId, () => {
<ShippingWorkflowTimeline
v-if="showShippingWorkflowTimeline"
:conversation-id="activeShippingConversationId"
:conversation-title="activeShippingConversationTitle"
:refresh-trigger="page.workflowRefreshTrigger"
:controller="shippingProcessing"
@close="closeBatchWorkbench"
/>
@@ -846,16 +826,3 @@ watch(() => page.currentAgentId, () => {
</template>
<style scoped>
/** 打开批次工作台后,左侧对话保留为压缩入口,右侧取得主工作区宽度。 */
@media (min-width: 1024px) {
.shipping-workbench-layout {
min-width: 0;
}
.shipping-chat-column {
flex: 0 0 clamp(360px, 32vw, 520px);
}
}
</style>