فهرست منبع

论坛分页问题处理

canghailong 6 ماه پیش
والد
کامیت
21930a57ab
2فایلهای تغییر یافته به همراه14 افزوده شده و 9 حذف شده
  1. 14 9
      src/views/forum/index.vue
  2. 0 0
      stats.html

+ 14 - 9
src/views/forum/index.vue

@@ -74,7 +74,9 @@
 				<template #bodyCell="{ column, record }">
 					<template v-if="column.dataIndex === 'postTitle'">
 						<div class="forum-list-title">{{ record.postTitle }}</div>
-						<div class="forum-list-type">{{ postName(record.postType) }} | {{ record.typeName }}</div>
+						<div class="forum-list-type">
+							{{ postName(record.postType) }} {{ record.typeName ? '|' : '' }} {{ record.typeName }}
+						</div>
 						<div class="forum-list-content one-line" v-html="record.postContent"></div>
 					</template>
 					<template v-if="column.dataIndex === 'lastReplyUserAvatar'">
@@ -88,7 +90,7 @@
 				</template>
 			</a-table>
 			<div style="text-align: center; cursor: pointer" class="mt-2" @click="moreList">{{ moreText }}</div>
-			<Form ref="formRef" @successful="loadData(pagination.value)" />
+			<Form ref="formRef" @successful="resetLoad()" />
 		</a-card>
 	</div>
 </template>
@@ -195,6 +197,10 @@
 			value: 3
 		}
 	])
+	const pagination = ref({
+		current: 1,
+		size: 10
+	})
 	const postName = computed(() => {
 		return (val) => {
 			return typeOptionsVal.value.filter((r) => r.value == val)[0].label
@@ -256,6 +262,10 @@
 	const exType = ref(false)
 	const tableData = ref([])
 	const tableTotal = ref(0)
+	const resetLoad = () => {
+		pagination.value.current = 1
+		loadData(pagination.value)
+	}
 	const loadData = (parameter, a) => {
 		if (exType.value) {
 			let postExtend = moduleTypeList.value.filter((r) => r.id == searchFormState.sortOrder)[0]?.state
@@ -286,10 +296,6 @@
 			})
 		}
 	}
-	const pagination = ref({
-		current: 1,
-		size: 10
-	})
 
 	// 切换应用标签查询菜单列表
 	const moduleClock = (value, t) => {
@@ -337,12 +343,11 @@
 			path: '/'
 		})
 	}
-
-	// 添加scroll监听
 	onMounted(() => {
 		getTypeList()
 		loadData(pagination.value)
 		nextTick(() => {
+			// 添加scroll监听
 			if (table.value) {
 				const tableContainer = window.document.querySelector('.main-content-wrapper')
 				tableContainer.addEventListener('scroll', handleScroll)
@@ -350,8 +355,8 @@
 		})
 	})
 
-	// 移除scroll监听
 	onBeforeUnmount(() => {
+		// 移除scroll监听
 		nextTick(() => {
 			if (table.value) {
 				const tableContainer = window.document.querySelector('.main-content-wrapper')

تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 0 - 0
stats.html


برخی فایل ها در این مقایسه diff نمایش داده نمی شوند زیرا تعداد فایل ها بسیار زیاد است