修改学院对比样式

This commit is contained in:
Cool 2024-04-29 16:46:41 +08:00
parent 7cb5a9e2bb
commit 78d271d832
1 changed files with 95 additions and 45 deletions

View File

@ -5,8 +5,8 @@
<a-tab-pane key="1" tab="查询全校各学院通过率">
<div>
<div class="query">
<span
style="font-size: 15px; margin-right: 10px; display: flex; justify-content: center; align-items: center; font-weight: bold">年级:
<span style="font-size: 15px; margin-right: 10px; display: flex; justify-content: center; align-items: center; font-weight: bold"
>年级:
</span>
<a-select v-model:value="oneentrydate" style="width: 200px" :options="entrydateOptions"></a-select>
<a-button style="margin-left: 10px" type="primary" @click="allQuery">查询</a-button>
@ -35,17 +35,44 @@
<a-tab-pane key="2" tab="对比多学院" force-render>
<div>
<div class="query">
<span
style="font-size: 15px; margin-right: 10px; display: flex; justify-content: center; align-items: center; font-weight: bold">学院:
</span>
<a-select v-model:value="collegetab2" style="width: 300px; margin-right: 20px" mode="multiple"
:max-tag-count="5" :options="collegeOptions" @change="onCollegeChange"></a-select>
<span
style="font-size: 15px; margin-right: 10px; display: flex; justify-content: center; align-items: center; font-weight: bold">年级:
</span>
<a-select v-model:value="collegeentrydate" style="width: 200px" :options="entrydateOptions"
mode="multiple" :max-tag-count="5" @change="onCollegeChange"></a-select>
<a-button style="margin-left: 10px" type="primary" @click="collegeQuery">查询</a-button>
<div>
<div style="display: flex">
<span style="font-size: 15px; margin-right: 10px; display: flex; justify-content: center; align-items: center; font-weight: bold"
>年级:
</span>
<a-checkbox-group :options="entrydateOptions" v-model:value="collegeentrydate" @change="onCollegeEntrydateChange" />
</div>
<div style="display: flex; margin-top: 10px">
<span style="font-size: 15px; margin-right: 10px; display: flex; justify-content: center; align-items: center; font-weight: bold"
>学院:
</span>
<a-checkbox-group :options="collegeOptions" v-model:value="collegetab2" @change="onCollegeChange" />
</div>
<div style="margin-top: 20px; margin-right: 20px; display: flex; justify-content: flex-end; align-items: center">
<a-button style="margin-left: 10px" type="primary" @click="clearCollege">清除</a-button>
<a-button style="margin-left: 10px; " type="primary" @click="collegeQuery">查询</a-button>
</div>
</div>
<!-- <a-select
v-model:value="collegetab2"
style="width: 300px; margin-right: 20px"
mode="multiple"
:max-tag-count="5"
:options="collegeOptions"
@change="onCollegeChange"
></a-select> -->
<!-- <a-select
v-model:value="collegeentrydate"
style="width: 200px"
:options="entrydateOptions"
mode="multiple"
:max-tag-count="5"
@change="onCollegeChange"
></a-select> -->
</div>
<a-card title="按学院分析" :loading="tab2loading" :bordered="false">
@ -82,45 +109,35 @@
:max-tag-count="5" @change="onCollegeMajorChange"></a-select>
<a-button style="margin-left: 10px;" type="primary" @click="majorQuery">查询</a-button> -->
<div style="display: flex">
<span
style="font-size: 15px; margin-right: 10px; font-weight: bold; display: flex; justify-content: center; align-items: center">年级:
<span style="font-size: 15px; margin-right: 10px; font-weight: bold; display: flex; justify-content: center; align-items: center"
>年级:
</span>
<a-checkbox-group v-model:value="majorentrydate" :options="entrydateOptions"
@change="onMajorEntrydateChange" />
<a-checkbox-group v-model:value="majorentrydate" :options="entrydateOptions" @change="onMajorEntrydateChange" />
</div>
<div style="display: flex; margin-top: 10px">
<span
style="font-size: 15px; margin-right: 10px; font-weight: bold; display: flex; justify-content: center; align-items: center">学院:
<span style="font-size: 15px; margin-right: 10px; font-weight: bold; display: flex; justify-content: center; align-items: center"
>学院:
</span>
<a-radio-group v-model:value="collegeMajor" :options="collegeMajorOptions"
@change="onMajorCollegeChange" />
<a-radio-group v-model:value="collegeMajor" :options="collegeMajorOptions" @change="onMajorCollegeChange" />
</div>
<div style="display: flex; margin-top: 10px">
<span
style="font-size: 15px; margin-right: 10px; font-weight: bold; display: flex; justify-content: center; align-items: center">专业:
<span style="font-size: 15px; margin-right: 10px; font-weight: bold; display: flex; justify-content: center; align-items: center"
>专业:
</span>
<a-checkbox-group v-model:value="majorCheckOn" :options="majorOptions" @change="onCollegeMajorChange" />
</div>
<div style="margin-top: 10px">
<span
style="font-size: 15px; margin-right: 10px; font-weight: bold; display: flex; align-items: center">已选择:
<a-tag v-for="(item, index) in lastCollegeMajor" :key="item[1]"
style="margin-left: 10px; font-size: 13px;" color="blue">
<span style="font-size: 15px; margin-right: 10px; font-weight: bold; display: flex; align-items: center"
>已选择:
<a-tag v-for="(item, index) in lastCollegeMajor" :key="item[1]" style="margin-left: 10px; font-size: 13px" color="blue">
{{ item[1] }}
<a-icon type="close" style="font-size: 15px;" @click="removeTag(index)" />
<a-icon type="close" style="font-size: 15px" @click="removeTag(index)" />
</a-tag>
</span>
</div>
<div style="margin-top: 20px;margin-right: 20px;
display: flex;
justify-content: flex-end;
align-items: center;
">
<a-button style="margin-left: 10px;" type="primary" @click="clear">清除</a-button>
<a-button style="margin-left: 10px;" type="primary" @click="majorQuery">查询</a-button>
<div style="margin-top: 20px; margin-right: 20px; display: flex; justify-content: flex-end; align-items: center">
<a-button style="margin-left: 10px" type="primary" @click="clearMajor">清除</a-button>
<a-button style="margin-left: 10px" type="primary" @click="majorQuery">查询</a-button>
</div>
</div>
@ -254,9 +271,14 @@ export default {
entrydateOptions: [],
entrydate: [],
majorCheckOn: [],
//
lastCollegeMajor: [],
majorLength: 0,
majorOptions: [],
//
lastCollege: [],
//
lastCollegeEntrydate: [],
};
},
methods: {
@ -386,7 +408,7 @@ export default {
// });
// this.college = [''];
this.collegetab2 = ['地理科学学院', '文学院'];
// this.collegetab2 = ['', ''];
console.log(this.collegeOptions, 'collegeOptions');
});
},
@ -405,15 +427,37 @@ export default {
}
this.lastMajorEntrydate = value;
},
//
//
onCollegeChange(value) {
console.log(value, 'value');
if (value.length > 5) {
message.error('最多选择五个');
//value
value.pop();
//lastCollegevaluelastCollege
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('最多选择五个');
//lastCollegeEntrydatevaluelastCollegeEntrydate
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) {
@ -444,7 +488,7 @@ export default {
},
removeTag(index) {
if (this.majorCheckOn.includes(this.lastCollegeMajor[index][1])) {
let index1 = this.majorCheckOn.indexOf(this.lastCollegeMajor[index][1])
let index1 = this.majorCheckOn.indexOf(this.lastCollegeMajor[index][1]);
this.majorCheckOn.splice(index1, 1);
}
this.lastCollegeMajor.splice(index, 1);
@ -474,11 +518,17 @@ export default {
console.log(this.majorCheckOn, 'majorCheckOn');
},
clear() {
clearMajor() {
this.majorCheckOn = [];
this.lastCollegeMajor = [];
this.majorLength = 0;
},
clearCollege() {
this.collegetab2 = [];
this.collegeentrydate = [];
this.lastCollege = [];
this.lastCollegeEntrydate = [];
},
//tab2\3
drawChart(data, tab) {
let seriesData = [];
@ -936,7 +986,7 @@ export default {
const getEntrydate = await defHttp.get({ url: this.Url.getEntrydate });
this.entrydateOptions = getEntrydate.entrydates;
this.oneentrydate = this.entrydateOptions[0].value;
this.collegeentrydate = [this.entrydateOptions[0].value];
// this.collegeentrydate = [this.entrydateOptions[0].value];
this.majorentrydate = [this.entrydateOptions[0].value];
// this.entrydate.push (this.entrydateOptions[0].value);
},