Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
X
x-training
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
EzijingWeb
x-training
Commits
b1f2f127
提交
b1f2f127
authored
12月 16, 2020
作者:
lihuihui
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
对接接口
上级
ed5e2611
隐藏空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
134 行增加
和
22 行删除
+134
-22
common.js
src/api/common.js
+5
-0
form.vue
src/pages/groupAnalysis/components/form.vue
+5
-15
index.vue
src/pages/groupAnalysis/index.vue
+124
-5
index.vue
src/pages/userTrigger/index.vue
+0
-2
没有找到文件。
src/api/common.js
浏览文件 @
b1f2f127
...
@@ -50,3 +50,8 @@ export function submitTrigger(data) {
...
@@ -50,3 +50,8 @@ export function submitTrigger(data) {
export
function
submitContext
(
data
)
{
export
function
submitContext
(
data
)
{
return
httpRequest
.
post
(
'/api/opera/v1/api/reach/submit/context'
,
data
)
return
httpRequest
.
post
(
'/api/opera/v1/api/reach/submit/context'
,
data
)
}
}
/* 特征提交 */
export
function
submitCharacteristic
(
data
)
{
return
httpRequest
.
post
(
'/api/opera/v1/api/characteristic/submit'
,
data
)
}
src/pages/groupAnalysis/components/form.vue
浏览文件 @
b1f2f127
<
template
>
<
template
>
<div
class=
"form-box"
>
<div
class=
"form-box"
>
<ul
v-if=
"Object.keys(radioBox).length != 0"
>
<ul>
<li
v-for=
"(item, index) in data"
:key=
"index"
>
<li
v-for=
"(item, index) in data"
:key=
"index"
>
<div
class=
"name"
>
{{
item
.
name
}}
</div>
<div
class=
"name"
>
{{
item
.
name
}}
</div>
<el-radio-group
v-model=
"
radioBox[index]
"
>
<el-radio-group
v-model=
"
item.radio
"
>
<el-radio
:label=
"0"
>
不筛选
</el-radio>
<el-radio
:label=
"0"
>
不筛选
</el-radio>
<template
v-for=
"(btn, btnIndex) in JSON.parse(item.context)"
>
<template
v-for=
"(btn, btnIndex) in JSON.parse(item.context)"
>
<el-radio
:key=
"btnIndex + 'a'"
:label=
"btn.options"
>
{{
btn
.
options_info
}}
</el-radio>
<el-radio
:key=
"btnIndex + 'a'"
:label=
"btn.options"
>
{{
btn
.
options_info
}}
</el-radio>
...
@@ -20,20 +20,10 @@ export default {
...
@@ -20,20 +20,10 @@ export default {
},
},
data
()
{
data
()
{
return
{
return
{
radioBox
:
{
0
:
0
,
1
:
0
,
2
:
0
,
3
:
0
,
4
:
0
,
5
:
0
,
6
:
0
,
7
:
0
,
8
:
0
,
9
:
0
,
10
:
0
}
}
}
},
mounted
()
{
// console.log(this.data, '===123')
}
}
}
}
</
script
>
</
script
>
...
...
src/pages/groupAnalysis/index.vue
浏览文件 @
b1f2f127
...
@@ -15,7 +15,7 @@
...
@@ -15,7 +15,7 @@
<div
class=
"app-container-ft"
>
<div
class=
"app-container-ft"
>
<div
class=
"btn-box"
>
<div
class=
"btn-box"
>
<div
class=
"bor"
>
<div
class=
"bor"
>
<div
class=
"btn"
v-if=
"isFormShow"
>
确定
</div>
<div
class=
"btn"
v-if=
"isFormShow"
@
click=
"confirm"
>
确定
</div>
<div
class=
"btn"
v-else
@
click=
"intoForm"
>
进入此用户群
</div>
<div
class=
"btn"
v-else
@
click=
"intoForm"
>
进入此用户群
</div>
<div
class=
"right-btn"
>
<div
class=
"right-btn"
>
<div
class=
"btn"
@
click=
"isCurrentCardShow = !isCurrentCardShow"
>
当前案例背景
</div>
<div
class=
"btn"
@
click=
"isCurrentCardShow = !isCurrentCardShow"
>
当前案例背景
</div>
...
@@ -53,7 +53,8 @@ export default {
...
@@ -53,7 +53,8 @@ export default {
cardData
:
{},
cardData
:
{},
casesId
:
1
,
casesId
:
1
,
currentCasesId
:
1
,
currentCasesId
:
1
,
formData
:
[]
formData
:
[],
verificationData
:
[]
}
}
},
},
mounted
()
{
mounted
()
{
...
@@ -65,11 +66,45 @@ export default {
...
@@ -65,11 +66,45 @@ export default {
},
},
// 进入表单
// 进入表单
intoForm
()
{
intoForm
()
{
this
.
form
Data
=
this
.
list
.
find
(
item
=>
{
const
v
Data
=
this
.
list
.
find
(
item
=>
{
return
item
.
id
===
this
.
currentCasesId
return
item
.
id
===
this
.
currentCasesId
}).
characteristics
}).
characteristics
if
(
vData
.
length
===
0
)
{
this
.
$message
({
message
:
'请联系管理员'
,
type
:
'warning'
})
return
false
}
else
{
const
isVerification
=
this
.
setData
(
vData
)
for
(
let
i
=
0
;
i
<
this
.
formData
.
length
;
i
++
)
{
const
data
=
isVerification
.
find
(
item
=>
{
return
item
.
id
===
this
.
formData
[
i
].
id
})
if
(
data
)
{
this
.
formData
[
i
].
tName
=
data
.
tName
this
.
formData
[
i
].
tId
=
data
.
tId
this
.
formData
[
i
].
verification
=
true
}
}
}
this
.
isFormShow
=
true
this
.
isFormShow
=
true
},
},
// 找到需要验证的对象 重新组合数据
setData
(
data
)
{
const
fData
=
[]
data
.
map
(
item
=>
{
fData
.
push
({
id
:
item
.
template_id
,
tId
:
item
.
id
,
tName
:
item
.
name
,
answer
:
JSON
.
parse
(
item
.
context
).
find
(
item
=>
{
return
parseInt
(
item
.
answer
)
===
1
}).
options
})
})
return
fData
},
// 跳转页面
// 跳转页面
goPage
(
path
)
{
goPage
(
path
)
{
this
.
$router
.
push
({
this
.
$router
.
push
({
...
@@ -95,11 +130,95 @@ export default {
...
@@ -95,11 +130,95 @@ export default {
api
api
.
getUserGroup
({
case_id
:
id
})
.
getUserGroup
({
case_id
:
id
})
.
then
(
response
=>
{
.
then
(
response
=>
{
this
.
list
=
response
.
data
this
.
list
=
response
.
data
.
groups
this
.
currentCasesId
=
response
.
data
[
0
].
id
this
.
currentCasesId
=
response
.
data
.
groups
[
0
].
id
// 改变数据 添加 radio双向绑定值
for
(
let
i
=
0
;
i
<
response
.
data
.
characteristics_templates
.
length
;
i
++
)
{
response
.
data
.
characteristics_templates
[
i
].
radio
=
0
}
// 所有特征
this
.
formData
=
response
.
data
.
characteristics_templates
})
.
finally
(()
=>
{
})
},
// 确认提交表单
confirm
()
{
const
param
=
{
case_id
:
this
.
casesId
,
cgroup_id
:
this
.
currentCasesId
,
data
:
[]
}
// 拼数据
this
.
formData
.
map
(
item
=>
{
if
(
item
.
verification
)
{
param
.
data
.
push
({
name
:
item
.
tName
,
characteristic_id
:
item
.
tId
,
context
:
this
.
setSubContext
(
item
.
context
,
item
.
radio
)
})
}
})
api
.
submitCharacteristic
(
param
)
.
then
(
response
=>
{
const
num
=
parseInt
(
response
.
data
.
is_complete_all
)
===
1
?
1
:
parseInt
(
response
.
data
.
result
)
?
2
:
3
this
.
messageBox
(
num
)
})
})
.
finally
(()
=>
{
.
finally
(()
=>
{
})
})
},
// 过滤提交的选项
setSubContext
(
data
,
opt
)
{
const
fData
=
[]
JSON
.
parse
(
data
).
map
(
item
=>
{
fData
.
push
({
options
:
item
.
options
,
options_info
:
item
.
options_info
,
options_select
:
item
.
options
===
opt
?
1
:
0
})
})
return
fData
},
// 弹出不同弹窗
messageBox
(
n
)
{
switch
(
n
)
{
case
1
:
this
.
$alert
(
'恭喜您,已经全部通过,您可以进入用户触达部分了。'
,
{
confirmButtonText
:
'确定'
,
callback
:
action
=>
{
this
.
$router
.
push
({
path
:
'/userTrigger'
})
}
})
break
case
2
:
this
.
$alert
(
'恭喜您,您的筛选正确。'
,
{
confirmButtonText
:
'确定'
,
callback
:
action
=>
{
this
.
$loading
({
lock
:
true
,
text
:
'Loading'
,
spinner
:
'el-icon-loading'
,
background
:
'rgba(0, 0, 0, 0.7)'
})
this
.
$router
.
go
(
0
)
}
})
break
case
3
:
this
.
$alert
(
'您的答案有误'
,
{
confirmButtonText
:
'确定'
,
callback
:
action
=>
{
}
})
break
}
}
}
}
}
}
}
...
...
src/pages/userTrigger/index.vue
浏览文件 @
b1f2f127
...
@@ -194,8 +194,6 @@ export default {
...
@@ -194,8 +194,6 @@ export default {
background
:
#C01540
;
background
:
#C01540
;
}
}
}
}
.trigger-mian
{
}
.btn-box
{
.btn-box
{
width
:
100%
;
width
:
100%
;
// padding: 0 16px;
// padding: 0 16px;
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论