index.vue
2.6 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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
<!--
* @Author: yangming yangming@didihu.com.cn
* @Date: 2022-10-12 09:30:11
* @LastEditors: yangming yangming@didihu.com.cn
* @LastEditTime: 2022-11-23 09:50:08
* @FilePath: \scrm-micro-drainage\src\views\channel\index.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<template>
<div class="channel-main">
<GLTabs v-model="activeName" :tabPaneList="tabPaneList" class="tabs-panel"></GLTabs>
<channel-list v-if="activeName == 'first'"></channel-list>
<channel-statistics v-if="activeName == 'second'"></channel-statistics>
</div>
</template>
<script>
import channelList from './components/channelList'
import channelStatistics from './components/channelStatistics'
import a from '@/api/modules/channel'
export default {
name: 'channel',
components: {
channelList,
channelStatistics
},
data() {
return {
activeName: 'first',
tabPaneList: [
{
label: '渠道码列表',
name: 'first'
},
{
label: '数据统计',
name: 'second'
}
]
}
},
methods: {
render(createElement) {
createElement(
'div',
{
class: {
'channel-main': true
}
},
[createElement('el-tabs', {})]
)
},
jumpWx() {
this.$history.push('/settings/enterpriseWechat/index')
},
wxTips() {
const menu = JSON.parse(sessionStorage['SCRM_BASE_MENULIST'])
menu.forEach(item => {
if (!item.children) {
return
}
item.children.forEach(itm => {
if (itm.path == '/enterpriseWechat/index') {
this.$apis.channel.getStatus({}).then(res => {
if (res.status != 'SUCCESS') {
const h = this.$createElement
this.$message({
showClose: true,
duration: 0,
message: h('p', null, [h('span', null, '此功能需完成【企业微信授权】后方可使用! '), h('span', { on: { click: this.jumpWx }, style: { marginRight: '150px', cursor: 'pointer', color: '#5850ff' } }, ['企业微信授权 ', h('i', { class: 'el-icon-d-arrow-right' }, '')])])
})
}
})
}
})
})
},
handleClick() {}
},
beforeDestroy() {
this.$message.closeAll()
},
mounted() {
console.log(a)
this.wxTips()
}
}
</script>
<style lang="scss" scoped>
.channel-main {
.tabs-panel {
margin-bottom: 10px;
}
}
</style>