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 ?? '';