canghailong 7 месяцев назад
Родитель
Сommit
c446865af4
1 измененных файлов с 66 добавлено и 8 удалено
  1. 66 8
      src/views/forum/index.vue

+ 66 - 8
src/views/forum/index.vue

@@ -17,6 +17,14 @@
 				:filter-option="filterOption"
 				:filter-option="filterOption"
 				@change="handleChange"
 				@change="handleChange"
 			></a-select>
 			></a-select>
+			<a-select
+				v-model:value="typeValueEx"
+				allowClear
+				placeholder="请选择"
+				style="width: 200px"
+				:options="typeOptionsEx"
+				@change="handleChangeEx"
+			></a-select>
 			<a-radio-group v-model:value="searchFormState.sortOrder" button-style="solid">
 			<a-radio-group v-model:value="searchFormState.sortOrder" button-style="solid">
 				<a-radio-button
 				<a-radio-button
 					v-for="module in moduleTypeList"
 					v-for="module in moduleTypeList"
@@ -110,6 +118,8 @@
 	const typeValue = ref('所有分类')
 	const typeValue = ref('所有分类')
 	const typeOptions = ref([])
 	const typeOptions = ref([])
 	const handleChange = (value) => {
 	const handleChange = (value) => {
+		exType.value = false
+		typeValueEx.value = ''
 		searchFormState.typeId = value
 		searchFormState.typeId = value
 		table.value.refresh(true)
 		table.value.refresh(true)
 	}
 	}
@@ -122,6 +132,8 @@
 	}
 	}
 	// 查询
 	// 查询
 	const onSearch = () => {
 	const onSearch = () => {
+		typeValueEx.value = ''
+		exType.value = false
 		table.value.refresh(true)
 		table.value.refresh(true)
 	}
 	}
 	function customRow(record) {
 	function customRow(record) {
@@ -138,7 +150,7 @@
 			}
 			}
 		})
 		})
 	}
 	}
-	const loadData = (parameter) => {
+	function getTypeList() {
 		forumApi.forumTypeList().then((data) => {
 		forumApi.forumTypeList().then((data) => {
 			typeOptions.value = data.map((r) => {
 			typeOptions.value = data.map((r) => {
 				return {
 				return {
@@ -148,16 +160,62 @@
 				}
 				}
 			})
 			})
 		})
 		})
-		return forumApi.forumList(Object.assign(parameter, searchFormState)).then((data) => {
-			if (data) {
-				return data
-			} else {
-				return []
-			}
-		})
+	}
+	getTypeList()
+
+	const typeValueEx = ref('')
+	const exType = ref(false)
+	const typeOptionsEx = ref([
+		{
+			label: '我发布的',
+			value: 1
+		},
+		{
+			label: '我回复的',
+			value: 2
+		},
+		{
+			label: '关于我的',
+			value: 3
+		},
+		{
+			label: '我点赞的',
+			value: 4
+		}
+	])
+	const handleChangeEx = (value) => {
+		if (value) {
+			exType.value = true
+		} else {
+			exType.value = false
+			typeValueEx.value = ''
+		}
+
+		table.value.refresh(true)
+	}
+	const loadData = (parameter) => {
+		if (exType.value) {
+			return forumApi.moreList(Object.assign(parameter, {postExtend:typeValueEx.value})).then((data) => {
+				if (data) {
+					return data
+				} else {
+					return []
+				}
+			})
+		} else {
+			return forumApi.forumList(Object.assign(parameter, searchFormState)).then((data) => {
+				if (data) {
+					return data
+				} else {
+					return []
+				}
+			})
+		}
 	}
 	}
 	// 切换应用标签查询菜单列表
 	// 切换应用标签查询菜单列表
 	const moduleClock = (value) => {
 	const moduleClock = (value) => {
+		exType.value = false
+		typeValueEx.value = ''
 		searchFormState.sortOrder = value
 		searchFormState.sortOrder = value
 		table.value.refresh(true)
 		table.value.refresh(true)
 	}
 	}