|
|
@ -6,6 +6,7 @@ import { clone, cloneDeep, debounce, pickBy } from 'lodash-es'
|
|
|
|
import { useDialog, useMessage } from 'naive-ui'
|
|
|
|
import { useDialog, useMessage } from 'naive-ui'
|
|
|
|
import {
|
|
|
|
import {
|
|
|
|
computed,
|
|
|
|
computed,
|
|
|
|
|
|
|
|
nextTick,
|
|
|
|
onMounted,
|
|
|
|
onMounted,
|
|
|
|
onUnmounted,
|
|
|
|
onUnmounted,
|
|
|
|
onUpdated,
|
|
|
|
onUpdated,
|
|
|
@ -37,6 +38,7 @@ const totalCount = ref(0)
|
|
|
|
let _imagesload: any
|
|
|
|
let _imagesload: any
|
|
|
|
const bgLoadingImg = ref(bgLoading)
|
|
|
|
const bgLoadingImg = ref(bgLoading)
|
|
|
|
const imgbigshow = ref(true)
|
|
|
|
const imgbigshow = ref(true)
|
|
|
|
|
|
|
|
const isInitLoading = ref(0)
|
|
|
|
|
|
|
|
|
|
|
|
function changeimgbigshow() {
|
|
|
|
function changeimgbigshow() {
|
|
|
|
imgbigshow.value = !imgbigshow.value
|
|
|
|
imgbigshow.value = !imgbigshow.value
|
|
|
@ -132,7 +134,13 @@ function reset() {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
async function refreshHandler() {
|
|
|
|
async function refreshHandler() {
|
|
|
|
reset()
|
|
|
|
reset()
|
|
|
|
|
|
|
|
loadMore()
|
|
|
|
|
|
|
|
setTimeout(() => {
|
|
|
|
|
|
|
|
loadMore()
|
|
|
|
|
|
|
|
canloadMore = true
|
|
|
|
|
|
|
|
}, 1000)
|
|
|
|
|
|
|
|
nextTick(() => {
|
|
|
|
|
|
|
|
setTimeout(() => {
|
|
|
|
useInfiniteScroll(
|
|
|
|
useInfiniteScroll(
|
|
|
|
el as any,
|
|
|
|
el as any,
|
|
|
|
() => {
|
|
|
|
() => {
|
|
|
@ -140,15 +148,26 @@ async function refreshHandler() {
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{ distance: 10, canLoadMore: () => canloadMore },
|
|
|
|
{ distance: 10, canLoadMore: () => canloadMore },
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
}, 300)
|
|
|
|
|
|
|
|
})
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
useInfiniteScroll(
|
|
|
|
|
|
|
|
el as any,
|
|
|
|
|
|
|
|
() => {
|
|
|
|
|
|
|
|
loadMore()
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
{ distance: 10, canLoadMore: () => canloadMore },
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
async function loadMore() {
|
|
|
|
async function loadMore() {
|
|
|
|
if (loading.value || el.value == null)
|
|
|
|
if (loading.value || el.value == null)
|
|
|
|
return
|
|
|
|
return
|
|
|
|
|
|
|
|
|
|
|
|
const more = await featchList()
|
|
|
|
const more = await featchList()
|
|
|
|
listData.value.push(...more)
|
|
|
|
listData.value.push(...more)
|
|
|
|
console.log('listData.value11111111111111111', listData.value)
|
|
|
|
loading.value = false
|
|
|
|
|
|
|
|
isInitLoading.value++
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
async function featchList() {
|
|
|
|
async function featchList() {
|
|
|
@ -163,7 +182,7 @@ async function featchList() {
|
|
|
|
})
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
totalCount.value = total
|
|
|
|
totalCount.value = total
|
|
|
|
canloadMore = pageCount >= taskpagination.pageNo && pageCount > 0
|
|
|
|
canloadMore = (pageCount >= taskpagination.pageNo && pageCount > 0 && isInitLoading.value > 1)
|
|
|
|
return data
|
|
|
|
return data
|
|
|
|
}
|
|
|
|
}
|
|
|
|
catch (error) {
|
|
|
|
catch (error) {
|
|
|
@ -175,19 +194,21 @@ async function featchList() {
|
|
|
|
const layout = debounce(() => {
|
|
|
|
const layout = debounce(() => {
|
|
|
|
if (el.value == null)
|
|
|
|
if (el.value == null)
|
|
|
|
return
|
|
|
|
return
|
|
|
|
|
|
|
|
|
|
|
|
_imagesload = imagesloaded('.grid-item')
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
_imagesload.on('done', (instance) => {
|
|
|
|
|
|
|
|
if (!el.value)
|
|
|
|
|
|
|
|
return
|
|
|
|
|
|
|
|
loading.value = false
|
|
|
|
loading.value = false
|
|
|
|
})
|
|
|
|
// 暂时注释 start
|
|
|
|
|
|
|
|
// _imagesload = imagesloaded('.grid-item')
|
|
|
|
|
|
|
|
|
|
|
|
_imagesload.on('fail', (instance) => {
|
|
|
|
// _imagesload.on('done', (instance) => {
|
|
|
|
message.error('图片错误')
|
|
|
|
// if (!el.value)
|
|
|
|
loading.value = false
|
|
|
|
// return
|
|
|
|
})
|
|
|
|
// loading.value = false
|
|
|
|
|
|
|
|
// })
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// _imagesload.on('fail', (instance) => {
|
|
|
|
|
|
|
|
// message.error('图片错误')
|
|
|
|
|
|
|
|
// loading.value = false
|
|
|
|
|
|
|
|
// })
|
|
|
|
|
|
|
|
// 暂时注释 end
|
|
|
|
}, 300)
|
|
|
|
}, 300)
|
|
|
|
|
|
|
|
|
|
|
|
const fullscreenStyles = computed<any>(() => ({
|
|
|
|
const fullscreenStyles = computed<any>(() => ({
|
|
|
@ -202,13 +223,17 @@ const fullscreenStyles = computed<any>(() => ({
|
|
|
|
// 切换全屏状态
|
|
|
|
// 切换全屏状态
|
|
|
|
function toggleFullScreen() {
|
|
|
|
function toggleFullScreen() {
|
|
|
|
isFullScreen.value = !isFullScreen.value
|
|
|
|
isFullScreen.value = !isFullScreen.value
|
|
|
|
if(!isFullScreen.value){
|
|
|
|
if (!isFullScreen.value)
|
|
|
|
imgbigshow.value = true
|
|
|
|
imgbigshow.value = true
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
onUpdated(() => {
|
|
|
|
onUpdated(() => {
|
|
|
|
layout()
|
|
|
|
// layout()
|
|
|
|
|
|
|
|
// nextTick(() => {
|
|
|
|
|
|
|
|
// setTimeout(() => {
|
|
|
|
|
|
|
|
// layout()
|
|
|
|
|
|
|
|
// }, 500)
|
|
|
|
|
|
|
|
// })
|
|
|
|
})
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
watch(
|
|
|
|
watch(
|
|
|
@ -635,6 +660,7 @@ defineExpose({
|
|
|
|
|
|
|
|
|
|
|
|
<n-spin :show="loading">
|
|
|
|
<n-spin :show="loading">
|
|
|
|
<div ref="el" class="scroll">
|
|
|
|
<div ref="el" class="scroll">
|
|
|
|
|
|
|
|
<!-- <div class="scroll"> -->
|
|
|
|
<div class="wrapper-detail">
|
|
|
|
<div class="wrapper-detail">
|
|
|
|
<!-- 左侧大图 图片信息 -->
|
|
|
|
<!-- 左侧大图 图片信息 -->
|
|
|
|
<div
|
|
|
|
<div
|
|
|
@ -952,7 +978,8 @@ defineExpose({
|
|
|
|
.fullscreen-container {
|
|
|
|
.fullscreen-container {
|
|
|
|
/* 可添加其他样式 */
|
|
|
|
/* 可添加其他样式 */
|
|
|
|
width: 100vw;
|
|
|
|
width: 100vw;
|
|
|
|
height: 100vh;
|
|
|
|
// height: 100vh;
|
|
|
|
|
|
|
|
height: 100%;
|
|
|
|
margin: 0px !important;
|
|
|
|
margin: 0px !important;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -966,9 +993,14 @@ defineExpose({
|
|
|
|
background: #fff;
|
|
|
|
background: #fff;
|
|
|
|
border-radius: 3px;
|
|
|
|
border-radius: 3px;
|
|
|
|
border: 1px solid rgb(239, 239, 245);
|
|
|
|
border: 1px solid rgb(239, 239, 245);
|
|
|
|
|
|
|
|
:deep(.n-spin-container) {
|
|
|
|
|
|
|
|
height: calc(100% - 68px);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
:deep(.n-spin-content) {
|
|
|
|
|
|
|
|
height: 100%;
|
|
|
|
|
|
|
|
}
|
|
|
|
.scroll {
|
|
|
|
.scroll {
|
|
|
|
height: calc(100vh - 88px - 72px);
|
|
|
|
height: 100%;
|
|
|
|
overflow-y: scroll;
|
|
|
|
overflow-y: scroll;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|