档案采集、任务记录 重新提交识别任务修改

master
wanglei 1 year ago
parent e6ef9730f9
commit 37fcd5a964

@ -19,17 +19,26 @@ export function collectRecongnize(data) {
return request({
url: '/dangan/collect/recongnize',
method: 'post',
timeout: 100000000,
data: data
})
}
// 识别 组
export function collectRecongnizeZu(data) {
/*export function collectRecongnizeZu(data) {
return request({
url: '/dangan/collect/recongnizeZu',
method: 'post',
timeout: 1000000,
data: data
})
}*/
// 重新提交识别
export function reRecongnize(data) {
return request({
url: '/dangan/collect/reRecongnize',
method: 'post',
data: data
})
}

@ -42,3 +42,12 @@ export function delTask(id) {
method: 'delete'
})
}
// 查询图片
export function listByIds(query) {
return request({
url: '/dangan/pictureRecard/listByIds',
method: 'get',
params: query
})
}

@ -97,7 +97,7 @@ service.interceptors.response.use(res => {
return Promise.reject('会话已过期,或者被挤下线,请重新登录。')
} else if (code === 500) {
Message({ message: msg, type: 'error' })
return Promise.reject(new Error(msg))
return Promise.reject(res.data)
} else if (code === 601) {
Message({ message: msg, type: 'warning' })
return Promise.reject('error')

@ -49,10 +49,6 @@
<div v-if="pictureRecard.length>0">
<div v-show="isFails" style="margin-bottom: 10px;width:80%;min-width:400px">
<el-alert title="未识别图片,请重新识别" type="warning" effect="dark" :closable="false"></el-alert>
</div>
<el-checkbox v-model="checkAll" @change="handleCheckAllChange"></el-checkbox>
<div style="margin: 15px 0;"></div>
<el-checkbox v-for="item in pictureRecard" :label="item.picName" :key="item.id" v-model="item.checked" @change="handleCheckChange(item)">
@ -206,13 +202,21 @@
</el-dialog>
<div class="myProgress" v-show="openProgress">
<div style="font-size: 50px">
<span style="color: #409EFF">{{ percentage }}</span> /
<span style="color: #67C23A">{{ checkLength }} </span>
<!--采集识别失败提示-->
<el-dialog
title="提示"
:visible.sync="tsVisible"
width="500px">
<div style="padding: 0 30px; line-height: 30px">
OCR识别任务提交失败请选择暂不处理继续采集重新提交任务去任务记录查看!
</div>
<div slot="footer" class="dialog-footer">
<el-button type="primary" plain @click="onZbqljxcj"></el-button>
<el-button type="primary" plain @click="qxtjTask"></el-button>
<el-button type="primary" plain @click="goTask"></el-button>
</div>
<div style="margin-top:20px;">拼命识别中...</div>
</div>
</el-dialog>
</div>
</template>
@ -222,16 +226,16 @@ import { listCatalog } from "@/api/dangan/catalog";
import Treeselect from "@riophae/vue-treeselect";
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
import { getCabinetTree } from "@/api/dangan/cabinet";
import { collectSaves, collectRecongnize } from "@/api/dangan/collection";
import { collectSaves, collectRecongnize, reRecongnize } from "@/api/dangan/collection";
import '@/utils/WebScan';
import axios from 'axios'
export default {
name: "Collection",
components: {Treeselect},
data() {
return {
isFails: false,
tsVisible: false,
taskId: null,
// 0 1 2
pixel: 1,
//
@ -272,9 +276,6 @@ export default {
wlsjNode: undefined,
list: []
},
percentage: 0,
openProgress: false,
Interval : null
};
},
watch: {
@ -602,43 +603,42 @@ export default {
this.checkLength = arr.length;
if(arr.length>0){
this.percentage = 0;
this.openProgress = true;
collectRecongnize(arr).then(response => {
if(response.fails&&response.fails.length>0){
this.pictureRecard = response.fails
this.isFails = true;
this.$alert(`${response.msg},请重新识别失败档案!`, `提示`, {
type: 'warning'
});
}else {
this.isFails = false;
this.pictureRecard = [];
this.$modal.msgSuccess(response.msg);
}
this.pictureRecard = [];
this.checkAll = false;
clearInterval(this.Interval);
this.openProgress = false;
}).catch(()=>{
clearInterval(this.Interval);
this.openProgress = false;
});
this.Interval = setInterval(()=> {
if(this.percentage===this.checkLength || this.percentage>this.checkLength){
clearInterval(this.Interval);
this.Interval = null;
}else {
this.getProgress()
this.$modal.msgSuccess(response.msg);
}).catch((err)=>{
console.log(123,err);
if(err.taskId){
this.taskId = err.taskId;
this.tsVisible = true;
}
}, 5000);
});
}else {
this.$alert(`请先选择需要识别的档案!`, `提示`, {
type: 'warning'
});
}
},
//
onZbqljxcj(){
this.pictureRecard = [];
this.checkAll = false;
this.tsVisible = false;
},
//
qxtjTask(){
reRecongnize({taskId: this.taskId}).then(response => {
this.pictureRecard = [];
this.checkAll = false;
this.tsVisible = false;
this.$modal.msgSuccess(response.msg);
})
},
//
goTask(){
this.$router.push("/task");
},
//
deleteFile(index){
this.fileList.splice(index, 1);
@ -661,29 +661,7 @@ export default {
// File
const file = new File([blob], fileName, {type: mimeString});
return file;
},
/** 查询识别进度 */
getProgress() {
// ID
//axios.post('http://20.206.150.166:22443/get_file_count',`username=${this.$store.state.user.name}`, {
axios.post('http://123.57.142.195:443/get_file_count',`username=${this.$store.state.user.name}`, {
headers: {
'Content-Type': 'application/x-www-form-urlencoded'
}
})
.then( (response)=> {
this.percentage = response.data.file_counts;
if(this.percentage===this.checkLength||this.percentage>this.checkLength){
clearInterval(this.Interval);
this.Interval = null;
}
}).catch((error)=> {
console.log(error)
})
},
}
}
};
</script>

@ -51,7 +51,6 @@
</el-table-column>
<el-table-column label="档案目录路径" align="center" prop="muPath" min-width="120" show-overflow-tooltip/>
<el-table-column label="总数量" align="center" prop="num" />
<el-table-column label="任务状态" align="center" prop="status" min-width="100" show-overflow-tooltip>
<template slot-scope="scope">
<dict-tag :options="dict.type.task_status" :value="scope.row.status"/>
@ -59,19 +58,23 @@
</el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
v-if="scope.row.status==='0'"
size="mini"
type="text"
@click="onReRecongnize(scope.row)"
>重新提交任务</el-button>
<el-button
v-if="scope.row.status==='2'"
size="mini"
type="text"
@click="handleUpdate1(scope.row)"
v-hasPermi="['dangan:task:edit']"
>查看任务详情</el-button>
<el-button
v-if="scope.row.status==='1'"
size="mini"
type="text"
@click="handleUpdate(scope.row)"
v-hasPermi="['dangan:task:edit']"
>查看任务进度</el-button>
</template>
</el-table-column>
@ -97,20 +100,50 @@
</div>
<div class="num" v-if="form.status==='2'">
<span style="color:#67C23A;">成功{{ form.successNum }}</span>
<el-link :underline="false" type="primary" style="font-size:16px" v-if="form.successNum && form.successNum>0"></el-link>
<el-link :underline="false" type="primary" style="font-size:16px"
v-if="form.successNum && form.successNum>0" @click="getSuccessPicture(form.successIds)">成功图片</el-link>
</div>
<div class="num" v-if="form.status==='2'">
<span style="color:#F56C6C;">失败{{ form.failNum }}</span>
<el-link :underline="false" type="primary" style="font-size:16px" v-if="form.failNum && form.failNum>0"></el-link>
<el-link :underline="false" type="primary" style="font-size:16px"
v-if="form.failNum && form.failNum>0" @click="getFailPicture(form.failIds)">失败图片</el-link>
</div>
</div>
</el-dialog>
<!-- 查看相关图片 -->
<el-dialog :title="xgtp.title" :visible.sync="xgtp.open" width="800px" append-to-body top="6vh">
<div>
<el-table v-loading="xgtp.loading" :data="xgtp.list">
<!-- <el-table-column label="档案目录ID" align="center" prop="muId" fixed min-width="90"/>
<el-table-column label="档案目录路径" align="center" prop="muPath" min-width="120" show-overflow-tooltip/>-->
<el-table-column label="上传时间" align="center" prop="createTime" min-width="100" show-overflow-tooltip/>
<el-table-column label="图片路径" align="center" prop="picUrl">
<template slot-scope="scope">
<image-preview :src="scope.row.picUrl" :width="50" :height="50"/>
</template>
</el-table-column>
</el-table>
<pagination
v-show="xgtp.total>0"
:total="xgtp.total"
:page.sync="xgtp.queryParams.pageNum"
:limit.sync="xgtp.queryParams.pageSize"
@pagination="xgtpQuery"
/>
</div>
</el-dialog>
</div>
</template>
<script>
import { listTask } from "@/api/dangan/task";
import { listTask, listByIds } from "@/api/dangan/task";
import { reRecongnize } from "@/api/dangan/collection";
export default {
name: "Task",
@ -136,7 +169,19 @@
num: null,
status: null
},
form: {}
form: {},
//
xgtp:{
title: null,
open: false,
list: [],
total: 0,
queryParams:{
pageNum: 1,
pageSize: 10,
ids: null
}
}
};
},
created() {
@ -152,6 +197,31 @@
this.loading = false;
});
},
getFailPicture(ids){
this.xgtp.queryParams.pageNum = 1;
this.xgtp.queryParams.ids = ids;
this.xgtp.title="失败图片";
this.xgtp.open = true;
this.xgtpQuery();
},
getSuccessPicture(ids){
this.xgtp.queryParams.pageNum = 1;
this.xgtp.queryParams.ids = ids;
this.xgtp.title="成功图片";
this.xgtp.open = true;
this.xgtpQuery();
},
xgtpQuery(){
this.xgtp.list = [];
this.xgtp.loading = true;
listByIds(this.xgtp.queryParams).then(response => {
this.xgtp.list = response.rows;
this.xgtp.total = response.total;
this.xgtp.loading = false;
}).catch(()=>{
this.xgtp.loading = false;
});
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
@ -173,6 +243,12 @@
this.open = true;
this.title = "任务详情";
},
onReRecongnize(row){
reRecongnize({taskId: row.id}).then(response => {
this.$modal.msgSuccess(response.msg);
this.getList()
})
},
}
};
</script>

Loading…
Cancel
Save