|
|
|
@ -13,8 +13,8 @@ import dayjs from 'dayjs'
|
|
|
|
|
import imagesloaded from 'imagesloaded'
|
|
|
|
|
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 { useMessage, NIcon } from 'naive-ui'
|
|
|
|
|
import { computed, nextTick, onMounted, onUnmounted, onUpdated, reactive, ref, unref, watch, h, } from 'vue'
|
|
|
|
|
import CheckingTaskModal from './modal/CheckingTaskModal.vue'
|
|
|
|
|
import FinishPackageModal from './modal/FinishPackageModal.vue'
|
|
|
|
|
import GeneratePackageModal from './modal/GeneratePackageModal.vue'
|
|
|
|
@ -22,6 +22,16 @@ import LoginSuccessModal from './modal/LoginSuccessModal.vue'
|
|
|
|
|
import PackageSettingsModal from './modal/PackageSettingsModal.vue'
|
|
|
|
|
import QueryRepeatedTasksModal from './modal/QueryRepeatedTasksModal.vue'
|
|
|
|
|
import type { PictureSortParam } from "/#/api"
|
|
|
|
|
import type { Component } from 'vue'
|
|
|
|
|
import {
|
|
|
|
|
Upload as UploadIcon,
|
|
|
|
|
Download as DownloadIcon,
|
|
|
|
|
} from '@vicons/tabler'
|
|
|
|
|
import {
|
|
|
|
|
EyeOutline as EyeOutlineIcon,
|
|
|
|
|
EllipsisHorizontal,
|
|
|
|
|
} from '@vicons/ionicons5'
|
|
|
|
|
import { Icon } from '@vicons/utils'
|
|
|
|
|
|
|
|
|
|
const deviceHeight = ref(600)
|
|
|
|
|
let _masonry: null | Masonry = null
|
|
|
|
@ -129,6 +139,26 @@ const viewLabel = computed(() => {
|
|
|
|
|
return item?.label
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
let isAllowDownload = ref(true)
|
|
|
|
|
let calNum = ref(0);
|
|
|
|
|
const searchValue = ref('');
|
|
|
|
|
|
|
|
|
|
configStore.$subscribe(() => {
|
|
|
|
|
isAllowDownload.value = configStore.isAllowDownload;
|
|
|
|
|
calNum.value = configStore.getTimeNum;
|
|
|
|
|
// console.log("calNum.value----------", calNum.value);
|
|
|
|
|
searchValue.value = configStore.getSearchValue;
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
watch(() => searchValue.value,
|
|
|
|
|
(newVal, oldVal) => {
|
|
|
|
|
if(newVal) {
|
|
|
|
|
featchList()
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
const listData = ref<any[]>([])
|
|
|
|
|
|
|
|
|
|
async function featchList() {
|
|
|
|
@ -140,7 +170,7 @@ async function featchList() {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
pagination.pageNo += 1
|
|
|
|
|
|
|
|
|
|
const searchValue = configStore.getSearchValue // rao
|
|
|
|
|
const asideParams = unref(configStore.getAsideValue)
|
|
|
|
|
const params = filterId ? { userSearchId: filterId } : asideParams
|
|
|
|
|
let result = {
|
|
|
|
@ -148,10 +178,17 @@ async function featchList() {
|
|
|
|
|
data: [],
|
|
|
|
|
total: 0,
|
|
|
|
|
}
|
|
|
|
|
let sortObj: any = {} // rao start
|
|
|
|
|
if(sortBy.orderbyvalue == "pictureResult") {
|
|
|
|
|
sortObj.ordertype = sortBy.orderbyname
|
|
|
|
|
}else if(sortBy.orderbyvalue == "fromuptime") {
|
|
|
|
|
sortObj.orderByTime = sortBy.orderbyname
|
|
|
|
|
}// rao end
|
|
|
|
|
|
|
|
|
|
if (checkTaskStatus.value === 2 && isRefresh) {
|
|
|
|
|
result = await queryPageListByCheckNo({ ...pagination, ...contentParams, ...params, ...sortBy, checkDuplicateNo: checkDuplicateNo.value })
|
|
|
|
|
result = await queryPageListByCheckNo({ ...pagination, ...contentParams, ...params, ...sortObj, checkDuplicateNo: checkDuplicateNo.value, upUserName: searchValue })
|
|
|
|
|
} else {
|
|
|
|
|
result = await getPictureList({ ...pagination, ...contentParams, ...params, ...sortBy })
|
|
|
|
|
result = await getPictureList({ ...pagination, ...contentParams, ...params, ...sortObj, upUserName: searchValue })
|
|
|
|
|
}
|
|
|
|
|
const { data, pageCount, total } = result
|
|
|
|
|
totalCount.value = total
|
|
|
|
@ -215,7 +252,7 @@ async function oneCheck() {
|
|
|
|
|
if (res.code === "OK") {
|
|
|
|
|
checkDuplicateNo.value = res.data.checkDuplicateNo
|
|
|
|
|
checkTaskStatus.value = res.data.status
|
|
|
|
|
tasksLoadingModal.showModal()
|
|
|
|
|
tasksLoadingModal.closeModal()
|
|
|
|
|
} else {
|
|
|
|
|
message.error(res.message || '查重失败')
|
|
|
|
|
}
|
|
|
|
@ -233,7 +270,10 @@ async function showAddPackage() {
|
|
|
|
|
//查重任务加载提示框,关闭回调
|
|
|
|
|
async function tasksLoadingCloseCallback() {
|
|
|
|
|
const checkingTaskModal = checkingTaskModalRef.value as any
|
|
|
|
|
checkingTaskModal.showModal()
|
|
|
|
|
checkingTaskModal.closeModal()
|
|
|
|
|
if(isRefresh.value) {
|
|
|
|
|
refresh(true);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
async function showLoginSuccessModal() {
|
|
|
|
@ -241,6 +281,9 @@ async function showLoginSuccessModal() {
|
|
|
|
|
// modal.showModal()
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 包id
|
|
|
|
|
const packageIdRef = ref('');
|
|
|
|
|
|
|
|
|
|
async function commitHandler(settingParam) {
|
|
|
|
|
const params = {
|
|
|
|
|
name: settingParam.packagename,
|
|
|
|
@ -252,6 +295,7 @@ async function commitHandler(settingParam) {
|
|
|
|
|
createPackage(params).then((res) => {
|
|
|
|
|
if (res.code === "OK") {
|
|
|
|
|
message.success(res.data);
|
|
|
|
|
packageIdRef.value = res.data.checkDuplicateId;
|
|
|
|
|
modal.closeModal()
|
|
|
|
|
finishModal.showModal()
|
|
|
|
|
//清空查重任务状态和编号
|
|
|
|
@ -330,6 +374,7 @@ function getAvatar(url: string): string {
|
|
|
|
|
function sortHandler(orderby: "pictureResult" | "fromuptime") {
|
|
|
|
|
sortBy.orderbyvalue = orderby;
|
|
|
|
|
sortBy.orderbyname = sortBy.orderbyname === "asc" ? "desc" : "asc";
|
|
|
|
|
|
|
|
|
|
refreshHandler()
|
|
|
|
|
}
|
|
|
|
|
async function downloadImage(item) {
|
|
|
|
@ -379,10 +424,12 @@ function previewHandler(index: number, event: MouseEvent) {
|
|
|
|
|
(imageRef.value?.[index] as any).mergedOnClick();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const timer = ref();
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 检查查重状态
|
|
|
|
|
*/
|
|
|
|
|
function refresh(val) {
|
|
|
|
|
function refresh(val?: any) {
|
|
|
|
|
// delete asideVal.izsimilarity
|
|
|
|
|
const checkingTaskModal = checkingTaskModalRef.value as any
|
|
|
|
|
if (checkDuplicateNo.value) {
|
|
|
|
@ -395,15 +442,39 @@ function refresh(val) {
|
|
|
|
|
// return
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
if (checkTaskStatus.value === 2 && isRefresh) {
|
|
|
|
|
if (checkTaskStatus.value === 2 && isRefresh.value) {
|
|
|
|
|
configStore.setTimeNum(100);
|
|
|
|
|
const tasksLoadingModal = queryRepeatedTasksModalRef.value as any
|
|
|
|
|
tasksLoadingModal.closeModal();
|
|
|
|
|
checkingTaskModal.closeModal()
|
|
|
|
|
isRefresh.value = false
|
|
|
|
|
message.success('任务执行完毕,正在刷新数据...');
|
|
|
|
|
if(timer.value) {
|
|
|
|
|
clearInterval(timer.value);
|
|
|
|
|
}
|
|
|
|
|
reset()
|
|
|
|
|
loadMore()
|
|
|
|
|
// configStore.setTimeNum(0);
|
|
|
|
|
} else if (checkTaskStatus.value === 1) {
|
|
|
|
|
// checkingTaskModal.showModal()
|
|
|
|
|
return
|
|
|
|
|
const tasksLoadingModal = queryRepeatedTasksModalRef.value as any
|
|
|
|
|
tasksLoadingModal.showModal();
|
|
|
|
|
if(calNum.value < 90) {
|
|
|
|
|
calNum.value = calNum.value + 10;
|
|
|
|
|
// console.log("calNum.value计算后的值",calNum.value);
|
|
|
|
|
}
|
|
|
|
|
configStore.setTimeNum(calNum.value);
|
|
|
|
|
// console.log("calNum.value timer.value外面------", timer.value, calNum.value, isRefresh.value);
|
|
|
|
|
if(calNum.value == 10 && isRefresh.value) {
|
|
|
|
|
if(timer.value) {
|
|
|
|
|
clearInterval(timer.value);
|
|
|
|
|
}
|
|
|
|
|
timer.value = setInterval(() => {
|
|
|
|
|
// console.log("calNum.value timer.value里面------", timer.value, calNum.value);
|
|
|
|
|
refresh();
|
|
|
|
|
}, 200);
|
|
|
|
|
}
|
|
|
|
|
checkingTaskModal.showModal()
|
|
|
|
|
// return
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
@ -425,6 +496,32 @@ function cancel(val) {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const renderIcon = (icon: Component) => {
|
|
|
|
|
return () => {
|
|
|
|
|
return h(NIcon, null, {
|
|
|
|
|
default: () => h(icon)
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const dropdownOptions = ref([
|
|
|
|
|
{
|
|
|
|
|
label: '导入任务数据',
|
|
|
|
|
key: 'profile',
|
|
|
|
|
icon: renderIcon(UploadIcon)
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
label: '导出任务数据',
|
|
|
|
|
key: 'editProfile',
|
|
|
|
|
icon: renderIcon(DownloadIcon)
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
label: '查看导入记录',
|
|
|
|
|
key: 'logout',
|
|
|
|
|
icon: renderIcon(EyeOutlineIcon)
|
|
|
|
|
}
|
|
|
|
|
]);
|
|
|
|
|
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<template>
|
|
|
|
@ -434,10 +531,23 @@ function cancel(val) {
|
|
|
|
|
<SvgIcon size="32" name="magnifying" />
|
|
|
|
|
<span class="font">AI一键查重</span>
|
|
|
|
|
</div>
|
|
|
|
|
<SvgIcon v-show="checkTaskStatus !== 2" style="cursor: pointer;" size="105" name="yijianchachong"
|
|
|
|
|
@click="oneCheck" />
|
|
|
|
|
<SvgIcon v-show="checkTaskStatus === 2" style="cursor: pointer;" size="105" name="shengchengrenwubao"
|
|
|
|
|
@click="showAddPackage" />
|
|
|
|
|
<div class="flex-btn-icon">
|
|
|
|
|
<SvgIcon v-show="checkTaskStatus !== 2" style="cursor: pointer;" size="105" name="yijianchachong"
|
|
|
|
|
@click="oneCheck" />
|
|
|
|
|
<SvgIcon v-show="checkTaskStatus === 2" style="cursor: pointer;" size="105" name="shengchengrenwubao"
|
|
|
|
|
@click="showAddPackage" />
|
|
|
|
|
<n-dropdown
|
|
|
|
|
trigger="hover"
|
|
|
|
|
placement="bottom-start"
|
|
|
|
|
:options="dropdownOptions"
|
|
|
|
|
>
|
|
|
|
|
<n-button style="margin-left: 10px;">
|
|
|
|
|
<Icon>
|
|
|
|
|
<EllipsisHorizontal />
|
|
|
|
|
</Icon>
|
|
|
|
|
</n-button>
|
|
|
|
|
</n-dropdown>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="wrapper-content">
|
|
|
|
|
<div style="display: flex;justify-content: space-between;">
|
|
|
|
@ -464,7 +574,7 @@ function cancel(val) {
|
|
|
|
|
<SvgIcon style="margin-left: 8px;" name="sort" size="12" />
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<span style="font-size: 16px;color:#494949">共 <span style="color:#7899fd;font-weight: 500;">{{ totalCount
|
|
|
|
|
<span style="font-size: 16px;color: #333">共 <span style="color: #507AFD;font-weight: 500;">{{ totalCount
|
|
|
|
|
}}</span> 项</span>
|
|
|
|
|
</div>
|
|
|
|
|
<n-spin :show="loading">
|
|
|
|
@ -486,16 +596,23 @@ function cancel(val) {
|
|
|
|
|
{{ `${item.similar}%` }}
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="glass">
|
|
|
|
|
<div class="glass" v-if="isAllowDownload">
|
|
|
|
|
<SvgIcon size="16" name="download" style="margin-top: -6px;cursor: pointer;"
|
|
|
|
|
@click="downloadImage(item)" />
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="info">
|
|
|
|
|
<div class="footer">
|
|
|
|
|
<div class="img-name">{{ item.imgName }}</div>
|
|
|
|
|
<div class="img-name">
|
|
|
|
|
<n-tooltip trigger="hover">
|
|
|
|
|
<template #trigger>
|
|
|
|
|
<span>{{ item.imgName }}</span>
|
|
|
|
|
</template>
|
|
|
|
|
{{ item.imgName }}
|
|
|
|
|
</n-tooltip>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="icon-wrap" @click="previewHandler(index, $event)">
|
|
|
|
|
<SvgIcon size="13" name="magnifying-2" style="cursor: pointer;margin-left: 3px;color:#898481" />
|
|
|
|
|
<SvgIcon size="13" name="magnifying-2" style="cursor: pointer;color:#898481" />
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="left">
|
|
|
|
@ -517,7 +634,7 @@ function cancel(val) {
|
|
|
|
|
<GeneratePackageModal ref="generateModalRef" />
|
|
|
|
|
<QueryRepeatedTasksModal ref="queryRepeatedTasksModalRef" @closeCallback="tasksLoadingCloseCallback"/>
|
|
|
|
|
<LoginSuccessModal ref="LoginSuccessModalRef" />
|
|
|
|
|
<FinishPackageModal ref="finishPackageModal" />
|
|
|
|
|
<FinishPackageModal ref="finishPackageModal" :id="packageIdRef"/>
|
|
|
|
|
<CheckingTaskModal ref="checkingTaskModalRef" @refresh="refresh" @cancel="cancel" />
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
@ -677,6 +794,8 @@ function cancel(val) {
|
|
|
|
|
.icon-wrap {
|
|
|
|
|
width: 22px;
|
|
|
|
|
height: 22px;
|
|
|
|
|
line-height: 22px;
|
|
|
|
|
text-align: center;
|
|
|
|
|
background-color: #FFF;
|
|
|
|
|
border-radius: 6px;
|
|
|
|
|
}
|
|
|
|
@ -729,5 +848,9 @@ function cancel(val) {
|
|
|
|
|
overflow-y: scroll;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
.flex-btn-icon {
|
|
|
|
|
display: flex;
|
|
|
|
|
align-items: center;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
</style>
|
|
|
|
|