首页四六级查询
This commit is contained in:
parent
e1f887e055
commit
8cf7443af6
|
@ -5,18 +5,22 @@
|
|||
<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"
|
||||
:options="entrydateOptions"></a-select>
|
||||
<a-button style="margin-left: 10px;" type="primary" @click="query">查询</a-button>
|
||||
</template>
|
||||
|
||||
<a-row :gutter="24">
|
||||
<a-col :xl="12" :style="{ marginBottom: '24px' }">
|
||||
<div class="container">
|
||||
<div id="map1" style="width: 660px; height: 400px"></div>
|
||||
</div>
|
||||
<a-table :dataSource="dataSourceCet4" bordered :columns="columns" :pagination='false'>
|
||||
<template #title>
|
||||
<span style="font-size: 20px;font-weight:bold">四级成绩分析</span>
|
||||
</template>
|
||||
</a-table>
|
||||
</a-col>
|
||||
<a-col :xl="12" :style="{ marginBottom: '24px' }">
|
||||
<div class="container">
|
||||
<div id="map2" style="width: 660px; height: 400px"></div>
|
||||
</div>
|
||||
<a-table :dataSource="dataSourceCet6" bordered :columns="columns" :pagination='false'>
|
||||
<template #title>
|
||||
<span style="font-size: 20px;font-weight:bold">六级成绩分析</span>
|
||||
</template>
|
||||
</a-table>
|
||||
</a-col>
|
||||
</a-row>
|
||||
</a-card>
|
||||
|
@ -28,144 +32,73 @@ import { defHttp } from '/@/utils/http/axios';
|
|||
import * as echarts from 'echarts';
|
||||
|
||||
export default {
|
||||
|
||||
name: "Analysis",
|
||||
data() {
|
||||
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: {
|
||||
getGradeAndCollegeData: '/cet/getGradeAndCollege',
|
||||
getData: '/cet/getData'
|
||||
},
|
||||
collegeOptions: [],
|
||||
entrydateOptions: [],
|
||||
college: null,
|
||||
entrydate: null
|
||||
entrydate: null,
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
map1Chart() {
|
||||
// 基于准备好的dom,初始化echarts实例 这个和上面的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() {
|
||||
// 基于准备好的dom,初始化echarts实例 这个和上面的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() {
|
||||
const data = await defHttp.get({ url: this.Url.getGradeAndCollegeData });
|
||||
this.collegeOptions = data.colleges;
|
||||
this.college= this.collegeOptions[0].value;
|
||||
this.college = this.collegeOptions[0].value;
|
||||
this.entrydateOptions = data.entrydates;
|
||||
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() {
|
||||
this.getGradeAndCollegeData();
|
||||
this.map1Chart();
|
||||
this.map2Chart();
|
||||
}
|
||||
|
||||
}
|
||||
</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);
|
||||
|
|
Loading…
Reference in New Issue