8ea9c133
陈威
初始化提交
|
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
|
<template>
<content-layout
:tab-pane-list="currentShowTab"
@tab-click="handleTabClick"
@node-click="handleNodeClick"
>
<keep-alive :include="keepaliveComponents">
<component
:is="currentView[currentActiveTab]"
:ref="`${currentActiveTab}Table`"
v-loading="loading"
></component>
</keep-alive>
</content-layout>
</template>
<script>
import { mapState } from 'vuex'
import { TAB_PANE_LIST, COMPONENTS_MAP } from './const'
import processClassify from '@/mixins/processClassify.js'
import fromModule from '@/mixins/fromModule'
export default {
name: 'CirculateMatter',
components: {
Received: () => import('./Received'),
Circulated: () => import('./Circulated'),
ContentLayout: () => import('@/views/matter/components/ContentLayout'),
},
mixins: [processClassify, fromModule],
data() {
return {
currentTabPaneList: TAB_PANE_LIST,
currentActiveTab: this.$route.query.tabActiveName || 'received',
currentView: COMPONENTS_MAP,
isKeepalive: false,
}
},
computed: {
...mapState('user', ['account']),
isShowAside() {
return this.currentActiveTab === 'received' ? false : true
},
keepaliveComponents() {
return this.isKeepalive ? Object.values(COMPONENTS_MAP) : []
},
},
activated() {
this.currentActiveTab = this.$route.query.tabActiveName || 'received'
},
created() {
if (localStorage.getItem(`keepalive_${this.account}`)) {
const keepaliveRouteList = JSON.parse(
localStorage.getItem(`keepalive_${this.account}`)
)
if (keepaliveRouteList && keepaliveRouteList.length) {
this.isKeepalive = keepaliveRouteList
.map((item) => item.name)
.includes('CirculateMatter')
}
}
},
mounted() {
this.currentActiveTab = this.$route.query.tabActiveName || 'received'
},
}
</script>
<style lang="scss" scoped></style>
|