From de0a9ad60c00f284b77df58aa02727a0b4015388 Mon Sep 17 00:00:00 2001 From: lihui_ocr Date: Mon, 29 Apr 2024 22:25:04 +0800 Subject: [PATCH] =?UTF-8?q?feat:=E4=B8=80=E9=94=AE=E6=9F=A5=E9=87=8D?= =?UTF-8?q?=E7=8A=B6=E6=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/home/main.ts | 26 ++++++++++++ src/views/home/content/Content.vue | 17 +++++++- src/views/home/index.vue | 3 ++ src/views/task/content/Content.vue | 42 +++++++++++++++++-- src/views/task/index.vue | 6 ++- src/views/task/modal/ImgDetailModal.vue | 9 ++-- src/views/worksheet/content/Content.vue | 55 +++++++++++++++++++++---- 7 files changed, 139 insertions(+), 19 deletions(-) diff --git a/src/api/home/main.ts b/src/api/home/main.ts index 618ab9b..acdf631 100644 --- a/src/api/home/main.ts +++ b/src/api/home/main.ts @@ -282,3 +282,29 @@ export async function getFilterList(params) { params, }) } + +/** + * 获取最后一次的查重id + * @param + * @returns + */ + export async function getLastCheckNox() { + return http.request({ + url: `/ocr/checkDuplicate/getLastCheckNo`, + method: 'get', + + }) +} + +/** + * 最后一次id执行状态 + * @param + * @returns + */ + export async function getCheckDuplicateStatusx(params) { + return http.request({ + url: `/ocr/checkDuplicate/getCheckDuplicateStatus`, + method: 'get', + params + }) +} \ No newline at end of file diff --git a/src/views/home/content/Content.vue b/src/views/home/content/Content.vue index dae5893..c02cd69 100644 --- a/src/views/home/content/Content.vue +++ b/src/views/home/content/Content.vue @@ -49,8 +49,9 @@ import { oneClickCheckTaskPackage, queryPageListByCheckNo, removeCheckDuplicate, + getCheckDuplicateStatusx } from '@/api/home/main' - +import {getLastCheckNox} from "@/api/home/main" import bgLoading from '@/assets/images/bg-loading.png' const listData = ref([]) @@ -77,6 +78,7 @@ const finishPackageModal = ref(null) const loading = ref(false) const message = useMessage() const totalCount = ref(0) + const sortBy: PictureSortParam = { orderbyname: 'desc', orderbyvalue: 'pictureResult', @@ -105,7 +107,17 @@ const listStyle = computed(() => { height: `${deviceHeight.value}px`, } }) - +async function init() { + let result = await getLastCheckNox() + console.log(result.data) + if(result.data){ + let res=await getCheckDuplicateStatusx({checkDuplicateNo:result.data}) + if(res.data.status==1){ + const checkingTaskModal = checkingTaskModalRef.value as any + checkingTaskModal.showModal() + } + } +} // const layout = debounce(() => { // if (masonryRef.value == null || el.value == null) // return @@ -158,6 +170,7 @@ onBeforeMount(async () => { }) onUpdated(() => { + init() // nextTick(() => { // setTimeout(() => { // layout() diff --git a/src/views/home/index.vue b/src/views/home/index.vue index 22d8087..8371ddb 100644 --- a/src/views/home/index.vue +++ b/src/views/home/index.vue @@ -36,4 +36,7 @@ useKeydown('enter', closeLoginModal) box-sizing: border-box; width: 100%; } +::v-deep .aside{ + height: 854px !important; +} diff --git a/src/views/task/content/Content.vue b/src/views/task/content/Content.vue index 8323ed7..393a953 100644 --- a/src/views/task/content/Content.vue +++ b/src/views/task/content/Content.vue @@ -37,6 +37,8 @@ import { formatToDateHMS } from '@/utils/dateUtil' import { hideDownload } from '@/utils/image' import bgLoading from '@/assets/images/bg-loading.png' import { useKeydown } from '@/hooks/event/useKeydown' +import CheckingTaskModal from '@/views/home/content/modal/CheckingTaskModal.vue' +import {getLastCheckNox,removeCheckDuplicate,getCheckDuplicateStatus,getCheckDuplicateStatusx} from "@/api/home/main" const emit = defineEmits(['setAsideItemName']) const HeaderStore=useDataHeaderStore() @@ -61,6 +63,9 @@ const isDetail = ref(false) // 是否是详情 const finalStore = useFinal() const imgbigshow = ref(true) const imgdetailref=ref(null) +const checkingTaskModalRef = ref(null) +const checkTaskStatus = ref(null) // 1.执行中 2.执行完毕 3.执行失败 +const checkDuplicateNo = ref('') const sortBy: any = { orderType: 'desc', orderName: 'similarityScore', @@ -116,6 +121,16 @@ const fullscreenStylestwo = computed(() => ({ left: isFullScreen.value ? '0' : '', zIndex: isFullScreen.value ? '160' : '', })) +async function init() { + let result = await getLastCheckNox() + if(result.data){ + let res=await getCheckDuplicateStatusx({checkDuplicateNo:result.data}) +if(res.data.status==1){ + const checkingTaskModal = checkingTaskModalRef.value as any + checkingTaskModal.showModal() + } + } +} onMounted(() => { if (route.query.id) { taskId.value = route.query.id @@ -123,9 +138,8 @@ onMounted(() => { taskIndex.value = route.query.taskindex as string isDetail.value = true getDetail() - } - + init() window.addEventListener('keydown', onEsc) }) @@ -673,6 +687,24 @@ function nopassfun(e){ singleRejectHandlex([imgdetailref.value?.taskDetailInfo]) } +/** + * 检查查重状态 + */ + +/** + * 取消查重任务 + */ +function cancel() { + if (checkTaskStatus.value === 1) { + removeCheckDuplicate(checkDuplicateNo.value).then((res) => { + if (res.code === 'OK') { + checkDuplicateNo.value = '' + checkTaskStatus.value = null + message.success('查重任务取消成功') + } + }) + } +} @@ -1396,8 +1429,9 @@ function nopassfun(e){ flex: 1; flex-direction: column; box-sizing: border-box; - margin-left: 16px; - margin-right: 16px !important; + margin-right: 16px !important; + margin-left: 16px !important; + margin-bottom: 16px !important; padding: 16px 16px 0px 16px; background: #fff; border-radius: 3px; diff --git a/src/views/task/index.vue b/src/views/task/index.vue index 3d2e48e..4501738 100644 --- a/src/views/task/index.vue +++ b/src/views/task/index.vue @@ -32,6 +32,10 @@ function setAsideItemName(text) { :deep(.wrapper){ top:0 } +:deep(.aside){ + margin-right: 0; + margin-bottom: 16px; +} :deep(.ip_box){ z-index: 50; } @@ -46,6 +50,6 @@ function setAsideItemName(text) { flex-direction: row; box-sizing: border-box; width: 100%; - margin-bottom: 16px; + } diff --git a/src/views/task/modal/ImgDetailModal.vue b/src/views/task/modal/ImgDetailModal.vue index 19eab98..5496917 100644 --- a/src/views/task/modal/ImgDetailModal.vue +++ b/src/views/task/modal/ImgDetailModal.vue @@ -227,15 +227,16 @@ defineExpose({
+
- {{ item[0].value }} + {{ item[0].value }}
+
{{ item[0].label }}
diff --git a/src/views/worksheet/content/Content.vue b/src/views/worksheet/content/Content.vue index 9b4706e..70b1c11 100644 --- a/src/views/worksheet/content/Content.vue +++ b/src/views/worksheet/content/Content.vue @@ -30,6 +30,8 @@ import type { ApprovalParam, SimilarityPictureSortParam } from '/#/api' import bgLoading from '@/assets/images/bg-loading.png' import { useKeydown } from '@/hooks/event/useKeydown' import { useDataHeaderStore } from '@/store/modules/DataHeader' +import CheckingTaskModal from '@/views/home/content/modal/CheckingTaskModal.vue' +import {getLastCheckNox,removeCheckDuplicate,getCheckDuplicateStatus,getCheckDuplicateStatusx} from "@/api/home/main" const batch = ref(false) // 批量审批状态 const selectItems = ref([]) @@ -41,7 +43,9 @@ const bgLoadingImg = ref(bgLoading) const imgbigshow = ref(true) const isInitLoading = ref(0) const haeaderstore=useDataHeaderStore() - +const checkingTaskModalRef = ref(null) +const checkTaskStatus = ref(null) // 1.执行中 2.执行完毕 3.执行失败 +const checkDuplicateNo = ref('') function changeimgbigshow() { imgbigshow.value = !imgbigshow.value } @@ -375,12 +379,23 @@ useKeydown('k k', () => { }) useKeydown('right', forwardHandler) useKeydown('left', backHandler) +async function init() { + let result = await getLastCheckNox() + if(result.data){ + let res=await getCheckDuplicateStatusx({checkDuplicateNo:result.data}) +if(res.data.status==1){ + const checkingTaskModal = checkingTaskModalRef.value as any + checkingTaskModal.showModal() + } + } +} onUnmounted(() => { workStore.reset() document.removeEventListener('keydown', onEsc) }) onMounted(() => { document.addEventListener('keydown', onEsc) + init() }) function immersionHandler() { // class="wrapper" @@ -601,6 +616,24 @@ function handleRejectdubiousfileyd(pictureid) { onNegativeClick: () => {}, }) } +/** + * 检查查重状态 + */ + +/** + * 取消查重任务 + */ +function cancel() { + if (checkTaskStatus.value === 1) { + removeCheckDuplicate(checkDuplicateNo.value).then((res) => { + if (res.code === 'OK') { + checkDuplicateNo.value = '' + checkTaskStatus.value = null + message.success('查重任务取消成功') + } + }) + } +} // 监听审核不通过弹窗 function onRejectDialog(visible) { rejectDialog.value = visible @@ -773,19 +806,19 @@ defineExpose({ > @@ -943,20 +976,21 @@ defineExpose({
@@ -983,6 +1017,7 @@ defineExpose({ @show="onRejectDialog" @success="reloadDetailInfo" /> +
@@ -1177,7 +1212,9 @@ defineExpose({ display: flex; border-radius: 8px; align-items: center; - justify-content: center; + // justify-content: center; + display: flex; + justify-content: space-around; background: linear-gradient( 180deg, rgba(0, 0, 0, 0) 0%, @@ -1488,7 +1525,7 @@ defineExpose({ display: flex; border-radius: 8px; align-items: center; - justify-content: center; + justify-content: space-around; background: linear-gradient(180deg, rgba(0, 0, 0, 0.01), rgba(0, 0, 0, 0.44) 88%); } }