Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
X
x-training-admin
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
EzijingWeb
x-training-admin
Commits
41483bb7
提交
41483bb7
authored
2月 08, 2021
作者:
wangyizheng
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
新增更新特征配置
上级
f28085fb
隐藏空白字符变更
内嵌
并排
正在显示
5 个修改的文件
包含
285 行增加
和
3 行删除
+285
-3
characteristics2.js
src/api/characteristics2.js
+1
-1
index.vue
src/pages/v2/characteristics/index.vue
+1
-1
update.vue
src/pages/v2/characteristics/update.vue
+281
-0
update.vue
src/pages/v2/reachschemes/update.vue
+1
-1
routes.js
src/router/routes.js
+1
-0
没有找到文件。
src/api/characteristics2.js
浏览文件 @
41483bb7
...
...
@@ -25,7 +25,7 @@ export function deleteCharacteristic2(id, params = {}) {
}
// 更新用户特征
export
function
upateCharacteristic2
(
id
,
data
=
{})
{
export
function
up
d
ateCharacteristic2
(
id
,
data
=
{})
{
var
headers
=
{
'Content-Type'
:
'application/json'
}
...
...
src/pages/v2/characteristics/index.vue
浏览文件 @
41483bb7
...
...
@@ -133,7 +133,6 @@
<el-table-column
fixed=
"right"
label=
"操作"
>
<
template
slot-scope=
"scope"
>
<el-select
size=
"mini"
:value=
"opera"
@
change=
"operation"
placeholder=
"请选择"
>
<el-option
:value=
"
{ tag: 'detail', row: scope.row }" label="详情">
</el-option>
<el-option
:value=
"
{ tag: 'edit', row: scope.row }" label="编辑">
</el-option>
<el-option
:value=
"
{ tag: 'delete', row: scope.row }" label="删除">
</el-option>
</el-select>
...
...
@@ -393,6 +392,7 @@ export default {
case
'detail'
:
break
case
'edit'
:
this
.
$router
.
push
({
path
:
'/training/characteristics/update'
,
query
:
{
id
:
opera
.
row
.
id
}
})
break
case
'delete'
:
this
.
handleDelete
(
opera
.
row
.
id
)
...
...
src/pages/v2/characteristics/update.vue
0 → 100644
浏览文件 @
41483bb7
<
template
>
<div>
<div>
<el-card
class=
"box-card"
>
<el-breadcrumb
separator-class=
"el-icon-arrow-right"
>
<el-breadcrumb-item
:to=
"
{ path: '/' }">首页
</el-breadcrumb-item>
<el-breadcrumb-item
:to=
"
{ path: '/training/characteristics' }">特征管理
</el-breadcrumb-item>
<el-breadcrumb-item>
编辑特征
</el-breadcrumb-item>
</el-breadcrumb>
</el-card>
</div>
<div>
<el-card
class=
"box-card"
>
<el-form
:model=
"updateForm"
size=
"mini"
>
<el-form-item
label=
"案例"
:label-width=
"formLabelWidth"
style=
"margin-right: 5%"
>
<el-input
disabled
v-model=
"caseName"
size=
"mini"
></el-input>
</el-form-item>
<el-form-item>
<el-divider
content-position=
"left"
>
特征选项配置
</el-divider>
</el-form-item>
<div
v-for=
"(option, optionIndex) in updateForm.options"
:key=
"'options-' + optionIndex"
style=
"margin-top: 3%"
>
<div
style=
"margin-left: 5%"
>
<i
class=
"el-icon-circle-plus-outline"
@
click=
"addOptions(optionIndex)"
>
添加
</i>
<i
class=
"el-icon-remove-outline"
@
click=
"removeOptions(optionIndex)"
>
删除
</i>
</div>
<div
style=
"margin-left: 5%"
>
<span>
<strong>
选项名称:
</strong>
<el-input
size=
"mini"
v-model=
"option.name"
placeholder=
"请输入选项名称"
style=
"width: 50%"
></el-input>
</span>
</div>
<div
style=
"margin-left: 5%"
>
<span><strong>
选项配置:
</strong></span>
</div>
<div
style=
"margin-left: 5%; margin-right: 5%; margin-top: 2%"
v-for=
"(childOption, childOptionIndex) in option.options"
:key=
"'childOption-' + childOptionIndex"
>
<el-card
class=
"box-card"
>
<div>
<span>
<el-tag
size=
"mini"
effect=
"plain"
>
{{
childOption
.
option
}}
</el-tag>
<el-input
size=
"mini"
v-model=
"childOption.option_name"
placeholder=
"请输入选项内容"
style=
"width: 50%"
></el-input>
</span>
<i
class=
"el-icon-circle-plus-outline"
@
click=
"addChildOptions(optionIndex, childOptionIndex)"
></i>
<i
class=
"el-icon-remove-outline"
@
click=
"removeChildOptions(optionIndex, childOptionIndex)"
></i>
</div>
<div
style=
"margin-top: 2%"
>
<span>
分值:
<el-input
size=
"mini"
v-model
.
number=
"childOption.score"
placeholder=
"分值"
style=
"width: 30%"
></el-input>
</span>
</div>
<div
style=
"margin-top: 2%"
>
<span>
是否正确:
<el-radio
size=
"mini"
v-model
.
number=
"childOption.answer"
:label=
"0"
>
否
</el-radio>
<el-radio
size=
"mini"
v-model
.
number=
"childOption.answer"
:label=
"1"
>
是
</el-radio>
</span>
</div>
<div
style=
"margin-top: 2%"
>
<span>
是否触及红线:
<el-radio
size=
"mini"
v-model
.
number=
"childOption.warning"
:label=
"0"
>
否
</el-radio>
<el-radio
size=
"mini"
v-model
.
number=
"childOption.warning"
:label=
"1"
>
是
</el-radio>
</span>
</div>
</el-card>
</div>
</div>
<el-form-item>
<el-divider
content-position=
"left"
>
择算分规则配置
</el-divider>
</el-form-item>
<div
v-for=
"(rule, ruleIndex) in updateForm.rules"
:key=
"'rules-' + ruleIndex"
style=
"margin-top: 2%"
>
<i
style=
"margin-left: 5%"
class=
"el-icon-circle-plus-outline"
@
click=
"addRules(ruleIndex)"
>
添加
</i>
<i
class=
"el-icon-remove-outline"
@
click=
"removeRules(ruleIndex)"
>
删除
</i>
<el-card
class=
"box-card"
style=
"margin-left: 5%; margin-right: 5%; margin-top: 2%"
>
<div
style=
"margin-top: 2%"
>
<span>
最小分区间:
<el-input
size=
"mini"
v-model
.
number=
"rule.min"
placeholder=
"最小分"
style=
"width: 10%"
></el-input>
</span>
<span
style=
"margin-left: 2%"
>
最大分区间:
<el-input
size=
"mini"
v-model
.
number=
"rule.max"
placeholder=
"最小分"
style=
"width: 10%"
></el-input>
</span>
<span
style=
"margin-left: 2%"
>
择算分:
<el-input
size=
"mini"
v-model
.
number=
"rule.score"
placeholder=
"择算分"
style=
"width: 10%"
></el-input>
</span>
</div>
</el-card>
</div>
<el-form-item>
<el-divider
content-position=
"left"
>
风险等级规则配置
</el-divider>
</el-form-item>
<div
v-for=
"(level, levelIndex) in updateForm.levels"
:key=
"'levels-' + levelIndex"
style=
"margin-top: 2%"
>
<i
style=
"margin-left: 5%"
class=
"el-icon-circle-plus-outline"
@
click=
"addLevels(levelIndex)"
>
添加
</i>
<i
class=
"el-icon-remove-outline"
@
click=
"removeLevels(levelIndex)"
>
删除
</i>
<el-card
class=
"box-card"
style=
"margin-left: 5%; margin-right: 5%; margin-top: 2%"
>
<div
style=
"margin-top: 2%"
>
<span>
最小分区间:
<el-input
size=
"mini"
v-model
.
number=
"level.min"
placeholder=
"最小分"
style=
"width: 20%"
></el-input>
</span>
<span
style=
"margin-left: 2%"
>
最大分区间:
<el-input
size=
"mini"
v-model
.
number=
"level.max"
placeholder=
"最小分"
style=
"width: 20%"
></el-input>
</span>
</div>
<div
style=
"margin-top: 2%"
>
<span>
风险等级:
<el-select
size=
"mini"
v-model
.
number=
"level.level"
placeholder=
"请选择风险等级等级"
>
<el-option
label=
"低风险"
:value=
"1"
></el-option>
<el-option
label=
"中风险"
:value=
"2"
></el-option>
<el-option
label=
"高风险"
:value=
"3"
></el-option>
</el-select>
</span>
</div>
</el-card>
</div>
<el-form-item>
<el-divider
content-position=
"left"
></el-divider>
</el-form-item>
<el-form-item>
<div
class=
"demo-drawer__footer"
style=
"margin-left: 60%"
>
<el-button
type=
"primary"
@
click=
"save"
>
保 存
</el-button>
</div>
</el-form-item>
</el-form>
</el-card>
</div>
</div>
</
template
>
<
script
>
import
*
as
characteristicsApi
from
'@/api/characteristics2'
export
default
{
name
:
'update'
,
data
()
{
return
{
id
:
0
,
formLabelWidth
:
'100px'
,
caseName
:
''
,
updateForm
:
{
options
:
[
{
name
:
''
,
options
:
[
{
option
:
'A'
,
option_name
:
''
,
answer
:
0
,
score
:
0
,
warning
:
0
}
]
}
],
rules
:
[
{
min
:
0
,
max
:
10
,
score
:
0
}
],
levels
:
[
{
min
:
0
,
max
:
10
,
level
:
1
}
]
}
}
},
mounted
()
{
this
.
id
=
this
.
$route
.
query
.
id
this
.
getInfo
(
this
.
id
)
this
.
AZkey
=
this
.
A_Z
()
},
methods
:
{
A_Z
()
{
const
result
=
[]
for
(
let
i
=
0
;
i
<
26
;
i
++
)
{
result
.
push
(
String
.
fromCharCode
(
65
+
i
))
}
return
result
},
setKey
(
arr
)
{
arr
.
map
((
item
,
index
)
=>
{
item
.
option
=
this
.
AZkey
[
index
]
})
},
save
()
{
characteristicsApi
.
updateCharacteristic2
(
this
.
id
,
this
.
updateForm
).
then
(
res
=>
{
if
(
res
.
code
===
0
)
{
this
.
$message
.
success
(
res
.
message
)
return
true
}
else
{
this
.
$message
.
error
(
res
.
message
)
return
false
}
})
},
getInitUpdateFormOptions
()
{
return
{
name
:
''
,
options
:
[
{
option
:
'A'
,
option_name
:
''
,
answer
:
0
,
score
:
0
,
warning
:
0
}
]
}
},
getInfo
(
id
)
{
characteristicsApi
.
characteristic2
(
id
).
then
(
res
=>
{
if
(
res
.
code
===
0
)
{
var
characteristics
=
res
.
data
this
.
caseName
=
characteristics
.
case
.
name
if
(
characteristics
.
levels
)
{
this
.
updateForm
.
levels
=
characteristics
.
levels
}
if
(
characteristics
.
rules
)
{
this
.
updateForm
.
rules
=
characteristics
.
rules
}
if
(
characteristics
.
options
)
{
this
.
updateForm
.
options
=
characteristics
.
options
}
return
true
}
else
{
this
.
$message
.
error
(
res
.
message
)
return
false
}
})
},
addOptions
(
optionIndex
)
{
this
.
updateForm
.
options
.
push
(
this
.
getInitUpdateFormOptions
())
},
removeOptions
(
optionIndex
)
{
if
(
this
.
updateForm
.
options
.
length
>
1
)
{
this
.
updateForm
.
options
.
splice
(
optionIndex
,
1
)
}
},
addChildOptions
(
optionIndex
,
childOptionIndex
)
{
if
(
this
.
updateForm
.
options
[
optionIndex
].
options
.
length
>=
26
)
{
this
.
$message
.
warning
(
'最多输入26项'
)
return
false
}
this
.
getKey
=
this
.
updateForm
.
options
[
optionIndex
].
options
[
this
.
updateForm
.
options
[
optionIndex
].
options
.
length
-
1
].
option
this
.
getIndex
=
this
.
AZkey
.
findIndex
(
item
=>
{
return
item
===
this
.
getKey
})
this
.
updateForm
.
options
[
optionIndex
].
options
.
push
({
option
:
this
.
AZkey
[
this
.
getIndex
+
1
],
option_name
:
''
,
answer
:
0
,
score
:
0
,
warning
:
0
})
},
removeChildOptions
(
optionIndex
,
childOptionIndex
)
{
if
(
this
.
updateForm
.
options
[
optionIndex
].
options
.
length
>
1
)
{
this
.
updateForm
.
options
[
optionIndex
].
options
.
splice
(
childOptionIndex
,
1
)
this
.
setKey
(
this
.
updateForm
.
options
[
optionIndex
].
options
)
}
},
addRules
(
ruleIndex
)
{
this
.
updateForm
.
rules
.
push
({
min
:
0
,
max
:
10
,
score
:
0
})
},
removeRules
(
ruleIndex
)
{
if
(
this
.
updateForm
.
rules
.
length
>
1
)
{
this
.
updateForm
.
rules
.
splice
(
ruleIndex
,
1
)
}
},
addLevels
(
levelIndex
)
{
this
.
updateForm
.
levels
.
push
({
min
:
0
,
max
:
10
,
level
:
1
})
},
removeLevels
(
levelIndex
)
{
if
(
this
.
updateForm
.
levels
.
length
>
1
)
{
this
.
updateForm
.
levels
.
splice
(
levelIndex
,
1
)
}
}
}
}
</
script
>
<
style
scoped
>
</
style
>
src/pages/v2/reachschemes/update.vue
浏览文件 @
41483bb7
...
...
@@ -4,7 +4,7 @@
<el-card
class=
"box-card"
>
<el-breadcrumb
separator-class=
"el-icon-arrow-right"
>
<el-breadcrumb-item
:to=
"
{ path: '/' }">首页
</el-breadcrumb-item>
<el-breadcrumb-item
:to=
"
{ path: '/training/reachschemes
/update
' }">触达管理
</el-breadcrumb-item>
<el-breadcrumb-item
:to=
"
{ path: '/training/reachschemes' }">触达管理
</el-breadcrumb-item>
<el-breadcrumb-item>
编辑触达
</el-breadcrumb-item>
</el-breadcrumb>
</el-card>
...
...
src/router/routes.js
浏览文件 @
41483bb7
...
...
@@ -19,6 +19,7 @@ const userGroup = [
{
path
:
'/training/categories'
,
name
:
'category'
,
component
:
()
=>
import
(
'@/pages/v2/categories/category'
)
},
{
path
:
'/training/cases'
,
name
:
'cases'
,
component
:
()
=>
import
(
'@/pages/v2/cases/index'
)
},
{
path
:
'/training/characteristics'
,
name
:
'characteristics'
,
component
:
()
=>
import
(
'@/pages/v2/characteristics/index'
)
},
{
path
:
'/training/characteristics/update'
,
name
:
'characteristics_update'
,
component
:
()
=>
import
(
'@/pages/v2/characteristics/update'
)
},
{
path
:
'/training/reachschemes'
,
name
:
'reach_schemes'
,
component
:
()
=>
import
(
'@/pages/v2/reachschemes/index'
)
},
{
path
:
'/training/reachschemes/update'
,
name
:
'reach_schemes_update'
,
component
:
()
=>
import
(
'@/pages/v2/reachschemes/update'
)
},
{
path
:
'/training/useruseconfigs'
,
name
:
'useruseconfigs'
,
component
:
()
=>
import
(
'@/pages/v2/useruseconfigs/index'
)
},
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论