1 |
- !function(){function e(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,r)}return t}function n(n){for(var r=1;r<arguments.length;r++){var i=null!=arguments[r]?arguments[r]:{};r%2?e(Object(i),!0).forEach((function(e){t(n,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(i)):e(Object(i)).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(i,e))}))}return n}function t(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function r(e,n,t,r,i,a,o){try{var u=e[a](o),c=u.value}catch(s){return void t(s)}u.done?n(c):Promise.resolve(c).then(r,i)}function i(e){return function(){var n=this,t=arguments;return new Promise((function(i,a){var o=e.apply(n,t);function u(e){r(o,i,a,u,c,"next",e)}function c(e){r(o,i,a,u,c,"throw",e)}u(void 0)}))}}System.register(["./ResizeObserver.es-legacy.42c87f31.js","./index-legacy.4e98d1df.js","./index-legacy.e8708a77.js","./index.module-legacy.55a8bd96.js","./index-legacy.3051ad75.js","./index-legacy.2ef22a80.js","./index-legacy.c576e604.js","./index-legacy.5ed6775c.js","./index-legacy.ce45bf73.js","./index-legacy.ed38cd1f.js","./index-legacy.f0837e3a.js","./music-img-default-legacy.4c9588f0.js","./index-legacy.dd465861.js","./index-legacy.db49cff7.js","./index-legacy.fc29a65a.js","./use-tab-status-legacy.c8efb696.js","./Picker-legacy.bc86cfc8.js","./index-legacy.4ff85114.js","./index-legacy.d630a845.js","./index-legacy.82cefb8a.js"],(function(e){"use strict";var t,r,a,o,u,c,s,l,f,d,p,m,g,v,y,h,b,x,j,w,O,k,C,S,T,A,R,P,L;return{setters:[function(e){t=e.d,r=e.aj,a=e.ai,o=e.U,u=e.g,c=e.r,s=e.G,l=e.a1,f=e.c,d=e.al,p=e.f,m=e.e,g=e.a7,v=e.am,y=e.P,h=e.an,b=e.n,x=e.a0},function(e){j=e.O},function(e){w=e.g},function(e){O=e.s},function(e){k=e.O},function(e){C=e.O},function(e){S=e.D,T=e.a},function(e){A=e.L},function(e){R=e.C},function(e){P=e.C},function(e){L=e.P},function(){},function(){},function(){},function(){},function(){},function(){},function(){},function(){},function(){}],execute:function(){e("default",t({name:"accompany-music-list",props:{musicTree:{type:Array,default:function(){return[]}}},setup:function(){var e,t,E,V,I,D,U=r(),H=a(),N=w("icon-music.svg"),B=o({}),q=(null===(e=u.user)||void 0===e||null===(t=e.data)||void 0===t?void 0:t.phone)||"accompany-music-list-subject",z=localStorage.getItem(q)||(null===(E=u.user)||void 0===E||null===(V=E.data)||void 0===V||null===(I=V.subjectId)||void 0===I||null===(D=I.split(","))||void 0===D?void 0:D[0])||"",G=c({loading:!1,firstRender:!1,finished:!1,refreshing:!1,musicTree:[],pagenation:{page:1,rows:20},value1:null,value2:null,PopoverOpen:!1,list:[],keyword:"",musicSubject:z,subjectList:[]}),W=function(){var e=i(regeneratorRuntime.mark((function e(){var n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,b.post(u.platformApi+"/musicSheetCategories/queryTreeByParentId",{data:{parentId:U.query.categorieid,enable:!0}});case 3:n=e.sent,Array.isArray(null==n?void 0:n.data)&&(G.musicTree=n.data),x((function(){M()})),e.next=11;break;case 8:e.prev=8,e.t0=e.catch(0),console.log(e.t0);case 11:case"end":return e.stop()}}),e,null,[[0,8]])})));return function(){return e.apply(this,arguments)}}(),X=function(){var e=i(regeneratorRuntime.mark((function e(){var n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,b.get(u.platformApi+"/subject/musicList",{params:{enableFlag:!0,page:1,rows:100}});case 3:n=e.sent,(n.data||[]).forEach((function(e){G.subjectList.push({text:e.name,value:e.id+""})})),e.next=10;break;case 8:e.prev=8,e.t0=e.catch(0);case 10:case"end":return e.stop()}}),e,null,[[0,8]])})));return function(){return e.apply(this,arguments)}}(),F=function(){var e=i(regeneratorRuntime.mark((function e(){var n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,b.get("/api-student/student/member");case 3:n=e.sent,B.value=n.data||{},e.next=10;break;case 7:e.prev=7,e.t0=e.catch(0),console.log(e.t0);case 10:case"end":return e.stop()}}),e,null,[[0,7]])})));return function(){return e.apply(this,arguments)}}(),J=s((function(){var e=G.musicTree;return Array.isArray(e)?e.map((function(e){return G.value1||(G.value1=e.id,G.value2=null),{text:e.name,value:e.id}})):[]})),K=s((function(){var e=G.musicTree;if(console.log(e,"---"),Array.isArray(e)){var n=null==e?void 0:e.find((function(e){return e.id==G.value1}));if(Array.isArray(null==n?void 0:n.musicSheetCategoriesList))return[{text:"全部",value:null}].concat(n.musicSheetCategoriesList.map((function(e){return{text:e.name,value:e.id}})))}return[{text:"全部",value:null}]})),M=function(){var e=i(regeneratorRuntime.mark((function e(){var t,r,i;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!G.loading){e.next=2;break}return e.abrupt("return");case 2:return G.loading=!0,t=n(n({},G.pagenation),{},{keyword:G.keyword,musicSheetCategoriesId:G.value2||G.value1,status:1}),"TEACHER"==u.platformType&&(t.musicSubject=G.musicSubject),e.prev=5,e.next=8,b.post(u.platformApi+"/musicSheet/page",{data:t,hideLoading:!0});case 8:i=e.sent,Array.isArray(null==i||null===(r=i.data)||void 0===r?void 0:r.rows)?(G.list=[].concat(G.list,i.data.rows),G.pagenation.page+=1,G.finished=i.data.rows.length<G.pagenation.rows):G.finished=!0,e.next=15;break;case 12:e.prev=12,e.t0=e.catch(5),G.finished=!0;case 15:G.loading=!1,G.refreshing=!1,G.firstRender=!0;case 18:case"end":return e.stop()}}),e,null,[[5,12]])})));return function(){return e.apply(this,arguments)}}(),Q=function(){G.pagenation.page=1,G.list=[],G.finished=!1,G.list=[],M()},Y=function(){var e=i(regeneratorRuntime.mark((function e(n){var t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t="".concat(location.origin,"/orchestra-music-score/?id=").concat(n.id,"&part-index=").concat(Z.partIndex),console.log("🚀 ~ src:",t),m({api:"openAccompanyWebView",content:{url:t,orientation:0,isHideTitle:!0,statusBarTextColor:!1,isOpenLight:!0}});case 3:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}();l((function(){"STUDENT"==u.platformType&&F(),"TEACHER"==u.platformType&&X(),W()}));var Z=c({open:!1,musicXml:{},instrumentName:"",partIndex:0,partList:[]});return function(){var e;return f("div",{class:O["accompany-music-list"]},[f(k,{mode:"sticky",class:O.heade,onGetHeight:function(e){document.documentElement.style.setProperty("--header-height",e+"px")}},{default:function(){return[f(d,{border:!1},null),f("div",null,[f(S,{activeColor:"var(--van-primary)"},{default:function(){return[f(T,{modelValue:G.value1,"onUpdate:modelValue":function(e){return G.value1=e},options:J.value,onChange:function(){G.value2=null,Q()}},null),f(T,{modelValue:G.value2,"onUpdate:modelValue":function(e){return G.value2=e},options:K.value,onChange:function(){return Q()}},null)]}}),f("div",{class:O.filter},[f(C,{class:O.filterBox,onSearch:function(e){G.keyword=e,Q()}},{left:function(){return"TEACHER"==u.platformType?f(S,{activeColor:"var(--van-primary)"},{default:function(){return[f(T,{modelValue:G.musicSubject,"onUpdate:modelValue":function(e){return G.musicSubject=e},options:G.subjectList,onChange:function(){localStorage.setItem(q,G.musicSubject),Q()}},null)]}}):null}})])])]}}),f(j,{modelValue:G.refreshing,"onUpdate:modelValue":function(e){return G.refreshing=e},onRefresh:Q,style:"min-height: calc(100vh - var(--header-height))"},{default:function(){return[f(A,{"loading-text":" ",immediateCheck:!1,loading:G.loading,finished:G.finished,"onUpdate:finished":function(e){return G.finished=e},finishedText:" ",onLoad:function(){M()}},{default:function(){return[f(R,{inset:!0},(n=e=G.list.map((function(e){return f(P,{size:"large",center:!0,title:e.musicSheetName,isLink:!0,onClick:function(){if(p().isApp){var n="".concat(location.origin).concat(location.pathname,"#/musicDetail?id=").concat(e.id);m({api:"openWebView",content:{url:n,orientation:1,isHideTitle:!0,statusBarTextColor:!1,isOpenLight:!1}})}else H.push({path:"/musicDetail",query:{id:e.id}})}},{icon:function(){return f(g,{style:{marginRight:"12px"},size:40,name:N},null)}})})),"function"==typeof n||"[object Object]"===Object.prototype.toString.call(n)&&!h(n)?e:{default:function(){return[e]}})),f("div",{style:{height:"40px"}},null)];var n}}),G.firstRender&&!G.loading&&!G.list.length&&f(v,{tips:"暂无曲谱"},null)]}}),f(y,{teleport:"body",position:"bottom",round:!0,show:Z.open,"onUpdate:show":function(e){return Z.open=e}},{default:function(){return[f(L,{columns:Z.musicXml[Z.instrumentName],onConfirm:function(e){Z.open=!1,Z.partIndex=e.selectedValues[0],Y({id:Z.instrumentName})},onCancel:function(){return Z.open=!1}},null)]}})])}}}))}}}))}();
|