index.5714da48.js 2.6 KB

1
  1. import{d as y,Q as C,S as T,V as a,W as x,bC as L,j as v}from"./index.c8a33855.js";import{c as M}from"./index.ed5eea4e.js";import k from"./index.ee55bf55.js";import q from"./index.578135f6.js";import{m as o,s as w}from"./header.29993887.js";import{g as O}from"./music.dcb2254f.js";import{a as V,S as A}from"./hooks.88972ca3.js";import"./index.e91b3eaf.js";import"./index.cf2652a7.js";import"./use-tab-status.9eeb64d0.js";import"./index.3dff5bed.js";import"./index.42df2d54.js";import"./use-id.c5c54d4f.js";import"./use-refs.ef9788ce.js";import"./index.24110c1a.js";import"./index.89b19a2f.js";import"./index.5792511e.js";import"./select-subject.1f30aaed.js";import"./index.d9b7361c.js";import"./index.36837871.js";import"./index.c3e67d80.js";import"./index.5da3180f.js";import"./icon-xin.df8ab2d7.js";import"./select-tag.70e5a2d3.js";import"./index.e3473eb6.js";import"./index.08e52374.js";import"./index.926ca9c5.js";import"./index.86e74b46.js";import"./index.module.7b815a85.js";import"./index.041659c0.js";import"./icon_uploader.9f387137.js";import"./icon_album.fa329df6.js";import"./icon_album_active.ce98b2a8.js";import"./icon_exquisite.69e33c80.js";import"./icon_music_active.3b316ab8.js";import"./icon-play.bc9e7aab.js";import"./index.00003e8f.js";import"./index.a0b72ee6.js";import"./use-height.f274d759.js";var je=y({name:"MusicSearch",emits:["confirm"],setup(){localStorage.setItem("behaviorId",O());const p=C(),j=T(),d=a(p.query.keyword||""),r=a(p.query.tagids||""),c=a(),R=a(!1),i=M("music-search",[]),m=a("songe"),I=V(A.SEARCH);c.value=I.id;const b=e=>{var t,u;d.value=e;const s=i.value.indexOf(e);s>-1&&i.value.splice(s,1),e&&(i.value.unshift(e),i.value.length=Math.min(i.value.length,5)),(u=(t=(m.value==="album"?n:l).value).onSearch)==null||u.call(t,e)},h=e=>{var t,u;const s=Object.values(e).flat().filter(Boolean).join(",");r.value=s,(u=(t=(m.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=(m.value==="album"?n:l).value).onComfirmSubject)==null||t.call(f,e)},n=a(null),l=a(null),S=e=>{m.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},[m.value==="album"?v(k,{hideSearch:!0,ref:n,defauleParams:{search:d.value,tagids:r.value,albumTagIds:r.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:r.value,musicTagIds:r.value,subjectIds:c.value}},null)])}});export{je as default};