|
|
|
@ -1,23 +1,22 @@
|
|
|
|
|
<script lang="ts" setup>
|
|
|
|
|
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<any[]>([]);
|
|
|
|
@ -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<any>(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) {
|
|
|
|
|
<div class="wrapper-detail">
|
|
|
|
|
<div
|
|
|
|
|
class="left"
|
|
|
|
|
:style="{ 'background-image': `url(${taskDetailInfo?.ocrPicture?.imgurl})` }"
|
|
|
|
|
:style="{ 'background-image': `url(${taskDetailInfo?.imgurl})` }"
|
|
|
|
|
@click="showAction"
|
|
|
|
|
@mouseleave="leaveTaskHandler"
|
|
|
|
|
>
|
|
|
|
@ -461,12 +469,12 @@ function previewHandler(event: MouseEvent) {
|
|
|
|
|
</div>
|
|
|
|
|
<div class="time">
|
|
|
|
|
<SvgIcon color="#FFF" size="16" name="time" />
|
|
|
|
|
<span>{{ formatToDateHMS(taskDetailInfo.createdate || 0) }}</span>
|
|
|
|
|
<span>{{ taskDetailInfo.createTime }} </span>
|
|
|
|
|
</div>
|
|
|
|
|
<!-- 右下信息 -->
|
|
|
|
|
<div class="info">
|
|
|
|
|
<n-grid x-gap="16" y-gap="0" :cols="12">
|
|
|
|
|
<n-gi span="4">
|
|
|
|
|
<!-- <n-gi span="4">
|
|
|
|
|
<span style="color: #8b8d8f">
|
|
|
|
|
<SvgIcon name="m1" />
|
|
|
|
|
</span>
|
|
|
|
@ -482,7 +490,7 @@ function previewHandler(event: MouseEvent) {
|
|
|
|
|
>
|
|
|
|
|
<span>{{ mark }}</span>
|
|
|
|
|
<span>图片标记</span>
|
|
|
|
|
</n-gi>
|
|
|
|
|
</n-gi> -->
|
|
|
|
|
<n-gi span="4">
|
|
|
|
|
<span style="color: #8b8d8f">
|
|
|
|
|
<SvgIcon name="m2" />
|
|
|
|
@ -511,7 +519,7 @@ function previewHandler(event: MouseEvent) {
|
|
|
|
|
<n-image
|
|
|
|
|
ref="imageRef"
|
|
|
|
|
:img-props="{ onClick: hideDownload }"
|
|
|
|
|
:src="taskDetailInfo?.ocrPicture?.imgurl"
|
|
|
|
|
:src="taskDetailInfo?.imgurl"
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
|
|
|
|
<!-- 操作 -->
|
|
|
|
@ -530,20 +538,66 @@ function previewHandler(event: MouseEvent) {
|
|
|
|
|
</div>
|
|
|
|
|
<div class="right">
|
|
|
|
|
<n-scrollbar style="max-height: 100%">
|
|
|
|
|
<span class="name">图片名称</span>
|
|
|
|
|
<span class="name">任务ID:{{taskDetailInfo.taskname}}</span>
|
|
|
|
|
<div class="tags">
|
|
|
|
|
<div class="tag tag-actived">重复图片</div>
|
|
|
|
|
<div class="tag">基线任务</div>
|
|
|
|
|
</div>
|
|
|
|
|
<n-divider />
|
|
|
|
|
<div class="property">
|
|
|
|
|
<span class="property-name top" style="font-weight: bold; color: #333333"
|
|
|
|
|
>拜访终端
|
|
|
|
|
<span class="property-name top" style=" color: #666666"
|
|
|
|
|
>图片大小
|
|
|
|
|
</span>
|
|
|
|
|
<span style=" color: #333333; font-size: 16px"
|
|
|
|
|
>{{ (taskDetailInfo?.pictureInfo?.imgSize /1000).toFixed(2) }}KB</span
|
|
|
|
|
>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="property">
|
|
|
|
|
<span class="property-name top" style=" color: #666666"
|
|
|
|
|
>图片格式
|
|
|
|
|
</span>
|
|
|
|
|
<span style=" color: #333333; font-size: 16px"
|
|
|
|
|
>{{ taskDetailInfo?.pictureInfo?.imgSpace }}</span
|
|
|
|
|
>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="property">
|
|
|
|
|
<span class="property-name top" style=" color: #666666"
|
|
|
|
|
>图片尺寸
|
|
|
|
|
</span>
|
|
|
|
|
<span style=" color: #333333; font-size: 16px"
|
|
|
|
|
>{{ taskDetailInfo?.pictureInfo?.imgMeasure }}</span
|
|
|
|
|
>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="property">
|
|
|
|
|
<span class="property-name top" style=" color: #666666"
|
|
|
|
|
>色彩空间
|
|
|
|
|
</span>
|
|
|
|
|
<span style="font-weight: bold; color: #333333; font-size: 16px"
|
|
|
|
|
>拜访终端</span
|
|
|
|
|
<span style=" color: #333333; font-size: 16px"
|
|
|
|
|
>{{ taskDetailInfo?.pictureInfo?.imgMeasure }}</span
|
|
|
|
|
>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="property">
|
|
|
|
|
<span class="property-name top" style=" color: #666666"
|
|
|
|
|
>提报人
|
|
|
|
|
</span>
|
|
|
|
|
<span style=" color: #333333; font-size: 16px"
|
|
|
|
|
>{{ taskDetailInfo?.pictureInfo?.source || "-" }}</span
|
|
|
|
|
>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="property">
|
|
|
|
|
<span class="property-name top" style=" color: #666666"
|
|
|
|
|
>创建时间
|
|
|
|
|
</span>
|
|
|
|
|
<span style=" color: #333333; font-size: 16px"
|
|
|
|
|
>{{ taskDetailInfo?.pictureInfo && format(taskDetailInfo?.pictureInfo?.createTime, 'yyyy-MM-dd HH:mm:ss')}}</span>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="property">
|
|
|
|
|
<span class="property-name top" style=" color: #666666"
|
|
|
|
|
>提报时间
|
|
|
|
|
</span>
|
|
|
|
|
<span style=" color: #333333; font-size: 16px"
|
|
|
|
|
>{{ taskDetailInfo?.uploadTime && format(taskDetailInfo?.pictureInfo?.uploadTime, 'yyyy-MM-dd HH:mm:ss') || '-'}}</span>
|
|
|
|
|
</div>
|
|
|
|
|
<div v-for="key in Object.keys(propertys)" :key="key" class="property">
|
|
|
|
|
<span class="property-name">{{ fieldMap[key] }}</span>
|
|
|
|
|
<span class="property-content">{{ propertys[key] }}</span>
|
|
|
|
@ -557,13 +611,13 @@ function previewHandler(event: MouseEvent) {
|
|
|
|
|
><span>({{ totalCount }})</span>
|
|
|
|
|
</div>
|
|
|
|
|
<div style="display: flex; align-items: center">
|
|
|
|
|
<div style="cursor: pointer" @click="sortHandler('fromuptime')">
|
|
|
|
|
<div style="cursor: pointer" @click="sortHandler('createdate')">
|
|
|
|
|
<span>按时间排序</span>
|
|
|
|
|
<SvgIcon style="margin-left: 8px" name="sort" size="12" />
|
|
|
|
|
</div>
|
|
|
|
|
<div
|
|
|
|
|
style="margin-left: 15px; cursor: pointer"
|
|
|
|
|
@click="sortHandler('pictureResult')"
|
|
|
|
|
@click="sortHandler('similarityScore')"
|
|
|
|
|
>
|
|
|
|
|
<span>相似度排序</span>
|
|
|
|
|
<SvgIcon style="margin-left: 8px" name="sort" size="12" />
|
|
|
|
@ -582,7 +636,7 @@ function previewHandler(event: MouseEvent) {
|
|
|
|
|
>
|
|
|
|
|
<div
|
|
|
|
|
class="img-wrapper"
|
|
|
|
|
:style="{ 'background-image': `url(${item.thumburl})` }"
|
|
|
|
|
:style="{ 'background-image': `url(${item.imgurl})` }"
|
|
|
|
|
/>
|
|
|
|
|
<div class="time">
|
|
|
|
|
<SvgIcon color="#FFF" size="16" name="time" />
|
|
|
|
@ -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 {
|
|
|
|
|