页面布局改进

This commit is contained in:
Xubx 2024-10-11 15:29:09 +08:00
parent 4c60ba4ca7
commit 80a240675d
5 changed files with 2593 additions and 2138 deletions

View File

@ -1,59 +1,50 @@
<template>
<div style="background: #ececec; padding: 15px">
<a-card :bordered="false">
<a-tabs v-model:activeKey="activeKey" type="card">
<a-tab-pane key="1" tab="查询全校各学院四级通过率">
<div>
<div class="query">
<span style="font-size: 15px; margin-right: 10px; display: flex; justify-content: center; align-items: center; font-weight: bold"
>年级:
</span>
<a-select v-model:value="oneentrydate" style="width: 200px" :options="entrydateOptions"></a-select>
<a-select v-model:value="oneentrydate" style="width: 200px" :options="entrydateOptions" />
<a-button style="margin-left: 10px" type="primary" @click="allQuery">查询</a-button>
</div>
<a-card title="查询全校各学院四级通过率" :loading="tab1loading" :bordered="false">
<template #extra>
<!-- <a-select v-model:value="college" style="width: 300px" mode="multiple" :max-tag-count="2"
:options="collegeOptions" @change="onCollegeMajorChange"></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-select v-model:value="entrydate" style="margin-left: 10px;width: 150px"
:options="entrydateOptions"></a-select>
<a-button style="margin-left: 10px;" type="primary" @click="query">查询</a-button> -->
</template>
<a-row :gutter="24">
<a-col :xl="24" :style="{ marginBottom: '24px' }">
<div class="container" >
<div id="span" >
<a-card :bordered="true">
<a-row :gutter="12">
<a-col :xl="16">
<a-card :loading="map1loading">
<div id="span">
<div style="display: flex; justify-content: center; align-items: center">
<span style="font-size: 18px" >点击柱状图可查看该学院&nbsp </span>
<span style="font-size: 18px; color: red">各年级四级通过率</span>
<span style="font-size: 16px">点击柱状图可查看该学院&nbsp; </span>
<span style="font-size: 16px; color: red">各年级四级通过率</span>
</div>
<!-- <span style=" font-size: 18px;">&nbsp 变化</span> -->
</div>
<div id="map1" style="width: 100%; height: 600px"></div>
</div>
<div id="map1" style="width: 100%; height: 500px"></div>
</a-card>
</a-col>
<a-col :xl="8">
<a-card :style="{ marginBottom: '12px' }">
<div id="map2" style="width: 100%; height: 230px"></div>
</a-card>
<a-card>
<div id="map3" style="width: 100%; height: 230px"></div>
</a-card>
</a-col>
</a-row>
</a-card>
</div>
</a-tab-pane>
</a-tabs>
</a-card>
</div>
</template>
<script>
import { defHttp } from '/@/utils/http/axios';
import * as echarts from 'echarts';
import bar from '/@/components/Scrollbar/src/bar';
import { message } from 'ant-design-vue';
import { last } from 'xe-utils';
import { defHttp } from '/@/utils/http/axios';
import * as echarts from 'echarts';
import { message } from 'ant-design-vue';
export default {
name: 'Analysis',
export default {
data() {
return {
activeKey: '1',
@ -78,7 +69,7 @@ export default {
getCollegeMajor: '/cet/getCollegeMajor',
getRateByMajor: '/cet/getRateByMajor',
},
tab1loading: false,
map1loading: false,
tab2loading: false,
tab3loading: false,
@ -105,9 +96,18 @@ export default {
lastCollegeEntrydate: [],
};
},
mounted() {
this.getCollegeOptions();
// this.getBatch();
this.getEntrydate();
this.allQuery();
this.getCollegeMajorData();
this.gradePassRate();
this.majorPassRate();
},
methods: {
allQuery() {
this.tab1loading = true;
this.map1loading = true;
let college = ['全校'];
let query = 'tab1';
if (this.oneentrydate == null) {
@ -184,12 +184,108 @@ export default {
console.log(this.collegeOptions, 'collegeOptions');
});
},
//
async gradePassRate() {
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);
const name = ['西语学院'];
let queryParams = {
college: name,
entrydate: entrydate,
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: {
text: name + '四级通过率',
textStyle: {
fontSize: 14,
},
},
xAxis: {
data: result.map((item) => item.entrydate),
},
//
tooltip: {
trigger: 'axis',
axisPointer: {
type: 'shadow',
},
formatter: function (params) {
//tooltip,
let result = params[0].name + '<br>';
for (let i = 0; i < params.length; i++) {
result += params[i].marker + name + ' : ' + params[i].value + '%' + '<br>';
}
return result;
},
},
series: {
type: 'line',
data: result.map((item) => item.passRate),
label: {
show: true, //
position: 'top', //
formatter: function (params) {
//
return params.value + '%';
},
//
},
universalTransition: {
// enabled: true,
// divideShape: 'clone',
},
},
yAxis: {},
animationDurationUpdate: 500,
};
myChart.setOption(collegeOption);
},
//
majorPassRate() {
var myChart = echarts.init(document.getElementById('map3'));
var option = {
title: {
text: '西语学院各专业四级通过率',
textStyle: {
fontSize: 14,
},
},
xAxis: {
type: 'category',
data: ['英语', '翻译', '法语', '葡萄牙语', '西班牙语'],
},
yAxis: {
type: 'value',
},
series: [
{
data: [200, 150, 80, 70, 110, 130],
type: 'bar',
},
],
};
myChart.setOption(option);
},
dataChart(data, tab) {
let seriesData = [];
let xData = [];
let colors = [
'#5370c5',
'#91CC75',
'#ffffff',
'#fac858',
'#ee6666',
'#73c0de',
@ -251,7 +347,7 @@ export default {
name: i + '级累计总通过率',
type: 'bar',
//
barWidth: 25,
barWidth: 1,
data: yData,
//
barGap: '30%',
@ -298,7 +394,7 @@ export default {
textStyle: {
//
color: 'black',
fontSize: 13,
fontSize: 8,
},
},
color: colors[j++],
@ -311,14 +407,15 @@ export default {
}
}
let myChart = null;
if (tab == 'tab1') {
myChart = echarts.init(document.getElementById('map1'));
}
//
// const college1 = this.college;
let option = {
title: {
text: '本年级学院四级通过率排名',
textStyle: {
fontSize: 16,
},
},
tooltip: {
trigger: 'axis',
@ -396,14 +493,13 @@ export default {
],
series: seriesData,
};
if (tab == 'tab1') {
option.series = [
{
name: '累计总通过率',
type: 'bar',
data: seriesData[0].data,
//
barWidth: 25,
barWidth: 16,
// barWidth: '60%',
itemStyle: {
normal: {
@ -414,7 +510,7 @@ export default {
textStyle: {
//
color: 'black',
fontSize: 13,
fontSize: 10,
},
},
color: colors[0],
@ -434,7 +530,6 @@ export default {
color: colors[1],
},
];
}
myChart.setOption(option, true);
// 使
myChart.on('click', async (params) => {
@ -468,6 +563,9 @@ export default {
let collegeOption = {
title: {
text: name + '四级通过率',
textStyle: {
fontSize: 14,
},
},
xAxis: {
data: result.map((item) => item.entrydate),
@ -507,50 +605,17 @@ export default {
yAxis: {},
animationDurationUpdate: 500,
graphic: [
{
type: 'rect',
left: 30,
top: 43,
z: 1, //
shape: {
width: 55, //
height: 30, //
},
style: {
fill: 'rgba(24, 144, 255)', //
},
},
{
type: 'text',
left: 35,
top: 50,
z: 2, //
style: {
text: '返 回',
fontSize: 20,
fill: 'white', //
},
onclick: function () {
myChart.setOption(option, true);
let spanElement = document.getElementById('span');
// span
spanElement.style.display = 'block';
},
},
],
};
console.log(collegeOption, 'collegeOption');
let spanElement = document.getElementById('span');
//let spanElement = document.getElementById('span');
// span
spanElement.style.display = 'none';
//spanElement.style.display = 'none';
var map2Chart = echarts.init(document.getElementById('map2'));
map2Chart.setOption(collegeOption, true);
//myChart.setOption(collegeOption, true);
myChart.setOption(collegeOption, true);
console.log(myChart, 'mychart');
// this.college = [params];
@ -604,7 +669,7 @@ export default {
// });
console.log('data', result.data);
} finally {
query == 'tab1' ? (this.tab1loading = false) : (this.tab2loading = false);
query == 'tab1' ? (this.map1loading = false) : (this.tab2loading = false);
this.$nextTick(() => {
if (query == 'tab1') {
this.dataChart(result.data, query);
@ -613,42 +678,36 @@ export default {
}
},
},
mounted() {
this.getCollegeOptions();
// this.getBatch();
this.getEntrydate();
this.allQuery();
this.getCollegeMajorData();
},
};
};
</script>
<style lang="less" scoped>
.container {
.container {
// display: flex;
background-color: #fff;
padding: 15px;
border-radius: 4px;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.09);
}
}
.query {
.query {
//
display: flex;
justify-content: flex-end;
align-items: center;
margin-left: 24px;
padding-bottom: 10px;
}
.tab3 {
justify-content: flex-start;
align-items: center;
margin-left: 24px;
}
}
.tab3 {
justify-content: flex-start;
align-items: center;
margin-left: 24px;
}
.title {
.title {
font-size: 34px;
color: rgb(8, 8, 8);
font-weight: bold;
}
}
</style>

View File

@ -6,7 +6,50 @@
<a-cascader v-model:value="collegeMajor" :options="collegeMajorOptions" change-on-select />
<a-button style="margin-left: 10px" type="primary" @click="query">查询</a-button>
</template>
<a-row :gutter="12">
<a-col :xl="16" :style="{ marginBottom: '24px' }">
<!-- 根据需求 删除 更改-->
<a-card class="tip">
<div style="display: flex">
<div v-if="topCollege != null">
<span style="font-size: 15px; padding-left: 100px">该数据为 </span>
<span style="color: red; font-size: 18px">{{ topCollege }}</span>
<span v-if="topMajor != null && topMajor != ''" style="color: red; font-size: 18px"> / {{ topMajor }}</span>
<span style="font-size: 15px"> 的四级通过率变化趋势 </span>
</div>
</div>
</a-card>
<a-card>
<!--<template #extra>
<div style="display: flex">
<div v-if="topCollege != null">
<span style="font-size: 15px; padding-left: 100px">该数据为 </span>
<span style="color: red; font-size: 18px">{{ topCollege }}</span>
<span v-if="topMajor != null && topMajor != ''" style="color: red; font-size: 18px"> / {{ topMajor }}</span>
<span style="font-size: 15px"> 的四级通过率变化趋势 </span>
</div>
</div>
</template>-->
<div>
<div id="map1" style="width: 100%; height: 400px"></div>
</div>
</a-card>
</a-col>
<a-col :xl="8">
<a-card style="margin-bottom: 10px">
<div style="width: 100%; height: 210px; padding: 10px" class="participate_Piechart" id="participate_Piechart"></div>
</a-card>
<a-card>
<div style="width: 100%; height: 210px; padding: 10px" class="pass_Piechart" id="pass_Piechart"></div>
</a-card>
</a-col>
</a-row>
<!-- <div>
<a-row :gutter="24">
<a-col :xl="24" :style="{ marginBottom: '24px' }">
<div class="container">
@ -23,17 +66,16 @@
</div>
</a-col>
</a-row>
</div>
</div> -->
</a-card>
</div>
</template>
<script>
import { defHttp } from '/@/utils/http/axios';
import * as echarts from 'echarts';
import { defHttp } from '/@/utils/http/axios';
import * as echarts from 'echarts';
export default {
name: 'Analysis',
export default {
data() {
return {
Url: {
@ -54,10 +96,15 @@ export default {
college: null,
batch: null,
collegeMajor: null,
topCollege: null,//
topMajor: null,//
topCollege: null, //
topMajor: null, //
};
},
mounted() {
this.getCollegeMajorData();
this.getBatch();
this.query();
},
methods: {
dataChart(data) {
let xData = [];
@ -77,7 +124,7 @@ export default {
type: 'category',
data: xData,
axisLabel: {
interval: 0, //x
interval: 1, //x
rotate: -10, //30
},
},
@ -134,6 +181,211 @@ export default {
// 使
myChart.setOption(option);
},
//---
draPieChart_Pass() {
//console.log(this.passRatePie);
//console.log('piedata', piedata);
let myChart = echarts.init(document.getElementById('pass_Piechart'));
let option = {
tooltip: {
trigger: '',
conginee: false,
//
itemStytle: {
fontSize: 100,
},
},
title: {
//text: '/',
left: 'left',
top: '0%',
textStyle: {
fontSize: 14,
},
},
legend: {
top: '5%',
left: 'center',
},
color: ['#b3cde0', '#6497b1', '#005b96', '#03396c', '#e5e5e5'],
series: [
{
name: '学院/专业每个批次通过人数饼图',
type: 'pie',
radius: ['0', '100%'],
top: 80,
itemStyle: {
borderRadius: 5,
borderColor: '#fff',
borderWideth: 2,
},
label: {
show: true,
fontSize: 14,
overflow: 'truncate',
},
emphasis: {
itemStyle: {
shadowBlur: 10,
shadowOffsetX: 0,
shadowColor: 'rgba(0, 0, 0, 0.5)',
},
label: {
show: true,
fontSize: 15,
fontWeight: 'bold',
},
},
data: [
{ value: 1048, name: '计算机' },
{ value: 735, name: '东语' },
{ value: 580, name: '物理' },
{ value: 484, name: '大数据' },
{ value: 300, name: '树莓' },
],
},
],
};
myChart.setOption(option);
},
//---
draPieChart_Participate() {
//console.log(this.passRatePie);
//console.log('piedata', piedata);
let myChart = echarts.init(document.getElementById('participate_Piechart'));
let option = {
tooltip: {
trigger: 'item',
conginee: false,
//
itemStytle: {
//
shadowBlur: 10, //
shadowColor: 'rgba(0, 0, 0, 0.3)', //
shadowOffsetX: 5, //
shadowOffsetY: 5, //
fontSize: 100,
},
},
// title: {
// text: '/',
// left: 'top',
// top: '0%',
// textStyle: {
// fontSize: 12,
// },
// },
legend: {
top: '5%',
left: 'center',
// orient: 'vertical',
itemGap: 3,
selectedMode: true,
// inactiveColor: '#ccc',
// icon: 'circle',
// formatter: function (name) {
// var value;
// for (var i = 0; i < data.length; i++){
// if(data[i].name == name){
// value = data[i].value;
// }
// }
// return name + ' : ' + Math.round(value / num * 10000) / 100 + "%";
// },
},
color: ['#b3cde0', '#6497b1', '#005b96', '#03396c', '#e5e5e5'],
series: [
{
name: '学院/专业该批次通过人数饼图',
type: 'pie',
radius: ['50%', '100%'],
center: ['50%', '50%'],
startAngle: 130,
top: 80,
//
itemStyle: {
// borderRadius: 5,
// borderColor: '#fff',
borderWidth: 2,
},
label: {
show: true,
// position: 'inside',
fontSize: 12,
overflow: 'truncate',
},
labelLine: {
show: true,
smooth: true,
length: 10,
},
emphasis: {
itemStyle: {
shadowBlur: 10,
shadowOffsetX: 0,
shadowColor: 'rgba(0, 0, 0, 0.5)',
},
label: {
show: true,
fontSize: 15,
fontWeight: 'bold',
},
},
data: [
{ value: 1048, name: '计算机' },
{ value: 735, name: '东语' },
{ value: 580, name: '物理' },
{ value: 484, name: '大数据' },
{ value: 300, name: '树莓' },
],
},
{
type: 'pie',
startAngle: 130,
top: 80,
radius: ['40%', '51%'],
center: ['50%', '50%'],
//
itemStyle: {
// borderRadius: 3,
// borderColor: '#fff',
borderWidth: 2,
},
label: {
show: false,
},
hoverAnimation: false,
legendHoverLink: false,
// animationnfalse,
tooltip: {
show: false,
},
data: [
{ value: 1048, name: '计算机' },
{ value: 735, name: '东语' },
{ value: 580, name: '物理' },
{ value: 484, name: '大数据' },
{ value: 300, name: '树莓' },
],
},
],
};
myChart.setOption(option);
myChart.dispatchAction({
type: 'highlight',
seriesIndex: 1,
});
window.addEventListener('resize', function () {
myChart.resize();
});
},
//
async getBatch() {
const getBatch = await defHttp.get({ url: this.Url.getBatch });
@ -169,7 +421,6 @@ export default {
let data = null;
console.log(this.collegeMajor, 'collegeMajor');
try {
//this.collegeMajornull
if (!this.collegeMajor) {
this.collegeMajor = ['东语学院', '日语'];
@ -182,7 +433,7 @@ export default {
this.topCollege = college;
this.topMajor = major;
this.loading = true;
console.log(college, major, "college,major");
console.log(college, major, 'college,major');
let params = {
college: college,
major: major,
@ -193,30 +444,32 @@ export default {
this.loading = false;
this.$nextTick(() => {
this.dataChart(data);
this.draPieChart_Pass();
this.draPieChart_Participate();
});
}
},
},
mounted() {
this.getCollegeMajorData();
this.getBatch();
this.query();
},
};
};
</script>
<style lang="less" scoped>
.container {
.container {
// display: flex;
background-color: #fff;
padding: 15px;
border-radius: 4px;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.09);
}
}
.title {
.title {
font-size: 20px;
color: rgb(8, 8, 8);
font-weight: bold;
}
}
.tip {
margin-bottom: 10px;
background-color: #d0e5fe;
opacity: 0.9;
}
</style>

View File

@ -1,13 +1,56 @@
<template>
<div style="background: #ececec; padding: 15px">
<a-card title="按批次对比分析" :loading="loading" :bordered="false">
<a-card title="按批次对比分析" :loading="loading" :bordered="false">
<template #extra>
<a-select v-model:value="collegeMajor" style="width: 300px" :options="collegeMajorOptions"></a-select>
<a-select v-model:value="batch" :options="batchOptions" change-on-select
style="margin-left: 10px;width: 120px" />
<a-button style="margin-left: 10px;" type="primary" @click="query">查询</a-button>
<a-select v-model:value="collegeMajor" style="width: 300px" :options="collegeMajorOptions" />
<a-select v-model:value="batch" :options="batchOptions" change-on-select style="margin-left: 10px; width: 120px" />
<a-button style="margin-left: 10px" type="primary" @click="query">查询</a-button>
</template>
<a-row :grutter="24">
<a-col :xl="16" :style="{ marginBottom: '24px' }">
<!-- 根据需求 删除 更改-->
<a-card style="margin-bottom: 10px" class="tip">
<div style="display: flex">
<div v-if="topCollege != null">
<span style="color: red; font-size: 18px; padding-left: 100px"> {{ topCollege }}</span>
<span style="font-size: 15px"> </span>
<span style="color: red; font-size: 18px"> {{ topBath }} </span>
<span style="font-size: 15px"> 批次的四级通过率为</span>
<span style="color: red; font-size: 18px"> {{ sumRate }}%</span>
</div>
</div>
</a-card>
<a-card>
<!--<template #extra>
<div style="display: flex">
<div v-if="topCollege != null">
<span style="color: red; font-size: 18px; padding-left: 100px"> {{ topCollege }}</span>
<span style="font-size: 15px"> </span>
<span style="color: red; font-size: 18px"> {{ topBath }} </span>
<span style="font-size: 15px"> 批次的四级通过率为</span>
<span style="color: red; font-size: 18px"> {{ sumRate }}%</span>
</div>
</div>
</template>-->
<div>
<div id="map1" style="width: 100%; height: 400px"></div>
</div>
</a-card>
</a-col>
<a-col :xl="8" style="padding-left: 10px">
<a-card style="margin-bottom: 10px">
<div style="width: 100%; height: 210px; padding: 10px" class="participate_Piechart" id="participate_Piechart"></div>
</a-card>
<a-card>
<div style="width: 100%; height: 210px; padding: 10px" class="pass_Piechart" id="pass_Piechart"></div>
</a-card>
</a-col>
</a-row>
<!-- <div>
<a-row :gutter="24">
<a-col :xl="24" :style="{ marginBottom: '24px' }">
<div class="container">
@ -25,26 +68,23 @@
</div>
</a-col>
</a-row>
</div>
</div> -->
</a-card>
</div>
</template>
<script>
import { result } from 'lodash-es';
import { defHttp } from '/@/utils/http/axios';
import * as echarts from 'echarts';
export default {
name: "Analysis",
import { defHttp } from '/@/utils/http/axios';
import * as echarts from 'echarts';
export default {
data() {
return {
Url: {
getBatch: '/cet/getBatch',
getCollege: '/cet/getCollege',
getRate: '/cet/getRateByBatch',
getCollegeMajor: '/cet/getCollegeMajor'
getCollegeMajor: '/cet/getCollegeMajor',
},
loading: false,
collegeOptions: [],
@ -52,17 +92,22 @@ export default {
batchOptions: [],
levelOptions: [
{ value: 'cet4', label: '英语四级' },
{ value: 'cet6', label: '英语六级' }
{ value: 'cet6', label: '英语六级' },
],
level: null,
college: null,
batch: null,
collegeMajor: null,
sumRate: null,//
topCollege: null,//
topBath: null,//
sumRate: null, //
topCollege: null, //
topBath: null, //
};
},
mounted() {
this.getCollegeMajorData();
this.getBatch();
this.query();
},
methods: {
dataChart(data) {
let xData = [];
@ -70,10 +115,10 @@ export default {
for (let key in data) {
xData.push(key);
// %
yData.push((data[key]).toFixed(1));
yData.push(data[key].toFixed(1));
}
xData = xData.map(label => label.split("").join("\n"));//x
let myChart = echarts.init(document.getElementById("map1"));
xData = xData.map((label) => label.split('').join('\n')); //x
let myChart = echarts.init(document.getElementById('map1'));
//
let option = {
title: {
@ -83,23 +128,32 @@ export default {
type: 'category',
data: xData,
axisLabel: {
interval: 0,//x
rotate: 0,//30
}
interval: 0, //x
rotate: 0, //30
},
},
//
tooltip: {
trigger: 'axis',
axisPointer: {
type: 'shadow'
type: 'shadow',
},
formatter: function (params) {
return params[0].name + '<br/>' +
return (
params[0].name +
'<br/>' +
'<table>' +
'<tr><td>' + params[0].marker + '</td><td style="font-weight: bold;">' + '&nbsp;&nbsp;&nbsp;&nbsp;' + params[0].value + '%' + '</td></tr>' +
'<tr>'
+ '</table>';
}
'<tr><td>' +
params[0].marker +
'</td><td style="font-weight: bold;">' +
'&nbsp;&nbsp;&nbsp;&nbsp;' +
params[0].value +
'%' +
'</td></tr>' +
'<tr>' +
'</table>'
);
},
},
toolbox: {
// show: true,
@ -113,15 +167,15 @@ export default {
grid: {
left: '3%',
right: '4%',
bottom: '1%',//3%
containLabel: true
bottom: '1%', //3%
containLabel: true,
},
yAxis: {
type: 'value',
name: '通过率',
axisLabel: {
formatter: '{value} %'
}
formatter: '{value} %',
},
},
series: [
{
@ -132,16 +186,17 @@ export default {
label: {
show: true, //
position: 'top', //
textStyle: { //
textStyle: {
//
color: 'black',
fontSize: 12
fontSize: 12,
},
formatter: '{c}%',
}
}
}
}
]
},
},
},
},
],
};
// 使
myChart.setOption(option);
@ -149,11 +204,11 @@ export default {
//
async getBatch() {
const getBatch = await defHttp.get({ url: this.Url.getBatch });
this.batchOptions = getBatch.batches.map(item => {
this.batchOptions = getBatch.batches.map((item) => {
return {
value: item.value,
label: item.label
}
label: item.label,
};
});
// const getCollege = await defHttp.get({ url: this.Url.getCollege });
@ -169,21 +224,21 @@ export default {
const res = await defHttp.get({ url: this.Url.getCollegeMajor });
//map
this.collegeMajorOptions = res.collegeMajor.map(item => {
this.collegeMajorOptions = res.collegeMajor.map((item) => {
return {
value: item.college,
label: item.college,
children: item.major.map(major => {
children: item.major.map((major) => {
return {
value: major,
label: major
}
})
}
label: major,
};
}),
};
});
this.collegeMajorOptions.unshift({ value: '全校', label: '全校' });
this.collegeMajor = this.collegeMajorOptions[0].value;
console.log(this.collegeMajor)
console.log(this.collegeMajor);
console.log(this.collegeMajorOptions);
},
//
@ -198,7 +253,7 @@ export default {
this.collegeMajor = '全校';
}
//this.batch[1]null
let major = this.batch.length > 1 ? this.batch[1] : "";
let major = this.batch.length > 1 ? this.batch[1] : '';
this.topCollege = this.collegeMajor;
this.topBath = this.batch;
this.loading = true;
@ -206,39 +261,245 @@ export default {
batch: this.batch,
college: this.collegeMajor,
level: 'cet4',
}
};
resultData = await defHttp.get({ url: this.Url.getRate, params });
this.sumRate = resultData.sumRate;
console.log("result", resultData)
console.log('result', resultData);
} finally {
this.loading = false;
this.$nextTick(() => {
this.dataChart(resultData.data);
})
}
this.draPieChart_Pass();
this.draPieChart_Participate();
});
}
},
mounted() {
this.getCollegeMajorData();
this.getBatch();
this.query();
}
}
//--cet4
draPieChart_Pass() {
//console.log(this.passRatePie);
//console.log('piedata', piedata);
let myChart = echarts.init(document.getElementById('pass_Piechart'));
let option = {
tooltip: {
trigger: 'item',
conginee: false,
//
itemStytle: {
fontSize: 100,
},
},
//title: {
// text: '/',
// left: 'top',
// top: '0%',
// textStyle: {
// fontSize: 12,
// },
//},
legend: {
top: '5%',
left: 'center',
},
color: ['#ec2e30', '#c75af1', '#2b9eef', '#eee03f', '#2aed91', '#c5ed3c'],
series: [
{
name: '学院/专业该批次通过人数饼图',
type: 'pie',
radius: ['0', '100%'],
top: 80,
itemStyle: {
borderRadius: 5,
borderColor: '#fff',
borderWideth: 2,
},
label: {
show: true,
fontSize: 12,
overflow: 'truncate',
},
emphasis: {
itemStyle: {
shadowBlur: 10,
shadowOffsetX: 0,
shadowColor: 'rgba(0, 0, 0, 0.5)',
},
label: {
show: true,
fontSize: 15,
fontWeight: 'bold',
},
},
data: [
{ value: 1048, name: '你好' },
{ value: 735, name: '不好' },
{ value: 580, name: '孤寡' },
{ value: 484, name: '小鸟伏特加' },
{ value: 300, name: '喜喜' },
],
},
],
};
myChart.setOption(option);
},
//--
draPieChart_Participate() {
//console.log(this.passRatePie);
//console.log('piedata', piedata);
let myChart = echarts.init(document.getElementById('participate_Piechart'));
let option = {
tooltip: {
trigger: 'item',
conginee: false,
//
itemStytle: {
//
shadowBlur: 10, //
shadowColor: 'rgba(0, 0, 0, 0.3)', //
shadowOffsetX: 5, //
shadowOffsetY: 5, //
fontSize: 100,
},
},
// title: {
// text: '/',
// left: 'top',
// top: '0%',
// textStyle: {
// fontSize: 12,
// },
// },
legend: {
top: '5%',
left: 'center',
// orient: 'vertical',
itemGap: 3,
selectedMode: true,
// inactiveColor: '#ccc',
// icon: 'circle',
// formatter: function (name) {
// var value;
// for (var i = 0; i < data.length; i++){
// if(data[i].name == name){
// value = data[i].value;
// }
// }
// return name + ' : ' + Math.round(value / num * 10000) / 100 + "%";
// },
},
color: ['#ec2e30', '#c75af1', '#2b9eef', '#eee03f', '#2aed91', '#c5ed3c'],
series: [
{
name: '学院/专业该批次通过人数饼图',
type: 'pie',
radius: ['50%', '100%'],
center: ['50%', '50%'],
startAngle: 130,
top: 80,
//
itemStyle: {
// borderRadius: 5,
// borderColor: '#fff',
borderWidth: 2,
},
label: {
show: true,
// position: 'inside',
fontSize: 12,
overflow: 'truncate',
},
labelLine: {
show: true,
smooth: true,
length: 10,
},
emphasis: {
itemStyle: {
shadowBlur: 10,
shadowOffsetX: 0,
shadowColor: 'rgba(0, 0, 0, 0.5)',
},
label: {
show: true,
fontSize: 15,
fontWeight: 'bold',
},
},
data: [
{ value: 1048, name: '你好' },
{ value: 735, name: '不好' },
{ value: 580, name: '孤寡' },
{ value: 484, name: '小鸟伏特加' },
{ value: 300, name: '喜喜' },
],
},
{
type: 'pie',
startAngle: 130,
top: 80,
radius: ['40%', '51%'],
center: ['50%', '50%'],
//
itemStyle: {
// borderRadius: 3,
// borderColor: '#fff',
borderWidth: 2,
},
label: {
show: false,
},
hoverAnimation: false,
legendHoverLink: false,
// animationnfalse,
tooltip: {
show: false,
},
data: [
{ value: 1048, name: '你好' },
{ value: 735, name: '不好' },
{ value: 580, name: '孤寡' },
{ value: 484, name: '小鸟伏特加' },
{ value: 300, name: '喜喜' },
],
},
],
};
myChart.setOption(option);
myChart.dispatchAction({
type: 'highlight',
seriesIndex: 1,
});
window.addEventListener('resize', function () {
myChart.resize();
});
},
},
};
</script>
<style lang="less" scoped>
.container {
.container {
// display: flex;
background-color: #fff;
padding: 15px;
border-radius: 4px;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.09);
}
}
.title {
.title {
font-size: 20px;
color: rgb(8, 8, 8);
font-weight: bold;
}
}
.tip {
margin-bottom: 10px;
background-color: #d0e5fe;
opacity: 0.9;
}
</style>

View File

@ -1,9 +1,6 @@
<template>
<div>
<div>
<div style="background: #ececec; padding: 15px">
<a-card :bordered="false">
<a-tabs v-model:activeKey="activeKey" type="card">
<a-tab-pane key="1" tab="对比多学院四级通过率">
<div class="query">
<div>
<div style="display: flex">
@ -19,64 +16,36 @@
<a-checkbox-group :options="collegeOptions" v-model:value="collegetab2" @change="onCollegeChange" />
</div>
<div style="margin-top: 20px; margin-right: 20px; display: flex; justify-content: flex-end; align-items: center">
<div style="margin-top: 10px; margin-right: 20px; display: flex; justify-content: flex-end; align-items: center">
<a-button style="margin-left: 10px" type="primary" @click="clearCollege">清除</a-button>
<a-button style="margin-left: 10px" type="primary" @click="collegeQuery">查询</a-button>
</div>
</div>
<!-- <a-select
v-model:value="collegetab2"
style="width: 300px; margin-right: 20px"
mode="multiple"
:max-tag-count="5"
:options="collegeOptions"
@change="onCollegeChange"
></a-select> -->
<!-- <a-select
v-model:value="collegeentrydate"
style="width: 200px"
:options="entrydateOptions"
mode="multiple"
:max-tag-count="5"
@change="onCollegeChange"
></a-select> -->
</div>
</a-tab-pane>
</a-tabs>
</a-card>
<a-card title="按学院分析" :loading="tab2loading" :bordered="false">
<template #extra>
<!-- <a-select v-model:value="college" style="width: 300px" mode="multiple" :max-tag-count="2"
:options="collegeOptions" @change="onCollegeMajorChange"></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-select v-model:value="entrydate" style="margin-left: 10px;width: 150px"
:options="entrydateOptions"></a-select>
<a-button style="margin-left: 10px;" type="primary" @click="query">查询</a-button> -->
</template>
<a-row :gutter="24">
<a-col :xl="24" :style="{ marginBottom: '24px' }">
<a-card title="学院四级通过率对比" :loading="tab2loading" :bordered="false">
<a-row :gutter="12">
<a-col :xl="14">
<div class="container">
<div id="map2" style="width: 100%; height: 600px"></div>
<div id="map2" style="width: 100%; min-height: 400px"></div>
</div>
</a-col>
<a-col :xl="10">
<div class="container">
<div id="map3" style="width: 100%; min-height: 400px"></div>
</div>
</a-col>
</a-row>
</a-card>
</div>
</div>
</template>
<script>
import { defHttp } from '/@/utils/http/axios';
import * as echarts from 'echarts';
import bar from '/@/components/Scrollbar/src/bar';
import { message } from 'ant-design-vue';
import { last } from 'xe-utils';
import { defHttp } from '/@/utils/http/axios';
import * as echarts from 'echarts';
import { message } from 'ant-design-vue';
export default {
name: 'Analysis',
export default {
data() {
return {
activeKey: '1',
@ -127,6 +96,13 @@ export default {
lastCollegeEntrydate: [],
};
},
mounted() {
this.getCollegeOptions();
// this.getBatch();
this.getEntrydate();
this.allQuery();
this.getCollegeMajorData();
},
methods: {
onMajorChange(value) {
console.log(value, 'value');
@ -462,7 +438,7 @@ export default {
name: i,
type: 'bar',
//
barWidth: 25,
barWidth: 16,
data: yData,
//
barGap: '30%',
@ -476,7 +452,7 @@ export default {
textStyle: {
//
color: 'black',
fontSize: 13,
fontSize: 10,
},
},
color: colors[k++],
@ -489,7 +465,6 @@ export default {
// debugger
let myChart = null;
console.log(tab, 'tab');
if (tab == 'tab2') {
myChart = document.getElementById('map2');
if (myChart) {
myChart = echarts.getInstanceByDom(myChart);
@ -498,21 +473,14 @@ export default {
}
}
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 = {
title: {
text: '学院四级通过率对比',
},
//title: {
// text: '',
// textStyle: {
// fontSize: 14,
// },
//},
legend: {},
tooltip: {
trigger: 'axis',
@ -528,14 +496,14 @@ export default {
return result;
},
},
toolbox: {
show: true,
feature: {
magicType: { show: true, type: ['line', 'bar'] },
restore: { show: true },
saveAsImage: { show: true },
},
},
//toolbox: {
// show: true,
// feature: {
// magicType: { show: true, type: ['line', 'bar'] },
// restore: { show: true },
// saveAsImage: { show: true },
// },
//},
grid: {
left: '3%',
right: '4%',
@ -570,10 +538,15 @@ export default {
myChart.setOption(option);
}, 1);
},
dataChart(data, tab) {
drawChart2(data, tab) {
let seriesData = [];
let xData = [];
let xData = this.majorentrydate.sort((a, b) => a - b);
if (tab == 'tab2') {
xData = this.collegeentrydate.sort((a, b) => a - b);
}
let k = 0;
let legendData = [];
let colors = [
'#5370c5',
'#91CC75',
@ -622,23 +595,26 @@ export default {
'#FAFAD2',
'#FAF0E6 ',
];
let j = 0;
let isJK = false;
for (let i in data) {
xData = [];
console.log(i, 'i');
legendData.push(i);
let yData = [];
for (let key in data[i]) {
xData.push(data[i][key].college);
// %
yData.push(data[i][key].passRate);
}
// legendData=[];
console.log(data[i], 'data[i]');
xData = xData.map((label) => label.split('').join('\n')); //x
for (let j in data[i]) {
console.log(data[i][j].college, 'data[i][j].college111');
// if(data[i][j].college == ''){
yData.push(data[i][j].passRate);
// legendData.push(data[i][j].college);
}
console.log(yData, 'yData');
seriesData.push({
name: i + '级累计总通过率',
type: 'bar',
name: i,
type: 'line',
//
barWidth: 25,
barWidth: 18,
data: yData,
//
barGap: '30%',
@ -652,65 +628,28 @@ export default {
textStyle: {
//
color: 'black',
fontSize: 13,
fontSize: 10,
},
},
color: colors[j++],
color: colors[k++],
},
},
});
if (j == colors.length) {
j = 0;
}
let rankData = yData
.slice()
.sort((a, b) => b - a)
.map((value) => yData.indexOf(value) + 1);
//
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: 13,
},
},
color: colors[j++],
},
},
});
if (j == colors.length) {
j = 0;
}
}
}
// debugger
let myChart = null;
if (tab == 'tab2') {
myChart = echarts.init(document.getElementById('map2'));
} else if (tab == 'tab1') {
myChart = echarts.init(document.getElementById('map1'));
} else if (tab == 'tab3') {
myChart = echarts.init(document.getElementById('map3'));
console.log(tab, 'tab');
myChart = document.getElementById('map3');
if (myChart) {
myChart = echarts.getInstanceByDom(myChart);
if (myChart) {
myChart.dispose();
}
}
myChart = echarts.init(document.getElementById('map3'));
//
// const college1 = this.college;
let option = {
title: {
text: '本批次学院通过率排名',
},
legend: {},
tooltip: {
trigger: 'axis',
axisPointer: {
@ -718,43 +657,21 @@ export default {
},
formatter: function (params) {
//tooltip,
let result = params[0].name + '<br>';
let result = params[0].name + '级通过率<br>';
for (let i = 0; i < params.length; i++) {
result += params[i].marker + params[i].seriesName + ' : ' + params[i].value + '%' + '<br>';
}
if (tab == 'tab1') {
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>';
result += params[i].marker + legendData[i] + ' : ' + params[i].value + '%' + '<br>';
}
return result;
},
},
toolbox: {
show: true,
feature: {
magicType: { show: true, type: ['line', 'bar'] },
restore: { show: true },
saveAsImage: { show: true },
},
},
//toolbox: {
// show: true,
// feature: {
// magicType: { show: true, type: ['line', 'bar'] },
// restore: { show: true },
// saveAsImage: { show: true },
// },
//},
grid: {
left: '3%',
right: '4%',
@ -779,56 +696,15 @@ export default {
formatter: '{value} %',
},
},
{
type: 'value',
name: '排名',
show: false,
},
],
series: seriesData,
};
if (tab == 'tab1') {
option.series = [
{
name: '累计总通过率',
type: 'bar',
data: seriesData[0].data,
//
barWidth: 25,
// 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],
},
];
}
// 使
console.log(option, 'option');
console.log(myChart, 'myChart');
setTimeout(() => {
myChart.setOption(option);
}, 1);
},
//
async getBatch() {
@ -882,46 +758,40 @@ export default {
this.dataChart(result.data, query);
} else if (query == 'tab2') {
this.drawChart(result.data, query);
this.drawChart2(result.data, query);
}
});
}
},
},
mounted() {
this.getCollegeOptions();
// this.getBatch();
this.getEntrydate();
this.allQuery();
this.getCollegeMajorData();
},
};
};
</script>
<style lang="less" scoped>
.container {
.container {
display: flex;
background-color: #fff;
padding: 15px;
border-radius: 4px;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.09);
}
}
.query {
.query {
display: flex;
justify-content: flex-start;
align-items: center;
margin-left: 24px;
}
}
.tab3 {
.tab3 {
justify-content: flex-start;
align-items: center;
margin-left: 24px;
}
}
.title {
.title {
font-size: 34px;
color: rgb(8, 8, 8);
font-weight: bold;
}
}
</style>

View File

@ -3,42 +3,43 @@
<a-card title="四级总通过率查询" :loading="loading" :bordered="false">
<template #extra>
<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>
<a-button style="margin-left: 10px;" type="primary" @click="query">查询</a-button>
<a-select v-model:value="entrydate" style="margin-left: 10px; width: 100px" :options="entrydateOptions" />
<a-button style="margin-left: 10px" type="primary" @click="query">查询</a-button>
<!-- <a-button @click=test()>test</a-button> -->
</template>
<a-row :gutter="24">
<a-row :gutter="12">
<a-col :xl="13">
<div style="padding-left: 10px;min-height: 400px;">
<div v-if="topCollege != null" style="margin-bottom: 5px;">
<span style="font-size: 15px;">当前数据为 </span>
<span style="color: red; font-size: 18px;">{{ topCollege }}</span>
<span v-if="topMajor != null && topMajor != '' " style="color: red; font-size: 18px;"> / {{ topMajor }}</span>
<span style="font-size: 15px;"> </span>
<span style="color: red; font-size: 20px;">{{ topEntrydate }}</span>
<span style="font-size: 15px;"> 级数据</span>
<div style="padding-left: 10px; min-height: 400px">
<div v-if="topCollege != null" style="margin-bottom: 5px">
<span style="font-size: 15px">当前数据为 </span>
<span style="color: red; font-size: 18px">{{ topCollege }}</span>
<span v-if="topMajor != null && topMajor != ''" style="color: red; font-size: 18px"> / {{ topMajor }}</span>
<span style="font-size: 15px"> </span>
<span style="color: red; font-size: 20px">{{ topEntrydate }}</span>
<span style="font-size: 15px"> 级数据</span>
</div>
<a-table :dataSource="dataSourceCet4" :columns="columns" :pagination='false' bordered>
<template v-slot:passRateSlot>
<a-table :dataSource="dataSourceCet4" :columns="columns" :pagination="false" bordered>
<template #passRateSlot>
累计总通过率
<a-tooltip :title="'累计通过人数 / ' + this.totalName + '总人数'" placement="top">
<a-tooltip :title="'累计通过人数 / ' + totalName + '总人数'" placement="top">
<a-icon type="question-circle" />
</a-tooltip>
</template>
</a-table>
<div style="display: flex; justify-content: space-between; font-size: 15px; margin-top: 10px;"
v-if="total && total > 0">
<span>{{ this.totalName }}总人数{{ total }}</span>
<div style="display: flex; justify-content: space-between; font-size: 15px; margin-top: 10px" v-if="total && total > 0">
<span>{{ totalName }}总人数{{ total }}</span>
<span>累计通过人数: {{ passNumberBottom }}</span>
<span>累计总通过率: {{ passRateBottom }}</span>
</div>
</div>
</a-col>
<a-col :xl="11">
<div style="width: 100%;height: 500px;padding: 10px;" class="piechart" id="piechart">
</div>
<a-card style="margin-top: 33px; margin-bottom: 12px">
<div style="width: 100%; height: 215px" class="piechart" id="piechart"> </div>
</a-card>
<a-card>
<div style="width: 100%; height: 180px" id="map2"> </div>
</a-card>
</a-col>
</a-row>
<!-- <div style="height: 300px;">
@ -49,11 +50,10 @@
</template>
<script>
import { defHttp } from '/@/utils/http/axios';
import * as echarts from 'echarts';
import { defHttp } from '/@/utils/http/axios';
import * as echarts from 'echarts';
export default {
name: "Analysis",
export default {
data() {
return {
loading: false,
@ -65,7 +65,7 @@ export default {
key: 'grade',
align: 'center',
customCell: (_, index) => ({
rowSpan: index % 2 === 0 ? 2 : 0,//graderowSpan
rowSpan: index % 2 === 0 ? 2 : 0, //graderowSpan
}),
},
{
@ -100,13 +100,13 @@ export default {
customCell: (_, index) => ({
rowSpan: index % 2 === 0 ? 2 : 0,
}),
}
},
],
Url: {
getEntrydate: '/cet/getEntrydate',
getCollege: '/cet/getCollege',
getData: '/cet/getData',
getCollegeMajor: '/cet/getCollegeMajor'
getCollegeMajor: '/cet/getCollegeMajor',
},
total: 0,
totalName: '',
@ -117,14 +117,20 @@ export default {
collegeMajorOptions: [],
entrydateOptions: [],
college: null,
entrydate: 2017,//
entrydate: 2017, //
//
collegeMajor: ['全校'],//
topCollege: null,//
topMajor: null,//
topEntrydate: null,//
collegeMajor: ['全校'], //
topCollege: null, //
topMajor: null, //
topEntrydate: null, //
};
},
mounted() {
this.getEntrydateAndCollegeData();
this.getCollegeMajorData();
this.query();
this.map2Chart();
},
methods: {
//
async getEntrydateAndCollegeData() {
@ -141,17 +147,17 @@ export default {
async getCollegeMajorData() {
const res = await defHttp.get({ url: this.Url.getCollegeMajor });
//map
this.collegeMajorOptions = res.collegeMajor.map(item => {
this.collegeMajorOptions = res.collegeMajor.map((item) => {
return {
value: item.college,
label: item.college,
children: item.major.map(major => {
children: item.major.map((major) => {
return {
value: major,
label: major
}
})
}
label: major,
};
}),
};
});
//
this.collegeMajorOptions.unshift({ value: '专升本', label: '专升本' });
@ -165,66 +171,65 @@ export default {
async query() {
try {
//this.collegeMajor[1]null
let major = this.collegeMajor.length > 1 ? this.collegeMajor[1] : "";
let major = this.collegeMajor.length > 1 ? this.collegeMajor[1] : '';
this.topCollege = this.collegeMajor[0];
this.topMajor = major;
this.topEntrydate = this.entrydate;
if (this.college)
this.loading = true;
if (this.college) this.loading = true;
let params = {
college: this.collegeMajor[0],
major: major,
entrydate: this.entrydate
}
console.log("params", params);
entrydate: this.entrydate,
};
console.log('params', params);
const result = await defHttp.get({ url: this.Url.getData, params });
let tableData = [];
let piedata = [];
let passrate = 0;
let index = 0;
const passRate = {}
if(result.cet4["大一学年"] != undefined) {
passRate["大一学年"] = result.cet4["大一学年"];
const passRate = {};
if (result.cet4['大一学年'] != undefined) {
passRate['大一学年'] = result.cet4['大一学年'];
}
if(result.cet4["大二学年"] != undefined) {
passRate["大二学年"] = result.cet4["大二学年"];
if (result.cet4['大二学年'] != undefined) {
passRate['大二学年'] = result.cet4['大二学年'];
}
if(result.cet4["大三学年"] != undefined) {
passRate["大三学年"] = result.cet4["大三学年"];
if (result.cet4['大三学年'] != undefined) {
passRate['大三学年'] = result.cet4['大三学年'];
}
if(result.cet4["大四学年"] != undefined) {
passRate["大四学年"] = result.cet4["大四学年"];
if (result.cet4['大四学年'] != undefined) {
passRate['大四学年'] = result.cet4['大四学年'];
}
result.cet4 = passRate;
for (let grade in result.cet4) {
result.cet4[grade].forEach(item => {
result.cet4[grade].forEach((item) => {
if (index % 2 == 0) {
piedata.push({ value: parseFloat(item.gradepassrate - passrate).toFixed(3), name: grade + "时通过" });
piedata.push({ value: parseFloat(item.gradepassrate - passrate).toFixed(3), name: grade + '时通过' });
passrate = parseFloat(item.gradepassrate).toFixed(3);
}
index++
index++;
tableData.push({
grade: grade,
attendNumber: item.attendNumber,
batch: item.batch,
gradepassrate: (item.gradepassrate * 100).toFixed(1) + '%',
passNumber: item.passNumber,
batchpassrate: (item.batchpassrate * 100).toFixed(1) + '%'
batchpassrate: (item.batchpassrate * 100).toFixed(1) + '%',
});
});
}
console.log("tableData", tableData);
this.dataSourceCet4 = tableData;//
this.total = result.total;//
this.totalName = result.totalName;//
this.passNumberBottom = result.passNumber;//
this.passRateBottom = (result.passRate * 100).toFixed(1) + '%';//
console.log('tableData', tableData);
this.dataSourceCet4 = tableData; //
this.total = result.total; //
this.totalName = result.totalName; //
this.passNumberBottom = result.passNumber; //
this.passRateBottom = (result.passRate * 100).toFixed(1) + '%'; //
//
this.passRatePie = []//
this.passRatePie = []; //
this.passRatePie.push({ value: result.passRate, name: '已通过' });
this.passRatePie.push({ value: 1 - result.passRate, name: '未通过' })
piedata.push({ value: (1 - passrate).toFixed(3), name: '未通过' });//
this.passRatePie.push({ value: 1 - result.passRate, name: '未通过' });
piedata.push({ value: (1 - passrate).toFixed(3), name: '未通过' }); //
setTimeout(() => {
this.drawPieChart(piedata);
}, 100);
@ -234,21 +239,58 @@ export default {
}
},
test() {
defHttp.get({ url: "/cet/getTest" });
defHttp.get({ url: '/cet/getTest' });
},
map2Chart() {
var myChart = echarts.init(document.getElementById('map2'));
var option = {
title: {
text: '各批次通过率分析',
left: 'left',
top: '0%',
textStyle: {
fontSize: 16,
},
},
tooltip: {
trigger: 'item',
},
grid: {
top: '50px',
left: '50px',
right: '50px',
bottom: '30px',
},
xAxis: {
type: 'category',
data: ['2017-12-01', '2017-12-01', '2017-12-01', '2017-12-01', '2017-12-01'],
},
yAxis: {
type: 'value',
},
series: [
{
data: [150, 230, 224, 218, 135],
type: 'line',
},
],
};
option && myChart.setOption(option);
},
drawPieChart(piedata) {
console.log(this.passRatePie)
console.log("piedata", piedata)
console.log(this.passRatePie);
console.log('piedata', piedata);
let myChart = echarts.init(document.getElementById('piechart'));
let option = {
tooltip: {
trigger: 'item',
confine: false,
avoidLabelOverlap: true,
//
itemStyle: {
fontSize: 100
}
fontSize: 100,
},
},
title: {
@ -256,45 +298,23 @@ export default {
left: 'left',
top: '0%',
textStyle: {
fontSize: 20
}
fontSize: 16,
},
},
legend: {
top: '5%',
left: 'center'
top: 'center',
right: '0%',
orient: 'vertical',
},
color: ['#b3cde0', '#6497b1', '#005b96', '#03396c', '#e5e5e5'],
series: [
//
// {
// name: '',
// type: 'pie',
// radius: ['0', '30%'],
// avoidLabelOverlap: false,
// itemStyle: {
// borderRadius: 3,
// borderColor: '#fff',
// borderWidth: 2,
// },
// label: {
// position: 'inner',
// fontSize: 14
// },
// emphasis: {
// label: {
// show: true,
// fontSize: 20,
// fontWeight: 'bold'
// }
// },
// data: this.passRatePie
// },
//
{
name: '四级通过率',
type: 'pie',
radius: ['35%', '60%'],
center: ['30%', '50%'],
radius: ['35%', '70%'],
itemStyle: {
borderRadius: 10,
borderColor: '#fff',
@ -303,52 +323,44 @@ export default {
label: {
show: true,
fontSize: 14,
overflow: 'truncate'
overflow: 'truncate',
minMargin: -1,
},
emphasis: {
itemStyle: {
shadowBlur: 10,
shadowOffsetX: 0,
shadowColor: 'rgba(0, 0, 0, 0.5)'
shadowColor: 'rgba(0, 0, 0, 0.5)',
},
label: {
show: true,
fontSize: 15,
fontWeight: 'bold'
}
fontWeight: 'bold',
},
data: piedata
}
]
},
data: piedata,
},
],
};
myChart.setOption(option);
}
},
mounted() {
this.getEntrydateAndCollegeData();
this.getCollegeMajorData();
this.query();
}
}
},
};
</script>
<style lang="less" scoped>
.container {
.container {
display: flex;
background-color: #fff;
padding: 15px;
border-radius: 4px;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.09);
}
}
.title {
.title {
font-size: 34px;
color: rgb(8, 8, 8);
font-weight: bold;
}
}
</style>