index.d0b9b1bd.js 2.6 KB

1
  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.39b48a47.js";import{d as M}from"./index.dc19bc54.js";import k from"./index.a4cd9536.js";import q from"./index.0962fc25.js";import{m as o,s as w}from"./header.f876530b.js";import{g as O}from"./music.27f3de35.js";import{a as P,S as V}from"./hooks.6df65925.js";import"./index.6c529ad4.js";import"./use-tab-status.bcc0c503.js";import"./index.608320e9.js";import"./index.0e35d2fb.js";import"./index.5d4d28cc.js";import"./use-id.b004ff17.js";import"./use-refs.07204da6.js";import"./index.e10a1ae2.js";import"./index.db115763.js";import"./index.428ab1a8.js";import"./select-subject.5a3e156f.js";import"./index.34ac729a.js";import"./index.25ff6681.js";import"./index.5416c7b0.js";import"./index.fcbcb027.js";import"./icon-xin.797feb04.js";import"./index.970ad07b.js";import"./index.e90d2179.js";import"./index.1f05bcbc.js";import"./select-tag.c133608d.js";import"./index.0a093430.js";import"./index.3c44a6d7.js";import"./index.926ca9c5.js";import"./index.a256e876.js";import"./index.fbd2c321.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};