完善学院对比功能
This commit is contained in:
parent
39fb1184f6
commit
29f5da8c52
|
@ -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);
|
||||
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue