|
|
@ -4,23 +4,17 @@ import imagesloaded from 'imagesloaded'
|
|
|
|
import { debounce } from 'lodash-es'
|
|
|
|
import { debounce } from 'lodash-es'
|
|
|
|
import Masonry from 'masonry-layout'
|
|
|
|
import Masonry from 'masonry-layout'
|
|
|
|
import { useMessage } from 'naive-ui'
|
|
|
|
import { useMessage } from 'naive-ui'
|
|
|
|
import { computed, nextTick, onBeforeMount, onMounted, onUnmounted, onUpdated, reactive, ref, unref, watch } from 'vue'
|
|
|
|
import { computed, nextTick, onMounted, onUnmounted, onUpdated, reactive, ref, unref, watch } from 'vue'
|
|
|
|
import GeneratePackageModal from './modal/GeneratePackageModal.vue'
|
|
|
|
import GeneratePackageModal from './modal/GeneratePackageModal.vue'
|
|
|
|
import PackageSettingsModal from './modal/PackageSettingsModal.vue'
|
|
|
|
import PackageSettingsModal from './modal/PackageSettingsModal.vue'
|
|
|
|
import LoginSuccessModal from './modal/LoginSuccessModal.vue'
|
|
|
|
import LoginSuccessModal from './modal/LoginSuccessModal.vue'
|
|
|
|
import { getPictureList, oneClickCheck } from '@/api/home/main'
|
|
|
|
import { getPictureList, oneClickCheck } from '@/api/home/main'
|
|
|
|
import img1 from '@/assets/images/1.jpg'
|
|
|
|
|
|
|
|
import img2 from '@/assets/images/2.jpg'
|
|
|
|
|
|
|
|
import img3 from '@/assets/images/3.jpg'
|
|
|
|
|
|
|
|
import img4 from '@/assets/images/4.jpg'
|
|
|
|
|
|
|
|
import img5 from '@/assets/images/5.jpg'
|
|
|
|
|
|
|
|
import avatar from '@/assets/images/avatar.jpg'
|
|
|
|
import avatar from '@/assets/images/avatar.jpg'
|
|
|
|
import { timeOptions, viewOptions } from '@/config/home'
|
|
|
|
import { timeOptions, viewOptions } from '@/config/home'
|
|
|
|
import { useWindowSizeFn } from '@/hooks/event/useWindowSizeFn'
|
|
|
|
import { useWindowSizeFn } from '@/hooks/event/useWindowSizeFn'
|
|
|
|
import { useConfig } from '@/store/modules/asideConfig'
|
|
|
|
import { useConfig } from '@/store/modules/asideConfig'
|
|
|
|
import { getViewportOffset } from '@/utils/domUtils'
|
|
|
|
import { getViewportOffset } from '@/utils/domUtils'
|
|
|
|
import { hideDownload } from '@/utils/image'
|
|
|
|
import { hideDownload } from '@/utils/image'
|
|
|
|
import { randomInt } from '@/utils/index'
|
|
|
|
|
|
|
|
import emitter from '@/utils/mitt'
|
|
|
|
import emitter from '@/utils/mitt'
|
|
|
|
import { getImgUrl } from '@/utils/urlUtils'
|
|
|
|
import { getImgUrl } from '@/utils/urlUtils'
|
|
|
|
|
|
|
|
|
|
|
@ -32,7 +26,7 @@ const el = ref<HTMLDivElement | null>(null)
|
|
|
|
const viewMode = ref('masonry')
|
|
|
|
const viewMode = ref('masonry')
|
|
|
|
const pagination = reactive({
|
|
|
|
const pagination = reactive({
|
|
|
|
pageNo: 0,
|
|
|
|
pageNo: 0,
|
|
|
|
pageSize: 30,
|
|
|
|
pageSize: 50,
|
|
|
|
})
|
|
|
|
})
|
|
|
|
const configStore = useConfig()
|
|
|
|
const configStore = useConfig()
|
|
|
|
const packageModalRef = ref(null)
|
|
|
|
const packageModalRef = ref(null)
|
|
|
@ -73,17 +67,13 @@ const layout = debounce(() => {
|
|
|
|
|
|
|
|
|
|
|
|
_imagesload = imagesloaded('.grid-item')
|
|
|
|
_imagesload = imagesloaded('.grid-item')
|
|
|
|
|
|
|
|
|
|
|
|
// _imagesload.on('always', (instance) => {
|
|
|
|
|
|
|
|
// console.log('always')
|
|
|
|
|
|
|
|
// })
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
_imagesload.on('done', (instance) => {
|
|
|
|
_imagesload.on('done', (instance) => {
|
|
|
|
(_masonry as any).layout()
|
|
|
|
(_masonry as any).layout()
|
|
|
|
if (!el.value)
|
|
|
|
if (!el.value)
|
|
|
|
return
|
|
|
|
return
|
|
|
|
const scrollHeight = el.value!.scrollHeight
|
|
|
|
const scrollHeight = el.value!.scrollHeight
|
|
|
|
const clientHeight = el.value!.clientHeight
|
|
|
|
const clientHeight = el.value!.clientHeight
|
|
|
|
const top = scrollHeight - clientHeight - 20
|
|
|
|
const top = scrollHeight - clientHeight - 100
|
|
|
|
el.value!.scrollTo({ top, behavior: 'instant' })
|
|
|
|
el.value!.scrollTo({ top, behavior: 'instant' })
|
|
|
|
loading.value = false
|
|
|
|
loading.value = false
|
|
|
|
})
|
|
|
|
})
|
|
|
@ -136,19 +126,6 @@ const viewLabel = computed(() => {
|
|
|
|
|
|
|
|
|
|
|
|
const listData = ref<any[]>([])
|
|
|
|
const listData = ref<any[]>([])
|
|
|
|
|
|
|
|
|
|
|
|
const urls = [
|
|
|
|
|
|
|
|
img1,
|
|
|
|
|
|
|
|
img2,
|
|
|
|
|
|
|
|
img3,
|
|
|
|
|
|
|
|
img4,
|
|
|
|
|
|
|
|
img5,
|
|
|
|
|
|
|
|
]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function randomUrl() {
|
|
|
|
|
|
|
|
const index = randomInt(0, urls.length)
|
|
|
|
|
|
|
|
return urls[index]
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
async function featchList() {
|
|
|
|
async function featchList() {
|
|
|
|
loading.value = true
|
|
|
|
loading.value = true
|
|
|
|
try {
|
|
|
|
try {
|
|
|
@ -159,9 +136,6 @@ async function featchList() {
|
|
|
|
|
|
|
|
|
|
|
|
pagination.pageNo += 1
|
|
|
|
pagination.pageNo += 1
|
|
|
|
const result = await getPictureList({ ...pagination, ...contentParams })
|
|
|
|
const result = await getPictureList({ ...pagination, ...contentParams })
|
|
|
|
// TODO:测试数据
|
|
|
|
|
|
|
|
// result.data = Array.from({ length: 30 })
|
|
|
|
|
|
|
|
// result.pageCount = 1
|
|
|
|
|
|
|
|
const { data, pageCount } = result
|
|
|
|
const { data, pageCount } = result
|
|
|
|
canloadMore = pageCount >= pagination.pageNo && pageCount > 0
|
|
|
|
canloadMore = pageCount >= pagination.pageNo && pageCount > 0
|
|
|
|
|
|
|
|
|
|
|
@ -190,11 +164,6 @@ async function loadMore() {
|
|
|
|
listData.value.push(...more)
|
|
|
|
listData.value.push(...more)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// onBeforeMount(async () => {
|
|
|
|
|
|
|
|
// const list = await featchList()
|
|
|
|
|
|
|
|
// listData.value = list
|
|
|
|
|
|
|
|
// })
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const gridHeight = computed(() => {
|
|
|
|
const gridHeight = computed(() => {
|
|
|
|
return viewMode.value !== 'masonry' ? '145px' : ''
|
|
|
|
return viewMode.value !== 'masonry' ? '145px' : ''
|
|
|
|
})
|
|
|
|
})
|
|
|
@ -255,7 +224,7 @@ watch(() => configStore.asideValue, (newVal, oldVal) => {
|
|
|
|
|
|
|
|
|
|
|
|
async function refreshHandler() {
|
|
|
|
async function refreshHandler() {
|
|
|
|
pagination.pageNo = 0
|
|
|
|
pagination.pageNo = 0
|
|
|
|
pagination.pageSize = 30
|
|
|
|
pagination.pageSize = 50
|
|
|
|
listData.value.length = 0
|
|
|
|
listData.value.length = 0
|
|
|
|
loading.value = true
|
|
|
|
loading.value = true
|
|
|
|
canloadMore = true
|
|
|
|
canloadMore = true
|
|
|
@ -290,30 +259,30 @@ function getAvatar(url: string): string {
|
|
|
|
<template>
|
|
|
|
<template>
|
|
|
|
<div class="wrapper">
|
|
|
|
<div class="wrapper">
|
|
|
|
<div class="wrapper-header">
|
|
|
|
<div class="wrapper-header">
|
|
|
|
<div class="wrapper-header-left">
|
|
|
|
<div class="left">
|
|
|
|
<SvgIcon size="32" name="magnifying" />
|
|
|
|
<SvgIcon size="32" name="magnifying" />
|
|
|
|
<span class="wrapper-header-font">AI一键查重</span>
|
|
|
|
<span class="font">AI一键查重</span>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<SvgIcon style="cursor: pointer;" size="105" name="yijianchachong" @click="oneCheck" />
|
|
|
|
<SvgIcon style="cursor: pointer;" size="105" name="yijianchachong" @click="oneCheck" />
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="wrapper-content">
|
|
|
|
<div class="wrapper-content">
|
|
|
|
<div class="wrapper-content-form">
|
|
|
|
<div class="form">
|
|
|
|
<n-popselect v-model:value="timeRange" :options="timeOptions" trigger="click">
|
|
|
|
<n-popselect v-model:value="timeRange" :options="timeOptions" trigger="click">
|
|
|
|
<div class="wrapper-content-dropdown">
|
|
|
|
<div class="dropdown">
|
|
|
|
<span>{{ timeLabel || '请选择' }}</span>
|
|
|
|
<span>{{ timeLabel || '请选择' }}</span>
|
|
|
|
<SvgIcon class="wrapper-content-dropdown-gap" name="arrow-botton" size="14" />
|
|
|
|
<SvgIcon class="gap" name="arrow-botton" size="14" />
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</n-popselect>
|
|
|
|
</n-popselect>
|
|
|
|
<n-popselect v-model:value="viewMode" :options="viewOptions" trigger="click">
|
|
|
|
<n-popselect v-model:value="viewMode" :options="viewOptions" trigger="click">
|
|
|
|
<div class="wrapper-content-dropdown">
|
|
|
|
<div class="dropdown">
|
|
|
|
<span>{{ viewLabel || '请选择' }}</span>
|
|
|
|
<span>{{ viewLabel || '请选择' }}</span>
|
|
|
|
<SvgIcon class="wrapper-content-dropdown-gap" name="arrow-botton" size="14" />
|
|
|
|
<SvgIcon class="gap" name="arrow-botton" size="14" />
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</n-popselect>
|
|
|
|
</n-popselect>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div ref="el" class="scroll" :style="listStyle">
|
|
|
|
<n-spin :show="loading">
|
|
|
|
<!-- <n-scrollbar :on-scroll="scrollHandler"> -->
|
|
|
|
<div ref="el" class="scroll" :style="listStyle">
|
|
|
|
<n-spin :show="loading">
|
|
|
|
<!-- <n-scrollbar :on-scroll="scrollHandler"> -->
|
|
|
|
<div ref="masonryRef" class="grid">
|
|
|
|
<div ref="masonryRef" class="grid">
|
|
|
|
<div v-for="(item, index) in listData" :key="index" :style="{ height: gridHeight }" class="grid-item">
|
|
|
|
<div v-for="(item, index) in listData" :key="index" :style="{ height: gridHeight }" class="grid-item">
|
|
|
|
<!-- <div :style="{ 'background-color': randomColor(0.2) }" class="wrapper-content-item-img" /> -->
|
|
|
|
<!-- <div :style="{ 'background-color': randomColor(0.2) }" class="wrapper-content-item-img" /> -->
|
|
|
@ -321,22 +290,25 @@ function getAvatar(url: string): string {
|
|
|
|
class="wrapper-content-item-img" :class="{ 'wrapper-content-item-img-fit': viewMode !== 'masonry' }"
|
|
|
|
class="wrapper-content-item-img" :class="{ 'wrapper-content-item-img-fit': viewMode !== 'masonry' }"
|
|
|
|
:src="item.imgUrl"
|
|
|
|
:src="item.imgUrl"
|
|
|
|
> -->
|
|
|
|
> -->
|
|
|
|
<n-image class="wrapper-content-item-img" :img-props="{ onClick: hideDownload }" :class="{ 'wrapper-content-item-img-fit': viewMode !== 'masonry' }" :src="item.imgUrl" />
|
|
|
|
<n-image
|
|
|
|
<div class="wrapper-content-item-info">
|
|
|
|
class="img" :img-props="{ onClick: hideDownload }"
|
|
|
|
<div class="wrapper-content-item-info-left">
|
|
|
|
:class="{ 'img-fit': viewMode !== 'masonry' }" :src="item.imgUrl"
|
|
|
|
<n-avatar :src="getAvatar(item.uphead)" class="wrapper-content-item-info-avatar" round />
|
|
|
|
/>
|
|
|
|
|
|
|
|
<div class="info">
|
|
|
|
|
|
|
|
<div class="left">
|
|
|
|
|
|
|
|
<n-avatar :src="getAvatar(item.uphead)" class="avatar" round />
|
|
|
|
<span>{{ item.upname }}</span>
|
|
|
|
<span>{{ item.upname }}</span>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="wrapper-content-item-info-right">
|
|
|
|
<div class="right">
|
|
|
|
<span :style="{ marginRight: '5px' }">分类</span>
|
|
|
|
<span :style="{ marginRight: '5px' }">分类</span>
|
|
|
|
<span>{{ item.ocrPictureclass?.classname }}</span>
|
|
|
|
<span>{{ item.ocrPictureclass?.classname }}</span>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</n-spin>
|
|
|
|
<!-- </n-scrollbar> -->
|
|
|
|
<!-- </n-scrollbar> -->
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</n-spin>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<PackageSettingsModal ref="packageModalRef" @commit="commitHandler" />
|
|
|
|
<PackageSettingsModal ref="packageModalRef" @commit="commitHandler" />
|
|
|
|
<GeneratePackageModal ref="generateModalRef" />
|
|
|
|
<GeneratePackageModal ref="generateModalRef" />
|
|
|
@ -365,12 +337,12 @@ function getAvatar(url: string): string {
|
|
|
|
border-radius: 3px;
|
|
|
|
border-radius: 3px;
|
|
|
|
width: 100%;
|
|
|
|
width: 100%;
|
|
|
|
|
|
|
|
|
|
|
|
&-left {
|
|
|
|
.left {
|
|
|
|
display: flex;
|
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
|
|
|
align-items: center;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
&-font {
|
|
|
|
.font {
|
|
|
|
font-size: 18px;
|
|
|
|
font-size: 18px;
|
|
|
|
font-weight: bold;
|
|
|
|
font-weight: bold;
|
|
|
|
color: #333333;
|
|
|
|
color: #333333;
|
|
|
@ -387,55 +359,53 @@ function getAvatar(url: string): string {
|
|
|
|
border-radius: 3px;
|
|
|
|
border-radius: 3px;
|
|
|
|
border: 1px solid rgb(239, 239, 245);
|
|
|
|
border: 1px solid rgb(239, 239, 245);
|
|
|
|
|
|
|
|
|
|
|
|
&-form {
|
|
|
|
.form {
|
|
|
|
display: flex;
|
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
|
|
|
align-items: center;
|
|
|
|
font-size: 14px;
|
|
|
|
font-size: 14px;
|
|
|
|
padding-bottom: 16px;
|
|
|
|
padding-bottom: 16px;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
&-item {
|
|
|
|
.img {
|
|
|
|
&-img {
|
|
|
|
border-radius: 7px;
|
|
|
|
border-radius: 7px;
|
|
|
|
display: block;
|
|
|
|
display: block;
|
|
|
|
height: calc(100% - 25px);
|
|
|
|
height: calc(100% - 20px);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.img-fit {
|
|
|
|
|
|
|
|
width: 100%;
|
|
|
|
|
|
|
|
overflow: hidden;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.info {
|
|
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
|
|
justify-content: space-between;
|
|
|
|
|
|
|
|
margin-top: 4px;
|
|
|
|
|
|
|
|
|
|
|
|
&-img-fit {
|
|
|
|
.left {
|
|
|
|
width: 100%;
|
|
|
|
display: flex;
|
|
|
|
object-fit: cover;
|
|
|
|
align-items: center;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
&-info {
|
|
|
|
.right {
|
|
|
|
display: flex;
|
|
|
|
display: flex;
|
|
|
|
justify-content: space-between;
|
|
|
|
align-items: center;
|
|
|
|
margin-top: 4px;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
&-left {
|
|
|
|
.avatar {
|
|
|
|
display: flex;
|
|
|
|
width: 15px;
|
|
|
|
align-items: center;
|
|
|
|
height: 15px;
|
|
|
|
}
|
|
|
|
margin-right: 5px;
|
|
|
|
|
|
|
|
|
|
|
|
&-right {
|
|
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
|
|
align-items: center;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
&-avatar {
|
|
|
|
|
|
|
|
width: 15px;
|
|
|
|
|
|
|
|
height: 15px;
|
|
|
|
|
|
|
|
margin-right: 5px;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
&-dropdown {
|
|
|
|
.dropdown {
|
|
|
|
display: flex;
|
|
|
|
display: flex;
|
|
|
|
flex-direction: row;
|
|
|
|
flex-direction: row;
|
|
|
|
align-items: center;
|
|
|
|
align-items: center;
|
|
|
|
margin-right: 24px;
|
|
|
|
margin-right: 24px;
|
|
|
|
|
|
|
|
|
|
|
|
&-gap {
|
|
|
|
.gap {
|
|
|
|
margin-left: 5px;
|
|
|
|
margin-left: 5px;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -443,7 +413,8 @@ function getAvatar(url: string): string {
|
|
|
|
.grid-item {
|
|
|
|
.grid-item {
|
|
|
|
width: 182px;
|
|
|
|
width: 182px;
|
|
|
|
border-radius: 7px;
|
|
|
|
border-radius: 7px;
|
|
|
|
margin-bottom: 20px;
|
|
|
|
margin-bottom: 10px;
|
|
|
|
|
|
|
|
overflow: hidden;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.scroll {
|
|
|
|
.scroll {
|
|
|
|