ocr校核

This commit is contained in:
caoyang
2022-02-18 15:29:04 +08:00
parent 6433730819
commit 90a3073359
2 changed files with 52 additions and 1 deletions
@@ -151,6 +151,7 @@
<!-- <uploadFile ref="uploadFile" @uploadSuccess="uploadSuccess"></uploadFile>-->
</a-card>
</div>
</template>
<script>
@@ -161,6 +162,8 @@
import docTable from './modules/docTable'
import frameAssembly from '@/components/frameAssembly/index'
import ocrUpload from '@/components/ocrUpload/index'
import { ACCESS_TOKEN } from "@/store/mutation-types"
import Vue from 'vue'
// import uploadFile from '@/components/uploadFile/file'
export default {
name: 'ocr',
@@ -455,7 +458,11 @@
},
//校核确认
handleOkCheck(){
window.open(`http://10.0.1.25:8080/jero-boot/ocr/pageOffice/word`)
this.$router.push({
path:'/ocr/ocrSplit'
})
// const token = Vue.ls.get(ACCESS_TOKEN);
// window.open('http://10.0.1.31:8080/jero-boot/ocr/pageOffice/word?token='+token)
this.checkVisible=false
},
//校核取消
@@ -0,0 +1,44 @@
<template>
<iframe id="iframe" frameborder="0"></iframe>
</template>
<script>
import { ACCESS_TOKEN } from "@/store/mutation-types"
import Vue from 'vue'
export default {
name: 'ocrSplit',
data(){
return{
token:Vue.ls.get(ACCESS_TOKEN),
}
},
mounted() {
setTimeout(() => {
var iframe = document.querySelector("#iframe");
this.populateIframe(iframe, [["X-Access-Token", this.token]]);
}, 0);
},
methods:{
populateIframe(iframe, headers) {
var xhr = new XMLHttpRequest();
xhr.open("GET", 'http://10.0.1.31:8080/jero-boot/ocr/pageOffice/word');
xhr.responseType = "blob";
headers.forEach((header) => {
xhr.setRequestHeader(header[0], header[1]);
});
xhr.onreadystatechange = () => {
if (xhr.readyState === xhr.DONE) {
if (xhr.status === 200) {
iframe.src = URL.createObjectURL(xhr.response);
}
}
};
xhr.send();
},
},
}
</script>
<style scoped>
</style>