|
@@ -18,18 +18,18 @@ const UserSource = props => {
|
18
|
18
|
UserConversionRate({ conversion: 'authorization_phone' })
|
19
|
19
|
}, [])
|
20
|
20
|
|
21
|
|
- function UserConversionRate (params) {
|
|
21
|
+ function UserConversionRate(params) {
|
22
|
22
|
|
23
|
23
|
request({
|
24
|
24
|
...apis.indexEcharts.userConversion,
|
25
|
25
|
params,
|
26
|
|
- }).then(data => {
|
27
|
|
- console.log(data.data_count.registeredCount/data.data_count.pvNum,'1241234')
|
|
26
|
+ }).then(data => {
|
|
27
|
+ console.log(data.data_count.registeredCount / data.data_count.pvNum, '1241234')
|
28
|
28
|
setDataset(data, params.conversion)
|
29
|
29
|
})
|
30
|
30
|
}
|
31
|
31
|
|
32
|
|
- function setDataset (data, theStatis) {
|
|
32
|
+ function setDataset(data, theStatis) {
|
33
|
33
|
const { pvNum, ...other } = data.data_count
|
34
|
34
|
|
35
|
35
|
// 获取第一个值
|
|
@@ -43,7 +43,7 @@ const UserSource = props => {
|
43
|
43
|
setTheCurrent([])
|
44
|
44
|
} else {
|
45
|
45
|
|
46
|
|
- setConversionRate(num/pvNum)
|
|
46
|
+ setConversionRate(num / pvNum)
|
47
|
47
|
setTheCurrent([
|
48
|
48
|
{ name: getStatisName(theStatis), value: num },
|
49
|
49
|
{ name: '其余', value: pvNum - num },
|
|
@@ -51,7 +51,7 @@ const UserSource = props => {
|
51
|
51
|
}
|
52
|
52
|
}
|
53
|
53
|
|
54
|
|
- function getStatisName (theStatis) {
|
|
54
|
+ function getStatisName(theStatis) {
|
55
|
55
|
const statisTypes = [
|
56
|
56
|
{ label: '授权手机', value: 'authorization_phone' },
|
57
|
57
|
{ label: '项目收藏', value: 'building_save' },
|
|
@@ -75,14 +75,21 @@ const UserSource = props => {
|
75
|
75
|
name: '转化率',
|
76
|
76
|
radius: ['34%', '52%'],
|
77
|
77
|
avoidLabelOverlap: false,
|
78
|
|
- label: {
|
79
|
|
- normal: {
|
80
|
|
- show: true,
|
|
78
|
+ label: {
|
|
79
|
+ normal: {
|
|
80
|
+ show: false,
|
81
|
81
|
position: 'center',
|
82
|
82
|
color: '#666666',
|
83
|
|
- fontSize: 24,
|
84
|
|
- fontWeight: 'bold',
|
85
|
|
- formatter: `${(conversionRate*100).toFixed(2) === 'NaN' ? 0 : (conversionRate*100).toFixed(2) }%`, // {b}:数据名; {c}:数据值; {d}:百分比,可以自定义显示内容,
|
|
83
|
+ fontSize: 22,
|
|
84
|
+ formatter: '{d}%'
|
|
85
|
+ },
|
|
86
|
+ emphasis: {
|
|
87
|
+ show: true,
|
|
88
|
+ formatter: '{d}%',
|
|
89
|
+ textStyle: {
|
|
90
|
+ fontSize: '22',
|
|
91
|
+ fontWeight: 'bold'
|
|
92
|
+ }
|
86
|
93
|
}
|
87
|
94
|
},
|
88
|
95
|
labelLine: {
|
|
@@ -95,7 +102,7 @@ const UserSource = props => {
|
95
|
102
|
},
|
96
|
103
|
}
|
97
|
104
|
|
98
|
|
- function onChange (e) {
|
|
105
|
+ function onChange(e) {
|
99
|
106
|
UserConversionRate({ conversion: e })
|
100
|
107
|
}
|
101
|
108
|
const piestyles = {
|