import { reactive } from 'vue'

const original = () => {
  return {
    groupId: 0,
    active: 0,
    tabIndex: 1,
    loadingStatus: false,
    rate: 0, // 手续费
    video_account_period: 0, //平台账期
    subjectList: [], // 声部列表
    templateList: [
      'https://oss.dayaedu.com/video-course/1657853010619green.png',
      'https://oss.dayaedu.com/video-course/1657853051064gray.png',
      'https://oss.dayaedu.com/video-course/1657853062314yellow.png',
      'https://oss.dayaedu.com/video-course/1657853076136linear.png'
    ], // 模板列表
    lessonGroup: {
      id: null,
      lessonName: '',
      lessonSubject: null as any,
      lessonDesc: '',
      payType: 'PAY',
      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())
}
