feat(shipping-notice): 落地字段资产治理与唯一 Schema,自动建单随版本冻结
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
b7307fc573
commit
3a1dbf7ce5
144 files changed
+15167
-4480
No files matched your search
@@ -1,400 +1,829 @@
|
||||
/**
|
||||
|
||||
* features/chat/components/ChatViewContent.vue
|
||||
* 用途:对话页主区域,组合侧栏、发货批次进度区、消息列表、输入栏与内置浏览器。
|
||||
* 依赖:ChatSidebar、ChatMessageList、ChatInputBar、ShippingBatchProgressPanel、ShippingBatchWorkspaceDrawer、chat.context。
|
||||
* 逻辑:本文件只做页面结构编排;发货批次进度样式与任务续办交互下沉到独立面板组件。
|
||||
|
||||
* 用途:对话页主区域,组合侧栏、消息列表、输入栏、货代会话任务摘要与内置浏览器。
|
||||
|
||||
* 依赖:ChatSidebar、ChatMessageList、ChatInputBar、ShippingSessionSummaryPanel、chat.context。
|
||||
|
||||
* 逻辑:本文件只做页面结构编排;货代 Chat 仅上传/进度通知,履约写操作不在本页;右侧摘要只读展示后端 ui_state/summary。
|
||||
|
||||
*/
|
||||
|
||||
<script setup lang="ts">
|
||||
|
||||
import { computed, ref, watch } from 'vue';
|
||||
|
||||
import { useRoute } from 'vue-router';
|
||||
|
||||
import { Maximize2, Minimize2, Loader2 } 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 ShippingBatchProgressPanel from '@/features/chat/components/ShippingBatchProgressPanel.vue';
|
||||
import ShippingBatchWorkspaceDrawer from '@/features/chat/components/ShippingBatchWorkspaceDrawer.vue';
|
||||
|
||||
import ShippingSessionSummaryPanel from '@/features/chat/components/ShippingSessionSummaryPanel.vue';
|
||||
|
||||
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 ShippingOrderReviewView from '@/features/chat/views/ShippingOrderReviewView.vue';
|
||||
|
||||
import { useChatPageContext } from '@/features/chat/composables/chat.context';
|
||||
|
||||
import { matchesTrainingAgent } from '@/features/chat/training/trainingWorkspace.utils';
|
||||
|
||||
import { agentHasIntentUiProfile } from '@/shared/utils/agent-registry.utils';
|
||||
|
||||
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';
|
||||
|
||||
|
||||
|
||||
type MaintenanceRecordPanelCommand = {
|
||||
|
||||
mode: 'list' | 'create';
|
||||
|
||||
device: MaintenanceDevice;
|
||||
|
||||
nonce: number;
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
const page = useChatPageContext();
|
||||
|
||||
const route = useRoute();
|
||||
|
||||
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'));
|
||||
const embeddedIframeSrc = computed(() => {
|
||||
const agent = page.currentAgent;
|
||||
if (!agent) return undefined;
|
||||
const url = agent.iframe_url;
|
||||
return url ? String(url) : undefined;
|
||||
});
|
||||
const canManageMaintenance = computed(() => ['admin', 'maintenance_manager'].includes(String(page.currentUser?.role || '')));
|
||||
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%' };
|
||||
|
||||
const activeExtractionRunNo = computed(() => {
|
||||
|
||||
// [STEP 1] 优先从消息流中的抽取状态卡取 run_no(终态后仍在消息里)。
|
||||
// page 经 reactive provide 后 messages 已解包为数组,禁止再读 .value。
|
||||
const messages = Array.isArray(page.messages) ? page.messages : [];
|
||||
|
||||
for (let i = messages.length - 1; i >= 0; i -= 1) {
|
||||
|
||||
const item = messages[i];
|
||||
|
||||
if (!item || item.role !== 'assistant') continue;
|
||||
|
||||
const payload = item.payload && typeof item.payload === 'object' ? item.payload : null;
|
||||
|
||||
const fromPayload = payload && typeof (payload as { order_extraction_run_no?: unknown }).order_extraction_run_no === 'string'
|
||||
|
||||
? String((payload as { order_extraction_run_no: string }).order_extraction_run_no).trim()
|
||||
|
||||
: '';
|
||||
|
||||
if (fromPayload) return fromPayload;
|
||||
|
||||
if (item.shipping_order_extraction_state) {
|
||||
|
||||
const fromGetter = String(page.getActiveOrderExtractionRunNo?.() || '').trim();
|
||||
|
||||
if (fromGetter) return fromGetter;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
return buildMaintenancePanelWidthStyle(maintenancePanelWidth.value);
|
||||
|
||||
// [STEP 2] 回退活动 Run(轮询中)与路由深链。
|
||||
|
||||
try {
|
||||
|
||||
const fromActive = String(page.getActiveOrderExtractionRunNo?.() || '').trim();
|
||||
|
||||
if (fromActive) return fromActive;
|
||||
|
||||
} catch {
|
||||
|
||||
/* ignore */
|
||||
|
||||
}
|
||||
|
||||
const fromQuery = typeof route.query.run_no === 'string' ? route.query.run_no.trim() : '';
|
||||
|
||||
return fromQuery;
|
||||
|
||||
});
|
||||
|
||||
|
||||
|
||||
const showShippingSessionSummary = computed(() => (
|
||||
|
||||
page.isShippingNoticeAgent
|
||||
|
||||
&& Boolean(
|
||||
|
||||
page.shippingBatchSummary
|
||||
|
||||
|| page.shippingConversationWorkspace?.batches?.length
|
||||
|
||||
|| activeExtractionRunNo.value
|
||||
|
||||
)
|
||||
|
||||
));
|
||||
|
||||
const embeddedIframeSrc = computed(() => {
|
||||
|
||||
const agent = page.currentAgent;
|
||||
|
||||
if (!agent) return undefined;
|
||||
|
||||
const url = agent.iframe_url;
|
||||
|
||||
return url ? String(url) : undefined;
|
||||
|
||||
});
|
||||
|
||||
const canManageMaintenance = computed(() => ['admin', 'maintenance_manager'].includes(String(page.currentUser?.role || '')));
|
||||
|
||||
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 - 浼氳瘽缁撴灉涓懡涓殑璁惧銆?
|
||||
|
||||
* 打开右侧维修记录列表,并按当前设备编号筛选历史记录。
|
||||
|
||||
* @param device - 会话结果中命中的设备。
|
||||
|
||||
*/
|
||||
|
||||
const openMaintenanceRecordHistory = (device: MaintenanceDevice): void => {
|
||||
|
||||
maintenanceEditRecord.value = null;
|
||||
|
||||
maintenanceRecordPanelCommand.value = { mode: 'list', device, nonce: Date.now() };
|
||||
|
||||
maintenancePanel.value = 'record';
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 鎵撳紑鍙充晶缁翠慨璁板綍鏂板琛ㄥ崟锛屽苟棰勫~褰撳墠璁惧缂栧彿銆?
|
||||
* @param device - 浼氳瘽缁撴灉涓懡涓殑璁惧銆?
|
||||
|
||||
* 打开右侧维修记录新增表单,并预填当前设备编号。
|
||||
|
||||
* @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"
|
||||
|
||||
@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"
|
||||
|
||||
@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" />
|
||||
|
||||
<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">
|
||||
|
||||
<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"
|
||||
|
||||
/>
|
||||
|
||||
<ShippingBatchProgressPanel
|
||||
v-if="page.showShippingProgressWorkspace && (page.shippingBatchSummary || page.activeShippingTaskDetail)"
|
||||
:conversation-workspace="page.shippingConversationWorkspace"
|
||||
:active-batch-no="page.activeShippingBatchNo"
|
||||
:batch-summary="page.shippingBatchSummary"
|
||||
:batch-tasks="page.shippingBatchTasks"
|
||||
:active-task-detail="page.activeShippingTaskDetail"
|
||||
:workspace-open="page.shippingWorkspaceOpen"
|
||||
@switch-batch="page.switchShippingBatch"
|
||||
@toggle-workspace="page.shippingWorkspaceOpen = !page.shippingWorkspaceOpen"
|
||||
/>
|
||||
|
||||
|
||||
<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"
|
||||
|
||||
: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"
|
||||
|
||||
/>
|
||||
|
||||
|
||||
|
||||
<ChatInputBar
|
||||
|
||||
v-show="!isTrainingWorkspaceExpanded"
|
||||
|
||||
:key="`${page.currentAgentId}-${page.conversationId || 'draft'}-${page.messages.length}`"
|
||||
|
||||
v-model="page.input"
|
||||
|
||||
v-model:selected-kb="page.selectedKb"
|
||||
|
||||
: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"
|
||||
|
||||
:can-send-message="page.canSendMessage"
|
||||
|
||||
:is-shipping-notice-agent="page.isShippingNoticeAgent"
|
||||
|
||||
:is-maintenance-agent="isMaintenanceAgentPage"
|
||||
|
||||
:can-manage-maintenance="canManageMaintenance"
|
||||
|
||||
:can-force-create-shipping-duplicate="page.canForceCreateShippingDuplicate"
|
||||
|
||||
:shipping-suggested-prompt="page.shippingSuggestedPrompt"
|
||||
:shipping-focus-task-no="page.focusedShippingTaskNo"
|
||||
:shipping-focus-reason="page.shippingFocusReason"
|
||||
|
||||
: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.handleShippingInventorySelected"
|
||||
|
||||
@use-shipping-suggested-prompt="page.useShippingSuggestedPrompt"
|
||||
|
||||
@maintenance-ledger-config="maintenancePanel = 'ledger'"
|
||||
|
||||
@maintenance-create-record="openBlankMaintenanceRecordCreate"
|
||||
@clear-shipping-focus="page.clearShippingFocus"
|
||||
|
||||
/>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<ShippingSessionSummaryPanel
|
||||
|
||||
v-if="showShippingSessionSummary"
|
||||
|
||||
:conversation-workspace="page.shippingConversationWorkspace"
|
||||
|
||||
:active-batch-no="page.activeShippingBatchNo"
|
||||
|
||||
:batch-summary="page.shippingBatchSummary"
|
||||
|
||||
:batch-tasks="page.shippingBatchTasks"
|
||||
|
||||
:active-task-detail="page.activeShippingTaskDetail"
|
||||
|
||||
:extraction-run-no="activeExtractionRunNo"
|
||||
|
||||
/>
|
||||
|
||||
|
||||
|
||||
<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"
|
||||
|
||||
/>
|
||||
|
||||
<ShippingBatchWorkspaceDrawer
|
||||
v-if="page.showShippingProgressWorkspace && (page.shippingConversationWorkspace || page.shippingBatchSummary)"
|
||||
v-model:open="page.shippingWorkspaceOpen"
|
||||
:conversation-workspace="page.shippingConversationWorkspace"
|
||||
:active-batch-no="page.activeShippingBatchNo"
|
||||
:focused-task-no="page.focusedShippingTaskNo"
|
||||
:batch-summary="page.shippingBatchSummary"
|
||||
:batch-tasks="page.shippingBatchTasks"
|
||||
:active-task-detail="page.activeShippingTaskDetail"
|
||||
:retrying-pending="page.retryingShippingPendingTasks"
|
||||
:action-busy="page.shippingActionBusy"
|
||||
@switch-batch="page.switchShippingBatch"
|
||||
@focus-task="page.switchShippingFocusTask"
|
||||
@workspace-action="page.handleShippingWorkspaceAction"
|
||||
@query-shortage="page.queryShippingShortageDetails"
|
||||
@retry-pending="page.openRetryFailedConfirm"
|
||||
/>
|
||||
</div>
|
||||
|
||||
</template>
|
||||
|
||||
</ChatShell>
|
||||
|
||||
</template>
|
||||
|
||||
|
||||
Reference in new issue
Block a user