From 5f0d860d27e67f37dc18e6248b222cd29bae19e6 Mon Sep 17 00:00:00 2001 From: 2910410219 <2910410219@qq.com> Date: Tue, 7 Jul 2026 16:00:08 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AF=B9=E8=AF=9D=E8=AE=B0=E5=BD=95=E5=92=8C?= =?UTF-8?q?=E5=B7=A5=E4=BD=9C=E7=A9=BA=E9=97=B4=E9=93=BE=E8=B7=AF=E7=A1=AE?= =?UTF-8?q?=E8=AE=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/settings/creation/index.ts | 15 +- src/views/home/components/InputBar.vue | 6 +- src/views/home/components/MainContent.vue | 14 +- src/views/home/components/Sidebar.vue | 53 ++----- src/views/home/index.vue | 175 ++++++++++++++-------- src/views/settings/creation/index.vue | 21 +-- 6 files changed, 144 insertions(+), 140 deletions(-) diff --git a/src/api/settings/creation/index.ts b/src/api/settings/creation/index.ts index c5bc537..3c9d656 100644 --- a/src/api/settings/creation/index.ts +++ b/src/api/settings/creation/index.ts @@ -86,22 +86,16 @@ export interface CreationTreeItem { // 新的执行列表数据结构 export interface ExecutionItem { + id: string; timestamp: string; content: string; label: string; type?: string; } -export interface ExecutionFlowItem { - flowName: string; - Id?: number | string; - sessionId?: string; - items: ExecutionItem[]; -} - export interface ExecutionTreeItem { createDate: string; - flows: ExecutionFlowItem[]; + items: ExecutionItem[]; } export interface CreationListData { @@ -351,7 +345,7 @@ export function executeFlow(data: ExecuteFlowParams | FormData, requestOptions?: }); } /** 删除工作空间结果(单个文件) */ -export function deleteExecutionResult(data: { id: string | number }, requestOptions?: RequestOptions) { +export function deleteExecutionResult(data: { id: string; content: string }, requestOptions?: RequestOptions) { return request({ url: '/ai-agent/flow/execution/deleteResult', method: 'delete', @@ -384,10 +378,11 @@ export interface SessionListItem { } /** 获取会话记录列表 */ -export function getSessionList(requestOptions?: RequestOptions) { +export function getSessionList(params?: Record, requestOptions?: RequestOptions) { return request({ url: '/ai-agent/flow/execution/sessionList', method: 'get', + params, requestOptions, }) as Promise; } diff --git a/src/views/home/components/InputBar.vue b/src/views/home/components/InputBar.vue index 578f1ca..fc3d353 100644 --- a/src/views/home/components/InputBar.vue +++ b/src/views/home/components/InputBar.vue @@ -39,7 +39,7 @@
Shift+Enter 换行 -
@@ -100,8 +100,8 @@ const fetchWorkflows = async () => { }; const handleSend = () => { + if (selectedWorkflowId.value === null) return; const msg = message.value.trim(); - if (!msg && selectedWorkflowId.value === null) return; emit('send', msg || ''); message.value = ''; selectedWorkflowId.value = null; @@ -133,7 +133,7 @@ onMounted(() => { fetchWorkflows(); }); - defineExpose({ resetAll, clearWorkflow, selectedWorkflowId }); + defineExpose({ resetAll, clearWorkflow, selectedWorkflowId, commonWorkflows }); \ No newline at end of file + diff --git a/src/views/settings/creation/index.vue b/src/views/settings/creation/index.vue index d33cb58..0a610a0 100644 --- a/src/views/settings/creation/index.vue +++ b/src/views/settings/creation/index.vue @@ -1401,21 +1401,12 @@ const buildTreeNodes = (tree: ExecutionTreeItem[]): TreeNode[] => id: `date-${di}`, label: d.createDate, nodeType: 'date', - children: (d.flows || []).map((f, fi) => ({ - id: `flow-${di}-${fi}`, - label: f.flowName || '未命名工作流', - nodeType: 'contentType', - workflowId: f.Id, - sessionId: f.sessionId, - children: (f.items || []).map((item, ii) => ({ - id: `item-${di}-${fi}-${ii}`, - label: item.label || `作品${ii + 1}`, - nodeType: 'title', - fileUrl: item.content, - fileType: item.type, - workflowId: f.Id, - sessionId: f.sessionId, - })), + children: (d.items || []).map((item, ii) => ({ + id: `item-${di}-${ii}`, + label: item.label || `作品${ii + 1}`, + nodeType: 'title', + fileUrl: item.content, + fileType: item.type, })), })); const getList = async () => {