text: (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-bdc5e3b8"],{"48aa":function(e,t,n){"use strict";n.r(t);var s=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"panel-search",attrs:{flex:"dir:top"}},[n("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(t)}}},[n("d2-icon-svg",{staticClass:"panel-search__logo",attrs:{name:"d2-admin-text"}}),n("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(t)}},scopedSlots:e._u([{key:"default",fn:function(e){var t=e.item;return n("d2-panel-search-item",{attrs:{item:t}})}}]),model:{value:e.searchText,callback:function(t){e.searchText=t},expression:"searchText"}}),n("div",{staticClass:"panel-search__tip"},[e._v(" 您可以使用快捷键 "),n("span",{staticClass:"panel-search__key"},[e._v(e._s(e.hotkey.open))]),e._v(" 唤醒搜索面板，按 "),n("span",{staticClass:"panel-search__key"},[e._v(e._s(e.hotkey.close))]),e._v(" 关闭 ")])],1),e.resultsList.length>0?n("div",{staticClass:"panel-search__results-group",attrs:{"flex-box":"1"}},[n("el-card",{attrs:{shadow:"never"}},[n("div",{staticClass:"panel-search__results-group-inner"},e._l(e.resultsList,(function(t,s){return n("d2-panel-search-item",{key:s,attrs:{item:t,"hover-mode":!0},nativeOn:{click:function(n){return e.handleResultsGroupItemClick(t.path)}}})})),1)])],1):e._e()])},a=[],r=(n("d81d"),n("d3b7"),n("ac1f"),n("841c"),n("96cf"),n("1da1")),c=n("5530"),i=n("6062"),u=n("2f62"),l=n("b55f"),o={mixins:[l["a"]],components:{"d2-panel-search-item":function(){return n.e("chunk-795cb6f9").then(n.bind(null,"f1ee"))}},data:function(){return{searchText:"",results:[]}},computed:Object(c["a"])(Object(c["a"])({},Object(u["e"])("d2admin/search",["hotkey","pool"])),{},{resultsList:function(){return 0===this.results.length&&""===this.searchText?this.pool.map((function(e){return Object(c["a"])({value:e.fullTitle},e)})):this.results},fuse:function(){return new i["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"])(regeneratorRuntime.mark((function n(){var s;return regeneratorRuntime.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"])(regeneratorRuntime.mark((function t(){return regeneratorRuntime.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)})))()}}},h=o,p=(n("92d6"),n("2877")),f=Object(p["a"])(h,s,a,!1,null,"37377ffe",null);t["default"]=f.exports},"8a34":function(e,t,n){},"92d6":function(e,t,n){"use strict";n("8a34")}}]);