849 lines
24 KiB
Vue
849 lines
24 KiB
Vue
/**
|
||
|
||
* features/chat/components/ChatViewContent.vue
|
||
|
||
* 用途:对话页主区域,组合侧栏、消息列表、输入栏、货代会话 Workflow 时间线与内置浏览器。
|
||
|
||
* 依赖:ChatSidebar、ChatMessageList、ChatInputBar、ShippingWorkflowTimeline、ContractPaymentChatPanel、EquipmentAcceptanceChatPanel、VoucherCheckChatPanel、chunkLoadRecovery、chat.context。
|
||
|
||
* 逻辑:本文件只做页面结构编排;货代 Chat 仅上传/进度通知,履约写操作不在本页;
|
||
* 货代会话主区域:有会话即全屏批次进度中心(常驻),无会话为欢迎页+输入框;会话标题取自侧栏历史并传给中心;
|
||
* 右侧「本次处理」由 conversationId 驱动 Workflow projection,extractionRunNo 仅作进度装饰;
|
||
* 订单复核工作台异步分包,避免普通对话首屏拉取 PDF.js;合同付款预警、设备验收预警、立账凭证 Agent 用作业面替换消息列表与输入框。
|
||
|
||
*/
|
||
|
||
<script setup lang="ts">
|
||
|
||
import { computed, provide, ref, watch } from 'vue';
|
||
|
||
import { useRoute } from 'vue-router';
|
||
|
||
import { useAuthStore } from '@/features/auth/stores/auth.store';
|
||
|
||
import { Maximize2 } from 'lucide-vue-next';
|
||
|
||
import ChatShell from '@/shared/layouts/ChatShell.vue';
|
||
|
||
import ChatSidebar from '@/features/chat/components/ChatSidebar.vue';
|
||
|
||
import ChatInputBar from '@/features/chat/components/ChatInputBar.vue';
|
||
|
||
import ChatMessageList from '@/features/chat/components/ChatMessageList.vue';
|
||
|
||
import ChatMobileHeader from '@/features/chat/components/ChatMobileHeader.vue';
|
||
|
||
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';
|
||
|
||
import MaintenanceRecordManagerPanel from '@/features/maintenance/components/MaintenanceRecordManagerPanel.vue';
|
||
|
||
import { useChatPageContext } from '@/features/chat/composables/chat.context';
|
||
|
||
import { matchesTrainingAgent } from '@/features/chat/training/trainingWorkspace.utils';
|
||
|
||
import { agentHasIntentUiProfile, resolveAgentCode, AGENT_CODE_IN_TRANSIT_TRANSFER, isContractPaymentAgent, isEquipmentAcceptanceAgent, isVoucherCheckAgent } from '@/shared/utils/agent-registry.utils';
|
||
|
||
import {
|
||
SHIPPING_WORKFLOW_KEY,
|
||
useShippingNoticeWorkflow,
|
||
} from '@/features/chat/shipping/useShippingNoticeWorkflow';
|
||
|
||
import type { MaintenanceDevice } from '@/features/maintenance/types/ledger.types';
|
||
|
||
import type { MaintenanceRecord } from '@/features/maintenance/types/record.types';
|
||
|
||
import {
|
||
|
||
MAINTENANCE_PANEL_DEFAULT_WIDTH,
|
||
|
||
buildMaintenancePanelWidthStyle,
|
||
|
||
clampMaintenancePanelWidth,
|
||
|
||
} from '@/features/maintenance/utils/maintenance-panel-layout.utils';
|
||
|
||
import { defineRecoverableAsyncComponent } from '@/shared/utils/chunkLoadRecovery';
|
||
|
||
/** 复核工作台按需分包:仅 order-review 模式加载,避免 Chat 首屏带上 PDF.js。 */
|
||
const ShippingOrderReviewView = defineRecoverableAsyncComponent(
|
||
() => import('@/features/chat/views/ShippingOrderReviewView.vue'),
|
||
);
|
||
|
||
const ContractPaymentChatPanel = defineRecoverableAsyncComponent(
|
||
() => import('@/features/contract-payment/components/ContractPaymentChatPanel.vue'),
|
||
);
|
||
|
||
const EquipmentAcceptanceChatPanel = defineRecoverableAsyncComponent(
|
||
() => import('@/features/equipment-acceptance/components/EquipmentAcceptanceChatPanel.vue'),
|
||
);
|
||
|
||
const VoucherCheckChatPanel = defineRecoverableAsyncComponent(
|
||
() => import('@/features/voucher-check/components/VoucherCheckChatPanel.vue'),
|
||
);
|
||
|
||
type MaintenanceRecordPanelCommand = {
|
||
|
||
mode: 'list' | 'create';
|
||
|
||
device: MaintenanceDevice;
|
||
|
||
nonce: number;
|
||
|
||
};
|
||
|
||
|
||
|
||
const page = useChatPageContext();
|
||
|
||
const route = useRoute();
|
||
|
||
const shippingProcessing = useShippingNoticeWorkflow({
|
||
// 历史会话首屏直接使用路由 ID,与聊天消息并行拉取统一进度。
|
||
// 路由切换先于 page 历史消息回填;必须先切换 Projection,禁止短暂复用旧会话卡片。
|
||
conversationId: () => String(route.query.conversation_id || page.conversationId || ''),
|
||
refreshTrigger: () => page.workflowRefreshTrigger,
|
||
});
|
||
provide(SHIPPING_WORKFLOW_KEY, shippingProcessing);
|
||
|
||
/**
|
||
* 当前货代工作台的会话身份。
|
||
*
|
||
* 核心逻辑:历史会话首帧时 page.conversationId 尚未由消息恢复链路回填,
|
||
* 但 route.query.conversation_id 已是用户明确打开的会话。所有批次中心
|
||
* 显隐、传参和会话切换边界必须使用同一个优先级,避免中心带空 ID 初始化。
|
||
*/
|
||
const activeShippingConversationId = computed(() => (
|
||
String(route.query.conversation_id || page.conversationId || '').trim()
|
||
));
|
||
|
||
const isOrderReviewMode = computed(() => route.query.mode === 'order-review' && typeof route.query.run_no === 'string' && route.query.run_no.length > 0);
|
||
|
||
const isTrainingAgentPage = computed(() => matchesTrainingAgent(page.currentAgent));
|
||
|
||
const isMaintenanceAgentPage = computed(() => agentHasIntentUiProfile(page.currentAgent, 'maintenance'));
|
||
|
||
/** 在途仓自动调拨 Agent:无消息时展示专属首页入口区(决策:补 Chat 首页入口 A 方案)。 */
|
||
const isInTransitTransferAgent = computed(() => resolveAgentCode(page.currentAgent) === AGENT_CODE_IN_TRANSIT_TRANSFER);
|
||
|
||
/** 合同付款预警 Agent:主区嵌台账 Tab,隐藏对话输入与历史。 */
|
||
const isContractPaymentAgentPage = computed(() => isContractPaymentAgent(page.currentAgent));
|
||
|
||
/** 设备验收预警 Agent:主区嵌停留列表,隐藏对话输入与历史。 */
|
||
const isEquipmentAcceptanceAgentPage = computed(() => isEquipmentAcceptanceAgent(page.currentAgent));
|
||
|
||
/** 立账凭证 Agent:主区嵌检核任务 / 企微发送记录 Tab,隐藏对话输入与历史。 */
|
||
const isVoucherCheckAgentPage = computed(() => isVoucherCheckAgent(page.currentAgent));
|
||
|
||
/** builtin 作业面 Agent 共用:隐藏新会话、历史列表与输入框。 */
|
||
const hideTaskChatSessionUi = computed(() => isContractPaymentAgentPage.value || isEquipmentAcceptanceAgentPage.value || isVoucherCheckAgentPage.value);
|
||
|
||
/** 在途仓自动调拨业务流激活(来源选择/待处理等子视图)时隐藏聊天输入框,模拟业务页。 */
|
||
const transferFlowActive = ref(false);
|
||
watch(isInTransitTransferAgent, (isTransfer) => { if (!isTransfer) transferFlowActive.value = false; });
|
||
|
||
/**
|
||
* 货代发货会话主区域规则(方案 A):
|
||
* 有会话 ID → 全屏批次进度中心(常驻不可关闭);无会话 → 欢迎页 + 输入框(唯一提交入口)。
|
||
*/
|
||
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(() => {
|
||
|
||
const agent = page.currentAgent;
|
||
|
||
if (!agent) return undefined;
|
||
|
||
const url = agent.iframe_url;
|
||
|
||
return url ? String(url) : undefined;
|
||
|
||
});
|
||
|
||
const authStore = useAuthStore();
|
||
|
||
/**
|
||
* 设备维保台账/维修写入口。
|
||
* 核心逻辑:读登录态 maintenance.ledger_write,不再认 role 字符串。
|
||
*/
|
||
const canManageMaintenance = computed(() => authStore.hasFeaturePermission('maintenance.ledger_write'));
|
||
|
||
const hideWelcomePanel = computed(() => false);
|
||
|
||
const hideWelcomeTitle = computed(() => isTrainingAgentPage.value);
|
||
|
||
const isTrainingWorkspaceExpanded = ref(false);
|
||
|
||
const maintenancePanel = ref<'ledger' | 'record' | null>(null);
|
||
|
||
const maintenanceEditRecord = ref<MaintenanceRecord | null>(null);
|
||
|
||
const maintenanceRecordPanelCommand = ref<MaintenanceRecordPanelCommand | null>(null);
|
||
|
||
const maintenancePanelWidth = ref(MAINTENANCE_PANEL_DEFAULT_WIDTH);
|
||
|
||
const isMaintenancePanelFullscreen = ref(false);
|
||
|
||
const isMaintenancePanelResizing = ref(false);
|
||
|
||
const maintenancePanelStyle = computed(() => {
|
||
|
||
if (isMaintenancePanelFullscreen.value) {
|
||
|
||
return { width: '100%', minWidth: '100%', maxWidth: '100%' };
|
||
|
||
}
|
||
|
||
return buildMaintenancePanelWidthStyle(maintenancePanelWidth.value);
|
||
|
||
});
|
||
|
||
|
||
|
||
/**
|
||
|
||
* 开始拖拽设备维保右侧面板左边缘,允许管理员按表格内容临时调宽。
|
||
|
||
* @param event - 鼠标按下事件。
|
||
|
||
*/
|
||
|
||
const startMaintenancePanelResize = (event: MouseEvent): void => {
|
||
|
||
if (isMaintenancePanelFullscreen.value) return;
|
||
|
||
event.preventDefault();
|
||
|
||
isMaintenancePanelResizing.value = true;
|
||
|
||
const startX = event.clientX;
|
||
|
||
const startWidth = maintenancePanelWidth.value;
|
||
|
||
const handleMove = (moveEvent: MouseEvent) => {
|
||
|
||
const nextWidth = startWidth + (startX - moveEvent.clientX);
|
||
|
||
maintenancePanelWidth.value = clampMaintenancePanelWidth(nextWidth, window.innerWidth);
|
||
|
||
};
|
||
|
||
const stopResize = () => {
|
||
|
||
isMaintenancePanelResizing.value = false;
|
||
|
||
window.removeEventListener('mousemove', handleMove);
|
||
|
||
window.removeEventListener('mouseup', stopResize);
|
||
|
||
};
|
||
|
||
window.addEventListener('mousemove', handleMove);
|
||
|
||
window.addEventListener('mouseup', stopResize);
|
||
|
||
};
|
||
|
||
|
||
|
||
/**
|
||
|
||
* 打开右侧维修记录面板并进入指定记录的编辑表单。
|
||
|
||
* @param record - 会话结果表格中选中的维修记录。
|
||
|
||
*/
|
||
|
||
const openMaintenanceRecordEdit = (record: MaintenanceRecord): void => {
|
||
|
||
maintenanceEditRecord.value = record;
|
||
|
||
maintenanceRecordPanelCommand.value = null;
|
||
|
||
maintenancePanel.value = 'record';
|
||
|
||
};
|
||
|
||
|
||
|
||
/**
|
||
|
||
* 打开右侧维修记录列表,并按当前设备编号筛选历史记录。
|
||
|
||
* @param device - 会话结果中命中的设备。
|
||
|
||
*/
|
||
|
||
const openMaintenanceRecordHistory = (device: MaintenanceDevice): void => {
|
||
|
||
maintenanceEditRecord.value = null;
|
||
|
||
maintenanceRecordPanelCommand.value = { mode: 'list', device, nonce: Date.now() };
|
||
|
||
maintenancePanel.value = 'record';
|
||
|
||
};
|
||
|
||
|
||
|
||
/**
|
||
|
||
* 打开右侧维修记录新增表单,并预填当前设备编号。
|
||
|
||
* @param device - 会话结果中命中的设备。
|
||
|
||
*/
|
||
|
||
const openMaintenanceRecordCreate = (device: MaintenanceDevice): void => {
|
||
|
||
maintenanceEditRecord.value = null;
|
||
|
||
maintenanceRecordPanelCommand.value = { mode: 'create', device, nonce: Date.now() };
|
||
|
||
maintenancePanel.value = 'record';
|
||
|
||
};
|
||
|
||
|
||
|
||
/**
|
||
|
||
* 打开空白维修记录新增表单(不预填设备)。
|
||
|
||
*/
|
||
|
||
const openBlankMaintenanceRecordCreate = (): void => {
|
||
|
||
maintenanceEditRecord.value = null;
|
||
|
||
maintenanceRecordPanelCommand.value = null;
|
||
|
||
maintenancePanel.value = 'record';
|
||
|
||
};
|
||
|
||
|
||
|
||
// 切换非培训 Agent 时,重置工作区展开状态;培训 Agent 的默认展开策略交给 TrainingWorkspacePanel 按角色决定。
|
||
|
||
watch(() => page.currentAgentId, () => {
|
||
|
||
if (!isTrainingAgentPage.value) {
|
||
|
||
isTrainingWorkspaceExpanded.value = false;
|
||
|
||
}
|
||
|
||
maintenancePanel.value = null;
|
||
|
||
isMaintenancePanelFullscreen.value = false;
|
||
|
||
});
|
||
|
||
</script>
|
||
|
||
|
||
|
||
<template>
|
||
|
||
<ChatShell>
|
||
|
||
<template #overlay>
|
||
|
||
<div
|
||
|
||
v-if="page.isSidebarOpen && !page.isMobile"
|
||
|
||
class="fixed inset-0 z-40 bg-overlay backdrop-blur-sm transition-opacity md:hidden"
|
||
|
||
@click="page.isSidebarOpen = false"
|
||
|
||
/>
|
||
|
||
</template>
|
||
|
||
|
||
|
||
<template #sidebar>
|
||
|
||
<ChatSidebar
|
||
|
||
v-if="!page.isMobile"
|
||
|
||
v-model:collapsed="page.sidebarCollapsed"
|
||
|
||
v-model:agent-panel-open="page.showAgentPanel"
|
||
|
||
:is-open="page.isSidebarOpen"
|
||
|
||
:current-agent="page.currentAgent"
|
||
|
||
:current-agent-id="page.currentAgentId"
|
||
|
||
:agent-description="page.agentDescription"
|
||
|
||
:has-agent-guides="page.agentGuides.length > 0"
|
||
|
||
:display-history="page.displayHistory"
|
||
|
||
:active-history-key="page.activeHistoryKey"
|
||
|
||
:user-agents="page.userAgents"
|
||
|
||
:current-user="page.currentUser"
|
||
|
||
:applied-theme="page.appliedTheme"
|
||
|
||
:hide-session-ui="hideTaskChatSessionUi"
|
||
|
||
@new-chat="page.handleSidebarNewChat"
|
||
|
||
@open-guide="page.openGuideModal"
|
||
|
||
@history-select="page.handleHistorySelect"
|
||
|
||
@clear-all-history="page.clearAllHistory"
|
||
|
||
@delete-history-item="page.deleteHistoryItem"
|
||
|
||
@switch-agent="page.switchToAgent"
|
||
|
||
@toggle-theme="page.toggleLightDark"
|
||
|
||
@open-feedback="page.showGeneralFeedbackDialog = true"
|
||
|
||
@go-workspace="page.goToWorkspace()"
|
||
|
||
|
||
@go-admin="page.goToAdmin"
|
||
|
||
@logout="page.handleLogout"
|
||
|
||
/>
|
||
|
||
</template>
|
||
|
||
|
||
|
||
<ChatMobileHeader
|
||
|
||
v-if="page.isMobile && page.currentAgent"
|
||
|
||
:agent-name="page.currentAgent?.name || 'AI'"
|
||
|
||
:active-agent-id="page.currentAgentId"
|
||
|
||
:has-agent-guides="page.agentGuides.length > 0"
|
||
|
||
:user-agents="page.userAgents"
|
||
|
||
:hide-history="hideTaskChatSessionUi"
|
||
|
||
@open-guide="page.openGuideModal"
|
||
|
||
@go-history="page.goToWorkspace('history')"
|
||
|
||
@open-agent-popover="page.loadUserAgents"
|
||
|
||
@switch-agent="page.switchToAgent"
|
||
|
||
/>
|
||
|
||
|
||
|
||
<div v-if="!page.currentAgent" class="flex flex-1 flex-col items-center justify-center space-y-4">
|
||
|
||
<Loader2 class="h-10 w-10 animate-spin text-brand-500" />
|
||
|
||
<p class="text-sm animate-pulse text-muted">{{ $t('chat.loadingAgent') }}</p>
|
||
|
||
</div>
|
||
|
||
|
||
|
||
<div v-else-if="page.currentAgent.runtime_provider === 'iframe' || page.currentAgent.conversation_mode === 'embedded'" class="relative h-full w-full flex-1">
|
||
|
||
<iframe
|
||
|
||
:src="embeddedIframeSrc"
|
||
|
||
class="h-full w-full border-0 bg-surface"
|
||
|
||
allow="microphone; camera; clipboard-read; clipboard-write"
|
||
|
||
/>
|
||
|
||
</div>
|
||
|
||
|
||
|
||
<template v-else>
|
||
|
||
<ShippingOrderReviewView v-if="isOrderReviewMode" />
|
||
|
||
<ContractPaymentChatPanel v-else-if="isContractPaymentAgentPage" />
|
||
|
||
<EquipmentAcceptanceChatPanel v-else-if="isEquipmentAcceptanceAgentPage" />
|
||
|
||
<VoucherCheckChatPanel v-else-if="isVoucherCheckAgentPage" />
|
||
|
||
<div v-else class="flex min-h-0 min-w-0 flex-1">
|
||
|
||
<!-- 中心展示时对话列整体隐藏(含输入框),新文件提交走新建对话(spec 方案 A 硬性决策)。 -->
|
||
<div v-show="!showShippingWorkflowTimeline" class="flex min-h-0 min-w-0 flex-1 flex-col">
|
||
|
||
<TrainingWorkspacePanel
|
||
|
||
:current-agent="page.currentAgent"
|
||
|
||
:current-user="page.currentUser"
|
||
|
||
:agent-guides="page.agentGuides"
|
||
|
||
:new-session-tick="page.viewId"
|
||
|
||
:training="page.training"
|
||
|
||
@open-guide="page.openGuideModal"
|
||
|
||
@update:expanded="isTrainingWorkspaceExpanded = $event"
|
||
|
||
/>
|
||
|
||
|
||
|
||
<ChatMessageList
|
||
|
||
v-show="!isTrainingWorkspaceExpanded"
|
||
|
||
:messages="page.messages"
|
||
|
||
:agent-name="page.currentAgent?.name || 'AI'"
|
||
|
||
:suggested-questions-style="page.suggestedQuestionsStyle"
|
||
|
||
:styled-sections="page.styledSuggestedQuestionSections"
|
||
|
||
:suggested-questions="page.agentSuggestedQuestions"
|
||
|
||
:show-thinking-bubble="page.shouldShowThinkingBubble"
|
||
|
||
:is-thinking="page.isThinking"
|
||
|
||
:show-chat-rating="page.showChatRating"
|
||
|
||
:copied-index="page.copiedIndex"
|
||
|
||
:is-shipping-notice-agent="page.isShippingNoticeAgent"
|
||
|
||
:handlers="page.messageBubbleHandlers"
|
||
|
||
:leave-handlers="page.leaveMessageHandlers"
|
||
|
||
:shipping-handlers="page.shippingMessageHandlers"
|
||
|
||
:training-handlers="page.trainingHandlers"
|
||
|
||
:should-render-message="page.shouldRenderMessage"
|
||
|
||
:should-show-tool-run-progress-after-message="page.shouldShowToolRunProgressAfterMessage"
|
||
|
||
:get-message-run-progress="page.getMessageRunProgress"
|
||
|
||
:get-message-run-progress-error="page.getMessageRunProgressError"
|
||
|
||
:is-message-run-progress-loading="page.isMessageRunProgressLoading"
|
||
|
||
:tool-run-progress="page.toolRunProgress"
|
||
|
||
:tool-run-progress-title="page.toolRunProgressTitle"
|
||
|
||
:show-scroll-to-bottom="page.showScrollToBottom"
|
||
|
||
:hide-welcome-panel="hideWelcomePanel"
|
||
|
||
:hide-welcome-title="hideWelcomeTitle"
|
||
|
||
:is-in-transit-transfer-agent="isInTransitTransferAgent"
|
||
|
||
:pin-messages-to-bottom="!isTrainingAgentPage"
|
||
|
||
:scroll-container-holder="page.scrollContainerHolder"
|
||
|
||
@copy="page.copyToClipboard($event.message, $event.index)"
|
||
|
||
@edit="page.input = $event"
|
||
|
||
@resend="page.handleSend($event)"
|
||
|
||
@regenerate="page.regenerate"
|
||
|
||
@open-feedback="page.handleOpenFeedback($event)"
|
||
|
||
@select-question="page.handleSend"
|
||
|
||
@scroll-to-bottom="page.scrollToBottom"
|
||
|
||
@maintenance-edit-record="openMaintenanceRecordEdit"
|
||
|
||
@maintenance-view-record-history="openMaintenanceRecordHistory"
|
||
|
||
@maintenance-create-record-for-device="openMaintenanceRecordCreate"
|
||
|
||
@transfer-flow-active="transferFlowActive = $event"
|
||
|
||
/>
|
||
|
||
|
||
|
||
<ChatInputBar
|
||
|
||
v-show="!isTrainingWorkspaceExpanded && !transferFlowActive"
|
||
|
||
:key="`${page.currentAgentId}-${page.conversationId || 'draft'}-${page.messages.length}`"
|
||
|
||
v-model="page.input"
|
||
v-model:selected-kb="page.selectedKb"
|
||
v-model:procurement-review-mode="page.procurementReviewMode"
|
||
:attachments="page.attachments"
|
||
|
||
:attachment-policy="page.attachmentPolicy"
|
||
:available-kb-options="page.availableKbOptions"
|
||
:kb-dropdown-disabled="page.kbDropdownDisabled"
|
||
:is-thinking="page.isThinking"
|
||
|
||
:is-voice-recording="page.isVoiceRecording"
|
||
|
||
:is-voice-transcribing="page.isVoiceTranscribing"
|
||
|
||
:is-uploading-attachments="page.isUploadingAttachments"
|
||
|
||
:is-order-extraction-submitting="page.isOrderExtractionSubmitting"
|
||
|
||
:can-send-message="page.canSendMessage"
|
||
|
||
:is-shipping-notice-agent="page.isShippingNoticeAgent"
|
||
:is-procurement-contract-agent="page.isProcurementContractAgent"
|
||
:procurement-original-contract-name="page.procurementOriginalContractName"
|
||
:is-maintenance-agent="isMaintenanceAgentPage"
|
||
|
||
:can-manage-maintenance="canManageMaintenance"
|
||
|
||
:can-force-create-shipping-duplicate="page.canForceCreateShippingDuplicate"
|
||
|
||
:shipping-suggested-prompt="page.shippingSuggestedPrompt"
|
||
|
||
:shipping-picker-ref-holder="page.shippingPickerRefHolder"
|
||
|
||
:shipping-notice-picker-ref-holder="page.shippingNoticePickerRefHolder"
|
||
:get-kb-label="page.getKbLabel"
|
||
@send="page.handleSend()"
|
||
|
||
@stop="page.stopActiveGeneration()"
|
||
|
||
@voice-click="page.handleVoiceFeatureClick"
|
||
|
||
@remove-attachment="page.removeAttachment"
|
||
|
||
@retry-attachment="page.retryAttachment"
|
||
|
||
@retry-shipping-notice-attachment="page.retryShippingNoticeAttachment"
|
||
|
||
@resolve-shipping-notice-duplicate="page.openShippingDuplicateDialog"
|
||
|
||
@select-shipping-candidate="page.setShippingCandidateSelected"
|
||
|
||
@resolve-shipping-candidate-duplicate="page.resolveShippingCandidateDuplicate"
|
||
|
||
@local-files-selected="page.handleLocalFilesSelected"
|
||
|
||
@add-remote-url="page.addRemoteUrlAttachment"
|
||
|
||
@shipping-inventory-selected="page.handleShippingOnhandSelected"
|
||
|
||
@use-shipping-suggested-prompt="page.useShippingSuggestedPrompt"
|
||
|
||
@maintenance-ledger-config="maintenancePanel = 'ledger'"
|
||
|
||
@maintenance-create-record="openBlankMaintenanceRecordCreate"
|
||
@clear-shipping-focus="page.clearShippingFocus"
|
||
@procurement-original-contract-selected="page.handleProcurementOriginalContractSelected"
|
||
@clear-procurement-original-contract="page.clearProcurementOriginalContract"
|
||
/>
|
||
|
||
</div>
|
||
|
||
|
||
|
||
<ShippingWorkflowTimeline
|
||
v-if="showShippingWorkflowTimeline"
|
||
:conversation-id="activeShippingConversationId"
|
||
:conversation-title="activeShippingConversationTitle"
|
||
:refresh-trigger="page.workflowRefreshTrigger"
|
||
:controller="shippingProcessing"
|
||
/>
|
||
|
||
|
||
|
||
<aside
|
||
|
||
v-if="isMaintenanceAgentPage && canManageMaintenance && maintenancePanel"
|
||
|
||
class="relative flex flex-col border-l border-default bg-surface shadow-[-8px_0_24px_rgba(15,23,42,0.06)]"
|
||
|
||
:class="[
|
||
|
||
isMaintenancePanelFullscreen ? 'absolute inset-y-0 right-0 z-30' : '',
|
||
|
||
isMaintenancePanelResizing ? 'select-none' : '',
|
||
|
||
]"
|
||
|
||
:style="maintenancePanelStyle"
|
||
|
||
>
|
||
|
||
<button
|
||
|
||
v-if="!isMaintenancePanelFullscreen"
|
||
|
||
type="button"
|
||
|
||
class="absolute inset-y-0 left-[-4px] z-10 w-2 cursor-col-resize bg-transparent hover:bg-brand-200/60"
|
||
|
||
:title="$t('maintenance.panel.resizeTitle')"
|
||
|
||
@mousedown="startMaintenancePanelResize"
|
||
|
||
/>
|
||
|
||
<div class="flex items-start justify-between gap-3 border-b border-default px-4 py-3">
|
||
|
||
<div>
|
||
|
||
<h2 class="text-base font-semibold text-primary">
|
||
|
||
{{ maintenancePanel === 'ledger' ? $t('maintenance.panel.ledgerTitle') : $t('maintenance.panel.recordTitle') }}
|
||
|
||
</h2>
|
||
|
||
<p class="mt-1 text-xs text-secondary">
|
||
|
||
{{ maintenancePanel === 'ledger' ? $t('maintenance.panel.ledgerSubtitle') : $t('maintenance.panel.recordSubtitle') }}
|
||
|
||
</p>
|
||
|
||
</div>
|
||
|
||
<div class="flex items-center gap-2">
|
||
|
||
<button
|
||
|
||
type="button"
|
||
|
||
class="inline-flex h-8 w-8 items-center justify-center rounded-lg border border-default text-secondary hover:bg-surface-soft"
|
||
|
||
:title="isMaintenancePanelFullscreen ? $t('maintenance.panel.exitFullscreen') : $t('maintenance.panel.fullscreen')"
|
||
|
||
@click="isMaintenancePanelFullscreen = !isMaintenancePanelFullscreen"
|
||
|
||
>
|
||
|
||
<Minimize2 v-if="isMaintenancePanelFullscreen" class="h-4 w-4" />
|
||
|
||
<Maximize2 v-else class="h-4 w-4" />
|
||
|
||
</button>
|
||
|
||
<button
|
||
|
||
type="button"
|
||
|
||
class="inline-flex h-8 w-8 items-center justify-center rounded-lg border border-default text-sm text-secondary hover:bg-surface-soft"
|
||
|
||
:title="$t('maintenance.panel.close')"
|
||
|
||
@click="maintenancePanel = null"
|
||
|
||
>
|
||
|
||
×
|
||
|
||
</button>
|
||
|
||
</div>
|
||
|
||
</div>
|
||
|
||
<div class="min-h-0 flex-1 overflow-auto p-4">
|
||
|
||
<LedgerConfigPanel v-if="maintenancePanel === 'ledger'" />
|
||
|
||
<MaintenanceRecordManagerPanel
|
||
|
||
v-else
|
||
|
||
:edit-record="maintenanceEditRecord"
|
||
|
||
:command="maintenanceRecordPanelCommand"
|
||
|
||
/>
|
||
|
||
</div>
|
||
|
||
</aside>
|
||
|
||
|
||
|
||
<ChatBrowserPanel
|
||
|
||
v-model:open="page.browserPanelOpen"
|
||
|
||
v-model:draft-url="page.browserDraftUrl"
|
||
|
||
:current-url="page.browserCurrentUrl"
|
||
|
||
:frame-key="page.browserFrameKey"
|
||
|
||
:panel-style="page.browserPanelStyle"
|
||
|
||
:is-resizing="page.isBrowserResizing"
|
||
|
||
@load="page.browser.loadPage"
|
||
|
||
@refresh="page.browser.refreshPage"
|
||
|
||
@open-new-tab="page.browser.openInNewTab"
|
||
|
||
@url-enter="page.browser.onUrlEnter"
|
||
|
||
@start-resize="page.browser.startResize"
|
||
|
||
@close="page.browser.close"
|
||
|
||
/>
|
||
|
||
</div>
|
||
|
||
</template>
|
||
|
||
</ChatShell>
|
||
|
||
</template>
|
||
|