1 |
- import{d as k,V as d,aq as S,$ as C,as as x,U as R,ao as T,h as O,a as o,S as V,u as g,G as K,H as b,z as M,x as I,R as U,P as _}from"./vendor.405ecf9c.js";/* empty css *//* empty css *//* empty css *//* empty css */import{C as z}from"./index.96f38933.js";import{c as N}from"./index.126c459c.js";import{c as P}from"./index.926ca9c5.js";import{S as B}from"./select-tag.311251e0.js";import{g as H}from"./music.0716f1be.js";import{S as $}from"./select-subject.ddf4d650.js";function q(s){return{all:s=s||new Map,on:function(r,a){var t=s.get(r);t?t.push(a):s.set(r,[a])},off:function(r,a){var t=s.get(r);t&&(a?t.splice(t.indexOf(a)>>>0,1):s.set(r,[]))},emit:function(r,a){var t=s.get(r);t&&t.slice().map(function(l){l(a)}),(t=s.get("*"))&&t.slice().map(function(l){l(r,a)})}}}const A="_search_ngdof_1",D="_sticky_ngdof_9",F="_title_ngdof_15",G="_keywords_ngdof_21",L="_content_ngdof_28",W="_searchKeyword_ngdof_38",E="_remove_ngdof_46",J="_label_ngdof_49";var i={search:A,sticky:D,title:F,keywords:G,content:L,searchKeyword:W,remove:E,label:J};function Q(s){return typeof s=="function"||Object.prototype.toString.call(s)==="[object Object]"&&!I(s)}const m=q(),y=d();var X=k({name:"MusicSearchHeader",setup(){const s=d();localStorage.setItem("behaviorId",H());const r=S(),a=C(),t=d(""),l=d(""),h=d(!1),c=N("music-search",[]),f=d("songe");x(()=>{var e,u;if(a.path==="/music-songbook/search"){t.value="",l.value="",n.name="\u5168\u90E8",n.id="",f.value="songe";try{(u=(e=y.value)==null?void 0:e.resetTags)==null||u.call(e)}catch(v){console.log(v)}}return!0}),R(f,e=>{m.emit("changeTab",e)});const p=e=>{t.value=e;const u=c.value.indexOf(e);u>-1&&c.value.splice(u,1),e&&(c.value.unshift(e),c.value.length=Math.min(c.value.length,5)),m.emit("search",e)},w=(e,u="")=>{const v=Object.values(e).flat().filter(Boolean).join(",");l.value=v,m.emit("confirm",e),h.value=!1},j=e=>{n.name=e.name,n.id=e.id,m.emit("confirmSubject",n),n.show=!1};T(()=>{});const n=O({show:!1,name:"\u5168\u90E8",id:""});return()=>o("div",{class:i.search},[o(V,{class:i.sticky},{default:()=>[o(z,{modelValue:t.value,showAction:!0,ref:s,onSearch:p,onFilter:()=>h.value=!0,filterDot:!!l.value,onClick:()=>{a.path==="/music-songbook"&&r.push({path:"/music-songbook/search"})}},{left:()=>o("div",{class:i.label,onClick:()=>n.show=!0},[n.name,o(g,{classPrefix:"iconfont",name:"down",size:12,color:"#333"},null)])}),a.path==="/music-songbook/search"&&o(K,{color:"var(--van-primary)",background:"transparent",lineWidth:20,shrink:!0,active:f.value,"onUpdate:active":e=>f.value=e,onChange:e=>f.value=e},{default:()=>[o(b,{title:"\u5355\u66F2",name:"songe"},null),o(b,{title:"\u4E13\u8F91",name:"album"},null)]})]}),c.value.length>0&&a.path==="/music-songbook/search"&&o("div",{class:P(i.keywords,"van-hairline--bottom")},[o("div",{class:i.content},[c.value.map(e=>o(M,{round:!0,class:i.searchKeyword,key:e,onClick:()=>p(e)},Q(e)?e:{default:()=>[e]}))]),o(g,{class:i.remove,name:"delete-o",onClick:()=>c.value=[]},null)]),o(U,null,null),o(_,{show:h.value,round:!0,closeable:!0,position:"bottom",style:{height:"60%"},teleport:"body","onUpdate:show":e=>h.value=e},{default:()=>[o(B,{ref:y,onConfirm:w,onCancel:()=>{}},null)]}),o(_,{show:n.show,position:"bottom",round:!0,closeable:!0,"safe-area-inset-bottom":!0,onClose:()=>n.show=!1,onClosed:()=>n.show=!1},{default:()=>[o($,{isReset:!0,onComfirm:j},null)]})])}}),ie=Object.freeze({__proto__:null,[Symbol.toStringTag]:"Module",mitter:m,default:X});export{ie as h,m,i as s};
|