feat(knowledge): 实现知识库文件上传和预处理功能

- 新增文件上传接口和相关组件
- 实现文件上传、预处理和保存功能
- 添加预处理结果预览功能
-优化知识库详情展示,增加文件内容和关键词显示
- 实现知识库文件删除功能
- TODO 拆分的文档展示  还需要调整  可能会把tags 放在标题上  需要修改样式
This commit is contained in:
陈昱达
2025-04-14 21:18:56 +08:00
parent 7f123159a3
commit bcff977d38
7 changed files with 263 additions and 57 deletions

View File

@@ -12,9 +12,9 @@
</el-steps>
<div class="components">
<step-preprocessing v-if="active === 0" @getForm="getForm" @getDocumentId="getDocumentId" @beMinerU="beMinerU"></step-preprocessing>
<step-split-config ref="splitConfig" v-if="active === 1"></step-split-config>
<step-words v-if="active === 2"></step-words>
<step-preprocessing v-show="active === 0" @getForm="getForm" @getDocumentId="getDocumentId" ref="stepPreProcessing"></step-preprocessing>
<step-split-config ref="splitConfig" v-show="active === 1"></step-split-config>
<step-words v-show="active === 2"></step-words>
</div>
</div>
@@ -26,14 +26,14 @@
<el-button size="medium" @click="active--" v-if="active >= 1">上一步</el-button>
<!-- <el-button type="primary" size="medium" @click="active++" v-if="active < 2">下一步</el-button>-->
<el-button type="primary" size="medium" @click="nextStep" v-if="active < 2">下一步</el-button>
<el-button type="primary" size="medium">取消</el-button>
<el-button type="primary" size="medium" @click="$router.history.go(-1)">取消</el-button>
</div>
</el-card>
<!-- 添加预处理结果预览对话框 -->
<el-drawer :visible.sync="visible" size="80%" title="预处理结果预览">
<div style="height:calc(100% - 55px);">
<r-miner-u :documentId="documentId"></r-miner-u>
<r-miner-u :documentId="documentId" @saveMarkDown="saveMarkDown"></r-miner-u>
</div>
</el-drawer>
</div>
@@ -47,9 +47,9 @@ export default {
name: 'create',
data() {
return {
visible: true,
visible: false,
active: 0,
documentId: '1361352503568994304'
documentId: '1361407835582337024'
}
},
props: {},
@@ -61,17 +61,30 @@ export default {
},
filters: {},
methods: {
beMinerU() {
this.visible = true
saveMarkDown() {
this.visible = false
this.active++
},
beMinerU() {
setTimeout(() => {
this.visible = true
})
},
getForm(form) {
if (form.beMinerU) {
this.beMinerU()
} else {
this.saveMarkDown()
}
},
getForm() {},
fetchApi() {},
getDocumentId(id) {
this.documentId = id
},
nextStep() {
if (this.active === 0) {
this.active++
// this.active++
this.$refs.stepPreProcessing.uploadFiled()
} else if (this.active === 1) {
this.$refs.splitConfig.nextStep()
}