diff --git a/src/router/modules/device.ts b/src/router/modules/device.ts index b10742f..d67dab6 100644 --- a/src/router/modules/device.ts +++ b/src/router/modules/device.ts @@ -245,6 +245,45 @@ auth: '/standard/checkApply', }, }, + { + path: ':type/:id?', + name: 'standardListAdd', + component: () => import('@/views/device/standardEquipment/components/listApply/listPageAdd.vue'), + meta: { + title: '更换申请申请', + icon: 'ep:key', + sidebar: false, + breadcrumb: true, + activeMenu: '/standard/changeApply', + }, + beforeEnter: (to, from, next) => { + const type = from.path.split('/')[from.path.split('/').length - 1] + console.log(type) + switch (type) { + case 'changeApply': + to.meta.activeMenu = '/standard/changeApply' + to.meta.title = '更换申请' + break + case 'pauseApply': + to.meta.activeMenu = '/standard/pauseApply' + to.meta.title = '暂停申请' + break + case 'cancelApply': + to.meta.activeMenu = '/standard/cancelApply' + to.meta.title = '撤销申请' + break + case 'resumeApply': + to.meta.activeMenu = '/standard/resumeApply' + to.meta.title = '恢复申请' + break + case 'checkApply': + to.meta.activeMenu = '/standard/checkApply' + to.meta.title = '复查申请' + break + } + next() + }, + }, ], }, { diff --git a/src/router/modules/device.ts b/src/router/modules/device.ts index b10742f..d67dab6 100644 --- a/src/router/modules/device.ts +++ b/src/router/modules/device.ts @@ -245,6 +245,45 @@ auth: '/standard/checkApply', }, }, + { + path: ':type/:id?', + name: 'standardListAdd', + component: () => import('@/views/device/standardEquipment/components/listApply/listPageAdd.vue'), + meta: { + title: '更换申请申请', + icon: 'ep:key', + sidebar: false, + breadcrumb: true, + activeMenu: '/standard/changeApply', + }, + beforeEnter: (to, from, next) => { + const type = from.path.split('/')[from.path.split('/').length - 1] + console.log(type) + switch (type) { + case 'changeApply': + to.meta.activeMenu = '/standard/changeApply' + to.meta.title = '更换申请' + break + case 'pauseApply': + to.meta.activeMenu = '/standard/pauseApply' + to.meta.title = '暂停申请' + break + case 'cancelApply': + to.meta.activeMenu = '/standard/cancelApply' + to.meta.title = '撤销申请' + break + case 'resumeApply': + to.meta.activeMenu = '/standard/resumeApply' + to.meta.title = '恢复申请' + break + case 'checkApply': + to.meta.activeMenu = '/standard/checkApply' + to.meta.title = '复查申请' + break + } + next() + }, + }, ], }, { diff --git a/src/views/device/standardEquipment/components/applyList.vue b/src/views/device/standardEquipment/components/applyList.vue index 45ab796..dca67da 100644 --- a/src/views/device/standardEquipment/components/applyList.vue +++ b/src/views/device/standardEquipment/components/applyList.vue @@ -39,6 +39,13 @@ disabled.value = false } } +onUnmounted(() => { + sessionStorage.setItem(`${props.applyType}Menu`, current.value) +}) +onMounted(() => { + current.value = sessionStorage.getItem(`${props.applyType}Menu`) || '全部' + sessionStorage.getItem(`${props.applyType}Menu`) ? sessionStorage.removeItem(`${props.applyType}Menu`) : '' +})