Commit 4667f18b by Mr. Lan

feat: 添加模版及流程的克隆功能。

parent 0420ffdd
...@@ -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'
})
}
...@@ -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'
})
}
...@@ -59,6 +59,13 @@ ...@@ -59,6 +59,13 @@
<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 <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']" v-permisaction="['process:admin:manager:edit']"
size="mini" size="mini"
type="text" type="text"
...@@ -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: '已取消'
})
})
} }
} }
} }
......
...@@ -59,6 +59,13 @@ ...@@ -59,6 +59,13 @@
<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 <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']" v-permisaction="['process:admin:template:edit']"
size="mini" size="mini"
type="text" type="text"
...@@ -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: '已取消'
})
})
} }
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment