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