search.vue
1.65 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
<template>
<div class="search-layout">
<nafm-header title="注册发行" navClass="nafmii-head-bg3">
<template #bottom>
<SearchInput v-model.trim="keyword" placeholder="请输入企业名称/注册报告名称/主承销商" @search="handleSearch" />
</template>
</nafm-header>
<div class="history-container">
<SearchHistory stateKey="RegIssue" @jumpPage="jumpResultPage" />
</div>
<slot />
</div>
</template>
<script>
import SearchInput from '@/components/SearchInput';
import SearchHistory from '@/components/SearchHistory';
import {KeywordBus} from '@/utils/eventBus'
export default {
name: 'ResIssueSearch', // 注册发行搜索页面
components: {
SearchInput,
SearchHistory
},
data() {
return {
keyword: ''
}
},
mounted() {
},
methods: {
handleJumpAction(keyword) {
this.$store.dispatch('search/APushRegIssueSearchValue', keyword)
KeywordBus.emit(keyword)
this.$router.back()
},
// 点击历史搜索页面tag签 或者搜索关键字回车 跳转到 搜索页面
handleSearch(val) {
const keyword = val || this.keyword
if (!keyword) {
Toast('搜索内容不能为空')
return
}
this.handleJumpAction(keyword)
},
jumpResultPage(val) {
this.handleJumpAction(val)
},
}
}
</script>
<style lang="less" scoped>
.search-layout {
height: 100%;
display: flex;
flex-direction: column;
.history-container {
flex: 1;
}
}
/deep/ .nav_bottom_container {
display: flex;
flex-direction: row;
align-items: center;
.filter {
width: 18px;
height: 21px;
margin-left: 15px;
}
}
</style>