ocr校核修改

This commit is contained in:
caoyang
2022-04-12 19:59:44 +08:00
parent 1ddcb671af
commit aa72c65306
5 changed files with 40 additions and 14 deletions
+11 -3
View File
@@ -28,7 +28,12 @@
@cancel="handleErrCancel" @cancel="handleErrCancel"
:footer="false" :footer="false"
> >
<span class="err-value">{{errValue}}</span> <div class="err-value">
<p class="err-item" v-for="item in errValues">
{{item}}
</p>
</div>
<!-- <span class="err-value">{{errValue}}</span>-->
</a-modal> </a-modal>
</div> </div>
</template> </template>
@@ -55,7 +60,8 @@
}, },
cut:'', cut:'',
preErrVisible:false, preErrVisible:false,
errValue:'' errValue:'',
errValues:[]
} }
}, },
computed:{ computed:{
@@ -122,7 +128,9 @@
this.$message.error(val.response.message); this.$message.error(val.response.message);
}else{ }else{
this.preErrVisible=true this.preErrVisible=true
this.errValue=val.response.message let errValue=val.response.message
this.errValues=errValue.split('</br>')
// this.errValue = errValue
} }
} }
@@ -50,7 +50,7 @@
}, },
methods:{ methods:{
beforeUpload(file,fileList) { beforeUpload(file,fileList) {
console.log('file',this.accept,file,fileList,this.myfileList) // console.log('file',this.accept,file,fileList,this.myfileList)
this.fileTypeSatus=false this.fileTypeSatus=false
if(this.myfileList&&this.myfileList.length>=1){ if(this.myfileList&&this.myfileList.length>=1){
// console.log() // console.log()
@@ -93,7 +93,7 @@
info.fileList.splice(index,1) info.fileList.splice(index,1)
} }
}) })
console.log('fileStatue',this.fileTypeSatus) // console.log('fileStatue',this.fileTypeSatus)
if (this.fileTypeSatus) { if (this.fileTypeSatus) {
if (file.size > 100000000) { if (file.size > 100000000) {
this.$message.error(this.errorMessage) this.$message.error(this.errorMessage)
@@ -152,7 +152,7 @@
if(this.myfileList.length > 0){ if(this.myfileList.length > 0){
this.$emit('uploadSuccess', this.fileList) this.$emit('uploadSuccess', this.fileList)
this.$message.destroy() this.$message.destroy()
this.$message.success(`${info.file.name}`+this.$t('fileUploadFailed')); this.$message.success(`${info.file.name}`+this.$t('uploadSuccessful'));
// console.log('fileList111',file,this.fileList,fileList1) // console.log('fileList111',file,this.fileList,fileList1)
} }
} else if (status === 'uploading') { } else if (status === 'uploading') {
@@ -1,6 +1,8 @@
<template> <template>
<a-card> <a-card>
<iframe id="iframe" ref="iframe" frameborder="0" :style="'width:100%;height:'+iframeHeight+'px'"></iframe> <iframe id="iframe" ref="iframe" frameborder="0" :style="'width:100%;height:'+iframeHeight+'px'">
<div class="form"></div>
</iframe>
</a-card> </a-card>
</template> </template>
@@ -18,12 +20,23 @@
} }
}, },
watch:{ watch:{
brownHeight(){ // brownHeight(){
immediate: true // immediate: true
//
} // }
}, },
mounted() { mounted() {
// var iframeTop=document.querySelector("#iframe").offsetHeight
// var formElement = document.querySelector('.form')
// formElement.style.height=iframeTop+'px'
// window.addEventListener('resize', () => {
// var iframeTopNow=document.querySelector("#iframe").offsetHeight
// formElement.style.height=iframeTopNow+'px'
// }, false);
this.iframeTop=this.$refs.iframe.getBoundingClientRect().top this.iframeTop=this.$refs.iframe.getBoundingClientRect().top
this.iframeHeight=this.brownHeight-this.iframeTop-24 this.iframeHeight=this.brownHeight-this.iframeTop-24
window.addEventListener('resize', () => { window.addEventListener('resize', () => {
@@ -40,8 +53,9 @@
methods:{ methods:{
populateIframe(iframe, headers) { populateIframe(iframe, headers) {
var xhr = new XMLHttpRequest(); var xhr = new XMLHttpRequest();
let fileName= this.$route.query.fileName
// xhr.open("GET", 'http://10.0.1.31:8080/jero-boot/ocr/pageOffice/word'); // xhr.open("GET", 'http://10.0.1.31:8080/jero-boot/ocr/pageOffice/word');
xhr.open("GET", 'http://10.0.1.25:8080/jero-boot/ocr/ocrCheck/editorFile'); xhr.open("GET", 'http://10.0.1.25:8080/jero-boot/ocr/ocrCheck/editorFile?fileName='+fileName);
xhr.responseType = "blob"; xhr.responseType = "blob";
headers.forEach((header) => { headers.forEach((header) => {
xhr.setRequestHeader(header[0], header[1]); xhr.setRequestHeader(header[0], header[1]);
@@ -310,6 +310,9 @@
// this.checkVisible=true // this.checkVisible=true
let newUrl = this.$router.resolve({ let newUrl = this.$router.resolve({
path: '/ocr/ocrSplit', path: '/ocr/ocrSplit',
query:{
fileName: val.docRealName
}
}) })
// this.$router.push({ // this.$router.push({
// path:'/ocr/ocrSplit' // path:'/ocr/ocrSplit'
@@ -50,7 +50,8 @@
@cancel="handleErrCancel" @cancel="handleErrCancel"
:footer="false" :footer="false"
> >
<span class="err-value">{{errValue}}</span> <div class="err-value" v-html="errValue"></div>
<!-- <span class="err-value">{{errValue}}</span>-->
</a-modal> </a-modal>
<!-- <split-upload ref="uploadFile" :disabled="disabled" :title="upload1" :accept="accept" @uploadSuccess="uploadSuccess"></split-upload>--> <!-- <split-upload ref="uploadFile" :disabled="disabled" :title="upload1" :accept="accept" @uploadSuccess="uploadSuccess"></split-upload>-->
</a-drawer> </a-drawer>
@@ -286,7 +287,7 @@
this.visible = false; this.visible = false;
this.$emit('visible',false) this.$emit('visible',false)
}else{ }else{
this.$message.warning(res.data.message) // this.$message.warning(res.data.message)
if(res.data.code==1){ if(res.data.code==1){
this.$message.error(res.data.message); this.$message.error(res.data.message);
}else{ }else{