|
|
@@ -21,7 +21,7 @@
|
|
|
:style="`background-color:${classesColor[item.id]}`"
|
|
|
v-for="item in showClassesList"
|
|
|
:key="item.id"
|
|
|
- >{{ item.name }}</div
|
|
|
+ >{{ item.name }} </div
|
|
|
>
|
|
|
<div
|
|
|
class="item"
|
|
|
@@ -127,7 +127,7 @@ export default {
|
|
|
this.search = debounce(500, this.search);
|
|
|
this.init();
|
|
|
await this.getBc();
|
|
|
- this.configColor();
|
|
|
+
|
|
|
},
|
|
|
methods: {
|
|
|
// 初始化数据
|
|
|
@@ -337,6 +337,7 @@ export default {
|
|
|
// 配置颜色
|
|
|
configColor() {
|
|
|
this.classesList.forEach((element, index) => {
|
|
|
+ console.log(element.id)
|
|
|
this.$set(this.classesColor, element.id, this.colorList[index]);
|
|
|
});
|
|
|
},
|
|
|
@@ -374,7 +375,10 @@ export default {
|
|
|
)})`
|
|
|
};
|
|
|
});
|
|
|
- const len = Math.round(this.classesList.length/5)
|
|
|
+
|
|
|
+ let len = Math.round(this.classesList.length/5)
|
|
|
+ len == 0 ? len = 1 : len
|
|
|
+
|
|
|
const color = [
|
|
|
'#fb6f7b',
|
|
|
'#f59a23',
|
|
|
@@ -387,6 +391,8 @@ export default {
|
|
|
this.colorList = this.colorList.concat(color)
|
|
|
}
|
|
|
this.showClassesList = this.classesList;
|
|
|
+
|
|
|
+ this.configColor();
|
|
|
});
|
|
|
},
|
|
|
// 搜索
|