Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
P
pica-risk-admin
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
收起侧边栏
Close sidebar
动态
分支图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
com.pica.cloud.education.frontend
pica-risk-admin
提交
5070f21b
提交
5070f21b
编写于
11月 27, 2020
作者:
huangwensu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
漏斗接口联调
上级
fc396ea6
变更
4
隐藏空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
194 行增加
和
99 行删除
+194
-99
env.js
src/common/env.js
+5
-0
add-funnel.vue
src/views/user-path/add-funnel.vue
+83
-18
funnel-data.vue
src/views/user-path/funnel-data.vue
+103
-78
funnel.vue
src/views/user-path/funnel.vue
+3
-3
未找到文件。
src/common/env.js
浏览文件 @
5070f21b
...
...
@@ -19,6 +19,7 @@ export const getAddress = () => {
let
ipAddress
=
"https://"
+
window
.
location
.
host
;
// let ipAddress = "http://localhost:8099";
let
env
=
getTestEnv
(
ipAddress
);
let
versionUrl
=
""
;
let
preViewUrl
=
""
let
qiniuImgUrl
=
""
;
let
qiniuFileUrl
=
''
;
...
...
@@ -41,6 +42,7 @@ export const getAddress = () => {
//本地
if
(
ipAddress
.
indexOf
(
"localhost"
)
>
-
1
||
ipAddress
.
indexOf
(
"10.177.10.118"
)
>
-
1
||
ipAddress
.
indexOf
(
"test-kf"
)
>
-
1
)
{
ipAddress
=
"http://localhost:7070"
;
versionUrl
=
'https://dev-dev.yunqueyi.com'
;
preViewUrl
=
"http://localhost:9090/#/template"
;
qiniuImgUrl
=
"https://test1-file.yunqueyi.com"
;
resource_url
=
"https://test-file.yunqueyi.com"
;
...
...
@@ -64,6 +66,7 @@ export const getAddress = () => {
qiniuFileUrl
=
"http://dev-sc.yunqueyi.com/contents/admin/qiniu/token1"
;
qiniuResourceUrl
=
"https://test1-videos.yunqueyi.com"
;
}
else
if
(
isNotEmptyUtils
(
env
))
{
//测试test1 test2 uat
versionUrl
=
'https://'
+
env
+
'-dev.yunqueyi.com'
;
preViewUrl
=
"https://"
+
env
+
"-phome.yunqueyi.com"
+
"/template/#/template"
qiniuFileUrl
=
"https://"
+
env
+
"-sc.yunqueyi.com"
+
"/contents/admin/qiniu/token1"
;
qiniuImgUrl
=
"https://test1-file.yunqueyi.com"
;
...
...
@@ -97,6 +100,7 @@ export const getAddress = () => {
lectureUrl
=
"https://"
+
env
+
"-sc.yunqueyi.com"
}
}
else
{
//生产环境
versionUrl
=
'https://dev.yunqueyi.com'
;
preViewUrl
=
"https://phome.yunqueyi.com"
+
"/template/#/template"
qiniuFileUrl
=
"https://sc.yunqueyi.com"
+
"/contents/admin/qiniu/token1"
;
qiniuImgUrl
=
"https://files.yunqueyi.com"
;
//qiniu存储域名
...
...
@@ -116,6 +120,7 @@ export const getAddress = () => {
qiniuResourceUrl
=
"https://video.yunqueyi.com"
;
//qiniu存储域名
exam_url
=
"https://sc.yunqueyi.com/exams"
;
}
localStorage
.
setItem
(
"versionUrl"
,
versionUrl
);
localStorage
.
setItem
(
"preViewUrl"
,
preViewUrl
);
localStorage
.
setItem
(
"qiniuFileUrl"
,
qiniuFileUrl
);
localStorage
.
setItem
(
"qiniuImgUrl"
,
qiniuImgUrl
);
...
...
src/views/user-path/add-funnel.vue
浏览文件 @
5070f21b
...
...
@@ -10,7 +10,7 @@
<el-form
ref=
"form"
:model=
"searchParam"
label-suffix=
":"
style=
"width:100%;"
>
<el-col
:span=
"21"
>
<el-form-item
label=
"漏斗名称"
>
<el-input
v-model=
"searchParam.name"
maxlength=
"
2
0"
placeholder=
"请输入漏斗名称"
style=
"width:288px;"
></el-input>
<el-input
v-model=
"searchParam.name"
maxlength=
"
3
0"
placeholder=
"请输入漏斗名称"
style=
"width:288px;"
></el-input>
</el-form-item>
</el-col>
<el-col
:span=
"3"
style=
"padding:0;text-align:right;padding-right:15px;"
>
...
...
@@ -21,7 +21,7 @@
<div
class=
"add-step"
>
<p>
请以用户逐步触发的事件为依据,构造漏斗、系统会自动计算整个过程的转化率。如果事件之间不连续,转化率为0!
</p>
</div>
<div
class=
"step-content"
v-for=
"(item,index) in s
tepArray
"
:key=
"index"
>
<div
class=
"step-content"
v-for=
"(item,index) in s
earchParam.actionModelList
"
:key=
"index"
>
<span>
步骤
{{
index
+
1
}}
</span>
<el-form
ref=
"form"
...
...
@@ -31,17 +31,17 @@
style=
"width:100%;"
>
<el-col
:span=
"11"
>
<el-form-item
label=
"步骤名称"
>
<el-input
v-model=
"item.
name"
maxlength=
"2
0"
placeholder=
"请输入步骤名称"
style=
"width:200px;"
></el-input>
<el-input
v-model=
"item.
actionName"
maxlength=
"3
0"
placeholder=
"请输入步骤名称"
style=
"width:200px;"
></el-input>
</el-form-item>
</el-col>
<el-col
:span=
"11"
>
<el-form-item
label=
"触发事件"
>
<el-select
v-model=
"item.event
"
placeholder=
"请选择用户触发事件"
style=
"width:200px"
>
<el-select
v-model=
"item.event
Id"
filterable
placeholder=
"请选择用户触发事件"
style=
"width:200px"
>
<el-option
v-for=
"(eItem,eIndex) in eventSelect"
:key=
"eIndex"
:label=
"eItem.
label
"
:value=
"eItem.
value
"
>
:label=
"eItem.
eventName
"
:value=
"eItem.
eventId
"
>
</el-option>
</el-select>
</el-form-item>
...
...
@@ -56,35 +56,100 @@
</div>
</
template
>
<
script
>
import
{
openLoading
,
closeLoading
}
from
"../../common/utils"
;
export
default
{
data
()
{
return
{
funnelId
:
''
,
searchParam
:
{
name
:
''
},
stepArray
:
[
name
:
''
,
actionModelList
:
[
{
n
ame
:
''
,
event
:
''
}
]
,
actionN
ame
:
''
,
event
Id
:
''
}
]
}
,
eventSelect
:
[]
}
},
created
()
{
this
.
funnelId
=
this
.
$route
.
query
.
id
;
},
mounted
()
{
this
.
getEventList
();
if
(
this
.
funnelId
)
this
.
getFunnelDetail
();
},
methods
:
{
// 封装一下请求通用的方法
getData
(
type
,
url
,
req
,
callback
)
{
openLoading
(
this
);
this
.
$axios
[
type
](
localStorage
.
getItem
(
"lectureUrl"
)
+
url
,
req
)
.
then
(
res
=>
{
closeLoading
(
this
);
let
data
=
res
.
data
;
if
(
data
.
code
==
"000000"
)
{
if
(
callback
)
callback
(
data
);
}
else
{
this
.
$message
.
error
(
data
.
message
);
}
})
},
// 获取触发事件列表
getEventList
()
{
let
req
=
this
.
searchParam
.
name
;
this
.
getData
(
"get"
,
`/session/funnel/eventList?searchName=
${
req
}
`
,
{},
res
=>
{
this
.
eventSelect
=
res
.
data
;
}
);
},
// 编辑获取漏斗详情
getFunnelDetail
()
{
this
.
getData
(
"get"
,
`/session/funnel/detail/
${
this
.
funnelId
}
`
,
{},
res
=>
{
if
(
res
.
code
==
'000000'
)
{
this
.
searchParam
=
res
.
data
;
}
}
);
},
// 保存
saveAddAndEdit
()
{
if
(
!
this
.
searchParam
.
name
)
{
this
.
$message
.
error
(
'请输入漏斗名称'
);
return
;
}
for
(
let
i
=
0
;
i
<
this
.
searchParam
.
actionModelList
.
length
;
i
++
)
{
if
(
!
this
.
searchParam
.
actionModelList
[
i
].
eventId
)
{
this
.
$message
.
error
(
'触发事件不能为空'
);
return
;
}
}
let
req
=
this
.
searchParam
;
this
.
getData
(
"post"
,
`/session/funnel/save`
,
req
,
res
=>
{
if
(
res
.
code
==
'000000'
)
{
this
.
$message
.
success
(
'转化漏斗创建成功'
);
this
.
$router
.
push
({
path
:
'user-path'
});
}
else
{
this
.
$message
.
error
(
res
.
message
);
}
}
);
},
// 删除步骤
deleteSteps
(
i
)
{
this
.
stepArray
.
splice
(
i
,
1
);
this
.
$message
.
success
(
'删除成功'
);
this
.
searchParam
.
actionModelList
.
splice
(
i
,
1
);
},
// 增加步骤
addSteps
()
{
this
.
s
tepArray
.
push
({
n
ame
:
''
,
event
:
''
this
.
s
earchParam
.
actionModelList
.
push
({
actionN
ame
:
''
,
event
Id
:
''
});
}
}
...
...
src/views/user-path/funnel-data.vue
浏览文件 @
5070f21b
...
...
@@ -11,11 +11,23 @@
<el-col
:span=
"10"
>
<el-form-item
label=
"时间"
>
<el-date-picker
v-model=
"searchParam.time"
type=
"daterange"
range-separator=
"-"
start-placeholder=
"开始日期"
end-placeholder=
"结束日期"
>
type=
"date"
placeholder=
"开始时间"
v-model=
"searchParam.startDate"
style=
"width: 200px;"
:picker-options=
"endDateOpt"
value-format=
"yyyy-MM-dd 00:00:00"
>
</el-date-picker>
<span>
-
</span>
<el-date-picker
type=
"date"
placeholder=
"结束时间"
v-model=
"searchParam.endDate"
style=
"width: 200px;"
:picker-options=
"endDateOpt1"
value-format=
"yyyy-MM-dd 23:59:59"
>
</el-date-picker>
</el-form-item>
</el-col>
...
...
@@ -41,19 +53,19 @@
<div
class=
"data-num"
>
<div
class=
"num-text first-num"
>
<span>
总人数
</span>
<p>
543233
<span>
人
</span></p>
<p>
{{
funnelData
.
userCountTotal
}}
<span>
人
</span></p>
</div>
<div
class=
"num-text"
>
<span>
总转化率
</span>
<p>
20.47
%
</p>
<p>
{{
funnelData
.
inversionRateTotal
}}
%
</p>
</div>
<div
class=
"num-text"
>
<span>
达成目标人数
</span>
<p>
234
<span>
人
</span></p>
<p>
{{
funnelData
.
userCountLast
}}
<span>
人
</span></p>
</div>
<div
class=
"num-text num"
>
<span>
转化率最低步骤
</span>
<p>
点击【相关推荐内容】
</p>
<p>
{{
funnelData
.
funnelNameLast
}}
</p>
</div>
</div>
<div
class=
"data-analysis"
>
...
...
@@ -61,13 +73,13 @@
<div
ref=
"chart"
class=
"echart"
></div>
<el-table
class=
"data-table"
:data=
"
tableData
"
:data=
"
funnelData.funnelReportModels
"
style=
"width: 100%"
>
<el-table-column
prop=
"
step
"
label=
"步骤"
min-width=
"140"
align=
"center"
></el-table-column>
<el-table-column
prop=
"
n
ame"
label=
"步骤名称"
min-width=
"140"
align=
"center"
></el-table-column>
<el-table-column
prop=
"user
Num
"
label=
"用户数"
min-width=
"150"
align=
"center"
></el-table-column>
<el-table-column
prop=
"
pr
e"
label=
"较上一步转化率"
min-width=
"150"
align=
"center"
></el-table-column>
<el-table-column
prop=
"
al
l"
label=
"总转化率"
min-width=
"150"
align=
"center"
></el-table-column>
<el-table-column
prop=
"
funnel
"
label=
"步骤"
min-width=
"140"
align=
"center"
></el-table-column>
<el-table-column
prop=
"
funnelN
ame"
label=
"步骤名称"
min-width=
"140"
align=
"center"
></el-table-column>
<el-table-column
prop=
"user
Count
"
label=
"用户数"
min-width=
"150"
align=
"center"
></el-table-column>
<el-table-column
prop=
"
inversionRat
e"
label=
"较上一步转化率"
min-width=
"150"
align=
"center"
></el-table-column>
<el-table-column
prop=
"
inversionRateTota
l"
label=
"总转化率"
min-width=
"150"
align=
"center"
></el-table-column>
</el-table>
</div>
</div>
...
...
@@ -76,72 +88,85 @@
</
template
>
<
script
>
let
url
=
'image://data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAARCAMAAACLgl7OAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAAaVBMVEUAAADBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcEAAAD45xibAAAAInRSTlMAmT6WJYwSfBMGZAFHmEgtkBeCCW0KAlI1k5QeiA10A1tc7ah1owAAAAFiS0dEAIgFHUgAAAAJcEhZcwAACxIAAAsSAdLdfvwAAAB7SURBVCjPtZDZDoAgDAQXvA+8bwX1/3/SGKIBEd+cx07TdgtIiAF0/mygDvnAoYDr2b3nnjP8wOaDUG6J4ncfR9cdScpMzbJECZEXT1/kesyy0n1VPv6AulF908Kg6+9DWN/hjWGUfhpgYV5Ov8ywwgUhguODddtXvXIAjuUEs/70/t4AAAAldEVYdGRhdGU6Y3JlYXRlADIwMTktMTItMTZUMTU6MzM6MDkrMDg6MDCzL2BEAAAAJXRFWHRkYXRlOm1vZGlmeQAyMDE5LTEyLTE2VDE1OjMzOjA5KzA4OjAwwnLY+AAAAABJRU5ErkJggg=='
;
import
{
openLoading
,
closeLoading
}
from
"../../common/utils"
;
export
default
{
data
()
{
return
{
name
:
'测试'
,
funnelId
:
''
,
name
:
''
,
searchParam
:
{
time
:
''
,
endDate
:
'2020-11-23'
,
startDate
:
'2020-11-20'
,
version
:
''
},
versionSelect
:
[],
// 版本下拉数据
tableData
:
[{
step
:
'步骤1'
,
name
:
'点击【微专业】'
,
userNum
:
54343
,
pre
:
98.00
,
all
:
67.34
},{
step
:
'步骤2'
,
name
:
'点击【课程】'
,
userNum
:
54343
,
pre
:
98.00
,
all
:
67.34
}]
funnelData
:
{},
endDateOpt
:
{
disabledData
:
(
time
)
=>
{
if
(
this
.
searchParam
.
endDate
!=
""
&&
this
.
searchParam
.
endDate
!=
null
)
{
return
(
time
.
getTime
()
>
new
Date
(
this
.
searchParam
.
endDate
).
getTime
()
);
}
}
},
endDateOpt1
:
{
disabledDate
:
time
=>
{
return
(
time
.
getTime
()
<
new
Date
(
this
.
searchParam
.
startDate
).
getTime
()
);
}
}
}
},
created
()
{
this
.
funnelId
=
this
.
$route
.
query
.
id
;
this
.
name
=
this
.
$route
.
query
.
name
;
},
mounted
()
{
this
.
initCharts
();
this
.
getAnalysisData
();
this
.
getVersionData
();
},
methods
:
{
// 封装一下请求通用的方法
getData
(
type
,
url
,
req
,
callback
)
{
openLoading
(
this
);
this
.
$axios
[
type
](
localStorage
.
getItem
(
"lectureUrl"
)
+
url
,
req
)
.
then
(
res
=>
{
closeLoading
(
this
);
let
data
=
res
.
data
;
if
(
data
.
code
==
"000000"
)
{
if
(
callback
)
callback
(
data
);
}
else
{
this
.
$message
.
error
(
data
.
message
);
}
})
},
// 获取版本号数据
getVersionData
()
{
openLoading
(
this
);
this
.
$axios
.
get
(
localStorage
.
getItem
(
"versionUrl"
)
+
'/api/PICAVersionServiceImpl/getVersionList'
,
{})
.
then
(
res
=>
{
closeLoading
(
this
);
})
},
// 获取漏斗分析数据
getAnalysisData
()
{
let
req
=
this
.
searchParam
;
this
.
getData
(
"get"
,
`/session/funnel/report?endDate=
${
req
.
endDate
}
&funnelId=
${
this
.
funnelId
}
&startDate=
${
req
.
endDate
}
&version=
${
req
.
version
}
`
,
{},
res
=>
{
if
(
res
.
code
==
'000000'
)
{
this
.
funnelData
=
res
.
data
;
this
.
initCharts
();
}
}
);
},
// 初始化图标
initCharts
()
{
let
lineargroup
=
[{
value
:
200
,
oriname
:
"点击【微专业】"
,
number
:
98756
,
color
:
[
"rgba(29,211,137,0.8)"
,
"rgba(29,211,137,0)"
]
},
{
value
:
150
,
oriname
:
"点击【课程】"
,
number
:
88756
,
pointValue
:
69.23
,
color
:
[
"rgba(102,142,255,0.7)"
,
"rgba(102,142,255,0)"
]
},
{
value
:
100
,
oriname
:
"点击【相关推荐内容】"
,
number
:
78756
,
pointValue
:
35.21
,
color
:
[
"rgba(255,198,82,0.6)"
,
"rgba(255,198,82,0)"
]
},
{
value
:
60
,
oriname
:
"点击【健康漫画】"
,
number
:
456
,
pointValue
:
15.21
,
color
:
[
"rgba(255,198,82,0.6)"
,
"rgba(255,198,82,0)"
]
},
{
value
:
30
,
oriname
:
"点击【更多】"
,
number
:
56
,
pointValue
:
5.21
,
color
:
[
"rgba(255,198,82,0.6)"
,
"rgba(255,198,82,0)"
]
},
];
let
lineargroup
=
this
.
funnelData
.
funnelReportModels
;
let
len
=
lineargroup
.
length
;
let
colorObj
=
{
type
:
'linear'
,
...
...
@@ -161,28 +186,28 @@ export default {
let
data1
=
[],
dataArr
=
[],
valueArr
=
[],
lineArr
=
[],
linksArr
=
[];
for
(
let
i
=
0
;
i
<
lineargroup
.
length
;
i
++
)
{
let
obj1
=
{
value
:
lineargroup
[
i
].
value
,
num
:
lineargroup
[
i
].
number
,
name
:
lineargroup
[
i
].
orin
ame
value
:
200
-
i
*
40
,
num
:
lineargroup
[
i
].
userCount
,
name
:
lineargroup
[
i
].
funnelN
ame
};
data1
.
push
(
obj1
);
if
(
i
!=
(
lineargroup
.
length
-
1
))
{
dataArr
.
push
(
'转化率'
);
valueArr
.
push
({
value
:
'100'
});
// 步骤箭头
linksArr
.
push
({
// 转化率线
source
:
lineargroup
[
i
].
orin
ame
,
target
:
lineargroup
[
i
+
1
].
orin
ame
,
value
:
lineargroup
[
i
+
1
].
pointValu
e
,
source
:
lineargroup
[
i
].
funnelN
ame
,
target
:
lineargroup
[
i
+
1
].
funnelN
ame
,
value
:
lineargroup
[
i
+
1
].
inversionRat
e
,
lineStyle
:
{
normal
:
{
curveness
:
parseInt
(
len
-
i
)
+
1
,
curveness
:
parseInt
(
len
-
i
)
+
4
,
color
:
colorObj
}
}
})
}
lineArr
.
push
({
name
:
lineargroup
[
i
].
orin
ame
,
name
:
lineargroup
[
i
].
funnelN
ame
,
x
:
400
,
y
:
0
+
i
*
15
});
...
...
@@ -190,10 +215,10 @@ export default {
let
option
=
{
backgroundColor
:
'#ffffff'
,
grid
:
{
top
:
11
0
-
len
*
5
,
// 箭头距离顶部高度
top
:
11
5
-
len
*
4
,
// 箭头距离顶部高度 3-115 4-
left
:
"-34%"
,
right
:
20
,
height
:
115
+
len
*
15
,
// 箭头之间的距离
height
:
50
+
len
*
30
,
// 箭头之间的距离 3-145 4-
bottom
:
'0'
},
xAxis
:
{
...
...
@@ -244,7 +269,7 @@ export default {
z
:
1
,
top
:
20
,
left
:
500
,
height
:
28
6
,
height
:
30
6
,
type
:
'graph'
,
layout
:
'none'
,
symbolSize
:
0
,
...
...
src/views/user-path/funnel.vue
浏览文件 @
5070f21b
...
...
@@ -114,12 +114,12 @@ export default {
this
.
$router
.
push
({
path
:
'add-funnel'
});
},
// 查看数据
visitData
()
{
this
.
$router
.
push
({
path
:
'path-data'
});
visitData
(
row
)
{
this
.
$router
.
push
({
path
:
'path-data'
,
query
:
{
id
:
row
.
id
,
name
:
row
.
name
}
});
},
// 编辑
editColumn
(
row
)
{
this
.
$router
.
push
({
path
:
'add-funnel'
,
query
:
{
id
:
row
.
id
}});
this
.
$router
.
push
({
path
:
'add-funnel'
,
query
:
{
id
:
row
.
id
}});
},
// 删除确认框
deleteConfirm
(
row
)
{
...
...
写
预览
Markdown
格式
0%
请重试
or
附加一个文件
附加文件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录