|
@@ -20,7 +20,7 @@
|
|
<div class="menu_bottom_box" ref="scrollWrapper">
|
|
<div class="menu_bottom_box" ref="scrollWrapper">
|
|
<div class="item_box_sidebar" v-for="(item, index) in filteredArray" :key="item.path + index">
|
|
<div class="item_box_sidebar" v-for="(item, index) in filteredArray" :key="item.path + index">
|
|
<div @click="goBack(item.path)">
|
|
<div @click="goBack(item.path)">
|
|
- <div class="img_box_item" :class="activeMenu == item.path ? 'activate_img_sidebar' : ''">
|
|
|
|
|
|
+ <div class="img_box_item" :class="getPathUrl(item.path) ? 'activate_img_sidebar' : ''">
|
|
<svg class="energy_box_icon" aria-hidden="true">
|
|
<svg class="energy_box_icon" aria-hidden="true">
|
|
<defs>
|
|
<defs>
|
|
<linearGradient id="myGradient" x1="0%" y1="100%" x2="0%" y2="0%">
|
|
<linearGradient id="myGradient" x1="0%" y1="100%" x2="0%" y2="0%">
|
|
@@ -35,7 +35,7 @@
|
|
</linearGradient>
|
|
</linearGradient>
|
|
</defs>
|
|
</defs>
|
|
<use :xlink:href="iconName(item.meta.icon)"
|
|
<use :xlink:href="iconName(item.meta.icon)"
|
|
- :fill="activeMenu == item.path ? `url('#activate_Gradient')` : `url('#myGradient')`" />
|
|
|
|
|
|
+ :fill="getPathUrl(item.path) ? `url('#activate_Gradient')` : `url('#myGradient')`" />
|
|
</svg>
|
|
</svg>
|
|
</div>
|
|
</div>
|
|
<span class="title_sidebar">{{ item.meta.title }}</span>
|
|
<span class="title_sidebar">{{ item.meta.title }}</span>
|
|
@@ -79,7 +79,12 @@ const settingsStore = useSettingsStore()
|
|
const permissionStore = usePermissionStore()
|
|
const permissionStore = usePermissionStore()
|
|
|
|
|
|
const sidebarRouters = computed(() => permissionStore.sidebarRouters);
|
|
const sidebarRouters = computed(() => permissionStore.sidebarRouters);
|
|
-const filteredArray = sidebarRouters.value.filter(obj => obj.hasOwnProperty('meta'));
|
|
|
|
|
|
+const filteredArray = ref([])
|
|
|
|
+sidebarRouters.value.forEach((item) => {
|
|
|
|
+ if (item.redirect == "noRedirect") {
|
|
|
|
+ filteredArray.value = item.children.filter(obj => obj.hasOwnProperty('meta'));
|
|
|
|
+ }
|
|
|
|
+})
|
|
|
|
|
|
const showLogo = computed(() => settingsStore.sidebarLogo);
|
|
const showLogo = computed(() => settingsStore.sidebarLogo);
|
|
const sideTheme = computed(() => settingsStore.sideTheme);
|
|
const sideTheme = computed(() => settingsStore.sideTheme);
|
|
@@ -102,20 +107,36 @@ const getMenuTextColor = computed(() => {
|
|
return sideTheme.value === 'theme-dark' ? variables.menuText : variables.menuLightText;
|
|
return sideTheme.value === 'theme-dark' ? variables.menuText : variables.menuLightText;
|
|
});
|
|
});
|
|
|
|
|
|
-const activeMenu = computed(() => {
|
|
|
|
|
|
+function getPathUrl(pathUrl) {
|
|
const { meta, path } = route;
|
|
const { meta, path } = route;
|
|
- if (meta.activeMenu) {
|
|
|
|
- return meta.activeMenu;
|
|
|
|
|
|
+ let arrUrl = path.split("/system/")
|
|
|
|
+ let arril = ''
|
|
|
|
+ if (arrUrl.length > 1) {
|
|
|
|
+ arril = arrUrl[1];
|
|
|
|
+ } else {
|
|
|
|
+ arril = arrUrl[0];
|
|
|
|
+ }
|
|
|
|
+ if (arril == '/index' && pathUrl == '/') {
|
|
|
|
+ return true
|
|
|
|
+ } else {
|
|
|
|
+ if (arril == pathUrl) {
|
|
|
|
+ return true
|
|
|
|
+ }
|
|
}
|
|
}
|
|
- return path;
|
|
|
|
-});
|
|
|
|
|
|
|
|
|
|
+}
|
|
function iconName(iconClass) {
|
|
function iconName(iconClass) {
|
|
return `#icon-${iconClass}`
|
|
return `#icon-${iconClass}`
|
|
}
|
|
}
|
|
|
|
|
|
function goBack(event) {
|
|
function goBack(event) {
|
|
- router.push({ path: event || "/" });
|
|
|
|
|
|
+ let path = '/system/' + event
|
|
|
|
+ console.log(event, 222);
|
|
|
|
+ if (event == "/") {
|
|
|
|
+ router.push("/index");
|
|
|
|
+ } else {
|
|
|
|
+ router.push({ path: path || "/" });
|
|
|
|
+ }
|
|
}
|
|
}
|
|
// 向右
|
|
// 向右
|
|
function arrowBack() {
|
|
function arrowBack() {
|