(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2fde50ca"],{"335b":function(e,t,n){"use strict";n("fd2f")},"48aa":function(e,t,n){"use strict";n.r(t);var s=function(){var e=this,t=e._self._c;return t("div",{staticClass:"panel-search",attrs:{flex:"dir:top"}},[t("div",{staticClass:"panel-search__input-group",attrs:{"flex-box":"0",flex:"dir:top main:center cross:center"},on:{click:function(t){return t.target!==t.currentTarget?null:e.handlePanelClick.apply(null,arguments)}}},[t("d2-icon-svg",{staticClass:"panel-search__logo",staticStyle:{width:"200px",height:"200px"},attrs:{name:"dvadmin"}}),t("el-autocomplete",{ref:"input",staticClass:"panel-search__input",attrs:{"suffix-icon":"el-icon-search",placeholder:"搜索页面","fetch-suggestions":e.querySearch,"trigger-on-focus":!1,clearable:!0},on:{select:e.handleSelect},nativeOn:{keydown:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"esc",27,t.key,["Esc","Escape"])?null:e.handleEsc.apply(null,arguments)}},scopedSlots:e._u([{key:"default",fn:function(e){var n=e.item;return t("d2-panel-search-item",{attrs:{item:n}})}}]),model:{value:e.searchText,callback:function(t){e.searchText=t},expression:"searchText"}}),t("div",{staticClass:"panel-search__tip"},[e._v(" 您可以使用快捷键 "),t("span",{staticClass:"panel-search__key"},[e._v(e._s(e.hotkey.open))]),e._v(" 唤醒搜索面板，按 "),t("span",{staticClass:"panel-search__key"},[e._v(e._s(e.hotkey.close))]),e._v(" 关闭 ")])],1),e.resultsList.length>0?t("div",{staticClass:"panel-search__results-group",attrs:{"flex-box":"1"}},[t("el-card",{attrs:{shadow:"never"}},[t("div",{staticClass:"panel-search__results-group-inner"},e._l(e.resultsList,(function(n,s){return t("d2-panel-search-item",{key:s,attrs:{item:n,"hover-mode":!0},nativeOn:{click:function(t){return e.handleResultsGroupItemClick(n.path)}}})})),1)])],1):e._e()])},a=[],c=n("c7eb"),r=n("1da1"),i=n("5530"),l=(n("d81d"),n("e9f5"),n("ab43"),n("d3b7"),n("ac1f"),n("3ca3"),n("841c"),n("ddb0"),n("8d85")),u=n.n(l),o=n("5880"),h=n("b55f"),p={mixins:[h["a"]],components:{"d2-panel-search-item":function(){return n.e("chunk-2e7b3a9d").then(n.bind(null,"f1ee"))}},data:function(){return{searchText:"",results:[]}},computed:Object(i["a"])(Object(i["a"])({},Object(o["mapState"])("d2admin/search",["hotkey","pool"])),{},{resultsList:function(){return 0===this.results.length&&""===this.searchText?this.pool.map((function(e){return Object(i["a"])({value:e.fullTitle},e)})):this.results},fuse:function(){return new u.a(this.pool,{shouldSort:!0,tokenize:!0,threshold:.6,location:0,distance:100,maxPatternLength:32,minMatchCharLength:1,keys:["fullTitle","path"]})}}),methods:{querySearch:function(e,t){var n=this.fuse.search(e).map((function(e){return e.item}));this.results=n,t(n)},focus:function(){var e=this;this.input="",setTimeout((function(){e.$refs.input&&e.$refs.input.focus(),e.searchText="",e.results=[]}),500)},handleResultsGroupItemClick:function(e){e!==this.$route.path?this.handleMenuSelect(e):this.handleEsc()},handleSelect:function(e){var t=this;return Object(r["a"])(Object(c["a"])().mark((function n(){var s;return Object(c["a"])().wrap((function(n){while(1)switch(n.prev=n.next){case 0:if(s=e.path,s!==t.$route.path){n.next=4;break}return t.handleEsc(),n.abrupt("return");case 4:return n.next=6,t.$nextTick();case 6:t.handleMenuSelect(s);case 7:case"end":return n.stop()}}),n)})))()},closeSuggestion:function(){this.$refs.input.activated&&(this.$refs.input.suggestions=[],this.$refs.input.activated=!1)},handlePanelClick:function(){this.handleEsc()},handleEsc:function(){var e=this;return Object(r["a"])(Object(c["a"])().mark((function t(){return Object(c["a"])().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return e.closeSuggestion(),t.next=3,e.$nextTick();case 3:e.$emit("close");case 4:case"end":return t.stop()}}),t)})))()}}},f=p,d=(n("335b"),n("2877")),k=Object(d["a"])(f,s,a,!1,null,"fe732fea",null);t["default"]=k.exports},fd2f:function(e,t,n){}}]);