;(function(){function asyncGeneratorStep(gen,resolve,reject,_next,_throw,key,arg){try{var info=gen[key](arg);var value=info.value;}catch(error){reject(error);return;}if(info.done){resolve(value);}else{Promise.resolve(value).then(_next,_throw);}}function _asyncToGenerator(fn){return function(){var self=this,args=arguments;return new Promise(function(resolve,reject){var gen=fn.apply(self,args);function _next(value){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"next",value);}function _throw(err){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"throw",err);}_next(undefined);});};}function ownKeys(object,enumerableOnly){var keys=Object.keys(object);if(Object.getOwnPropertySymbols){var symbols=Object.getOwnPropertySymbols(object);enumerableOnly&&(symbols=symbols.filter(function(sym){return Object.getOwnPropertyDescriptor(object,sym).enumerable;})),keys.push.apply(keys,symbols);}return keys;}function _objectSpread(target){for(var i=1;i<arguments.length;i++){var source=null!=arguments[i]?arguments[i]:{};i%2?ownKeys(Object(source),!0).forEach(function(key){_defineProperty(target,key,source[key]);}):Object.getOwnPropertyDescriptors?Object.defineProperties(target,Object.getOwnPropertyDescriptors(source)):ownKeys(Object(source)).forEach(function(key){Object.defineProperty(target,key,Object.getOwnPropertyDescriptor(source,key));});}return target;}function _defineProperty(obj,key,value){if(key in obj){Object.defineProperty(obj,key,{value:value,enumerable:true,configurable:true,writable:true});}else{obj[key]=value;}return obj;}var __vite_style__=document.createElement('style');__vite_style__.innerHTML="._sticky_1xjt9_1 .van-sticky--fixed{box-shadow:.26667rem .26667rem .26667rem var(--box-shadow-color)}._label_1xjt9_4{margin-right:.21333rem;font-size:.37333rem}._label_1xjt9_4 .van-list__loading,._label_1xjt9_4 .van-list__finished-text,._label_1xjt9_4 .van-list__error-text{width:100%}._label_1xjt9_4 .iconfont-down{margin-left:.10667rem}\n";document.head.appendChild(__vite_style__);System.register(['./vendor-legacy.b3aeff6a.js','./index-legacy.f25f109a3.js','./index-legacy.f25f109a6.js','./index-legacy.03b70b26.js','./index-legacy.101dd5f6.js','./item-legacy.c76638a3.js','./select-tag-legacy.b927aafa.js','./select-subject-legacy.24c03a60.js','./hooks-legacy.e1f8097f.js','./index-legacy.f25f109a.js','./index-legacy.f25f109a5.js','./index-legacy.f25f109a2.js','./favorite-legacy.9d79fe4e.js','./index-legacy.c933002c.js','./index-legacy.f25f109a10.js','./index-legacy.f25f109a13.js','./index-legacy.f25f109a14.js','./index-legacy.6e10cd37.js'],function(exports){'use strict';var defineComponent,useRoute,reactive,ref,createVNode,List,Sticky,Icon,Popup,Fragment,ColSearch,state,ColResult,request,Item,SelectTag,SelectSubject,useSubjectId,SubjectEnum;return{setters:[function(module){defineComponent=module.d;useRoute=module.u;reactive=module.h;ref=module.l;createVNode=module.a;List=module.M;Sticky=module.S;Icon=module.K;Popup=module.P;Fragment=module.F;},function(){},function(){},function(module){ColSearch=module.C;},function(module){state=module.s;ColResult=module.C;request=module.r;},function(module){Item=module.I;},function(module){SelectTag=module.S;},function(module){SelectSubject=module.S;},function(module){useSubjectId=module.u;SubjectEnum=module.S;},function(){},function(){},function(){},function(){},function(){},function(){},function(){},function(){},function(){}],execute:function execute(){var sticky="_sticky_1xjt9_1";var label="_label_1xjt9_4";var styles={sticky:sticky,label:label};var AlbumList=exports('default',defineComponent({name:'Album',props:{hideSearch:{type:Boolean,default:false},defauleParams:{type:Object,default:function _default(){return{};}}},setup:function setup(_ref,_ref2){var hideSearch=_ref.hideSearch,defauleParams=_ref.defauleParams;var expose=_ref2.expose;var subjects=useSubjectId(SubjectEnum.SEARCH);// 判断是否已有数据
if(!subjects.id){var users=state.user.data;var subjectId=users.subjectId?Number(users.subjectId.split(',')[0]):'';var subjectName=users.subjectName?users.subjectName.split(',')[0]:'';console.log(subjectName,subjectId,subjects);if(subjectId){useSubjectId(SubjectEnum.SEARCH,JSON.stringify({id:subjectId,name:subjectName}),'set');}}var route=useRoute();var tempParams={};if(state.version){tempParams.version=state.version||'';// 处理ios审核版本
tempParams.platform=state.platformType==='STUDENT'?'ios-student':'ios-teacher';}// if (state.platformType === 'TEACHER') {
tempParams.myself=false;// }
// console.log({ ...defauleParams })
if(!hideSearch){var _getSubject=useSubjectId(SubjectEnum.SEARCH);tempParams.subjectIds=_getSubject.id;}var params=reactive(_objectSpread(_objectSpread({search:route.query.search||'',albumTagIds:route.query.tagids||'',page:1},defauleParams),tempParams));var data=ref(null);var loading=ref(false);var finished=ref(false);var isError=ref(false);var tagVisibility=ref(false);var onSearch=function onSearch(value){params.page=1;params.search=value;data.value=null;FetchList();};var FetchList=/*#__PURE__*/function(){var _ref3=_asyncToGenerator(/*#__PURE__*/regeneratorRuntime.mark(function _callee(){var res,_data$value,result;return regeneratorRuntime.wrap(function _callee$(_context){while(1){switch(_context.prev=_context.next){case 0:if(!loading.value){_context.next=2;break;}return _context.abrupt("return");case 2:loading.value=true;isError.value=false;_context.prev=4;_context.next=7;return request.post('/music/album/list',{prefix:state.platformType==='TEACHER'?'/api-teacher':'/api-student',data:_objectSpread(_objectSpread({},params),{},{idAndName:params.search})});case 7:res=_context.sent;if(data.value){result=(((_data$value=data.value)===null||_data$value===void 0?void 0:_data$value.rows)||[]).concat(res.data.rows||[]);data.value.rows=result;}data.value=data.value||res.data;params.page=res.data.pageNo+1;finished.value=res.data.pageNo>=res.data.totalPage;_context.next=17;break;case 14:_context.prev=14;_context.t0=_context["catch"](4);isError.value=true;case 17:loading.value=false;case 18:case"end":return _context.stop();}}},_callee,null,[[4,14]]);}));return function FetchList(){return _ref3.apply(this,arguments);};}();var onComfirm=function onComfirm(tags){var d=Object.values(tags).flat().filter(Boolean).join(',');params.albumTagIds=d;params.page=1;data.value=null;FetchList();tagVisibility.value=false;};var onComfirmSubject=function onComfirmSubject(item){params.page=1;params.subjectIds=item.id;subject.id=item.id;subject.name=item.name;data.value=null;useSubjectId(SubjectEnum.SEARCH,JSON.stringify({id:item.id,name:item.name}),'set');FetchList();subject.show=false;};expose({onSearch:onSearch,onComfirm:onComfirm,onComfirmSubject:onComfirmSubject});var getSubject=useSubjectId(SubjectEnum.SEARCH);var subject=reactive({show:false,name:getSubject.name||'全部声部',id:getSubject.id||''});return function(){return createVNode(Fragment,null,[createVNode(List,{"loading":loading.value,"finished":finished.value,"finished-text":data.value&&data.value.rows.length?'没有更多了':'',"onLoad":FetchList,"error":isError.value},{default:function _default(){return[!hideSearch&&createVNode(Sticky,{"class":styles.sticky},{default:function _default(){return[createVNode(ColSearch,{"modelValue":params.search,"showAction":true,"onSearch":onSearch,"onFilter":function onFilter(){return tagVisibility.value=true;},"filterDot":!!params.albumTagIds},{left:function left(){return createVNode("div",{"class":styles.label,"onClick":function onClick(){return subject.show=true;}},[subject.name,createVNode(Icon,{"classPrefix":"iconfont","name":"down","size":12,"color":"#333"},null)]);}})];}}),data.value&&data.value.rows.length?data.value.rows.map(function(item){return createVNode(Item,{"data":item},null);}):!loading.value&&createVNode(ColResult,{"tips":"暂无专辑","classImgSize":"SMALL","btnStatus":false},null)];}}),createVNode(Popup,{"show":tagVisibility.value,"round":true,"closeable":true,"position":"bottom","style":{height:'60%'},"teleport":"body","onUpdate:show":function onUpdateShow(val){return tagVisibility.value=val;}},{default:function _default(){return[createVNode(SelectTag,{"defaultValue":route.query.tagids,"onConfirm":onComfirm,"onCancel":function onCancel(){}},null)];}}),createVNode(Popup,{"show":subject.show,"position":"bottom","round":true,"closeable":true,"safe-area-inset-bottom":true,"onClose":function onClose(){return subject.show=false;},"onClosed":function onClosed(){return subject.show=false;}},{default:function _default(){return[createVNode(SelectSubject,{"isReset":true,"searchParams":subject,"onComfirm":onComfirmSubject},null)];}})]);};}}));}};});})();
