Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
江名洋
/
linkwe-scrm
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit ab8ce4ae
authored
Jul 10, 2023
by
xinla
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
表单微信用户统计等
1 parent
59dc8084
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
41 additions
and
76 deletions
vue3-lw-pc/src/views/drainageCode/smartForms/build/formsDetail.vue
vue3-lw-pc/src/views/drainageCode/smartForms/statistics/UserStatistics.vue
vue3-lw-pc/src/views/drainageCode/smartForms/build/formsDetail.vue
View file @
ab8ce4a
...
@@ -204,7 +204,6 @@ import {
...
@@ -204,7 +204,6 @@ import {
insertPieValue
,
insertPieValue
,
isCompleteSurvey
,
isCompleteSurvey
,
siteStas
,
siteStas
,
statisticAdd
,
}
from
'@/api/drainageCode/smartForms.js'
}
from
'@/api/drainageCode/smartForms.js'
import
{
getProvinceCityTree
}
from
'@/utils/index'
import
{
getProvinceCityTree
}
from
'@/utils/index'
// import render from './generator/render'
// import render from './generator/render'
...
@@ -242,7 +241,7 @@ export default {
...
@@ -242,7 +241,7 @@ export default {
Ifcontainer
:
true
,
Ifcontainer
:
true
,
ifEnd
:
false
,
ifEnd
:
false
,
style
:
'false'
,
style
:
'false'
,
formData
1
:
{
formData
:
{
userName
:
undefined
,
userName
:
undefined
,
mobile
:
''
,
mobile
:
''
,
},
},
...
@@ -292,10 +291,6 @@ export default {
...
@@ -292,10 +291,6 @@ export default {
drawingData
:
{},
drawingData
:
{},
activeId
:
''
,
activeId
:
''
,
drawerVisible
:
false
,
drawerVisible
:
false
,
formData
:
{
userName
:
''
,
mobile
:
''
,
},
dialogVisible
:
false
,
dialogVisible
:
false
,
generateConf
:
null
,
generateConf
:
null
,
showFileName
:
false
,
showFileName
:
false
,
...
@@ -305,7 +300,6 @@ export default {
...
@@ -305,7 +300,6 @@ export default {
page
:
1
,
page
:
1
,
unionidN
:
''
,
unionidN
:
''
,
openIdN
:
''
,
openIdN
:
''
,
nickname
:
''
,
isMobile
:
true
,
isMobile
:
true
,
}
}
},
},
...
@@ -432,6 +426,21 @@ export default {
...
@@ -432,6 +426,21 @@ export default {
//开始填写
//开始填写
startFillIn
()
{
startFillIn
()
{
if
(
this
.
style
!=
'y'
||
this
.
index
!=
1
)
{
if
(
this
.
style
!=
'y'
||
this
.
index
!=
1
)
{
if
(
this
.
style
!=
'y'
&&
this
.
fromList
.
anAuth
==
1
&&
!
this
.
unionidN
)
{
showDialog
({
title
:
'提示'
,
message
:
'需要微信授权登录'
,
showCancelButton
:
true
,
})
.
then
(()
=>
{
this
.
getAccessToken
()
// on confirm
})
.
catch
(()
=>
{
// on cancel
})
return
}
this
.
fromList
.
visibility
=
1
this
.
fromList
.
visibility
=
1
// this.$forceUpdate()
// this.$forceUpdate()
}
}
...
@@ -459,9 +468,9 @@ export default {
...
@@ -459,9 +468,9 @@ export default {
answer
.
push
(
cloneCurItem
)
answer
.
push
(
cloneCurItem
)
if
(
curItem
.
formCodeId
==
11
)
{
if
(
curItem
.
formCodeId
==
11
)
{
this
.
formData
1
.
userName
=
curItem
.
defaultValue
// 姓名
this
.
formData
.
userName
=
curItem
.
defaultValue
// 姓名
}
else
if
(
curItem
.
formCodeId
==
5
)
{
}
else
if
(
curItem
.
formCodeId
==
5
)
{
this
.
formData
1
.
mobile
=
curItem
.
defaultValue
// 手机号
this
.
formData
.
mobile
=
curItem
.
defaultValue
// 手机号
}
else
if
([
6
,
7
,
8
,
9
].
includes
(
+
cloneCurItem
.
formCodeId
))
{
}
else
if
([
6
,
7
,
8
,
9
].
includes
(
+
cloneCurItem
.
formCodeId
))
{
// 下拉选择, 级联选择, 选项组, 省市联动
// 下拉选择, 级联选择, 选项组, 省市联动
cloneCurItem
.
formId
=
this
.
formId
cloneCurItem
.
formId
=
this
.
formId
...
@@ -512,12 +521,6 @@ export default {
...
@@ -512,12 +521,6 @@ export default {
}
}
}
}
}
}
try
{
localStorage
.
setItem
(
'userName'
,
that
.
formData1
.
userName
)
localStorage
.
setItem
(
'mobile'
,
that
.
formData1
.
mobile
)
}
catch
(
e
)
{
//TODO handle the exception
}
console
.
log
(
'answer'
,
answer
)
console
.
log
(
'answer'
,
answer
)
let
formCodeDict
=
{
let
formCodeDict
=
{
0
:
'单行文本'
,
0
:
'单行文本'
,
...
@@ -581,8 +584,8 @@ export default {
...
@@ -581,8 +584,8 @@ export default {
}
}
}
}
let
data
=
{
let
data
=
{
mobile
:
that
.
formData
1
.
mobile
,
mobile
:
that
.
formData
.
mobile
,
name
:
that
.
formData
1
.
userName
,
name
:
that
.
formData
.
userName
,
//开始填写时间
//开始填写时间
anTime
:
this
.
anTime
,
anTime
:
this
.
anTime
,
//填写用时
//填写用时
...
@@ -682,8 +685,8 @@ export default {
...
@@ -682,8 +685,8 @@ export default {
console
.
log
(
'提交饼图信息返回值'
,
response
)
console
.
log
(
'提交饼图信息返回值'
,
response
)
})
})
},
},
//
判断是否在微信里,然后下一步
//
微信授权登录,获取微信用户信息
getA
uthorize
()
{
getA
ccessToken
()
{
let
code
=
getQueryValue
(
'code'
)
let
code
=
getQueryValue
(
'code'
)
if
(
!
code
)
{
if
(
!
code
)
{
if
(
this
.
formId
)
{
if
(
this
.
formId
)
{
...
@@ -692,32 +695,20 @@ export default {
...
@@ -692,32 +695,20 @@ export default {
localStorage
.
removeItem
(
'formId'
)
localStorage
.
removeItem
(
'formId'
)
}
}
}
}
this
.
getAccessToken
()
},
//获取微信用户信息
getAccessToken
()
{
getWechatAuthUserInfo
().
then
((
data
)
=>
{
getWechatAuthUserInfo
().
then
((
data
)
=>
{
this
.
loading
=
false
this
.
unionidN
=
data
.
unionId
this
.
unionidN
=
data
.
unionId
this
.
openIdN
=
data
.
openId
this
.
openIdN
=
data
.
openId
this
.
nickname
=
data
.
nickName
this
.
formData
.
userName
=
data
.
nickName
if
(
this
.
nickname
)
{
this
.
formData
.
userName
=
this
.
nickname
}
this
.
siteStas
()
this
.
siteStas
()
this
.
isCompleteSurveyF
()
this
.
isCompleteSurveyF
()
this
.
formData1
.
userName
=
localStorage
.
getItem
(
'userName'
)
this
.
formData1
.
mobile
=
localStorage
.
getItem
(
'mobile'
)
// if (response.code == 200) {
// } else {
// this.toast(response.msg)
// }
})
})
},
},
//判断用户是否填写表单
//判断用户是否填写表单
isCompleteSurveyF
()
{
isCompleteSurveyF
()
{
let
data
=
{
let
data
=
{
belongId
:
this
.
formId
,
belongId
:
this
.
formId
,
// mobile: this.formData
1
.mobile,
// mobile: this.formData.mobile,
openId
:
this
.
openIdN
,
openId
:
this
.
openIdN
,
dataSource
:
this
.
dataSource
,
dataSource
:
this
.
dataSource
,
}
}
...
@@ -758,11 +749,10 @@ export default {
...
@@ -758,11 +749,10 @@ export default {
}
}
selectInfoToSurvey
(
this
.
formId
).
then
((
response
)
=>
{
selectInfoToSurvey
(
this
.
formId
).
then
((
response
)
=>
{
if
(
response
.
code
==
200
)
{
if
(
response
.
code
==
200
)
{
this
.
loading
=
false
that
.
fromList
=
response
.
data
that
.
fromList
=
response
.
data
let
clannelsName
=
that
.
fromList
.
channelsName
.
split
(
','
)
let
clannelsName
=
that
.
fromList
.
channelsName
.
split
(
','
)
let
clannelsPath
=
that
.
fromList
.
channelsPath
.
split
(
','
)
let
clannelsPath
=
that
.
fromList
.
channelsPath
.
split
(
','
)
console
.
log
(
'that.dataSource'
,
that
.
dataSource
,
clannelsPath
)
//
console.log('that.dataSource', that.dataSource, clannelsPath)
for
(
let
i
=
0
;
i
<
clannelsName
.
length
;
i
++
)
{
for
(
let
i
=
0
;
i
<
clannelsName
.
length
;
i
++
)
{
if
(
clannelsPath
[
i
]
==
that
.
dataSource
)
{
if
(
clannelsPath
[
i
]
==
that
.
dataSource
)
{
that
.
dataSource
=
clannelsName
[
i
]
that
.
dataSource
=
clannelsName
[
i
]
...
@@ -789,37 +779,16 @@ export default {
...
@@ -789,37 +779,16 @@ export default {
let
styles
=
JSON
.
parse
(
response
.
data
.
styles
)
let
styles
=
JSON
.
parse
(
response
.
data
.
styles
)
that
.
pageData
=
[[]]
that
.
pageData
=
[[]]
if
(
that
.
style
!=
'y'
&&
that
.
style
!=
'q'
)
{
if
(
that
.
style
!=
'y'
&&
that
.
style
!=
'q'
)
{
if
(
that
.
fromList
.
surveyState
==
0
)
{
let
dict
=
{
// this.$alert('当前问卷暂未开放回收,暂时无法填写。', '提示', {
0
:
'当前问卷暂未开放回收,暂时无法填写。'
,
// confirmButtonText: '我知道了',
2
:
'当前问卷已暂停回收,暂时无法填写。'
,
// });
3
:
'当前问卷已结束回收,无法填写。'
,
showDialog
({
}
title
:
'提示'
,
if
(
Object
.
keys
(
dict
).
includes
(
that
.
fromList
.
surveyState
+
''
))
{
message
:
'当前问卷暂未开放回收,暂时无法填写。'
,
this
.
loading
=
false
confirmButtonText
:
'我知道了'
,
}).
then
(()
=>
{
// on close
})
return
}
else
if
(
that
.
fromList
.
surveyState
==
2
)
{
// this.$alert('当前问卷已暂停回收,暂时无法填写。', '提示', {
// confirmButtonText: '我知道了',
// });
showDialog
({
title
:
'提示'
,
message
:
'当前问卷已暂停回收,暂时无法填写。'
,
confirmButtonText
:
'我知道了'
,
}).
then
(()
=>
{
// on close
})
return
}
else
if
(
that
.
fromList
.
surveyState
==
3
)
{
// this.$alert('当前问卷已结束回收,无法填写。', '提示', {
// confirmButtonText: '我知道了',
// });
showDialog
({
showDialog
({
title
:
'提示'
,
title
:
'提示'
,
message
:
'当前问卷已结束回收,无法填写。'
,
message
:
dict
[
that
.
fromList
.
surveyState
]
,
confirmButtonText
:
'我知道了'
,
confirmButtonText
:
'我知道了'
,
}).
then
(()
=>
{
}).
then
(()
=>
{
// on close
// on close
...
@@ -837,7 +806,6 @@ export default {
...
@@ -837,7 +806,6 @@ export default {
that
.
pageData
[
page
-
1
]
=
styles
[
i
]
that
.
pageData
[
page
-
1
]
=
styles
[
i
]
}
}
}
}
console
.
log
(
'that.pageDataxx'
,
that
.
pageData
)
that
.
drawingList
=
this
.
pageData
[
this
.
page
-
1
]
that
.
drawingList
=
this
.
pageData
[
this
.
page
-
1
]
that
.
$forceUpdate
()
that
.
$forceUpdate
()
that
.
activeData
=
that
.
drawingList
[
0
]
that
.
activeData
=
that
.
drawingList
[
0
]
...
@@ -848,15 +816,17 @@ export default {
...
@@ -848,15 +816,17 @@ export default {
// if (that.style == 'y' || that.style == 'q') {
// if (that.style == 'y' || that.style == 'q') {
// return
// return
// }
// }
// that.getA
uthorize
()
// that.getA
ccessToken
()
// } else {
// } else {
// }
// }
if
(
that
.
style
==
'y'
||
that
.
style
==
'q'
)
{
if
(
that
.
style
==
'y'
||
that
.
style
==
'q'
)
{
this
.
loading
=
false
return
return
}
}
that
.
getA
uthorize
()
that
.
getA
ccessToken
()
}
else
{
}
else
{
//如果是表单首页
//如果是表单首页
this
.
loading
=
false
if
(
that
.
fromList
.
visibility
==
1
)
{
if
(
that
.
fromList
.
visibility
==
1
)
{
if
(
that
.
style
==
'y'
||
that
.
style
==
'q'
)
{
if
(
that
.
style
==
'y'
||
that
.
style
==
'q'
)
{
return
return
...
@@ -864,7 +834,6 @@ export default {
...
@@ -864,7 +834,6 @@ export default {
}
}
this
.
siteStas
()
this
.
siteStas
()
}
}
return
}
else
{
}
else
{
showDialog
(
response
.
msg
)
showDialog
(
response
.
msg
)
}
}
...
@@ -872,10 +841,6 @@ export default {
...
@@ -872,10 +841,6 @@ export default {
},
},
async
siteStas
()
{
async
siteStas
()
{
if
(
!
[
'y'
,
'q'
].
includes
(
this
.
style
))
{
if
(
!
[
'y'
,
'q'
].
includes
(
this
.
style
))
{
statisticAdd
({
belongId
:
this
.
formId
,
dataSource
:
this
.
dataSource
,
})
//智能表单站点统计 PV
//智能表单站点统计 PV
try
{
try
{
this
.
userIp
=
this
.
userIp
||
(
await
getIP
())
this
.
userIp
=
this
.
userIp
||
(
await
getIP
())
...
...
vue3-lw-pc/src/views/drainageCode/smartForms/statistics/UserStatistics.vue
View file @
ab8ce4a
...
@@ -26,19 +26,19 @@
...
@@ -26,19 +26,19 @@
{{
row
.
createTime
}}
{{
row
.
createTime
}}
</
template
>
</
template
>
</el-table-column>
</el-table-column>
<
!-- <el-table-column label="用户姓名
" align="center" min-width="100" show-overflow-tooltip>
<
el-table-column
label=
"用户昵称
"
align=
"center"
min-width=
"100"
show-overflow-tooltip
>
<
template
#
default=
"{ row }"
>
<
template
#
default=
"{ row }"
>
{{
row
.
name
}}
{{
row
.
name
}}
</
template
>
</
template
>
</el-table-column>
</el-table-column>
<el-table-column label="用户手机号" align="center" min-width="100" show-overflow-tooltip>
<
!-- <
el-table-column label="用户手机号" align="center" min-width="100" show-overflow-tooltip>
<template #default="{ row }">
<template #default="{ row }">
{{ row.mobile }}
{{ row.mobile }}
</template>
</template>
</el-table-column> -->
</el-table-column> -->
<el-table-column
label=
"渠道"
align=
"center"
min-width=
"100"
show-overflow-tooltip
>
<el-table-column
label=
"渠道"
align=
"center"
min-width=
"100"
show-overflow-tooltip
>
<
template
#
default=
"{ row }"
>
<
template
#
default=
"{ row }"
>
{{
dataSource
}}
{{
row
.
dataSource
}}
</
template
>
</
template
>
</el-table-column>
</el-table-column>
<el-table-column
label=
"openId"
align=
"center"
min-width=
"100"
show-overflow-tooltip
>
<el-table-column
label=
"openId"
align=
"center"
min-width=
"100"
show-overflow-tooltip
>
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment