前端修改

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

View File

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

View File

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