Compare commits
2 Commits
87be30a18a
...
c920b7811e
Author | SHA1 | Date | |
---|---|---|---|
c920b7811e | |||
ada626f684 |
@ -66,7 +66,7 @@ const leftMenu = reactive([
|
||||
name: 'control',
|
||||
title: '物流',
|
||||
icon: 'menu3.png',
|
||||
path: '',
|
||||
path: '/sub-operation-service/logistics',
|
||||
isOpen: false,
|
||||
children: [],
|
||||
},
|
||||
@ -77,7 +77,9 @@ let currentCIndex = ref('');
|
||||
|
||||
const toLink = (index) => {
|
||||
currentIndex.value = index;
|
||||
if (leftMenu[index].children.length > 0) {
|
||||
window.sessionStorage.setItem('currentOpen', index);
|
||||
}
|
||||
if (index === 0) {
|
||||
window.sessionStorage.setItem('currentChild', 'main');
|
||||
}
|
||||
@ -85,6 +87,7 @@ const toLink = (index) => {
|
||||
let path = index !== undefined ? leftMenu[index].path : null;
|
||||
if (path) {
|
||||
router.push(path);
|
||||
window.sessionStorage.setItem('currentParent', index);
|
||||
}
|
||||
};
|
||||
const toLinkSub = (index, name) => {
|
||||
@ -109,6 +112,7 @@ const openList = (index) => {
|
||||
};
|
||||
|
||||
onMounted(() => {
|
||||
currentIndex.value = window.sessionStorage.getItem('currentParent') ? Number(window.sessionStorage.getItem('currentParent')) : 0;
|
||||
const currentMenu = window.sessionStorage.getItem('currentOpen');
|
||||
if (currentMenu) {
|
||||
for (let i in leftMenu) {
|
||||
@ -117,7 +121,6 @@ onMounted(() => {
|
||||
}
|
||||
const currentChild = window.sessionStorage.getItem('currentChild');
|
||||
if (currentChild && currentChild === 'main') {
|
||||
currentIndex.value = 0;
|
||||
currentCIndex.value = '';
|
||||
} else if (currentChild) {
|
||||
currentCIndex.value = currentChild;
|
||||
|
@ -1,17 +1,18 @@
|
||||
<template>
|
||||
<page-layout :menus="state.menus"> 物流 </page-layout>
|
||||
<section>
|
||||
<common>
|
||||
<template #main> 物流 </template>
|
||||
</common>
|
||||
</section>
|
||||
</template>
|
||||
<script setup name="page-menu">
|
||||
import { ref, reactive, watch } from 'vue';
|
||||
import { getAssetsFile } from '@/utils';
|
||||
import { useRoute, useRouter } from 'vue-router';
|
||||
import warehouseLogisticsRoutes from '@/router/modules/warehouseLogistics';
|
||||
import Common from '../components/common.vue';
|
||||
|
||||
const route = useRoute();
|
||||
const router = useRouter();
|
||||
|
||||
const state = reactive({
|
||||
menus: warehouseLogisticsRoutes[0].children,
|
||||
});
|
||||
</script>
|
||||
<script setup></script>
|
||||
<style lang="scss" scoped></style>
|
||||
|
Loading…
x
Reference in New Issue
Block a user