前端修改

This commit is contained in:
hh 2024-03-27 18:26:50 +08:00
parent a3a14d4ccc
commit daff63566b
3 changed files with 50 additions and 43 deletions

View File

@ -1,6 +1,6 @@
<template> <template>
<div style="background: #ececec; padding: 25px"> <div style="background: #ececec; padding: 25px">
<a-card title="按学院分析" :bordered="false"> <a-card title="按学院分析" :loading="loading" :bordered="false">
<template #extra> <template #extra>
<!-- <a-select v-model:value="college" style="width: 300px" :options="collegeOptions"></a-select> --> <!-- <a-select v-model:value="college" style="width: 300px" :options="collegeOptions"></a-select> -->
<a-select v-model:value="batch" style="margin-left: 10px;width: 120px" :options="batchOptions"></a-select> <a-select v-model:value="batch" style="margin-left: 10px;width: 120px" :options="batchOptions"></a-select>
@ -31,6 +31,7 @@ export default {
getCollege: '/cet/getCollege', getCollege: '/cet/getCollege',
getRate: '/cet/getRateByBatch' getRate: '/cet/getRateByBatch'
}, },
loading: false,
collegeOptions: [], collegeOptions: [],
batchOptions: [], batchOptions: [],
levelOptions: [ levelOptions: [
@ -43,7 +44,7 @@ export default {
}; };
}, },
methods: { methods: {
map1Chart() { dataChart() {
// domecharts main // domecharts main
let myChart = echarts.init(document.getElementById("map1")); let myChart = echarts.init(document.getElementById("map1"));
// //
@ -110,17 +111,21 @@ export default {
}, },
// //
async query() { async query() {
this.loading = true;
let params = { let params = {
batch: this.batch, batch: this.batch,
level: 'cet4' level: 'cet4'
} }
const data = await defHttp.get({ url: this.Url.getRate, params }); const data = await defHttp.get({ url: this.Url.getRate, params });
this.$message.info(`查询结果:${JSON.stringify(data)}`); this.loading = false;
this.$nextTick(() => {
this.dataChart();
})
} }
}, },
mounted() { mounted() {
this.getBatch(); this.getBatch();
this.map1Chart(); this.dataChart();
} }
} }

View File

@ -1,19 +1,21 @@
<template> <template>
<div style="background: #ececec; padding: 25px"> <div style="background: #ececec; padding: 25px">
<a-card title="按学院分析" :bordered="false"> <a-card title="按批次分析" :loading="loading" :bordered="false">
<template #extra> <template #extra>
<!-- <a-select v-model:value="college" style="width: 300px" :options="collegeOptions"></a-select> --> <a-select v-model:value="college" style="width: 300px" :options="collegeOptions"></a-select>
<a-select v-model:value="batch" style="margin-left: 10px;width: 120px" :options="batchOptions"></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="level" style="margin-left: 10px;width: 120px" :options="levelOptions"></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"> <div>
<a-col :xl="24" :style="{ marginBottom: '24px' }"> <a-row :gutter="24">
<div class="container"> <a-col :xl="24" :style="{ marginBottom: '24px' }">
<div id="map1" style="width: 660px; height: 400px;"></div> <div class="container">
</div> <div id="map1" style="width: 660px; height: 400px;"></div>
</a-col> </div>
</a-row> </a-col>
</a-row>
</div>
</a-card> </a-card>
</div> </div>
</template> </template>
@ -29,8 +31,9 @@ export default {
Url: { Url: {
getBatch: '/cet/getBatch', getBatch: '/cet/getBatch',
getCollege: '/cet/getCollege', getCollege: '/cet/getCollege',
getRate: '/cet/getRateByBatch' getRate: '/cet/getRateByCollege'
}, },
loading: false,
collegeOptions: [], collegeOptions: [],
batchOptions: [], batchOptions: [],
levelOptions: [ levelOptions: [
@ -43,7 +46,7 @@ export default {
}; };
}, },
methods: { methods: {
map1Chart() { dataChart() {
// domecharts main // domecharts main
let myChart = echarts.init(document.getElementById("map1")); let myChart = echarts.init(document.getElementById("map1"));
// //
@ -95,32 +98,34 @@ export default {
// //
async getBatch() { async getBatch() {
const getBatch = await defHttp.get({ url: this.Url.getBatch }); const getBatch = await defHttp.get({ url: this.Url.getBatch });
// const getCollege = await defHttp.get({ url: this.Url.getCollege }); const getCollege = await defHttp.get({ url: this.Url.getCollege });
// this.collegeOptions = getCollege.colleges; this.collegeOptions = getCollege.colleges;
// this.college = this.collegeOptions[0].value;
// this.collegeOptions.unshift({ value: '', label: '' });
// this.college = this.collegeOptions[0].value;
this.batchOptions = getBatch.batches; // this.batchOptions = getBatch.batches;
this.batch = this.batchOptions[0].value; // this.batch = this.batchOptions[0].value;
this.level = this.levelOptions[0].value; this.level = this.levelOptions[0].value;
this.query(); // this.query();
}, },
// //
async query() { async query() {
this.loading = true;
let params = { let params = {
batch: this.batch, college: this.college,
level: 'cet4' level: 'cet4'
} }
const data = await defHttp.get({ url: this.Url.getRate, params }); const data = await defHttp.get({ url: this.Url.getRate, params });
this.$message.info(`查询结果:${JSON.stringify(data)}`); this.loading = false;
this.$nextTick(() => {
this.dataChart();
})
} }
}, },
mounted() { mounted() {
this.getBatch(); this.getBatch();
this.map1Chart(); this.dataChart();
} }
} }

View File

@ -1,6 +1,6 @@
<template> <template>
<div style="background: #ececec; padding: 25px"> <div style="background: #ececec; padding: 25px">
<a-card title="四级总通过率查询" :bordered="false"> <a-card title="四级总通过率查询" :bordered="false">
<template #extra> <template #extra>
<a-select v-model:value="college" style="width: 300px" :options="collegeOptions"></a-select> <a-select v-model:value="college" style="width: 300px" :options="collegeOptions"></a-select>
<a-select v-model:value="entrydate" style="margin-left: 10px;width: 100px" <a-select v-model:value="entrydate" style="margin-left: 10px;width: 100px"
@ -8,19 +8,16 @@
<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="24">
<a-col :xl="12" :style="{ marginBottom: '24px' }"> <a-col :xl="12">
<a-table :dataSource="dataSourceCet4" bordered :columns="columns" :pagination='false'> <div style="padding-left: 10px;min-height: 400px;">
<template #title> <a-table :dataSource="dataSourceCet4" :columns="columns" :pagination='false'>
<span style="font-size: 20px;font-weight:bold">四级成绩分析</span> <template #title>
</template> <span style="font-size: 15px;float: right;" v-if="total && total > 0">
</a-table> 学院总人数: {{ total }}
</a-col> </span>
<a-col :xl="12" :style="{ marginBottom: '24px' }"> </template>
<a-table :dataSource="dataSourceCet6" bordered :columns="columns" :pagination='false'> </a-table>
<template #title> </div>
<span style="font-size: 20px;font-weight:bold">六级成绩分析</span>
</template>
</a-table>
</a-col> </a-col>
</a-row> </a-row>
</a-card> </a-card>
@ -36,7 +33,6 @@ export default {
data() { data() {
return { return {
dataSourceCet4: [], dataSourceCet4: [],
dataSourceCet6: [],
columns: [ columns: [
{ {
title: '年级', title: '年级',
@ -64,6 +60,7 @@ export default {
getCollege: '/cet/getCollege', getCollege: '/cet/getCollege',
getData: '/cet/getData' getData: '/cet/getData'
}, },
total: 0,
collegeOptions: [], collegeOptions: [],
entrydateOptions: [], entrydateOptions: [],
college: null, college: null,
@ -90,7 +87,7 @@ export default {
} }
const result = await defHttp.get({ url: this.Url.getData, params }); const result = await defHttp.get({ url: this.Url.getData, params });
this.dataSourceCet4 = result.data.cet4; this.dataSourceCet4 = result.data.cet4;
this.dataSourceCet6 = result.data.cet6; this.total = result.data.total;
} }
}, },
mounted() { mounted() {