基本功能完成
This commit is contained in:
parent
e7786d3429
commit
171dc8f3f6
|
@ -3,8 +3,10 @@
|
||||||
<a-card title="按学院 / 专业分析" :loading="loading" :bordered="false">
|
<a-card title="按学院 / 专业分析" :loading="loading" :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="batch" style="margin-left: 10px;width: 120px" :options="batchOptions"></a-select>
|
<!-- <a-select v-model:value="batch" style="margin-left: 10px;width: 120px" :options="batchOptions"></a-select> -->
|
||||||
<!-- <a-select v-model:value="level" style="margin-left: 10px;width: 120px" :options="levelOptions"></a-select> -->
|
<!-- <a-select v-model:value="level" style="margin-left: 10px;width: 120px" :options="levelOptions"></a-select> -->
|
||||||
|
<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>
|
<a-button style="margin-left: 10px;" type="primary" @click="query">查询</a-button>
|
||||||
</template>
|
</template>
|
||||||
<a-row :gutter="24">
|
<a-row :gutter="24">
|
||||||
|
@ -28,6 +30,7 @@ export default {
|
||||||
return {
|
return {
|
||||||
Url: {
|
Url: {
|
||||||
getBatch: '/cet/getBatch',
|
getBatch: '/cet/getBatch',
|
||||||
|
getEntrydate: '/cet/getEntrydate',
|
||||||
getCollege: '/cet/getCollege',
|
getCollege: '/cet/getCollege',
|
||||||
getRate: '/cet/getRateByBatch'
|
getRate: '/cet/getRateByBatch'
|
||||||
},
|
},
|
||||||
|
@ -40,7 +43,10 @@ export default {
|
||||||
],
|
],
|
||||||
level: null,
|
level: null,
|
||||||
college: null,
|
college: null,
|
||||||
batch: null
|
batch: null,
|
||||||
|
entrydateOptions: [],
|
||||||
|
entrydate: null,
|
||||||
|
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
@ -56,9 +62,9 @@ export default {
|
||||||
let xData = [];
|
let xData = [];
|
||||||
let yData = [];
|
let yData = [];
|
||||||
for (let key in data) {
|
for (let key in data) {
|
||||||
xData.push(key);
|
xData.push(data[key].college);
|
||||||
// 将数据转换为百分比(加上%)
|
// 将数据转换为百分比(加上%)
|
||||||
yData.push((data[key] * 100).toFixed(2));
|
yData.push(data[key].passRate);
|
||||||
}
|
}
|
||||||
let myChart = echarts.init(document.getElementById("map1"));
|
let myChart = echarts.init(document.getElementById("map1"));
|
||||||
// 指定图表的配置项和数据
|
// 指定图表的配置项和数据
|
||||||
|
@ -72,6 +78,15 @@ export default {
|
||||||
type: 'shadow'
|
type: 'shadow'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
toolbox: {
|
||||||
|
show: true,
|
||||||
|
feature: {
|
||||||
|
dataView: { show: true, readOnly: false },
|
||||||
|
magicType: { show: true, type: ['line', 'bar'] },
|
||||||
|
restore: { show: true },
|
||||||
|
saveAsImage: { show: true }
|
||||||
|
}
|
||||||
|
},
|
||||||
grid: {
|
grid: {
|
||||||
left: '3%',
|
left: '3%',
|
||||||
right: '4%',
|
right: '4%',
|
||||||
|
@ -82,8 +97,9 @@ export default {
|
||||||
{
|
{
|
||||||
type: 'category',
|
type: 'category',
|
||||||
data: xData,
|
data: xData,
|
||||||
axisTick: {
|
axisLabel: {
|
||||||
alignWithLabel: true
|
interval: 1,//代表显示所有x轴标签显示
|
||||||
|
rotate: -20,//代表倾斜30度显示
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
@ -94,10 +110,22 @@ export default {
|
||||||
],
|
],
|
||||||
series: [
|
series: [
|
||||||
{
|
{
|
||||||
name: 'Direct',
|
name: '累计总通过率',
|
||||||
type: 'bar',
|
type: 'bar',
|
||||||
barWidth: '60%',
|
barWidth: '60%',
|
||||||
data: yData
|
data: yData,
|
||||||
|
itemStyle: {
|
||||||
|
normal: {
|
||||||
|
label: {
|
||||||
|
show: true, //开启显示
|
||||||
|
position: 'top', //在上方显示
|
||||||
|
textStyle: { //数值样式
|
||||||
|
color: 'black',
|
||||||
|
fontSize: 13
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
};
|
};
|
||||||
|
@ -111,36 +139,48 @@ export default {
|
||||||
this.batch = this.batchOptions[0].value;
|
this.batch = this.batchOptions[0].value;
|
||||||
this.level = this.levelOptions[0].value;
|
this.level = this.levelOptions[0].value;
|
||||||
},
|
},
|
||||||
|
//获取年级数据
|
||||||
|
async getEntrydate() {
|
||||||
|
const getEntrydate = await defHttp.get({ url: this.Url.getEntrydate });
|
||||||
|
this.entrydateOptions = getEntrydate.entrydates;
|
||||||
|
this.entrydate = this.entrydateOptions[0].value;
|
||||||
|
},
|
||||||
// 查询数据
|
// 查询数据
|
||||||
async query() {
|
async query() {
|
||||||
let data = null;
|
let result = null;
|
||||||
console.log(this.college, this.batch);
|
console.log(this.college, this.entrydate);
|
||||||
//如果this.college和this.batch为null则先赋静态值
|
//如果this.college和this.batch为null则先赋静态值
|
||||||
if (!this.college) {
|
if (!this.college) {
|
||||||
this.college = '全校';
|
this.college = '全校';
|
||||||
}
|
}
|
||||||
if (!this.batch) {
|
if (!this.entrydate) {
|
||||||
this.batch = '2017-12-01';
|
this.entrydate = '2017';
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
let params = {
|
let params = {
|
||||||
college: this.college,
|
college: this.college,
|
||||||
batch: this.batch,
|
entrydate: this.entrydate,
|
||||||
level: 'cet4'
|
level: 'cet4'
|
||||||
}
|
}
|
||||||
data = await defHttp.get({ url: this.Url.getRate, params });
|
result = await defHttp.get({ url: this.Url.getRate, params });
|
||||||
|
//使数据按照passRate从大到小排序
|
||||||
|
result.data.sort((a, b) => {
|
||||||
|
return b.passRate - a.passRate;
|
||||||
|
});
|
||||||
|
console.log("data",result.data);
|
||||||
} finally {
|
} finally {
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
this.dataChart(data);
|
this.dataChart(result.data);
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
this.getCollegeOptions();
|
this.getCollegeOptions();
|
||||||
this.getBatch();
|
// this.getBatch();
|
||||||
|
this.getEntrydate();
|
||||||
this.query();
|
this.query();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -65,6 +65,10 @@ export default {
|
||||||
xAxis: {
|
xAxis: {
|
||||||
type: 'category',
|
type: 'category',
|
||||||
data: xData,
|
data: xData,
|
||||||
|
axisLabel: {
|
||||||
|
interval:0,//代表显示所有x轴标签显示
|
||||||
|
rotate:-20,//代表倾斜30度显示
|
||||||
|
}
|
||||||
},
|
},
|
||||||
tooltip: {
|
tooltip: {
|
||||||
trigger: 'axis',
|
trigger: 'axis',
|
||||||
|
@ -78,7 +82,19 @@ export default {
|
||||||
series: [
|
series: [
|
||||||
{
|
{
|
||||||
data: yData,
|
data: yData,
|
||||||
type: 'line'
|
type: 'line',
|
||||||
|
itemStyle: {
|
||||||
|
normal: {
|
||||||
|
label: {
|
||||||
|
show: true, //开启显示
|
||||||
|
position: 'top', //在上方显示
|
||||||
|
textStyle: { //数值样式
|
||||||
|
color: 'black',
|
||||||
|
fontSize: 12
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
};
|
};
|
||||||
|
|
|
@ -6,11 +6,18 @@
|
||||||
<a-select v-model:value="entrydate" style="margin-left: 10px;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>
|
||||||
|
<!-- <a-button @click=test()>test</a-button> -->
|
||||||
</template>
|
</template>
|
||||||
<a-row :gutter="24">
|
<a-row :gutter="24">
|
||||||
<a-col :xl="12">
|
<a-col :xl="14">
|
||||||
<div style="padding-left: 10px;min-height: 400px;">
|
<div style="padding-left: 10px;min-height: 400px;">
|
||||||
<a-table :dataSource="dataSourceCet4" :columns="columns" :pagination='false'>
|
<a-table :dataSource="dataSourceCet4" :columns="columns" :pagination='false' bordered>
|
||||||
|
<template v-slot:passRateSlot>
|
||||||
|
累计总通过率
|
||||||
|
<a-tooltip title="累计通过人数 / (学院 / 专业总人数)" placement="top">
|
||||||
|
<a-icon type="question-circle" />
|
||||||
|
</a-tooltip>
|
||||||
|
</template>
|
||||||
</a-table>
|
</a-table>
|
||||||
<span style="font-size: 15px;float: right;margin-top: 10px;" v-if="total && total > 0">
|
<span style="font-size: 15px;float: right;margin-top: 10px;" v-if="total && total > 0">
|
||||||
学院 / 专业总人数: {{ total }}
|
学院 / 专业总人数: {{ total }}
|
||||||
|
@ -37,21 +44,32 @@ export default {
|
||||||
title: '年级',
|
title: '年级',
|
||||||
dataIndex: 'grade',
|
dataIndex: 'grade',
|
||||||
key: 'grade',
|
key: 'grade',
|
||||||
|
align: 'center',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '两个批次总参加人数',
|
title: '考试批次',
|
||||||
|
dataIndex: 'batch',
|
||||||
|
key: 'batch',
|
||||||
|
align: 'center',
|
||||||
|
//数据显示上下两行
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '总参加人数',
|
||||||
dataIndex: 'attendNumber',
|
dataIndex: 'attendNumber',
|
||||||
key: 'attendNumber',
|
key: 'attendNumber',
|
||||||
|
align: 'center',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '新通过人数',
|
title: '新通过人数',
|
||||||
dataIndex: 'passNumber',
|
dataIndex: 'passNumber',
|
||||||
key: 'passNumber',
|
key: 'passNumber',
|
||||||
|
align: 'center',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '累计总通过率',
|
slots: { title: 'passRateSlot' },
|
||||||
dataIndex: 'passRate',
|
dataIndex: 'passRate',
|
||||||
key: 'passRate',
|
key: 'passRate',
|
||||||
|
align: 'center',
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
Url: {
|
Url: {
|
||||||
|
@ -97,6 +115,8 @@ export default {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
//手动添加一个专升本字段
|
||||||
|
this.collegeMajorOptions.unshift({ value: '专升本', label: '专升本' });
|
||||||
// 手动添加一个全校字段
|
// 手动添加一个全校字段
|
||||||
this.collegeMajorOptions.unshift({ value: '全校', label: '全校' });
|
this.collegeMajorOptions.unshift({ value: '全校', label: '全校' });
|
||||||
this.collegeMajor = ['全校'];
|
this.collegeMajor = ['全校'];
|
||||||
|
@ -123,6 +143,9 @@ export default {
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
test() {
|
||||||
|
defHttp.get({ url: "/cet/getTest" });
|
||||||
|
}
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
this.getEntrydateAndCollegeData();
|
this.getEntrydateAndCollegeData();
|
||||||
|
|
Loading…
Reference in New Issue