|
|
|
@ -1,5 +1,5 @@
|
|
|
|
|
<script lang="ts" setup>
|
|
|
|
|
import { getPictureList, oneClickCheck } from '@/api/home/main'
|
|
|
|
|
import { createPackage, getCheckDuplicateStatus, getLastCheckNo, getPictureList, oneClickCheckTaskPackage, queryPageListByCheckNo } from '@/api/home/main'
|
|
|
|
|
import avatar from '@/assets/images/avatar.jpg'
|
|
|
|
|
import { timeOptions, viewOptions } from '@/config/home'
|
|
|
|
|
import { useWindowSizeFn } from '@/hooks/event/useWindowSizeFn'
|
|
|
|
@ -9,8 +9,9 @@ import { hideDownload } from '@/utils/image'
|
|
|
|
|
import emitter from '@/utils/mitt'
|
|
|
|
|
import { getImgUrl } from '@/utils/urlUtils'
|
|
|
|
|
import { useInfiniteScroll } from '@vueuse/core'
|
|
|
|
|
import dayjs from 'dayjs'
|
|
|
|
|
import imagesloaded from 'imagesloaded'
|
|
|
|
|
import { debounce } from 'lodash-es'
|
|
|
|
|
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'
|
|
|
|
@ -41,6 +42,10 @@ const sortBy: PictureSortParam = {
|
|
|
|
|
orderbyvalue: "pictureResult",
|
|
|
|
|
};
|
|
|
|
|
const imageRef = ref<ComponentElRef | null>()
|
|
|
|
|
const checkDuplicateNo = ref('')
|
|
|
|
|
const checkTaskStatus = ref(null) // 1.执行中 2.执行完毕 3.执行失败
|
|
|
|
|
const isRefresh = ref(true) // 生成任务包前,点击刷新数据,并将【一键查重】切换按钮为【生成任务包】
|
|
|
|
|
|
|
|
|
|
let canloadMore = true
|
|
|
|
|
let filterId = null
|
|
|
|
|
|
|
|
|
@ -132,7 +137,16 @@ async function featchList() {
|
|
|
|
|
|
|
|
|
|
const asideParams = unref(configStore.getAsideValue)
|
|
|
|
|
const params = filterId ? { userSearchId: filterId } : asideParams
|
|
|
|
|
const result = await getPictureList({ ...pagination, ...contentParams, ...params, ...sortBy })
|
|
|
|
|
let result = {
|
|
|
|
|
pageCount: 0,
|
|
|
|
|
data: [],
|
|
|
|
|
total: 0,
|
|
|
|
|
}
|
|
|
|
|
if (checkTaskStatus.value === 2 && isRefresh) {
|
|
|
|
|
result = await queryPageListByCheckNo({ ...pagination, ...contentParams, ...params, ...sortBy, checkDuplicateNo: checkDuplicateNo.value })
|
|
|
|
|
} else {
|
|
|
|
|
result = await getPictureList({ ...pagination, ...contentParams, ...params, ...sortBy })
|
|
|
|
|
}
|
|
|
|
|
const { data, pageCount, total } = result
|
|
|
|
|
totalCount.value = total
|
|
|
|
|
canloadMore = pageCount >= pagination.pageNo && pageCount > 0
|
|
|
|
@ -180,8 +194,38 @@ const gridHeight = computed(() => {
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
async function oneCheck() {
|
|
|
|
|
const modal = packageModalRef.value as any
|
|
|
|
|
modal.showModal()
|
|
|
|
|
const asideVal = cloneDeep(configStore.getAsideValue)
|
|
|
|
|
asideVal.izyear = dayjs(asideVal.izyear[0]).format("YYYY/MM/DD") + '-' + dayjs(asideVal.izyear[1]).format("YYYY/MM/DD")
|
|
|
|
|
delete asideVal.izsimilarity
|
|
|
|
|
if (checkDuplicateNo.value) {
|
|
|
|
|
getCheckDuplicateStatus(checkDuplicateNo.value).then((res) => {
|
|
|
|
|
if (res.code === "OK") {
|
|
|
|
|
checkTaskStatus.value = res.data.status // 1.执行中 2.执行完毕
|
|
|
|
|
if (isRefresh.value === false) {
|
|
|
|
|
const modal = packageModalRef.value as any
|
|
|
|
|
modal.showModal()
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (checkTaskStatus.value === 2 && isRefresh) {
|
|
|
|
|
isRefresh.value = false
|
|
|
|
|
message.success('任务执行完毕,正在刷新数据...');
|
|
|
|
|
reset()
|
|
|
|
|
loadMore()
|
|
|
|
|
} else if (checkTaskStatus.value === 1) {
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
oneClickCheckTaskPackage(asideVal).then((res) => {
|
|
|
|
|
if (res.code === "OK") {
|
|
|
|
|
checkDuplicateNo.value = res.data.checkDuplicateNo
|
|
|
|
|
} else {
|
|
|
|
|
message.error(res.message || '查重失败')
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
async function showLoginSuccessModal() {
|
|
|
|
@ -190,28 +234,42 @@ async function showLoginSuccessModal() {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
async function commitHandler(settingParam) {
|
|
|
|
|
const contentParams = {
|
|
|
|
|
search_month: timeRange.value,
|
|
|
|
|
// comparehistory: false
|
|
|
|
|
// mark: false // 是否给重复图片添加重复标识
|
|
|
|
|
// packagename: "22222"
|
|
|
|
|
const params = {
|
|
|
|
|
name: settingParam.packagename,
|
|
|
|
|
checkDuplicateNo: checkDuplicateNo.value,
|
|
|
|
|
// mark: settingParam.mark
|
|
|
|
|
}
|
|
|
|
|
createPackage(params).then((res) => {
|
|
|
|
|
if (res.code === "OK") {
|
|
|
|
|
message.success(res.data);
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
// 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 = { ...contentParams, ...asideVal }
|
|
|
|
|
finalParam.buessinessno = settingParam.packagename
|
|
|
|
|
finalParam.search_history = settingParam.comparehistory ? 1 : 0
|
|
|
|
|
|
|
|
|
|
const modal = generateModalRef.value as any
|
|
|
|
|
modal.showModal()
|
|
|
|
|
// const modal = generateModalRef.value as any
|
|
|
|
|
// modal.showModal()
|
|
|
|
|
|
|
|
|
|
oneClickCheck(finalParam).then(() => {
|
|
|
|
|
modal.closeModal()
|
|
|
|
|
}, () => {
|
|
|
|
|
modal.closeModal()
|
|
|
|
|
})
|
|
|
|
|
// oneClickCheck(finalParam).then(() => {
|
|
|
|
|
// modal.closeModal()
|
|
|
|
|
// }, () => {
|
|
|
|
|
// modal.closeModal()
|
|
|
|
|
// })
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
onMounted(() => {
|
|
|
|
|
emitter.on('filter', refreshHandler)
|
|
|
|
|
|
|
|
|
|
// 一件键重——获取任务编号
|
|
|
|
|
getLastCheckNo().then((res) => {
|
|
|
|
|
if (res.code === "OK") {
|
|
|
|
|
checkDuplicateNo.value = res.data
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
nextTick(() => {
|
|
|
|
|
computeListHeight()
|
|
|
|
|
// 登录后展示成功
|
|
|
|
@ -310,7 +368,7 @@ async function downloadImage(item) {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function previewHandler(index: number,event: MouseEvent) {
|
|
|
|
|
function previewHandler(index: number, event: MouseEvent) {
|
|
|
|
|
event.stopImmediatePropagation();
|
|
|
|
|
event.stopPropagation();
|
|
|
|
|
if (imageRef.value?.[index] && (imageRef.value[index] as any).src)
|
|
|
|
@ -325,7 +383,11 @@ function previewHandler(index: number,event: MouseEvent) {
|
|
|
|
|
<SvgIcon size="32" name="magnifying" />
|
|
|
|
|
<span class="font">AI一键查重</span>
|
|
|
|
|
</div>
|
|
|
|
|
<SvgIcon style="cursor: pointer;" size="105" name="yijianchachong" @click="oneCheck" />
|
|
|
|
|
<SvgIcon v-show="checkTaskStatus !== 2" style="cursor: pointer;" size="105" name="yijianchachong"
|
|
|
|
|
@click="oneCheck" />
|
|
|
|
|
<div v-show="checkTaskStatus === 2" style="cursor: pointer;" size="105" name="magnifying" @click="oneCheck">
|
|
|
|
|
生成任务包
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="wrapper-content">
|
|
|
|
|
<div style="display: flex;justify-content: space-between;">
|
|
|
|
@ -352,7 +414,8 @@ function previewHandler(index: number,event: MouseEvent) {
|
|
|
|
|
<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> 项</span>
|
|
|
|
|
<span style="font-size: 16px;color:#494949">共 <span style="color:#7899fd;font-weight: 500;">{{ totalCount
|
|
|
|
|
}}</span> 项</span>
|
|
|
|
|
</div>
|
|
|
|
|
<n-spin :show="loading">
|
|
|
|
|
<div ref="el" class="scroll" :style="listStyle">
|
|
|
|
@ -508,7 +571,7 @@ function previewHandler(index: number,event: MouseEvent) {
|
|
|
|
|
flex-direction: row;
|
|
|
|
|
align-items: center;
|
|
|
|
|
margin-right: 24px;
|
|
|
|
|
color:#323233;
|
|
|
|
|
color: #323233;
|
|
|
|
|
|
|
|
|
|
.gap {
|
|
|
|
|
margin-left: 5px;
|
|
|
|
@ -546,6 +609,7 @@ function previewHandler(index: number,event: MouseEvent) {
|
|
|
|
|
padding: 0 10px;
|
|
|
|
|
background: rgba(0, 0, 0, .35);
|
|
|
|
|
border-radius: 7px;
|
|
|
|
|
|
|
|
|
|
.img-name {
|
|
|
|
|
width: 70%;
|
|
|
|
|
color: #FFF;
|
|
|
|
|