完善学院对比功能

This commit is contained in:
Cool 2024-04-23 16:43:44 +08:00
parent 39fb1184f6
commit 29f5da8c52
1 changed files with 27 additions and 17 deletions

View File

@ -202,7 +202,8 @@ export default {
getBatch: '/cet/getBatch',
getEntrydate: '/cet/getEntrydate',
getCollege: '/cet/getCollege',
getRate: '/cet/getRateByCollege',
getCollegeRate: '/cet/getRateByCollege',
getAllRate: '/cet/getAllRate',
getCollegeMajor: '/cet/getCollegeMajor',
getRateByMajor: '/cet/getRateByMajor',
@ -334,15 +335,7 @@ export default {
return
}
},
// deleteData() {
// console.log("delete")
// //
// this.college = [];
// this.entrydate = [];
// this.oneentrydate = null;
// this.checkedOptions = [];
// this.allCollege = [];
// },
//tab3
drawChart(data,tab){
@ -398,10 +391,27 @@ export default {
console.log(seriesData,'dasaaseriresdata')
// debugger
let myChart = null;
console.log(tab,"tab")
if (tab == 'tab2') {
myChart=document.getElementById("map2");
if(myChart){
myChart=echarts.getInstanceByDom(myChart)
if(myChart){
myChart.dispose();
}
}
myChart = echarts.init(document.getElementById("map2"));
} else if (tab == 'tab3') {
myChart=document.getElementById("map3");
if(myChart){
myChart=echarts.getInstanceByDom(myChart)
if(myChart){
myChart.dispose();
}
}
myChart = echarts.init(document.getElementById("map3"));
}
//
let option = {
@ -462,12 +472,11 @@ export default {
// 使
console.log(option, "option")
console.log(myChart, "myChart")
myChart.setOption(option);
},
//tab2
tab2drawChart(data){
setTimeout(() => {
myChart.setOption(option);
}, 1)
},
dataChart(data, tab) {
let seriesData = [];
@ -700,8 +709,9 @@ export default {
entrydate: entrydate,
level: 'cet4'
}
let url = query == 'tab1' ? this.Url.getAllRate : this.Url.getCollegeRate;
console.log(params.college, "college")
result = await defHttp.post({ url: this.Url.getRate, params });
result = await defHttp.post({ url: url, params });
//使passRate
// result.data.sort((a, b) => {
// return b.passRate - a.passRate;
@ -713,7 +723,7 @@ export default {
if (query == 'tab1') {
this.dataChart(result.data, query);
} else if (query == 'tab2') {
this.drawChart(result.data);
this.drawChart(result.data,query);
}