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

master
wanglei 1 year ago
parent e6ef9730f9
commit 37fcd5a964

@ -19,17 +19,26 @@ export function collectRecongnize(data) {
return request({ return request({
url: '/dangan/collect/recongnize', url: '/dangan/collect/recongnize',
method: 'post', method: 'post',
timeout: 100000000,
data: data data: data
}) })
} }
// 识别 组 // 识别 组
export function collectRecongnizeZu(data) { /*export function collectRecongnizeZu(data) {
return request({ return request({
url: '/dangan/collect/recongnizeZu', url: '/dangan/collect/recongnizeZu',
method: 'post', method: 'post',
timeout: 1000000, timeout: 1000000,
data: data 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' 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('会话已过期,或者被挤下线,请重新登录。') return Promise.reject('会话已过期,或者被挤下线,请重新登录。')
} else if (code === 500) { } else if (code === 500) {
Message({ message: msg, type: 'error' }) Message({ message: msg, type: 'error' })
return Promise.reject(new Error(msg)) return Promise.reject(res.data)
} else if (code === 601) { } else if (code === 601) {
Message({ message: msg, type: 'warning' }) Message({ message: msg, type: 'warning' })
return Promise.reject('error') return Promise.reject('error')

@ -49,10 +49,6 @@
<div v-if="pictureRecard.length>0"> <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> <el-checkbox v-model="checkAll" @change="handleCheckAllChange"></el-checkbox>
<div style="margin: 15px 0;"></div> <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)"> <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> </el-dialog>
<div class="myProgress" v-show="openProgress"> <!--采集识别失败提示-->
<div style="font-size: 50px"> <el-dialog
<span style="color: #409EFF">{{ percentage }}</span> / title="提示"
<span style="color: #67C23A">{{ checkLength }} </span> :visible.sync="tsVisible"
width="500px">
<div style="padding: 0 30px; line-height: 30px">
OCR识别任务提交失败请选择暂不处理继续采集重新提交任务去任务记录查看!
</div> </div>
<div style="margin-top:20px;">拼命识别中...</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>
</el-dialog>
</div> </div>
</template> </template>
@ -222,16 +226,16 @@ 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";
import { getCabinetTree } from "@/api/dangan/cabinet"; 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 '@/utils/WebScan';
import axios from 'axios'
export default { export default {
name: "Collection", name: "Collection",
components: {Treeselect}, components: {Treeselect},
data() { data() {
return { return {
isFails: false, tsVisible: false,
taskId: null,
// 0 1 2 // 0 1 2
pixel: 1, pixel: 1,
// //
@ -272,9 +276,6 @@ export default {
wlsjNode: undefined, wlsjNode: undefined,
list: [] list: []
}, },
percentage: 0,
openProgress: false,
Interval : null
}; };
}, },
watch: { watch: {
@ -602,43 +603,42 @@ export default {
this.checkLength = arr.length; this.checkLength = arr.length;
if(arr.length>0){ if(arr.length>0){
this.percentage = 0;
this.openProgress = true;
collectRecongnize(arr).then(response => { 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.pictureRecard = [];
this.checkAll = false;
this.$modal.msgSuccess(response.msg); this.$modal.msgSuccess(response.msg);
}).catch((err)=>{
console.log(123,err);
if(err.taskId){
this.taskId = err.taskId;
this.tsVisible = true;
} }
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()
}
}, 5000);
}else { }else {
this.$alert(`请先选择需要识别的档案!`, `提示`, { this.$alert(`请先选择需要识别的档案!`, `提示`, {
type: 'warning' 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){ deleteFile(index){
this.fileList.splice(index, 1); this.fileList.splice(index, 1);
@ -661,29 +661,7 @@ export default {
// File // File
const file = new File([blob], fileName, {type: mimeString}); const file = new File([blob], fileName, {type: mimeString});
return file; 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> </script>

@ -51,7 +51,6 @@
</el-table-column> </el-table-column>
<el-table-column label="档案目录路径" align="center" prop="muPath" min-width="120" show-overflow-tooltip/> <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="num" />
<el-table-column label="任务状态" align="center" prop="status" min-width="100" show-overflow-tooltip> <el-table-column label="任务状态" align="center" prop="status" min-width="100" show-overflow-tooltip>
<template slot-scope="scope"> <template slot-scope="scope">
<dict-tag :options="dict.type.task_status" :value="scope.row.status"/> <dict-tag :options="dict.type.task_status" :value="scope.row.status"/>
@ -59,19 +58,23 @@
</el-table-column> </el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width"> <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button
v-if="scope.row.status==='0'"
size="mini"
type="text"
@click="onReRecongnize(scope.row)"
>重新提交任务</el-button>
<el-button <el-button
v-if="scope.row.status==='2'" v-if="scope.row.status==='2'"
size="mini" size="mini"
type="text" type="text"
@click="handleUpdate1(scope.row)" @click="handleUpdate1(scope.row)"
v-hasPermi="['dangan:task:edit']"
>查看任务详情</el-button> >查看任务详情</el-button>
<el-button <el-button
v-if="scope.row.status==='1'" v-if="scope.row.status==='1'"
size="mini" size="mini"
type="text" type="text"
@click="handleUpdate(scope.row)" @click="handleUpdate(scope.row)"
v-hasPermi="['dangan:task:edit']"
>查看任务进度</el-button> >查看任务进度</el-button>
</template> </template>
</el-table-column> </el-table-column>
@ -97,20 +100,50 @@
</div> </div>
<div class="num" v-if="form.status==='2'"> <div class="num" v-if="form.status==='2'">
<span style="color:#67C23A;">成功{{ form.successNum }}</span> <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>
<div class="num" v-if="form.status==='2'"> <div class="num" v-if="form.status==='2'">
<span style="color:#F56C6C;">失败{{ form.failNum }}</span> <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>
</div> </div>
</el-dialog> </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> </div>
</template> </template>
<script> <script>
import { listTask } from "@/api/dangan/task"; import { listTask, listByIds } from "@/api/dangan/task";
import { reRecongnize } from "@/api/dangan/collection";
export default { export default {
name: "Task", name: "Task",
@ -136,7 +169,19 @@
num: null, num: null,
status: null status: null
}, },
form: {} form: {},
//
xgtp:{
title: null,
open: false,
list: [],
total: 0,
queryParams:{
pageNum: 1,
pageSize: 10,
ids: null
}
}
}; };
}, },
created() { created() {
@ -152,6 +197,31 @@
this.loading = false; 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() { handleQuery() {
this.queryParams.pageNum = 1; this.queryParams.pageNum = 1;
@ -173,6 +243,12 @@
this.open = true; this.open = true;
this.title = "任务详情"; this.title = "任务详情";
}, },
onReRecongnize(row){
reRecongnize({taskId: row.id}).then(response => {
this.$modal.msgSuccess(response.msg);
this.getList()
})
},
} }
}; };
</script> </script>

Loading…
Cancel
Save