System.register(["./index-legacy-26fae7cb-1706882452509.js"],(function(e,t){"use strict";var s,i,n;return{setters:[e=>{s=e.dd,i=e.dC,n=e.dD}],execute:function(){e("u",s("catch-store",{state:()=>({bookVersionList:[],musicTypeList:[],subjectList:[],subjectInstruemnts:[]}),getters:{getBookVersion(){return this.bookVersionList},getMusicCategories(){return this.musicTypeList},getAllMusicCategories(){return[{name:"全部",id:null},...this.musicTypeList]},getSubjectList(){return this.subjectList},getSubjectAllList(){return[{name:"全部",id:null},...this.subjectList]},getSubjectInstruments(){return[{name:"全部",id:null,label:"全部",value:null},...this.subjectInstruemnts]}},actions:{setBookVersion(e){this.bookVersionList=e},setMusicCategories(e){this.musicTypeList=e},setSubjects(e){this.subjectList=e},setSubjectInstruemnts(e){this.subjectInstruemnts=e},async getSubjects(){try{if(this.getSubjectList&&this.getSubjectList.length>0)return Promise.resolve();const{data:e}=await i({enableFlag:!0,delFlag:0,page:1,rows:999}),t=e||[],s=[];return t.forEach((e=>{e.value=e.id,e.label=e.name,e.instruments&&e.instruments.length>0&&e.instruments.forEach((e=>{e.label=e.name,e.value=e.id}));const t={value:e.id,label:e.name,id:e.id,name:e.name,instruments:[]};e.instruments&&(1==e.instruments.length?(t.value=e.instruments[0].id,t.label=e.instruments[0].name,t.id=e.id,t.name=e.name):e.instruments.length>1&&e.instruments.forEach((e=>{e.label=e.name,e.value=e.id,t.instruments.push({label:e.name,value:e.id,id:e.id,name:e.name})}))),s.push(t)})),this.setSubjects(t||[]),this.setSubjectInstruemnts(s||[]),Promise.resolve()}catch(e){return Promise.reject(e)}},async getMusicSheetCategory(){try{if(this.getMusicCategories&&this.getMusicCategories.length>0)return Promise.resolve();const{data:e}=await n({enable:!0,page:1,rows:999});return this.setMusicCategories(e.rows||[]),Promise.resolve()}catch(e){return Promise.reject(e)}}}}))}}}));
