Parcourir la source

论坛切换问题

canghailong il y a 6 mois
Parent
commit
da6bd4b833
2 fichiers modifiés avec 5 ajouts et 5 suppressions
  1. 3 3
      src/views/forum/index.vue
  2. 2 2
      src/views/student/paper/index.vue

+ 3 - 3
src/views/forum/index.vue

@@ -192,7 +192,7 @@
 	})
 	const postName = computed(() => {
 		return (val) => {
-			return typeOptionsVal.value.filter((r) => r.value == val)[0].label
+			return typeOptionsVal.value.find((r) => r.value == val).label
 		}
 	})
 	const typeValue = ref('所有分类')
@@ -254,7 +254,7 @@
 	}
 	const loadData = (parameter, a) => {
 		if (exType.value) {
-			let postExtend = moduleTypeList.value.filter((r) => r.id == searchFormState.sortOrder)[0]?.state
+			let postExtend = moduleTypeList.value.find((r) => r.id == searchFormState.sortOrder).state
 			return forumApi.moreList(Object.assign(parameter,searchFormState, { postExtend: postExtend })).then((data) => {
 				tableTotal.value = data.total
 				if (a) {
@@ -285,7 +285,7 @@
 
 	// 切换应用标签查询菜单列表
 	const moduleClock = (value, t) => {
-		exType.value = false
+		exType.value = true
 		searchFormState.sortOrder = value
 		pagination.value.current = 1
 		moreText.value = '加载更多'

+ 2 - 2
src/views/student/paper/index.vue

@@ -82,13 +82,13 @@
 	const examStore = useExamStore()
 	const paperTypeEnum = computed(() => {
 		return (key) => {
-			return examStore.paperTypeEnum.filter((item) => item.key == key)[0]?.value
+			return examStore.paperTypeEnum.find((item) => item.key == key)?.value
 		}
 	})
 	const examNameOption = tool.dictList('EXAM_TYPE')
 	const examTypeName = computed(() => {
 		return (id) => {
-			return examNameOption.filter((r) => r.value == id)[0].label
+			return examNameOption.find((r) => r.value == id).label
 		}
 	})