From a49e1b018779d88d92ac0ce74fe2234c7042bd11 Mon Sep 17 00:00:00 2001 From: Siri <8250070+litianxin123@user.noreply.gitee.com> Date: Wed, 18 May 2022 14:44:50 +0000 Subject: [PATCH] =?UTF-8?q?!21=20#Close=20fix=20=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E6=B5=81=E7=A8=8B=E5=AE=9A=E4=B9=89=E7=95=8C=E9=9D=A2=E5=86=85?= =?UTF-8?q?=E6=9F=A5=E7=9C=8B=E6=B5=81=E7=A8=8B=E5=9B=BE=E6=97=B6=E5=9B=A0?= =?UTF-8?q?=E7=BC=93=E5=AD=98=E9=97=AE=E9=A2=98=E8=80=8C=E4=B8=8D=E6=9B=B4?= =?UTF-8?q?=E6=96=B0=E6=95=B0=E6=8D=AE=E3=80=81=E6=B5=81=E7=A8=8B=E5=AE=9A?= =?UTF-8?q?=E4=B9=89=E7=95=8C=E9=9D=A2=E5=86=85=E7=9A=84=E5=AF=BC=E5=85=A5?= =?UTF-8?q?=E6=93=8D=E4=BD=9C=E4=BB=A5=E5=8F=8A=E4=B8=8A=E4=BC=A0=E5=9C=B0?= =?UTF-8?q?=E5=9D=80=E9=94=99=E8=AF=AF=EF=BC=8C=E5=B9=B6=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E9=AA=8C=E8=AF=81=20*=20=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E6=B5=81=E7=A8=8B=E5=AE=9A=E4=B9=89=E7=95=8C=E9=9D=A2=E5=86=85?= =?UTF-8?q?=E6=9F=A5=E7=9C=8B=E6=B5=81=E7=A8=8B=E5=9B=BE=E6=97=B6=E5=9B=A0?= =?UTF-8?q?=E7=BC=93=E5=AD=98=E9=97=AE=E9=A2=98=E8=80=8C=E4=B8=8D=E6=9B=B4?= =?UTF-8?q?=E6=96=B0=E6=95=B0=E6=8D=AE=E3=80=81=E6=B5=81=E7=A8=8B=E5=AE=9A?= =?UTF-8?q?=E4=B9=89=E7=95=8C=E9=9D=A2=E5=86=85=E7=9A=84=E5=AF=BC=E5=85=A5?= =?UTF-8?q?=E6=93=8D=E4=BD=9C=E4=BB=A5=E5=8F=8A=E4=B8=8A=E4=BC=A0=E5=9C=B0?= =?UTF-8?q?=E5=9D=80=E9=94=99=E8=AF=AF=EF=BC=8C=E5=B9=B6=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E9=AA=8C=E8=AF=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/components/ProcessViewer/index.vue | 31 ++++++------ .../src/views/workflow/definition/index.vue | 48 +++++++++++++++---- 2 files changed, 54 insertions(+), 25 deletions(-) diff --git a/ruoyi-ui/src/components/ProcessViewer/index.vue b/ruoyi-ui/src/components/ProcessViewer/index.vue index 8fdd0a16..f30cabea 100644 --- a/ruoyi-ui/src/components/ProcessViewer/index.vue +++ b/ruoyi-ui/src/components/ProcessViewer/index.vue @@ -90,6 +90,20 @@ export default { hoverTimer: null } }, + watch: { + xml: { + handler(newXml) { + this.importXML(newXml); + }, + immediate: true + }, + finishedInfo: { + handler(newInfo) { + this.setProcessStatus(newInfo); + }, + immediate: true + } + }, created() { this.$nextTick(() => { this.importXML(this.xml) @@ -188,7 +202,6 @@ export default { await this.bpmnViewer.importXML(xml); this.addCustomDefs(); } catch (e) { - console.error(e); this.clearViewer(); } finally { this.isLoading = false; @@ -237,21 +250,7 @@ export default { }, destroyed() { this.clearViewer(); - }, - // watch: { - // xml: { - // handler(newXml) { - // this.importXML(newXml); - // }, - // immediate: true - // }, - // finishedInfo: { - // handler(newInfo) { - // this.setProcessStatus(newInfo); - // }, - // immediate: true - // } - // } + } } diff --git a/ruoyi-ui/src/views/workflow/definition/index.vue b/ruoyi-ui/src/views/workflow/definition/index.vue index 27b3b412..20110286 100644 --- a/ruoyi-ui/src/views/workflow/definition/index.vue +++ b/ruoyi-ui/src/views/workflow/definition/index.vue @@ -151,7 +151,7 @@ /> - + 点击上传
- 流程名称: - 流程分类: + + + + + + + + + +
提示:仅允许导入“bpmn20.xml”格式文件!
- + @@ -368,7 +377,7 @@ export default { // 设置上传的请求头部 headers: { Authorization: "Bearer " + getToken() }, // 上传的地址 - url: process.env.VUE_APP_BASE_API + "/flowable/definition/import" + url: process.env.VUE_APP_BASE_API + "/workflow/definition/import" }, // 查询参数 queryParams: { @@ -398,6 +407,14 @@ export default { form: {}, // 表单校验 rules: { + name: [ + { required: true, message: "流程定义名称不能为空", trigger: "blur" } + ], + category: [{ + required: true, + message: '请选择任意一项', + trigger: 'change' + }], } }; }, @@ -427,6 +444,14 @@ export default { this.publish.loading = false; }) }, + // 点击取消时关闭dialog并且清空form表格的数据 + cancel (form) { + // 重置form表单 + this.$refs[form].resetFields() + this.$refs['upload'].clearFiles() + // 关闭dialog + this.upload.open = false + }, // 表单重置 reset() { this.form = { @@ -486,8 +511,8 @@ export default { // 发送请求,获取xml readXml(definitionId).then(res => { this.processView.xmlData = res.data; - this.processView.open = true; }) + this.processView.open = true; }, /** 挂载表单弹框 */ handleAddForm(row){ @@ -567,6 +592,7 @@ export default { }).then(function() { return delDeployment(params); }).then(() => { + this.getList(); this.getPublishList(); this.$modal.msgSuccess("删除成功"); }) @@ -598,12 +624,16 @@ export default { this.upload.open = false; this.upload.isUploading = false; this.$refs.upload.clearFiles(); - this.$message(response.msg); + this.$message.success(response.msg); this.getList(); }, // 提交上传文件 submitFileForm() { - this.$refs.upload.submit(); + this.$refs.uploadForm.validate(valid => { + if (valid) { + this.$refs.upload.submit(); + } + }); }, categoryFormat(row, column) { return this.categoryOptions.find(k => k.code === row.category)?.categoryName ?? '';