首页四六级查询

This commit is contained in:
xbx 2024-03-27 15:49:00 +08:00
parent e1f887e055
commit 8cf7443af6
1 changed files with 50 additions and 117 deletions

View File

@ -5,18 +5,22 @@
<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: 15px;width: 100px"
:options="entrydateOptions"></a-select> :options="entrydateOptions"></a-select>
<a-button style="margin-left: 10px;" type="primary" @click="query">查询</a-button>
</template> </template>
<a-row :gutter="24"> <a-row :gutter="24">
<a-col :xl="12" :style="{ marginBottom: '24px' }"> <a-col :xl="12" :style="{ marginBottom: '24px' }">
<div class="container"> <a-table :dataSource="dataSourceCet4" bordered :columns="columns" :pagination='false'>
<div id="map1" style="width: 660px; height: 400px"></div> <template #title>
</div> <span style="font-size: 20px;font-weight:bold">四级成绩分析</span>
</template>
</a-table>
</a-col> </a-col>
<a-col :xl="12" :style="{ marginBottom: '24px' }"> <a-col :xl="12" :style="{ marginBottom: '24px' }">
<div class="container"> <a-table :dataSource="dataSourceCet6" bordered :columns="columns" :pagination='false'>
<div id="map2" style="width: 660px; height: 400px"></div> <template #title>
</div> <span style="font-size: 20px;font-weight:bold">六级成绩分析</span>
</template>
</a-table>
</a-col> </a-col>
</a-row> </a-row>
</a-card> </a-card>
@ -28,144 +32,73 @@ 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 {
dataSourceCet4: [],
dataSourceCet6: [],
columns: [
{
title: '年级',
dataIndex: 'grade',
key: 'grade',
},
{
title: '参加人数',
dataIndex: 'attendNumber',
key: 'attendNumber',
},
{
title: '新通过人数',
dataIndex: 'passNumber',
key: 'passNumber',
},
{
title: '累计总通过率',
dataIndex: 'passRate',
key: 'passRate',
}
],
Url: { Url: {
getGradeAndCollegeData: '/cet/getGradeAndCollege', getGradeAndCollegeData: '/cet/getGradeAndCollege',
getData: '/cet/getData'
}, },
collegeOptions: [], collegeOptions: [],
entrydateOptions: [], entrydateOptions: [],
college: null, college: null,
entrydate: null entrydate: null,
}; };
}, },
methods: { methods: {
map1Chart() {
// domecharts main
let myChart = echarts.init(document.getElementById("map1"));
//
let option = {
title: {
text: "总上座人数对比",
},
tooltip: {
trigger: 'axis',
axisPointer: {
type: 'shadow'
}
},
legend: {
data: ["英国", "中国"],//
},
xAxis: {
data: ["一级", "二级", "三级", "四级"],
axisLabel: {
interval: 0,
// rotate: 30
}
},
yAxis: {
name: '总上座人数(万)',
},
series: [
{
name: "英国",
type: "bar",
data: [1450, 1100, 450, 300],
label: {
formatter: '{@value}'
}
},
{
name: "中国",
type: "bar",
data: [552, 180, 200, 0],
label: {
formatter: '{@value}'
}
},
],
};
// 使
myChart.setOption(option);
},
map2Chart() {
// domecharts main
let myChart = echarts.init(document.getElementById("map2"));
//
let option = {
title: {
text: "平均上座人数对比",
},
tooltip: {
trigger: 'axis',
axisPointer: {
type: 'shadow'
}
},
legend: {
data: ["英国", "中国"],//
},
xAxis: {
data: ["一级", "二级", "三级", "四级"],
axisLabel: {
interval: 0,
// rotate: 30
}
},
yAxis: {
name: '平均上座人数(千)',
},
series: [
{
name: "英国",
type: "bar",
data: [38, 21, 8, 5],
label: {
formatter: '{@value}'
}
},
{
name: "中国",
type: "bar",
data: [23, 7, 2, 0],
label: {
formatter: '{@value}'
}
},
],
};
// 使
myChart.setOption(option);
},
// //
async getGradeAndCollegeData() { async getGradeAndCollegeData() {
const data = await defHttp.get({ url: this.Url.getGradeAndCollegeData }); const data = await defHttp.get({ url: this.Url.getGradeAndCollegeData });
this.collegeOptions = data.colleges; this.collegeOptions = data.colleges;
this.college= this.collegeOptions[0].value; this.college = this.collegeOptions[0].value;
this.entrydateOptions = data.entrydates; this.entrydateOptions = data.entrydates;
this.entrydate = this.entrydateOptions[0].value; this.entrydate = this.entrydateOptions[0].value;
},
//
async query() {
let params = {
college: this.college,
entrydate: this.entrydate
}
const result = await defHttp.get({ url: this.Url.getData, params });
this.dataSourceCet4 = result.data.cet4;
this.dataSourceCet6 = result.data.cet6;
this.$message.info(`查询结果:${JSON.stringify(result)}`);
} }
}, },
mounted() { mounted() {
this.getGradeAndCollegeData(); this.getGradeAndCollegeData();
this.map1Chart();
this.map2Chart();
} }
} }
</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);