|
@@ -74,17 +74,21 @@ export default defineComponent({
|
|
|
const _list = Array.from(
|
|
|
new Set(data.value.map(item => item.musicGroupName))
|
|
|
);
|
|
|
+ let index = 0;
|
|
|
const obj: { [_key: string]: { text: string; color: string } } =
|
|
|
_list.reduce(
|
|
|
(
|
|
|
obj: { [_key: string]: { text: string; color: string } },
|
|
|
- value: string,
|
|
|
- index: number
|
|
|
+ value: string
|
|
|
) => {
|
|
|
+ if (index > colors.length - 1) {
|
|
|
+ index = 0;
|
|
|
+ }
|
|
|
obj[value] = {
|
|
|
text: value,
|
|
|
color: colors[index]
|
|
|
};
|
|
|
+ index++;
|
|
|
return obj;
|
|
|
},
|
|
|
{}
|