增加全校排序

This commit is contained in:
Cool 2024-04-17 13:22:19 +08:00
parent b5e4153350
commit 0ef5138f30
1 changed files with 89 additions and 5 deletions

View File

@ -16,7 +16,7 @@
<a-descriptions-item label="学院" :span="3"> <a-descriptions-item label="学院" :span="3">
<a-checkbox :disabled="showBox" @change="checkAll"> <a-checkbox v-model="allCollege" :disabled="showBox" @change="checkAll">
全校 全校
</a-checkbox> </a-checkbox>
<a-checkbox-group v-model="checkedOptions" :options="collegeOptions" :disabled="showGroup" <a-checkbox-group v-model="checkedOptions" :options="collegeOptions" :disabled="showGroup"
@ -37,7 +37,9 @@
<div class="buttons"> <div class="buttons">
<a-button type="primary" style="margin-right: 5px;" @click="visible = false"><a-icon <a-button type="primary" style="margin-right: 5px;" @click="visible = false"><a-icon
type="close" />取消</a-button> type="close" />取消</a-button>
<a-button type="primary" @click="query"><a-icon type="search" />查询</a-button> <a-button type="primary" @click="query" style="margin-right: 5px;"><a-icon type="search" />查询</a-button>
</div> </div>
</a-drawer> </a-drawer>
@ -79,7 +81,7 @@ export default {
name: "Analysis", name: "Analysis",
data() { data() {
return { return {
allCollege:[],
showBox: false, showBox: false,
showGroup: false, showGroup: false,
oneentrydate: null, oneentrydate: null,
@ -166,7 +168,16 @@ export default {
} }
console.log(value); console.log(value);
}, },
dataChart(data, isAll) { // deleteData() {
// console.log("delete")
// //
// this.college = [];
// this.entrydate = [];
// this.oneentrydate = null;
// this.checkedOptions = [];
// this.allCollege = [];
// },
dataChart(data) {
let seriesData = []; let seriesData = [];
let xData = []; let xData = [];
let colors = ['#5370c5', '#91CC75', '#fac858', '#ee6666', '#73c0de', '#FF6A6A', '#FFA500', '#EE2C2C', '#90EE90', '#008B8B', '#FFC0CB', '#FFDAB9', '#FFDEAD', '#FFE4B5', '#FFE4C4', '#FFE4E1', '#FFEBCD', '#FFEFD5', '#FFFAF0', '#FFFAFA', '#FFFFE0', '#FFFFF0', '#FFFFFF', '#F0F8FF', '#FAEBD7', '#FAF0E6', '#FAFAD2', '#F5FFFA', '#F8F8FF', '#F0FFF0', '#F0FFFF', '#F0E68C', '#F0F8FF', '#F0FFF0', '#F0FFFF', '#F4A460', '#F5DEB3', '#F5F5DC', '#F5F5F5', '#F5FFFA', '#F8F8FF', '#F9EBEA', '#FAD7A0', '#FAF0E6', '#FAFAD2', '#FAF0E6 '] let colors = ['#5370c5', '#91CC75', '#fac858', '#ee6666', '#73c0de', '#FF6A6A', '#FFA500', '#EE2C2C', '#90EE90', '#008B8B', '#FFC0CB', '#FFDAB9', '#FFDEAD', '#FFE4B5', '#FFE4C4', '#FFE4E1', '#FFEBCD', '#FFEFD5', '#FFFAF0', '#FFFAFA', '#FFFFE0', '#FFFFF0', '#FFFFFF', '#F0F8FF', '#FAEBD7', '#FAF0E6', '#FAFAD2', '#F5FFFA', '#F8F8FF', '#F0FFF0', '#F0FFFF', '#F0E68C', '#F0F8FF', '#F0FFF0', '#F0FFFF', '#F4A460', '#F5DEB3', '#F5F5DC', '#F5F5F5', '#F5FFFA', '#F8F8FF', '#F9EBEA', '#FAD7A0', '#FAF0E6', '#FAFAD2', '#FAF0E6 ']
@ -204,11 +215,40 @@ export default {
} }
} }
});
let rankData = yData.slice().sort((a, b) => b - a).map((value) => yData.indexOf(value) + 1);
//
if (this.college.includes('全校')) {
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: 13
},
},
color: colors[j++]
}
}
});
} }
);
} }
let myChart = echarts.init(document.getElementById("map1")); let myChart = echarts.init(document.getElementById("map1"));
// //
const college1 = this.college;
let option = { let option = {
title: { title: {
text: "本批次学院通过率排名", text: "本批次学院通过率排名",
@ -224,6 +264,13 @@ export default {
for (let i = 0; i < params.length; i++) { for (let i = 0; i < params.length; i++) {
result += params[i].marker + params[i].seriesName + ' : ' + params[i].value + '%' + '<br>'; result += params[i].marker + params[i].seriesName + ' : ' + params[i].value + '%' + '<br>';
} }
if (college1.includes('全校')) {
result = params[0].name + '<br/>' +
'<table>' +
'<tr><td>' + params[0].marker + params[0].seriesName + '</td><td style="font-weight: bold;">' + '&nbsp;&nbsp;&nbsp;&nbsp;' + params[0].value + '%' + '</td></tr>' +
'<tr><td>' + params[1].marker + params[1].seriesName + '</td><td style="font-weight: bold;">' + '&nbsp;&nbsp;&nbsp;&nbsp;' + params[1].value + '</td></tr>' +
'</table>';
}
return result; return result;
} }
}, },
@ -268,6 +315,43 @@ export default {
], ],
series: seriesData series: seriesData
}; };
if (this.college.includes('全校')) {
option.series = [{
name: '累计总通过率',
type: 'bar',
data: seriesData[0].data,
barWidth: '60%',
itemStyle: {
normal: {
label: {
show: true,//
position: 'top',//
formatter: '{c}%',
textStyle: { //
color: 'black',
fontSize: 13
},
},
color: colors[0]
}
}
},
{
name: '排名',
type: 'bar',
data: seriesData[1].data,
label: {
show: false,
position: 'inside',
formatter: '{c}',
},
yAxisIndex: 1,
color: colors[1]
},
]
}
// 使 // 使
myChart.setOption(option); myChart.setOption(option);
}, },