From 942f5e1f54338eec4f93343b0933ff970afae655 Mon Sep 17 00:00:00 2001 From: tony <846249920@qq.com> Date: Fri, 6 Jan 2023 15:11:33 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E6=B5=81=E7=A8=8B?= =?UTF-8?q?=E8=AE=BE=E8=AE=A1=E4=BF=9D=E5=AD=98=E6=88=90=E5=8A=9F=E5=90=8E?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E6=9C=AA=E5=88=B7=E6=96=B0=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/views/flowable/definition/index.vue | 54 +++++++++++-------- .../src/views/flowable/definition/model.vue | 4 +- 2 files changed, 35 insertions(+), 23 deletions(-) diff --git a/ruoyi-ui/src/views/flowable/definition/index.vue b/ruoyi-ui/src/views/flowable/definition/index.vue index 4bb9715f..8e992877 100644 --- a/ruoyi-ui/src/views/flowable/definition/index.vue +++ b/ruoyi-ui/src/views/flowable/definition/index.vue @@ -172,16 +172,13 @@ - - + -
- -
+
@@ -215,9 +212,7 @@ /> -
- -
+
@@ -287,11 +282,9 @@ export default { formDeployTitle: "", formList: [], formTotal:0, - formConf: {}, // 默认表单数据 - readImage:{ - open: false, - src: "", - }, + flowImageTitle: '', + flowImageOpen: false, + formRenderData:{}, // bpmn.xml 导入 upload: { // 是否显示弹出层(xml导入) @@ -331,7 +324,6 @@ export default { deployId: null }, deployId: '', - currentRow: null, // xml flowData: {}, // 表单参数 @@ -344,6 +336,12 @@ export default { created() { this.getList(); }, + activated() { + const time = this.$route.query.t; + if (time != null) { + this.getList(); + } + }, methods: { /** 查询流程定义列表 */ getList() { @@ -414,19 +412,25 @@ export default { }, /** 流程图查看 */ handleReadImage(deployId){ - this.readImage.title = "流程图"; - this.readImage.open = true; - // this.readImage.src = process.env.VUE_APP_BASE_API + "/flowable/definition/readImage/" + deploymentId; + this.flowImageTitle = "流程图"; + this.flowImageOpen = true; flowXmlAndNode({deployId:deployId}).then(res => { this.flowData = res.data; }) }, /** 表单查看 */ - handleForm(formId){ - getForm(formId).then(res =>{ + handleForm(formId) { + getForm(formId).then(res => { this.formTitle = "表单详情"; this.formConfOpen = true; - this.formConf = JSON.parse(res.data.formContent) + // 回显表单 + this.$nextTick(() => { + this.$refs.vFormRef.setFormJson(res.data.formContent); + this.$nextTick(() => { + // 表单禁用 + this.$refs.vFormRef.disableForm(); + }) + }) }) }, /** 启动流程 */ @@ -473,7 +477,15 @@ export default { }, handleCurrentChange(data) { if (data) { - this.currentRow = JSON.parse(data.formContent); + // 回显表单 + this.$nextTick(() => { + this.$refs.vFormRef.setFormJson(JSON.parse(data.formContent)); + // 加载表单填写的数据 + this.$nextTick(() => { + // 表单禁用 + this.$refs.vFormRef.disableForm(); + }) + }) } }, /** 挂起/激活流程 */ diff --git a/ruoyi-ui/src/views/flowable/definition/model.vue b/ruoyi-ui/src/views/flowable/definition/model.vue index da1b46ae..d2b20f01 100644 --- a/ruoyi-ui/src/views/flowable/definition/model.vue +++ b/ruoyi-ui/src/views/flowable/definition/model.vue @@ -108,8 +108,8 @@ export default { saveXml(params).then(res => { this.$modal.msgSuccess(res.msg) // 关闭当前标签页并返回上个页面 - this.$store.dispatch("tagsView/delView", this.$route); - this.$router.go(-1) + const obj = { path: "/flowable/definition", query: { t: Date.now()} }; + this.$tab.closeOpenPage(obj); }) }, /** 指定流程办理人员列表 */