Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
X
x-training-admin
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
EzijingWeb
x-training-admin
Commits
6c277e63
提交
6c277e63
authored
6月 23, 2021
作者:
pengxiaohui
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
版本功能优化
上级
8530cf81
全部展开
显示空白字符变更
内嵌
并排
正在显示
7 个修改的文件
包含
222 行增加
和
140 行删除
+222
-140
cases2.js
src/api/cases2.js
+7
-0
reach-scheme.js
src/api/reach-scheme.js
+7
-0
index.vue
src/pages/v2/cases/index.vue
+0
-0
category.vue
src/pages/v2/categories/category.vue
+26
-22
index.vue
src/pages/v2/characteristics/index.vue
+76
-58
index.vue
src/pages/v2/reachschemes/index.vue
+78
-30
index.vue
src/pages/v2/useruseconfigs/index.vue
+28
-30
没有找到文件。
src/api/cases2.js
浏览文件 @
6c277e63
...
@@ -36,3 +36,10 @@ export function updateCase2(id, data) {
...
@@ -36,3 +36,10 @@ export function updateCase2(id, data) {
}
}
return
httpRequest
.
put
(
`/api/opera/v2/training/
${
id
}
/case`
,
data
,
{
headers
})
return
httpRequest
.
put
(
`/api/opera/v2/training/
${
id
}
/case`
,
data
,
{
headers
})
}
}
// 发布案例
export
function
publishCase2
(
id
,
data
)
{
var
headers
=
{
'Content-Type'
:
'application/json'
}
return
httpRequest
.
post
(
`/api/opera/v2/training/case/
${
id
}
/publish`
,
data
,
{
headers
})
}
src/api/reach-scheme.js
浏览文件 @
6c277e63
...
@@ -39,3 +39,10 @@ export function reachSchemeList(params) {
...
@@ -39,3 +39,10 @@ export function reachSchemeList(params) {
}
}
return
httpRequest
.
get
(
'/api/opera/v2/training/reach-schemes'
,
{
params
},
{
headers
})
return
httpRequest
.
get
(
'/api/opera/v2/training/reach-schemes'
,
{
params
},
{
headers
})
}
}
// 拷贝触达
export
function
copyReachScheme
(
id
,
data
)
{
var
headers
=
{
'Content-Type'
:
'application/json'
}
return
httpRequest
.
post
(
`/api/opera/v2/training/reach-scheme/
${
id
}
/copy`
,
data
,
{
headers
})
}
src/pages/v2/cases/index.vue
浏览文件 @
6c277e63
差异被折叠。
点击展开。
src/pages/v2/categories/category.vue
浏览文件 @
6c277e63
...
@@ -66,11 +66,17 @@
...
@@ -66,11 +66,17 @@
</el-table-column>
</el-table-column>
<el-table-column
label=
"操作"
>
<el-table-column
label=
"操作"
>
<
template
slot-scope=
"scope"
>
<
template
slot-scope=
"scope"
>
<el-select
size=
"mini"
:value=
"opera"
@
change=
"operation"
placeholder=
"请选择"
>
<el-dropdown
@
command=
"type => handleCommand(type, scope.row)"
>
<el-option
:value=
"
{ tag: 'edit', row: scope.row }" label="编辑">
</el-option>
<span
class=
"el-dropdown-link"
>
<el-option
:value=
"
{ tag: 'addChild', row: scope.row }" label="添加子分类">
</el-option>
<!-- 请选择
<i
class=
"el-icon-arrow-down el-icon--right"
></i>
-->
<el-option
:value=
"
{ tag: 'delete', row: scope.row }" label="删除">
</el-option>
<el-button
size=
"mini"
>
请选择
<i
class=
"el-icon-arrow-down el-icon--right"
></i></el-button>
</el-select>
</span>
<el-dropdown-menu
slot=
"dropdown"
>
<el-dropdown-item
command=
"edit"
>
编辑
</el-dropdown-item>
<el-dropdown-item
command=
"addChild"
>
添加子分类
</el-dropdown-item>
<el-dropdown-item
command=
"delete"
>
删除
</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</
template
>
</
template
>
</el-table-column>
</el-table-column>
</el-table>
</el-table>
...
@@ -398,30 +404,28 @@ export default {
...
@@ -398,30 +404,28 @@ export default {
})
})
})
})
},
},
operation
(
opera
)
{
handleCommand
(
type
,
rowData
)
{
switch
(
opera
.
tag
)
{
switch
(
type
)
{
case
'detail'
:
break
case
'edit'
:
case
'edit'
:
this
.
updateForm
.
id
=
opera
.
row
.
id
this
.
updateForm
.
id
=
rowData
.
id
this
.
updateForm
.
name
=
opera
.
row
.
name
this
.
updateForm
.
name
=
rowData
.
name
this
.
updateForm
.
tag
=
opera
.
row
.
tag
this
.
updateForm
.
tag
=
rowData
.
tag
this
.
updateForm
.
url
=
opera
.
row
.
url
this
.
updateForm
.
url
=
rowData
.
url
if
(
opera
.
row
.
url
)
{
if
(
rowData
.
url
)
{
this
.
updateFileList
=
[{
url
:
opera
.
row
.
url
}]
this
.
updateFileList
=
[{
url
:
rowData
.
url
}]
}
}
this
.
updateForm
.
order
=
opera
.
row
.
order
this
.
updateForm
.
order
=
rowData
.
order
this
.
editCategoryDialogFormVisible
=
true
this
.
editCategoryDialogFormVisible
=
true
break
break
case
'delete'
:
this
.
handleDelete
(
rowData
.
id
)
break
case
'addChild'
:
case
'addChild'
:
this
.
childForm
.
tag
=
opera
.
row
.
tag
this
.
childForm
.
tag
=
rowData
.
tag
this
.
childForm
.
pid
=
opera
.
row
.
id
this
.
childForm
.
pid
=
rowData
.
id
this
.
parentName
=
opera
.
row
.
name
this
.
parentName
=
rowData
.
name
this
.
childCategoryDialogFormVisible
=
true
this
.
childCategoryDialogFormVisible
=
true
break
break
case
'delete'
:
this
.
handleDelete
(
opera
.
row
.
id
)
break
}
}
},
},
add
()
{
add
()
{
...
...
src/pages/v2/characteristics/index.vue
浏览文件 @
6c277e63
...
@@ -21,7 +21,8 @@
...
@@ -21,7 +21,8 @@
</el-input>
</el-input>
<el-button
size=
"mini"
icon=
"el-icon-search"
@
click=
"list(
{ name: searchCaseName, page: 1, limit: limit })">搜 索
</el-button>
<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-refresh"
@
click=
"refresh"
>
刷 新
</el-button>
<el-button
type=
"primary"
size=
"mini"
icon=
"el-icon-plus"
@
click=
"drawer = true"
>
创建特征
</el-button>
<el-button
type=
"primary"
size=
"mini"
icon=
"el-icon-plus"
@
click=
"handleNewCreate"
>
新建特征
</el-button>
<el-button
type=
"primary"
size=
"mini"
icon=
"el-icon-document-add"
@
click=
"handleDraftCreate"
v-if=
"formDraftStr"
>
通过草稿创建特征
</el-button>
</div>
</div>
</el-card>
</el-card>
</div>
</div>
...
@@ -71,11 +72,17 @@
...
@@ -71,11 +72,17 @@
</el-table-column>
</el-table-column>
<el-table-column
fixed=
"right"
label=
"操作"
>
<el-table-column
fixed=
"right"
label=
"操作"
>
<
template
slot-scope=
"scope"
>
<
template
slot-scope=
"scope"
>
<el-select
size=
"mini"
:value=
"opera"
@
change=
"operation"
placeholder=
"请选择"
>
<el-dropdown
@
command=
"type => handleCommand(type, scope.row)"
>
<el-option
:value=
"
{ tag: 'edit', row: scope.row }" label="编辑">
</el-option>
<span
class=
"el-dropdown-link"
>
<el-option
:value=
"
{ tag: 'copy', row: scope.row }" label="复制">
</el-option>
<!-- 请选择
<i
class=
"el-icon-arrow-down el-icon--right"
></i>
-->
<el-option
:value=
"
{ tag: 'delete', row: scope.row }" label="删除">
</el-option>
<el-button
size=
"mini"
>
请选择
<i
class=
"el-icon-arrow-down el-icon--right"
></i></el-button>
</el-select>
</span>
<el-dropdown-menu
slot=
"dropdown"
>
<el-dropdown-item
command=
"edit"
>
编辑
</el-dropdown-item>
<el-dropdown-item
command=
"copy"
>
复制
</el-dropdown-item>
<el-dropdown-item
command=
"delete"
>
删除
</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</
template
>
</
template
>
</el-table-column>
</el-table-column>
</el-table>
</el-table>
...
@@ -99,7 +106,7 @@
...
@@ -99,7 +106,7 @@
direction=
"rtl"
direction=
"rtl"
:append-to-body=
"true"
:append-to-body=
"true"
:withHeader=
"true"
:withHeader=
"true"
:
before-close=
"handleClo
se"
:
wrapperClosable=
"fal
se"
ref=
"drawer"
ref=
"drawer"
size=
"70%"
>
size=
"70%"
>
<div
class=
"demo-drawer__content"
>
<div
class=
"demo-drawer__content"
>
...
@@ -222,7 +229,8 @@
...
@@ -222,7 +229,8 @@
<el-form-item>
<el-form-item>
<div
class=
"demo-drawer__footer"
style=
"margin-left: 60%"
>
<div
class=
"demo-drawer__footer"
style=
"margin-left: 60%"
>
<el-button
@
click=
"cancelForm"
>
取 消
</el-button>
<el-button
@
click=
"cancelForm"
>
取 消
</el-button>
<el-button
type=
"primary"
@
click=
"$refs.drawer.closeDrawer()"
:loading=
"loading"
>
{{ loading ? '提交中 ...' : '确 定' }}
</el-button>
<el-button
type=
"primary"
plain
@
click=
"handleFormDraft"
>
暂 存
</el-button>
<el-button
type=
"primary"
@
click=
"handleFormEnsure"
:loading=
"loading"
>
{{ loading ? '提交中 ...' : '确 定' }}
</el-button>
</div>
</div>
</el-form-item>
</el-form-item>
</el-form>
</el-form>
...
@@ -336,6 +344,37 @@
...
@@ -336,6 +344,37 @@
<
script
>
<
script
>
import
*
as
characteristicsApi
from
'@/api/characteristics2'
import
*
as
characteristicsApi
from
'@/api/characteristics2'
import
*
as
casesApi
from
'@/api/cases2'
import
*
as
casesApi
from
'@/api/cases2'
const
defaultForm
=
{
case2_id
:
''
,
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
}
]
}
export
default
{
export
default
{
name
:
'index'
,
name
:
'index'
,
data
()
{
data
()
{
...
@@ -372,43 +411,15 @@ export default {
...
@@ -372,43 +411,15 @@ export default {
rules
:
[],
rules
:
[],
options
:
[],
options
:
[],
levels
:
[],
levels
:
[],
addForm
:
{
addForm
:
Object
.
assign
({},
defaultForm
),
case2_id
:
''
,
formDraftStr
:
''
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
()
{
mounted
()
{
this
.
list
({
page
:
this
.
currentPage
,
limit
:
this
.
limit
})
this
.
list
({
page
:
this
.
currentPage
,
limit
:
this
.
limit
})
this
.
caseList
({
page
:
1
,
limit
:
10
})
this
.
caseList
({
page
:
1
,
limit
:
10
})
this
.
AZkey
=
this
.
A_Z
()
this
.
AZkey
=
this
.
A_Z
()
this
.
formDraftStr
=
window
.
localStorage
.
getItem
(
'characFormDraftData'
)
},
},
methods
:
{
methods
:
{
A_Z
()
{
A_Z
()
{
...
@@ -442,20 +453,18 @@ export default {
...
@@ -442,20 +453,18 @@ export default {
handleCurrentChange
(
val
)
{
handleCurrentChange
(
val
)
{
this
.
list
({
page
:
val
,
limit
:
this
.
limit
})
this
.
list
({
page
:
val
,
limit
:
this
.
limit
})
},
},
operation
(
opera
)
{
handleCommand
(
type
,
rowData
)
{
switch
(
opera
.
tag
)
{
switch
(
type
)
{
case
'detail'
:
break
case
'copy'
:
this
.
copyDialogTableVisible
=
true
this
.
copyTitle
=
opera
.
row
.
case
.
name
this
.
copyId
=
opera
.
row
.
id
+
''
break
case
'edit'
:
case
'edit'
:
this
.
$router
.
push
({
path
:
'/training/characteristics/update'
,
query
:
{
id
:
opera
.
row
.
id
}
})
this
.
$router
.
push
({
path
:
'/training/characteristics/update'
,
query
:
{
id
:
rowData
.
id
}
})
break
break
case
'delete'
:
case
'delete'
:
this
.
handleDelete
(
opera
.
row
.
id
)
this
.
handleDelete
(
rowData
.
id
)
break
case
'copy'
:
this
.
copyDialogTableVisible
=
true
this
.
copyTitle
=
rowData
.
case
.
name
this
.
copyId
=
rowData
.
id
break
break
}
}
},
},
...
@@ -533,39 +542,48 @@ export default {
...
@@ -533,39 +542,48 @@ export default {
this
.
drawer
=
false
this
.
drawer
=
false
clearTimeout
(
this
.
timer
)
clearTimeout
(
this
.
timer
)
},
},
handleClose
(
done
)
{
handleNewCreate
()
{
this
.
addForm
=
Object
.
assign
({},
defaultForm
)
this
.
drawer
=
true
},
handleDraftCreate
()
{
console
.
log
(
JSON
.
parse
(
this
.
formDraftStr
))
const
data
=
JSON
.
parse
(
this
.
formDraftStr
)
this
.
addForm
=
data
this
.
drawer
=
true
},
handleFormDraft
()
{
const
data
=
JSON
.
stringify
(
this
.
addForm
)
window
.
localStorage
.
setItem
(
'characFormDraftData'
,
data
)
},
handleFormEnsure
()
{
if
(
this
.
loading
)
{
if
(
this
.
loading
)
{
return
return
}
}
this
.
$confirm
(
'确定要提交表单吗?'
)
.
then
(
_
=>
{
this
.
loading
=
true
this
.
loading
=
true
// 提交表单
// 提交表单
const
rLoading
=
this
.
openLoading
(
'.table-list'
)
const
rLoading
=
this
.
openLoading
(
'.table-list'
)
characteristicsApi
.
createCharacteristic2
(
this
.
addForm
).
then
(
res
=>
{
characteristicsApi
.
createCharacteristic2
(
this
.
addForm
).
then
(
res
=>
{
rLoading
.
close
()
this
.
loading
=
false
if
(
res
.
code
===
0
)
{
if
(
res
.
code
===
0
)
{
this
.
list
({
page
:
1
,
limit
:
this
.
limit
})
this
.
list
({
page
:
1
,
limit
:
this
.
limit
})
this
.
caseList
({
page
:
1
,
limit
:
10
})
this
.
caseList
({
page
:
1
,
limit
:
10
})
this
.
AZkey
=
this
.
A_Z
()
this
.
AZkey
=
this
.
A_Z
()
rLoading
.
close
()
this
.
$message
.
success
(
res
.
message
)
this
.
$message
.
success
(
res
.
message
)
return
true
return
true
}
else
{
}
else
{
rLoading
.
close
()
this
.
$message
.
error
(
res
.
message
)
this
.
$message
.
error
(
res
.
message
)
return
false
return
false
}
}
})
})
this
.
timer
=
setTimeout
(()
=>
{
this
.
timer
=
setTimeout
(()
=>
{
done
()
// 动画关闭需要一定的时间
// 动画关闭需要一定的时间
setTimeout
(()
=>
{
setTimeout
(()
=>
{
this
.
loading
=
false
this
.
loading
=
false
},
400
)
},
400
)
},
2000
)
},
2000
)
})
.
catch
(
_
=>
{})
},
},
remoteMethod
(
query
)
{
remoteMethod
(
query
)
{
this
.
caseList
({
name
:
query
,
page
:
1
,
limit
:
10
})
this
.
caseList
({
name
:
query
,
page
:
1
,
limit
:
10
})
...
...
src/pages/v2/reachschemes/index.vue
浏览文件 @
6c277e63
...
@@ -59,10 +59,17 @@
...
@@ -59,10 +59,17 @@
</el-table-column>
</el-table-column>
<el-table-column
fixed=
"right"
label=
"操作"
>
<el-table-column
fixed=
"right"
label=
"操作"
>
<
template
slot-scope=
"scope"
>
<
template
slot-scope=
"scope"
>
<el-select
size=
"mini"
:value=
"opera"
@
change=
"operation"
placeholder=
"请选择"
>
<el-dropdown
@
command=
"type => handleCommand(type, scope.row)"
>
<el-option
:value=
"
{ tag: 'edit', row: scope.row }" label="编辑">
</el-option>
<span
class=
"el-dropdown-link"
>
<el-option
:value=
"
{ tag: 'delete', row: scope.row }" label="删除">
</el-option>
<!-- 请选择
<i
class=
"el-icon-arrow-down el-icon--right"
></i>
-->
</el-select>
<el-button
size=
"mini"
>
请选择
<i
class=
"el-icon-arrow-down el-icon--right"
></i></el-button>
</span>
<el-dropdown-menu
slot=
"dropdown"
>
<el-dropdown-item
command=
"edit"
>
编辑
</el-dropdown-item>
<el-dropdown-item
command=
"copy"
>
复制
</el-dropdown-item>
<el-dropdown-item
command=
"delete"
>
删除
</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</
template
>
</
template
>
</el-table-column>
</el-table-column>
</el-table>
</el-table>
...
@@ -81,12 +88,12 @@
...
@@ -81,12 +88,12 @@
</div>
</div>
<div>
<div>
<el-drawer
<el-drawer
title=
"创建
特征
"
title=
"创建
触达
"
:visible
.
sync=
"drawer"
:visible
.
sync=
"drawer"
direction=
"rtl"
direction=
"rtl"
:append-to-body=
"true"
:append-to-body=
"true"
:withHeader=
"true"
:withHeader=
"true"
:
before-close=
"handleClo
se"
:
wrapperClosable=
"fal
se"
ref=
"drawer"
ref=
"drawer"
size=
"50%"
>
size=
"50%"
>
<div
class=
"demo-drawer__content"
>
<div
class=
"demo-drawer__content"
>
...
@@ -129,7 +136,7 @@
...
@@ -129,7 +136,7 @@
<el-form-item>
<el-form-item>
<div
class=
"demo-drawer__footer"
style=
"margin-left: 60%"
>
<div
class=
"demo-drawer__footer"
style=
"margin-left: 60%"
>
<el-button
@
click=
"cancelForm"
>
取 消
</el-button>
<el-button
@
click=
"cancelForm"
>
取 消
</el-button>
<el-button
type=
"primary"
@
click=
"
$refs.drawer.closeDrawer()
"
:loading=
"loading"
>
{{ loading ? '提交中 ...' : '确 定' }}
</el-button>
<el-button
type=
"primary"
@
click=
"
handleFormEnsure
"
:loading=
"loading"
>
{{ loading ? '提交中 ...' : '确 定' }}
</el-button>
</div>
</div>
</el-form-item>
</el-form-item>
</el-form>
</el-form>
...
@@ -152,6 +159,31 @@
...
@@ -152,6 +159,31 @@
</div>
</div>
</el-dialog>
</el-dialog>
</div>
</div>
<el-dialog
center
:title=
"copyTitle"
:visible
.
sync=
"copyDialogVisible"
>
<el-form
size=
"mini"
:model=
"copyForm"
>
<el-form-item
label=
"案例:"
:label-width=
"formLabelWidth"
>
<el-select
v-model=
"copyForm.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>
<div
slot=
"footer"
class=
"dialog-footer"
>
<el-button
size=
"mini"
@
click=
"copyDialogVisible = false"
>
取 消
</el-button>
<el-button
size=
"mini"
type=
"primary"
@
click=
"handleCopy"
>
确 定
</el-button>
</div>
</el-dialog>
</div>
</div>
</template>
</template>
...
@@ -183,6 +215,12 @@ export default {
...
@@ -183,6 +215,12 @@ export default {
score
:
0
score
:
0
}
}
]
]
},
copyTitle
:
'复制'
,
copyDialogVisible
:
false
,
copyTargetId
:
''
,
copyForm
:
{
case2_id
:
''
}
}
}
}
},
},
...
@@ -197,19 +235,33 @@ export default {
...
@@ -197,19 +235,33 @@ export default {
handleCurrentChange
(
val
)
{
handleCurrentChange
(
val
)
{
this
.
list
({
page
:
val
,
limit
:
this
.
limit
})
this
.
list
({
page
:
val
,
limit
:
this
.
limit
})
},
},
operation
(
opera
)
{
handleCommand
(
type
,
rowData
)
{
switch
(
opera
.
tag
)
{
switch
(
type
)
{
case
'detail'
:
break
case
'edit'
:
case
'edit'
:
this
.
$router
.
push
({
path
:
'/training/reachschemes/update'
,
query
:
{
id
:
opera
.
row
.
id
}
})
this
.
$router
.
push
({
path
:
'/training/reachschemes/update'
,
query
:
{
id
:
rowData
.
id
}
})
break
break
case
'delete'
:
case
'delete'
:
this
.
delete
(
opera
.
row
.
id
)
this
.
handleDelete
(
rowData
.
id
)
break
break
case
'copy'
:
this
.
copyDialogVisible
=
true
this
.
copyTitle
=
rowData
.
case
.
name
this
.
copyTargetId
=
rowData
.
id
break
}
},
handleCopy
()
{
reachSchemeApi
.
copyReachScheme
(
this
.
copyTargetId
,
{
case2_id
:
this
.
copyForm
.
case2_id
+
''
}).
then
(
res
=>
{
if
(
res
.
code
===
0
&&
res
.
data
&&
res
.
data
.
case2_id
)
{
this
.
$message
.
success
(
'复制案例成功'
)
this
.
copyDialogVisible
=
false
this
.
list
({
page
:
this
.
currentPage
,
limit
:
this
.
limit
})
}
else
{
this
.
$message
.
error
(
res
.
message
||
'复制案例失败'
)
}
}
})
},
},
d
elete
(
id
)
{
handleD
elete
(
id
)
{
this
.
$confirm
(
'确认删除?'
,
'提示'
).
then
(
_
=>
{
this
.
$confirm
(
'确认删除?'
,
'提示'
).
then
(
_
=>
{
const
rLoading
=
this
.
openLoading
(
'.table-list'
)
const
rLoading
=
this
.
openLoading
(
'.table-list'
)
reachSchemeApi
.
deleteReachScheme
(
id
).
then
(
res
=>
{
reachSchemeApi
.
deleteReachScheme
(
id
).
then
(
res
=>
{
...
@@ -259,12 +311,18 @@ export default {
...
@@ -259,12 +311,18 @@ export default {
this
.
searchCaseName
=
''
this
.
searchCaseName
=
''
this
.
list
({
page
:
1
,
limit
:
this
.
limit
})
this
.
list
({
page
:
1
,
limit
:
this
.
limit
})
},
},
handleClose
(
done
)
{
remoteMethod
(
query
)
{
this
.
caseList
({
name
:
query
,
page
:
1
,
limit
:
10
})
},
cancelForm
()
{
this
.
loading
=
false
this
.
drawer
=
false
clearTimeout
(
this
.
timer
)
},
handleFormEnsure
()
{
if
(
this
.
loading
)
{
if
(
this
.
loading
)
{
return
return
}
}
this
.
$confirm
(
'确定要提交表单吗?'
)
.
then
(
_
=>
{
this
.
loading
=
true
this
.
loading
=
true
// 提交表单
// 提交表单
const
rLoading
=
this
.
openLoading
(
'.table-list'
)
const
rLoading
=
this
.
openLoading
(
'.table-list'
)
...
@@ -282,31 +340,21 @@ export default {
...
@@ -282,31 +340,21 @@ export default {
]
]
}
}
rLoading
.
close
()
rLoading
.
close
()
this
.
$message
.
success
(
res
.
message
)
this
.
$message
.
success
(
'创建成功'
)
this
.
drawer
=
false
return
true
return
true
}
else
{
}
else
{
rLoading
.
close
()
rLoading
.
close
()
this
.
$message
.
error
(
res
.
message
)
this
.
$message
.
error
(
res
.
message
||
'创建失败'
)
return
false
return
false
}
}
})
})
this
.
timer
=
setTimeout
(()
=>
{
this
.
timer
=
setTimeout
(()
=>
{
done
()
// 动画关闭需要一定的时间
// 动画关闭需要一定的时间
setTimeout
(()
=>
{
setTimeout
(()
=>
{
this
.
loading
=
false
this
.
loading
=
false
},
400
)
},
400
)
},
2000
)
},
2000
)
})
.
catch
(
_
=>
{})
},
remoteMethod
(
query
)
{
this
.
caseList
({
name
:
query
,
page
:
1
,
limit
:
10
})
},
cancelForm
()
{
this
.
loading
=
false
this
.
drawer
=
false
clearTimeout
(
this
.
timer
)
},
},
addKeywords
(
keywordIndex
)
{
addKeywords
(
keywordIndex
)
{
this
.
addForm
.
keywords
.
push
({
keyword
:
''
,
score
:
0
})
this
.
addForm
.
keywords
.
push
({
keyword
:
''
,
score
:
0
})
...
...
src/pages/v2/useruseconfigs/index.vue
浏览文件 @
6c277e63
...
@@ -70,10 +70,16 @@
...
@@ -70,10 +70,16 @@
</el-table-column>
</el-table-column>
<el-table-column
fixed=
"right"
label=
"操作"
>
<el-table-column
fixed=
"right"
label=
"操作"
>
<
template
slot-scope=
"scope"
>
<
template
slot-scope=
"scope"
>
<el-select
size=
"mini"
:value=
"opera"
@
change=
"operation"
placeholder=
"请选择"
>
<el-dropdown
@
command=
"type => handleCommand(type, scope.row)"
>
<el-option
:value=
"
{ tag: 'edit', row: scope.row }" label="编辑">
</el-option>
<span
class=
"el-dropdown-link"
>
<el-option
:value=
"
{ tag: 'delete', row: scope.row }" label="删除">
</el-option>
<!-- 请选择
<i
class=
"el-icon-arrow-down el-icon--right"
></i>
-->
</el-select>
<el-button
size=
"mini"
>
请选择
<i
class=
"el-icon-arrow-down el-icon--right"
></i></el-button>
</span>
<el-dropdown-menu
slot=
"dropdown"
>
<el-dropdown-item
command=
"edit"
>
编辑
</el-dropdown-item>
<el-dropdown-item
command=
"delete"
>
删除
</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</
template
>
</
template
>
</el-table-column>
</el-table-column>
</el-table>
</el-table>
...
@@ -97,7 +103,7 @@
...
@@ -97,7 +103,7 @@
direction=
"rtl"
direction=
"rtl"
:append-to-body=
"true"
:append-to-body=
"true"
:withHeader=
"true"
:withHeader=
"true"
:
before-close=
"handleClo
se"
:
wrapperClosable=
"fal
se"
ref=
"drawer"
ref=
"drawer"
size=
"50%"
>
size=
"50%"
>
<div
class=
"demo-drawer__content"
>
<div
class=
"demo-drawer__content"
>
...
@@ -140,7 +146,7 @@
...
@@ -140,7 +146,7 @@
<el-form-item>
<el-form-item>
<div
class=
"demo-drawer__footer"
style=
"margin-left: 60%"
>
<div
class=
"demo-drawer__footer"
style=
"margin-left: 60%"
>
<el-button
@
click=
"cancelForm"
>
取 消
</el-button>
<el-button
@
click=
"cancelForm"
>
取 消
</el-button>
<el-button
type=
"primary"
@
click=
"
$refs.drawer.closeDrawer()
"
:loading=
"loading"
>
{{ loading ? '提交中 ...' : '确 定' }}
</el-button>
<el-button
type=
"primary"
@
click=
"
handleFormEnsure
"
:loading=
"loading"
>
{{ loading ? '提交中 ...' : '确 定' }}
</el-button>
</div>
</div>
</el-form-item>
</el-form-item>
</el-form>
</el-form>
...
@@ -187,15 +193,13 @@ export default {
...
@@ -187,15 +193,13 @@ export default {
handleCurrentChange
(
val
)
{
handleCurrentChange
(
val
)
{
this
.
list
({
page
:
val
,
limit
:
this
.
limit
})
this
.
list
({
page
:
val
,
limit
:
this
.
limit
})
},
},
operation
(
opera
)
{
handleCommand
(
type
,
rowData
)
{
switch
(
opera
.
tag
)
{
switch
(
type
)
{
case
'detail'
:
break
case
'edit'
:
case
'edit'
:
this
.
$router
.
push
({
path
:
'/training/useruseconfigs/update'
,
query
:
{
id
:
opera
.
row
.
id
}
})
this
.
$router
.
push
({
path
:
'/training/useruseconfigs/update'
,
query
:
{
id
:
rowData
.
id
}
})
break
break
case
'delete'
:
case
'delete'
:
this
.
handleDelete
(
opera
.
row
.
id
)
this
.
handleDelete
(
rowData
.
id
)
break
break
}
}
},
},
...
@@ -254,20 +258,10 @@ export default {
...
@@ -254,20 +258,10 @@ export default {
this
.
drawer
=
false
this
.
drawer
=
false
clearTimeout
(
this
.
timer
)
clearTimeout
(
this
.
timer
)
},
},
addOptions
(
addOptionIndex
)
{
handleFormEnsure
()
{
this
.
addForm
.
options
.
push
(
''
)
},
removeOptions
(
addOptionIndex
)
{
if
(
this
.
addForm
.
options
.
length
>
1
)
{
this
.
addForm
.
options
.
splice
(
addOptionIndex
,
1
)
}
},
handleClose
(
done
)
{
if
(
this
.
loading
)
{
if
(
this
.
loading
)
{
return
return
}
}
this
.
$confirm
(
'确定要提交表单吗?'
)
.
then
(
_
=>
{
this
.
loading
=
true
this
.
loading
=
true
// 提交表单
// 提交表单
const
rLoading
=
this
.
openLoading
(
'.table-list'
)
const
rLoading
=
this
.
openLoading
(
'.table-list'
)
...
@@ -276,23 +270,27 @@ export default {
...
@@ -276,23 +270,27 @@ export default {
this
.
list
({
page
:
1
,
limit
:
this
.
limit
})
this
.
list
({
page
:
1
,
limit
:
this
.
limit
})
this
.
caseList
({
page
:
1
,
limit
:
10
})
this
.
caseList
({
page
:
1
,
limit
:
10
})
rLoading
.
close
()
rLoading
.
close
()
this
.
$message
.
success
(
res
.
message
)
this
.
$message
.
success
(
'创建成功'
)
return
tru
e
this
.
drawer
=
fals
e
}
else
{
}
else
{
rLoading
.
close
()
rLoading
.
close
()
this
.
$message
.
error
(
res
.
message
)
this
.
$message
.
error
(
res
.
message
||
'创建失败'
)
return
false
}
}
})
})
this
.
timer
=
setTimeout
(()
=>
{
this
.
timer
=
setTimeout
(()
=>
{
done
()
// 动画关闭需要一定的时间
// 动画关闭需要一定的时间
setTimeout
(()
=>
{
setTimeout
(()
=>
{
this
.
loading
=
false
this
.
loading
=
false
},
400
)
},
400
)
},
2000
)
},
2000
)
})
},
.
catch
(
_
=>
{})
addOptions
(
addOptionIndex
)
{
this
.
addForm
.
options
.
push
(
''
)
},
removeOptions
(
addOptionIndex
)
{
if
(
this
.
addForm
.
options
.
length
>
1
)
{
this
.
addForm
.
options
.
splice
(
addOptionIndex
,
1
)
}
}
}
}
}
}
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论