This commit is contained in:
2026-08-06 10:36:12 +08:00
parent 74ecb6d277
commit 46f034d628
7 changed files with 44 additions and 20 deletions
+8 -5
View File
@@ -23,6 +23,7 @@
<el-tooltip :content="row.error_msg || ''" placement="top">
<el-tag :type="statusType(row.status)">{{ statusText(row.status) }}</el-tag>
</el-tooltip>
<el-tag v-if="row.status === 4 && row.error_msg" size="small" type="warning" style="margin-left: 4px">图谱未构建</el-tag>
</template>
</el-table-column>
<el-table-column prop="chunk_count" label="分块数" width="90" />
@@ -30,7 +31,7 @@
<el-table-column label="操作" width="240" fixed="right">
<template #default="{ row }">
<el-button link type="primary" @click="openChunks(row)">分块</el-button>
<el-button v-if="row.status === 3" link type="warning" @click="retry(row)">重试</el-button>
<el-button v-if="row.status === 5" link type="warning" @click="retry(row)">重试</el-button>
<el-button link type="primary" @click="reembed(row)">重新向量化</el-button>
<el-button link type="danger" @click="remove(row)">删除</el-button>
</template>
@@ -126,8 +127,10 @@ let editingChunk = null
const statusMap = {
0: { text: '待处理', type: 'info' },
1: { text: '解析中', type: 'warning' },
2: { text: '已完成', type: 'success' },
3: { text: '失败', type: 'danger' }
2: { text: '向量生成中', type: 'warning' },
3: { text: '图谱构建中', type: 'warning' },
4: { text: '已完成', type: 'success' },
5: { text: '失败', type: 'danger' }
}
function statusText(s) { return (statusMap[s] || {}).text || s }
@@ -172,7 +175,7 @@ async function startPolling() {
stopPolling()
pollTimer = setInterval(async () => {
await load()
if (!documents.value.some(d => d.status === 0 || d.status === 1)) stopPolling()
if (!documents.value.some(d => d.status < 4)) stopPolling()
}, 3000)
}
function stopPolling() {
@@ -189,7 +192,7 @@ onMounted(async () => {
datasetName.value = cur ? cur.name : '数据集'
} catch { /* 忽略 */ }
await load()
if (documents.value.some(d => d.status === 0 || d.status === 1)) startPolling()
if (documents.value.some(d => d.status < 4)) startPolling()
})
onUnmounted(stopPolling)