From 5dd8436cde8893b72cf969262610d77c434c1000 Mon Sep 17 00:00:00 2001 From: Simon Date: Sat, 18 Jul 2026 01:17:08 +0800 Subject: [PATCH] =?UTF-8?q?P2-1(=E9=83=A8=E5=88=86):=20=E5=88=A0=E9=99=A4?= =?UTF-8?q?=E5=AD=A4=E5=84=BF=E7=BB=84=E4=BB=B6=20InputBox.vue/MessageItem?= =?UTF-8?q?.vue=20+=20store=E6=AD=BB=E4=BB=A3=E7=A0=81=20showApprovalCard/?= =?UTF-8?q?closeApprovalCard/approvalCardVisible=EF=BC=88P0-3=E8=AF=AF?= =?UTF-8?q?=E6=8A=A5=E7=A1=AE=E8=AE=A4=EF=BC=8C=E7=BB=84=E4=BB=B6=E5=A4=87?= =?UTF-8?q?=E4=BB=BD=E4=BA=8E.workbuddy/tmp/orphan-backup=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend-h5/src/components/chat/InputBox.vue | 748 ------------------ .../src/components/chat/MessageItem.vue | 659 --------------- frontend-h5/src/stores/conversation.ts | 61 +- 3 files changed, 5 insertions(+), 1463 deletions(-) delete mode 100644 frontend-h5/src/components/chat/InputBox.vue delete mode 100644 frontend-h5/src/components/chat/MessageItem.vue diff --git a/frontend-h5/src/components/chat/InputBox.vue b/frontend-h5/src/components/chat/InputBox.vue deleted file mode 100644 index 36256a3..0000000 --- a/frontend-h5/src/components/chat/InputBox.vue +++ /dev/null @@ -1,748 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/frontend-h5/src/components/chat/MessageItem.vue b/frontend-h5/src/components/chat/MessageItem.vue deleted file mode 100644 index ed3502d..0000000 --- a/frontend-h5/src/components/chat/MessageItem.vue +++ /dev/null @@ -1,659 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/frontend-h5/src/stores/conversation.ts b/frontend-h5/src/stores/conversation.ts index eebf8e9..765b0b3 100644 --- a/frontend-h5/src/stores/conversation.ts +++ b/frontend-h5/src/stores/conversation.ts @@ -150,12 +150,6 @@ export const useConversationStore = defineStore('conversation', () => { /** 审批流程链接列表 */ const approvalLinks = ref([]) - /** 审批卡片弹窗是否显示(关键词触发) */ - const approvalCardVisible = ref(false) - - /** 触发审批卡片的关键词文本 */ - const approvalCardTriggerText = ref('') - /** 软件下载列表 */ const softwareDownloads = ref([]) @@ -898,52 +892,10 @@ export const useConversationStore = defineStore('conversation', () => { // 结果通过 WS dynamic_recommend 推送到侧边栏 DynamicRecommend 组件 // 前端不再独立调用 /approval/detect-intent 接口 - /** 关闭审批卡片弹窗(兼容旧调用,新流程中审批卡片为内联消息,无需关闭) */ - function closeApprovalCard(): void { - approvalCardVisible.value = false - approvalCardTriggerText.value = '' - } - - // v4.0 P0-3: 缓存全量审批卡片(首次点击拉取,后续复用) - let _allCategoriesCardCache: any = null - - /** - * 显示审批卡片(快捷按钮触发) - * v4.0 P0-3: 改为 async 拉取后端 /approval/all-categories-card, - * 修复旧版构造 {approval_type:'',confidence:0} 导致的空白气泡(F1) - * - * @param _triggerText 触发文本(可选,新流程中不再使用关键词匹配) - */ - async function showApprovalCard(_triggerText: string = ''): Promise { - // 首次拉取并缓存 - if (!_allCategoriesCardCache) { - try { - const { getAllCategoriesCard } = await import('@/api/conversation') - _allCategoriesCardCache = await getAllCategoriesCard() - } catch (e) { - console.error('[Store] 拉取全量审批卡片失败:', e) - return - } - } - - // 插入审批卡片消息(action.card_data 为后端标准化数据,前端纯渲染) - const approvalCardMessage: Message = { - message_id: `approval_card_${Date.now()}`, - conversation_id: currentConversation.value?.conversation_id || '', - message_type: 'system', - msg_type: 'approval_card', - content: '', - sender_name: '', - created_at: new Date().toISOString(), - extra_data: { - action: { - card_data: _allCategoriesCardCache, - }, - }, - } - messages.value.push(approvalCardMessage) - console.log('[Store] 手动插入审批卡片消息(快捷按钮触发,v4.0 全量卡片)') - } + // v4.0 P1-2:showApprovalCard/closeApprovalCard 已删除 + // 原因:唯一调用方 InputBox.vue 是孤儿组件(已移除), + // "快捷申请按钮"在当前产品中不存在(P0-3 误报确认) + // 后端 /approval/all-categories-card 端点保留备用 /** * 加载软件下载列表 @@ -1714,8 +1666,6 @@ export const useConversationStore = defineStore('conversation', () => { agentOnline, assistantPanelVisible, approvalLinks, - approvalCardVisible, - approvalCardTriggerText, softwareDownloads, lastMessageId, initialized, @@ -1745,8 +1695,7 @@ export const useConversationStore = defineStore('conversation', () => { shakeAgent, fetchApprovalLinks, // v2.0: checkApprovalIntent 已删除(审批意图识别统一由后端处理) - closeApprovalCard, - showApprovalCard, + // v4.0 P1-2: showApprovalCard/closeApprovalCard 已删除(孤儿组件 InputBox 的唯一调用方) fetchSoftwareDownloads, toggleAssistantPanel, switchToConversation,