index.138ffa49.js 2.6 KB

1
  1. import{d as y,O as C,P as T,S as a,U as x,bC as L,j as v}from"./index.394decd7.js";import{d as M}from"./index.75a0444f.js";import O from"./index.26e661c3.js";import k from"./index.12f35f00.js";import{m as o,s as q}from"./header.4ae4bb8c.js";import{g as w}from"./music.8e2b5f5b.js";import{a as P,S as A}from"./hooks.9e5ee122.js";import"./index.b9aedd1d.js";import"./index.dc786267.js";import"./use-tab-status.723110ee.js";import"./index.3bbf4ddb.js";import"./index.f1b52763.js";import"./index.ae00317c.js";import"./use-id.e2f22365.js";import"./use-refs.09b2d19c.js";import"./index.ada5e712.js";import"./index.9e0d46e4.js";import"./index.224299a1.js";import"./select-subject.2c6b1606.js";import"./index.dab716ce.js";import"./index.e5a263f6.js";import"./index.9849c993.js";import"./index.ae2dd816.js";import"./icon-xin.62588855.js";import"./index.e6e212d8.js";import"./index.88270f6d.js";import"./select-tag.9412794d.js";import"./index.24fb4ee4.js";import"./index.b91a923c.js";import"./index.926ca9c5.js";import"./index.e164926c.js";import"./index.3dfdbf1b.js";import"./icon_uploader.ff962490.js";import"./icon_album.ed729d4a.js";import"./icon_album_active.469423f9.js";import"./icon_exquisite.4b18ad76.js";import"./icon_music_active.1e7b47ef.js";import"./icon-play.bc9e7aab.js";var Se=y({name:"MusicSearch",emits:["confirm"],setup(){localStorage.setItem("behaviorId",w());const p=C(),j=T(),d=a(p.query.keyword||""),r=a(p.query.tagids||""),c=a(),R=a(!1),i=M("music-search",[]),s=a("songe"),I=P(A.SEARCH);c.value=I.id;const b=e=>{var t,u;d.value=e;const m=i.value.indexOf(e);m>-1&&i.value.splice(m,1),e&&(i.value.unshift(e),i.value.length=Math.min(i.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(",");r.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:q.search},[s.value==="album"?v(O,{hideSearch:!0,ref:n,defauleParams:{search:d.value,tagids:r.value,albumTagIds:r.value,subjectIds:c.value}},null):v(k,{hideSearch:!0,ref:l,onItemClick:e=>{j.push({path:"/music-detail",query:{id:e.id,albumId:p.params.id}})},defauleParams:{search:d.value,tagids:r.value,musicTagIds:r.value,subjectIds:c.value}},null)])}});export{Se as default};