From 536ad8386c3623dfc821f109f251aba54778635b Mon Sep 17 00:00:00 2001 From: 2910410219 <2910410219@qq.com> Date: Mon, 15 Jun 2026 16:52:51 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A6=96=E9=A1=B5=E5=B8=83=E5=B1=80=E6=9B=B4?= =?UTF-8?q?=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/home/components/Sidebar.vue | 219 ++++++++++++++++++++++++-- src/views/home/index.vue | 197 ++--------------------- 2 files changed, 212 insertions(+), 204 deletions(-) diff --git a/src/views/home/components/Sidebar.vue b/src/views/home/components/Sidebar.vue index d872841..803b0e3 100644 --- a/src/views/home/components/Sidebar.vue +++ b/src/views/home/components/Sidebar.vue @@ -13,7 +13,7 @@
历史对话
+ +
+
工作流
+
+ + + + +
+
diff --git a/src/views/home/index.vue b/src/views/home/index.vue index c86cab6..979e5b7 100644 --- a/src/views/home/index.vue +++ b/src/views/home/index.vue @@ -4,50 +4,21 @@ :active-menu="activeMenu" :active-history-id="activeHistoryId" :history-list="historyList" + :tree-nodes="treeNodes" + :tree-loading="treeLoading" @menu-change="handleMenuChange" @new-chat="handleCreateHistory" @select-history="handleSelectHistory" @delete-history="handleDeleteHistory" + @preview-node="previewNode" + @download-node="downloadNode" />
- -
-
- - - - -
-
- +
@@ -107,7 +78,6 @@ const historyList = ref([ { id: 4, title: '快捷回复产品设计', time: '2 天前' }, ]); -const treeProps = { children: 'children', label: 'label' }; const apiBaseUrl = (import.meta.env.VITE_API_URL || '').replace(/\/$/, ''); const joinUrl = (b: string, p: string) => `${b.replace(/\/$/, '')}${p.startsWith('/') ? p : `/${p}`}`; @@ -155,15 +125,15 @@ const mockTreeData: ExecutionTreeItem[] = [ flowName: '代码审查任务', sessionId: 'session-1', items: [ - { label: '审查结果.md', content: 'https://placekitten.com/800/600', type: 'text/markdown' }, - { label: '流程图.png', content: 'https://placekitten.com/800/600', type: 'image/png' }, + { label: '审查结果.md', content: 'https://placekitten.com/800/600', type: 'text/markdown', timestamp: '' }, + { label: '流程图.png', content: 'https://placekitten.com/800/600', type: 'image/png', timestamp: '' }, ], }, { Id: 2, flowName: '需求分析', sessionId: 'session-2', - items: [{ label: '需求拆解.txt', content: '# 需求分析结果\n\n- 功能点一\n- 功能点二\n- 需要优化', type: 'text/plain' }], + items: [{ label: '需求拆解.txt', content: '# 需求分析结果\n\n- 功能点一\n- 功能点二\n- 需要优化', type: 'text/plain', timestamp: '' }], }, ], }, @@ -174,7 +144,7 @@ const mockTreeData: ExecutionTreeItem[] = [ Id: 3, flowName: '生成演示视频', sessionId: 'session-3', - items: [{ label: '输出视频.mp4', content: 'https://www.w3schools.com/html/mov_bbb.mp4', type: 'video/mp4' }], + items: [{ label: '输出视频.mp4', content: 'https://www.w3schools.com/html/mov_bbb.mp4', type: 'video/mp4', timestamp: '' }], }, ], }, @@ -230,10 +200,6 @@ const downloadNode = (data: TreeNode) => { document.body.removeChild(a); }; -const handleTreeNodeClick = () => { - // 点击节点不需要额外操作 -}; - const handleMenuChange = (menu: string) => { activeMenu.value = menu; }; @@ -311,151 +277,6 @@ onMounted(() => { } } -/* 右侧工作空间面板 - 渐变玻璃风格 */ -.workspace-panel { - width: 260px; - background: linear-gradient( - 180deg, - rgba(255, 255, 255, 0.85) 0%, - rgba(249, 251, 255, 0.7) 50%, - rgba(235, 241, 252, 0.6) 100% - ); - border-left: 1px solid rgba(59, 130, 246, 0.15); - display: flex; - flex-direction: column; - height: 100%; - box-shadow: -6px 0 35px rgba(59, 130, 246, 0.08); - backdrop-filter: blur(16px); -} - -.workspace-tree-wrap { - flex: 1; - padding: 8px 8px 12px; - overflow-y: auto; - scrollbar-width: none; - -ms-overflow-style: none; - - &::-webkit-scrollbar { - display: none; - } - - :deep(.el-tree) { - background: transparent; - - .el-tree-node { - padding: 4px 0; - } - - // 一级节点(日期)- 蓝色渐变 - :deep(.level-date) .el-tree-node__content { - height: 42px; - background: linear-gradient(135deg, rgba(59, 130, 246, 0.20) 0%, rgba(59, 130, 246, 0.05) 100%); - border: 1px solid rgba(59, 130, 246, 0.28); - font-weight: 600; - } - - // 二级节点(工作流)- 紫色渐变 - :deep(.level-flow) .el-tree-node__content { - margin-left: 8px; - background: linear-gradient(135deg, rgba(139, 92, 246, 0.15) 0%, rgba(139, 92, 246, 0.03) 100%); - border: 1px solid rgba(139, 92, 246, 0.18); - } - - // 三级节点(文件)- 根据文件类型区分颜色 - :deep(.level-file.image) .el-tree-node__content, - :deep(.level-file.jpg) .el-tree-node__content, - :deep(.level-file.png) .el-tree-node__content, - :deep(.level-file.gif) .el-tree-node__content { - margin-left: 16px; - background: linear-gradient(135deg, rgba(16, 185, 129, 0.18) 0%, rgba(16, 185, 129, 0.04) 100%); - border: 1px solid rgba(16, 185, 129, 0.15); - } - - :deep(.level-file.video) .el-tree-node__content, - :deep(.level-file.mp4) .el-tree-node__content, - :deep(.level-file.webm) .el-tree-node__content { - margin-left: 16px; - background: linear-gradient(135deg, rgba(245, 158, 11, 0.18) 0%, rgba(245, 158, 11, 0.04) 100%); - border: 1px solid rgba(245, 158, 11, 0.15); - } - - :deep(.level-file.audio) .el-tree-node__content, - :deep(.level-file.mp3) .el-tree-node__content, - :deep(.level-file.wav) .el-tree-node__content { - margin-left: 16px; - background: linear-gradient(135deg, rgba(236, 72, 153, 0.18) 0%, rgba(236, 72, 153, 0.04) 100%); - border: 1px solid rgba(236, 72, 153, 0.15); - } - - :deep(.level-file.text) .el-tree-node__content, - :deep(.level-file.md) .el-tree-node__content, - :deep(.level-file.txt) .el-tree-node__content, - :deep(.level-file.markdown) .el-tree-node__content { - margin-left: 16px; - background: linear-gradient(135deg, rgba(79, 70, 229, 0.18) 0%, rgba(79, 70, 229, 0.04) 100%); - border: 1px solid rgba(79, 70, 229, 0.15); - } - - // 默认其他文件 - :deep(.level-file:not(.image):not(.video):not(.audio):not(.text)) .el-tree-node__content { - margin-left: 16px; - background: linear-gradient(135deg, rgba(100, 116, 139, 0.15) 0%, rgba(100, 116, 139, 0.04) 100%); - border: 1px solid rgba(100, 116, 139, 0.15); - } - - .el-tree-node__content { - height: 38px; - line-height: 38px; - border-radius: 8px; - margin: 2px 0; - backdrop-filter: blur(8px); - transition: all 0.2s ease; - - &:hover { - border-width: 2px; - transform: translateX(2px); - box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08); - } - } - - .el-tree-node.is-current > .el-tree-node__content { - border-width: 2px; - box-shadow: 0 3px 12px rgba(0, 0, 0, 0.12); - } - - .el-tree-node__expand-icon { - color: rgba(59, 130, 246, 0.7); - } - } -} - -.tree-node { - display: flex; - align-items: center; - justify-content: space-between; - width: 100%; - gap: 6px; - - .ellipsis { - overflow: hidden; - text-overflow: ellipsis; - white-space: nowrap; - font-size: 13px; - font-weight: 500; - color: #1e293b; - } - - .tree-node-actions { - flex-shrink: 0; - .el-button { - font-size: 11px; - padding: 2px 4px; - margin: 0; - line-height: 1; - } - } -} - .preview-container { max-height: 85vh; overflow: auto;