feature/1.0版本页面优化 #1

Merged
Xubx merged 19 commits from feature/1.0版本页面优化 into DEV 2024-12-10 13:53:08 +08:00
1 changed files with 208 additions and 0 deletions
Showing only changes of commit 5610e30c11 - Show all commits

View File

@ -79,7 +79,37 @@
import { defHttp } from '/@/utils/http/axios'; import { defHttp } from '/@/utils/http/axios';
import * as echarts from 'echarts'; import * as echarts from 'echarts';
import { message } from 'ant-design-vue'; import { message } from 'ant-design-vue';
import { defHttp } from '/@/utils/http/axios';
import * as echarts from 'echarts';
import { message } from 'ant-design-vue';
export default {
data() {
return {
activeKey: '1',
allCollege: [],
showBox: false,
showGroup: false,
oneentrydate: null,
collegeentrydate: [],
majorentrydate: [],
lastMajorEntrydate: [],
checkedOptions: [],
collegetab2: [],
collegeMajorOptions: [],
collegeMajor: [],
Url: {
getBatch: '/cet/getBatch',
getEntrydate: '/cet/getEntrydate',
getCollege: '/cet/getCollege',
getCollegeRate: '/cet/getRateByCollege',
getAllRate: '/cet/getAllRate',
getCollegeMajor: '/cet/getCollegeMajor',
getRateByMajor: '/cet/getRateByMajor',
},
tab1loading: false,
tab2loading: false,
tab3loading: false,
export default { export default {
data() { data() {
return { return {
@ -203,6 +233,26 @@
} }
}, },
//
async getCollegeMajorData() {
const res = await defHttp.get({ url: this.Url.getCollegeMajor });
//map
this.collegeMajorOptions = res.collegeMajor.map((item) => {
return {
value: item.college,
label: item.college,
children: item.major.map((major) => {
return {
value: major,
label: major,
};
}),
};
});
// this.collegeMajor = [''];
console.log(this.collegeMajor, 'collegeMajor');
console.log(this.collegeMajorOptions, 'collegeMajorOptions1');
},
// //
async getCollegeMajorData() { async getCollegeMajorData() {
const res = await defHttp.get({ url: this.Url.getCollegeMajor }); const res = await defHttp.get({ url: this.Url.getCollegeMajor });
@ -224,11 +274,20 @@
console.log(this.collegeMajorOptions, 'collegeMajorOptions1'); console.log(this.collegeMajorOptions, 'collegeMajorOptions1');
}, },
getCollegeOptions() {
defHttp.get({ url: this.Url.getCollege }).then((res) => {
this.collegeOptions = res.colleges;
//
getCollegeOptions() { getCollegeOptions() {
defHttp.get({ url: this.Url.getCollege }).then((res) => { defHttp.get({ url: this.Url.getCollege }).then((res) => {
this.collegeOptions = res.colleges; this.collegeOptions = res.colleges;
// //
// this.collegeOptions.unshift({ value: '', label: '' });
// this.collegeOptions.forEach(option => {
// if (option.value !== '') {
// option.disabled = true;
//}
// this.collegeOptions.unshift({ value: '', label: '' }); // this.collegeOptions.unshift({ value: '', label: '' });
// this.collegeOptions.forEach(option => { // this.collegeOptions.forEach(option => {
// if (option.value !== '') { // if (option.value !== '') {
@ -324,6 +383,117 @@
this.majorLength--; this.majorLength--;
}, },
// //
onMajorCollegeChange(value) {
let val = value.target.value;
console.log(val, 'value');
console.log(this.collegeMajorOptions.find((item) => item.value == val).children, 'majorOptions');
this.majorOptions = this.collegeMajorOptions.find((item) => item.value == val).children;
//this.majorCheckOnthis.lastCollegeMajorthis.lastCollegeMajorthis.majorCheckOn,
// for (let i = 0; i < this.majorCheckOn.length; i++) {
// if (!this.lastCollegeMajor.includes(this.majorCheckOn[i])) {
// this.lastCollegeMajor.push(this.majorCheckOn[i]);
// }
// }
// for (let i = 0; i < this.lastCollegeMajor.length; i++) {
// if (!this.majorCheckOn.includes(this.lastCollegeMajor[i])) {
// this.lastCollegeMajor.splice(i, 1);
// console.log("splice")
// }
// }
// this.lastCollegeMajor = this.majorCheckOn;
console.log(this.lastCollegeMajor, 'lastCollegeMajor');
this.majorCheckOn = this.lastCollegeMajor.map((item) => item[1]);
console.log(this.majorCheckOn, 'majorCheckOn');
},
// });
// this.college = [''];
// this.collegetab2 = ['', ''];
console.log(this.collegeOptions, 'collegeOptions');
});
},
onMajorEntrydateChange(value) {
console.log(value, 'value');
if (value.length > 5) {
//valuethis.lastMajorEntrydate
for (let i = 0; i < value.length; i++) {
if (!this.lastMajorEntrydate.includes(value[i])) {
message.error('最多选择五个');
//value[i]
value.splice(i, 1);
return;
}
}
}
this.lastMajorEntrydate = value;
},
//
onCollegeChange(value) {
console.log(value, 'value');
if (value.length > 5) {
message.error('最多选择五个');
//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) {
//valuethis.lastCollegeMajorvaluethis.lastCollegeMajor,this.majorOptionsthis.lastCollegeMajorvalue
for (let i = 0; i < value.length; i++) {
if (!this.lastCollegeMajor.map((item) => item[1]).includes(value[i])) {
if (this.majorLength == 5) {
message.error('最多选择五个');
//valuevalue[i]
value.splice(i, 1);
return;
}
this.lastCollegeMajor.push([this.collegeMajor, value[i]]);
this.majorLength++;
}
}
for (let i = 0; i < this.lastCollegeMajor.length; i++) {
if (!value.includes(this.lastCollegeMajor[i][1])) {
//this.majorOptions
if (this.majorOptions.find((item) => item.value == this.lastCollegeMajor[i][1])) {
this.lastCollegeMajor.splice(i, 1);
console.log('splice');
this.majorLength--;
}
}
}
console.log(value, 'value');
},
removeTag(index) {
if (this.majorCheckOn.includes(this.lastCollegeMajor[index][1])) {
let index1 = this.majorCheckOn.indexOf(this.lastCollegeMajor[index][1]);
this.majorCheckOn.splice(index1, 1);
}
this.lastCollegeMajor.splice(index, 1);
this.majorLength--;
},
//
onMajorCollegeChange(value) { onMajorCollegeChange(value) {
let val = value.target.value; let val = value.target.value;
console.log(val, 'value'); console.log(val, 'value');
@ -347,6 +517,20 @@
console.log(this.majorCheckOn, 'majorCheckOn'); console.log(this.majorCheckOn, 'majorCheckOn');
}, },
clearMajor() {
this.majorCheckOn = [];
this.lastCollegeMajor = [];
this.majorLength = 0;
},
clearCollege() {
this.collegetab2 = [];
this.collegeentrydate = [];
this.lastCollege = [];
this.lastCollegeEntrydate = [];
},
//tab2\3
drawChart(data, tab) {
let seriesData = [];
clearMajor() { clearMajor() {
this.majorCheckOn = []; this.majorCheckOn = [];
this.lastCollegeMajor = []; this.lastCollegeMajor = [];
@ -754,7 +938,21 @@
border-radius: 4px; border-radius: 4px;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.09); box-shadow: 0 2px 8px rgba(0, 0, 0, 0.09);
} }
.container {
display: flex;
background-color: #fff;
padding: 15px;
border-radius: 4px;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.09);
}
.query {
//
display: flex;
justify-content: flex-start;
align-items: center;
margin-left: 24px;
}
.query { .query {
// //
display: flex; display: flex;
@ -763,6 +961,11 @@
margin-left: 24px; margin-left: 24px;
} }
.tab3 {
justify-content: flex-start;
align-items: center;
margin-left: 24px;
}
.tab3 { .tab3 {
justify-content: flex-start; justify-content: flex-start;
align-items: center; align-items: center;
@ -774,4 +977,9 @@
color: rgb(8, 8, 8); color: rgb(8, 8, 8);
font-weight: bold; font-weight: bold;
} }
.title {
font-size: 34px;
color: rgb(8, 8, 8);
font-weight: bold;
}
</style> </style>