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 1/6] =?UTF-8?q?feat:=20=E4=BB=BB=E5=8A=A1=E5=8C=85?= =?UTF-8?q?=E9=80=BB=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() { - - - 是否对比历史数据 - - 是否给重复图片添加重复标识 From 3d146eb543d36a81a10a746c9b01d67ad89eee78 Mon Sep 17 00:00:00 2001 From: lizijiee <562949697@qq.com> Date: Mon, 25 Mar 2024 23:14:32 +0800 Subject: [PATCH 2/6] =?UTF-8?q?feat:=20=E5=AE=8C=E5=96=84=E4=BB=BB?= =?UTF-8?q?=E5=8A=A1=E5=8C=85=E5=92=8C=E6=9F=A5=E9=87=8D=E4=BB=BB=E5=8A=A1?= =?UTF-8?q?=E5=88=9B=E5=BB=BA=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components.d.ts | 8 -------- src/views/home/content/Content.vue | 27 ++++++++++----------------- 2 files changed, 10 insertions(+), 25 deletions(-) diff --git a/components.d.ts b/components.d.ts index 615d417..3b65693 100644 --- a/components.d.ts +++ b/components.d.ts @@ -17,18 +17,14 @@ declare module 'vue' { NCollapse: typeof import('naive-ui')['NCollapse'] NCollapseItem: typeof import('naive-ui')['NCollapseItem'] NConfigProvider: typeof import('naive-ui')['NConfigProvider'] - NDataTable: typeof import('naive-ui')['NDataTable'] NDatePicker: typeof import('naive-ui')['NDatePicker'] NDialogProvider: typeof import('naive-ui')['NDialogProvider'] NDivider: typeof import('naive-ui')['NDivider'] NDropdown: typeof import('naive-ui')['NDropdown'] - NEmpty: typeof import('naive-ui')['NEmpty'] NForm: typeof import('naive-ui')['NForm'] NFormItem: typeof import('naive-ui')['NFormItem'] - NGi: typeof import('naive-ui')['NGi'] NGrid: typeof import('naive-ui')['NGrid'] NGridItem: typeof import('naive-ui')['NGridItem'] - NIcon: typeof import('naive-ui')['NIcon'] NImage: typeof import('naive-ui')['NImage'] NInput: typeof import('naive-ui')['NInput'] NMessageProvider: typeof import('naive-ui')['NMessageProvider'] @@ -43,11 +39,7 @@ declare module 'vue' { NSpace: typeof import('naive-ui')['NSpace'] NSpin: typeof import('naive-ui')['NSpin'] NSwitch: typeof import('naive-ui')['NSwitch'] - NTabPane: typeof import('naive-ui')['NTabPane'] - NTabs: typeof import('naive-ui')['NTabs'] NTag: typeof import('naive-ui')['NTag'] - NTimeline: typeof import('naive-ui')['NTimeline'] - NTimelineItem: typeof import('naive-ui')['NTimelineItem'] NTooltip: typeof import('naive-ui')['NTooltip'] NUpload: typeof import('naive-ui')['NUpload'] NUploadDragger: typeof import('naive-ui')['NUploadDragger'] diff --git a/src/views/home/content/Content.vue b/src/views/home/content/Content.vue index 9ef76b2..1574f02 100644 --- a/src/views/home/content/Content.vue +++ b/src/views/home/content/Content.vue @@ -213,12 +213,14 @@ async function oneCheck() { reset() loadMore() } else if (checkTaskStatus.value === 1) { + message.success("请等待,查重任务正在创建中..."); return } } }) return } + message.success("请等待,查重任务正在创建中..."); oneClickCheckTaskPackage(asideVal).then((res) => { if (res.code === "OK") { checkDuplicateNo.value = res.data.checkDuplicateNo @@ -234,32 +236,23 @@ async function showLoginSuccessModal() { } async function commitHandler(settingParam) { - // comparehistory: false - // mark: false // 是否给重复图片添加重复标识 - // packagename: "22222" const params = { name: settingParam.packagename, - checkDuplicateNo: checkDuplicateNo.value, - // mark: settingParam.mark + checkDuplicateNo: checkDuplicateNo.value } + const modal = generateModalRef.value as any + modal.showModal() createPackage(params).then((res) => { if (res.code === "OK") { message.success(res.data); + modal.closeModal() } }) - // const asideVal = configStore.getAsideValue - // const finalParam = { ...contentParams, ...asideVal } - // finalParam.buessinessno = settingParam.packagename - // finalParam.search_history = settingParam.comparehistory ? 1 : 0 + const asideVal = configStore.getAsideValue + const finalParam = { ...asideVal } + finalParam.buessinessno = settingParam.packagename + finalParam.search_history = settingParam.comparehistory ? 1 : 0 - // const modal = generateModalRef.value as any - // modal.showModal() - - // oneClickCheck(finalParam).then(() => { - // modal.closeModal() - // }, () => { - // modal.closeModal() - // }) } onMounted(() => { From b8b9db8294247ea5edaa69fabfc3593cf2faa487 Mon Sep 17 00:00:00 2001 From: Dragon <> Date: Tue, 26 Mar 2024 00:01:41 +0800 Subject: [PATCH 3/6] ui --- src/views/task/content/Content.vue | 9 +++ src/views/task/content/History.vue | 53 ++++++++++++++--- src/views/task/content/PictureTable.vue | 75 ++++++++++++++++++++++--- 3 files changed, 121 insertions(+), 16 deletions(-) diff --git a/src/views/task/content/Content.vue b/src/views/task/content/Content.vue index b445f99..5733124 100644 --- a/src/views/task/content/Content.vue +++ b/src/views/task/content/Content.vue @@ -582,6 +582,15 @@ function getPercent(pictureid: string) { From 07622e3a5aa0258b1480945e08d626197eba5572 Mon Sep 17 00:00:00 2001 From: lizijiee <562949697@qq.com> Date: Tue, 26 Mar 2024 00:09:32 +0800 Subject: [PATCH 5/6] =?UTF-8?q?feat:=20=E7=BB=84=E4=BB=B6=E6=A0=BC?= =?UTF-8?q?=E5=BC=8F=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components.d.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/components.d.ts b/components.d.ts index 3b65693..06ebe68 100644 --- a/components.d.ts +++ b/components.d.ts @@ -21,8 +21,10 @@ declare module 'vue' { NDialogProvider: typeof import('naive-ui')['NDialogProvider'] NDivider: typeof import('naive-ui')['NDivider'] NDropdown: typeof import('naive-ui')['NDropdown'] + NEmpty: typeof import('naive-ui')['NEmpty'] NForm: typeof import('naive-ui')['NForm'] NFormItem: typeof import('naive-ui')['NFormItem'] + NGi: typeof import('naive-ui')['NGi'] NGrid: typeof import('naive-ui')['NGrid'] NGridItem: typeof import('naive-ui')['NGridItem'] NImage: typeof import('naive-ui')['NImage'] @@ -39,7 +41,11 @@ declare module 'vue' { NSpace: typeof import('naive-ui')['NSpace'] NSpin: typeof import('naive-ui')['NSpin'] NSwitch: typeof import('naive-ui')['NSwitch'] + NTabPane: typeof import('naive-ui')['NTabPane'] + NTabs: typeof import('naive-ui')['NTabs'] NTag: typeof import('naive-ui')['NTag'] + NTimeline: typeof import('naive-ui')['NTimeline'] + NTimelineItem: typeof import('naive-ui')['NTimelineItem'] NTooltip: typeof import('naive-ui')['NTooltip'] NUpload: typeof import('naive-ui')['NUpload'] NUploadDragger: typeof import('naive-ui')['NUploadDragger'] From 283491284169b89706a6fc4e143c01fe9d75c280 Mon Sep 17 00:00:00 2001 From: lizijiee <562949697@qq.com> Date: Tue, 26 Mar 2024 00:54:53 +0800 Subject: [PATCH 6/6] =?UTF-8?q?feat:=20=E5=A2=9E=E5=8A=A0=E4=BB=BB?= =?UTF-8?q?=E5=8A=A1=E5=8C=85=E5=88=9B=E5=BB=BA=E5=AE=8C=E6=88=90=E5=BC=B9?= =?UTF-8?q?=E6=A1=86=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/home/content/Content.vue | 5 ++ .../home/content/modal/FinishPackageModal.vue | 81 +++++++++++++++++++ 2 files changed, 86 insertions(+) create mode 100644 src/views/home/content/modal/FinishPackageModal.vue diff --git a/src/views/home/content/Content.vue b/src/views/home/content/Content.vue index 665bc0b..3ebc5d2 100644 --- a/src/views/home/content/Content.vue +++ b/src/views/home/content/Content.vue @@ -15,6 +15,7 @@ import { cloneDeep, debounce } from 'lodash-es' import Masonry from 'masonry-layout' import { useMessage } from 'naive-ui' import { computed, nextTick, onMounted, onUnmounted, onUpdated, reactive, ref, unref, watch } from 'vue' +import FinishPackageModal from './modal/FinishPackageModal.vue' import GeneratePackageModal from './modal/GeneratePackageModal.vue' import LoginSuccessModal from './modal/LoginSuccessModal.vue' import PackageSettingsModal from './modal/PackageSettingsModal.vue' @@ -36,6 +37,7 @@ const packageModalRef = ref(null) const generateModalRef = ref(null) const queryRepeatedTasksModalRef = ref(null) const LoginSuccessModalRef = ref(null) +const finishPackageModal = ref(null) const loading = ref(false) const message = useMessage() const totalCount = ref(0) @@ -244,11 +246,13 @@ async function commitHandler(settingParam) { checkDuplicateNo: checkDuplicateNo.value } const modal = generateModalRef.value as any + const finishModal = finishPackageModal.value as any modal.showModal() createPackage(params).then((res) => { if (res.code === "OK") { message.success(res.data); modal.closeModal() + finishModal.showModal() } }) const asideVal = configStore.getAsideValue @@ -463,6 +467,7 @@ function previewHandler(index: number, event: MouseEvent) { + diff --git a/src/views/home/content/modal/FinishPackageModal.vue b/src/views/home/content/modal/FinishPackageModal.vue new file mode 100644 index 0000000..bb0961a --- /dev/null +++ b/src/views/home/content/modal/FinishPackageModal.vue @@ -0,0 +1,81 @@ + + + + +