增加专业
This commit is contained in:
parent
50a62cbae3
commit
e7786d3429
|
@ -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.college和this.batch为null则先赋静态值
|
||||
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();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -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.collegeMajor为null则先赋个值
|
||||
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();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -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',
|
||||
},
|
||||
|
|
Loading…
Reference in New Issue