From ad175236eb189d692943d32625151caff9ef31c2 Mon Sep 17 00:00:00 2001 From: raoyongjun <785755591@qq.com> Date: Fri, 26 Apr 2024 18:05:23 +0800 Subject: [PATCH 1/2] =?UTF-8?q?feat:=20=E4=BF=AE=E6=94=B9=E9=80=82?= =?UTF-8?q?=E9=85=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/home/content/Content.vue | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/views/home/content/Content.vue b/src/views/home/content/Content.vue index 56a51e1..a7f6758 100644 --- a/src/views/home/content/Content.vue +++ b/src/views/home/content/Content.vue @@ -85,6 +85,7 @@ const checkDuplicateNo = ref('') const checkTaskStatus = ref(null) // 1.执行中 2.执行完毕 3.执行失败 const isRefresh = ref(true) // 生成任务包前,点击刷新数据,并将【一键查重】切换按钮为【生成任务包】 const bgLoadingImg = ref(bgLoading) +const cols = ref('7') let canloadMore = true let filterId = null @@ -154,6 +155,15 @@ onBeforeMount(async () => { item.calHeight = 182 * item.high / item.wide }) listData.value = listData.value.concat(tmore) + const screenWidth = window.screen.width + if (screenWidth > 1920 && screenWidth <= 2560) + cols.value = '11' + else if (screenWidth <= 1920 && screenWidth >= 1792) + cols.value = '7' + else if (screenWidth < 1792 && screenWidth > 1440) + cols.value = '6' + else if (screenWidth <= 1440) + cols.value = '5' }) onUpdated(() => { @@ -741,7 +751,7 @@ defineExpose({
- +
Date: Fri, 26 Apr 2024 18:35:57 +0800 Subject: [PATCH 2/2] =?UTF-8?q?feat:=20=E4=BF=AE=E6=94=B9=E6=A8=A1?= =?UTF-8?q?=E5=BC=8F=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/home/content/Content.vue | 145 +++++++++++++++++++++++++---- 1 file changed, 127 insertions(+), 18 deletions(-) diff --git a/src/views/home/content/Content.vue b/src/views/home/content/Content.vue index a7f6758..6ae860a 100644 --- a/src/views/home/content/Content.vue +++ b/src/views/home/content/Content.vue @@ -85,7 +85,7 @@ const checkDuplicateNo = ref('') const checkTaskStatus = ref(null) // 1.执行中 2.执行完毕 3.执行失败 const isRefresh = ref(true) // 生成任务包前,点击刷新数据,并将【一键查重】切换按钮为【生成任务包】 const bgLoadingImg = ref(bgLoading) -const cols = ref('7') +const cols = ref(7) let canloadMore = true let filterId = null @@ -157,13 +157,13 @@ onBeforeMount(async () => { listData.value = listData.value.concat(tmore) const screenWidth = window.screen.width if (screenWidth > 1920 && screenWidth <= 2560) - cols.value = '11' + cols.value = 11 else if (screenWidth <= 1920 && screenWidth >= 1792) - cols.value = '7' + cols.value = 7 else if (screenWidth < 1792 && screenWidth > 1440) - cols.value = '6' + cols.value = 6 else if (screenWidth <= 1440) - cols.value = '5' + cols.value = 5 }) onUpdated(() => { @@ -311,19 +311,24 @@ async function loadMore() { } const gridHeight = computed(() => { - let height = '' + let height = 0 if (viewMode.value === 'masonry') - height = 'auto' + height = 0 else if (viewMode.value === 'horizontalVersion') - height = '145px' + height = 145 else if (viewMode.value === 'verticalVersion') - height = '300px' + height = 300 else if (viewMode.value === '3:4') - height = '240px' + height = 240 return height }) +watch(() => viewMode.value, (newVal, oldVal) => { + reset() + loadMore() +}) + const gridMinHeight = computed(() => { let height = '' if (viewMode.value === 'masonry' && loading.value) @@ -504,10 +509,6 @@ function reset() { // layout() } -watch(listData.value, (newVal, oldVal) => { - console.log('最新的val', newVal) -}) - async function refreshHandler(filtersearchId?: any) { reset() @@ -750,12 +751,120 @@ defineExpose({
-
+
+
+
+ 加载错误 + +
+
+
+
加载错误 @@ -930,7 +1039,7 @@ defineExpose({ } .grid{ - display: block !important; + grid-gap: 10px 10px; } .img {