feat: 重构知识库文档导入任务化流程

- 新增上传建单、异步解析、分块处理与异步向量化闭环

- 收口分享页权限、完成态检索过滤与 SSE 局部状态刷新
This commit is contained in:
2026-04-15 19:27:22 +08:00
parent a41b50959e
commit 2689adfa40
56 changed files with 6376 additions and 1060 deletions

View File

@@ -78,6 +78,25 @@ const handleCurrentChange = (newPage: number) => {
pageInfo.pageNumber = newPage;
};
const patchRowById = (
id: number | string,
patch: Record<string, any>,
): boolean => {
const rowIndex = pageList.value.findIndex(
(item: Record<string, any>) => String(item?.id ?? '') === String(id ?? ''),
);
if (rowIndex === -1) {
return false;
}
const nextPageList = [...pageList.value];
nextPageList[rowIndex] = {
...nextPageList[rowIndex],
...patch,
};
pageList.value = nextPageList;
return true;
};
// 暴露给父组件的方法 (替代 useImperativeHandle)
const setQuery = (newQueryParams: Record<string, any>) => {
pageInfo.pageNumber = 1;
@@ -89,6 +108,7 @@ const setQuery = (newQueryParams: Record<string, any>) => {
// 暴露方法给父组件
defineExpose({
reload: getPageList,
patchRowById,
setQuery,
});

View File

@@ -67,8 +67,13 @@ const triggerFileSelect = () => {
}
};
const clearFiles = () => {
uploadRef.value?.clearFiles?.();
};
// 对外暴露方法父组件可通过ref调用
defineExpose({
clearFiles,
triggerFileSelect,
});
</script>