update 路由跳转

This commit is contained in:
gssong 2024-03-24 15:13:05 +08:00
parent d186c800f0
commit cd129aa949
9 changed files with 69 additions and 30 deletions

View File

@ -170,7 +170,7 @@ export const dynamicRoutes: RouteRecordRaw[] = [
permissions: ['demo:leave:edit'],
children: [
{
path: 'index/:id/:type',
path: 'index',
component: () => import('@/views/workflow/leave/leaveEdit.vue'),
name: 'leaveEdit',
meta: { title: '请假申请', activeMenu: '/demo/leave',noCache:true },

View File

@ -175,18 +175,36 @@ const handleSelectionChange = (selection: LeaveVO[]) => {
const handleAdd = () => {
proxy.$tab.closePage(proxy.$route);
proxy.$router.push(`/demo/leaveEdit/index/add/add`);
proxy.$router.push({
path: `/demo/leaveEdit/index`,
query: {
type: 'add'
}
})
};
/** 修改按钮操作 */
const handleUpdate = (row?: LeaveVO) => {
proxy.$tab.closePage(proxy.$route);
proxy.$router.push(`/demo/leaveEdit/index/${row.id}/update`);;
proxy.$router.push({
path: `/demo/leaveEdit/index`,
query: {
id: row.id,
type: 'update'
}
})
};
/** 查看按钮操作 */
const handleView = (row?: LeaveVO) => {
proxy.$tab.closePage(proxy.$route);
proxy.$router.push(`/demo/leaveEdit/index/${row.id}/view`);
proxy.$router.push({
path: `/demo/leaveEdit/index`,
query: {
id: row.id,
type: 'view'
}
})
};
/** 删除按钮操作 */

View File

@ -1,6 +1,5 @@
<template>
<div class="p-2">
<el-affix target=".p-2" :offset="80">
<el-card shadow="never">
<div style="display: flex;justify-content: space-between;">
<div>
@ -18,8 +17,7 @@
</div>
</div>
</el-card>
</el-affix>
<el-card shadow="never">
<el-card shadow="never" style="height: 78vh;overflow-y: auto;">
<el-form ref="leaveFormRef" :disabled="routeParams.type ==='view'" v-loading="loading" :model="form" :rules="rules" label-width="80px">
<el-form-item label="请假类型" prop="leaveType">
<el-select v-model="form.leaveType" placeholder="请选择请假类型" style="width: 100%">
@ -225,12 +223,13 @@ const goBack = () => {
}
//
const approvalVerifyOpen = async () => {
submitVerifyRef.value.openDialog(proxy.$route.query.taskId);
submitVerifyRef.value.openDialog(routeParams.value.taskId);
};
onMounted(() => {
nextTick(async () => {
routeParams.value = proxy?.$route.params
routeParams.value = proxy.$route.query
reset();
loading.value = false
if (routeParams.value.type === 'update' || routeParams.value.type === 'view' || routeParams.value.type === 'approval') {
getInfo()
}

View File

@ -350,7 +350,11 @@ const handleView = (row) => {
if(row.wfFormDefinitionVo){
proxy.$tab.closePage(proxy.$route);
proxy.$router.push({
path: `${row.wfFormDefinitionVo.path}/${row.businessKey}/view`
path: `${row.wfFormDefinitionVo.path}`,
query: {
id: row.businessKey,
type: 'view'
}
})
}else{
proxy?.$modal.msgError('请到流程定义菜单配置路由!');

View File

@ -263,7 +263,11 @@ const handleView = (row) => {
if(row.wfFormDefinitionVo){
proxy.$tab.closePage(proxy.$route);
proxy.$router.push({
path: `${row.wfFormDefinitionVo.path}/${row.businessKey}/view`
path: `${row.wfFormDefinitionVo.path}`,
query: {
id: row.businessKey,
type: 'view'
}
})
}else{
proxy?.$modal.msgError('请到流程定义菜单配置路由!');

View File

@ -253,7 +253,11 @@ const handleOpen = async (row,type) => {
if(row.wfFormDefinitionVo){
proxy.$tab.closePage(proxy.$route);
proxy.$router.push({
path: `${row.wfFormDefinitionVo.path}/${row.businessKey}/${type}`
path: `${row.wfFormDefinitionVo.path}`,
query: {
id: row.businessKey,
type: type
}
})
}else{
proxy?.$modal.msgError('请到流程定义菜单配置路由!');

View File

@ -130,7 +130,11 @@ const handleView = (row) => {
if(row.wfFormDefinitionVo){
proxy.$tab.closePage(proxy.$route);
proxy.$router.push({
path: `${row.wfFormDefinitionVo.path}/${row.businessKey}/view`
path: `${row.wfFormDefinitionVo.path}`,
query: {
id: row.businessKey,
type: 'view'
}
})
}else{
proxy?.$modal.msgError('请到流程定义菜单配置路由!');

View File

@ -117,7 +117,11 @@ const handleView = (row) => {
if(row.wfFormDefinitionVo){
proxy.$tab.closePage(proxy.$route);
proxy.$router.push({
path: `${row.wfFormDefinitionVo.path}/${row.businessKey}/view`
path: `${row.wfFormDefinitionVo.path}`,
query: {
id: row.businessKey,
type: 'view'
}
})
}else{
proxy?.$modal.msgError('请到流程定义菜单配置路由!');

View File

@ -138,8 +138,10 @@ const handleOpen = async (row: TaskVO) => {
if(row.wfFormDefinitionVo){
proxy.$tab.closePage(proxy.$route);
proxy.$router.push({
path: `${row.wfFormDefinitionVo.path}/${row.businessKey}/approval`,
path: `${row.wfFormDefinitionVo.path}`,
query: {
id: row.businessKey,
type: 'approval',
taskId: row.id
}
})