From a7d32ce6ed99b8d34423883334c1f4fdb062bf76 Mon Sep 17 00:00:00 2001 From: ssc Date: Wed, 19 May 2021 22:01:13 +0800 Subject: [PATCH] :tada: 1.0.1.RELEASE --- .../plugin/workflow/design/deployment.vue | 28 ++-- src/views/plugin/workflow/design/form.vue | 138 +++++++++++++++--- src/views/plugin/workflow/design/index.vue | 38 ++++- src/views/plugin/workflow/design/model.vue | 1 + 4 files changed, 169 insertions(+), 36 deletions(-) diff --git a/src/views/plugin/workflow/design/deployment.vue b/src/views/plugin/workflow/design/deployment.vue index 6bd717f..2ef70ef 100644 --- a/src/views/plugin/workflow/design/deployment.vue +++ b/src/views/plugin/workflow/design/deployment.vue @@ -142,7 +142,7 @@ export default { return { addBtn: this.vaildData(this.permission.deployment_add, false), viewBtn: this.vaildData(this.permission.deployment_view, false), - delBtn: this.vaildData(this.permission.deployment_delete, false), + delBtn: this.vaildData(this.permission.wf_design_deployment_delete, false), editBtn: this.vaildData(this.permission.deployment_edit, false) }; }, @@ -179,21 +179,25 @@ export default { }) }, rowDel(row) { - this.$confirm("确定将选择数据删除?", { + this.$confirm("此操作会级联删除当前正在进行的流程实例,且无法恢复,确定要删除吗?", { confirmButtonText: "确定", cancelButtonText: "取消", type: "warning" - }) - .then(() => { - return remove({ deploymentId: row.deploymentId }); + }).then(() => { + this.$confirm("二次确认!此操作会级联删除当前正在进行的流程实例,且无法恢复,确定要删除吗?", { + confirmButtonText: "确定", + cancelButtonText: "取消", + type: "warning" + }).then(() => { + remove({ deploymentId: row.deploymentId }).then(() => { + this.onLoad(this.page); + this.$message({ + type: "success", + message: "操作成功!" + }) + }) }) - .then(() => { - this.onLoad(this.page); - this.$message({ - type: "success", - message: "操作成功!" - }); - }); + }) }, handleDelete() { if (this.selectionList.length === 0) { diff --git a/src/views/plugin/workflow/design/form.vue b/src/views/plugin/workflow/design/form.vue index 9a8ee4c..38190dc 100644 --- a/src/views/plugin/workflow/design/form.vue +++ b/src/views/plugin/workflow/design/form.vue @@ -22,17 +22,24 @@ size="mini" icon="el-icon-delete" plain - v-if="permission.wf_design_model_delete" + v-if="permission.wf_design_form_delete" @click="handleDelete">删 除 + + + + + @@ -149,7 +166,52 @@ export default { type: 'textarea', span: 24, display: true - }] + }], + copyOption: { + column: [{ + label: "表单key", + prop: "key", + rules: [{ + required: true, + message: "请输入表单key", + trigger: "blur" + }], + }, + { + label: "表单名称", + prop: "name", + rules: [{ + required: true, + message: "请输入表单名称", + trigger: "blur" + }], + }, + { + label: '备注', + prop: 'remark', + type: 'textarea', + span: 24 + }, + { + label: '状态', + prop: 'status', + type: 'select', + dicData: [{ + label: '可用', + value: 1 + }, { + label: '禁用', + value: 2 + }], + rules: [{ + required: true, + message: "请选择状态", + trigger: "change" + }], + },] + }, + isCopy: false, + copyVisible: false }; }, computed: { @@ -173,34 +235,64 @@ export default { methods: { handleSubmit() { this.$refs.formDesign.getData('string').then(data => { - this.row.content = data - this.$confirm('是否将此表单保存为新版本?这意味着可以返回到以前的版本。', '提示', { - confirmButtonText: '否', - cancelButtonText: '是', - type: 'warning' - }).then(() => { - this.row.newVersion = false + if (this.isCopy) { + this.copyVisible = true + this.form.content = data + } else { + this.row.content = data + this.$confirm('是否将此表单保存为新版本?这意味着可以返回到以前的版本。', '提示', { + confirmButtonText: '否', + cancelButtonText: '是', + type: 'warning' + }).then(() => { + this.row.newVersion = false - update(this.row).then(() => { - this.$message.success("保存成功") - this.onLoad(this.page, this.query) - this.formVisible = false - }) - }).catch(() => { - this.row.newVersion = true + update(this.row).then(() => { + this.$message.success("保存成功") + this.onLoad(this.page, this.query) + this.formVisible = false + }) + }).catch(() => { + this.row.newVersion = true - update(this.row).then(() => { - this.$message.success("保存成功") - this.onLoad(this.page, this.query) - this.formVisible = false + update(this.row).then(() => { + this.$message.success("保存成功") + this.onLoad(this.page, this.query) + this.formVisible = false + }) }) - }) + } }) }, handleDesign(row) { this.formVisible = true this.options = this.deepClone(row.content || '') this.row = row + this.isCopy = false + }, + handleCopy(row) { + this.formVisible = true + this.options = this.deepClone(row.content || '') + this.isCopy = true + }, + handleCopySubmit(form, done) { + const param = { + ...form, + content: this.form.content + } + add(param).then(() => { + this.onLoad(this.page); + this.$message({ + type: "success", + message: "操作成功!" + }); + this.$refs.copyForm.resetFields() + done() + this.copyVisible = false + this.formVisible = false + }).catch(() => { + done() + }) }, rowSave(row, loading, done) { add(row).then(() => { diff --git a/src/views/plugin/workflow/design/index.vue b/src/views/plugin/workflow/design/index.vue index b2b8db7..8433026 100644 --- a/src/views/plugin/workflow/design/index.vue +++ b/src/views/plugin/workflow/design/index.vue @@ -19,7 +19,7 @@