Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
W
work-order-web
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
张圳龙
work-order-web
Commits
30cd4e7e
Unverified
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
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
76 additions
and
4 deletions
+76
-4
process.js
src/api/process/admin/process.js
+8
-0
template.js
src/api/process/admin/template.js
+8
-0
process-manager.vue
src/views/process/admin/process-manager.vue
+29
-1
template-manager.vue
src/views/process/admin/template-manager.vue
+31
-3
No files found.
src/api/process/admin/process.js
View file @
30cd4e7e
...
@@ -53,3 +53,11 @@ export function classifyProcessList(params) {
...
@@ -53,3 +53,11 @@ export function classifyProcessList(params) {
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) {
...
@@ -44,3 +44,11 @@ export function deleteTemplate(params) {
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
...
@@ -58,6 +58,13 @@
...
@@ -58,6 +58,13 @@
<el-table-column
label=
"更新时间"
align=
"center"
prop=
"update_time"
width=
"180"
/>
<el-table-column
label=
"更新时间"
align=
"center"
prop=
"update_time"
width=
"180"
/>
<el-table-column
label=
"操作"
align=
"center"
class-name=
"small-padding fixed-width"
>
<el-table-column
label=
"操作"
align=
"center"
class-name=
"small-padding fixed-width"
>
<template
slot-scope=
"scope"
>
<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
<el-button
v-permisaction=
"['process:admin:manager:edit']"
v-permisaction=
"['process:admin:manager:edit']"
size=
"mini"
size=
"mini"
...
@@ -191,7 +198,8 @@ import {
...
@@ -191,7 +198,8 @@ import {
createProcess
,
createProcess
,
updateProcess
,
updateProcess
,
processDetails
,
processDetails
,
deleteProcess
deleteProcess
,
cloneProcess
}
from
'@/api/process/admin/process'
}
from
'@/api/process/admin/process'
import
{
classifyList
}
from
'@/api/process/admin/classify'
import
{
classifyList
}
from
'@/api/process/admin/classify'
...
@@ -497,6 +505,26 @@ export default {
...
@@ -497,6 +505,26 @@ export default {
}
else
{
}
else
{
this
.
ruleForm
.
form_structure
=
''
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
...
@@ -58,6 +58,13 @@
...
@@ -58,6 +58,13 @@
<el-table-column
label=
"更新时间"
align=
"center"
prop=
"update_time"
width=
"180"
/>
<el-table-column
label=
"更新时间"
align=
"center"
prop=
"update_time"
width=
"180"
/>
<el-table-column
label=
"操作"
align=
"center"
class-name=
"small-padding fixed-width"
>
<el-table-column
label=
"操作"
align=
"center"
class-name=
"small-padding fixed-width"
>
<template
slot-scope=
"scope"
>
<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
<el-button
v-permisaction=
"['process:admin:template:edit']"
v-permisaction=
"['process:admin:template:edit']"
size=
"mini"
size=
"mini"
...
@@ -128,7 +135,8 @@ import {
...
@@ -128,7 +135,8 @@ import {
createTemplate
,
createTemplate
,
templateDetails
,
templateDetails
,
editTemplate
,
editTemplate
,
deleteTemplate
deleteTemplate
,
cloneTemplate
}
from
'@/api/process/admin/template'
}
from
'@/api/process/admin/template'
// 表单设计
// 表单设计
...
@@ -235,7 +243,7 @@ export default {
...
@@ -235,7 +243,7 @@ export default {
this
.
handleSave
(
this
.
$refs
.
makingform
.
getJSON
())
this
.
handleSave
(
this
.
$refs
.
makingform
.
getJSON
())
this
.
$refs
[
formName
].
validate
((
valid
)
=>
{
this
.
$refs
[
formName
].
validate
((
valid
)
=>
{
if
(
valid
)
{
if
(
valid
)
{
createTemplate
(
this
.
ruleForm
).
then
(
response
=>
{
createTemplate
(
this
.
ruleForm
).
then
(
()
=>
{
this
.
getList
()
this
.
getList
()
this
.
open
=
false
this
.
open
=
false
})
})
...
@@ -246,7 +254,7 @@ export default {
...
@@ -246,7 +254,7 @@ export default {
this
.
handleSave
(
this
.
$refs
.
makingform
.
getJSON
())
this
.
handleSave
(
this
.
$refs
.
makingform
.
getJSON
())
this
.
$refs
[
formName
].
validate
((
valid
)
=>
{
this
.
$refs
[
formName
].
validate
((
valid
)
=>
{
if
(
valid
)
{
if
(
valid
)
{
editTemplate
(
this
.
ruleForm
).
then
(
response
=>
{
editTemplate
(
this
.
ruleForm
).
then
(
()
=>
{
this
.
getList
()
this
.
getList
()
this
.
open
=
false
this
.
open
=
false
})
})
...
@@ -289,6 +297,26 @@ export default {
...
@@ -289,6 +297,26 @@ export default {
}
else
{
}
else
{
this
.
ruleForm
.
form_structure
=
''
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