feature/1.0版本院领导页面开发 #2

Merged
Xubx merged 7 commits from feature/1.0版本院领导页面开发 into feature/1.0版本页面优化 2025-02-03 15:41:06 +08:00
1 changed files with 51 additions and 30 deletions
Showing only changes of commit d66336ab60 - Show all commits

View File

@ -27,7 +27,7 @@
:pagination="false"
bordered
class="custom-table"
:style="{ fontSize: '10px', color: '#333', marginTop: '-11px' }"
:style="{ fontSize: '10px', color: '#333', marginTop: '11px' }"
:loading="loadingTable"
/>
</div>
@ -66,11 +66,11 @@
export default {
data() {
return {
roleName: null,
collegeStudentCount: '11',
collegeStudentPassCount: '11',
collegeStudentPassRate: '11',
schoolStudentPassRate: '11',
loading: false,
loadingTable: false,
loadingMap2: false,
loadingMap3: false,
@ -116,20 +116,37 @@
getCollegeRate: '/cet/getRateByCollege',
getEntrydate: '/cet/getEntrydate',
getCollegeMajor: '/cet/getCollegeMajor',
getUserInfo: '/sys/user/getUserInfo',
queryUserRole: '/sys/user/queryUserRole',
queryById: '/sys/role/queryById',
},
};
},
mounted() {
this.query();
this.majorPassRate();
this.gradePassRate();
this.queryMajorByCollege();
},
methods: {
//
async query() {
this.loadingTable = true;
this.loadingMap2 = true;
this.loadingMap3 = true;
this.loadingMap4 = true;
this.loadingMap5 = true;
let resultData = null;
let userInfoResult = await defHttp.get({ url: this.Url.getUserInfo });
console.log('123', userInfoResult.userInfo.id);
let id = userInfoResult.userInfo.id;
let roleId = await defHttp.get({ url: this.Url.queryUserRole, params: { userid: id } });
//console.log('userAndRoleId', userAndRoleId);
//let roleId = userAndRoleId[1];
console.log('roleId', roleId);
let roleInfo = await defHttp.get({ url: this.Url.queryById, params: { id: roleId[0] } });
console.log('roleInfo', roleInfo);
this.roleName = roleInfo.roleName;
console.log('roleName', this.roleName);
this.college = this.roleName;
try {
//this.batchnull
if (!this.batch) {
@ -145,7 +162,7 @@
};
resultData = await defHttp.get({ url: this.Url.getData, params });
console.log('result', resultData);
//console.log('result', resultData);
//
let tableData = [];
for (let grade in resultData.gradeData) {
@ -157,13 +174,16 @@
});
}
this.dataSourceCet4 = tableData; //
console.log(this.dataSourceCet4, 'dataSourceCet4');
//console.log(this.dataSourceCet4, 'dataSourceCet4');
} finally {
this.loadingTable = false;
this.$nextTick(() => {
//this.dataChart(resultData.data);
console.log('cet4:', resultData.data);
this.card_Table();
//console.log('cet4:', resultData.data);
this.circleMap();
this.majorPassRate();
this.gradePassRate();
this.queryMajorByCollege();
});
}
},
@ -174,15 +194,15 @@
}
let resultData = await defHttp.get({ url: this.Url.getCollegeMajor });
let collegeAndMajor = resultData.collegeMajor;
console.log('11111111111', collegeAndMajor);
//console.log('11111111111', collegeAndMajor);
// collegeAndMajor
let majors = collegeAndMajor.find((item) => item.college === this.college);
console.log('3333', majors);
//console.log('3333', majors);
majors = majors.major;
this.majors = majors;
console.log('444', this.majors);
//console.log('444', this.majors);
let collegeAndMajors = this.majors.map((major) => [this.college, major]);
console.log('777', collegeAndMajors);
//console.log('777', collegeAndMajors);
//this.major = resultData.
const getEntrydate = await defHttp.get({ url: this.Url.getEntrydate });
this.entrydateOptions = getEntrydate.entrydates;
@ -192,20 +212,21 @@
college: collegeAndMajors,
entrydate: entrydate,
};
console.log('666');
//console.log('666');
let res = await defHttp.post({ url: this.Url.getRateByMajor, params });
console.log('55555', res.data);
//console.log('55555', res.data);
this.loadingMap5 = false;
this.$nextTick(() => {
this.drawChart(res.data);
});
},
//--
async card_Table() {
//map2--
async circleMap() {
this.loadingMap2 = true;
//console.log(this.passRatePie);
//console.log('piedata', piedata);
//this.batchnull
//S
if (!this.batch) {
this.batch = '2024-06-01';
}
@ -217,10 +238,10 @@
college: this.college,
level: 'cet4',
};
console.log(queryParams, 'queryParams');
//console.log(queryParams, 'queryParams');
let result = await defHttp.get({ url: this.Url.getData, params: queryParams });
console.log(result, 'result');
//console.log(result, 'result');
let chartsData = [];
for (let key in result.gradeData) {
chartsData.push({
@ -247,7 +268,7 @@
left: 'top',
top: '0%',
textStyle: {
fontSize: 12,
fontSize: 14,
},
},
legend: {
@ -337,7 +358,7 @@
// -map3---------------------------------------------
async majorPassRate() {
this.loadingMap3 = true;
console.log('55555555', this.entrydate);
//console.log('55555555', this.entrydate);
if (!this.batch) {
this.batch = '2024-06-01';
}
@ -353,9 +374,9 @@
level: 'cet4',
};
let url = this.Url.getRateByMajor;
console.log(queryParams, 'queryParams');
//console.log(queryParams, 'queryParams');
let result = await defHttp.post({ url: url, data: queryParams });
console.log('88888', result.data);
//console.log('88888', result.data);
if (!result) {
return;
}
@ -447,7 +468,7 @@
this.entrydateOptions = getEntrydate.entrydates;
let entrydate = this.entrydateOptions.map((item) => item.value);
const college = ['计算机科学与信息工程学院'];
const college = [this.college];
let queryParams = {
college: college,
@ -568,19 +589,19 @@
'#FAF0E6 ',
];
for (let i in data) {
console.log(i, 'i');
//console.log(i, 'i');
legendData.push(i);
let yData = [];
// legendData=[];
console.log(data[i], 'data[i]');
//console.log(data[i], 'data[i]');
for (let j in data[i]) {
console.log(data[i][j].college, 'data[i][j].college111');
//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');
//console.log(yData, 'yData');
seriesData.push({
name: i,
type: 'bar',
@ -672,8 +693,8 @@
series: seriesData,
};
// 使
console.log(option, 'option');
console.log(myChart, 'myChart');
//console.log(option, 'option');
//console.log(myChart, 'myChart');
this.loadingMap5 = false;
setTimeout(() => {
myChart.setOption(option);