diff --git a/src/api/work/work.ts b/src/api/work/work.ts index 4a1c8c3..981987a 100644 --- a/src/api/work/work.ts +++ b/src/api/work/work.ts @@ -1,5 +1,5 @@ import { http } from '@/utils/http/axios' -import type { PageParam, PictureSortParam, SetTFParam } from '/#/api' +import type { PageParam, PictureSortParam, SetTFParam, SimilarityPictureSortParam } from '/#/api' import { ContentTypeEnum } from '@/enums/httpEnum' @@ -21,6 +21,24 @@ export async function getPackageList(params: PageParam, packagename: string) { } } +/** + * 任务包列表主图-新 + * @returns + */ +export async function getPackagePicture(params: PageParam, packagename: string) { + const res = await http.request({ + url: `/ocr/ocrPicture/getPackagePicture`, + method: 'get', + params: { ...params, packagename }, + }) + + const { data: { records, pages } } = res + return { + pageCount: pages, + data: records, + } +} + /** * 获取某个任务包内任务列表 * @param id 任务包id @@ -44,16 +62,14 @@ export async function getPackageTaskList(packageid: string, params: PageParam) { } /** - * 获取某个任务详情(字段信息) - * @param id 任务id - * @param packageid 任务包id + * 任务包列表主图-新 + * @param checkDuplicateId 查重id * @returns */ -export async function getTaskDetailInfo(taskId: string, packageid: string) { - const pid = packageid || 0 +export async function getTaskDetailInfo(checkDuplicateId: string) { const res = await http.request({ - url: `/backstage/jifen/ocrtaskchildpicture/getdata/${taskId}/${pid}`, + url: `/ocr/ocrPicture/getPackagePicture?checkDuplicateId=${checkDuplicateId}`, method: 'get', }) @@ -67,11 +83,10 @@ export async function getTaskDetailInfo(taskId: string, packageid: string) { * @param params * @returns */ -export async function getTaskDetailPictureList(packageid: string, taskchildpictureid: string, params: PageParam & PictureSortParam) { - const pid = packageid || 0 +export async function getTaskDetailPictureList(params: PageParam & PictureSortParam & SimilarityPictureSortParam) { const res = await http.request({ - url: `/backstage/jifen/ocrtaskchildpicture/listbypictureid/${pid}/${taskchildpictureid}`, + url: `/backstage/jifen/ocrtaskchildpicture/getPictureSimilarityList`, method: 'get', params, }) @@ -79,20 +94,22 @@ export async function getTaskDetailPictureList(packageid: string, taskchildpictu const { data: { records, pages, total } } = res // 精简一下数据 - const list = records.map((item) => { + const list = records.map((item,index) => { + return { id: item.id, taskId: item.taskId, taskname: item.fromtaskname, assignee: item.assignee, pictureid: item.pictureid, - imgurl: item.ocrPicture.imgurl, - thumburl: item.ocrPicture.serverThumbnailUrl || item.ocrPicture.imgurl, + imgurl: item.imgUrl, + thumburl: item.ocrPicture?.serverThumbnailUrl || item.ocrPicture?.imgurl, iztrueorfalse: item.iztrueorfalse, states: item.states, - history: hasHistory(item.ocpictureid, item.picturecompare), + history: item.ocpictureid && item.picturecompare && hasHistory(item.ocpictureid, item.picturecompare), } }) + return { pageCount: pages, data: list, diff --git a/src/store/modules/workOrder.ts b/src/store/modules/workOrder.ts index 4c73ff4..5470f90 100644 --- a/src/store/modules/workOrder.ts +++ b/src/store/modules/workOrder.ts @@ -1,8 +1,8 @@ -import { defineStore } from 'pinia' -import type { OrderState, PackageListItem } from '/#/workorder' -import { useMessage } from 'naive-ui' import { getPackageList } from '@/api/work/work' import { store } from '@/store' +import { useMessage } from 'naive-ui' +import { defineStore } from 'pinia' +import type { OrderState, PackageListItem } from '/#/workorder' export const useWorkOrderStore = defineStore({ id: 'work-order', @@ -11,6 +11,7 @@ export const useWorkOrderStore = defineStore({ activeId: '', packageList: [], immersion: false, + name: '' }), getters: { getActiveId: (state: OrderState) => state.activeId, @@ -24,7 +25,7 @@ export const useWorkOrderStore = defineStore({ setActive(index: number, orderId?: string) { this.currentIndex = index const order = this.packageList[index] - this.activeId = orderId || order?.id + this.activeId = orderId || order?.checkDuplicateId }, forward() { const len = this.packageList.length @@ -45,7 +46,6 @@ export const useWorkOrderStore = defineStore({ }, async fetchOrderList(pagination, keyword) { const res = await getPackageList(pagination, keyword) - if (res.data&&res.data.length > 0) { this.packageList.push(...res.data) if (!this.activeId) diff --git a/src/views/worksheet/aside/WorkSheetList.vue b/src/views/worksheet/aside/WorkSheetList.vue index 548dd8b..98c8b40 100644 --- a/src/views/worksheet/aside/WorkSheetList.vue +++ b/src/views/worksheet/aside/WorkSheetList.vue @@ -41,7 +41,7 @@ function showModal(modalRef: any, id) { function selectHandler(id: string, index: number) { workStore.setActive(index) - showModal(approvalModalRef, id) + // showModal(approvalModalRef, id) } useInfiniteScroll( @@ -139,7 +139,7 @@ defineExpose({ -import { computed, onUnmounted, onUpdated, reactive, ref, unref, watch } from "vue"; -import { useDialog, useMessage } from "naive-ui"; -import { clone, debounce, pickBy } from "lodash-es"; -import { useInfiniteScroll } from "@vueuse/core"; -import imagesloaded from "imagesloaded"; -import ConfrimModal from "../modal/ConfrimModal.vue"; -import type { PictureSortParam, SetTFParam } from "/#/api"; -import { useWorkOrder } from "@/store/modules/workOrder"; -import { formatToDateHMS } from "@/utils/dateUtil"; import { - clearTF, - getPackageTaskList, - getTaskDetailInfo, - getTaskDetailPictureList, - setTF, +clearTF, getTaskDetailInfo, +getTaskDetailPictureList, +setTF } from "@/api/work/work"; import { fieldMap } from "@/config/workorder"; -import { hideDownload } from "@/utils/image"; +import { useWorkOrder } from "@/store/modules/workOrder"; import { isEmpty } from "@/utils"; +import { formatToDateHMS } from "@/utils/dateUtil"; +import { hideDownload } from "@/utils/image"; +import { useInfiniteScroll } from "@vueuse/core"; +import { format } from 'date-fns'; +import imagesloaded from "imagesloaded"; +import { clone, debounce, pickBy } from "lodash-es"; +import { useDialog, useMessage } from "naive-ui"; +import { computed, onUnmounted, onUpdated, reactive, ref, unref, watch } from "vue"; +import ConfrimModal from "../modal/ConfrimModal.vue"; +import type { SetTFParam, SimilarityPictureSortParam } from "/#/api"; const batch = ref(false); const selectItems = ref([]); @@ -54,9 +53,9 @@ const taskpagination = reactive({ pageNo: 1, pageSize: 10, }); -const sortBy: PictureSortParam = { - orderbyname: "asc", - orderbyvalue: "pictureResult", +const sortBy: SimilarityPictureSortParam = { + orderType: "asc", + orderName: "similarityScore", }; const workStore = useWorkOrder(); const selectTask = ref(null); @@ -208,7 +207,7 @@ async function refreshHandler() { useInfiniteScroll( el as any, - () => { + () => { loadMore(); }, { distance: 10, canLoadMore: () => canloadMore } @@ -223,20 +222,20 @@ async function loadMore() { } async function featchList() { + loading.value = true; try { taskpagination.pageNo += 1; - const taskId = selectTask.value.id; const { data, total, pageCount } = await getTaskDetailPictureList( - workStore.activeId, - taskId, - { ...taskpagination, ...sortBy } + { ...taskpagination, ...sortBy ,checkDuplicateId: workStore.activeId} ); + totalCount.value = total; canloadMore = pageCount >= taskpagination.pageNo && pageCount > 0; return data; } catch (error) { + debugger canloadMore = false; return []; } @@ -272,23 +271,33 @@ watch( totalCount.value = 0; return; } - - const res = await getPackageTaskList(newValue, packagepagination); - const { data } = res; - taskList.value = data; - if (taskList.value.length > 0) handleSelect(taskList.value[0]); + queryDetail(packageid) + // const res = await getPackageTaskList(newValue, packagepagination); + // const { data } = res; + // taskList.value = data; + // if (taskList.value.length > 0) handleSelect(taskList.value[0]); // 暂时注释掉 } ); const packageName = computed(() => { const index = workStore.getCurrentIndex; - return workStore.getOrderList[index]?.packagename || ""; + return workStore.getOrderList[index]?.name || ""; }); +async function queryDetail(checkDuplicateId: any) { + taskDetailInfo.value = await getTaskDetailInfo(checkDuplicateId); + const packageid = workStore.getActiveId; + + if (isEmpty(packageid)) { + listData.value.length = 0; + totalCount.value = 0; + return; + } + + refreshHandler(); +} async function handleSelect(item: any) { - selectTask.value = item; - const taskId = item.id; - taskDetailInfo.value = await getTaskDetailInfo(taskId, workStore.activeId); + taskDetailInfo.value = await getTaskDetailInfo( workStore.activeId); const packageid = workStore.getActiveId; @@ -301,11 +310,10 @@ async function handleSelect(item: any) { refreshHandler(); } -async function sortHandler(orderby: "pictureResult" | "fromuptime") { - if (!selectTask.value) return; +async function sortHandler(orderby: "similarityScore" | "createdate") { - sortBy.orderbyvalue = orderby; - sortBy.orderbyname = sortBy.orderbyname === "asc" ? "desc" : "asc"; + sortBy.orderName = orderby; + sortBy.orderType = sortBy.orderType === "asc" ? "desc" : "asc"; refreshHandler(); } @@ -359,8 +367,8 @@ onUnmounted(() => { function getPercent(pictureid: string) { const { ocpictureid, pictureresult } = taskDetailInfo.value; - const index = ocpictureid.split(",").indexOf(String(pictureid)); - const results = pictureresult.split(","); + const index = ocpictureid ? ocpictureid.split(",").indexOf(String(pictureid)):''; + const results = pictureresult ? pictureresult.split(",") : ''; const percent = results[index] || "0"; const val = Math.floor(Number.parseFloat(percent)); return `${val}%`; @@ -440,7 +448,7 @@ function previewHandler(event: MouseEvent) {
@@ -461,12 +469,12 @@ function previewHandler(event: MouseEvent) {
- {{ formatToDateHMS(taskDetailInfo.createdate || 0) }} + {{ taskDetailInfo.createTime }}
- + @@ -511,7 +519,7 @@ function previewHandler(event: MouseEvent) {
@@ -530,20 +538,66 @@ function previewHandler(event: MouseEvent) {
- 图片名称 + 任务ID:{{taskDetailInfo.taskname}}
重复图片
基线任务
- 拜访终端 + 图片大小 + + {{ (taskDetailInfo?.pictureInfo?.imgSize /1000).toFixed(2) }}KB +
+
+ 图片格式 + + {{ taskDetailInfo?.pictureInfo?.imgSpace }} +
+
+ 图片尺寸 + + {{ taskDetailInfo?.pictureInfo?.imgMeasure }} +
+
+ 色彩空间 - 拜访终端{{ taskDetailInfo?.pictureInfo?.imgMeasure }}
+
+ 提报人 + + {{ taskDetailInfo?.pictureInfo?.source || "-" }} +
+
+ 创建时间 + + {{ taskDetailInfo?.pictureInfo && format(taskDetailInfo?.pictureInfo?.createTime, 'yyyy-MM-dd HH:mm:ss')}} +
+
+ 提报时间 + + {{ taskDetailInfo?.uploadTime && format(taskDetailInfo?.pictureInfo?.uploadTime, 'yyyy-MM-dd HH:mm:ss') || '-'}} +
{{ fieldMap[key] }} {{ propertys[key] }} @@ -557,13 +611,13 @@ function previewHandler(event: MouseEvent) { >({{ totalCount }})
-
+
按时间排序
相似度排序 @@ -582,7 +636,7 @@ function previewHandler(event: MouseEvent) { >
@@ -744,7 +798,7 @@ function previewHandler(event: MouseEvent) { right: 2%; bottom: 2%; width: 136px; - height: 119px; + height: 60px; opacity: 0.44; background: rgba(216, 216, 216, 0.4); border-radius: 7px; @@ -813,15 +867,7 @@ function previewHandler(event: MouseEvent) { } .top { - &::after { - position: absolute; - left: 72px; - top: 4px; - content: ""; - width: 1px; - height: 12px; - background: #979797; - } + } .property-content { diff --git a/src/views/worksheet/index.vue b/src/views/worksheet/index.vue index f7891d5..22109af 100644 --- a/src/views/worksheet/index.vue +++ b/src/views/worksheet/index.vue @@ -1,11 +1,11 @@