From 674b148bf11e2ed4effc75b2258b6e72b0dda0c1 Mon Sep 17 00:00:00 2001 From: liuwei Date: Mon, 9 Jun 2025 18:06:08 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E5=88=B7=E6=96=B0=E6=97=B6?= =?UTF-8?q?=E6=A0=B7=E5=BC=8F=E5=A4=B1=E6=95=88=E9=97=AE=E9=A2=98=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- admin/dashboard/templates/base.html | 61 ++++++++++++++++++----------- 1 file changed, 38 insertions(+), 23 deletions(-) diff --git a/admin/dashboard/templates/base.html b/admin/dashboard/templates/base.html index 0f29687..4135844 100644 --- a/admin/dashboard/templates/base.html +++ b/admin/dashboard/templates/base.html @@ -7,18 +7,18 @@ - - - - - - - - - - - + + + + + + + + + + + + + + {% block head %}{% endblock %} @@ -228,20 +239,21 @@ currentView: '1', timeRange: '7', charts: {}, - // 添加一个标志,用于控制时间范围选择器的显示 showTimeRangeSelector: false } }, created() { // 根据当前页面路径决定是否显示时间范围选择器 const path = window.location.pathname; - // 只在统计相关页面显示时间范围选择器 this.showTimeRangeSelector = ['/', '/plugins', '/users', '/groups','/robot','/errors'].includes(path); }, + mounted() { + // 添加页面加载完成后的过渡效果 + document.querySelector('.app-container').classList.add('loaded'); + }, methods: { handleSelect(key, keyPath) { this.currentView = key; - // 添加页面跳转逻辑 const routes = { '1': '/', '2': '/plugins', @@ -259,26 +271,29 @@ '15': '/file_browser' }; - // 如果当前不在对应页面,则跳转 const currentPath = window.location.pathname; const targetPath = routes[key]; if (currentPath !== targetPath && targetPath !== undefined) { - window.location.href = targetPath; + // 添加页面切换时的过渡效果 + document.querySelector('.app-container').classList.remove('loaded'); + setTimeout(() => { + window.location.href = targetPath; + }, 300); } }, loadData() { // 由子组件实现 }, - // 添加退出登录方法 logout() { - // 显示确认对话框 this.$confirm('确认退出登录吗?', '提示', { confirmButtonText: '确定', cancelButtonText: '取消', type: 'warning' }).then(() => { - // 用户点击确定,跳转到登出页面 - window.location.href = '/logout'; + document.querySelector('.app-container').classList.remove('loaded'); + setTimeout(() => { + window.location.href = '/logout'; + }, 300); }).catch(() => { // 用户点击取消,不做任何操作 });