From 32f6b5e6e9cab72b9671b710b75d50c8f42c3b52 Mon Sep 17 00:00:00 2001 From: Wenjie Zhang Date: Wed, 7 Jan 2026 11:16:08 +0800 Subject: [PATCH] =?UTF-8?q?fix(FileTable):=20=E4=BF=AE=E5=A4=8D=E8=87=AA?= =?UTF-8?q?=E5=8A=A8=E5=88=B7=E6=96=B0=E5=A4=B1=E6=95=88=E9=97=AE=E9=A2=98?= =?UTF-8?q?=E5=B9=B6=E4=BC=98=E5=8C=96=E6=8C=89=E9=92=AE=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 修改数据库存储逻辑以支持后台自动刷新时跳过加载状态 更新FileTable组件按钮样式和布局,增加可读性和交互性 --- docs/latest/changelog/roadmap.md | 4 ++++ web/src/components/FileTable.vue | 36 +++++++++++++++++++------------- web/src/stores/database.js | 18 +++++++++------- 3 files changed, 36 insertions(+), 22 deletions(-) diff --git a/docs/latest/changelog/roadmap.md b/docs/latest/changelog/roadmap.md index 0ca0be10..f7db7108 100644 --- a/docs/latest/changelog/roadmap.md +++ b/docs/latest/changelog/roadmap.md @@ -18,6 +18,9 @@ - 将工具与知识库解耦,在 context 中就完成解耦,虽然最终都是在 Agent 中的 get_tools 中获取 - 系统层面添加 apikey,在智能体、知识库调用中支持 apikey 以支持外部调用 - 支持更多类型的文档源的导入功能 +- 支持 markitdown 或者 docling 的功能 +- 支持设置上传后自动入库(indexing) +- 添加对于 lightrag 的结果解析 ### Bugs - 部分异常状态下,智能体的模型名称出现重叠[#279](https://github.com/xerrors/Yuxi-Know/issues/279) @@ -28,6 +31,7 @@ - 工具传递给模型的时候,使用英文,但部分模型不支持中文函数名(如gpt-4o-mini) - 首页加载的问题 - 当前的 upload 图谱查询为同步操作,可能会导致页面卡顿 +- FileTable 的自动刷新失效 ## v0.5 diff --git a/web/src/components/FileTable.vue b/web/src/components/FileTable.vue index 88224a47..7c135994 100644 --- a/web/src/components/FileTable.vue +++ b/web/src/components/FileTable.vue @@ -114,23 +114,25 @@ /> {{ selectedRowKeys.length }} 项 -
+
+ > + 批量解析 + + > + 批量入库 + + > + 批量删除 +
@@ -1082,7 +1085,7 @@ import ChunkParamsConfig from '@/components/ChunkParamsConfig.vue'; .panel-actions { display: flex; align-items: center; - gap: 0px; + gap: 4px; .action-searcher { width: 120px; @@ -1097,7 +1100,7 @@ import ChunkParamsConfig from '@/components/ChunkParamsConfig.vue'; display: flex; align-items: center; justify-content: space-between; - padding: 2px 12px; + padding: 4px 12px; background-color: var(--main-10); border-radius: 4px; margin-bottom: 4px; @@ -1118,9 +1121,12 @@ import ChunkParamsConfig from '@/components/ChunkParamsConfig.vue'; .batch-actions .ant-btn { font-size: 12px; - padding: 0 6px; - height: 22px; - border-radius: 3px; + padding: 4px 8px; + height: auto; + border-radius: 4px; + display: flex; + align-items: center; + gap: 4px; svg { width: 14px; @@ -1218,8 +1224,7 @@ import ChunkParamsConfig from '@/components/ChunkParamsConfig.vue'; align-items: center; justify-content: center; border-radius: 6px; - /* border: 1px solid var(--gray-300); */ - /* background-color: var(--gray-50); */ + padding: 0 4px; color: var(--gray-700); transition: all 0.1s ease; font-size: 12px; @@ -1251,7 +1256,8 @@ import ChunkParamsConfig from '@/components/ChunkParamsConfig.vue'; .panel-action-btn.active { color: var(--main-color); - background-color: var(--main-10); + background-color: var(--gray-100); + font-weight: 600; } .action-trigger-btn { diff --git a/web/src/stores/database.js b/web/src/stores/database.js index b30bd676..d94607b0 100644 --- a/web/src/stores/database.js +++ b/web/src/stores/database.js @@ -100,12 +100,14 @@ export const useDatabaseStore = defineStore('database', () => { } } - async function getDatabaseInfo(id, skipQueryParams = false) { + async function getDatabaseInfo(id, skipQueryParams = false, isBackground = false) { const db_id = id || databaseId.value; if (!db_id) return; - state.lock = true; - state.databaseLoading = true; + if (!isBackground) { + state.lock = true; + state.databaseLoading = true; + } try { const data = await databaseApi.getDatabaseInfo(db_id); database.value = data; @@ -119,8 +121,10 @@ export const useDatabaseStore = defineStore('database', () => { console.error(error); message.error(error.message || '获取数据库信息失败'); } finally { - state.lock = false; - state.databaseLoading = false; + if (!isBackground) { + state.lock = false; + state.databaseLoading = false; + } } } @@ -243,7 +247,7 @@ export const useDatabaseStore = defineStore('database', () => { }); } - const processingStatuses = new Set(['processing', 'waiting']); + const processingStatuses = new Set(['processing', 'waiting', 'parsing', 'indexing']); function enableAutoRefresh(source = 'auto') { if (autoRefreshManualOverride && source === 'auto') { @@ -469,7 +473,7 @@ export const useDatabaseStore = defineStore('database', () => { function startAutoRefresh() { if (state.autoRefresh && !refreshInterval) { refreshInterval = setInterval(() => { - getDatabaseInfo(undefined, true); // Skip loading query params during auto-refresh + getDatabaseInfo(undefined, true, true); // Skip loading query params during auto-refresh }, 1000); } }