From c8f457dadae98d694be5c18cfb57e2ded5488a4a Mon Sep 17 00:00:00 2001 From: 2910410219 <2910410219@qq.com> Date: Wed, 19 Aug 2026 13:38:04 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A6=96=E9=A1=B5=E5=8E=86=E5=8F=B2=E5=B7=A5?= =?UTF-8?q?=E4=BD=9C=E6=B5=81=E4=BC=9A=E8=AF=9D=E8=A7=A3=E9=99=A4=E5=B7=A5?= =?UTF-8?q?=E4=BD=9C=E6=B5=81=E9=94=81=E5=AE=9A=EF=BC=8C=E5=9B=9E=E6=98=BE?= =?UTF-8?q?=E9=A2=84=E9=80=89=E4=B8=8A=E6=AC=A1=E6=89=A7=E8=A1=8C=E5=B7=A5?= =?UTF-8?q?=E4=BD=9C=E6=B5=81=E5=8F=AF=E8=87=AA=E7=94=B1=E5=88=87=E6=8D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude --- src/views/home/components/InputBar.vue | 15 +++++---------- src/views/home/index.vue | 11 ++--------- 2 files changed, 7 insertions(+), 19 deletions(-) diff --git a/src/views/home/components/InputBar.vue b/src/views/home/components/InputBar.vue index f402b04..d0065ee 100644 --- a/src/views/home/components/InputBar.vue +++ b/src/views/home/components/InputBar.vue @@ -88,7 +88,6 @@ import { getWorkflowList } from '/@/api/settings/creation'; interface Props { sendDisabled?: boolean; - workflowLocked?: boolean; hideShortcuts?: boolean; generating?: boolean; // 当前会话模型名称,用于输入栏切换入口展示 @@ -114,7 +113,6 @@ interface Workflow { const props = withDefaults(defineProps(), { sendDisabled: false, - workflowLocked: false, hideShortcuts: false, generating: false, currentModelName: '', @@ -126,15 +124,12 @@ const isFocused = ref(false); const selectedWorkflowId = ref(null); const commonWorkflows = ref([]); -const visibleWorkflows = computed(() => { - if (props.workflowLocked && selectedWorkflowId.value) { - return commonWorkflows.value.filter((w) => w.id === selectedWorkflowId.value); - } - return commonWorkflows.value; -}); +// 工作流胶囊始终展示全部工作流:历史工作流会话回显预选上次执行的工作流, +// 但仍允许自由切换/取消(不锁定为单个工作流) +const visibleWorkflows = computed(() => commonWorkflows.value); -// 输入框整体锁定:选择了工作流(不可取消)或正处于生成/工作流执行中 -const lockAll = computed(() => props.workflowLocked || props.isWorkflowRunning || props.generating); +// 输入框整体锁定:正处于生成/工作流执行中(执行中禁止切换工作流) +const lockAll = computed(() => props.isWorkflowRunning || props.generating); // 输入框占位符:工作流执行中给出明确提示 const inputPlaceholder = computed(() => diff --git a/src/views/home/index.vue b/src/views/home/index.vue index 8ec5a14..66561ec 100644 --- a/src/views/home/index.vue +++ b/src/views/home/index.vue @@ -38,7 +38,6 @@ !!activeHistoryId.value && !!sendingSessions[activeHistoryId.value]); @@ -861,11 +859,9 @@ const handleDeleteMessage = async (msg: ChatMessage) => { // 仍含工作流结果:完整重建消息流(带值表单卡片 + 结果消息) const session = historyList.value.find((h) => h.id === sid); if (session) { - isHistoryWorkflow.value = true; await loadWorkflowSessionMessages(sid, results); } } else { - isHistoryWorkflow.value = false; inputBarRef.value?.clearWorkflow?.(); loadSessionMessagesFromResults(sid, results); } @@ -1372,7 +1368,7 @@ const handleSelectHistory = async (id: string) => { teardownSession(); activeHistoryId.value = id; activeMenu.value = 'chat'; - // 切换会话不继承工作流选择(回显的锁定标签由 InputBar 单独维护) + // 切换会话不继承工作流选择(历史工作流会话回显时预选上次执行的工作流,可自由切换) selectedWorkflowDetail.value = null; const session = historyList.value.find((h) => h.id === id); // 加载会话内结果列表(session/get),用它判断会话类型:普通会话(无 workflow 结果)只依赖这一个接口,不再调 execution/get @@ -1380,11 +1376,9 @@ const handleSelectHistory = async (id: string) => { const hasWorkflow = Array.isArray(results) && results.some((r) => r.type === 'workflow'); // 工作流会话:回显为消息流(带值表单卡片 + 结果消息),不再跳整页表单页 if (hasWorkflow) { - isHistoryWorkflow.value = true; // InputBar 锁定(禁止更换工作流) await loadWorkflowSessionMessages(id, results); } else { // 普通对话会话 / 虚拟会话:切回对话页,把 session/get 结果转换为正常对话消息流展示 - isHistoryWorkflow.value = false; inputBarRef.value?.clearWorkflow?.(); loadSessionMessagesFromResults(id, results); } @@ -1402,7 +1396,7 @@ const handleSelectHistory = async (id: string) => { // 表单卡片直接用结果记录的 requestParams(完整 flowContent,含 __start__ outputConfig 值快照)构造, // 不再依赖 execution/get;chat 结果按原逻辑转消息流 const loadWorkflowSessionMessages = async (sid: string, results: VOSessionInfoResult[]) => { - // 最近一次 workflow 结果记录(results 时间倒序,第一条即最新):用于同步 InputBar 锁定标签展示 + // 最近一次 workflow 结果记录(results 时间倒序,第一条即最新):用于回显预选 InputBar 工作流 const latestWf = Array.isArray(results) ? results.find((r) => r.type === 'workflow') : undefined; // 按 flowId 查工作流名(commonWorkflows 的 id 即工作流 id),每条记录用各自名称 const flowNameOf = (flowId?: string): string => { @@ -1568,7 +1562,6 @@ const createNewSession = () => { activeHistoryId.value = sessionId; activeMenu.value = 'chat'; selectedWorkflowDetail.value = null; - isHistoryWorkflow.value = false; inputBarRef.value?.resetAll(); sessionMessages.value.set(sessionId, []); // 清空消息 };