subject-song.ca3f9945.js 2.2 KB

1
  1. import{d as a,y as n,j as e,A as l,aS as r,$ as m}from"./ResizeObserver.es.39b48a47.js";import{C as i}from"./index.db115763.js";import{C as b}from"./index.9f5e14d1.js";import"./index.b8eefd8d.js";import{S as h}from"./index.608320e9.js";import{I as d}from"./index.fcbcb027.js";import{C as j}from"./index.970ad07b.js";import{P as p}from"./index.6617ac99.js";const f="_subjectSong_hub7a_1",I="_subjectSearch_hub7a_7",S="_cellGroup_hub7a_12",_="_musicPic_hub7a_24",v="_musicName_hub7a_32",C="_labelClass_hub7a_38";var c={subjectSong:f,subjectSearch:I,cellGroup:S,musicPic:_,musicName:v,labelClass:C};function w(t){return typeof t=="function"||Object.prototype.toString.call(t)==="[object Object]"&&!m(t)}var V=a({name:"subject-song",data(){const t=this.$route.query;return{id:t.id,subjectId:t.subjectId||"",showSubject:!1,columns:[],activeInfo:{}}},async mounted(){await this.getMusicInfo()},methods:{async getMusicInfo(){try{const t=await n.post("/api-student/open/activity/info/"+this.id);this.activeInfo=t.data;const s=t.data.subjectInfos||[],o=[];s.forEach(u=>{o.push({text:u.subjectName,value:u.subjectId})}),this.columns=o,this.subjectId=this.subjectId||s[0].subjectId}catch{}}},computed:{subjectName(){if(!this.subjectId)return"";const s=this.columns.find(o=>o.value===this.subjectId);return s?s.text:""},selectSubjectList(){return(this.activeInfo.activityMusicVoList||[]).filter(u=>u.subjectId===this.subjectId)}},render(){let t;return e("div",{class:c.subjectSong},[e(h,{position:"top"},{default:()=>[e(j,null,null),e(i,{class:c.subjectSearch,title:`${this.subjectName} \u58F0\u90E8`,isLink:!0,arrowDirection:"down",onClick:()=>{this.showSubject=!0}},null)]}),e(b,{inset:!0,class:c.cellGroup},w(t=this.selectSubjectList.map(s=>e(i,{center:!0},{icon:()=>e(d,{src:s.musicImage,class:c.musicPic},null),title:()=>e("div",{class:c.musicName},[s.musicSheetName]),label:()=>e("div",{class:c.labelClass},[l("\u4F5C\u8005\uFF1A"),s.composer])})))?t:{default:()=>[t]}),e(r,{position:"bottom",round:!0,show:this.showSubject,"onUpdate:show":s=>this.showSubject=s},{default:()=>[e(p,{title:"\u9009\u62E9\u58F0\u90E8",columns:this.columns,onCancel:()=>{this.showSubject=!1},onConfirm:s=>{this.subjectId=s.value,this.showSubject=!1}},null)]})])}});export{V as default};