From e49e32ec2a736cc0f8488413cbf336e8257c8879 Mon Sep 17 00:00:00 2001 From: wanglei Date: Tue, 4 Jun 2024 10:39:59 +0800 Subject: [PATCH] =?UTF-8?q?=E6=A1=A3=E6=A1=88=E9=87=87=E9=9B=86=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dangan-ui/src/api/dangan/collection.js | 10 +++ .../src/views/dangan/collection/index.vue | 78 +++++++++++++++---- 2 files changed, 72 insertions(+), 16 deletions(-) diff --git a/dangan-ui/src/api/dangan/collection.js b/dangan-ui/src/api/dangan/collection.js index 1acbb98..7b4cbff 100644 --- a/dangan-ui/src/api/dangan/collection.js +++ b/dangan-ui/src/api/dangan/collection.js @@ -23,6 +23,16 @@ export function collectRecongnize(data) { } +// 新增档案目录 组 +export function collectRecongnizeZu(data) { + return request({ + url: '/dangan/collect/recongnizeZu', + method: 'post', + data: data + }) +} + + // 获取进度条 export function collectProgress() { return request({ diff --git a/dangan-ui/src/views/dangan/collection/index.vue b/dangan-ui/src/views/dangan/collection/index.vue index 9533924..b11efa5 100644 --- a/dangan-ui/src/views/dangan/collection/index.vue +++ b/dangan-ui/src/views/dangan/collection/index.vue @@ -37,10 +37,17 @@ OCR识别 -
+
+
+ +
+ 是否一组[OCR最多选择2张识别] + 是否双面 +
+ 全选
@@ -215,7 +222,7 @@ import { catalogTreeselect } from "@/api/system/user"; import Treeselect from "@riophae/vue-treeselect"; import "@riophae/vue-treeselect/dist/vue-treeselect.css"; import { listBookshelf } from "@/api/dangan/bookshelf"; -import { collectSaves, collectRecongnize, collectProgress } from "@/api/dangan/collection"; +import { collectSaves, collectRecongnize, collectProgress, collectRecongnizeZu } from "@/api/dangan/collection"; import '@/utils/WebScan'; export default { @@ -256,6 +263,10 @@ export default { pictureRecard: [], // 是否全选 checkAll: false, + // 是否一组 + isYiZu: false, + // 是否双面 + isSuangMian: false, // 扫描文件上传 smwj: { loading: false, @@ -584,22 +595,57 @@ export default { }, // OCR识别 OCRRecognition(){ - let arr = []; - this.pictureRecard.forEach(item => { - if(item.checked){ - arr.push(item) - } - }) - if(arr.length>0){ - collectRecongnize(arr).then(response => { - this.pictureRecard = []; - this.$modal.msgSuccess("操作成功"); - }); + if(this.isYiZu){ + let checked = []; + let unchecked = []; + let singeOrDouble = 0 + if(this.isSuangMian){ + singeOrDouble = 1 + } + this.pictureRecard.forEach(item => { + item.singeOrDouble = singeOrDouble + if(item.checked){ + checked.push(item) + }else { + unchecked.push(item) + } + }) + if(checked.length>0){ //collectRecongnizeZu + collectRecongnizeZu({ + checked, + unchecked + }).then(response => { + this.pictureRecard = []; + this.$modal.msgSuccess("操作成功"); + }); + }else { + this.$alert(`请先选择需要识别的档案!`, `提示`, { + type: 'warning' + }); + } }else { - this.$alert(`请先选择需要识别的档案!`, `提示`, { - type: 'warning' - }); + let arr = []; + let singeOrDouble = 0 + if(this.isSuangMian){ + singeOrDouble = 1 + } + this.pictureRecard.forEach(item => { + item.singeOrDouble = singeOrDouble + if(item.checked){ + arr.push(item) + } + }) + if(arr.length>0){ + collectRecongnize(arr).then(response => { + this.pictureRecard = []; + this.$modal.msgSuccess("操作成功"); + }); + }else { + this.$alert(`请先选择需要识别的档案!`, `提示`, { + type: 'warning' + }); + } } }, // 删除 点击上传