Compare commits

...

2 Commits

Author SHA1 Message Date
c920b7811e Merge remote-tracking branch 'origin/dev' into dev 2025-05-28 15:11:51 +08:00
ada626f684 1 2025-05-28 15:11:44 +08:00
2 changed files with 13 additions and 9 deletions

View File

@ -66,7 +66,7 @@ const leftMenu = reactive([
name: 'control', name: 'control',
title: '物流', title: '物流',
icon: 'menu3.png', icon: 'menu3.png',
path: '', path: '/sub-operation-service/logistics',
isOpen: false, isOpen: false,
children: [], children: [],
}, },
@ -77,7 +77,9 @@ let currentCIndex = ref('');
const toLink = (index) => { const toLink = (index) => {
currentIndex.value = index; currentIndex.value = index;
window.sessionStorage.setItem('currentOpen', index); if (leftMenu[index].children.length > 0) {
window.sessionStorage.setItem('currentOpen', index);
}
if (index === 0) { if (index === 0) {
window.sessionStorage.setItem('currentChild', 'main'); window.sessionStorage.setItem('currentChild', 'main');
} }
@ -85,6 +87,7 @@ const toLink = (index) => {
let path = index !== undefined ? leftMenu[index].path : null; let path = index !== undefined ? leftMenu[index].path : null;
if (path) { if (path) {
router.push(path); router.push(path);
window.sessionStorage.setItem('currentParent', index);
} }
}; };
const toLinkSub = (index, name) => { const toLinkSub = (index, name) => {
@ -109,6 +112,7 @@ const openList = (index) => {
}; };
onMounted(() => { onMounted(() => {
currentIndex.value = window.sessionStorage.getItem('currentParent') ? Number(window.sessionStorage.getItem('currentParent')) : 0;
const currentMenu = window.sessionStorage.getItem('currentOpen'); const currentMenu = window.sessionStorage.getItem('currentOpen');
if (currentMenu) { if (currentMenu) {
for (let i in leftMenu) { for (let i in leftMenu) {
@ -117,7 +121,6 @@ onMounted(() => {
} }
const currentChild = window.sessionStorage.getItem('currentChild'); const currentChild = window.sessionStorage.getItem('currentChild');
if (currentChild && currentChild === 'main') { if (currentChild && currentChild === 'main') {
currentIndex.value = 0;
currentCIndex.value = ''; currentCIndex.value = '';
} else if (currentChild) { } else if (currentChild) {
currentCIndex.value = currentChild; currentCIndex.value = currentChild;

View File

@ -1,17 +1,18 @@
<template> <template>
<page-layout :menus="state.menus"> 物流 </page-layout> <section>
<common>
<template #main> 物流 </template>
</common>
</section>
</template> </template>
<script setup name="page-menu"> <script setup name="page-menu">
import { ref, reactive, watch } from 'vue'; import { ref, reactive, watch } from 'vue';
import { getAssetsFile } from '@/utils'; import { getAssetsFile } from '@/utils';
import { useRoute, useRouter } from 'vue-router'; import { useRoute, useRouter } from 'vue-router';
import warehouseLogisticsRoutes from '@/router/modules/warehouseLogistics'; import Common from '../components/common.vue';
const route = useRoute(); const route = useRoute();
const router = useRouter(); const router = useRouter();
const state = reactive({
menus: warehouseLogisticsRoutes[0].children,
});
</script> </script>
<script setup></script>
<style lang="scss" scoped></style> <style lang="scss" scoped></style>