1 |
- import{d as V,S as p,f as L,n as C,g as Y,P as B,O as K,bD as x,a2 as z,Q as j,U as G,j as s,z as M,M as U,R as P,C as Q,Z as J,w as N,W as Z}from"./index.394decd7.js";import{T as q}from"./index.dab716ce.js";import"./index.3bbf4ddb.js";import"./index.f1b52763.js";import{T as H,a as d}from"./index.ae00317c.js";import{D as O,a as X}from"./index.5d26697d.js";import"./index.9e0d46e4.js";import{E as $}from"./index.b6ce06cf.js";import{S as ee}from"./index.ada5e712.js";import{d as se}from"./index.75a0444f.js";import{c as ae}from"./index.926ca9c5.js";import{g as te}from"./music.a1b63125.js";import{S as oe}from"./select-subject.fa696791.js";import{a as w,S as _}from"./hooks.9e5ee122.js";import{T as ne}from"./index.88270f6d.js";import{C as ce}from"./index.e6e212d8.js";import{u as re}from"./index.b9aedd1d.js";const le="_search_k9vef_4",ie="_sticky_k9vef_13",ue="_searchCancel_k9vef_19",me="_titleActive_k9vef_47",fe="_title_k9vef_47",he="_keywordTitle_k9vef_56",pe="_t_k9vef_47",Ae="_remove_k9vef_69",ve="_keywords_k9vef_72",be="_content_k9vef_78",de="_searchKeyword_k9vef_83",ge="_arrowMore_k9vef_94",ke="_label_k9vef_105",we="_bgImg_k9vef_134",_e="_tagTabs_k9vef_142",Se="_alubmGroupSearch_k9vef_173",Ce="_hotMusic_k9vef_176",ye="_swipeItem_k9vef_179",Ie="_swipeChild_k9vef_179",Te="_swipeTitle_k9vef_197",Ee="_swipeContent_k9vef_204",Re="_swipe_k9vef_179",je="_num_k9vef_218",Me="_hot_k9vef_176",Ue="_swipeTop_k9vef_240",Ne="_searchResult_k9vef_246",He="_searchGroups_k9vef_258",Le="_searchItem_k9vef_267",De="_rName_k9vef_272",Fe="_iconSearch_k9vef_281",We="_searchAlbum_k9vef_286";var t={search:le,sticky:ie,searchCancel:ue,titleActive:me,title:fe,keywordTitle:he,t:pe,remove:Ae,keywords:ve,content:be,searchKeyword:de,arrowMore:ge,label:ke,bgImg:we,tagTabs:_e,alubmGroupSearch:Se,hotMusic:Ce,swipeItem:ye,swipeChild:Ie,swipeTitle:Te,swipeContent:Ee,swipe:Re,num:je,hot:Me,swipeTop:Ue,searchResult:Ne,searchGroups:He,searchItem:Le,rName:De,iconSearch:Fe,searchAlbum:We},Ve="./assets/bg-image-search.c44b4a0f.png",Ye="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAxRJREFUWEfNl01IVFEUx//nPUGnTRaYZB+QIdjGiqBVLSwJWrUQKRrmaRttruU8KYgW5csWIYSOqW9SDHPEzYSLVkFos2gXROUmQWjRhxJm6SZHcN6J9+bNzHNyZrRRp7e8957/+d1zzz33PEKWz68PVwFUC+A0gEoAu22TnwCmALwGeEwV9ZPZtNaap3RG3frTE0xyB5jPrkuYaII4essnGt6ua7296C8ALRwuKJ763AUmAUByijFjhQjfzTFmlBKhIMWZAWJ9ofJgq1ZdvbIekFUAD/TRXS5ExwBUJ415hkgaMAzp+eLc9KSmaYY5p2matLOkokqSjAvMRiNAZQ6H4SXItbeF+1c2iASAtfOPX146nJs7uO+Slx42NTX9ziTU39+/YynqugngDpCISnjhyIFz2SKRAPAHhnvAdM12tCBBrmsR7vFsO3DOP9JHawxEnwEotsaJe1Vv/fVMGhaAlXCQ3thnviJBPr9R53EnNsQLOxIGwTiZKTEtAH9gZNyR7W2qUNo3svPUtX49eBfAvVgUaEL1emrS6ZF9zz/EFvCMS45UZDvzbHCxnCiaTiYmH01XJ8ivB01SkxhEpPm8nhh5jl93YKSNmTVbpl0VSttakibAq3jmM8vHW5vd73P0bZl39Y0eI4q+s7XCqlDOpAOYAbDXLDKLc58K4/c8V4hYnShftovVrCoUZ51IyJsRiAAoBPBNFcr+XB077f168CuAfQCWVaEUpYtA3gHyfgR5T8J8X0Or4chfIcp7Kf4vHqNYFPL4HJsAW9CQgIAen1BaMhW3rWrJkj6Ze9Xm9E3JpjelEpFuMJcAuBinIKDPJxSzM+LUaGxJWx4Khe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WCnUn9O8V5RgKzrfwVgK4i+tHT1oXpTso5/EoRbQRi1dO3ZpQHw/Akwrgfwu2VoN00Vse0PVsSvPf1fzWV8YxraXcsAyw4sO7A0Drh+0A92MfBbxtB6Lm/DL5RrVn53KTj3wfy1ZfbfvSQAjlt4n8HPgehtS1dfmnYQuX7Q+T5MRI6pq9aCARy38DGDnwgvoxhvHNzd/8PlJ7VFZ9eGmzO7kr+EV0vdsG1b6ezc0JPJJH+u/31o6M07J6uTQYMadNafmIb6ZP18o+vYA5AOBUKkzXRyaIH3UChzcsXdLGUuypGzDE1vCuA4xXuZ5OHoWL3AivKANZCIuuP5oWSHS1tQqYwF6ybMx+I+00weaQoQTGZd/yMATwWfmfEXEeWZ6BCIL7aFwLSKmB9l5hQRros0ByxDe3qmvmGvt3dvYTXFMA7wprYKtgyi41xFXyajnm8LIHQhW+qCqIwA2LGIlj3o//ZDKv2WlZhoxNmy23Xdfb0seBukvEMCq1o+bI32Ilj8SEQHDWPntD8kM/X/A4ncTT5rcucXAAAAAElFTkSuQmCC";function Ke(m){return typeof m=="function"||Object.prototype.toString.call(m)==="[object Object]"&&!J(m)}const v=new $,xe=p(),y=(m,f)=>{L().isApp?C({api:"openWebView",content:{url:m,orientation:1,isHideTitle:!1}}):f&&f()};var ze=V({name:"MusicSearchHeader",setup(){const m=w(_.SEARCH);if(!m.id){const e=Y.user.data,c=e.subjectId?Number(e.subjectId.split(",")[0]):"",o=e.subjectName?e.subjectName.split(",")[0]:"";c&&w(_.SEARCH,JSON.stringify({id:c,name:o}),"set")}localStorage.setItem("behaviorId",te());const f=B(),a=K(),A=p(!1),r=p(""),S=p(""),l=se(a.path==="/music-songbook/search"?"music-search":"music-search-ablum",[]),i=p("all");a.path==="/music-songbook/result"&&(r.value=a.query.search,S.value="",i.value="all"),x((e,c)=>{var n,b;const o=w(_.SEARCH);if(h.name=o.name||"\u5168\u90E8\u58F0\u90E8",h.id=o.id,a.path==="/music-songbook/search"){r.value="",S.value="",i.value="all";try{(b=(n=xe.value)==null?void 0:n.resetTags)==null||b.call(n)}catch(W){console.log(W)}}return e.path==="/music-songbook/result"&&(r.value=e.query.search,console.log(r.value,"value",a.query),S.value="",i.value="all"),!0}),z(i,e=>{v.emit("changeTab",e,r.value)});const g=p([]),D=re(async e=>{try{let c={};if(a.path==="/music-songbook/searchAlbum"){const{data:n}=await N.post("/api-student/music/sheet/searchTenant",{hideLoading:!0,data:{name:e,rows:10}});c=n}else{const{data:n}=await N.post("/api-student/music/sheet/search",{hideLoading:!0,data:{subjectId:m.id,name:e,rows:10}});c=n}const o=c.musicNames||[];o.forEach((n,b)=>{b<10&&(n.name=n.name.replace(e,`<span>${e}</span>`))}),g.value=o,A.value=!!r.value}catch{}},300),I=e=>{console.log("object :>> ",e),r.value=e;const c=l.value.indexOf(e);c>-1&&l.value.splice(c,1),e&&(l.value.unshift(e),l.value.length=Math.min(l.value.length,10),a.path==="/music-songbook/search"&&k(),a.path==="/music-songbook/searchAlbum"&&k()),a.path!=="/music-songbook/searchAlbum"&&a.path!=="/music-songbook/result"?(f.replace({path:"/music-songbook/result",query:{search:e}}),A.value=!1,g.value=[]):(A.value=!1,v.emit("search",e))},T=p(),F=e=>{h.name=e.name,h.id=e.id,T.value.toggle(),w(_.SEARCH,JSON.stringify({id:e.id,name:e.name}),"set"),h.show=!1,v.emit("confirmSubject",h)},E=w(_.SEARCH),h=j({show:!1,name:E.name||"\u5168\u90E8\u58F0\u90E8",id:E.id||""}),R=p([]),u=j({line:0,arrowStatus:!1}),k=()=>{Z(()=>{if(!l.value||!l.value.length)return;let e=-1;u.line=0,R.value.forEach((o,n)=>{try{o.$el.style.display="block",n===0?(u.line=1,e=o.$el.offsetLeft):o.$el.offsetLeft===e&&n!=0&&(u.line+=1),u.arrowStatus?o.$el.style.display="block":u.line>1?o.$el.style.display="none":o.$el.style.display="block"}catch(b){console.log(b,"Error")}})})};return a.path==="/music-songbook/search"&&k(),a.path==="/music-songbook/searchAlbum"&&k(),G(()=>{C({api:"backIconChange",content:{backIconHide:!0}})}),()=>s("div",{class:t.search},[s("div",{class:t.sticky},[s(ne,{position:"top"},{default:()=>[s(ce,{isFixed:!1,background:"transparent",isBack:!1,title:" "},null),s(ee,{modelValue:r.value,background:"transparent",showAction:!0,onInput:e=>{r.value=e,e?D(e):(g.value=[],A.value=!1,a.path==="/music-songbook/result"&&f.replace("/music-songbook/search"),a.path==="/music-songbook/searchAlbum"&&v.emit("search",""))},onSearch:e=>{if(!e){a.path==="/music-songbook/searchAlbum"&&v.emit("search","");return}r.value=e,I(e)},type:"tenant"},{left:()=>a.path!=="/music-songbook/searchAlbum"&&s(O,null,{default:()=>[s(X,{title:h.name,ref:T},{default:()=>[s(oe,{isReset:!0,searchParams:h,onComfirm:F},null)]})]}),action:()=>s("span",{class:t.searchCancel,onClick:()=>{L().isApp?C({api:"back"}):f.back()}},[M("\u53D6\u6D88")])}),a.path==="/music-songbook/result"&&!A.value&&s(H,{color:"var(--van-primary)",background:"transparent",lineWidth:20,shrink:!0,class:t.tagTabs,active:i.value,"onUpdate:active":e=>i.value=e,onChange:e=>i.value=e},{default:()=>[s(d,{title:"\u7EFC\u5408",name:"all"},null),s(d,{title:"\u5355\u66F2",name:"songe"},null),s(d,{title:"\u4E13\u8F91",name:"album"},null)]})]}),s("img",{class:t.bgImg,src:Ve},null)]),l.value.length>0&&(a.path==="/music-songbook/search"||a.path==="/music-songbook/searchAlbum")&&s("div",{class:t.keywordSection},[s("div",{class:t.keywordTitle},[s("span",{class:t.t},[M("\u641C\u7D22\u5386\u53F2")]),s(U,{class:t.remove,name:Be,onClick:()=>l.value=[]},null)]),s("div",{class:ae(t.keywords)},[s("div",{class:t.content},[l.value.map((e,c)=>s(q,{ref:o=>R.value[c]=o,round:!0,class:[t.searchKeyword,"van-ellipsis"],key:e,onClick:()=>{r.value=e,I(e)}},Ke(e)?e:{default:()=>[e]})),u.line>1&&s("span",{class:[t.arrowMore],onClick:()=>{u.arrowStatus=!u.arrowStatus,k()}},[s(U,{name:u.arrowStatus?"arrow-up":"arrow-down"},null)])])])]),a.path==="/music-songbook/search"&&s(H,{color:"var(--van-primary)",background:"transparent",lineWidth:20,shrink:!0,class:t.tagTabs,active:i.value,"onUpdate:active":e=>i.value=e,onChange:e=>i.value=e},{default:()=>[s(d,{title:"\u7EFC\u5408",name:"all"},null),s(d,{title:"\u5355\u66F2",name:"songe"},null),s(d,{title:"\u4E13\u8F91",name:"album"},null)]}),s(P,null,null),s("div",{class:[t.searchResult],style:{display:A.value?"block":"none"}},[s("div",{class:t.searchGroups},[g.value.map(e=>s("div",{class:t.searchItem,onClick:()=>{e.type==="ALBUM"?y(`${location.origin}/tenant/#/music-album-detail/${e.id}`,()=>{f.push({path:"/music-album-detail/"+e.id})}):y(`${location.origin}/tenant/#/music-detail?id=${e.id}`,()=>{f.push({path:"/music-detail",query:{id:e.id}})})}},[s("img",{src:Ye,class:t.iconSearch},null),s("span",{class:t.rName,innerHTML:e.name},null)])),g.value.length<=0&&s(Q,{tips:"\u6682\u65E0\u641C\u7D22\u7ED3\u679C",btnStatus:!1},null)])])])}}),ls=Object.freeze(Object.defineProperty({__proto__:null,mitter:v,openWebViewOrWeb:y,default:ze},Symbol.toStringTag,{value:"Module"}));export{ls as h,v as m,y as o,t as s};
|