feat(knowledge): 添加 MinerU组件以支持 PDF 文件处理

- 新增 RenderMinerU 组件,用于 PDF 文件的预处理和 Markdown 编辑
- 在 create.vue 中集成 RenderMinerU组件,实现预处理结果预览功能
- 更新公共样式以支持 Markdown 渲染
- 在 main.js 中注册 RMinerU组件
- 修改 package.json,添加 markdown-it 和 markdown-it-katex 依赖
- 更新 vue.config.js,添加对 mjs 文件的处理规则
This commit is contained in:
陈昱达
2025-04-11 16:26:27 +08:00
parent e9ee7fe0a2
commit d108379f41
8 changed files with 379 additions and 42 deletions

View File

@@ -1,83 +1,89 @@
<template>
<div class='container create-container'>
<div class="container create-container">
<el-card shadow="hover">
<div slot="header" class="clearfix">
<h3>创建知识库</h3>
</div>
<div class='card-body'>
<el-steps :active="active" simple finish-status="success" >
<div class="card-body">
<el-steps :active="active" simple finish-status="success">
<el-step title="文件上传/预处理"></el-step>
<el-step title="拆分配置"></el-step>
<el-step title="题词配置"></el-step>
</el-steps>
<div class='components'>
<step-preprocessing v-if='active===0' @getForm='getForm'></step-preprocessing>
<split-config v-if='active===1'></split-config>
<words v-if='active===2'></words>
<div class="components">
<step-preprocessing v-if="active === 0" @getForm="getForm"></step-preprocessing>
<split-config v-if="active === 1"></split-config>
</div>
</div>
<div class='card-bottom'>
<el-button type="primary" size='medium' @click='fetchApi'>一键处理</el-button>
<el-button type="primary" size='medium' @click='active++' v-if='active<2'>下一步</el-button>
<el-button type="primary" size='medium' v-if='active === 2'>确定</el-button>
<el-button type="primary" size='medium' @click='active--' v-if='active>=1'>上一步</el-button>
<el-button type="primary" size='medium' >取消</el-button>
<div class="card-bottom">
<el-button type="primary" size="medium" @click="fetchApi">一键处理</el-button>
<el-button type="primary" size="medium" @click="active++" v-if="active < 2">下一步</el-button>
<el-button type="primary" size="medium" v-if="active === 2">确定</el-button>
<el-button type="primary" size="medium" @click="active--" v-if="active >= 1">上一步</el-button>
<el-button type="primary" size="medium">取消</el-button>
</div>
</el-card>
<el-drawer :visible.sync="visible" size="80%" title="预处理结果预览">
<div class="mv10 mh20 text-right">
<el-button type="primary" size="medium">保存并处理</el-button>
<el-button size="medium">取消</el-button>
</div>
<div style="height:calc(100% - 55px);">
<r-miner-u></r-miner-u>
</div>
</el-drawer>
</div>
</template>
<script>
import StepPreprocessing from './components/preprocessing.vue'
import SplitConfig from '@/views/knowledge/detail/components/split/SplitConfig.vue'
import Words from '@/views/knowledge/detail/components/words/Index.vue'
// import StepC
export default {
name: 'create',
data() {
return {
active:0
visible: true,
active: 0
}
},
props: {},
watch: {},
components: {
Words,
SplitConfig,
StepPreprocessing
},
filters: {},
methods: {
getForm(){},
fetchApi(){
},
},
created() {
},
mounted() {
getForm() {},
fetchApi() {}
},
created() {},
mounted() {},
computed: {}
}
</script>
<style scoped lang='scss'>
/deep/ .card-bottom{
position: relative;
width: 100%;
padding-top: 20px;
&::after{
content: '';
border-top: 1px solid #ebeef5;
position: absolute;
top:0;
left:0;
width:100%
}
& .el-button{
<style scoped lang="scss">
/deep/.el-drawer__header {
margin-bottom: unset;
border-bottom: 1px solid #eee;
padding-bottom: 20px;
}
}
/deep/ .card-bottom {
position: relative;
width: 100%;
padding-top: 10px;
&::after {
content: '';
border-top: 1px solid #ebeef5;
position: absolute;
top: 0;
left: 0;
width: 100%;
}
& .el-button {
}
}
</style>