index.vue
1.79 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
72
73
74
75
76
77
78
<!--
* @Description:
* @Author: huyue
* @Date: 2022-05-31 17:23:27
* @LastEditors: huyue
* @LastEditTime: 2022-06-07 18:53:43
-->
<template>
<div class="solicit-container">
<tab :list="['总览', `跟进(${countData.tabPageFollowUpCount})`, `结果(${countData.tabPageResultCount})`]" :index="currentIndex" @change="changeIndex"></tab>
<div class="solicit-content">
<overview v-if="currentIndex == 0" @getCountInfo="getCountInfo"></overview>
<follow v-if="currentIndex == 1"></follow>
<result v-if="currentIndex == 2"></result>
</div>
</div>
</template>
<script>
import overview from './overview.vue'
import follow from './follow.vue'
import result from './result.vue'
import { mapState, mapMutations } from 'vuex'
export default {
name: 'index',
data() {
return {
tabList: ['总览', '跟进', '结果'],
countData: {
tabPageFollowUpCount: 0,
tabPageResultCount: 0
}
}
},
watch: {
overviewCountInfo: {
handler(n) {
this.countData = n
},
immediate: true,
deep: true
}
},
components: {
overview,
follow,
result
},
computed: {
...mapState({
currentIndex: state => state.solicit.currentIndex,
overviewCountInfo: state => state.solicit.overviewCountInfo
})
},
methods: {
...mapMutations({
SET_TAB_INDEX: 'solicit/SET_TAB_INDEX',
SET_OVERVIEW_COUNT_INFO: 'solicit/SET_OVERVIEW_COUNT_INFO'
}),
changeIndex(index) {
this.SET_TAB_INDEX({ currentIndex: index })
},
getCountInfo(val) {
this.SET_OVERVIEW_COUNT_INFO({
overviewCountInfo: val
})
}
}
}
</script>
<style lang="scss" scoped>
.solicit-container {
.solicit-content {
padding: 16px;
width: 100%;
box-sizing: border-box;
}
}
</style>