diff --git a/src/views/home/content/Content.vue b/src/views/home/content/Content.vue index 56a51e1..6ae860a 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(() => { @@ -301,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) @@ -494,10 +509,6 @@ function reset() { // layout() } -watch(listData.value, (newVal, oldVal) => { - console.log('最新的val', newVal) -}) - async function refreshHandler(filtersearchId?: any) { reset() @@ -740,12 +751,120 @@ defineExpose({ -
- +
+
+
+ 加载错误 + +
+
+
+
+
加载错误 @@ -920,7 +1039,7 @@ defineExpose({ } .grid{ - display: block !important; + grid-gap: 10px 10px; } .img {