fix: 流程详情页与流程发起页修改为动态路由,解决页面数据不刷新与刷新转圈的问题

This commit is contained in:
konbai
2022-11-27 15:16:44 +08:00
parent 76ed6b4cc5
commit 0d8d7c5e63
8 changed files with 39 additions and 44 deletions

View File

@@ -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' }
}
]
},
]
// 防止连续点击多次路由报错

View File

@@ -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

View File

@@ -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) {

View File

@@ -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){

View File

@@ -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,
}
})
},

View File

@@ -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

View File

@@ -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

View File

@@ -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