Commit 184da175 authored by “yiyousong”'s avatar “yiyousong”

perf: 优化页面

parent 5387cdbf
......@@ -11,25 +11,27 @@
</template>
<script>
import Vue from "vue";
import Vue from 'vue';
export default {
data() {
return {
percentage: 1,
loading: false,
title: "文件导出中",
title: '文件导出中'
};
},
beforeCreate() {
Vue.prototype.$app = this;
},
created() {},
methods: {},
methods: {}
};
</script>
<style lang="less" scoped>
.app {
max-width: 2560px;
margin: auto;
background-color: #eff0f4;
// font-family: Source Han Sans CN;
.loading {
......
......@@ -10,8 +10,7 @@
<h1 class="title cursor-pointer" @click="handleGoHome">
{{ sysName ? sysName : systemName }}
</h1>
<HeaderSite class="ml-10"></HeaderSite>
</div>
<HeaderSite class="ml-10 mr-[120px]"></HeaderSite>
<!-- 导航 -->
<el-menu :default-active="activeMenu" mode="horizontal" router @select="selectMenu">
<template v-for="v in menus">
......@@ -35,6 +34,7 @@
</el-menu-item>
</template>
</el-menu>
</div>
<div class="flex gap-5">
<div class="page-home" @click="handleGoHome">首页</div>
<!-- 返回门户 -->
......@@ -60,11 +60,13 @@ export default {
computed: {
activeMenu() {
const route = this.$route;
const { meta, path } = route;
const { meta, matched } = route;
if (meta.activeMenu) {
return meta.activeMenu;
} else {
let curMatched = matched.filter((v) => v.path);
return curMatched[0].path;
}
return path;
},
...mapState('user', ['sysName', 'sysLogo', 'path', 'menus'])
},
......
......@@ -99,7 +99,8 @@ export default {
'SET_userInfo',
'SET_permissions',
'SET_routes',
'SET_menusList'
'SET_menusList',
'SET_secondaryRoutes'
]),
// 获取验证码
......@@ -169,6 +170,7 @@ export default {
calcMenu();
if (routes.length) {
let path = routes[0].path;
this.SET_secondaryRoutes(path);
this.$router.push(path);
} else {
this.$message.warning('暂无权限,请联系管理员!');
......
......@@ -28,7 +28,8 @@ export default {
'SET_userInfo',
'SET_permissions',
'SET_routes',
'SET_menusList'
'SET_menusList',
'SET_secondaryRoutes'
]),
// 获取token
async getToken() {
......@@ -65,6 +66,7 @@ export default {
calcMenu();
if (routes.length) {
let path = routes[0].path;
this.SET_secondaryRoutes(path);
this.$router.push(path);
} else {
this.$message.warning('暂无页面权限,请联系管理员!');
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment