From 0d8d7c5e631a3ac43dd3c6f060bfbf66b775b6ef Mon Sep 17 00:00:00 2001 From: konbai <1527468660@qq.com> Date: Sun, 27 Nov 2022 15:16:44 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=B5=81=E7=A8=8B=E8=AF=A6=E6=83=85?= =?UTF-8?q?=E9=A1=B5=E4=B8=8E=E6=B5=81=E7=A8=8B=E5=8F=91=E8=B5=B7=E9=A1=B5?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=B8=BA=E5=8A=A8=E6=80=81=E8=B7=AF=E7=94=B1?= =?UTF-8?q?=EF=BC=8C=E8=A7=A3=E5=86=B3=E9=A1=B5=E9=9D=A2=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E4=B8=8D=E5=88=B7=E6=96=B0=E4=B8=8E=E5=88=B7=E6=96=B0=E8=BD=AC?= =?UTF-8?q?=E5=9C=88=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ruoyi-ui/src/router/index.js | 41 ++++++++++--------- ruoyi-ui/src/views/workflow/work/copy.vue | 5 ++- ruoyi-ui/src/views/workflow/work/detail.vue | 11 ++--- ruoyi-ui/src/views/workflow/work/finished.vue | 7 ++-- ruoyi-ui/src/views/workflow/work/index.vue | 3 +- ruoyi-ui/src/views/workflow/work/own.vue | 3 +- ruoyi-ui/src/views/workflow/work/start.vue | 10 ++--- ruoyi-ui/src/views/workflow/work/todo.vue | 3 +- 8 files changed, 39 insertions(+), 44 deletions(-) diff --git a/ruoyi-ui/src/router/index.js b/ruoyi-ui/src/router/index.js index 20431a4e..e77bdbc2 100644 --- a/ruoyi-ui/src/router/index.js +++ b/ruoyi-ui/src/router/index.js @@ -74,25 +74,6 @@ export const constantRoutes = [ } ] }, - { - path: '/work', - component: Layout, - hidden: true, - children: [ - { - path: 'start', - component: () => import('@/views/workflow/work/start'), - name: 'start', - meta: { title: '发起流程', icon: '' } - }, - { - path: 'detail', - component: () => import('@/views/workflow/work/detail'), - name: 'Detail', - meta: { title: '流程详情', icon: '' } - } - ] - }, { path: '/tool', component: Layout, @@ -193,7 +174,27 @@ export const dynamicRoutes = [ meta: { title: '修改生成配置', activeMenu: '/tool/gen' } } ] - } + }, + { + path: '/workflow/process', + component: Layout, + hidden: true, + permissions: ['workflow:process:query'], + children: [ + { + path: 'start/:deployId([\\w|\\-]+)', + component: () => import('@/views/workflow/work/start'), + name: 'WorkStart', + meta: { title: '发起流程', icon: '' } + }, + { + path: 'detail/:procInsId([\\w|\\-]+)', + component: () => import('@/views/workflow/work/detail'), + name: 'WorkDetail', + meta: { title: '流程详情', activeMenu: '/work/own' } + } + ] + }, ] // 防止连续点击多次路由报错 diff --git a/ruoyi-ui/src/views/workflow/work/copy.vue b/ruoyi-ui/src/views/workflow/work/copy.vue index a2eb842d..ea43d950 100644 --- a/ruoyi-ui/src/views/workflow/work/copy.vue +++ b/ruoyi-ui/src/views/workflow/work/copy.vue @@ -188,10 +188,11 @@ export default { }, /** 查看详情 */ handleFlowRecord(row){ - this.$router.push({ path: '/work/detail', + console.log(row); + this.$router.push({ + path: '/workflow/process/detail/' + row.instanceId, query: { definitionId: row.processId, - procInsId: row.instanceId, deployId: row.deploymentId, taskId: row.taskId, finished: false diff --git a/ruoyi-ui/src/views/workflow/work/detail.vue b/ruoyi-ui/src/views/workflow/work/detail.vue index eb4b3440..f0a97c02 100644 --- a/ruoyi-ui/src/views/workflow/work/detail.vue +++ b/ruoyi-ui/src/views/workflow/work/detail.vue @@ -216,7 +216,7 @@ import '@riophae/vue-treeselect/dist/vue-treeselect.css' import Treeselect from '@riophae/vue-treeselect' export default { - name: "Detail", + name: "WorkDetail", components: { ProcessViewer, Parser, @@ -316,17 +316,14 @@ export default { }; }, created() { - this.init(); - }, - activated() { - this.init(); + this.initData(); }, methods: { - init() { + initData() { + this.taskForm.procInsId = this.$route.params && this.$route.params.procInsId; this.taskForm.deployId = this.$route.query && this.$route.query.deployId; this.taskForm.definitionId = this.$route.query && this.$route.query.definitionId; this.taskForm.taskId = this.$route.query && this.$route.query.taskId; - this.taskForm.procInsId = this.$route.query && this.$route.query.procInsId; this.finished = this.$route.query && this.$route.query.finished // 流程任务重获取变量表单 if (this.taskForm.taskId) { diff --git a/ruoyi-ui/src/views/workflow/work/finished.vue b/ruoyi-ui/src/views/workflow/work/finished.vue index f4a24752..fa98b96a 100644 --- a/ruoyi-ui/src/views/workflow/work/finished.vue +++ b/ruoyi-ui/src/views/workflow/work/finished.vue @@ -210,14 +210,15 @@ export default { }, /** 流程流转记录 */ handleFlowRecord(row){ - this.$router.push({ path: '/work/detail', + this.$router.push({ + path: '/workflow/process/detail/' + row.procInsId, query: { definitionId: row.procDefId, - procInsId: row.procInsId, deployId: row.deployId, taskId: row.taskId, finished: false - }}) + } + }) }, /** 撤回任务 */ handleRevoke(row){ diff --git a/ruoyi-ui/src/views/workflow/work/index.vue b/ruoyi-ui/src/views/workflow/work/index.vue index 57122427..e00a1a1e 100644 --- a/ruoyi-ui/src/views/workflow/work/index.vue +++ b/ruoyi-ui/src/views/workflow/work/index.vue @@ -155,10 +155,9 @@ export default { }, handleStart(row) { this.$router.push({ - path: '/work/start', + path: '/workflow/process/start/' + row.deploymentId, query: { definitionId: row.definitionId, - deployId: row.deploymentId, } }) }, diff --git a/ruoyi-ui/src/views/workflow/work/own.vue b/ruoyi-ui/src/views/workflow/work/own.vue index 57654d97..60ff20b9 100644 --- a/ruoyi-ui/src/views/workflow/work/own.vue +++ b/ruoyi-ui/src/views/workflow/work/own.vue @@ -234,10 +234,9 @@ export default { /** 流程流转记录 */ handleFlowRecord(row) { this.$router.push({ - path: '/work/detail', + path: '/workflow/process/detail/' + row.procInsId, query: { definitionId: row.procDefId, - procInsId: row.procInsId, deployId: row.deployId, taskId: row.taskId, finished: false diff --git a/ruoyi-ui/src/views/workflow/work/start.vue b/ruoyi-ui/src/views/workflow/work/start.vue index 16ec9c27..c6f327ea 100644 --- a/ruoyi-ui/src/views/workflow/work/start.vue +++ b/ruoyi-ui/src/views/workflow/work/start.vue @@ -18,7 +18,7 @@ import { getProcessForm, startProcess } from '@/api/workflow/process' import Parser from '@/utils/generator/parser' export default { - name: 'Start', + name: 'WorkStart', components: { Parser }, @@ -30,15 +30,13 @@ export default { formData: {}, } }, - beforeRouteEnter(to, from, next) { - next(vm => { - vm.initData() - }) + created() { + this.initData(); }, methods: { initData() { + this.deployId = this.$route.params && this.$route.params.deployId; this.definitionId = this.$route.query && this.$route.query.definitionId; - this.deployId = this.$route.query && this.$route.query.deployId; getProcessForm({ definitionId: this.definitionId, deployId: this.deployId diff --git a/ruoyi-ui/src/views/workflow/work/todo.vue b/ruoyi-ui/src/views/workflow/work/todo.vue index 7c2e63fe..5b3f8e19 100644 --- a/ruoyi-ui/src/views/workflow/work/todo.vue +++ b/ruoyi-ui/src/views/workflow/work/todo.vue @@ -141,10 +141,9 @@ export default { // 跳转到处理页面 handleProcess(row) { this.$router.push({ - path: '/work/detail', + path: '/workflow/process/detail/' + row.procInsId, query: { definitionId: row.procDefId, - procInsId: row.procInsId, deployId: row.deployId, taskId: row.taskId, finished: true