feat: 重构知识库文档导入任务化流程
- 新增上传建单、异步解析、分块处理与异步向量化闭环 - 收口分享页权限、完成态检索过滤与 SSE 局部状态刷新
This commit is contained in:
@@ -18,10 +18,16 @@ interface FileInfo {
|
||||
}
|
||||
const fileData = ref<FileInfo[]>([]);
|
||||
const filesPath = ref([]);
|
||||
const dragUploadRef = ref<InstanceType<typeof DragFileUpload>>();
|
||||
defineExpose({
|
||||
getFilesData() {
|
||||
return fileData.value.filter((item) => item.filePath);
|
||||
},
|
||||
reset() {
|
||||
fileData.value = [];
|
||||
filesPath.value = [];
|
||||
dragUploadRef.value?.clearFiles?.();
|
||||
},
|
||||
});
|
||||
function handleSuccess(response: any) {
|
||||
filesPath.value = response.data;
|
||||
@@ -59,11 +65,13 @@ function handleRemove(row: any) {
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div>
|
||||
<div>
|
||||
<DragFileUpload @success="handleSuccess" @on-change="handleChange" />
|
||||
</div>
|
||||
<div>
|
||||
<div class="import-file-container">
|
||||
<DragFileUpload
|
||||
ref="dragUploadRef"
|
||||
@success="handleSuccess"
|
||||
@on-change="handleChange"
|
||||
/>
|
||||
<div class="import-file-container__table">
|
||||
<ElTable :data="fileData" style="width: 100%" size="large">
|
||||
<ElTableColumn
|
||||
prop="fileName"
|
||||
@@ -104,4 +112,14 @@ function handleRemove(row: any) {
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style scoped></style>
|
||||
<style scoped>
|
||||
.import-file-container {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 12px;
|
||||
}
|
||||
|
||||
.import-file-container__table {
|
||||
margin-top: 2px;
|
||||
}
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user