|
@@ -11,20 +11,20 @@
|
11
|
11
|
</div>
|
12
|
12
|
<a @click="search">搜索</a>
|
13
|
13
|
</div>
|
14
|
|
- <div class="searchRemark" v-if="showSearchRemark">
|
|
14
|
+ <div class="searchRemark" v-if="showSearch">
|
15
|
15
|
<span>
|
16
|
16
|
关于“
|
17
|
|
- <em>{{indexSearchKey}}</em>”的搜索结果:
|
|
17
|
+ <em>{{doSearchKey}}</em>”的搜索结果:
|
18
|
18
|
</span>
|
19
|
19
|
</div>
|
20
|
|
- <div class="flex-item">
|
|
20
|
+ <div class="flex-item" :hidden="!showSearch">
|
21
|
21
|
<div>
|
22
|
|
- <div class="noData" v-if="noData">
|
|
22
|
+ <div class="noData" v-if="(books.list || []).length < 1">
|
23
|
23
|
<img src="../../../../common/icon/kong.png" alt>
|
24
|
24
|
<span>暂无内容</span>
|
25
|
25
|
</div>
|
26
|
|
- <ul>
|
27
|
|
- <li v-for="(item, index) in searchBooksList" :key="index">
|
|
26
|
+ <ul v-else>
|
|
27
|
+ <li v-for="(item, index) in books.list" :key="index">
|
28
|
28
|
<libraryListItem :data="item" @appointmentBook="appointmentBook"></libraryListItem>
|
29
|
29
|
</li>
|
30
|
30
|
</ul>
|
|
@@ -48,46 +48,41 @@
|
48
|
48
|
<script>
|
49
|
49
|
import libraryListItem from '../../../../components/libraryListItem/index'
|
50
|
50
|
import { mapState, createNamespacedHelpers } from 'vuex'
|
51
|
|
-const { mapActions: mapAppActions } = createNamespacedHelpers('app')
|
52
|
|
-const { mapState: mapLibraryState, mapActions: mapLibraryAction, mapMutations: mapLibraryMutations } = createNamespacedHelpers('library')
|
|
51
|
+const { mapState: mapBookState, mapActions: mapBookAction } = createNamespacedHelpers('book')
|
53
|
52
|
export default {
|
54
|
53
|
data () {
|
55
|
54
|
return {
|
56
|
55
|
searchKey: '',
|
57
|
|
- showSearchRemark: false,
|
|
56
|
+ showSearch: false,
|
58
|
57
|
noData: false,
|
59
|
|
- showAppointmentDialog: false
|
|
58
|
+ showAppointmentDialog: false,
|
|
59
|
+ caseid: '',
|
|
60
|
+ page: 1,
|
|
61
|
+ pagesize: 10,
|
|
62
|
+ doSearchKey: '',
|
60
|
63
|
}
|
61
|
64
|
},
|
62
|
65
|
created () {
|
|
66
|
+ this.caseid = this.$route.query.caseid
|
63
|
67
|
},
|
64
|
68
|
computed: {
|
65
|
|
- ...mapState({
|
66
|
|
- CaseList: x => x.app.CaseList,
|
67
|
|
- }),
|
68
|
|
- ...mapLibraryState({
|
69
|
|
- indexSearchKey: x => x.indexSearchKey,
|
70
|
|
- searchBooksList: x => x.searchBooksList
|
|
69
|
+ ...mapBookState({
|
|
70
|
+ books: x => x.books,
|
71
|
71
|
})
|
72
|
72
|
},
|
73
|
73
|
mounted () {
|
74
|
|
- this.$nextTick(() => {
|
75
|
|
- this.searchKey = this.indexSearchKey || ''
|
76
|
|
- })
|
77
|
74
|
},
|
78
|
75
|
components: {
|
79
|
76
|
libraryListItem
|
80
|
77
|
},
|
81
|
78
|
methods: {
|
82
|
|
- ...mapAppActions([
|
83
|
|
- 'getCaseList',
|
|
79
|
+ ...mapBookAction([
|
|
80
|
+ 'getBookList',
|
84
|
81
|
]),
|
85
|
|
- ...mapLibraryAction(['']),
|
86
|
|
- ...mapLibraryMutations(['setIndexSearchKey']),
|
87
|
82
|
search () { // 搜索
|
88
|
83
|
if (this.searchKey !== '') {
|
89
|
|
- this.setIndexSearchKey(this.searchKey)
|
90
|
|
- this.showSearchRemark = true
|
|
84
|
+ this.doSearchKey = this.searchKey
|
|
85
|
+ this.getSearchList()
|
91
|
86
|
} else {
|
92
|
87
|
this.$toast('搜索关键词不能为空')
|
93
|
88
|
}
|
|
@@ -98,6 +93,16 @@ export default {
|
98
|
93
|
sureAppointmentBook () { // 确定预约图书
|
99
|
94
|
this.showAppointmentDialog = false
|
100
|
95
|
},
|
|
96
|
+ getSearchList () {
|
|
97
|
+ this.getBookList({
|
|
98
|
+ caseid: this.caseid,
|
|
99
|
+ name: this.doSearchKey,
|
|
100
|
+ page: this.page,
|
|
101
|
+ pagesize: this.pagesize,
|
|
102
|
+ }).then(() => {
|
|
103
|
+ this.showSearch = true
|
|
104
|
+ })
|
|
105
|
+ },
|
101
|
106
|
}
|
102
|
107
|
}
|
103
|
108
|
</script>
|