1 |
- import{d as x,U as a,a5 as b,a as t,S as y,G as _,H as p,z as S,x as g,I as k,P as w}from"./vendor.372dc65e.js";/* empty css *//* empty css *//* empty css *//* empty css */import{S as C}from"./index.da09e935.js";import{d as R}from"./index.406b9d83.js";import L from"./index.29ec408e.js";import O from"./index.5766f57d.js";import{c as T}from"./index.926ca9c5.js";import{S as K}from"./select-tag.dc3f52d8.js";/* empty css *//* empty css *//* empty css */import"./index.84d59606.js";import"./item.b8ded331.js";/* empty css */import"./footer.5093eb25.js";import"./favorite.9bdf4305.js";import"./index.75b00e65.js";/* empty css *//* empty css */import"./item.8cb8443f.js";import"./init-user-icon.d5c3c464.js";const M="_search_1ihx9_1",P="_sticky_1ihx9_9",V="_title_1ihx9_15",N="_keywords_1ihx9_21",U="_content_1ihx9_28",A="_searchKeyword_1ihx9_34",I="_remove_1ihx9_41";var r={search:M,sticky:P,title:V,keywords:N,content:U,searchKeyword:A,remove:I};function z(o){return typeof o=="function"||Object.prototype.toString.call(o)==="[object Object]"&&!g(o)}var ue=x({name:"MusicSearch",setup(){a(!1);const o=a(""),u=a("");a([]),a([]);const d=a(!1),s=R("music-search",[]),i=a("album"),h=e=>{var l,c;o.value=e;const n=s.value.indexOf(e);n>-1&&s.value.splice(n,1),e&&(s.value.unshift(e),s.value.length=Math.min(s.value.length,5)),(c=(l=(i.value==="album"?m:v).value).onSearch)==null||c.call(l,e)},j=e=>{var l,c;const n=Object.values(e).flat().filter(Boolean).join(",");u.value=n,(c=(l=(i.value==="album"?m:v).value).onComfirm)==null||c.call(l,e),d.value=!1},m=a(null),v=a(null);return b(()=>{var n,f;(f=(n=(i.value==="album"?m:v).value).onSearch)==null||f.call(n,"")}),()=>t("div",{class:r.search},[t(y,{class:r.sticky},{default:()=>[t(C,{modelValue:o.value,showAction:!0,autofocus:!0,onSearch:h,onFilter:()=>d.value=!0,filterDot:!!u.value},null),t(_,{color:"var(--van-primary)",background:"transparent",lineWidth:20,shrink:!0,active:i.value,"onUpdate:active":e=>i.value=e,onChange:e=>i.value=e},{default:()=>[t(p,{title:"\u4E13\u8F91",name:"album"},null),t(p,{title:"\u5355\u66F2",name:"songe"},null)]})]}),s.value.length>0&&t("div",{class:T(r.keywords,"van-hairline--bottom")},[t("div",{class:r.content},[s.value.map(e=>t(S,{round:!0,class:r.searchKeyword,key:e,onClick:()=>h(e)},z(e)?e:{default:()=>[e]}))]),t(k,{class:r.remove,name:"delete-o",onClick:()=>s.value=[]},null)]),i.value==="album"?t(L,{hideSearch:!0,ref:m,defauleParams:{search:o.value,tagids:u.value}},null):t(O,{hideSearch:!0,ref:v,defauleParams:{search:o.value,tagids:u.value}},null),t(w,{show:d.value,round:!0,closeable:!0,position:"bottom",style:{height:"60%"},teleport:"body","onUpdate:show":e=>d.value=e},{default:()=>[t(K,{onComfirm:j,onCancel:()=>{}},null)]})])}});export{ue as default};
|