index.0e4be149.js 2.6 KB

1
  1. import{d as y,P as C,Q as T,U as a,V as x,bE as L,j as v}from"./ResizeObserver.es.f28023e0.js";import{d as M}from"./index.9a41251d.js";import k from"./index.83c4ce6c.js";import q from"./index.7ce263ff.js";import{m as o,s as w}from"./header.ba3cc48a.js";import{g as E}from"./music.96a1c334.js";import{a as O,S as P}from"./hooks.19957bf3.js";import"./index.79f59946.js";import"./use-tab-status.653933d8.js";import"./index.b0753b8c.js";import"./index.966d1893.js";import"./index.aa87c0e3.js";import"./use-id.cc14bbe9.js";import"./use-refs.b4f9d723.js";import"./index.22776016.js";import"./index.3b2e70c8.js";import"./index.975e8f79.js";import"./select-subject.c9c8869a.js";import"./index.af901340.js";import"./index.d038da33.js";import"./index.f0f901ab.js";import"./index.7a1af785.js";import"./icon-xin.575e2987.js";import"./index.bd375ca9.js";import"./index.787d69a0.js";import"./index.8b5ee282.js";import"./select-tag.89981fc2.js";import"./index.b5553db8.js";import"./index.49ee134a.js";import"./index.926ca9c5.js";import"./index.3bbba552.js";import"./index.9f739f31.js";import"./icon_uploader.5826c51d.js";import"./icon_album.eca1da54.js";import"./icon_album_active.a67a159e.js";import"./icon_exquisite.7cf228c5.js";import"./icon_music_active.5a84cf57.js";import"./icon-play.bc9e7aab.js";var Se=y({name:"MusicSearch",emits:["confirm"],setup(){localStorage.setItem("behaviorId",E());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=O(P.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:w.search},[s.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{Se as default};