添加院领导首页数据的加载效果

This commit is contained in:
YuNan 2025-01-14 16:00:00 +08:00
parent 2b83ad54a3
commit 8f96b9ba85
1 changed files with 32 additions and 24 deletions

View File

@ -28,32 +28,33 @@
bordered bordered
class="custom-table" class="custom-table"
:style="{ fontSize: '10px', color: '#333', marginTop: '-11px' }" :style="{ fontSize: '10px', color: '#333', marginTop: '-11px' }"
:loading="loadingTable"
/> />
</div> </div>
</a-card-grid> </a-card-grid>
<a-card-grid class="card-center"> <a-card class="card-center" :loading="loadingMap2">
<div style="width: 100%; height: 210px; padding: 10px" class="map2" id="map2"></div> <div style="width: 100%; height: 210px; padding: 10px" class="map2" id="map2"></div>
</a-card-grid> </a-card>
<a-card-grid class="card-center"> <a-card class="card-center" :loading="loadingMap3">
<a-select <a-select
v-model:value="entrydate" v-model:value="entrydate"
style="border-radius: 10%; width: 100px; margin-left: -20px" style="border-radius: 10%; width: 100px; margin-left: 220px"
:options="entrydateOptions" :options="entrydateOptions"
@change="handleSelectChange" @change="handleSelectChange"
/> />
<div id="map3" style="width: 100%; height: 230px"></div> <div id="map3" style="width: 100%; height: 230px"></div>
</a-card-grid> </a-card>
</a-row> </a-row>
<a-row :gutter="1"> <a-row :gutter="1">
<a-card-grid class="card-bottom" style="width: 32%"> <a-card class="card-bottom" style="width: 32%" :loading="loadingMap4">
<div id="map4" style="width: 100%; height: 100%"></div> <div id="map4" style="width: 100%; height: 300%"></div>
</a-card-grid> </a-card>
<a-card-grid style="width: 65%" class="card-bottom"> <a-card style="width: 65%" class="card-bottom" :loading="loadingMap5">
<div id="map5" style="width: 100%; height: 100%"></div> <div id="map5" style="width: 100%; height: 300%"></div>
</a-card-grid> </a-card>
</a-row> </a-row>
</a-card> </a-card>
</template> </template>
@ -70,6 +71,11 @@
collegeStudentPassRate: '11', collegeStudentPassRate: '11',
schoolStudentPassRate: '11', schoolStudentPassRate: '11',
loading: false, loading: false,
loadingTable: false,
loadingMap2: false,
loadingMap3: false,
loadingMap4: false,
loadingMap5: false,
dataSourceCet4: [], dataSourceCet4: [],
batch: '', batch: '',
college: '', college: '',
@ -120,13 +126,9 @@
this.queryMajorByCollege(); this.queryMajorByCollege();
}, },
methods: { methods: {
//
async queryTopData() {
let result = await defHttp.get({ url: this.Url.getDataForHead });
console.log('0000', result.data);
},
// //
async query() { async query() {
this.loadingTable = true;
let resultData = null; let resultData = null;
try { try {
//this.batchnull //this.batchnull
@ -136,7 +138,6 @@
if (!this.college) { if (!this.college) {
this.college = '计算机科学与信息工程学院'; this.college = '计算机科学与信息工程学院';
} }
this.loading = true;
let params = { let params = {
batch: this.batch, batch: this.batch,
college: this.college, college: this.college,
@ -158,7 +159,7 @@
this.dataSourceCet4 = tableData; // this.dataSourceCet4 = tableData; //
console.log(this.dataSourceCet4, 'dataSourceCet4'); console.log(this.dataSourceCet4, 'dataSourceCet4');
} finally { } finally {
this.loading = false; this.loadingTable = false;
this.$nextTick(() => { this.$nextTick(() => {
//this.dataChart(resultData.data); //this.dataChart(resultData.data);
console.log('cet4:', resultData.data); console.log('cet4:', resultData.data);
@ -167,6 +168,7 @@
} }
}, },
async queryMajorByCollege() { async queryMajorByCollege() {
this.loadingMap5 = true;
if (!this.college) { if (!this.college) {
this.college = '计算机科学与信息工程学院'; this.college = '计算机科学与信息工程学院';
} }
@ -193,12 +195,14 @@
console.log('666'); console.log('666');
let res = await defHttp.post({ url: this.Url.getRateByMajor, params }); 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.$nextTick(() => {
this.drawChart(res.data); this.drawChart(res.data);
}); });
}, },
//-- //--
async card_Table() { async card_Table() {
this.loadingMap2 = true;
//console.log(this.passRatePie); //console.log(this.passRatePie);
//console.log('piedata', piedata); //console.log('piedata', piedata);
//this.batchnull //this.batchnull
@ -320,16 +324,19 @@
], ],
animationDurationUpate: 500, animationDurationUpate: 500,
}; };
this.loadingMap2 = false;
this.$nextTick(() => { this.$nextTick(() => {
var myChart = echarts.init(document.getElementById('map2')); var myChart = echarts.init(document.getElementById('map2'));
myChart.setOption(option); myChart.setOption(option);
}); });
}, },
handleSelectChange() { handleSelectChange() {
this.loadingMap3 = true;
this.majorPassRate(); this.majorPassRate();
}, },
// -map3--------------------------------------------- // -map3---------------------------------------------
async majorPassRate() { async majorPassRate() {
this.loadingMap3 = true;
console.log('55555555', this.entrydate); console.log('55555555', this.entrydate);
if (!this.batch) { if (!this.batch) {
this.batch = '2024-06-01'; this.batch = '2024-06-01';
@ -337,7 +344,6 @@
if (!this.college) { if (!this.college) {
this.college = ['计算机科学与信息工程学院']; this.college = ['计算机科学与信息工程学院'];
} }
this.map3loading = true;
//entrydate //entrydate
let entrydateArray = []; let entrydateArray = [];
entrydateArray.push(this.entrydate); entrydateArray.push(this.entrydate);
@ -428,15 +434,15 @@
], ],
animationDurationUpdate: 500, animationDurationUpdate: 500,
}; };
this.map3loading = false; this.loadingMap3 = false;
this.$nextTick(() => { this.$nextTick(() => {
var myChart = echarts.init(document.getElementById('map3')); var myChart = echarts.init(document.getElementById('map3'));
myChart.setOption(majorOption); myChart.setOption(majorOption);
}); });
}, },
// // map4
async gradePassRate() { async gradePassRate() {
this.map2loading = true; this.loadingMap4 = true;
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;
let entrydate = this.entrydateOptions.map((item) => item.value); let entrydate = this.entrydateOptions.map((item) => item.value);
@ -500,14 +506,15 @@
animationDurationUpdate: 500, animationDurationUpdate: 500,
}; };
this.map2loading = false; this.loadingMap4 = false;
this.$nextTick(() => { this.$nextTick(() => {
var myChart = echarts.init(document.getElementById('map4')); var myChart = echarts.init(document.getElementById('map4'));
myChart.setOption(collegeOption); myChart.setOption(collegeOption);
}); });
}, },
// //map5
drawChart(data) { drawChart(data) {
this.loadingMap5 = true;
let seriesData = []; let seriesData = [];
let xData = this.majorentrydate.sort((a, b) => a - b); let xData = this.majorentrydate.sort((a, b) => a - b);
let k = 0; let k = 0;
@ -667,6 +674,7 @@
// 使 // 使
console.log(option, 'option'); console.log(option, 'option');
console.log(myChart, 'myChart'); console.log(myChart, 'myChart');
this.loadingMap5 = false;
setTimeout(() => { setTimeout(() => {
myChart.setOption(option); myChart.setOption(option);
}, 1); }, 1);