index.69074947.js 5.3 KB

1
  1. import{C as i}from"./index.2625baa0.js";import{r as p}from"./index.b0469f01.js";import{d as c,c as e,m as n,n as t,V as o,W as s,a as r,k as m,O as f,S as h,P as b,T as g,f as d}from"./vendor.e6623967.js";const V="_form_fvzbi_1";var y={form:V};function U(a){return typeof a=="function"||Object.prototype.toString.call(a)==="[object Object]"&&!g(a)}var v=c({name:"music-operation",data(){return{type:this.$route.query.type||"create",subjectList:[],form:{xmlFileUrl:"",hasBeat:0,mp3Url:"",bgmp3Url:"",musicSheetName:"",composer:"",vlewSubjectList:null,tags:[],canEvaluate:1,showFingering:1,chargeType:0}}},async mounted(){try{await p.get("/api-website/open/subject/subjectSelect").then(a=>{this.subjectList=a.data||[]})}catch{}},methods:{onSubmit(){this.$refs.form.validate(a=>{if(a)console.log(!0);else return this.$nextTick(()=>{document.getElementsByClassName("is-error")[0].scrollIntoView({block:"center",behavior:"smooth"})}),!1})}},render(){let a;return e("div",{class:y.form},[e("div",{class:"text-base text-[#333] leading-none px-6 py-5 border-b border-b-[#E5E5E5]"},[this.type==="create"?"\u65B0\u5EFA\u4E50\u8C31":"\u7F16\u8F91\u4E50\u8C31"]),e(n,{size:"large",labelPosition:"left",labelWidth:"120px",model:this.form,ref:"form",class:"px-52 py-5"},{default:()=>[e(t,{label:"MusicXML\u6587\u4EF6",prop:"xmlFileUrl",rules:[{required:!0,message:"\u8BF7\u9009\u62E9MusicXML\u6587\u4EF6"}]},{default:()=>[e(i,{modelValue:this.form.xmlFileUrl,"onUpdate:modelValue":l=>this.form.xmlFileUrl=l,bucket:"cloud-coach",accept:"application/xml",uploadType:"file",extraTips:"\u6587\u4EF6\u6700\u5927\u4E0D\u80FD\u8D85\u8FC75MB"},null)]}),e(t,{label:"\u662F\u5426\u5E26\u8282\u62CD\u5668",prop:"hasBeat",rules:[{required:!0,message:"\u8BF7\u9009\u62E9\u662F\u5426\u5E26\u8282\u62CD\u5668"}]},{default:()=>[e(o,{modelValue:this.form.hasBeat,"onUpdate:modelValue":l=>this.form.hasBeat=l},{default:()=>[e(s,{label:0,class:"mr-3 w-24"},{default:()=>[r("\u5426")]}),e(s,{label:1,class:"w-24"},{default:()=>[r("\u662F")]})]})]}),e(t,{label:"\u4F34\u594F\u6587\u4EF6",prop:"mp3Url"},{default:()=>[e(i,{modelValue:this.form.mp3Url,"onUpdate:modelValue":l=>this.form.mp3Url=l,bucket:"cloud-coach",accept:".mp3",uploadType:"file",extraTips:"\u6587\u4EF6\u6700\u5927\u4E0D\u80FD\u8D85\u8FC75MB"},null)]}),e(t,{label:"\u539F\u97F3\u6587\u4EF6",prop:"bgmp3Url",rules:[{required:!0,message:"\u8BF7\u9009\u62E9\u539F\u97F3\u6587\u4EF6"}]},{default:()=>[e(i,{modelValue:this.form.bgmp3Url,"onUpdate:modelValue":l=>this.form.bgmp3Url=l,bucket:"cloud-coach",accept:".mp3",uploadType:"file",extraTips:"\u6587\u4EF6\u6700\u5927\u4E0D\u80FD\u8D85\u8FC75MB"},null)]}),e(t,{label:"\u66F2\u76EE\u540D\u79F0",prop:"musicSheetName",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u66F2\u76EE\u540D\u79F0"}]},{default:()=>[e(m,{modelValue:this.form.musicSheetName,"onUpdate:modelValue":l=>this.form.musicSheetName=l,placeholder:"\u8BF7\u9009\u62E9\u66F2\u76EE\u540D\u79F0"},null)]}),e(t,{label:"\u4F5C\u66F2\u4EBA",prop:"composer",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4F5C\u66F2\u4EBA"}]},{default:()=>[e(m,{modelValue:this.form.composer,"onUpdate:modelValue":l=>this.form.composer=l,placeholder:"\u8BF7\u8F93\u5165\u4F5C\u66F2\u4EBA"},null)]}),e(t,{label:"\u66F2\u76EE\u58F0\u90E8",prop:"vlewSubjectList",rules:[{required:!0,message:"\u8BF7\u9009\u62E9\u66F2\u76EE\u58F0\u90E8",trigger:"change"}]},{default:()=>[e(f,{filterable:!0,modelValue:this.form.vlewSubjectList,"onUpdate:modelValue":l=>this.form.vlewSubjectList=l,placeholder:"\u8BF7\u9009\u62E9\u66F2\u76EE\u58F0\u90E8",class:"w-full"},U(a=this.subjectList.map(l=>e(h,{key:l.id,label:l.name},{default:()=>[l.subjects&&l.subjects.map(u=>e(b,{key:u.id,value:u.id,label:u.name},null))]})))?a:{default:()=>[a]})]}),e(t,{label:"\u66F2\u76EE\u6807\u7B7E",prop:"tags",rules:[{required:!0,message:"\u8BF7\u9009\u62E9\u66F2\u76EE\u6807\u7B7E"}]},{default:()=>[e(m,{modelValue:this.form.tags,"onUpdate:modelValue":l=>this.form.tags=l,placeholder:"\u8BF7\u8F93\u5165\u4E50\u8C31\u540D\u79F0"},null)]}),e(t,{label:"\u662F\u5426\u8BC4\u6D4B",prop:"canEvaluate",rules:[{required:!0,message:"\u8BF7\u9009\u62E9\u662F\u5426\u8BC4\u6D4B"}]},{default:()=>[e(o,{modelValue:this.form.canEvaluate,"onUpdate:modelValue":l=>this.form.canEvaluate=l},{default:()=>[e(s,{label:0,class:"mr-3 w-24"},{default:()=>[r("\u5426")]}),e(s,{label:1,class:"w-24"},{default:()=>[r("\u662F")]})]})]}),e(t,{label:"\u6307\u6CD5\u5C55\u793A",prop:"showFingering",rules:[{required:!0,message:"\u8BF7\u9009\u62E9\u6307\u6CD5\u5C55\u793A"}]},{default:()=>[e(o,{modelValue:this.form.showFingering,"onUpdate:modelValue":l=>this.form.showFingering=l},{default:()=>[e(s,{label:0,class:"mr-3 w-24"},{default:()=>[r("\u5426")]}),e(s,{label:1,class:"w-24"},{default:()=>[r("\u662F")]})]})]}),e(t,{label:"\u662F\u5426\u6536\u8D39",prop:"chargeType",rules:[{required:!0,message:"\u8BF7\u9009\u62E9\u662F\u5426\u6536\u8D39"}]},{default:()=>[e(o,{modelValue:this.form.chargeType,"onUpdate:modelValue":l=>this.form.chargeType=l},{default:()=>[e(s,{label:0,class:"mr-3 w-24"},{default:()=>[r("\u5426")]}),e(s,{label:1,class:"w-24"},{default:()=>[r("\u662F")]})]})]})]}),e("div",{class:"border-t border-t-[#E5E5E5] text-center pt-6 pb-7"},[e(d,{class:"!w-40 !h-[38px]",onClick:()=>{this.$router.back()}},{default:()=>[r("\u53D6\u6D88")]}),e(d,{type:"primary",class:"!w-40 !h-[38px]",onClick:this.onSubmit},{default:()=>[r("\u63D0\u4EA4\u5BA1\u6838")]})])])}});export{v as default};