diff --git a/frontend/src/views/DocList.vue b/frontend/src/views/DocList.vue
index 3e958f8..09e2192 100644
--- a/frontend/src/views/DocList.vue
+++ b/frontend/src/views/DocList.vue
@@ -82,7 +82,9 @@
{{ row.fileType }}
{{ formatSize(row.fileSize) }}
- {{ categoryStore.getCategoryName(row.categoryId) }}
+
+ {{ docPath(row) }}
+
{{ statusLabel(row.status) }}
@@ -189,6 +191,8 @@ const isResizing = ref(false)
const MIN_TREE_WIDTH = 200
const MAX_TREE_WIDTH = 480
let resizeCleanup: (() => void) | null = null
+// 目录 id → { name, parentId },位置列据此沿 parentId 回溯拼目录路径
+const folderMap = ref>({})
// 表格排序状态(服务端排序)
const sortInfo = ref<{ sortBy: string; descending: boolean } | null>(null)
@@ -232,7 +236,7 @@ const columns = [
{ colKey: 'title', title: '标题', width: 220, sorter: true },
{ colKey: 'fileType', title: '类型', width: 70, sorter: true },
{ colKey: 'fileSize', title: '大小', width: 80, sorter: true },
- { colKey: 'categoryId', title: '分类', width: 100 },
+ { colKey: 'categoryId', title: '位置', width: 200 },
{ colKey: 'status', title: '状态', width: 80 },
{ colKey: 'enabled', title: '启用', width: 60 },
{ colKey: 'chunkCount', title: '分块', width: 60, sorter: true },
@@ -262,6 +266,20 @@ function getDocTags(doc: any): string[] {
function statusLabel(s: string) { return s === 'READY' ? '已完成' : s === 'PROCESSING' ? '处理中' : s === 'FAILED' ? '失败' : s }
function formatSize(b: number) { return b ? formatBytes(b) : '-' }
+/** 计算文档所在目录路径(不含分类名);直接挂分类根/无目录时返回「—」 */
+function docPath(row: any): string {
+ let fid = row.folderId != null ? String(row.folderId) : '0'
+ const chain: string[] = []
+ let guard = 0
+ while (fid && fid !== '0' && guard++ < 20) {
+ const f = folderMap.value[fid]
+ if (!f) break
+ chain.unshift(f.name)
+ fid = String(f.parentId ?? '0')
+ }
+ return chain.length ? chain.join(' / ') : '—'
+}
+
// ==================== 搜索防抖 ====================
const debouncedLoad = debounce(() => load(1))
@@ -342,6 +360,9 @@ async function loadTreeData() {
const cats = catRes.success ? (catRes.data || []) : []
const folders = folderRes.success ? (folderRes.data || []) : []
treeData.value = buildTree(cats, folders)
+ // 目录映射:位置列只回溯目录链,无需分类链映射
+ folderMap.value = {}
+ for (const f of folders || []) folderMap.value[String(f.id)] = { name: f.name, parentId: f.parentId }
} catch (e: any) {
toast('加载目录树失败:' + e.message, 'error')
} finally {
@@ -626,10 +647,16 @@ loadData()