feat: 合同付款预警迁移到agent页面

This commit is contained in:
sophie committed 2026-09-16 09:36:18 +08:00
1 parent ef6bc42c20
commit 4ce2defef0
49 files changed
+1052 -423

No files matched your search

@@ -1,6 +1,6 @@
/**
* features/chat/components/ChatMobileHeader.vue
* 移动端顶栏:Agent 名称、学习之窗与 Agent 切换弹层。
* 移动端顶栏:Agent 名称、学习之窗与 Agent 切换弹层。合同付款预警可隐藏历史入口。
*/
<script setup lang="ts">
import { onBeforeUnmount, onMounted, ref } from 'vue';
@@ -15,6 +15,7 @@ defineProps<{
activeAgentId: number;
hasAgentGuides: boolean;
userAgents: ChatMobileHeaderAgent[];
hideHistory?: boolean;
}>();
const emit = defineEmits<{
@@ -85,6 +86,7 @@ onBeforeUnmount(() => {
<LayoutGrid class="h-5 w-5" />
</button>
<button
v-if="!hideHistory"
type="button"
class="flex h-9 w-9 items-center justify-center rounded-full text-muted transition-colors hover-surface-soft"
:title="$t('chat.history')"
@@ -4,7 +4,7 @@
* 依赖:lucide-vue-next、LocaleToggleButton、ExternalSystemLinks、AgentCategoryList、chat.types。
* 逻辑:由聊天页面传入当前 Agent、历史记录与用户可用 Agent;通过事件把新会话、切换 Agent、反馈、进入管理控制台等操作回传给页面。
* 管理员通过底部右侧工具图标进入管理控制台;用户下拉菜单仅保留退出登录。
* 关联服务入口与主题/语言等底栏图标统一为同尺寸 inline icon 按钮,避免错位。
* 合同付款预警第一期不走对话,hideSessionUi 时隐藏新会话与历史列表。
*/
<script setup lang="ts">
import { computed, onBeforeUnmount, onMounted, ref } from 'vue';
@@ -48,6 +48,7 @@ const props = defineProps<{
userAgents: ChatSidebarAgent[];
currentUser: Record<string, unknown> | null;
appliedTheme: string;
hideSessionUi?: boolean;
}>();
const emit = defineEmits<{
@@ -198,13 +199,16 @@ const orderExtractionAttentionClass = (item: DisplayHistoryItem) => {
</button>
</div>
<div class="px-4 pb-4">
<div v-if="!hideSessionUi" class="px-4 pb-4">
<button type="button" class="chat-sidebar-btn" @click="onNewChat">
<Plus class="h-4 w-4" /> {{ $t('chat.createNewChat') }}
</button>
</div>
<p v-else class="px-4 pb-3 text-xs leading-5 text-muted">
{{ $t('admin.contractPayment.sessionHint') }}
</p>
<div class="flex items-center justify-between px-4 py-2">
<div v-if="!hideSessionUi" class="flex items-center justify-between px-4 py-2">
<span class="text-xs font-semibold text-muted">{{ $t('chat.history') }}</span>
<button
v-if="displayHistory.length > 0"
@@ -216,7 +220,7 @@ const orderExtractionAttentionClass = (item: DisplayHistoryItem) => {
</button>
</div>
<div class="scrollbar-thin flex-1 overflow-y-auto px-2">
<div v-if="!hideSessionUi" class="scrollbar-thin flex-1 overflow-y-auto px-2">
<div v-if="displayHistory.length === 0" class="py-8 text-center text-sm italic text-muted">
{{ $t('chat.noHistory') }}
</div>
@@ -4,11 +4,11 @@
* 用途:对话页主区域,组合侧栏、消息列表、输入栏、货代会话 Workflow 时间线与内置浏览器。
* 依赖:ChatSidebar、ChatMessageList、ChatInputBar、ShippingWorkflowTimeline、chat.context。
* 依赖:ChatSidebar、ChatMessageList、ChatInputBar、ShippingWorkflowTimeline、ContractPaymentChatPanel、chat.context。
* 逻辑:本文件只做页面结构编排;货代 Chat 仅上传/进度通知,履约写操作不在本页;
* 右侧「本次处理」由 conversationId 驱动 Workflow projection,extractionRunNo 仅作进度装饰;
* 订单复核工作台异步分包,避免普通对话首屏拉取 PDF.js。
* 订单复核工作台异步分包,避免普通对话首屏拉取 PDF.js;合同付款预警 Agent 用 Tab 台账替换消息列表与输入框。
*/
@@ -44,7 +44,7 @@ import { useChatPageContext } from '@/features/chat/composables/chat.context';
import { matchesTrainingAgent } from '@/features/chat/training/trainingWorkspace.utils';
import { agentHasIntentUiProfile, resolveAgentCode, AGENT_CODE_IN_TRANSIT_TRANSFER } from '@/shared/utils/agent-registry.utils';
import { agentHasIntentUiProfile, resolveAgentCode, AGENT_CODE_IN_TRANSIT_TRANSFER, isContractPaymentAgent } from '@/shared/utils/agent-registry.utils';
import {
SHIPPING_WORKFLOW_KEY,
@@ -70,6 +70,10 @@ const ShippingOrderReviewView = defineAsyncComponent(
() => import('@/features/chat/views/ShippingOrderReviewView.vue'),
);
const ContractPaymentChatPanel = defineAsyncComponent(
() => import('@/features/contract-payment/components/ContractPaymentChatPanel.vue'),
);
type MaintenanceRecordPanelCommand = {
mode: 'list' | 'create';
@@ -114,6 +118,9 @@ const isMaintenanceAgentPage = computed(() => agentHasIntentUiProfile(page.curre
/** 在途仓自动调拨 Agent:无消息时展示专属首页入口区(决策:补 Chat 首页入口 A 方案)。 */
const isInTransitTransferAgent = computed(() => resolveAgentCode(page.currentAgent) === AGENT_CODE_IN_TRANSIT_TRANSFER);
/** 合同付款预警 Agent:主区嵌台账 Tab,隐藏对话输入与历史。 */
const isContractPaymentAgentPage = computed(() => isContractPaymentAgent(page.currentAgent));
/** 在途仓自动调拨业务流激活(来源选择/待处理等子视图)时隐藏聊天输入框,模拟业务页。 */
const transferFlowActive = ref(false);
watch(isInTransitTransferAgent, (isTransfer) => { if (!isTransfer) transferFlowActive.value = false; });
@@ -391,6 +398,8 @@ watch(() => page.currentAgentId, () => {
:applied-theme="page.appliedTheme"
:hide-session-ui="isContractPaymentAgentPage"
@new-chat="page.handleSidebarNewChat"
@open-guide="page.openGuideModal"
@@ -431,6 +440,8 @@ watch(() => page.currentAgentId, () => {
:user-agents="page.userAgents"
:hide-history="isContractPaymentAgentPage"
@open-guide="page.openGuideModal"
@go-history="page.goToWorkspace('history')"
@@ -473,6 +484,8 @@ watch(() => page.currentAgentId, () => {
<ShippingOrderReviewView v-if="isOrderReviewMode" />
<ContractPaymentChatPanel v-else-if="isContractPaymentAgentPage" />
<div v-else class="flex min-h-0 min-w-0 flex-1" :class="showShippingWorkflowTimeline ? 'shipping-workbench-layout' : ''">
<div class="flex min-h-0 min-w-0 flex-1 flex-col" :class="showShippingWorkflowTimeline ? 'shipping-chat-column' : ''">