From 26ebe5e79789d431d8092dd9f88a53d3e8781187 Mon Sep 17 00:00:00 2001 From: lizijiee <562949697@qq.com> Date: Mon, 25 Mar 2024 22:59:15 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E4=BB=BB=E5=8A=A1=E5=8C=85=E9=80=BB?= =?UTF-8?q?=E8=BE=91=E6=8E=A5=E5=8F=A3=E8=81=94=E8=B0=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/home/main.ts | 104 +++++++++++++++- src/views/home/content/Content.vue | 112 ++++++++++++++---- .../content/modal/PackageSettingsModal.vue | 14 +-- 3 files changed, 193 insertions(+), 37 deletions(-) diff --git a/src/api/home/main.ts b/src/api/home/main.ts index ea24139..8072c2c 100644 --- a/src/api/home/main.ts +++ b/src/api/home/main.ts @@ -1,9 +1,9 @@ -import { pickBy } from 'lodash-es' -import { http } from '@/utils/http/axios' -import type { CheckParam, PageParam, QueryPictureParam, UploadParam } from '/#/api' import { ContentTypeEnum } from '@/enums/httpEnum' import { notEmpty } from '@/utils' import { formatToDate2 } from '@/utils/dateUtil' +import { http } from '@/utils/http/axios' +import { pickBy } from 'lodash-es' +import type { CheckParam, PageParam, QueryPictureParam, UploadParam } from '/#/api' /** * 获取查重列表 @@ -103,6 +103,104 @@ export async function oneClickCheck(params: Partial = { search_histo }) } +/** + * 增加生成任务包逻辑—一键查重 + * @param note + * @returns + */ + export async function oneClickCheckTaskPackage(params: Partial = { search_history: '0' }) { + const notEmptyParams = pickBy(params, notEmpty) + + Object.keys(notEmptyParams).forEach((key) => { + const val = notEmptyParams[key] + + if (Array.isArray(val)) + notEmptyParams[key] = val.join(',') + }) + + return http.request({ + url: `/ocr/checkDuplicate/openCheckDuplicate`, + method: 'get', + params: notEmptyParams, + headers: { 'Content-Type': ContentTypeEnum.FORM_DATA }, + }) +} + +/** + * 获取任务编号 + * @param note + * @returns + */ + export async function getLastCheckNo() { + + return http.request({ + url: `/ocr/checkDuplicate/getLastCheckNo`, + method: 'get', + headers: { 'Content-Type': ContentTypeEnum.FORM_DATA }, + }) +} +/** + * 获取查重任务状态 + * @param note + * @returns + */ + export async function getCheckDuplicateStatus(checkDuplicateNo) { + + return http.request({ + url: `/ocr/checkDuplicate/getCheckDuplicateStatus`, + method: 'get', + params: { checkDuplicateNo }, + headers: { 'Content-Type': ContentTypeEnum.FORM_DATA }, + }) +} +/** + * 创建任务包 + * @param + * @returns + */ + export async function createPackage(params) { + + return http.request({ + url: `/ocr/ocrTaskPackage/createPackage`, + method: 'post', + params + }) +} +/** + * 任务完成——创建任务包前——获取图片列表 + * @param + * @returns + */ +export async function queryPageListByCheckNo(params: any): Promise { + const notEmptyParams = pickBy(params, notEmpty) + + Object.keys(notEmptyParams).forEach((key) => { + const val = notEmptyParams[key] + + if (key === 'izyear') { + const start = formatToDate2(val[0]) + const end = formatToDate2(val[1]) + notEmptyParams[key] = `${start}-${end}` + } + + if (Array.isArray(notEmptyParams[key])) + notEmptyParams[key] = val.join(',') + }) + + const res = await http.request({ + url: `/ocr/checkDuplicate/queryPageListByCheckNo`, + method: 'get', + params: notEmptyParams, + headers: { 'Content-Type': ContentTypeEnum.FORM_DATA }, + }) + + const { data: { records, pages, total } } = res + return { + pageCount: pages, + data: records, + total, + } +} /** * 获取图片列表 * @param params diff --git a/src/views/home/content/Content.vue b/src/views/home/content/Content.vue index 46e5ce1..9ef76b2 100644 --- a/src/views/home/content/Content.vue +++ b/src/views/home/content/Content.vue @@ -1,5 +1,5 @@ @@ -85,11 +84,6 @@ function afterLeave() { - - - 是否对比历史数据 - - 是否给重复图片添加重复标识