search.vue
1.32 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
<template>
<div class="resIssue_search_container">
<NafmHeader title="注册发行" navClass="nafmii-head-bg3">
<template #bottom>
<SearchInput v-model="keyword" placeholder="请输入企业名称/注册报告名称/主承销商" @search="handleSearch" />
</template>
</NafmHeader>
<div class="resIssue_search_content">
<SearchHistory :list="list" @jumpPage="jumpDetail" @clear="handleClear" />
</div>
</div>
</template>
<script>
import SearchInput from '@/components/SearchInput.vue'
import SearchHistory from '@/components/SearchHistory'
import { setLocalStorage, getLocalStorage, removeLocalStorage } from '@/utils/LocalStorage'
export default {
name: 'ResIssueSearch',
components: {
SearchInput,
SearchHistory
},
data() {
return {
keyword: '',
list: []
}
},
mounted() {
this.list = getLocalStorage('resIssucessData') || []
},
methods: {
handleSearch(val) {
if (this.list.indexOf(val) === -1) {
this.list.unshift(val)
if (this.list.length > 10) {
this.list.pop()
}
setLocalStorage('resIssucessData', this.list)
}
},
jumpDetail(val) {
},
handleClear() {
this.list = []
removeLocalStorage('resIssucessData')
}
}
}
</script>
<style lang="less" scoped>
</style>