|
|
@@ -0,0 +1,64 @@
|
|
|
+<template>
|
|
|
+ <view class="h-full">
|
|
|
+ <z-paging ref="paging" @query="handleQuery">
|
|
|
+ <template #top>
|
|
|
+ <college-conditions-picker :options="filter"/>
|
|
|
+ <ie-search v-model="queryParams.name" placeholder="输入院校名称" @search="handleSearch"
|
|
|
+ @clear="handleSearch"/>
|
|
|
+ </template>
|
|
|
+ </z-paging>
|
|
|
+ </view>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script setup lang="ts">
|
|
|
+import {useTransferPage} from "@/hooks/useTransferPage";
|
|
|
+import {getUniversityFilters, universityList} from "@/api/modules/university";
|
|
|
+import {UniversityQueryDto} from "@/types/university";
|
|
|
+import {UNIVERSITY_FILTER} from "@/types/injectionSymbols";
|
|
|
+import CollegeConditionsPicker from "@/pagesOther/pages/university/index/components/plus/college-conditions-picker.vue";
|
|
|
+
|
|
|
+const {transferTo} = useTransferPage()
|
|
|
+const paging = ref<ZPagingInstance>()
|
|
|
+const list = ref([])
|
|
|
+const filter = ref({})
|
|
|
+const queryParams = ref<UniversityQueryDto>({
|
|
|
+ name: '',
|
|
|
+ features: [],
|
|
|
+ type: [],
|
|
|
+ natureTypeCN: [],
|
|
|
+ location: [],
|
|
|
+ level: [],
|
|
|
+ tier: []
|
|
|
+})
|
|
|
+
|
|
|
+const handleSearch = async () => {
|
|
|
+ paging.value?.reload();
|
|
|
+}
|
|
|
+
|
|
|
+const handleQuery = (pageNum: number, pageSize: number) => {
|
|
|
+ const query = {pageNum, pageSize, ...queryParams.value}
|
|
|
+ universityList(query)
|
|
|
+ .then(res => paging.value?.completeByTotal(res.rows, res.total))
|
|
|
+ .catch(e => paging.value?.complete(false))
|
|
|
+}
|
|
|
+
|
|
|
+provide(UNIVERSITY_FILTER, queryParams)
|
|
|
+
|
|
|
+watch([
|
|
|
+ () => queryParams.value.features,
|
|
|
+ () => queryParams.value.type,
|
|
|
+ () => queryParams.value.natureTypeCN,
|
|
|
+ () => queryParams.value.location,
|
|
|
+ () => queryParams.value.level,
|
|
|
+ () => queryParams.value.tier
|
|
|
+], () => handleSearch())
|
|
|
+
|
|
|
+onMounted(async () => {
|
|
|
+ const {data} = await getUniversityFilters()
|
|
|
+})
|
|
|
+
|
|
|
+</script>
|
|
|
+
|
|
|
+<style scoped>
|
|
|
+
|
|
|
+</style>
|