music-list-legacy.d3c46e17.js 11 KB

1
  1. !function(){function e(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function t(t){for(var n=1;n<arguments.length;n++){var r=null!=arguments[n]?arguments[n]:{};n%2?e(Object(r),!0).forEach((function(e){o(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):e(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function n(e,t,n,r,o,i,a){try{var u=e[i](a),l=u.value}catch(c){return void n(c)}u.done?t(l):Promise.resolve(l).then(r,o)}function r(e){return function(){var t=this,r=arguments;return new Promise((function(o,i){var a=e.apply(t,r);function u(e){n(a,o,i,u,l,"next",e)}function l(e){n(a,o,i,u,l,"throw",e)}u(void 0)}))}}function o(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,o,i=[],a=!0,u=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);a=!0);}catch(l){u=!0,o=l}finally{try{a||null==n.return||n.return()}finally{if(u)throw o}}return i}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return a(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return a(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function a(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}System.register(["./index-legacy.48c8d62c.js","./index-legacy.b00f6427.js","./index.module-legacy.cb3d08ee.js","./index-legacy.8cf5f94f.js","./index-legacy.87ef53c1.js","./index-legacy.087e0425.js","./index-legacy.04f465c8.js","./index-legacy.269a0b91.js","./index-legacy.55fe5b03.js","./use-tab-status-legacy.6949b1de.js"],(function(e){"use strict";var n,a,u,l,c,s,d,f,p,v,m,g,h,y,b,w,x,O,C,j,k,S,P,A,V,R,T,z,L,I,D,E,U,W,q,B,H,M,Q,$,G,K,N,_,F,J,X,Y;return{setters:[function(e){n=e.t,a=e.d,u=e.Q,l=e.R,c=e.x,s=e.an,d=e.y,f=e.a1,p=e.bj,v=e.a0,m=e.c,g=e.v,h=e.z,y=e.w,b=e.u,w=e.ay,x=e.am,O=e.aR,C=e.r,j=e.C,k=e.W,S=e.bK,P=e.aw,A=e.O,V=e.aU,R=e.ac,T=e.aQ,z=e.P,L=e.E,I=e.a5,D=e.D,E=e.aV,U=e.ag,W=e.$,q=e.ai,B=e.ak,H=e.m,M=e.f,Q=e._,$=e.k},function(e){G=e.O},function(e){K=e.g,N=e.s},function(e){_=e.O},function(e){F=e.O},function(e){J=e.C},function(e){X=e.L},function(e){Y=e.C},function(){},function(){}],execute:function(){var Z=i(n("dropdown-menu"),2),ee=Z[0],te=Z[1],ne={overlay:g,zIndex:h,duration:y(.2),direction:b("down"),activeColor:String,closeOnClickOutside:g,closeOnClickOverlay:g},re=Symbol(ee),oe=a({name:ee,props:ne,setup:function(e,t){var n=t.slots,r=u(),i=l(),a=l(),g=l(0),h=c(re),y=h.children,b=h.linkChildren,C=s(i),j=d((function(){return y.some((function(e){return e.state.showWrapper}))})),k=d((function(){if(j.value&&f(e.zIndex))return{zIndex:+e.zIndex+1}})),S=function(){if(a.value){var t=x(a);"down"===e.direction?g.value=t.bottom:g.value=O.value-t.top}},P=function(t,n){var i=t.state.showPopup,a=t.disabled,u=t.titleClass;return m("div",{id:"".concat(r,"-").concat(n),role:"button",tabindex:a?void 0:0,class:[te("item",{disabled:a}),o({},w,!a)],onClick:function(){var e;a||(e=n,y.forEach((function(t,n){n===e?(S(),t.toggle()):t.state.showPopup&&t.toggle(!1,{immediate:!0})})))}},[m("span",{class:[te("title",{down:i===("down"===e.direction),active:i}),u],style:{color:i?e.activeColor:""}},[m("div",{class:"van-ellipsis"},[t.renderTitle()])])])};return b({id:r,props:e,offset:g}),p(i,(function(){e.closeOnClickOutside&&y.forEach((function(e){e.toggle(!1)}))})),v("scroll",(function(){j.value&&S()}),{target:C,passive:!0}),function(){var e;return m("div",{ref:i,class:te()},[m("div",{ref:a,style:k.value,class:te("bar",{opened:j.value})},[y.map(P)]),null==(e=n.default)?void 0:e.call(n)])}}}),ie=i(n("dropdown-item"),2),ae=ie[0],ue=ie[1],le={title:String,options:P(),disabled:Boolean,teleport:[String,Object],lazyRender:g,modelValue:A,titleClass:A},ce=a({name:ae,inheritAttrs:!1,props:le,emits:["open","opened","close","closed","change","update:modelValue"],setup:function(e,t){var n=t.emit,r=t.slots,o=t.attrs,i=C({showPopup:!1,transition:!0,showWrapper:!1}),a=j(re),u=a.parent,l=a.index;if(u){var c=function(e){return function(){return n(e)}},s=c("open"),d=c("close"),f=c("opened"),p=function(){i.showWrapper=!1,n("closed")},v=function(t){e.teleport&&t.stopPropagation()},g=function(t){var r=u.props.activeColor,o=t.value===e.modelValue;return m(J,{role:"menuitem",key:t.value,icon:t.icon,title:t.text,class:ue("option",{active:o}),style:{color:o?r:""},tabindex:o?0:-1,clickable:!0,onClick:function(){i.showPopup=!1,t.value!==e.modelValue&&(n("update:modelValue",t.value),n("change",t.value))}},{value:function(){if(o)return m(I,{class:ue("icon"),color:r,name:"success"},null)}})},h=function(){var t=u.offset,n=u.props,a=n.zIndex,c=n.overlay,h=n.duration,y=n.direction,b=n.closeOnClickOverlay,w=V(a);return"down"===y?w.top="".concat(t.value,"px"):w.bottom="".concat(t.value,"px"),R(m("div",L({style:w,class:ue([y]),onClick:v},o),[m(z,{show:i.showPopup,"onUpdate:show":function(e){return i.showPopup=e},role:"menu",class:ue("content"),overlay:c,position:"down"===y?"top":"bottom",duration:i.transition?h:0,lazyRender:e.lazyRender,overlayStyle:{position:"absolute"},"aria-labelledby":"".concat(u.id,"-").concat(l.value),closeOnClickOverlay:b,onOpen:s,onClose:d,onOpened:f,onClosed:p},{default:function(){var t;return[e.options.map(g),null==(t=r.default)?void 0:t.call(r)]}})]),[[T,i.showWrapper]])};return k({state:i,toggle:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:!i.showPopup,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};e!==i.showPopup&&(i.showPopup=e,i.transition=!t.immediate,e&&(i.showWrapper=!0))},renderTitle:function(){if(r.title)return r.title();if(e.title)return e.title;var t=e.options.find((function(t){return t.value===e.modelValue}));return t?t.text:""}}),function(){return e.teleport?m(S,{to:e.teleport},{default:function(){return[h()]}}):h()}}console.error("[Vant] <DropdownItem> must be a child component of <DropdownMenu>.")}}),se=D(ce),de=D(oe);e("default",a({name:"accompany-music-list",props:{musicTree:{type:Array,default:function(){return[]}}},setup:function(e,n){var o=E();U();var i=K("icon-music.svg"),a=l({}),u=C({loading:!1,finished:!1,refreshing:!1,musicTree:[],pagenation:{page:1,rows:20},value1:null,value2:null,PopoverOpen:!1,list:[],keyword:""}),c=function(){var e=r(regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,H.get(M.platformApi+"/musicSheetCategories/queryTree?enable=true");case 3:t=e.sent,Array.isArray(null==t?void 0:t.data)&&(u.musicTree=t.data),Q((function(){v()})),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)}}(),s=function(){var e=r(regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,H.get("/api-student/student/member");case 3:t=e.sent,a.value=t.data||{},e.next=9;break;case 7:e.prev=7,e.t0=e.catch(0);case 9:case"end":return e.stop()}}),e,null,[[0,7]])})));return function(){return e.apply(this,arguments)}}(),f=d((function(){var e=u.musicTree.find((function(e){return e.id==o.query.categorieid}));return Array.isArray(null==e?void 0:e.musicSheetCategoriesList)?e.musicSheetCategoriesList.map((function(e){return u.value1||(u.value1=e.id,u.value2=null),{text:e.name,value:e.id}})):[]})),p=d((function(){var e=u.musicTree.find((function(e){return e.id==o.query.categorieid}));if(Array.isArray(null==e?void 0:e.musicSheetCategoriesList)){var t=e.musicSheetCategoriesList.find((function(e){return e.id==u.value1}));if(Array.isArray(null==t?void 0:t.musicSheetCategoriesList))return[{text:"全部",value:null}].concat(t.musicSheetCategoriesList.map((function(e){return{text:e.name,value:e.id}})))}return[{text:"全部",value:null}]})),v=function(){var e=r(regeneratorRuntime.mark((function e(){var n,r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!u.loading){e.next=2;break}return e.abrupt("return");case 2:return u.loading=!0,e.prev=3,e.next=6,H.post(M.platformApi+"/musicSheet/page",{data:t(t({},u.pagenation),{},{keyword:u.keyword,musicSheetCategoriesId:u.value2||u.value1}),hideLoading:!0});case 6:r=e.sent,Array.isArray(null==r||null===(n=r.data)||void 0===n?void 0:n.rows)?(u.list=[].concat(u.list,r.data.rows),u.pagenation.page+=1,u.finished=!r.data.rows.length):u.finished=!0,e.next=13;break;case 10:e.prev=10,e.t0=e.catch(3),u.finished=!0;case 13:u.loading=!1,u.refreshing=!1;case 15:case"end":return e.stop()}}),e,null,[[3,10]])})));return function(){return e.apply(this,arguments)}}(),g=function(){u.pagenation.page=1,u.list=[],u.finished=!1,u.list=[],v()};return W((function(){s(),c()})),function(){var e;return m("div",{class:N["accompany-music-list"]},[m(_,{mode:"sticky",class:N.heade,onGetHeight:function(e){document.documentElement.style.setProperty("--header-height",e+"px")}},{default:function(){return[m("div",null,[m(de,{activeColor:"var(--van-primary)"},{default:function(){return[m(se,{modelValue:u.value1,"onUpdate:modelValue":function(e){return u.value1=e},options:f.value,onChange:function(e){u.value2=null,g()}},null),m(se,{modelValue:u.value2,"onUpdate:modelValue":function(e){return u.value2=e},options:p.value,onChange:function(){return g()}},null)]}}),m("div",{class:N.filter},[m(F,{style:{width:"100%"},background:"transparent",onSearch:function(e){u.keyword=e,g()}},null)])])]}}),m(G,{modelValue:u.refreshing,"onUpdate:modelValue":function(e){return u.refreshing=e},onRefresh:g,style:"min-height: calc(100vh - var(--header-height))"},{default:function(){return[m(X,{"loading-text":" ",immediateCheck:!1,loading:u.loading,finished:u.finished,"onUpdate:finished":function(e){return u.finished=e},finishedText:" ",onLoad:function(){v()}},{default:function(){return[m(Y,{inset:!0},(t=e=u.list.map((function(e){return m(J,{size:"large",center:!0,title:e.musicSheetName,isLink:!0,onClick:function(){return function(e){var t="".concat(location.origin,"/orchestra-music-score/?id=").concat(e.id);$({api:"openAccompanyWebView",content:{url:t,orientation:0,isHideTitle:!0,statusBarTextColor:!1,isOpenLight:!0}})}(e)}},{icon:function(){return m(I,{style:{marginRight:"12px"},size:40,name:i},null)}})})),"function"==typeof t||"[object Object]"===Object.prototype.toString.call(t)&&!B(t)?e:{default:function(){return[e]}}))];var t}}),!u.loading&&!u.list.length&&m(q,{tips:"暂无曲谱"},null)]}})])}}}))}}}))}();