mirror of
http://112.124.100.131/ebiz-ai/ebiz-ai-knowledge-manage.git
synced 2025-12-06 17:36:48 +08:00
refactor(RenderMinerU):优化 PDF 渲染组件
- 移除了 input.scss 中的冗余样式 - 重构了 RenderMinerU 组件,提高了代码可维护性 - 增加了对非 PDF 文件的隐藏逻辑 - 优化了 PDF预览的用户界面
This commit is contained in:
@@ -346,6 +346,3 @@
|
|||||||
color: $--color-primary;
|
color: $--color-primary;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.el-input__inner {
|
|
||||||
height: 100%;
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -1,11 +1,12 @@
|
|||||||
<template>
|
<template>
|
||||||
<div style="height: 100%;">
|
<div style="height: 100%;">
|
||||||
<div class="flex align-items-c justify-content-b mb10">
|
<div class="flex align-items-c justify-content-b mb10">
|
||||||
<div class="fileName flex align-items-c">
|
<div class="fileName flex align-items-c ">
|
||||||
<svg-icon
|
<svg-icon
|
||||||
icon-class="pdf"
|
icon-class="pdf"
|
||||||
style="width: 20px;height: 20px"
|
style="width: 20px;height: 20px"
|
||||||
class-name="mr10"
|
class-name="mr10"
|
||||||
|
v-if='showPdf'
|
||||||
/>
|
/>
|
||||||
{{ fileName }}
|
{{ fileName }}
|
||||||
</div>
|
</div>
|
||||||
@@ -52,7 +53,7 @@
|
|||||||
element-loading-text="读取文档中..."
|
element-loading-text="读取文档中..."
|
||||||
>
|
>
|
||||||
<iframe
|
<iframe
|
||||||
v-if="isShowPdf"
|
v-if="showPdf"
|
||||||
id="iframe"
|
id="iframe"
|
||||||
ref="iframe"
|
ref="iframe"
|
||||||
:src="
|
:src="
|
||||||
@@ -70,22 +71,21 @@
|
|||||||
>
|
>
|
||||||
<div class="el-card ebiz-pdf" style="height: 100%;overflow: hidden">
|
<div class="el-card ebiz-pdf" style="height: 100%;overflow: hidden">
|
||||||
<div style="height: 47px;width: 100%;text-align: center;">
|
<div style="height: 47px;width: 100%;text-align: center;">
|
||||||
<div
|
<div class="flex align-items-c justify-content-c miner-navbar fs14">
|
||||||
class="flex align-items-c justify-content-c"
|
|
||||||
style="margin-top: 11px;border-bottom: 1px solid #EBEEF5;padding-bottom: 10px;gap: 10px"
|
|
||||||
>
|
|
||||||
<el-icon
|
<el-icon
|
||||||
class="el-icon-caret-left cursor-pointer"
|
class="el-icon-caret-left cursor-pointer"
|
||||||
@click.native="changePageDown('down')"
|
@click.native="changePageDown('down')"
|
||||||
>
|
>
|
||||||
</el-icon>
|
</el-icon>
|
||||||
<el-input
|
<input
|
||||||
style="height: 23px;width: 50px;text-align: center"
|
style="width: 50px;text-align: center"
|
||||||
v-model="copyValue"
|
v-model="copyValue"
|
||||||
:min="0"
|
:min="0"
|
||||||
|
class="fs13 miner-input el-input"
|
||||||
@blur="blursChange"
|
@blur="blursChange"
|
||||||
></el-input>
|
></input>
|
||||||
<span class="ml5">/ {{ mdJsons.length }}</span>
|
<span class="mh5">/ </span>
|
||||||
|
<span>{{ mdJsons.length }}</span>
|
||||||
<el-icon
|
<el-icon
|
||||||
class="el-icon-caret-right cursor-pointer"
|
class="el-icon-caret-right cursor-pointer"
|
||||||
@click.native="changePageUp('up')"
|
@click.native="changePageUp('up')"
|
||||||
@@ -151,6 +151,7 @@ export default {
|
|||||||
mdJsons: {},
|
mdJsons: {},
|
||||||
finishenEnd: false,
|
finishenEnd: false,
|
||||||
fileName: '',
|
fileName: '',
|
||||||
|
showPdf:true,
|
||||||
recordId: '', //pdf 记录的id
|
recordId: '', //pdf 记录的id
|
||||||
endEmit: false,
|
endEmit: false,
|
||||||
tab: '0',
|
tab: '0',
|
||||||
@@ -662,7 +663,9 @@ export default {
|
|||||||
JSON.parse(JSON.stringify(res.content.content.pdf_info))
|
JSON.parse(JSON.stringify(res.content.content.pdf_info))
|
||||||
)
|
)
|
||||||
// this.$refs.iframe 重新刷新iframe
|
// this.$refs.iframe 重新刷新iframe
|
||||||
this.$refs.iframe.contentWindow.location.reload()
|
if( this.$refs.iframe){
|
||||||
|
this.$refs.iframe.contentWindow.location.reload()
|
||||||
|
}
|
||||||
|
|
||||||
this.getPDFDetailMarkDown()
|
this.getPDFDetailMarkDown()
|
||||||
})
|
})
|
||||||
@@ -809,6 +812,11 @@ export default {
|
|||||||
if (res) {
|
if (res) {
|
||||||
this.mdPges = res.content.content.pages
|
this.mdPges = res.content.content.pages
|
||||||
this.fileName = res.content.content.name
|
this.fileName = res.content.content.name
|
||||||
|
|
||||||
|
// 隐藏非pdf文件
|
||||||
|
this.showPdf = this.fileName.indexOf('.pdf') > 0;
|
||||||
|
|
||||||
|
|
||||||
this.recordId = res.content.content.recordId
|
this.recordId = res.content.content.recordId
|
||||||
switch (res.content.content.status) {
|
switch (res.content.content.status) {
|
||||||
case 0:
|
case 0:
|
||||||
@@ -923,6 +931,21 @@ export default {
|
|||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
|
.miner-navbar {
|
||||||
|
margin-top: 11px;
|
||||||
|
border-bottom: 1px solid #ebeef5;
|
||||||
|
padding-bottom: 10px;
|
||||||
|
gap: 5px;
|
||||||
|
& .miner-input {
|
||||||
|
height: 20px ;
|
||||||
|
line-height: 20px;
|
||||||
|
border: 1px solid #BBBBBC;
|
||||||
|
outline:none;
|
||||||
|
border-radius: 2px;
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.lineHeight25 {
|
.lineHeight25 {
|
||||||
line-height: 25px;
|
line-height: 25px;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user