mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2025-01-31 14:08:06 +08:00
feat: 优化缓存二级路由方式 (#6944)
This commit is contained in:
parent
eab475a631
commit
b31ed9b920
@ -53,6 +53,10 @@ const props = defineProps({
|
|||||||
type: Number,
|
type: Number,
|
||||||
default: 0,
|
default: 0,
|
||||||
},
|
},
|
||||||
|
height: {
|
||||||
|
type: Number,
|
||||||
|
default: 0,
|
||||||
|
},
|
||||||
});
|
});
|
||||||
const emit = defineEmits(['search', 'update:selects', 'update:paginationConfig']);
|
const emit = defineEmits(['search', 'update:selects', 'update:paginationConfig']);
|
||||||
const globalStore = GlobalStore();
|
const globalStore = GlobalStore();
|
||||||
@ -105,11 +109,19 @@ onMounted(() => {
|
|||||||
if (props.heightDiff) {
|
if (props.heightDiff) {
|
||||||
heightDiff = props.heightDiff;
|
heightDiff = props.heightDiff;
|
||||||
}
|
}
|
||||||
|
if (props.height) {
|
||||||
|
tableHeight.value = props.height;
|
||||||
|
} else {
|
||||||
|
tableHeight.value = window.innerHeight - heightDiff;
|
||||||
|
}
|
||||||
|
|
||||||
tableHeight.value = window.innerHeight - heightDiff;
|
|
||||||
window.onresize = () => {
|
window.onresize = () => {
|
||||||
return (() => {
|
return (() => {
|
||||||
tableHeight.value = window.innerHeight - heightDiff;
|
if (props.height) {
|
||||||
|
tableHeight.value = props.height;
|
||||||
|
} else {
|
||||||
|
tableHeight.value = window.innerHeight - heightDiff;
|
||||||
|
}
|
||||||
})();
|
})();
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
@ -19,7 +19,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="content-container__main" v-if="slots.main">
|
<div class="content-container__main" v-if="slots.main">
|
||||||
<el-card>
|
<el-card>
|
||||||
<div class="content-container__title" v-if="title">
|
<div class="content-container__title">
|
||||||
<slot name="title">
|
<slot name="title">
|
||||||
<div v-if="showBack">
|
<div v-if="showBack">
|
||||||
<div class="flex justify-between">
|
<div class="flex justify-between">
|
||||||
|
@ -56,8 +56,15 @@ router.beforeEach((to, from, next) => {
|
|||||||
|
|
||||||
router.afterEach((to) => {
|
router.afterEach((to) => {
|
||||||
if (to.meta.activeMenu && !isRedirecting) {
|
if (to.meta.activeMenu && !isRedirecting) {
|
||||||
localStorage.setItem('cachedRoute' + to.meta.activeMenu, to.path);
|
let notMathParam = true;
|
||||||
|
if (to.matched.some((record) => record.path.includes(':'))) {
|
||||||
|
notMathParam = false;
|
||||||
|
}
|
||||||
|
if (notMathParam) {
|
||||||
|
localStorage.setItem('cachedRoute' + to.meta.activeMenu, to.path);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
isRedirecting = false;
|
isRedirecting = false;
|
||||||
NProgress.done();
|
NProgress.done();
|
||||||
});
|
});
|
||||||
|
@ -45,6 +45,7 @@ const webSiteRouter = {
|
|||||||
component: () => import('@/views/website/runtime/php/index.vue'),
|
component: () => import('@/views/website/runtime/php/index.vue'),
|
||||||
meta: {
|
meta: {
|
||||||
title: 'menu.runtime',
|
title: 'menu.runtime',
|
||||||
|
activeMenu: '/websites/runtimes/php',
|
||||||
requiresAuth: false,
|
requiresAuth: false,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
Loading…
x
Reference in New Issue
Block a user