import { reactive } from 'vue'

export type IAuthItem = {
  desc?: string
  name?: string
}

type IAnyObject = {
  [key: string]: any
}

export type IAuth = {
  teaching?: IAuthItem
  follow?: IAuthItem
  fingering?: IAuthItem
  switch?: IAuthItem
  speed?: IAuthItem
  evaluating?: IAuthItem
  excerpts?: IAuthItem
  recording?: IAuthItem
}

export type IAuthKey =
  | 'teaching'
  | 'follow'
  | 'fingering'
  | 'switch'
  | 'speed'
  | 'evaluating'
  | 'excerpts'
  | 'recording'

const state = reactive({
  modular: {
    teaching: false,
    follow: false,
    fingering: false,
    switch: false,
    speed: false,
    evaluating: false,
    excerpts: false,
    recording: false,
  },
  modularDetail: {
    teaching: {
      name: '大雅金唐教材',
      desc: '同步乐团学习教材，让孩子在专业系统的训练下提升演奏水平',
      images: ['./static/teaching/1.jpg', './static/teaching/2.jpg', './static/teaching/3.jpg'],
    },
    follow: {
      name: '五线谱跟播',
      desc: '将教材转化成五线谱，并支持音符根据播放进度高亮显示，增强孩子演奏乐感',
      images: ['./static/follow/1.jpg'],
    },
    fingering: {
      name: '演奏指法跟播',
      desc: '根据音符时值展现演奏指法，培养孩子良好的演奏习惯',
      images: ['./static/fingering/1.jpg', './static/fingering/2.jpg', './static/fingering/3.jpg'],
    },
    switch: {
      name: '原声/伴奏切换',
      desc: '为不同声部学员提供专业伴奏，支持伴奏与原音切换，声临其境的感受乐曲',
      images: ['./static/switch/1.jpg', './static/switch/2.jpg'],
    },
    speed: {
      name: '播放速度调整',
      desc: '播放速度课根据个人练习情况调整，循序渐进的掌握每首曲目的演奏',
      images: ['./static/speed/1.jpg', './static/speed/2.jpg'],
    },
    evaluating: {
      name: '智能评测',
      desc: '为孩子的演奏提供专业、标准的点评',
      images: ['./static/evaluating/1.jpg', './static/evaluating/2.jpg', './static/evaluating/3.jpg'],
    },
    excerpts: {
      name: '五线谱选段播放',
      desc: '根据练习情况选择重难点小节循环练习，帮助孩子突破难关',
      images: ['./static/excerpts/1.jpg'],
    },
    recording: {
      name: '边录边播',
      desc: '打开摄像头，可以在练习时看到自己的演奏状态，还可以录制演奏的视频或音频',
      images: [],
    },
  } as IAuth,
  openKey: '' as IAuthKey | '',
  user: null as any,
  subjectId: 0,
  subjectLoading: false,
  origanSubjectId: 0, // 原始用户声部
  subjectOptions: [{ value: 0, text: '全部声部' }] as any[],
  chinesePartName: {} as IAnyObject,
  MusicalInstrumentClassification: {} as IAnyObject,
  tenantId: null as any,
  organId: null as any,
  extSubjectIds: [] as any[], // 学生的扩展声部
  /** 客户端类型 */
  clintNmae: 'orchestra',
})

export default state
