This commit is contained in:
xbx 2024-03-27 16:10:08 +08:00
parent 81d2d93618
commit 7a17e9a0ed
1 changed files with 24 additions and 12 deletions

View File

@ -3,7 +3,7 @@
<a-card title="四六级总通过率查询" :bordered="false">
<template #extra>
<a-select v-model:value="college" style="width: 300px" :options="collegeOptions"></a-select>
<a-select v-model:value="entrydate" style="margin-left: 15px;width: 100px"
<a-select v-model:value="entrydate" style="margin-left: 10px;width: 100px"
:options="entrydateOptions"></a-select>
<a-button style="margin-left: 10px;" type="primary" @click="query">查询</a-button>
</template>
@ -32,7 +32,6 @@ import { defHttp } from '/@/utils/http/axios';
import * as echarts from 'echarts';
export default {
name: "Analysis",
data() {
return {
@ -61,23 +60,28 @@ export default {
}
],
Url: {
getGradeAndCollegeData: '/cet/getGradeAndCollege',
getEntrydate: '/cet/getEntrydate',
getCollege: '/cet/getCollege',
getData: '/cet/getData'
},
collegeOptions: [],
entrydateOptions: [],
college: null,
entrydate: null,
entrydate: null
};
},
methods: {
//
async getGradeAndCollegeData() {
const data = await defHttp.get({ url: this.Url.getGradeAndCollegeData });
this.collegeOptions = data.colleges;
async getEntrydateAndCollegeData() {
const getEntrydate = await defHttp.get({ url: this.Url.getEntrydate });
const getCollege = await defHttp.get({ url: this.Url.getCollege });
this.collegeOptions = getCollege.colleges;
//
this.collegeOptions.unshift({ value: '全校', label: '全校' });
this.college = this.collegeOptions[0].value;
this.entrydateOptions = data.entrydates;
this.entrydateOptions = getEntrydate.entrydates;
this.entrydate = this.entrydateOptions[0].value;
this.query();
},
//
async query() {
@ -85,23 +89,31 @@ export default {
college: this.college,
entrydate: this.entrydate
}
const result = await defHttp.get({ url: this.Url.getData, params });
const data = await defHttp.get({ url: this.Url.getData, params });
this.dataSourceCet4 = result.data.cet4;
this.dataSourceCet6 = result.data.cet6;
this.$message.info(`查询结果:${JSON.stringify(result)}`);
this.$message.info(`查询结果:${JSON.stringify(data)}`);
}
},
mounted() {
this.getGradeAndCollegeData();
this.getEntrydateAndCollegeData();
}
}
</script>
<style lang="less" scoped>
.container {
display: flex;
background-color: #fff;
padding: 15px;
border-radius: 4px;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.09);
}
.title {
font-size: 34px;
color: rgb(8, 8, 8);
font-weight: bold;
}
</style>
</style>