index.vue
5.95 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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
<template>
<div>
<!-- 素材分析 -->
<CardGroupIndex :data="cardData"></CardGroupIndex>
<div class="g-card">
<div class="g-card-title">数据趋势</div>
<search-title :showScene="true" @search="getLineData"></search-title>
<chart-line style="height: 300px" :legend="legend" :xData="xdata" :series="series"></chart-line>
</div>
<div class="g-card">
<div class="g-card-title">
素材触达 Top5
<el-popover
trigger="hover"
content="仅统计轨迹素材被查看情况统计,排行权重:查看总人数 > 查看总次数 > 发送总次数"
placement="top-start">
<i slot="reference" class="el-icon-question"></i>
</el-popover>
</div>
<el-table v-loading="loading" :data="tableList" style="width: 100%">
<el-table-column type="index" width="50"></el-table-column>
<el-table-column label="素材" align="center" min-width="100" prop="materialName" show-overflow-tooltip>
<template slot-scope="scope">
<!-- <el-button type="text" @click="numClick(scope.row.id)">{{
scope.row.materialName
}}</el-button> -->
<PicTitContent :row="scope.row" />
</template>
</el-table-column>
<el-table-column label="素材类型" align="center" min-width="100" show-overflow-tooltip>
<template slot-scope="scope">
<div>
{{ dealType(scope.row.mediaType) }}
</div>
</template>
</el-table-column>
<el-table-column
label="查看总人数"
align="center"
min-width="100"
prop="viewByTotalNum"
show-overflow-tooltip />
<el-table-column label="查看总次数" align="center" min-width="100" prop="viewTotalNum" show-overflow-tooltip />
<el-table-column label="发送总次数" align="center" min-width="100" prop="sendTotalNum" show-overflow-tooltip />
</el-table>
</div>
</div>
</template>
<script>
import ChartBar from '@/components/ChartBar.vue'
import ChartLine from '@/components/ChartLine.vue'
import SearchTitle from '../components/SearchTitle.vue'
import { getCount, getTableTotal } from '@/api/contentCenter/common.js'
import PicTitContent from '@/views/contentCenter/components/PicTitContent'
export default {
name: 'scene-statistics-scene',
components: {
SearchTitle,
ChartLine,
ChartBar,
PicTitContent,
},
data() {
return {
exportLoading: false,
// barLegend1: ['访问客户总数'],
// barLegend2: ['咨询客户总数'],
legend: ['发送次数', '查看次数', '查看人数'],
xdata: [],
series: [],
activeName: 'first',
cardData: [
{
title: '发送总次数 ',
tips: '全部素材在侧边栏被员工发送次数',
value: 0,
noArrow: true,
},
{
title: '查看总次数',
tips: '全部轨迹素材被客户打开的总次数,不去重',
value: 0,
},
{
title: '查看总人数',
tips: '全部轨迹素材被客户打开且授权的总人数,去重',
value: 0,
},
{
title: '今日发送次数',
tips: '全部素材今日在侧边栏被员工发送的次数',
value: 0,
},
{
title: '今日查看次数',
tips: '全部轨迹素材今日被客户打开的次数,不去重',
value: 0,
},
{
title: '今日查看人数',
tips: '全部轨迹素材今日被客户打开且授权的人数,去重 ',
value: 0,
},
],
query: {
moduleType: 1,
},
tableList: [],
loading: false,
searchData: {},
bar1: [],
bar2: [],
value1: [],
value2: [],
tableSearch: {},
}
},
methods: {
dealType(type) {
switch (type) {
case '4':
return '文本'
break
case '0':
return '图片'
break
case '9':
return '图文'
break
case '11':
return '小程序'
break
case '12':
return '文章'
break
case '2':
return '视频'
break
case '3':
return '文件'
break
case '5':
return '海报'
break
}
},
// numClick(id) {
// this.$router.push({
// url: '',
// id,
// })
// },
getLineData(data) {
// this.searchData = data
data.moduleType = 1
this.legend = ['发送次数', '查看次数', '查看人数']
this.$forceUpdate()
getCount(data).then((res) => {
this.cardData[0].value = res.data.sendTotalNum
this.cardData[1].value = res.data.viewTotalNum
this.cardData[2].value = res.data.viewByTotalNum
this.cardData[3].value = res.data.sendTodayNum
this.cardData[4].value = res.data.viewTotalTodayNum
this.cardData[5].value = res.data.viewByTotalTodayNum
this.xdata = []
this.series = []
let arr1 = []
let arr2 = []
let arr3 = []
if (res.data && res.data.contentAxisVoList.length) {
res.data.contentAxisVoList.forEach((dd) => {
this.xdata.push(dd.dateStr)
arr1.push(dd.sendNum)
arr2.push(dd.viewNum)
arr3.push(dd.viewByNum)
})
this.series = [arr1, arr2, arr3]
}
})
},
getTableChangeSize() {
this.loading = true
getTableTotal(this.query).then((res) => {
this.tableList = res.data
this.loading = false
})
},
},
created() {
this.getTableChangeSize()
this.$store.dispatch(
'app/setBusininessDesc',
`
<div>全部素材发送与查看情况数据统计与分析</div>
`,
)
},
}
</script>
<style lang="scss" scoped></style>