This commit is contained in:
parent
81d2d93618
commit
7a17e9a0ed
|
@ -3,7 +3,7 @@
|
||||||
<a-card title="四六级总通过率查询" :bordered="false">
|
<a-card title="四六级总通过率查询" :bordered="false">
|
||||||
<template #extra>
|
<template #extra>
|
||||||
<a-select v-model:value="college" style="width: 300px" :options="collegeOptions"></a-select>
|
<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>
|
:options="entrydateOptions"></a-select>
|
||||||
<a-button style="margin-left: 10px;" type="primary" @click="query">查询</a-button>
|
<a-button style="margin-left: 10px;" type="primary" @click="query">查询</a-button>
|
||||||
</template>
|
</template>
|
||||||
|
@ -32,7 +32,6 @@ import { defHttp } from '/@/utils/http/axios';
|
||||||
import * as echarts from 'echarts';
|
import * as echarts from 'echarts';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
|
||||||
name: "Analysis",
|
name: "Analysis",
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
@ -61,23 +60,28 @@ export default {
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
Url: {
|
Url: {
|
||||||
getGradeAndCollegeData: '/cet/getGradeAndCollege',
|
getEntrydate: '/cet/getEntrydate',
|
||||||
|
getCollege: '/cet/getCollege',
|
||||||
getData: '/cet/getData'
|
getData: '/cet/getData'
|
||||||
},
|
},
|
||||||
collegeOptions: [],
|
collegeOptions: [],
|
||||||
entrydateOptions: [],
|
entrydateOptions: [],
|
||||||
college: null,
|
college: null,
|
||||||
entrydate: null,
|
entrydate: null
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
// 获取年级和学院数据
|
// 获取年级和学院数据
|
||||||
async getGradeAndCollegeData() {
|
async getEntrydateAndCollegeData() {
|
||||||
const data = await defHttp.get({ url: this.Url.getGradeAndCollegeData });
|
const getEntrydate = await defHttp.get({ url: this.Url.getEntrydate });
|
||||||
this.collegeOptions = data.colleges;
|
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.college = this.collegeOptions[0].value;
|
||||||
this.entrydateOptions = data.entrydates;
|
this.entrydateOptions = getEntrydate.entrydates;
|
||||||
this.entrydate = this.entrydateOptions[0].value;
|
this.entrydate = this.entrydateOptions[0].value;
|
||||||
|
this.query();
|
||||||
},
|
},
|
||||||
// 查询数据
|
// 查询数据
|
||||||
async query() {
|
async query() {
|
||||||
|
@ -85,20 +89,28 @@ export default {
|
||||||
college: this.college,
|
college: this.college,
|
||||||
entrydate: this.entrydate
|
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.dataSourceCet4 = result.data.cet4;
|
||||||
this.dataSourceCet6 = result.data.cet6;
|
this.dataSourceCet6 = result.data.cet6;
|
||||||
this.$message.info(`查询结果:${JSON.stringify(result)}`);
|
this.$message.info(`查询结果:${JSON.stringify(data)}`);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
this.getGradeAndCollegeData();
|
this.getEntrydateAndCollegeData();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="less" scoped>
|
<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 {
|
.title {
|
||||||
font-size: 34px;
|
font-size: 34px;
|
||||||
color: rgb(8, 8, 8);
|
color: rgb(8, 8, 8);
|
||||||
|
|
Loading…
Reference in New Issue