1 |
- import{d as W,U as h,f as L,n as y,g as Y,Q as B,P as K,bG as x,a3 as z,S as j,V as G,j as s,A as M,N as U,R as P,C as Q,$ as J,y as N,X as q}from"./ResizeObserver.es.39b48a47.js";import{T as X}from"./index.34ac729a.js";import"./index.608320e9.js";import"./index.0e35d2fb.js";import{T as H,a as g}from"./index.5d4d28cc.js";import{D as Z,a as O}from"./index.720260d3.js";import"./index.db115763.js";import{E as $}from"./index.b6ce06cf.js";import{S as ee}from"./index.e10a1ae2.js";import{d as se,e as ae}from"./index.dc19bc54.js";import{c as te}from"./index.926ca9c5.js";import{g as oe}from"./music.0a307f27.js";import{S as ne}from"./select-subject.9a862edf.js";import{a as _,S}from"./hooks.6df65925.js";import{T as ce}from"./index.e90d2179.js";import{C as re}from"./index.970ad07b.js";const le="_search_1bfp1_4",ie="_sticky_1bfp1_13",ue="_searchCancel_1bfp1_19",me="_titleActive_1bfp1_47",pe="_title_1bfp1_47",be="_keywordTitle_1bfp1_56",he="_t_1bfp1_47",fe="_remove_1bfp1_69",Ae="_keywords_1bfp1_72",de="_content_1bfp1_78",ge="_searchKeyword_1bfp1_83",ve="_arrowMore_1bfp1_94",we="_label_1bfp1_105",_e="_bgImg_1bfp1_134",Se="_tagTabs_1bfp1_142",ke="_alubmGroupSearch_1bfp1_173",ye="_hotMusic_1bfp1_176",Ce="_swipeItem_1bfp1_179",Ie="_swipeChild_1bfp1_179",Te="_swipeTitle_1bfp1_197",Ee="_swipeContent_1bfp1_204",Re="_swipe_1bfp1_179",je="_num_1bfp1_218",Me="_hot_1bfp1_176",Ue="_swipeTop_1bfp1_240",Ne="_searchResult_1bfp1_246",He="_searchGroups_1bfp1_258",Le="_searchItem_1bfp1_267",Fe="_rName_1bfp1_272",Ve="_iconSearch_1bfp1_281",De="_searchAlbum_1bfp1_289";var t={search:le,sticky:ie,searchCancel:ue,titleActive:me,title:pe,keywordTitle:be,t:he,remove:fe,keywords:Ae,content:de,searchKeyword:ge,arrowMore:ve,label:we,bgImg:_e,tagTabs:Se,alubmGroupSearch:ke,hotMusic:ye,swipeItem:Ce,swipeChild:Ie,swipeTitle:Te,swipeContent:Ee,swipe:Re,num:je,hot:Me,swipeTop:Ue,searchResult:Ne,searchGroups:He,searchItem:Le,rName:Fe,iconSearch:Ve,searchAlbum:De},We="./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+XB077f168CuAfQCWVaEUpYtA3gHyfgR5T8J8X0Or4chfIcp7Kf4vHqNYFPL4HJsAW9CQgIAen1BaMhW3rWrJkj6Ze9Xm9E3JpjelEpFuMJcAuBinIK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RPZ4K9lhu5RZH0YDlePWCnUn9O8V5RgKzrfwVgK4i+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 A=new $,xe=h(),C=(m,p)=>{L().isApp?y({api:"openWebView",content:{url:m,orientation:1,isHideTitle:!1}}):p&&p()};var ze=W({name:"MusicSearchHeader",setup(){const m=_(S.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&&_(S.SEARCH,JSON.stringify({id:c,name:o}),"set")}localStorage.setItem("behaviorId",oe());const p=B(),a=K(),f=h(!1),r=h(""),k=h(""),l=se(a.path==="/music-songbook/search"?"music-search":"music-search-ablum",[]),i=h("all");a.path==="/music-songbook/result"&&(r.value=a.query.search,k.value="",i.value="all"),x((e,c)=>{var n,d;const o=_(S.SEARCH);if(b.name=o.name||"\u5168\u90E8\u58F0\u90E8",b.id=o.id,a.path==="/music-songbook/search"){r.value="",k.value="",i.value="all";try{(d=(n=xe.value)==null?void 0:n.resetTags)==null||d.call(n)}catch(D){console.log(D)}}return e.path==="/music-songbook/result"&&(r.value=e.query.search,console.log(r.value,"value",a.query),k.value="",i.value="all"),!0}),z(i,e=>{A.emit("changeTab",e,r.value)});const v=h([]),F=ae(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,d)=>{d<10&&(n.name=n.name.replace(e,`<span>${e}</span>`))}),v.value=o,f.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"&&w(),a.path==="/music-songbook/searchAlbum"&&w()),a.path!=="/music-songbook/searchAlbum"&&a.path!=="/music-songbook/result"?(p.replace({path:"/music-songbook/result",query:{search:e}}),f.value=!1,v.value=[]):(f.value=!1,A.emit("search",e))},T=h(),V=e=>{b.name=e.name,b.id=e.id,T.value.toggle(),_(S.SEARCH,JSON.stringify({id:e.id,name:e.name}),"set"),b.show=!1,A.emit("confirmSubject",b)},E=_(S.SEARCH),b=j({show:!1,name:E.name||"\u5168\u90E8\u58F0\u90E8",id:E.id||""}),R=h([]),u=j({line:0,arrowStatus:!1}),w=()=>{q(()=>{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(d){console.log(d,"Error")}})})};return a.path==="/music-songbook/search"&&w(),a.path==="/music-songbook/searchAlbum"&&w(),G(()=>{y({api:"backIconChange",content:{backIconHide:!0}})}),()=>s("div",{class:t.search},[s("div",{class:t.sticky},[s(ce,{position:"top"},{default:()=>[s(re,{isFixed:!1,background:"transparent",isBack:!1,title:" "},null),s(ee,{modelValue:r.value,background:"transparent",showAction:!0,onInput:e=>{r.value=e,e?F(e):(v.value=[],f.value=!1,a.path==="/music-songbook/result"&&p.replace("/music-songbook/search"),a.path==="/music-songbook/searchAlbum"&&A.emit("search",""))},onSearch:e=>{if(!e){a.path==="/music-songbook/searchAlbum"&&A.emit("search","");return}r.value=e,I(e)},type:"tenant"},{left:()=>a.path!=="/music-songbook/searchAlbum"&&s(Z,null,{default:()=>[s(O,{title:b.name,ref:T},{default:()=>[s(ne,{isReset:!0,searchParams:b,onComfirm:V},null)]})]}),action:()=>s("span",{class:t.searchCancel,onClick:()=>{L().isApp?y({api:"back"}):p.back()}},[M("\u53D6\u6D88")])}),a.path==="/music-songbook/result"&&!f.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(g,{title:"\u7EFC\u5408",name:"all"},null),s(g,{title:"\u5355\u66F2",name:"songe"},null),s(g,{title:"\u4E13\u8F91",name:"album"},null)]})]}),s("img",{class:t.bgImg,src:We},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:te(t.keywords)},[s("div",{class:t.content},[l.value.map((e,c)=>s(X,{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,w()}},[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(g,{title:"\u7EFC\u5408",name:"all"},null),s(g,{title:"\u5355\u66F2",name:"songe"},null),s(g,{title:"\u4E13\u8F91",name:"album"},null)]}),s(P,null,null),s("div",{class:[t.searchResult],style:{display:f.value?"block":"none"}},[s("div",{class:t.searchGroups},[v.value.map(e=>s("div",{class:t.searchItem,onClick:()=>{e.type==="ALBUM"?C(`${location.origin}/tenant/#/music-album-detail/${e.id}`,()=>{p.push({path:"/music-album-detail/"+e.id})}):C(`${location.origin}/tenant/#/music-detail?id=${e.id}&tenantAlbumId=${a.path==="/music-songbook/searchAlbum"?e.tenantAlbumId:""}&type=search`,()=>{p.push({path:"/music-detail",query:{id:e.id,tenantAlbumId:a.path==="/music-songbook/searchAlbum"?e.tenantAlbumId:"",type:"search"}})})}},[s("img",{src:Ye,class:t.iconSearch},null),s("span",{class:t.rName,innerHTML:e.name},null)])),v.value.length<=0&&s(Q,{tips:"\u6682\u65E0\u641C\u7D22\u7ED3\u679C",btnStatus:!1},null)])])])}}),rs=Object.freeze(Object.defineProperty({__proto__:null,mitter:A,openWebViewOrWeb:C,default:ze},Symbol.toStringTag,{value:"Module"}));export{rs as h,A as m,C as o,t as s};
|