mirror of
http://112.124.100.131/ebiz-ai/ebiz-ai-knowledge-manage.git
synced 2025-12-24 10:12:58 +08:00
fix(minerU): 修复 PDF 识别状态和Markdown 加载问题
- 在 getPDFDetailBbox 方法中添加 iframe 刷新和 Markdown 加载 - 完善 getMinerUStatus 方法,增加识别失败的错误提示 - 优化代码结构,提高可读性和维护性
This commit is contained in:
@@ -75,7 +75,7 @@ export function minerUQuery(params) {
|
|||||||
}
|
}
|
||||||
//minerU 获取markdown
|
//minerU 获取markdown
|
||||||
export function minerUMarkDown(params) {
|
export function minerUMarkDown(params) {
|
||||||
return getUrl(`document/mineru/md?documentId=${params.documentId}`)
|
return getUrl(`/document/mineru/md?documentId=${params.documentId}`)
|
||||||
}
|
}
|
||||||
|
|
||||||
// minerU 获取pdf
|
// minerU 获取pdf
|
||||||
|
|||||||
@@ -7,6 +7,7 @@
|
|||||||
<iframe
|
<iframe
|
||||||
v-if="isShowPdf"
|
v-if="isShowPdf"
|
||||||
id="iframe"
|
id="iframe"
|
||||||
|
ref="iframe"
|
||||||
:src="`${iframeSrc}/pdfjs-dist/web/viewer.html?file=${encodeURIComponent(prdUrl)}`"
|
:src="`${iframeSrc}/pdfjs-dist/web/viewer.html?file=${encodeURIComponent(prdUrl)}`"
|
||||||
class="miner-u el-card is-always-shadow ml20"
|
class="miner-u el-card is-always-shadow ml20"
|
||||||
></iframe>
|
></iframe>
|
||||||
@@ -221,6 +222,9 @@ export default {
|
|||||||
getPDFDetailBbox() {
|
getPDFDetailBbox() {
|
||||||
minerUBbox({ documentId: this.documentId }).then(res => {
|
minerUBbox({ documentId: this.documentId }).then(res => {
|
||||||
this.bboxList = this.formatJson(JSON.parse(JSON.stringify(res.content.content)))
|
this.bboxList = this.formatJson(JSON.parse(JSON.stringify(res.content.content)))
|
||||||
|
// this.$refs.iframe 重新刷新iframe
|
||||||
|
this.$refs.iframe.contentWindow.location.reload()
|
||||||
|
this.getPDFDetailMarkDown()
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
changeTab() {
|
changeTab() {
|
||||||
@@ -263,8 +267,6 @@ export default {
|
|||||||
getMinerUStatus() {
|
getMinerUStatus() {
|
||||||
this.finishedMiner = true
|
this.finishedMiner = true
|
||||||
minerUQuery({ id: this.documentId }).then(res => {
|
minerUQuery({ id: this.documentId }).then(res => {
|
||||||
console.log(res)
|
|
||||||
|
|
||||||
let mineruStatus = res.content.content.mineruStatus
|
let mineruStatus = res.content.content.mineruStatus
|
||||||
switch (mineruStatus) {
|
switch (mineruStatus) {
|
||||||
case 0:
|
case 0:
|
||||||
@@ -277,10 +279,13 @@ export default {
|
|||||||
case '1':
|
case '1':
|
||||||
this.finishedMiner = false
|
this.finishedMiner = false
|
||||||
this.getPDFDetailBbox()
|
this.getPDFDetailBbox()
|
||||||
this.getPDFDetailMarkDown()
|
|
||||||
break
|
break
|
||||||
default:
|
default:
|
||||||
this.finishedMiner = false
|
this.finishedMiner = false
|
||||||
|
this.$message({
|
||||||
|
message: '识别失败',
|
||||||
|
type: 'error'
|
||||||
|
})
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user