1 |
- import{d as y,P as C,Q as T,U as a,V as x,bi as L,j as v}from"./ResizeObserver.es.b7226882.js";import{d as M}from"./index.1eaf642c.js";import k from"./index.077dc552.js";import q from"./index.89aec646.js";import{m as o,s as w}from"./header.24738bfa.js";import{g as O}from"./music.e5884c70.js";import{a as P,S as V}from"./hooks.a4ed20cb.js";import"./index.9fec2202.js";import"./use-tab-status.db1f6d2e.js";import"./index.f6c44874.js";import"./index.cf00521e.js";import"./index.dc988884.js";import"./use-id.5d5e6e63.js";import"./use-refs.428b450a.js";import"./index.521acd0b.js";import"./index.40f703b6.js";import"./index.021f1c7b.js";import"./select-subject.26eff12f.js";import"./index.ed3a5560.js";import"./index.320010a3.js";import"./index.023f50db.js";import"./index.20c0f4c5.js";import"./icon-xin.797feb04.js";import"./index.969bba7f.js";import"./index.1743594f.js";import"./index.deda73db.js";import"./select-tag.09b8e6bc.js";import"./index.1799aedf.js";import"./index.b1e15d61.js";import"./index.926ca9c5.js";import"./index.5f9ef71b.js";import"./index.f4934f0d.js";import"./icon_uploader.21a85a4d.js";import"./icon_album.4957b8e0.js";import"./icon_album_active.cb923735.js";import"./icon_exquisite.01ddc5aa.js";import"./icon_music_active.f55820b3.js";import"./icon-play.bc9e7aab.js";var Se=y({name:"MusicSearch",emits:["confirm"],setup(){localStorage.setItem("behaviorId",O());const p=C(),j=T(),d=a(p.query.keyword||""),i=a(p.query.tagids||""),c=a(),R=a(!1),r=M("music-search",[]),s=a("songe"),I=P(V.SEARCH);c.value=I.id;const b=e=>{var t,u;d.value=e;const m=r.value.indexOf(e);m>-1&&r.value.splice(m,1),e&&(r.value.unshift(e),r.value.length=Math.min(r.value.length,5)),(u=(t=(s.value==="album"?n:l).value).onSearch)==null||u.call(t,e)},h=e=>{var t,u;const m=Object.values(e).flat().filter(Boolean).join(",");i.value=m,(u=(t=(s.value==="album"?n:l).value).onComfirm)==null||u.call(t,e),R.value=!1},g=e=>{var f,t;c.value=e.id,(t=(f=(s.value==="album"?n:l).value).onComfirmSubject)==null||t.call(f,e)},n=a(null),l=a(null),S=e=>{s.value=e};return x(()=>{o.on("changeTab",S),o.on("search",b),o.on("confirm",h),o.on("confirmSubject",g)}),L(()=>{o.off("changeTab",S),o.off("search",b),o.off("confirm",h),o.off("confirmSubject",g)}),()=>v("div",{class:w.search},[s.value==="album"?v(k,{hideSearch:!0,ref:n,defauleParams:{search:d.value,tagids:i.value,albumTagIds:i.value,subjectIds:c.value}},null):v(q,{hideSearch:!0,ref:l,onItemClick:e=>{j.push({path:"/music-detail",query:{id:e.id,albumId:p.params.id}})},defauleParams:{search:d.value,tagids:i.value,musicTagIds:i.value,subjectIds:c.value}},null)])}});export{Se as default};
|