增加了elasticsearch全局搜索和文章内搜索

This commit is contained in:
暮光:城中城
2019-07-11 23:36:30 +08:00
parent 9a50db6b5d
commit a081443c91
21 changed files with 1132 additions and 131 deletions

View File

@@ -20,8 +20,8 @@
<div align="center">
<el-button v-on:click="createWiki" icon="el-icon-plus" style="width: 100%;">创建文档</el-button>
</div>
<el-input v-model="searchKeywords" @keyup.enter.native="searchByKeywords" placeholder="搜索文档" style="margin: 10px 0;">
<el-button slot="append" icon="el-icon-search" v-on:click="searchByKeywords"></el-button>
<el-input v-model="searchKeywords" @input="searchByKeywords" @keyup.enter.native="searchByKeywords" placeholder="搜索文档" style="margin: 10px 0;">
<el-button slot="append" icon="el-icon-search" v-on:click="searchByKeywordsNewPage"></el-button>
</el-input>
<el-tree :props="defaultProps" :data="wikiPageList" @node-click="handleNodeClick"
@node-expand="handleNodeExpand" draggable @node-drop="handlePageDrop"
@@ -207,6 +207,10 @@
searchByKeywords() {
this.$refs.wikiPageTree.filter(app.searchKeywords);
},
searchByKeywordsNewPage() {
var routeUrl = this.$router.resolve({path: '/page/search', query: {keywords: app.searchKeywords}});
window.open(routeUrl.href, '_blank');
},
handleNodeClick(data) {
console.log("点击节点:", data);
this.nowClickPath = {spaceId: this.nowClickPath.spaceId, pageId: data.id, parentId: data.id, path: data.path};