index-legacy.b73a5107.js 6.6 KB

1
  1. ;(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);});};}var __vite_style__=document.createElement('style');__vite_style__.innerHTML="._search_1lky7_1{--van-cell-background-color: transparent;--van-cell-font-size: .42667rem;--van-cell-text-color: #333;--van-cell-value-color: #999;--van-cell-icon-size: .26667rem}._search_1lky7_1 ._title_1lky7_8{padding-top:.42667rem}._search_1lky7_1 ._title_1lky7_8 .van-cell__value{font-size:.32rem}._search_1lky7_1 ._keywords_1lky7_14{margin-top:.26667rem;padding:0 .37333rem .26667rem;display:flex;align-items:center}._search_1lky7_1 ._keywords_1lky7_14 ._content_1lky7_21{flex:1;overflow:hidden;overflow-x:auto;display:flex}._search_1lky7_1 ._keywords_1lky7_14 ._content_1lky7_21 ._searchKeyword_1lky7_27{--van-tag-default-color: white;--van-tag-text-color: #333;font-size:.37333rem;padding:.10667rem .26667rem;margin-right:.13333rem}._search_1lky7_1 ._keywords_1lky7_14 ._remove_1lky7_34{font-size:.42667rem}\n";document.head.appendChild(__vite_style__);System.register(['./vendor-legacy.36eb999a.js','./index-legacy.f25f109a5.js','./index-legacy.f25f109a2.js','./index-legacy.f25f109a9.js','./index-legacy.45723dd2.js','./index-legacy.f2a1cb0a.js','./item-legacy.f94922ea.js','./item-legacy.1af68c72.js','./index-legacy.6e10cd37.js','./index-legacy.ffaf8d00.js','./select-tag-legacy.caf53881.js','./index-legacy.5410d485.js','./index-legacy.f25f109a3.js','./index-legacy.f25f109a4.js','./footer-legacy.72d3df3f.js','./favorite-legacy.403f54ea.js','./index-legacy.f25f109a10.js','./index-legacy.f25f109a8.js'],function(exports){'use strict';var defineComponent,ref,onMounted,createVNode,Sticky,Tag,isVNode,Icon,Fragment,Cell,Popup,Search,useLocalStorage,Item,Item$1,classNames,request,SelectTag,ColResult;return{setters:[function(module){defineComponent=module.d;ref=module.X;onMounted=module.a5;createVNode=module.a;Sticky=module.S;Tag=module.x;isVNode=module.y;Icon=module.I;Fragment=module.F;Cell=module.t;Popup=module.P;},function(){},function(){},function(){},function(module){Search=module.S;},function(module){useLocalStorage=module.c;},function(module){Item=module.I;},function(module){Item$1=module.I;},function(module){classNames=module.c;},function(module){request=module.r;},function(module){SelectTag=module.S;},function(module){ColResult=module.C;},function(){},function(){},function(){},function(){},function(){},function(){}],execute:function execute(){var search="_search_1lky7_1";var title="_title_1lky7_8";var keywords="_keywords_1lky7_14";var content="_content_1lky7_21";var searchKeyword="_searchKeyword_1lky7_27";var remove="_remove_1lky7_34";var styles={search:search,title:title,keywords:keywords,content:content,searchKeyword:searchKeyword,remove:remove};function _isSlot(s){return typeof s==='function'||Object.prototype.toString.call(s)==='[object Object]'&&!isVNode(s);}var index=exports('default',defineComponent({name:'MusicSearch',setup:function setup(){var loading=ref(false);var keyword=ref('');var tagids=ref('');var albumRows=ref([]);var sheetRows=ref([]);var tagVisibility=ref(false);var words=useLocalStorage('music-search',[]);var FetchList=/*#__PURE__*/function(){var _ref=_asyncToGenerator(/*#__PURE__*/regeneratorRuntime.mark(function _callee(){var res;return regeneratorRuntime.wrap(function _callee$(_context){while(1){switch(_context.prev=_context.next){case 0:loading.value=true;_context.prev=1;_context.next=4;return request.post('/api-student/music/sheet/albumAndSheetList',{data:{albumRow:3,sheetRow:10,search:keyword.value,musicTagIds:tagids.value}});case 4:res=_context.sent;albumRows.value=res.data.musicAlbumList.rows;sheetRows.value=res.data.musicSheetList.rows;_context.next=11;break;case 9:_context.prev=9;_context.t0=_context["catch"](1);case 11:loading.value=false;case 12:case"end":return _context.stop();}}},_callee,null,[[1,9]]);}));return function FetchList(){return _ref.apply(this,arguments);};}();var onSearch=function onSearch(val){keyword.value=val;var indexOf=words.value.indexOf(val);if(indexOf>-1){words.value.splice(indexOf,1);}if(val){words.value.unshift(val);words.value.length=Math.min(words.value.length,5);}FetchList();};var onComfirm=function onComfirm(tags){var data=Object.values(tags).flat().filter(Boolean).join(',');tagids.value=data;FetchList();tagVisibility.value=false;};onMounted(function(){return onSearch('');});return function(){return createVNode("div",{"class":styles.search},[createVNode(Sticky,null,{default:function _default(){return[createVNode(Search,{"modelValue":keyword.value,"showAction":true,"autofocus":true,"onSearch":onSearch,"onFilter":function onFilter(){return tagVisibility.value=true;}},null)];}}),words.value.length>0&&createVNode("div",{"class":classNames(styles.keywords,'van-hairline--bottom')},[createVNode("div",{"class":styles.content},[words.value.map(function(item){return createVNode(Tag,{"round":true,"class":styles.searchKeyword,"key":item,"onClick":function onClick(){return onSearch(item);}},_isSlot(item)?item:{default:function _default(){return[item];}});})]),createVNode(Icon,{"class":styles.remove,"name":"delete-o","onClick":function onClick(){return words.value=[];}},null)]),albumRows.value.length>0&&createVNode(Fragment,null,[createVNode(Cell,{"class":styles.title,"title":"专辑","is-link":true,"to":{path:'/music-album',query:{search:keyword.value,tagids:tagids.value}},"value":"更多"},null),albumRows.value.map(function(item){return createVNode(Item,{"data":item},null);})]),createVNode(Cell,{"class":styles.title,"title":"曲谱","is-link":true,"to":{path:'/music-list',query:{search:keyword.value,tagids:tagids.value}},"value":"更多"},null),sheetRows.value.map(function(item){return createVNode(Item$1,{"data":item},null);}),!loading.value&&sheetRows.value.length===0&&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,{"onComfirm":onComfirm,"onCancel":function onCancel(){}},null)];}})]);};}}));}};});})();