import ColUpload from '@/components/col-upload' import request from '@/helpers/request' import { ElButton, ElForm, ElFormItem, ElInput, ElOption, ElOptionGroup, ElRadioButton, ElRadioGroup, ElSelect } from 'element-plus' import { defineComponent } from 'vue' import styles from './index.module.less' export default defineComponent({ name: 'music-operation', data() { const query = this.$route.query return { type: query.type || 'create', subjectList: [], form: { xmlFileUrl: '', hasBeat: 0, mp3Url: '', bgmp3Url: '', musicSheetName: '', composer: '', vlewSubjectList: null as any, tags: [] as string[], canEvaluate: 1, showFingering: 1, chargeType: 0 } } }, async mounted() { try { await request.get('/api-website/open/subject/subjectSelect').then(res => { this.subjectList = res.data || [] // console.log(this.subjectList) // this.subjectListNames = this.getSubjectListNames(teacherState.subjectList) }) } catch {} }, methods: { onSubmit() { ;(this as any).$refs.form.validate((valid: any) => { if (valid) { console.log(true) } else { this.$nextTick(() => { let isError = document.getElementsByClassName('is-error') isError[0].scrollIntoView({ block: 'center', behavior: 'smooth' }) }) return false } }) } }, render() { return (