[update] 首页搜索回车跳转标题搜索

This commit is contained in:
lideqin
2024-03-18 10:37:27 +08:00
parent 10cf7ccd9e
commit 44c8ccbc94
2 changed files with 26 additions and 2 deletions
+13 -1
View File
@@ -11,7 +11,7 @@
</a-select-option>
<i slot="suffixIcon" class="iconfont icon-nav-bottom"></i>
</a-select>
<a-input v-model="searchValue" :placeholder="$t('pleaseEnter')">
<a-input v-model="searchValue" :placeholder="$t('pleaseEnter')" @pressEnter="searchInputEnter">
<i slot="prefix" class="iconfont icon-Searchbar_Search_icon"></i>
<!--<a-icon type="search" />-->
</a-input>
@@ -49,6 +49,18 @@ export default {
}
})
},
// 回车跳标题检索
searchInputEnter () {
const { href } = this.$router.resolve({
path: '/generalSearch',
query: {
type: 'title',
resourceType: this.resourceType,
searchValue: this.searchValue
}
})
window.open(href, '_blank')
},
// 点击跳转到一般检索页
toSearchWindow (type) {
const { href } = this.$router.resolve({
@@ -8,7 +8,7 @@
{{ item.title }}
</a-select-option>
</a-select>
<a-input v-model="searchValue" :placeholder="$t('pleaseEnter')"></a-input>
<a-input v-model="searchValue" :placeholder="$t('pleaseEnter')" @pressEnter="searchInputEnter"></a-input>
<a-button type="primary" @click="toSearchWindow('title')">标题检索</a-button>
<a-button type="primary" @click="toSearchWindow('fullText')">全文检索</a-button>
<a-button type="primary" ghost @click="toAdvancedSearch">高级检索</a-button>
@@ -137,6 +137,18 @@ export default {
}
})
},
// 回车跳标题检索
searchInputEnter () {
const { href } = this.$router.resolve({
path: '/generalSearch',
query: {
type: 'title',
resourceType: this.resourceType,
searchValue: this.searchValue
}
})
window.open(href, '_blank')
},
// 点击跳转到一般检索页
toSearchWindow (type) {
const { href } = this.$router.resolve({