档案采集图片上传修改,识别进度提示修改

master
wanglei 2 years ago
parent 547a21a38d
commit ec8505e42b

@ -77,7 +77,7 @@
<el-dialog title="档案文件上传" :visible.sync="upload.open" width="700px" append-to-body> <el-dialog title="档案文件上传" :visible.sync="upload.open" width="700px" append-to-body>
<div style="margin-bottom: 30px;display: flex;min-height: 300px;" v-loading="upload.loading"> <div style="margin-bottom: 30px;display: flex;min-height: 300px;" v-loading="upload.loading">
<div style="width:250px;border: 1px solid #eee; padding: 10px;max-height: 500px;overflow-y: auto"> <div style="width:250px;border: 1px solid #eee; padding: 10px;max-height: 400px;overflow-y: auto">
<div style="margin-bottom: 5px;">档案室密集柜</div> <div style="margin-bottom: 5px;">档案室密集柜</div>
<el-tree <el-tree
:data="shuJiaOptions" :data="shuJiaOptions"
@ -97,6 +97,7 @@
<el-upload :show-file-list="false" :fileSize="200" <el-upload :show-file-list="false" :fileSize="200"
ref="upload" ref="upload"
action="#" action="#"
accept="image/*"
drag drag
:before-upload="beforeUpload" :before-upload="beforeUpload"
:http-request="httpRequest" :http-request="httpRequest"
@ -104,7 +105,7 @@
> >
<i class="el-icon-upload"></i> <i class="el-icon-upload"></i>
<div class="el-upload__text">将文件拖到此处<em>点击上传</em></div> <div class="el-upload__text">将文件拖到此处<em>点击上传</em></div>
<div class="el-upload__tip" slot="tip">只能上传jpg/png文件且不超过500kb</div> <div class="el-upload__tip" slot="tip">只能上传图片且不超过200MB</div>
</el-upload> </el-upload>
<ul class="el-upload-list el-upload-list--text" style="max-height:200px;overflow-y:scroll;padding: 15px;"> <ul class="el-upload-list el-upload-list--text" style="max-height:200px;overflow-y:scroll;padding: 15px;">
@ -132,7 +133,7 @@
<el-dialog title="扫描文件上传" :visible.sync="smwj.open" width="1000px" append-to-body> <el-dialog title="扫描文件上传" :visible.sync="smwj.open" width="1000px" append-to-body>
<div style="margin-bottom: 30px;display: flex;align-items:start;min-height: 300px;" v-loading="smwj.loading"> <div style="margin-bottom: 30px;display: flex;align-items:start;min-height: 300px;" v-loading="smwj.loading">
<div style="width:250px;border: 1px solid #eee; padding: 10px;max-height: 500px;overflow-y: auto"> <div style="width:250px;border: 1px solid #eee; padding: 10px;max-height: 400px;overflow-y: auto">
<div style="margin-bottom: 5px;">档案室密集柜</div> <div style="margin-bottom: 5px;">档案室密集柜</div>
<el-tree <el-tree
:data="shuJiaOptions" :data="shuJiaOptions"
@ -206,10 +207,9 @@
</el-dialog> </el-dialog>
<div class="myProgress" v-show="openProgress"> <div class="myProgress" v-show="openProgress">
<!-- <el-progress type="circle" :percentage="percentage"></el-progress>-->
<div style="font-size: 50px"> <div style="font-size: 50px">
<span style="color: #409EFF">{{ percentage }}</span> / <span style="color: #409EFF">{{ percentage }}</span> /
<span style="color: #67C23A">{{ pictureRecard.length }} </span> <span style="color: #67C23A">{{ checkLength }} </span>
</div> </div>
<div style="margin-top:20px;">拼命识别中...</div> <div style="margin-top:20px;">拼命识别中...</div>
</div> </div>
@ -218,7 +218,6 @@
</template> </template>
<script> <script>
import { catalogTreeselect } from "@/api/system/user";
import { listCatalog } from "@/api/dangan/catalog"; import { listCatalog } from "@/api/dangan/catalog";
import Treeselect from "@riophae/vue-treeselect"; import Treeselect from "@riophae/vue-treeselect";
import "@riophae/vue-treeselect/dist/vue-treeselect.css"; import "@riophae/vue-treeselect/dist/vue-treeselect.css";
@ -260,6 +259,7 @@ export default {
// //
shuJiaOptions: [], shuJiaOptions: [],
pictureRecard: [], pictureRecard: [],
checkLength: 0,
// //
checkAll: false, checkAll: false,
// //
@ -586,6 +586,7 @@ export default {
}, },
// OCR // OCR
OCRRecognition(){ OCRRecognition(){
this.checkLength = 0;
let arr = []; let arr = [];
let singeOrDouble = 0 let singeOrDouble = 0
if(!this.single){ if(!this.single){
@ -597,6 +598,9 @@ export default {
arr.push(item) arr.push(item)
} }
}) })
this.checkLength = arr.length;
if(arr.length>0){ if(arr.length>0){
this.percentage = 0; this.percentage = 0;
this.openProgress = true; this.openProgress = true;
@ -621,7 +625,7 @@ export default {
}); });
this.Interval = setInterval(()=> { this.Interval = setInterval(()=> {
if(this.percentage===this.pictureRecard.length||this.percentage>this.pictureRecard.length){ if(this.percentage===this.checkLength || this.percentage>this.checkLength){
clearInterval(this.Interval); clearInterval(this.Interval);
this.Interval = null; this.Interval = null;
}else { }else {
@ -667,11 +671,10 @@ export default {
} }
}) })
.then( (response)=> { .then( (response)=> {
// this.percentage = Math.round((response.data.file_counts/this.pictureRecard.length)*100);
this.percentage = response.data.file_counts this.percentage = response.data.file_counts;
if(this.percentage===this.pictureRecard.length||this.percentage>this.pictureRecard.length){ if(this.percentage===this.checkLength||this.percentage>this.checkLength){
clearInterval(this.Interval); clearInterval(this.Interval);
this.Interval = null; this.Interval = null;
} }

Loading…
Cancel
Save