Compare commits

..

No commits in common. "cf89aae5846acf687e70b7e15b7260098bbe6a52" and "e60233645ac355920faa68ff182dbd8b7c6bf37e" have entirely different histories.

1 changed files with 74 additions and 52 deletions

View File

@ -25,10 +25,10 @@
</a-card>
</a-col>
<a-col :xl="8">
<a-card :loading="map2loading" :style="{ marginBottom: '12px' }">
<a-card :style="{ marginBottom: '12px' }">
<div id="map2" style="width: 100%; height: 230px"></div>
</a-card>
<a-card :loading="map3loading">
<a-card>
<div id="map3" style="width: 100%; height: 230px"></div>
</a-card>
</a-col>
@ -74,8 +74,8 @@
getRateByMajor: '/cet/getRateByMajor',
},
map1loading: false,
map2loading: false,
map3loading: false,
tab2loading: false,
tab3loading: false,
collegeOptions: [],
batchOptions: [],
@ -106,12 +106,12 @@
this.getEntrydate();
this.allQuery();
this.getCollegeMajorData();
this.gradePassRate();
this.majorPassRate();
},
methods: {
allQuery() {
this.map1loading = true;
this.map2loading = true; //
this.map3loading = true; //
let college = ['全校'];
let query = 'tab1';
if (this.oneentrydate == null) {
@ -192,7 +192,7 @@
},
//
async gradePassRate() {
this.map2loading = true;
var myChart = echarts.init(document.getElementById('map2'));
const getEntrydate = await defHttp.get({ url: this.Url.getEntrydate });
this.entrydateOptions = getEntrydate.entrydates;
let entrydate = this.entrydateOptions.map((item) => item.value);
@ -203,10 +203,14 @@
level: 'cet4',
};
let url = this.Url.getCollegeRate;
console.log(queryParams, 'queryParams');
let result = await defHttp.post({ url: url, data: queryParams });
console.log(myChart, 'mychart');
if (!result) {
return;
}
console.log(result.data, 'result');
result = result.data[name];
let collegeOption = {
title: {
@ -254,18 +258,17 @@
animationDurationUpdate: 500,
};
this.map2loading = false;
this.$nextTick(() => {
var myChart = echarts.init(document.getElementById('map2'));
myChart.setOption(collegeOption);
});
myChart.setOption(collegeOption);
},
//
async majorPassRate() {
this.map3loading = true;
var myChart = echarts.init(document.getElementById('map3'));
const name = '西语学院';
//let entrydate = this.oneentrydate.map((item) => item.value);
//console.log(entrydata, 'entrydata');
let queryParams = {
college: [[name]],
entrydate: [this.oneentrydate],
@ -273,11 +276,14 @@
};
let url = this.Url.getMajorRate;
console.log(queryParams, 'queryParams');
let result = await defHttp.post({ url: url, data: queryParams });
console.log(myChart, 'mychart');
if (!result) {
return;
}
console.log(result.data, 'result');
//result = result.data[name];
// result.data
@ -353,11 +359,7 @@
],
animationDurationUpdate: 500,
};
this.map3loading = false;
this.$nextTick(() => {
var myChart = echarts.init(document.getElementById('map3'));
myChart.setOption(majorOption);
});
myChart.setOption(majorOption);
},
dataChart(data, tab) {
@ -456,32 +458,34 @@
.sort((a, b) => b - a)
.map((value) => yData.indexOf(value) + 1);
//
seriesData.push({
name: i + '级累计总通过率排名',
type: 'line',
yAxisIndex: 1,
data: rankData,
bar: {},
show: false,
if (tab == 'tab1') {
seriesData.push({
name: i + '级累计总通过率排名',
type: 'line',
yAxisIndex: 1,
data: rankData,
bar: {},
show: false,
itemStyle: {
normal: {
label: {
show: false, //
position: 'top', //
formatter: '{c}',
textStyle: {
//
color: 'black',
fontSize: 8,
itemStyle: {
normal: {
label: {
show: false, //
position: 'top', //
formatter: '{c}',
textStyle: {
//
color: 'black',
fontSize: 8,
},
},
color: colors[j++],
},
color: colors[j++],
},
},
});
if (j == colors.length) {
j = 0;
});
if (j == colors.length) {
j = 0;
}
}
}
let myChart = null;
@ -619,6 +623,7 @@
this.collegeOptions.map((item) => item.value),
'collegeOptions'
);
console.log(name, 'params');
console.log(this.collegeOptions.map((item) => item.value).includes(name), 'bool');
if (params != null && params != undefined && params.name != '' && this.collegeOptions.map((item) => item.value).includes(name)) {
console.log(params, 'params');
@ -629,13 +634,14 @@
level: 'cet4',
};
let url = this.Url.getCollegeRate;
this.map2loading = true;
this.map3loading = true;
console.log(queryParams, 'queryParams');
let result = await defHttp.post({ url: url, data: queryParams });
console.log(myChart, 'mychart');
if (!result) {
return;
}
console.log(result.data, 'result');
result = result.data[name];
let collegeOption = {
title: {
@ -683,6 +689,21 @@
animationDurationUpdate: 500,
};
console.log(collegeOption, 'collegeOption');
//let spanElement = document.getElementById('span');
// span
//spanElement.style.display = 'none';
var map2Chart = echarts.init(document.getElementById('map2'));
map2Chart.setOption(collegeOption, true);
//myChart.setOption(collegeOption, true);
console.log(myChart, 'mychart');
// this.college = [params];
// this.query(tab, this.college, this.entrydate);
//
let querMajorParam = {
college: [[name]],
@ -690,12 +711,16 @@
level: 'cet4',
};
let urlMajor = this.Url.getMajorRate;
console.log(querMajorParam, 'querMajorParam');
let resultMajor = await defHttp.post({ url: urlMajor, data: querMajorParam });
console.log(myChart, 'mychart');
if (!resultMajor) {
return;
}
console.log(resultMajor.data, 'resultMajor');
//result = result.data[name];
// result.data
const majors = Object.keys(resultMajor.data); //
@ -767,14 +792,9 @@
],
animationDurationUpdate: 500,
};
this.map3loading = false;
this.map2loading = false;
this.$nextTick(() => {
var map2Chart = echarts.init(document.getElementById('map2'));
map2Chart.setOption(collegeOption, true);
var map3Chart = echarts.init(document.getElementById('map3'));
map3Chart.setOption(majorOption, true);
});
console.log(majorOption, 'majorOption');
var map3Chart = echarts.init(document.getElementById('map3'));
map3Chart.setOption(majorOption, true);
}
});
},
@ -824,9 +844,11 @@
// });
console.log('data', result.data);
} finally {
this.map1loading = false;
query == 'tab1' ? (this.map1loading = false) : (this.tab2loading = false);
this.$nextTick(() => {
this.dataChart(result.data, query);
if (query == 'tab1') {
this.dataChart(result.data, query);
}
});
}
},