基本功能完成

This commit is contained in:
xbx 2024-04-08 16:41:42 +08:00
parent e7786d3429
commit 171dc8f3f6
3 changed files with 101 additions and 22 deletions

View File

@ -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.collegethis.batchnull //this.collegethis.batchnull
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();
} }

View File

@ -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
}
}
}
}
} }
] ]
}; };

View File

@ -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();