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