Compare commits
2 Commits
cf6302cc71
...
54d1bcb9aa
Author | SHA1 | Date |
---|---|---|
|
54d1bcb9aa | |
|
ccd3305924 |
|
@ -59,10 +59,15 @@
|
||||||
:options="entrydateOptions"></a-select>
|
:options="entrydateOptions"></a-select>
|
||||||
<a-button style="margin-left: 10px;" type="primary" @click="query">查询</a-button> -->
|
<a-button style="margin-left: 10px;" type="primary" @click="query">查询</a-button> -->
|
||||||
</template>
|
</template>
|
||||||
<a-row :gutter="24">
|
<a-row :gutter="12">
|
||||||
<a-col :xl="24" :style="{ marginBottom: '24px' }">
|
<a-col :xl="14">
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<div id="map3" style="width: 100%; height: 600px"></div>
|
<div id="map3" style="width: 100%; height: 400px"></div>
|
||||||
|
</div>
|
||||||
|
</a-col>
|
||||||
|
<a-col :xl="10">
|
||||||
|
<div class="container">
|
||||||
|
<div id="map4" style="width: 100%; height: 400px"></div>
|
||||||
</div>
|
</div>
|
||||||
</a-col>
|
</a-col>
|
||||||
</a-row>
|
</a-row>
|
||||||
|
@ -74,7 +79,37 @@
|
||||||
import { defHttp } from '/@/utils/http/axios';
|
import { defHttp } from '/@/utils/http/axios';
|
||||||
import * as echarts from 'echarts';
|
import * as echarts from 'echarts';
|
||||||
import { message } from 'ant-design-vue';
|
import { message } from 'ant-design-vue';
|
||||||
|
import { defHttp } from '/@/utils/http/axios';
|
||||||
|
import * as echarts from 'echarts';
|
||||||
|
import { message } from 'ant-design-vue';
|
||||||
|
|
||||||
|
export default {
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
activeKey: '1',
|
||||||
|
allCollege: [],
|
||||||
|
showBox: false,
|
||||||
|
showGroup: false,
|
||||||
|
oneentrydate: null,
|
||||||
|
collegeentrydate: [],
|
||||||
|
majorentrydate: [],
|
||||||
|
lastMajorEntrydate: [],
|
||||||
|
checkedOptions: [],
|
||||||
|
collegetab2: [],
|
||||||
|
collegeMajorOptions: [],
|
||||||
|
collegeMajor: [],
|
||||||
|
Url: {
|
||||||
|
getBatch: '/cet/getBatch',
|
||||||
|
getEntrydate: '/cet/getEntrydate',
|
||||||
|
getCollege: '/cet/getCollege',
|
||||||
|
getCollegeRate: '/cet/getRateByCollege',
|
||||||
|
getAllRate: '/cet/getAllRate',
|
||||||
|
getCollegeMajor: '/cet/getCollegeMajor',
|
||||||
|
getRateByMajor: '/cet/getRateByMajor',
|
||||||
|
},
|
||||||
|
tab1loading: false,
|
||||||
|
tab2loading: false,
|
||||||
|
tab3loading: false,
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
@ -193,48 +228,31 @@
|
||||||
this.tab3loading = false;
|
this.tab3loading = false;
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
this.drawChart(res.data, 'tab3');
|
this.drawChart(res.data, 'tab3');
|
||||||
|
this.drawChart2(res.data, 'tab3');
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
collegeQuery() {
|
|
||||||
if (this.collegeentrydate.length == 0) {
|
|
||||||
message.error('请选择年级');
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (this.collegetab2.length == 0) {
|
|
||||||
message.error('请选择学院');
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
this.tab2loading = true;
|
//获取学院专业级联数据
|
||||||
let query = 'tab2';
|
async getCollegeMajorData() {
|
||||||
this.query(query, this.collegetab2, this.collegeentrydate);
|
const res = await defHttp.get({ url: this.Url.getCollegeMajor });
|
||||||
|
//通过map方法将数据转换为级联选择器需要的数据格式
|
||||||
|
this.collegeMajorOptions = res.collegeMajor.map((item) => {
|
||||||
|
return {
|
||||||
|
value: item.college,
|
||||||
|
label: item.college,
|
||||||
|
children: item.major.map((major) => {
|
||||||
|
return {
|
||||||
|
value: major,
|
||||||
|
label: major,
|
||||||
|
};
|
||||||
|
}),
|
||||||
|
};
|
||||||
|
});
|
||||||
|
// this.collegeMajor = ['东语学院'];
|
||||||
|
console.log(this.collegeMajor, 'collegeMajor');
|
||||||
|
console.log(this.collegeMajorOptions, 'collegeMajorOptions1');
|
||||||
},
|
},
|
||||||
test(value) {
|
|
||||||
console.log(this.collegeMajor);
|
|
||||||
console.log(value);
|
|
||||||
},
|
|
||||||
//选择全校
|
|
||||||
checkAll(e) {
|
|
||||||
this.college = ['全校'];
|
|
||||||
this.showGroup = !this.showGroup;
|
|
||||||
},
|
|
||||||
|
|
||||||
//选择学院
|
|
||||||
checkOne(e) {
|
|
||||||
console.log(e);
|
|
||||||
this.college = e;
|
|
||||||
this.showBox = true;
|
|
||||||
if (e.length == 0) {
|
|
||||||
this.showBox = false;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
//选择年级
|
|
||||||
checkoneentrydate(e) {
|
|
||||||
console.log(e.target.value, 'e');
|
|
||||||
this.entrydate = [e.target.value];
|
|
||||||
},
|
|
||||||
|
|
||||||
//获取学院专业级联数据
|
//获取学院专业级联数据
|
||||||
async getCollegeMajorData() {
|
async getCollegeMajorData() {
|
||||||
const res = await defHttp.get({ url: this.Url.getCollegeMajor });
|
const res = await defHttp.get({ url: this.Url.getCollegeMajor });
|
||||||
|
@ -256,11 +274,20 @@
|
||||||
console.log(this.collegeMajorOptions, 'collegeMajorOptions1');
|
console.log(this.collegeMajorOptions, 'collegeMajorOptions1');
|
||||||
},
|
},
|
||||||
|
|
||||||
|
getCollegeOptions() {
|
||||||
|
defHttp.get({ url: this.Url.getCollege }).then((res) => {
|
||||||
|
this.collegeOptions = res.colleges;
|
||||||
|
// 手动添加一个全校字段
|
||||||
getCollegeOptions() {
|
getCollegeOptions() {
|
||||||
defHttp.get({ url: this.Url.getCollege }).then((res) => {
|
defHttp.get({ url: this.Url.getCollege }).then((res) => {
|
||||||
this.collegeOptions = res.colleges;
|
this.collegeOptions = res.colleges;
|
||||||
// 手动添加一个全校字段
|
// 手动添加一个全校字段
|
||||||
|
|
||||||
|
// this.collegeOptions.unshift({ value: '全校', label: '全校' });
|
||||||
|
// this.collegeOptions.forEach(option => {
|
||||||
|
// if (option.value !== '全校') {
|
||||||
|
// option.disabled = true;
|
||||||
|
//}
|
||||||
// this.collegeOptions.unshift({ value: '全校', label: '全校' });
|
// this.collegeOptions.unshift({ value: '全校', label: '全校' });
|
||||||
// this.collegeOptions.forEach(option => {
|
// this.collegeOptions.forEach(option => {
|
||||||
// if (option.value !== '全校') {
|
// if (option.value !== '全校') {
|
||||||
|
@ -356,6 +383,117 @@
|
||||||
this.majorLength--;
|
this.majorLength--;
|
||||||
},
|
},
|
||||||
//学院选项回调函数
|
//学院选项回调函数
|
||||||
|
onMajorCollegeChange(value) {
|
||||||
|
let val = value.target.value;
|
||||||
|
console.log(val, 'value');
|
||||||
|
console.log(this.collegeMajorOptions.find((item) => item.value == val).children, 'majorOptions');
|
||||||
|
this.majorOptions = this.collegeMajorOptions.find((item) => item.value == val).children;
|
||||||
|
//将this.majorCheckOn中的数据与this.lastCollegeMajor比较,如果this.lastCollegeMajor中有this.majorCheckOn中没有的数据则删除,反之添加
|
||||||
|
// for (let i = 0; i < this.majorCheckOn.length; i++) {
|
||||||
|
// if (!this.lastCollegeMajor.includes(this.majorCheckOn[i])) {
|
||||||
|
// this.lastCollegeMajor.push(this.majorCheckOn[i]);
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// for (let i = 0; i < this.lastCollegeMajor.length; i++) {
|
||||||
|
// if (!this.majorCheckOn.includes(this.lastCollegeMajor[i])) {
|
||||||
|
// this.lastCollegeMajor.splice(i, 1);
|
||||||
|
// console.log("splice")
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// this.lastCollegeMajor = this.majorCheckOn;
|
||||||
|
console.log(this.lastCollegeMajor, 'lastCollegeMajor');
|
||||||
|
this.majorCheckOn = this.lastCollegeMajor.map((item) => item[1]);
|
||||||
|
console.log(this.majorCheckOn, 'majorCheckOn');
|
||||||
|
},
|
||||||
|
// });
|
||||||
|
// this.college = ['全校'];
|
||||||
|
// this.collegetab2 = ['地理科学学院', '文学院'];
|
||||||
|
console.log(this.collegeOptions, 'collegeOptions');
|
||||||
|
});
|
||||||
|
},
|
||||||
|
onMajorEntrydateChange(value) {
|
||||||
|
console.log(value, 'value');
|
||||||
|
if (value.length > 5) {
|
||||||
|
//找到value中不在this.lastMajorEntrydate中的数据
|
||||||
|
for (let i = 0; i < value.length; i++) {
|
||||||
|
if (!this.lastMajorEntrydate.includes(value[i])) {
|
||||||
|
message.error('最多选择五个');
|
||||||
|
//删除value[i]
|
||||||
|
value.splice(i, 1);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
this.lastMajorEntrydate = value;
|
||||||
|
},
|
||||||
|
//学院对比 学院选项回调函数
|
||||||
|
onCollegeChange(value) {
|
||||||
|
console.log(value, 'value');
|
||||||
|
if (value.length > 5) {
|
||||||
|
message.error('最多选择五个');
|
||||||
|
//和lastCollege比较,如果value中的数据不在lastCollege中则删除
|
||||||
|
for (let i = 0; i < value.length; i++) {
|
||||||
|
if (!this.lastCollege.includes(value[i])) {
|
||||||
|
value.splice(i, 1);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this.lastCollege = value;
|
||||||
|
},
|
||||||
|
//学院对比 年级选项回调函数
|
||||||
|
onCollegeEntrydateChange(value) {
|
||||||
|
console.log(value, 'value');
|
||||||
|
if (value.length > 5) {
|
||||||
|
message.error('最多选择五个');
|
||||||
|
//和lastCollegeEntrydate比较,如果value中的数据不在lastCollegeEntrydate中则删除
|
||||||
|
for (let i = 0; i < value.length; i++) {
|
||||||
|
if (!this.lastCollegeEntrydate.includes(value[i])) {
|
||||||
|
value.splice(i, 1);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this.lastCollegeEntrydate = value;
|
||||||
|
},
|
||||||
|
//专业选项回调函数
|
||||||
|
onCollegeMajorChange(value) {
|
||||||
|
//将value中的数据与this.lastCollegeMajor比较,如果value中的有this.lastCollegeMajor中没有的数据则添加,反之寻找在this.majorOptions中并且在this.lastCollegeMajor中但是不在value中的数据删除
|
||||||
|
for (let i = 0; i < value.length; i++) {
|
||||||
|
if (!this.lastCollegeMajor.map((item) => item[1]).includes(value[i])) {
|
||||||
|
if (this.majorLength == 5) {
|
||||||
|
message.error('最多选择五个');
|
||||||
|
//从value中删除value[i]
|
||||||
|
value.splice(i, 1);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this.lastCollegeMajor.push([this.collegeMajor, value[i]]);
|
||||||
|
this.majorLength++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
for (let i = 0; i < this.lastCollegeMajor.length; i++) {
|
||||||
|
if (!value.includes(this.lastCollegeMajor[i][1])) {
|
||||||
|
//查看该数据是都在this.majorOptions中
|
||||||
|
if (this.majorOptions.find((item) => item.value == this.lastCollegeMajor[i][1])) {
|
||||||
|
this.lastCollegeMajor.splice(i, 1);
|
||||||
|
console.log('splice');
|
||||||
|
this.majorLength--;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
console.log(value, 'value');
|
||||||
|
},
|
||||||
|
removeTag(index) {
|
||||||
|
if (this.majorCheckOn.includes(this.lastCollegeMajor[index][1])) {
|
||||||
|
let index1 = this.majorCheckOn.indexOf(this.lastCollegeMajor[index][1]);
|
||||||
|
this.majorCheckOn.splice(index1, 1);
|
||||||
|
}
|
||||||
|
this.lastCollegeMajor.splice(index, 1);
|
||||||
|
this.majorLength--;
|
||||||
|
},
|
||||||
|
//学院选项回调函数
|
||||||
onMajorCollegeChange(value) {
|
onMajorCollegeChange(value) {
|
||||||
let val = value.target.value;
|
let val = value.target.value;
|
||||||
console.log(val, 'value');
|
console.log(val, 'value');
|
||||||
|
@ -379,6 +517,20 @@
|
||||||
console.log(this.majorCheckOn, 'majorCheckOn');
|
console.log(this.majorCheckOn, 'majorCheckOn');
|
||||||
},
|
},
|
||||||
|
|
||||||
|
clearMajor() {
|
||||||
|
this.majorCheckOn = [];
|
||||||
|
this.lastCollegeMajor = [];
|
||||||
|
this.majorLength = 0;
|
||||||
|
},
|
||||||
|
clearCollege() {
|
||||||
|
this.collegetab2 = [];
|
||||||
|
this.collegeentrydate = [];
|
||||||
|
this.lastCollege = [];
|
||||||
|
this.lastCollegeEntrydate = [];
|
||||||
|
},
|
||||||
|
//tab2\3图标
|
||||||
|
drawChart(data, tab) {
|
||||||
|
let seriesData = [];
|
||||||
clearMajor() {
|
clearMajor() {
|
||||||
this.majorCheckOn = [];
|
this.majorCheckOn = [];
|
||||||
this.lastCollegeMajor = [];
|
this.lastCollegeMajor = [];
|
||||||
|
@ -448,7 +600,6 @@
|
||||||
'#FAFAD2',
|
'#FAFAD2',
|
||||||
'#FAF0E6 ',
|
'#FAF0E6 ',
|
||||||
];
|
];
|
||||||
let isJK = false;
|
|
||||||
for (let i in data) {
|
for (let i in data) {
|
||||||
console.log(i, 'i');
|
console.log(i, 'i');
|
||||||
legendData.push(i);
|
legendData.push(i);
|
||||||
|
@ -467,7 +618,7 @@
|
||||||
name: i,
|
name: i,
|
||||||
type: 'bar',
|
type: 'bar',
|
||||||
//设置柱状图大小
|
//设置柱状图大小
|
||||||
barWidth: 25,
|
barWidth: 16,
|
||||||
data: yData,
|
data: yData,
|
||||||
//柱子间距
|
//柱子间距
|
||||||
barGap: '30%',
|
barGap: '30%',
|
||||||
|
@ -489,8 +640,6 @@
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
console.log(legendData, 'legendData');
|
|
||||||
console.log(seriesData, 'dasaaseriresdata');
|
|
||||||
// debugger
|
// debugger
|
||||||
let myChart = null;
|
let myChart = null;
|
||||||
console.log(tab, 'tab');
|
console.log(tab, 'tab');
|
||||||
|
@ -515,9 +664,6 @@
|
||||||
}
|
}
|
||||||
// 指定图表的配置项和数据
|
// 指定图表的配置项和数据
|
||||||
let option = {
|
let option = {
|
||||||
title: {
|
|
||||||
text: '专业四级通过率对比',
|
|
||||||
},
|
|
||||||
legend: {},
|
legend: {},
|
||||||
tooltip: {
|
tooltip: {
|
||||||
trigger: 'axis',
|
trigger: 'axis',
|
||||||
|
@ -535,11 +681,11 @@
|
||||||
},
|
},
|
||||||
toolbox: {
|
toolbox: {
|
||||||
show: true,
|
show: true,
|
||||||
feature: {
|
//feature: {
|
||||||
magicType: { show: true, type: ['line', 'bar'] },
|
// magicType: { show: true, type: ['line', 'bar'] },
|
||||||
restore: { show: true },
|
// restore: { show: true },
|
||||||
saveAsImage: { show: true },
|
// saveAsImage: { show: true },
|
||||||
},
|
//},
|
||||||
},
|
},
|
||||||
grid: {
|
grid: {
|
||||||
left: '3%',
|
left: '3%',
|
||||||
|
@ -575,10 +721,15 @@
|
||||||
myChart.setOption(option);
|
myChart.setOption(option);
|
||||||
}, 1);
|
}, 1);
|
||||||
},
|
},
|
||||||
|
drawChart2(data, tab) {
|
||||||
dataChart(data, tab) {
|
|
||||||
let seriesData = [];
|
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 = [
|
let colors = [
|
||||||
'#5370c5',
|
'#5370c5',
|
||||||
'#91CC75',
|
'#91CC75',
|
||||||
|
@ -627,23 +778,23 @@
|
||||||
'#FAFAD2',
|
'#FAFAD2',
|
||||||
'#FAF0E6 ',
|
'#FAF0E6 ',
|
||||||
];
|
];
|
||||||
let j = 0;
|
|
||||||
|
|
||||||
for (let i in data) {
|
for (let i in data) {
|
||||||
xData = [];
|
console.log(i, 'i');
|
||||||
|
legendData.push(i);
|
||||||
let yData = [];
|
let yData = [];
|
||||||
for (let key in data[i]) {
|
// legendData=[];
|
||||||
xData.push(data[i][key].college);
|
console.log(data[i], 'data[i]');
|
||||||
// 将数据转换为百分比(加上%)
|
|
||||||
yData.push(data[i][key].passRate);
|
|
||||||
}
|
|
||||||
|
|
||||||
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({
|
seriesData.push({
|
||||||
name: i + '级累计总通过率',
|
name: i,
|
||||||
type: 'bar',
|
type: 'line',
|
||||||
//设置柱状图大小
|
|
||||||
barWidth: 25,
|
|
||||||
data: yData,
|
data: yData,
|
||||||
//柱子间距
|
//柱子间距
|
||||||
barGap: '30%',
|
barGap: '30%',
|
||||||
|
@ -660,62 +811,27 @@
|
||||||
fontSize: 13,
|
fontSize: 13,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
color: colors[j++],
|
color: colors[k++],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
if (j == colors.length) {
|
}
|
||||||
j = 0;
|
// debugger
|
||||||
}
|
let myChart = null;
|
||||||
let rankData = yData
|
console.log(tab, 'tab');
|
||||||
.slice()
|
if (tab == 'tab3') {
|
||||||
.sort((a, b) => b - a)
|
myChart = document.getElementById('map4');
|
||||||
.map((value) => yData.indexOf(value) + 1);
|
if (myChart) {
|
||||||
//如果选择全校,增加排名
|
myChart = echarts.getInstanceByDom(myChart);
|
||||||
if (tab == 'tab1') {
|
if (myChart) {
|
||||||
seriesData.push({
|
myChart.dispose();
|
||||||
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;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
myChart = echarts.init(document.getElementById('map4'));
|
||||||
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'));
|
|
||||||
}
|
}
|
||||||
// 指定图表的配置项和数据
|
// 指定图表的配置项和数据
|
||||||
// const college1 = this.college;
|
|
||||||
let option = {
|
let option = {
|
||||||
title: {
|
legend: {},
|
||||||
text: '本批次学院通过率排名',
|
|
||||||
},
|
|
||||||
tooltip: {
|
tooltip: {
|
||||||
trigger: 'axis',
|
trigger: 'axis',
|
||||||
axisPointer: {
|
axisPointer: {
|
||||||
|
@ -723,42 +839,20 @@
|
||||||
},
|
},
|
||||||
formatter: function (params) {
|
formatter: function (params) {
|
||||||
//生成tooltip,加上小圆球
|
//生成tooltip,加上小圆球
|
||||||
let result = params[0].name + '<br>';
|
let result = params[0].name + '级通过率<br>';
|
||||||
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 + legendData[i] + ' : ' + 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;">' +
|
|
||||||
' ' +
|
|
||||||
params[0].value +
|
|
||||||
'%' +
|
|
||||||
'</td></tr>' +
|
|
||||||
'<tr><td>' +
|
|
||||||
params[1].marker +
|
|
||||||
params[1].seriesName +
|
|
||||||
'</td><td style="font-weight: bold;">' +
|
|
||||||
' ' +
|
|
||||||
params[1].value +
|
|
||||||
'</td></tr>' +
|
|
||||||
'</table>';
|
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
toolbox: {
|
toolbox: {
|
||||||
show: true,
|
show: true,
|
||||||
feature: {
|
//feature: {
|
||||||
magicType: { show: true, type: ['line', 'bar'] },
|
// magicType: { show: true, type: ['line', 'bar'] },
|
||||||
restore: { show: true },
|
// restore: { show: true },
|
||||||
saveAsImage: { show: true },
|
// saveAsImage: { show: true },
|
||||||
},
|
//},
|
||||||
},
|
},
|
||||||
grid: {
|
grid: {
|
||||||
left: '3%',
|
left: '3%',
|
||||||
|
@ -784,56 +878,13 @@
|
||||||
formatter: '{value} %',
|
formatter: '{value} %',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
|
||||||
type: 'value',
|
|
||||||
name: '排名',
|
|
||||||
show: false,
|
|
||||||
},
|
|
||||||
],
|
],
|
||||||
series: seriesData,
|
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],
|
|
||||||
},
|
|
||||||
];
|
|
||||||
}
|
|
||||||
// 使用刚指定的配置项和数据显示图表。
|
// 使用刚指定的配置项和数据显示图表。
|
||||||
|
setTimeout(() => {
|
||||||
myChart.setOption(option);
|
myChart.setOption(option);
|
||||||
|
}, 1);
|
||||||
},
|
},
|
||||||
// 获取批次数据
|
// 获取批次数据
|
||||||
async getBatch() {
|
async getBatch() {
|
||||||
|
@ -847,24 +898,11 @@
|
||||||
const getEntrydate = await defHttp.get({ url: this.Url.getEntrydate });
|
const getEntrydate = await defHttp.get({ url: this.Url.getEntrydate });
|
||||||
this.entrydateOptions = getEntrydate.entrydates;
|
this.entrydateOptions = getEntrydate.entrydates;
|
||||||
this.oneentrydate = this.entrydateOptions[0].value;
|
this.oneentrydate = this.entrydateOptions[0].value;
|
||||||
// this.collegeentrydate = [this.entrydateOptions[0].value];
|
|
||||||
// this.majorentrydate = [this.entrydateOptions[0].value];
|
|
||||||
// this.entrydate.push (this.entrydateOptions[0].value);
|
|
||||||
},
|
},
|
||||||
// 查询数据
|
// 查询数据
|
||||||
async query(query, college, entrydate) {
|
async query(query, college, entrydate) {
|
||||||
this.visible = false;
|
this.visible = false;
|
||||||
let result = null;
|
let result = null;
|
||||||
// console.log(this.college, this.entrydate);
|
|
||||||
// //如果this.college和this.batch为null则先赋静态值
|
|
||||||
// if (this.college === null || this.college.length === 0) {
|
|
||||||
// this.college = ['全校'];
|
|
||||||
// }
|
|
||||||
|
|
||||||
// if (!this.entrydate || this.entrydate.length === 0) {
|
|
||||||
// this.entrydate = ['2017'];
|
|
||||||
// }
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
// console.log(this.college, this.entrydate)
|
// console.log(this.college, this.entrydate)
|
||||||
let params = {
|
let params = {
|
||||||
|
@ -883,11 +921,8 @@
|
||||||
} finally {
|
} finally {
|
||||||
query == 'tab1' ? (this.tab1loading = false) : (this.tab2loading = false);
|
query == 'tab1' ? (this.tab1loading = false) : (this.tab2loading = false);
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
if (query == 'tab1') {
|
this.drawChart(result.data, query);
|
||||||
this.dataChart(result.data, query);
|
this.drawChart2(result.data, query);
|
||||||
} else if (query == 'tab2') {
|
|
||||||
this.drawChart(result.data, query);
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -903,7 +938,21 @@
|
||||||
border-radius: 4px;
|
border-radius: 4px;
|
||||||
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.09);
|
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.09);
|
||||||
}
|
}
|
||||||
|
.container {
|
||||||
|
display: flex;
|
||||||
|
background-color: #fff;
|
||||||
|
padding: 15px;
|
||||||
|
border-radius: 4px;
|
||||||
|
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.09);
|
||||||
|
}
|
||||||
|
|
||||||
|
.query {
|
||||||
|
//居左
|
||||||
|
display: flex;
|
||||||
|
justify-content: flex-start;
|
||||||
|
align-items: center;
|
||||||
|
margin-left: 24px;
|
||||||
|
}
|
||||||
.query {
|
.query {
|
||||||
//居左
|
//居左
|
||||||
display: flex;
|
display: flex;
|
||||||
|
@ -912,6 +961,11 @@
|
||||||
margin-left: 24px;
|
margin-left: 24px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.tab3 {
|
||||||
|
justify-content: flex-start;
|
||||||
|
align-items: center;
|
||||||
|
margin-left: 24px;
|
||||||
|
}
|
||||||
.tab3 {
|
.tab3 {
|
||||||
justify-content: flex-start;
|
justify-content: flex-start;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
@ -923,4 +977,9 @@
|
||||||
color: rgb(8, 8, 8);
|
color: rgb(8, 8, 8);
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
}
|
}
|
||||||
|
.title {
|
||||||
|
font-size: 34px;
|
||||||
|
color: rgb(8, 8, 8);
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
|
@ -113,6 +113,8 @@
|
||||||
passNumberBottom: 0,
|
passNumberBottom: 0,
|
||||||
passRateBottom: 0,
|
passRateBottom: 0,
|
||||||
passRatePie: [],
|
passRatePie: [],
|
||||||
|
lineXData: [],
|
||||||
|
lineYData: [],
|
||||||
collegeOptions: [],
|
collegeOptions: [],
|
||||||
collegeMajorOptions: [],
|
collegeMajorOptions: [],
|
||||||
entrydateOptions: [],
|
entrydateOptions: [],
|
||||||
|
@ -129,7 +131,7 @@
|
||||||
this.getEntrydateAndCollegeData();
|
this.getEntrydateAndCollegeData();
|
||||||
this.getCollegeMajorData();
|
this.getCollegeMajorData();
|
||||||
this.query();
|
this.query();
|
||||||
this.map2Chart();
|
//this.map2Chart();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
// 获取年级和学院数据
|
// 获取年级和学院数据
|
||||||
|
@ -201,8 +203,12 @@
|
||||||
passRate['大四学年'] = result.cet4['大四学年'];
|
passRate['大四学年'] = result.cet4['大四学年'];
|
||||||
}
|
}
|
||||||
result.cet4 = passRate;
|
result.cet4 = passRate;
|
||||||
|
this.lineXData = [];
|
||||||
|
this.lineYData = [];
|
||||||
for (let grade in result.cet4) {
|
for (let grade in result.cet4) {
|
||||||
result.cet4[grade].forEach((item) => {
|
result.cet4[grade].forEach((item) => {
|
||||||
|
this.lineXData.push(item.batch);
|
||||||
|
this.lineYData.push((item.batchpassrate * 100).toFixed(1));
|
||||||
if (index % 2 == 0) {
|
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);
|
passrate = parseFloat(item.gradepassrate).toFixed(3);
|
||||||
|
@ -232,6 +238,7 @@
|
||||||
piedata.push({ value: (1 - passrate).toFixed(3), name: '未通过' }); //外置饼图
|
piedata.push({ value: (1 - passrate).toFixed(3), name: '未通过' }); //外置饼图
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
this.drawPieChart(piedata);
|
this.drawPieChart(piedata);
|
||||||
|
this.map2Chart();
|
||||||
}, 100);
|
}, 100);
|
||||||
// this.drawPieChart();
|
// this.drawPieChart();
|
||||||
} finally {
|
} finally {
|
||||||
|
@ -253,7 +260,26 @@
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
tooltip: {
|
tooltip: {
|
||||||
trigger: 'item',
|
trigger: 'axis',
|
||||||
|
axisPointer: {
|
||||||
|
type: 'shadow',
|
||||||
|
},
|
||||||
|
formatter: function (params) {
|
||||||
|
return (
|
||||||
|
params[0].name +
|
||||||
|
'<br/>' +
|
||||||
|
'<table>' +
|
||||||
|
'<tr><td>' +
|
||||||
|
params[0].marker +
|
||||||
|
'</td><td style="font-weight: bold;">' +
|
||||||
|
' ' +
|
||||||
|
params[0].value +
|
||||||
|
'%' +
|
||||||
|
'</td></tr>' +
|
||||||
|
'<tr>' +
|
||||||
|
'</table>'
|
||||||
|
);
|
||||||
|
},
|
||||||
},
|
},
|
||||||
grid: {
|
grid: {
|
||||||
top: '50px',
|
top: '50px',
|
||||||
|
@ -263,15 +289,29 @@
|
||||||
},
|
},
|
||||||
xAxis: {
|
xAxis: {
|
||||||
type: 'category',
|
type: 'category',
|
||||||
data: ['2017-12-01', '2017-12-01', '2017-12-01', '2017-12-01', '2017-12-01'],
|
data: this.lineXData,
|
||||||
},
|
},
|
||||||
yAxis: {
|
yAxis: {
|
||||||
type: 'value',
|
type: 'value',
|
||||||
},
|
},
|
||||||
series: [
|
series: [
|
||||||
{
|
{
|
||||||
data: [150, 230, 224, 218, 135],
|
data: this.lineYData,
|
||||||
type: 'line',
|
type: 'line',
|
||||||
|
itemStyle: {
|
||||||
|
normal: {
|
||||||
|
label: {
|
||||||
|
show: true, //开启显示
|
||||||
|
position: 'top', //在上方显示
|
||||||
|
textStyle: {
|
||||||
|
//数值样式
|
||||||
|
color: 'black',
|
||||||
|
fontSize: 12,
|
||||||
|
},
|
||||||
|
formatter: '{c}%',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue