import{d as _,ak as C,r as k,al as R,Q as T,a8 as n,o as I,c as Q,M as l,G as u,a as B,K as M,L as N,n as O}from"./vue.95e072e2.js";import{C as A,F}from"./index.8a64ecdf.js";import{_ as H}from"./_plugin-vue_export-helper.c27b6911.js";import"./elementPlus.58179425.js";import"./echarts.72dc8373.js";const U={class:"layout-search-dialog"},$=_({name:"layoutBreadcrumbSearch"}),b=_({...$,setup(j,{expose:d}){const f=A(),{tagsViewRoutes:h}=C(f),m=k(),{t:w}=F.useI18n(),p=R(),t=T({isShowSearch:!1,menuQuery:"",tagsViewList:[]}),S=()=>{t.menuQuery="",t.isShowSearch=!0,v(),O(()=>{setTimeout(()=>{m.value.focus()})})},V=()=>{t.isShowSearch=!1},g=(e,o)=>{let s=e?t.tagsViewList.filter(L(e)):t.tagsViewList;o(s)},L=e=>o=>o.path.toLowerCase().indexOf(e.toLowerCase())>-1||o.meta.title.toLowerCase().indexOf(e.toLowerCase())>-1||w(o.meta.title).indexOf(e.toLowerCase())>-1,v=()=>{if(t.tagsViewList.length>0)return!1;h.value.map(e=>{var o;(o=e.meta)!=null&&o.isHide||t.tagsViewList.push({...e})})},x=e=>{var c,r,i;let{path:o,redirect:s}=e;(c=e.meta)!=null&&c.isLink&&!((r=e.meta)!=null&&r.isIframe)?window.open((i=e.meta)==null?void 0:i.isLink):s?p.push(s):p.push(o),V()};return d({openSearch:S}),(e,o)=>{const s=n("ele-Search"),c=n("el-icon"),r=n("SvgIcon"),i=n("el-autocomplete"),y=n("el-dialog");return I(),Q("div",U,[l(y,{modelValue:t.isShowSearch,"onUpdate:modelValue":o[1]||(o[1]=a=>t.isShowSearch=a),"destroy-on-close":"","show-close":!1},{footer:u(()=>[l(i,{modelValue:t.menuQuery,"onUpdate:modelValue":o[0]||(o[0]=a=>t.menuQuery=a),"fetch-suggestions":g,placeholder:e.$t("message.user.searchPlaceholder"),ref_key:"layoutMenuAutocompleteRef",ref:m,onSelect:x,"fit-input-width":!0},{prefix:u(()=>[l(c,{class:"el-input__icon"},{default:u(()=>[l(s)]),_:1})]),default:u(({item:a})=>[B("div",null,[l(r,{name:a.meta.icon,class:"mr5"},null,8,["name"]),M(" "+N(e.$t(a.meta.title)),1)])]),_:1},8,["modelValue","placeholder"])]),_:1},8,["modelValue"])])}}});const z=H(b,[["__scopeId","data-v-a11c6061"]]);export{z as default};
