diff --git a/src/pages/workbench/component-center/process-management/designer/index.vue b/src/pages/workbench/component-center/process-management/designer/index.vue index 87c1050bf3dfba98ab70a95b57c78d292fef7c48..49b604fb9a51903bcb92d01b54409d12311b244a 100644 --- a/src/pages/workbench/component-center/process-management/designer/index.vue +++ b/src/pages/workbench/component-center/process-management/designer/index.vue @@ -108,16 +108,8 @@ export default { copyTempItem: null, copyTempItem_rules: { newName: [ - { - required: true, - message: "请输入流程名称", - trigger: "blur", - }, - { - max: 16, - message: "长度小于16个字符", - trigger: "blur", - }, + { required: true, message: "请输入流程名称", trigger: "blur" }, + { max: 16, message: "不能超过16个字符", trigger: "blur" }, ], }, }), @@ -319,48 +311,99 @@ export default { this.dialogInfo.cancelText = "暂不"; this.dialogInfo.sunbmitText = "取消发布"; this.dialogInfo.submit = () => { - console.log(`取消发布${item.name}`); + this.$http + .delete("/apaas/serviceapp/v3/workflows/cancelPublish", { + params: { + id: item.workflows_id, + }, + }) + .then(({ data }) => { + if (data.success === 1) { + this.$message.success(data.errMsg || "取消发布成功"); + this.refreshPage(); + } else { + this.$message.error(data.errMsg || "取消发布失败"); + } + }) + .catch((error) => { + console.log(error); + this.$message.error("取消发布失败"); + }); }; this.showDialog(); - }, // TODO: 取消发布流程 + }, deployItem(item) { this.dialogInfo.title = "提示"; this.dialogInfo.msg = `部署流程后,流程将部署到工作区域,但不会上架到服务超市,是否部署该流程?`; this.dialogInfo.cancelText = "取消"; this.dialogInfo.sunbmitText = "部署"; this.dialogInfo.submit = () => { - console.log(`部署${item.name}`); + let form = new FormData(); + form.append("id", item.workflows_id); + + this.$http + .post("/apaas/serviceapp/v3/workflows/deploy", form) + .then(({ data }) => { + if (data.success === 1) { + this.$message.success(data.errMsg || "部署成功"); + this.refreshPage(); + } else { + this.$message.error(data.errMsg || "部署失败"); + } + }) + .catch((error) => { + console.log(error); + this.$message.error("部署失败"); + }); }; this.showDialog(); - }, // TODO: 部署流程 + }, cancelDeployItem(item) { this.dialogInfo.title = "提示"; this.dialogInfo.msg = `取消部署后,该流程服务不能通过链接访问,是否取消部署流程服务“${item.name}”?`; this.dialogInfo.cancelText = "取消"; this.dialogInfo.sunbmitText = "取消部署"; this.dialogInfo.submit = () => { - console.log(`取消部署${item.name}`); + this.$http + .delete("/apaas/serviceapp/v3/workflows/cancelDeploy", { + params: { + id: item.workflows_id, + }, + }) + .then(({ data }) => { + if (data.success === 1) { + this.$message.success(data.errMsg || "取消部署成功"); + this.refreshPage(); + } else { + this.$message.error(data.errMsg || "取消部署失败"); + } + }) + .catch((error) => { + console.log(error); + this.$message.error("取消部署失败"); + }); }; this.showDialog(); - }, // TODO: 取消部署流程 + }, copyItem(item) { this.copyTempItem = { ...item, newName: "", }; this.copyProcessShow(); - }, // 复制流程 + }, cancelCopyProcess() { this.copyProcessHide(); - }, // 复制流程-取消 + }, submitCopyProcess() { this.$refs.detail_form.validate((valid) => { if (valid) { + let form = new FormData(); + form.append("id", this.copyTempItem.workflows_id); + form.append("name", this.copyTempItem.newName); + this.$http - .post("/apaas/serviceapp/v3/workflows/copy", { - id: this.copyTempItem.workflows_id, - name: this.copyTempItem.newName, - }) + .post("/apaas/serviceapp/v3/workflows/copy", form) .then(({ data }) => { if (data.success === 1) { this.$message.success(data.errMsg || "复制成功");