;(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;}System.register(['./vendor-legacy.09f20d09.js','./index-legacy.f25f109a3.js','./index-legacy.f25f109a6.js','./index-legacy.f72eae88.js','./index-legacy.595c24c3.js','./select-tag-legacy.4972aa0d.js','./index.module-legacy.9051c853.js','./music-legacy.6d4924e4.js','./select-subject-legacy.1290af03.js','./hooks-legacy.b91b3b59.js','./index-legacy.a92ed534.js','./index-legacy.f25f109a.js','./index-legacy.f25f109a5.js','./index-legacy.2d78ae68.js','./index-legacy.f25f109a10.js','./index-legacy.f25f109a13.js','./index-legacy.f25f109a14.js','./index-legacy.6e10cd37.js','./orderStatus-legacy.6131dfb6.js','./index-legacy.c75fe8a2.js','./index-legacy.f25f109a4.js','./index-legacy.f25f109a2.js','./index-legacy.92ff7530.js','./index-legacy.637f3556.js','./code-down-load-legacy.66a01c5d.js','./logo-legacy.cf4b3bd2.js','./browser-legacy.5a92c2a9.js','./icon_teacher-legacy.e765b7f7.js','./music-icon-legacy.a161f8f1.js'],function(exports){'use strict';var defineComponent,useRoute,reactive,ref,createVNode,Fragment,Sticky,Icon,List,Popup,ColSearch,state,ColResult,request,SelectTag,styles,getRandomKey,musicBuy,SelectSubject,useSubjectId,SubjectEnum,Song;return{setters:[function(module){defineComponent=module.d;useRoute=module.u;reactive=module.h;ref=module.l;createVNode=module.a;Fragment=module.F;Sticky=module.S;Icon=module.K;List=module.M;Popup=module.P;},function(){},function(){},function(module){ColSearch=module.C;},function(module){state=module.s;ColResult=module.C;request=module.r;},function(module){SelectTag=module.S;},function(module){styles=module.s;},function(module){getRandomKey=module.g;musicBuy=module.m;},function(module){SelectSubject=module.S;},function(module){useSubjectId=module.u;SubjectEnum=module.S;},function(module){Song=module.S;},function(){},function(){},function(){},function(){},function(){},function(){},function(){},function(){},function(){},function(){},function(){},function(){},function(){},function(){},function(){},function(){},function(){},function(){}],execute:function execute(){var noop=function noop(){//
};var MusicList=exports('default',defineComponent({name:'MusicList',props:{hideSearch:{type:Boolean,default:false},defauleParams:{type:Object,default:function _default(){return{};}},onItemClick:{type:Function,default:noop},teacherId:{type:String||Number,default:''},myself:{type:Boolean,default:false}},setup:function setup(_ref,_ref2){var hideSearch=_ref.hideSearch,defauleParams=_ref.defauleParams,onItemClick=_ref.onItemClick,teacherId=_ref.teacherId,myself=_ref.myself;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]:'';if(subjectId){useSubjectId(SubjectEnum.SEARCH,JSON.stringify({id:subjectId,name:subjectName}),'set');}}localStorage.setItem('behaviorId',getRandomKey());var route=useRoute();// const router = useRouter()
var tempParams={};if(state.version){tempParams.version=state.version||'';// 处理ios审核版本
tempParams.platform=state.platformType==='STUDENT'?'ios-student':'ios-teacher';}// 判断是否在搜索页面用过
if(!hideSearch){var _getSubject=useSubjectId(SubjectEnum.SEARCH);tempParams.subjectIds=_getSubject.id;}//
var params=reactive(_objectSpread(_objectSpread({search:route.query.search||'',// exquisiteFlag: 1,
musicTagIds: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 exquisiteFlag=ref(false);var apiSuffix=ref(state.platformType==='STUDENT'?'/api-student':'/api-teacher');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 tempParams,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;tempParams=_objectSpread(_objectSpread({},params),{},{auditStatus:'PASS',idAndName:params.search,createBy:teacherId});if(exquisiteFlag.value){tempParams.exquisiteFlag=1;}if(myself){tempParams.myself=true;}else{tempParams.myself=false;}_context.prev=7;_context.next=10;return request.post("".concat(apiSuffix.value,"/music/sheet/list"),{data:tempParams});case 10: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=20;break;case 17:_context.prev=17;_context.t0=_context["catch"](7);isError.value=true;case 20:loading.value=false;case 21:case"end":return _context.stop();}}},_callee,null,[[7,17]]);}));return function FetchList(){return _ref3.apply(this,arguments);};}();var onComfirm=function onComfirm(tags){var tempTags={};// 单独处理乐谱类型
for(var tag in tags){if(Number(tag)===-1){exquisiteFlag.value=tags[tag][0]?true:false;}else{tempTags[tag]=tags[tag];}}var d=Object.values(tempTags).flat().filter(Boolean).join(',');params.musicTagIds=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;};var getSubject=useSubjectId(SubjectEnum.SEARCH);var subject=reactive({show:false,name:getSubject.id?getSubject.name:'全部声部',id:getSubject.id||''});expose({onSearch:onSearch,onComfirm:onComfirm,onComfirmSubject:onComfirmSubject});return function(){return createVNode(Fragment,null,[!hideSearch&&createVNode(Sticky,{"class":styles.sticky},{default:function _default(){return[createVNode(ColSearch,{"showAction":true,"onSearch":onSearch,"onFilter":function onFilter(){return tagVisibility.value=true;},"filterDot":!!params.musicTagIds},{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)]);}})];}}),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[data.value&&data.value.rows.length?createVNode("div",{"class":styles.alumnList},[createVNode(Song,{"list":data.value.rows,"onDetail":function onDetail(item){if(onItemClick===noop){musicBuy(item);}else{onItemClick===null||onItemClick===void 0?void 0:onItemClick(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,{"exquisiteFlag":true,"onConfirm":onComfirm,"onCancel":function onCancel(){//
},"defaultValue":route.query.tagids},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,"type":"MUSIC","searchParams":subject,"onComfirm":onComfirmSubject},null)];}})]);};}}));}};});})();
