refactor(RenderMinerU):优化 PDF 渲染组件

- 移除了 input.scss 中的冗余样式
- 重构了 RenderMinerU 组件,提高了代码可维护性
- 增加了对非 PDF 文件的隐藏逻辑
- 优化了 PDF预览的用户界面
This commit is contained in:
陈昱达
2025-05-16 09:23:24 +08:00
parent df8b5e94ba
commit c32810387d
2 changed files with 34 additions and 14 deletions

View File

@@ -346,6 +346,3 @@
color: $--color-primary;
}
}
.el-input__inner {
height: 100%;
}

View File

@@ -6,6 +6,7 @@
icon-class="pdf"
style="width: 20px;height: 20px"
class-name="mr10"
v-if='showPdf'
/>
{{ fileName }}
</div>
@@ -52,7 +53,7 @@
element-loading-text="读取文档中..."
>
<iframe
v-if="isShowPdf"
v-if="showPdf"
id="iframe"
ref="iframe"
:src="
@@ -70,22 +71,21 @@
>
<div class="el-card ebiz-pdf" style="height: 100%;overflow: hidden">
<div style="height: 47px;width: 100%;text-align: center;">
<div
class="flex align-items-c justify-content-c"
style="margin-top: 11px;border-bottom: 1px solid #EBEEF5;padding-bottom: 10px;gap: 10px"
>
<div class="flex align-items-c justify-content-c miner-navbar fs14">
<el-icon
class="el-icon-caret-left cursor-pointer"
@click.native="changePageDown('down')"
>
</el-icon>
<el-input
style="height: 23px;width: 50px;text-align: center"
<input
style="width: 50px;text-align: center"
v-model="copyValue"
:min="0"
class="fs13 miner-input el-input"
@blur="blursChange"
></el-input>
<span class="ml5">/ {{ mdJsons.length }}</span>
></input>
<span class="mh5">/ </span>
<span>{{ mdJsons.length }}</span>
<el-icon
class="el-icon-caret-right cursor-pointer"
@click.native="changePageUp('up')"
@@ -151,6 +151,7 @@ export default {
mdJsons: {},
finishenEnd: false,
fileName: '',
showPdf:true,
recordId: '', //pdf 记录的id
endEmit: false,
tab: '0',
@@ -662,7 +663,9 @@ export default {
JSON.parse(JSON.stringify(res.content.content.pdf_info))
)
// this.$refs.iframe 重新刷新iframe
if( this.$refs.iframe){
this.$refs.iframe.contentWindow.location.reload()
}
this.getPDFDetailMarkDown()
})
@@ -809,6 +812,11 @@ export default {
if (res) {
this.mdPges = res.content.content.pages
this.fileName = res.content.content.name
// 隐藏非pdf文件
this.showPdf = this.fileName.indexOf('.pdf') > 0;
this.recordId = res.content.content.recordId
switch (res.content.content.status) {
case 0:
@@ -923,6 +931,21 @@ export default {
}
</script>
<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 {
line-height: 25px;
}