import { reactive } from 'vue'

const original = () => {
  return {
    groupId: 0,
    active: 0,
    tabIndex: 1,
    loadingStatus: false,
    rate: 0, // 手续费
    subjectList: [], // 声部列表
    templateList: [
      'https://ks3-cn-beijing.ksyuncs.com/video-course/1657853010619green.png',
      'https://ks3-cn-beijing.ksyuncs.com/video-course/1657853051064gray.png',
      'https://ks3-cn-beijing.ksyuncs.com/video-course/1657853062314yellow.png',
      'https://ks3-cn-beijing.ksyuncs.com/video-course/1657853076136linear.png'
    ], // 模板列表
    lessonGroup: {
      id: null,
      lessonName: '',
      lessonSubject: null as any,
      lessonDesc: '',
      lessonPrice: null as any,
      lessonCoverUrl: '',
      relationType: 'RECOMMEND',
      lessonCoverTemplateUrl: ''
    } as any,
    lessonList: [
      // {
      //   videoTitle: '',
      //   videoContent: '',
      //   videoUrl: '',
      //   coverUrl: '',
      //   relationList: [],
      //   posterUrl: '' // 视频封面图
      // }
    ] as any
  }
}

export const createState = reactive(original())

// 重置对象
export const resestState = () => {
  Object.assign(createState, original())
}
