- {{ item.label }}
+ {{ item.label }}
@@ -38,7 +38,7 @@
@@ -139,6 +139,7 @@
selectedLabel: '全校',
currentSubMenu: [],
currentSubSubMenu: [],
+ losefocus: false,
//测试构造数据
//menuData: [
// { key: '1', label: '全校' },
@@ -342,6 +343,9 @@
this.getEntrydate();
},
methods: {
+ loseFocus() {
+ this.dropdownVisible = false;
+ },
toggleDropdown() {
this.dropdownVisible = !this.dropdownVisible;
this.subMenuVisible = false;
@@ -519,17 +523,30 @@
'#FAF0E6 ',
];
let j = 0;
-
- for (let i in data) {
+ //过滤掉不需要的数据
+ let filteredData = [];
+ if (this.selectedLabel === '全校(不含艺体美外语)') {
+ for (let i in data) {
+ // 过滤函数
+ filteredData[i] = data[i].filter((college) => {
+ return !['体育科学学院', '美术学院', '音乐学院'].includes(college.college);
+ });
+ }
+ } else {
+ filteredData = data;
+ }
+ console.log('filteredData', filteredData);
+ for (let i in filteredData) {
xData = [];
let yData = [];
- for (let key in data[i]) {
- xData.push(data[i][key].college);
+ for (let key in filteredData[i]) {
+ xData.push(filteredData[i][key].college);
// 将数据转换为百分比(加上%)
- yData.push(data[i][key].passRate);
+ yData.push(filteredData[i][key].passRate);
}
-
+ console.log('xData', xData);
xData = xData.map((label) => label.split('').join('\n')); //将x轴竖着展示
+
seriesData.push({
name: i + '级累计总通过率',
type: 'bar',
@@ -1151,7 +1168,7 @@
display: inline-block;
}
.dropdown-trigger {
- width: 160px; /* ✅ 设置选择框宽度 */
+ width: 190px; /* ✅ 设置选择框宽度 */
height: 32px;
border: 1px solid #ccc; /* ✅ 添加边框 */
padding: 6px 12px;
- {{ subItem.label }}
+ {{ subItem.label }}