interface Album { code?: string; title: string; artist: string; label: string; level?: string; __children?: Album[]; } interface MusicAward { code?: string; category: string; artist?: string | null; title?: string | null; label?: string | null; level?: string; __children: Album[]; } // 音乐类型 const categories = [ 'Best Rock Performance', 'Best Metal Performance', 'Best Pop Performance', 'Best Jazz Performance', 'Best Classical Performance', 'Best Electronic Performance', 'Best Hip Hop Performance', 'Best Country Performance', 'Best R&B Performance', 'Best Alternative Performance' ] // 艺术家名字 const artists = [ 'Alabama Shakes', 'Florence & The Machine', 'Foo Fighters', 'Elle King', 'Wolf Alice', 'Ghost', 'August Burns Red', 'Lamb Of God', 'Sevendust', 'Slipknot', 'Muse', 'James Bay', 'Death Cab For Cutie', 'Highly Suspect', 'Arctic Monkeys', 'The Killers', 'Imagine Dragons', 'Twenty One Pilots', 'Panic! At The Disco', 'Fall Out Boy', 'Paramore', 'Green Day', 'Blink-182', 'My Chemical Romance', 'Linkin Park', 'Coldplay', 'Radiohead', 'The Strokes', 'Kings of Leon', 'The Black Keys' ] // 歌曲标题 const titles = [ "Don't Wanna Fight", 'What Kind Of Man', 'Something From Nothing', "Ex's & Oh's", 'Moaning Lisa Smile', 'Cirice', 'Identity', '512', 'Thank You', 'Custer', 'Drones', 'Chaos And The Calm', 'Kintsugi', 'Mister Asylum', 'The Gray Chapter', 'Believer', 'Thunder', 'Radioactive', 'Demons', 'Warriors', 'High Hopes', 'Hey Look Ma I Made It', 'Victorious', 'King of the Clouds', 'Roaring 20s', 'Misery Business', 'Still Into You', 'Ain\'t It Fun', 'Hard Times', 'Rose-Colored Boy' ] // 唱片公司 const labels = [ 'ATO Records', 'Republic', 'RCA Records', 'Warner Bros. Records', 'Atlantic', 'Loma Vista Recordings', 'Fearless Records', 'Epic Records', '7Bros Records', 'Roadrunner Records', '300 Entertainment', 'Columbia Records', 'Interscope Records', 'Capitol Records', 'Universal Music', 'Sony Music', 'EMI Records', 'Def Jam', 'Island Records', 'Elektra Records' ] // 生成随机数据 const generateMockData = (count: number): MusicAward[] => { const data: MusicAward[] = [] for (let i = 0; i < count; i++) { const categoryIndex = i % categories.length const childrenCount = Math.floor(Math.random() * 8) + 3 // 3-10个子项 const children: Album[] = [] for (let j = 0; j < childrenCount; j++) { children.push({ code: `${String.fromCharCode(65 + categoryIndex)}${String(i + 1).padStart(3, '0')}-${j + 1}`, title: titles[Math.floor(Math.random() * titles.length)], artist: artists[Math.floor(Math.random() * artists.length)], label: labels[Math.floor(Math.random() * labels.length)], level: `${i}-${j + 1}`, }) } data.push({ code: `${String.fromCharCode(65 + categoryIndex)}${String(i + 1).padStart(3, '0')}`, category: categories[categoryIndex], artist: null, title: null, label: null, level: String(i), __children: children, }) } return data } export function sourceData(row: number){return generateMockData(row ?? 10)} export const sourceDataObject = generateMockData(10)