Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Chatopera OpenSource
/
ferry_web
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Members
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
30cd4e7e
authored
Feb 19, 2021
by
lanyulei
Committed by
GitHub
Feb 19, 2021
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #56 from lanyulei/dev
feat: 添加模版及流程的克隆功能。
parents
0420ffdd
4667f18b
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
76 additions
and
4 deletions
src/api/process/admin/process.js
src/api/process/admin/template.js
src/views/process/admin/process-manager.vue
src/views/process/admin/template-manager.vue
src/api/process/admin/process.js
View file @
30cd4e7e
...
...
@@ -53,3 +53,11 @@ export function classifyProcessList(params) {
params
})
}
// 克隆流程
export
function
cloneProcess
(
id
)
{
return
request
({
url
:
`/api/v1/process/clone/
${
id
}
`
,
method
:
'post'
})
}
src/api/process/admin/template.js
View file @
30cd4e7e
...
...
@@ -44,3 +44,11 @@ export function deleteTemplate(params) {
params
})
}
// 克隆模版
export
function
cloneTemplate
(
id
)
{
return
request
({
url
:
`/api/v1/tpl/clone/
${
id
}
`
,
method
:
'post'
})
}
src/views/process/admin/process-manager.vue
View file @
30cd4e7e
...
...
@@ -59,6 +59,13 @@
<el-table-column
label=
"操作"
align=
"center"
class-name=
"small-padding fixed-width"
>
<template
slot-scope=
"scope"
>
<el-button
v-permisaction=
"['process:admin:manager:clone']"
size=
"mini"
type=
"text"
icon=
"el-icon-receiving"
@
click=
"handleClone(scope.row)"
>
克隆
</el-button>
<el-button
v-permisaction=
"['process:admin:manager:edit']"
size=
"mini"
type=
"text"
...
...
@@ -191,7 +198,8 @@ import {
createProcess
,
updateProcess
,
processDetails
,
deleteProcess
deleteProcess
,
cloneProcess
}
from
'@/api/process/admin/process'
import
{
classifyList
}
from
'@/api/process/admin/classify'
...
...
@@ -497,6 +505,26 @@ export default {
}
else
{
this
.
ruleForm
.
form_structure
=
''
}
},
handleClone
(
row
)
{
this
.
$confirm
(
`确认克隆流程 <
${
row
.
name
}
> ?`
,
'提示'
,
{
confirmButtonText
:
'确定'
,
cancelButtonText
:
'取消'
,
type
:
'info'
}).
then
(()
=>
{
cloneProcess
(
row
.
id
).
then
(()
=>
{
this
.
getList
()
this
.
$message
({
type
:
'success'
,
message
:
'流程已克隆!'
})
})
}).
catch
(()
=>
{
this
.
$message
({
type
:
'info'
,
message
:
'已取消'
})
})
}
}
}
...
...
src/views/process/admin/template-manager.vue
View file @
30cd4e7e
...
...
@@ -59,6 +59,13 @@
<el-table-column
label=
"操作"
align=
"center"
class-name=
"small-padding fixed-width"
>
<template
slot-scope=
"scope"
>
<el-button
v-permisaction=
"['process:admin:template:clone']"
size=
"mini"
type=
"text"
icon=
"el-icon-receiving"
@
click=
"handleClone(scope.row)"
>
克隆
</el-button>
<el-button
v-permisaction=
"['process:admin:template:edit']"
size=
"mini"
type=
"text"
...
...
@@ -128,7 +135,8 @@ import {
createTemplate
,
templateDetails
,
editTemplate
,
deleteTemplate
deleteTemplate
,
cloneTemplate
}
from
'@/api/process/admin/template'
// 表单设计
...
...
@@ -235,7 +243,7 @@ export default {
this
.
handleSave
(
this
.
$refs
.
makingform
.
getJSON
())
this
.
$refs
[
formName
].
validate
((
valid
)
=>
{
if
(
valid
)
{
createTemplate
(
this
.
ruleForm
).
then
(
response
=>
{
createTemplate
(
this
.
ruleForm
).
then
(
()
=>
{
this
.
getList
()
this
.
open
=
false
})
...
...
@@ -246,7 +254,7 @@ export default {
this
.
handleSave
(
this
.
$refs
.
makingform
.
getJSON
())
this
.
$refs
[
formName
].
validate
((
valid
)
=>
{
if
(
valid
)
{
editTemplate
(
this
.
ruleForm
).
then
(
response
=>
{
editTemplate
(
this
.
ruleForm
).
then
(
()
=>
{
this
.
getList
()
this
.
open
=
false
})
...
...
@@ -289,6 +297,26 @@ export default {
}
else
{
this
.
ruleForm
.
form_structure
=
''
}
},
handleClone
(
row
)
{
this
.
$confirm
(
`确认克隆模版 <
${
row
.
name
}
> ?`
,
'提示'
,
{
confirmButtonText
:
'确定'
,
cancelButtonText
:
'取消'
,
type
:
'info'
}).
then
(()
=>
{
cloneTemplate
(
row
.
id
).
then
(()
=>
{
this
.
getList
()
this
.
$message
({
type
:
'success'
,
message
:
'模版已克隆!'
})
})
}).
catch
(()
=>
{
this
.
$message
({
type
:
'info'
,
message
:
'已取消'
})
})
}
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
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 comment