增加专业

This commit is contained in:
xbx 2024-04-03 14:36:10 +08:00
parent 50a62cbae3
commit e7786d3429
3 changed files with 66 additions and 16 deletions

View File

@ -1,8 +1,8 @@
<template>
<div style="background: #ececec; padding: 25px">
<a-card title="按学院分析" :loading="loading" :bordered="false">
<a-card title="按学院 / 专业分析" :loading="loading" :bordered="false">
<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="level" style="margin-left: 10px;width: 120px" :options="levelOptions"></a-select> -->
<a-button style="margin-left: 10px;" type="primary" @click="query">查询</a-button>
@ -44,6 +44,14 @@ export default {
};
},
methods: {
getCollegeOptions() {
defHttp.get({ url: this.Url.getCollege }).then(res => {
this.collegeOptions = res.colleges;
//
this.collegeOptions.unshift({ value: '全校', label: '全校' });
this.college = this.collegeOptions[0].value;
});
},
dataChart(data) {
let xData = [];
let yData = [];
@ -102,14 +110,22 @@ export default {
this.batchOptions = getBatch.batches;
this.batch = this.batchOptions[0].value;
this.level = this.levelOptions[0].value;
this.query();
},
//
async query() {
let data = null;
console.log(this.college, this.batch);
//this.collegethis.batchnull
if (!this.college) {
this.college = '全校';
}
if (!this.batch) {
this.batch = '2017-12-01';
}
try {
this.loading = true;
let params = {
college: this.college,
batch: this.batch,
level: 'cet4'
}
@ -123,7 +139,9 @@ export default {
}
},
mounted() {
this.getCollegeOptions();
this.getBatch();
this.query();
}
}

View File

@ -2,7 +2,8 @@
<div style="background: #ececec; padding: 25px">
<a-card title="按批次分析" :loading="loading" :bordered="false">
<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-cascader v-model:value="collegeMajor" :options="collegeMajorOptions" change-on-select />
<a-button style="margin-left: 10px;" type="primary" @click="query">查询</a-button>
</template>
<div>
@ -29,10 +30,12 @@ export default {
Url: {
getBatch: '/cet/getBatch',
getCollege: '/cet/getCollege',
getRate: '/cet/getRateByCollege'
getRate: '/cet/getRateByCollege',
getCollegeMajor: '/cet/getCollegeMajor'
},
loading: false,
collegeOptions: [],
collegeMajorOptions: [],
batchOptions: [],
levelOptions: [
{ value: 'cet4', label: '英语四级' },
@ -40,7 +43,8 @@ export default {
],
level: null,
college: null,
batch: null
batch: null,
collegeMajor: null
};
},
methods: {
@ -56,7 +60,7 @@ export default {
//
let option = {
title: {
text: "学院通过率变化",
text: "学院 / 专业通过率变化",
},
xAxis: {
type: 'category',
@ -84,23 +88,50 @@ export default {
//
async getBatch() {
const getBatch = await defHttp.get({ url: this.Url.getBatch });
const getCollege = await defHttp.get({ url: this.Url.getCollege });
// const getCollege = await defHttp.get({ url: this.Url.getCollege });
this.collegeOptions = getCollege.colleges;
this.college = this.collegeOptions[0].value;
// this.collegeOptions = getCollege.colleges;
// this.college = this.collegeOptions[0].value;
this.level = this.levelOptions[0].value;
this.query();
// this.query();
},
//
async getCollegeMajorData() {
const res = await defHttp.get({ url: this.Url.getCollegeMajor });
//map
this.collegeMajorOptions = res.collegeMajor.map(item => {
return {
value: item.college,
label: item.college,
children: item.major.map(major => {
return {
value: major,
label: major
}
})
}
});
this.collegeMajor = this.collegeMajorOptions[0].value;
console.log(this.collegeMajorOptions);
},
//
async query() {
let data = null;
try {
console.log("sb",this.collegeMajor);
//this.collegeMajornull
if (!this.collegeMajor) {
this.collegeMajor = ['东语学院'];
}
//this.collegeMajor[1]null
let major = this.collegeMajor.length > 1 ? this.collegeMajor[1] : "";
this.loading = true;
let params = {
college: this.college,
level: 'cet4'
college: this.collegeMajor[0],
major: major,
level: 'cet4',
}
data = await defHttp.get({ url: this.Url.getRate, params });
} finally {
@ -112,7 +143,9 @@ export default {
}
},
mounted() {
this.getCollegeMajorData();
this.getBatch();
this.query();
}
}

View File

@ -2,7 +2,6 @@
<div style="background: #ececec; padding: 25px">
<a-card title="四级总通过率查询" :loading="loading" :bordered="false">
<template #extra>
<!-- <a-select v-model:value="college" style="width: 300px" :options="collegeOptions"></a-select> -->
<a-cascader v-model:value="collegeMajor" :options="collegeMajorOptions" change-on-select />
<a-select v-model:value="entrydate" style="margin-left: 10px;width: 100px"
:options="entrydateOptions"></a-select>
@ -14,7 +13,7 @@
<a-table :dataSource="dataSourceCet4" :columns="columns" :pagination='false'>
</a-table>
<span style="font-size: 15px;float: right;margin-top: 10px;" v-if="total && total > 0">
学院总人数: {{ total }}
学院 / 专业总人数: {{ total }}
</span>
</div>
</a-col>
@ -40,7 +39,7 @@ export default {
key: 'grade',
},
{
title: '参加人数',
title: '两个批次总参加人数',
dataIndex: 'attendNumber',
key: 'attendNumber',
},