Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
X
x-training-admin
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
EzijingWeb
x-training-admin
Commits
c5b6d1e6
提交
c5b6d1e6
authored
2月 08, 2021
作者:
wangyizheng
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
更新案例pdf的预览问题
上级
bdd3e0b0
隐藏空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
421 行增加
和
270 行删除
+421
-270
user-use-config.js
src/api/user-use-config.js
+1
-1
index.vue
src/pages/v2/characteristics/index.vue
+64
-66
index.vue
src/pages/v2/reachschemes/index.vue
+143
-145
index.vue
src/pages/v2/useruseconfigs/index.vue
+213
-58
没有找到文件。
src/api/user-use-config.js
浏览文件 @
c5b6d1e6
...
...
@@ -9,7 +9,7 @@ export function createUserUseConfig(data) {
}
// 添加用户使用配置
export
function
U
serUseConfig
(
id
,
params
=
{})
{
export
function
u
serUseConfig
(
id
,
params
=
{})
{
var
headers
=
{
'Content-Type'
:
'application/json'
}
...
...
src/pages/v2/characteristics/index.vue
浏览文件 @
c5b6d1e6
...
...
@@ -33,72 +33,70 @@
stripe
size=
"mini"
style=
"width: 100%"
>
<el-table-column
fixed
prop=
"id"
label=
"ID"
width=
"150px"
>
</el-table-column>
<el-table-column
width=
"150px"
label=
"案例名称"
>
<el-table-column
fixed
width=
"150px"
label=
"案例名称"
>
<template
slot-scope=
"scope"
>
<span>
{{
scope
.
row
.
case
.
name
}}
</span>
</
template
>
</el-table-column>
<el-table-column
width=
"150px"
label=
"特征选项配置"
>
<
template
slot-scope=
"scope"
>
<el-popover
placement=
"right"
width=
"600"
trigger=
"click"
>
<div
style=
"padding: 14px;"
v-for=
"(option, optionIndex) in scope.row.options"
:key=
"'option-' + optionIndex"
>
<el-card>
<div>
<span><strong>
特征选项名称:
</strong></span><span>
{{
option
.
name
}}
</span>
</div>
<div
class=
"bottom clearfix"
>
<span><strong>
特征选项配置
</strong></span>
<div
v-for=
"(option1, optionIndex1) in option.options"
:key=
"'option1-' + optionIndex1"
>
<span><el-tag
effect=
"plain"
type=
""
size=
"mini"
>
{{
option1
.
option
}}
</el-tag></span>
<span>
{{
option1
.
option_name
}}
, 分数:
{{
option1
.
score
}}
,
</span>
<span>
答案:
<el-icon
v-if=
"option1.answer"
class=
"el-icon-check"
></el-icon>
<el-icon
v-else
class=
"el-icon-close"
></el-icon>
,
</span>
<span>
触及红线:
<el-icon
v-if=
"option1.warning"
class=
"el-icon-check"
></el-icon>
<el-icon
v-else
class=
"el-icon-close"
></el-icon>
</span>
<br/>
</div>
</div>
</el-card>
</div>
<el-button
slot=
"reference"
size=
"mini"
>
查看配置
</el-button>
</el-popover>
</
template
>
</el-table-column>
<el-table-column
width=
"150px"
label=
"择算分规则"
>
<
template
slot-scope=
"scope"
>
<el-popover
placement=
"right"
width=
"500"
trigger=
"click"
>
<div
style=
"padding: 14px;"
v-for=
"(rule, ruleIndex) in scope.row.rules"
:key=
"'rule-' + ruleIndex"
>
<el-card>
<div>
<span><strong>
分数范围:
</strong></span>
<span>
{{
rule
.
min
}}
~
{{
rule
.
max
}}
</span>
</div>
<div>
<span><strong>
得分:
</strong></span>
<span>
{{
rule
.
score
}}
</span>
</el-table-column>
<el-table-column
width=
"150px"
label=
"特征选项配置"
>
<
template
slot-scope=
"scope"
>
<el-popover
placement=
"right"
width=
"600"
trigger=
"click"
>
<div
style=
"padding: 14px;"
v-for=
"(option, optionIndex) in scope.row.options"
:key=
"'option-' + optionIndex"
>
<el-card>
<div>
<span><strong>
特征选项名称:
</strong></span><span>
{{
option
.
name
}}
</span>
</div>
<div
class=
"bottom clearfix"
>
<span><strong>
特征选项配置
</strong></span>
<div
v-for=
"(option1, optionIndex1) in option.options"
:key=
"'option1-' + optionIndex1"
>
<span><el-tag
effect=
"plain"
type=
""
size=
"mini"
>
{{
option1
.
option
}}
</el-tag></span>
<span>
{{
option1
.
option_name
}}
, 分数:
{{
option1
.
score
}}
,
</span>
<span>
答案:
<el-icon
v-if=
"option1.answer"
class=
"el-icon-check"
></el-icon>
<el-icon
v-else
class=
"el-icon-close"
></el-icon>
,
</span>
<span>
触及红线:
<el-icon
v-if=
"option1.warning"
class=
"el-icon-check"
></el-icon>
<el-icon
v-else
class=
"el-icon-close"
></el-icon>
</span>
<br/>
</div>
</el-card>
</div>
<el-button
slot=
"reference"
size=
"mini"
>
查看择算分规则
</el-button>
</el-popover>
</
template
>
</el-table-column>
<el-table-column
width=
"150px"
label=
"风险等级规则"
>
</div>
</el-card>
</div>
<el-button
slot=
"reference"
size=
"mini"
>
查看配置
</el-button>
</el-popover>
</
template
>
</el-table-column>
<el-table-column
width=
"150px"
label=
"择算分规则"
>
<
template
slot-scope=
"scope"
>
<el-popover
placement=
"right"
width=
"500"
trigger=
"click"
>
<div
style=
"padding: 14px;"
v-for=
"(rule, ruleIndex) in scope.row.rules"
:key=
"'rule-' + ruleIndex"
>
<el-card>
<div>
<span><strong>
分数范围:
</strong></span>
<span>
{{
rule
.
min
}}
~
{{
rule
.
max
}}
</span>
</div>
<div>
<span><strong>
得分:
</strong></span>
<span>
{{
rule
.
score
}}
</span>
</div>
</el-card>
</div>
<el-button
slot=
"reference"
size=
"mini"
>
查看择算分规则
</el-button>
</el-popover>
</
template
>
</el-table-column>
<el-table-column
width=
"150px"
label=
"风险等级规则"
>
<
template
slot-scope=
"scope"
>
<el-popover
placement=
"right"
...
...
@@ -120,19 +118,19 @@
</el-popover>
</
template
>
</el-table-column>
<el-table-column
label=
"创建时间"
>
<el-table-column
label=
"创建时间"
>
<
template
slot-scope=
"scope"
>
<i
class=
"el-icon-time"
></i>
<span
style=
"margin-left: 10px"
>
{{
scope
.
row
.
created_at
}}
</span>
</
template
>
</el-table-column>
<el-table-column
label=
"更新时间"
>
<el-table-column
label=
"更新时间"
>
<
template
slot-scope=
"scope"
>
<i
class=
"el-icon-time"
></i>
<span
style=
"margin-left: 10px"
>
{{
scope
.
row
.
updated_at
}}
</span>
</
template
>
</el-table-column>
<el-table-column
fixed=
"right"
label=
"操作"
>
<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>
...
...
@@ -141,7 +139,7 @@
</el-select>
</
template
>
</el-table-column>
</el-table>
</el-table>
<div
class=
"block"
>
<el-pagination
@
size-change=
"handleSizeChange"
...
...
src/pages/v2/reachschemes/index.vue
浏览文件 @
c5b6d1e6
<
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>
触达管理
</el-breadcrumb-item>
</el-breadcrumb>
</el-card>
</div>
<div>
<el-card
class=
"box-card"
>
<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>
特征管理
</el-breadcrumb-item>
</el-breadcrumb>
</el-card>
<el-input
placeholder=
"请输入案例名称"
prefix-icon=
"el-icon-search"
v-model=
"searchCaseName"
size=
"mini"
style=
"width: 30%"
>
</el-input>
<el-button
size=
"mini"
icon=
"el-icon-search"
@
click=
"list(
{ name: searchCaseName, page: 1, limit: limit })">搜 索
</el-button>
<el-button
type=
"primary"
size=
"mini"
icon=
"el-icon-refresh"
@
click=
"refresh"
>
刷 新
</el-button>
<el-button
type=
"primary"
size=
"mini"
icon=
"el-icon-plus"
@
click=
"drawer = true"
>
创建触达
</el-button>
</div>
<div>
<el-card
class=
"box-card"
>
<div>
<el-input
placeholder=
"请输入案例名称"
prefix-icon=
"el-icon-search"
v-model=
"searchCaseName"
size=
"mini"
style=
"width: 30%"
>
</el-input>
<el-button
size=
"mini"
icon=
"el-icon-search"
@
click=
"list(
{ name: searchCaseName, page: 1, limit: limit })">搜 索
</el-button>
<el-button
type=
"primary"
size=
"mini"
icon=
"el-icon-refresh"
@
click=
"refresh"
>
刷 新
</el-button>
<el-button
type=
"primary"
size=
"mini"
icon=
"el-icon-plus"
@
click=
"drawer = true"
>
创建触达
</el-button>
</div>
</el-card>
</div>
<div>
<el-card
class=
"box-card"
>
<el-table
:data=
"tableData"
border
stripe
size=
"mini"
style=
"width: 100%"
>
<el-table-column
fixed
prop=
"id"
label=
"ID"
width=
"80px"
>
</el-table-column>
<el-table-column
label=
"案例名称"
>
<template
slot-scope=
"scope"
>
<span>
{{
scope
.
row
.
case
.
name
}}
</span>
</
template
>
</el-table-column>
<el-table-column
label=
"关键词配置"
>
<
template
slot-scope=
"scope"
>
<el-popover
placement=
"right"
width=
"500"
trigger=
"click"
>
<div
style=
"padding: 14px;"
v-for=
"(keyword, keywordIndex) in scope.row.keywords"
:key=
"'keyword-' + keywordIndex"
>
<el-card>
<span><strong>
关键词:
</strong></span>
<span>
{{
keyword
.
keyword
}}
,
</span>
<span><strong>
分数:
</strong></span>
<span>
{{
keyword
.
score
}}
</span>
</el-card>
</div>
<el-button
slot=
"reference"
size=
"mini"
>
查看关键词
</el-button>
</el-popover>
</
template
>
</el-table-column>
<el-table-column
label=
"创建时间"
>
<
template
slot-scope=
"scope"
>
<i
class=
"el-icon-time"
></i>
<span
style=
"margin-left: 10px"
>
{{
scope
.
row
.
created_at
}}
</span>
</
template
>
</el-table-column>
<el-table-column
label=
"更新时间"
>
<
template
slot-scope=
"scope"
>
<i
class=
"el-icon-time"
></i>
<span
style=
"margin-left: 10px"
>
{{
scope
.
row
.
updated_at
}}
</span>
</
template
>
</el-table-column>
<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>
</
template
>
</el-table-column>
</el-table>
<div
class=
"block"
>
<el-pagination
@
size-change=
"handleSizeChange"
@
current-change=
"handleCurrentChange"
:current-page=
"currentPage"
:page-sizes=
"[10, 20, 30, 50, 100]"
:page-size=
"limit"
layout=
"total, sizes, prev, pager, next, jumper"
:total=
"totalPage"
>
</el-pagination>
</el-card>
</div>
<div>
<el-card
class=
"box-card"
>
<el-table
:data=
"tableData"
border
stripe
size=
"mini"
style=
"width: 100%"
>
<el-table-column
fixed
label=
"案例名称"
>
<template
slot-scope=
"scope"
>
<span>
{{
scope
.
row
.
case
.
name
}}
</span>
</
template
>
</el-table-column>
<el-table-column
label=
"关键词配置"
>
<
template
slot-scope=
"scope"
>
<el-popover
placement=
"right"
width=
"500"
trigger=
"click"
>
<div
style=
"padding: 14px;"
v-for=
"(keyword, keywordIndex) in scope.row.keywords"
:key=
"'keyword-' + keywordIndex"
>
<el-card>
<span><strong>
关键词:
</strong></span>
<span>
{{
keyword
.
keyword
}}
,
</span>
<span><strong>
分数:
</strong></span>
<span>
{{
keyword
.
score
}}
</span>
</el-card>
</div>
</el-card>
<el-button
slot=
"reference"
size=
"mini"
>
查看关键词
</el-button>
</el-popover>
</
template
>
</el-table-column>
<el-table-column
label=
"创建时间"
>
<
template
slot-scope=
"scope"
>
<i
class=
"el-icon-time"
></i>
<span
style=
"margin-left: 10px"
>
{{
scope
.
row
.
created_at
}}
</span>
</
template
>
</el-table-column>
<el-table-column
label=
"更新时间"
>
<
template
slot-scope=
"scope"
>
<i
class=
"el-icon-time"
></i>
<span
style=
"margin-left: 10px"
>
{{
scope
.
row
.
updated_at
}}
</span>
</
template
>
</el-table-column>
<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>
</
template
>
</el-table-column>
</el-table>
<div
class=
"block"
>
<el-pagination
@
size-change=
"handleSizeChange"
@
current-change=
"handleCurrentChange"
:current-page=
"currentPage"
:page-sizes=
"[10, 20, 30, 50, 100]"
:page-size=
"limit"
layout=
"total, sizes, prev, pager, next, jumper"
:total=
"totalPage"
>
</el-pagination>
</div>
<div
>
<el-drawer
title=
"创建特征"
:visible
.
sync=
"drawer"
direction=
"rtl
"
:append-to-body=
"true
"
:withHeader=
"true
"
:before-close=
"handleClos
e"
ref=
"drawer
"
size=
"50%"
>
<div
class=
"demo-drawer__content"
>
<el-form
:model=
"addForm"
size=
"mini
"
>
<el-form-item
label=
"案例"
:label-width=
"formLabelWidth
"
>
<el-select
v-model=
"addForm.case2_id"
filterable
remote
reserve-keyword
placeholder=
"请输入案例名称"
:remote-method=
"remoteMethod"
:loading=
"caseLoading"
>
<el-option
v-for=
"casesItem in cases"
:key=
"casesItem.value"
:label=
"casesItem.name
"
:value=
"casesItem.id"
>
</el-option>
</el-select
>
</el-form-item
>
<el-form-item
>
<el-divider
content-position=
"left"
>
关键词配置
</el-divider
>
</
el-form-item>
<div
style=
"margin-top: 2%"
v-for=
"(keyword, keywordIndex) in addForm.keywords"
:key=
"'keyword-' + keywordIndex"
>
<div
style=
"margin-left: 15%; margin-top: 2%"
>
<i
class=
"el-icon-circle-plus-outline"
@
click=
"addKeywords(keywordIndex)"
>
添加
</i
>
<i
class=
"el-icon-remove-outline"
@
click=
"removeKeywords(keywordIndex)"
>
删除
</i
>
</div
>
<el-card
style=
"margin-left: 5%; margin-top: 2%"
>
<span><strong>
关键词:
</strong></span
>
<el-input
size=
"mini"
v-model=
"keyword.keyword"
placeholder=
"请输入关键词"
style=
"width: 40%"
></el-input
>
<span
style=
"margin-left: 2%"
><strong>
分数
:
</strong></span>
<el-input
size=
"mini"
v-model
.
number=
"keyword.score"
placeholder=
"请输入分数"
style=
"width: 2
0%"
></el-input>
</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
@
click=
"cancelForm"
>
取 消
</el-button
>
<el-button
type=
"primary"
@
click=
"$refs.drawer.closeDrawer()"
:loading=
"loading"
>
{{ loading ? '提交中 ...' : '确 定' }}
</el-button
>
</div
>
</el-form-item
>
</el-form
>
</div
>
</el-drawer
>
</el-card
>
</div>
<div>
<el-drawer
title=
"创建特征
"
:visible
.
sync=
"drawer
"
direction=
"rtl
"
:append-to-body=
"tru
e"
:withHeader=
"true
"
:before-close=
"handleClose"
ref=
"drawer"
size=
"50%
"
>
<div
class=
"demo-drawer__content
"
>
<el-form
:model=
"addForm"
size=
"mini"
>
<el-form-item
label=
"案例"
:label-width=
"formLabelWidth"
>
<el-select
v-model=
"addForm.case2_id"
filterable
remote
reserve-keyword
placeholder=
"请输入案例名称"
:remote-method=
"remoteMethod"
:loading=
"caseLoading"
>
<el-option
v-for=
"casesItem in cases
"
:key=
"casesItem.value"
:label=
"casesItem.name"
:value=
"casesItem.id"
>
</el-option
>
</el-select
>
</el-form-item
>
<
el-form-item>
<el-divider
content-position=
"left"
>
关键词配置
</el-divider
>
</el-form-item
>
<div
style=
"margin-top: 2%"
v-for=
"(keyword, keywordIndex) in addForm.keywords"
:key=
"'keyword-' + keywordIndex"
>
<div
style=
"margin-left: 15%; margin-top: 2%"
>
<i
class=
"el-icon-circle-plus-outline"
@
click=
"addKeywords(keywordIndex)"
>
添加
</i
>
<i
class=
"el-icon-remove-outline"
@
click=
"removeKeywords(keywordIndex)"
>
删除
</i
>
</div
>
<el-card
style=
"margin-left: 5%; margin-top: 2%"
>
<span><strong>
关键词
:
</strong></span>
<el-input
size=
"mini"
v-model=
"keyword.keyword"
placeholder=
"请输入关键词"
style=
"width: 4
0%"
></el-input>
<span
style=
"margin-left: 2%"
><strong>
分数:
</strong></span
>
<el-input
size=
"mini"
v-model
.
number=
"keyword.score"
placeholder=
"请输入分数"
style=
"width: 20%"
></el-input
>
</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
@
click=
"cancelForm"
>
取 消
</el-button
>
<el-button
type=
"primary"
@
click=
"$refs.drawer.closeDrawer()"
:loading=
"loading"
>
{{ loading ? '提交中 ...' : '确 定' }}
</el-button
>
</div
>
</el-form-item
>
</el-form
>
</div>
</el-drawer>
</div>
</div>
</template>
...
...
src/pages/v2/useruseconfigs/index.vue
浏览文件 @
c5b6d1e6
<
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>
用户使用配置管理
</el-breadcrumb-item>
</el-breadcrumb>
</el-card>
</div>
<div>
<el-card
class=
"box-card"
>
<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>
特征管理
</el-breadcrumb-item>
</el-breadcrumb>
</el-card>
<el-input
placeholder=
"请输入案例名称"
prefix-icon=
"el-icon-search"
v-model=
"searchCaseName"
size=
"mini"
style=
"width: 30%"
>
</el-input>
<el-button
size=
"mini"
icon=
"el-icon-search"
@
click=
"list(
{ name: searchCaseName, page: 1, limit: limit })">搜 索
</el-button>
<el-button
type=
"primary"
size=
"mini"
icon=
"el-icon-refresh"
@
click=
"refresh"
>
刷 新
</el-button>
<el-button
type=
"primary"
size=
"mini"
icon=
"el-icon-plus"
@
click=
"drawer = true"
>
创建用户使用配置
</el-button>
</div>
<div>
<el-card
class=
"box-card"
>
<div>
<el-input
placeholder=
"请输入案例名称"
prefix-icon=
"el-icon-search"
v-model=
"searchCaseName"
size=
"mini"
style=
"width: 30%"
>
</el-input>
<el-button
size=
"mini"
icon=
"el-icon-search"
@
click=
"list(
{ name: searchCaseName, page: 1, limit: limit })">搜 索
</el-button>
<el-button
type=
"primary"
size=
"mini"
icon=
"el-icon-refresh"
@
click=
"refresh"
>
刷 新
</el-button>
<el-button
type=
"primary"
size=
"mini"
icon=
"el-icon-plus"
@
click=
"drawer = true"
>
创建用户使用配置
</el-button>
</el-card>
</div>
<div>
<el-card
class=
"box-card"
>
<el-table
:data=
"tableData"
border
stripe
size=
"mini"
style=
"width: 100%"
>
<el-table-column
fixed
label=
"案例名称"
>
<template
slot-scope=
"scope"
>
<span>
{{
scope
.
row
.
case
.
name
}}
</span>
</
template
>
</el-table-column>
<el-table-column
label=
"配置项"
>
<
template
slot-scope=
"scope"
>
<el-popover
placement=
"right"
width=
"500"
trigger=
"click"
>
<div
style=
"padding: 14px;"
v-for=
"(option, optionIndex) in scope.row.options"
:key=
"'option-' + optionIndex"
>
<el-card>
<div>
<span>
{{
option
}}
</span>
</div>
</el-card>
</div>
</el-card>
<el-button
slot=
"reference"
size=
"mini"
>
查看择算分规则
</el-button>
</el-popover>
</
template
>
</el-table-column>
<el-table-column
label=
"创建时间"
>
<
template
slot-scope=
"scope"
>
<i
class=
"el-icon-time"
></i>
<span
style=
"margin-left: 10px"
>
{{
scope
.
row
.
created_at
}}
</span>
</
template
>
</el-table-column>
<el-table-column
label=
"更新时间"
>
<
template
slot-scope=
"scope"
>
<i
class=
"el-icon-time"
></i>
<span
style=
"margin-left: 10px"
>
{{
scope
.
row
.
updated_at
}}
</span>
</
template
>
</el-table-column>
<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>
</
template
>
</el-table-column>
</el-table>
<div
class=
"block"
>
<el-pagination
@
size-change=
"handleSizeChange"
@
current-change=
"handleCurrentChange"
:current-page=
"currentPage"
:page-sizes=
"[10, 20, 30, 50, 100]"
:page-size=
"limit"
layout=
"total, sizes, prev, pager, next, jumper"
:total=
"totalPage"
>
</el-pagination>
</div>
<div>
<el-card
class=
"box-card"
>
<el-table
:data=
"tableData"
border
stripe
size=
"mini"
style=
"width: 100%"
>
<el-table-column
fixed
prop=
"id"
label=
"ID"
width=
"150px"
>
</el-table-column>
<el-table-column
fixed
width=
"150px"
label=
"案例名称"
>
<template
slot-scope=
"scope"
>
<span>
{{
scope
.
row
.
case
.
name
}}
</span>
</
template
>
</el-table-column>
<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>
</
template
>
</el-table-column>
</el-table>
<div
class=
"block"
>
<el-pagination
@
size-change=
"handleSizeChange"
@
current-change=
"handleCurrentChange"
:current-page=
"currentPage"
:page-sizes=
"[10, 20, 30, 50, 100]"
:page-size=
"limit"
layout=
"total, sizes, prev, pager, next, jumper"
:total=
"totalPage"
>
</el-pagination>
</el-card>
</div>
<div>
<el-drawer
title=
"创建用户使用配置"
:visible
.
sync=
"drawer"
direction=
"rtl"
:append-to-body=
"true"
:withHeader=
"true"
:before-close=
"handleClose"
ref=
"drawer"
size=
"50%"
>
<div
class=
"demo-drawer__content"
>
<el-form
:model=
"addForm"
size=
"mini"
>
<el-form-item
label=
"案例"
:label-width=
"formLabelWidth"
>
<el-select
v-model
.
number=
"addForm.case2_id"
filterable
remote
reserve-keyword
placeholder=
"请输入案例名称"
:remote-method=
"remoteMethod"
:loading=
"caseLoading"
>
<el-option
v-for=
"casesItem in cases"
:key=
"casesItem.value"
:label=
"casesItem.name"
:value=
"casesItem.id"
>
</el-option>
</el-select>
</el-form-item>
<el-form-item>
<el-divider
content-position=
"left"
>
配置
</el-divider>
</el-form-item>
<div
v-for=
"(addOption, addOptionIndex) in addForm.options"
:key=
"'addOption-' + addOptionIndex"
style=
"margin-top: 2%"
>
<i
style=
"margin-left: 15%"
class=
"el-icon-circle-plus-outline"
@
click=
"addOptions(addOptionIndex)"
>
添加
</i>
<i
class=
"el-icon-remove-outline"
@
click=
"removeOptions(addOptionIndex)"
>
删除
</i>
<el-card
class=
"box-card"
style=
"margin-left: 10%; margin-top: 2%"
>
<div
style=
"margin-top: 2%"
>
<span
style=
"margin-left: 2%"
>
<span>
配置项:
</span>
<el-input
size=
"mini"
v-model=
"addForm.options[addOptionIndex]"
placeholder=
"配置项"
style=
"width: 50%"
></el-input>
</span>
</div>
</el-card>
</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
@
click=
"cancelForm"
>
取 消
</el-button>
<el-button
type=
"primary"
@
click=
"$refs.drawer.closeDrawer()"
:loading=
"loading"
>
{{ loading ? '提交中 ...' : '确 定' }}
</el-button>
</div>
</el-form-item>
</el-form>
</div>
</el-drawer>
</div>
</div>
</template>
<
script
>
import
*
as
userUseConfigApi
from
'@/api/user-use-config'
import
*
as
casesApi
from
'@/api/cases2'
export
default
{
name
:
'index'
,
data
()
{
...
...
@@ -78,11 +163,22 @@ export default {
limit
:
10
,
tableData
:
[],
drawer
:
false
,
opera
:
''
opera
:
''
,
addForm
:
{
case2_id
:
''
,
options
:
[
'APP弹窗'
]
},
loading
:
false
,
caseLoading
:
false
,
cases
:
[],
formLabelWidth
:
'100px'
}
},
mounted
()
{
this
.
list
({
page
:
this
.
currentPage
,
limit
:
this
.
limit
})
this
.
caseList
({
page
:
1
,
limit
:
10
})
},
methods
:
{
handleSizeChange
(
val
)
{
...
...
@@ -117,6 +213,65 @@ export default {
refresh
()
{
this
.
searchCaseName
=
''
this
.
list
({
page
:
1
,
limit
:
this
.
limit
})
},
caseList
(
params
=
{})
{
this
.
caseLoading
=
true
casesApi
.
case2s
(
params
).
then
(
res
=>
{
if
(
res
.
code
===
0
)
{
this
.
cases
=
res
.
data
.
data
this
.
caseLoading
=
false
return
true
}
else
{
this
.
$message
.
error
(
res
.
message
)
return
false
}
})
},
remoteMethod
(
query
)
{
this
.
caseList
({
name
:
query
,
page
:
1
,
limit
:
10
})
},
cancelForm
()
{
this
.
loading
=
false
this
.
drawer
=
false
clearTimeout
(
this
.
timer
)
},
addOptions
(
addOptionIndex
)
{
this
.
addForm
.
options
.
push
(
''
)
},
removeOptions
(
addOptionIndex
)
{
if
(
this
.
addForm
.
options
.
length
>
1
)
{
this
.
addForm
.
options
.
splice
(
addOptionIndex
,
1
)
}
},
handleClose
(
done
)
{
if
(
this
.
loading
)
{
return
}
this
.
$confirm
(
'确定要提交表单吗?'
)
.
then
(
_
=>
{
this
.
loading
=
true
// 提交表单
console
.
log
(
this
.
addForm
)
userUseConfigApi
.
createUserUseConfig
(
this
.
addForm
).
then
(
res
=>
{
if
(
res
.
code
===
0
)
{
this
.
list
({
page
:
1
,
limit
:
this
.
limit
})
this
.
caseList
({
page
:
1
,
limit
:
10
})
this
.
$message
.
success
(
res
.
message
)
return
true
}
else
{
this
.
$message
.
error
(
res
.
message
)
return
false
}
})
this
.
timer
=
setTimeout
(()
=>
{
done
()
// 动画关闭需要一定的时间
setTimeout
(()
=>
{
this
.
loading
=
false
},
400
)
},
2000
)
})
.
catch
(
_
=>
{})
}
}
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论