Browse Source

菜单样式调整

newMaster
1747191978@qq.com 4 months ago
parent
commit
55784ad5fb
  1. BIN
      acupuncture-前台/src/assets/images/dangan_n@1x.png
  2. BIN
      acupuncture-前台/src/assets/images/dangan_s@1x.png
  3. BIN
      acupuncture-前台/src/assets/images/home_N@1x.png
  4. BIN
      acupuncture-前台/src/assets/images/home_S@1x.png
  5. BIN
      acupuncture-前台/src/assets/images/logo@1x.png
  6. BIN
      acupuncture-前台/src/assets/images/me_n@1x.png
  7. BIN
      acupuncture-前台/src/assets/images/me_s@1x.png
  8. BIN
      acupuncture-前台/src/assets/images/suifang_n@1x.png
  9. BIN
      acupuncture-前台/src/assets/images/suifang_s@1x.png
  10. BIN
      acupuncture-前台/src/assets/images/zhenliao_n@1x.png
  11. BIN
      acupuncture-前台/src/assets/images/zhenliao_s@1x.png
  12. 53
      acupuncture-前台/src/assets/styles/sidebar.scss
  13. 34
      acupuncture-前台/src/assets/styles/variables.scss
  14. 75
      acupuncture-前台/src/components/TopNav/index.vue
  15. 4
      acupuncture-前台/src/layout/components/Navbar.vue
  16. 37
      acupuncture-前台/src/layout/components/Sidebar/Item.vue
  17. 67
      acupuncture-前台/src/layout/components/Sidebar/Logo.vue
  18. 113
      acupuncture-前台/src/layout/components/Sidebar/SidebarItem.vue
  19. 31
      acupuncture-前台/src/layout/components/Sidebar/index.vue
  20. 2
      acupuncture-前台/src/store/modules/settings.js

BIN
acupuncture-前台/src/assets/images/dangan_n@1x.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 874 B

BIN
acupuncture-前台/src/assets/images/dangan_s@1x.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 849 B

BIN
acupuncture-前台/src/assets/images/home_N@1x.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 767 B

BIN
acupuncture-前台/src/assets/images/home_S@1x.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 734 B

BIN
acupuncture-前台/src/assets/images/logo@1x.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1018 B

BIN
acupuncture-前台/src/assets/images/me_n@1x.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 716 B

BIN
acupuncture-前台/src/assets/images/me_s@1x.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 699 B

BIN
acupuncture-前台/src/assets/images/suifang_n@1x.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 860 B

BIN
acupuncture-前台/src/assets/images/suifang_s@1x.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 833 B

BIN
acupuncture-前台/src/assets/images/zhenliao_n@1x.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 787 B

BIN
acupuncture-前台/src/assets/images/zhenliao_s@1x.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 759 B

53
acupuncture-前台/src/assets/styles/sidebar.scss

@ -1,18 +1,17 @@
#app {
.main-container {
height: 100%;
transition: margin-left .28s;
transition: margin-left 0.28s;
margin-left: $base-sidebar-width;
position: relative;
}
.sidebarHide {
margin-left: 0!important;
margin-left: 0 !important;
}
.sidebar-container {
-webkit-transition: width .28s;
-webkit-transition: width 0.28s;
transition: width 0.28s;
width: $base-sidebar-width !important;
background-color: $base-menu-background;
@ -24,12 +23,17 @@
left: 0;
z-index: 1001;
overflow: hidden;
-webkit-box-shadow: 2px 0 6px rgba(0,21,41,.35);
box-shadow: 2px 0 6px rgba(0,21,41,.35);
-webkit-box-shadow: 2px 0 6px rgba(0, 21, 41, 0.35);
box-shadow: 2px 0 6px rgba(0, 21, 41, 0.35);
// reset element-ui css
.horizontal-collapse-transition {
transition: 0s width ease-in-out, 0s padding-left ease-in-out, 0s padding-right ease-in-out;
transition: 0s width ease-in-out, 0s padding-left ease-in-out,
0s padding-right ease-in-out;
-webkit-transition: 0s width ease-in-out, 0s padding-left ease-in-out;
-moz-transition: 0s width ease-in-out, 0s padding-left ease-in-out;
-ms-transition: 0s width ease-in-out, 0s padding-left ease-in-out;
-o-transition: 0s width ease-in-out, 0s padding-left ease-in-out;
}
.scrollbar-wrapper {
@ -70,17 +74,26 @@
width: 100% !important;
}
.el-menu-item, .el-submenu__title {
.el-menu-item,
.el-submenu__title {
overflow: hidden !important;
text-overflow: ellipsis !important;
white-space: nowrap !important;
}
.el-menu-item {
height: 90px;
line-height: 26px !important;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}
// menu hover
.submenu-title-noDropdown,
.el-submenu__title {
&:hover {
background-color: rgba(0, 0, 0, 0.06) !important;
background-color: rgba(0, 0, 0, 0.2) !important;
color: #fff !important;
}
}
@ -88,7 +101,7 @@
color: $base-menu-color-active !important;
}
& .nest-menu .el-submenu>.el-submenu__title,
& .nest-menu .el-submenu > .el-submenu__title,
& .el-submenu .el-menu-item {
min-width: $base-sidebar-width !important;
@ -97,7 +110,7 @@
}
}
& .theme-dark .nest-menu .el-submenu>.el-submenu__title,
& .theme-dark .nest-menu .el-submenu > .el-submenu__title,
& .theme-dark .el-submenu .el-menu-item {
background-color: $base-sub-menu-background !important;
@ -132,20 +145,19 @@
.el-submenu {
overflow: hidden;
&>.el-submenu__title {
& > .el-submenu__title {
padding: 0 !important;
.svg-icon {
margin-left: 20px;
}
}
}
.el-menu--collapse {
.el-submenu {
&>.el-submenu__title {
&>span {
& > .el-submenu__title {
& > span {
height: 0;
width: 0;
overflow: hidden;
@ -168,7 +180,7 @@
}
.sidebar-container {
transition: transform .28s;
transition: transform 0.28s;
width: $base-sidebar-width !important;
}
@ -182,7 +194,6 @@
}
.withoutAnimation {
.main-container,
.sidebar-container {
transition: none;
@ -192,13 +203,13 @@
// when menu collapsed
.el-menu--vertical {
&>.el-menu {
& > .el-menu {
.svg-icon {
margin-right: 16px;
}
}
.nest-menu .el-submenu>.el-submenu__title,
.nest-menu .el-submenu > .el-submenu__title,
.el-menu-item {
&:hover {
// you can use $subMenuHover
@ -207,7 +218,7 @@
}
// the scroll bar appears when the subMenu is too long
>.el-menu--popup {
> .el-menu--popup {
max-height: 100vh;
overflow-y: auto;

34
acupuncture-前台/src/assets/styles/variables.scss

@ -1,25 +1,25 @@
// base color
$blue:#324157;
$light-blue:#3A71A8;
$red:#C03639;
$pink: #E65D6E;
$green: #30B08F;
$tiffany: #4AB7BD;
$yellow:#FEC171;
$panGreen: #30B08F;
$blue: #324157;
$light-blue: #3a71a8;
$red: #c03639;
$pink: #e65d6e;
$green: #30b08f;
$tiffany: #4ab7bd;
$yellow: #fec171;
$panGreen: #30b08f;
// 默认菜单主题风格
$base-menu-color:#bfcbd9;
$base-menu-color-active:#f4f4f5;
$base-menu-background:#304156;
$base-menu-color: #c7bdb1;
$base-menu-color-active: #f4f4f5;
$base-menu-background: #70483e;
$base-logo-title-color: #ffffff;
$base-menu-light-color:rgba(0,0,0,.70);
$base-menu-light-background:#ffffff;
$base-menu-light-color: rgba(0, 0, 0, 0.7);
$base-menu-light-background: #ffffff;
$base-logo-light-title-color: #001529;
$base-sub-menu-background:#1f2d3d;
$base-sub-menu-hover:#001528;
$base-sub-menu-background: #1f2d3d;
$base-sub-menu-hover: #001528;
// 自定义暗色菜单风格
/**
@ -36,7 +36,7 @@ $base-sub-menu-background:#000c17;
$base-sub-menu-hover:#001528;
*/
$base-sidebar-width: 200px;
$base-sidebar-width: 120px;
// the :export directive is the magic sauce for webpack
// https://www.bluematador.com/blog/how-to-share-variables-between-js-and-sass
@ -50,5 +50,5 @@ $base-sidebar-width: 200px;
subMenuHover: $base-sub-menu-hover;
sideBarWidth: $base-sidebar-width;
logoTitleColor: $base-logo-title-color;
logoLightTitleColor: $base-logo-light-title-color
logoLightTitleColor: $base-logo-light-title-color;
}

75
acupuncture-前台/src/components/TopNav/index.vue

@ -5,25 +5,38 @@
@select="handleSelect"
>
<template v-for="(item, index) in topMenus">
<el-menu-item :style="{'--theme': theme}" :index="item.path" :key="index" v-if="index < visibleNumber">
<el-menu-item
:style="{ '--theme': theme }"
:index="item.path"
:key="index"
v-if="index < visibleNumber"
>
<svg-icon
v-if="item.meta && item.meta.icon && item.meta.icon !== '#'"
:icon-class="item.meta.icon"/>
:icon-class="item.meta.icon"
/>
{{ item.meta.title }}
</el-menu-item>
</template>
<!-- 顶部菜单超出数量折叠 -->
<el-submenu :style="{'--theme': theme}" index="more" :key="visibleNumber" v-if="topMenus.length > visibleNumber">
<el-submenu
:style="{ '--theme': theme }"
index="more"
:key="visibleNumber"
v-if="topMenus.length > visibleNumber"
>
<template slot="title">更多菜单</template>
<template v-for="(item, index) in topMenus">
<el-menu-item
:index="item.path"
:key="index"
v-if="index >= visibleNumber">
v-if="index >= visibleNumber"
>
<svg-icon
v-if="item.meta && item.meta.icon && item.meta.icon !== '#'"
:icon-class="item.meta.icon"/>
:icon-class="item.meta.icon"
/>
{{ item.meta.title }}
</el-menu-item>
</template>
@ -36,7 +49,7 @@ import { constantRoutes } from "@/router";
import { isHttp } from "@/utils/validate";
//
const hideList = ['/index', '/user/profile'];
const hideList = ["/index", "/user/profile"];
export default {
data() {
@ -44,7 +57,7 @@ export default {
//
visibleNumber: 5,
// index
currentIndex: undefined
currentIndex: undefined,
};
},
computed: {
@ -76,11 +89,12 @@ export default {
this.routers.map((router) => {
for (var item in router.children) {
if (router.children[item].parentPath === undefined) {
if(router.path === "/") {
if (router.path === "/") {
router.children[item].path = "/" + router.children[item].path;
} else {
if(!isHttp(router.children[item].path)) {
router.children[item].path = router.path + "/" + router.children[item].path;
if (!isHttp(router.children[item].path)) {
router.children[item].path =
router.path + "/" + router.children[item].path;
}
}
router.children[item].parentPath = router.path;
@ -94,25 +108,29 @@ export default {
activeMenu() {
const path = this.$route.path;
let activePath = path;
if (path !== undefined && path.lastIndexOf("/") > 0 && hideList.indexOf(path) === -1) {
if (
path !== undefined &&
path.lastIndexOf("/") > 0 &&
hideList.indexOf(path) === -1
) {
const tmpPath = path.substring(1, path.length);
if (!this.$route.meta.link) {
activePath = "/" + tmpPath.substring(0, tmpPath.indexOf("/"));
this.$store.dispatch('app/toggleSideBarHide', false);
this.$store.dispatch("app/toggleSideBarHide", false);
}
} else if(!this.$route.children) {
} else if (!this.$route.children) {
activePath = path;
this.$store.dispatch('app/toggleSideBarHide', true);
this.$store.dispatch("app/toggleSideBarHide", true);
}
this.activeRoutes(activePath);
return activePath;
},
},
beforeMount() {
window.addEventListener('resize', this.setVisibleNumber)
window.addEventListener("resize", this.setVisibleNumber);
},
beforeDestroy() {
window.removeEventListener('resize', this.setVisibleNumber)
window.removeEventListener("resize", this.setVisibleNumber);
},
mounted() {
this.setVisibleNumber();
@ -126,24 +144,24 @@ export default {
//
handleSelect(key, keyPath) {
this.currentIndex = key;
const route = this.routers.find(item => item.path === key);
const route = this.routers.find((item) => item.path === key);
if (isHttp(key)) {
// http(s)://
window.open(key, "_blank");
} else if (!route || !route.children) {
//
const routeMenu = this.childrenMenus.find(item => item.path === key);
const routeMenu = this.childrenMenus.find((item) => item.path === key);
if (routeMenu && routeMenu.query) {
let query = JSON.parse(routeMenu.query);
this.$router.push({ path: key, query: query });
} else {
this.$router.push({ path: key });
}
this.$store.dispatch('app/toggleSideBarHide', true);
this.$store.dispatch("app/toggleSideBarHide", true);
} else {
//
this.activeRoutes(key);
this.$store.dispatch('app/toggleSideBarHide', false);
this.$store.dispatch("app/toggleSideBarHide", false);
}
},
//
@ -156,36 +174,35 @@ export default {
}
});
}
if(routes.length > 0) {
if (routes.length > 0) {
this.$store.commit("SET_SIDEBAR_ROUTERS", routes);
} else {
this.$store.dispatch('app/toggleSideBarHide', true);
}
this.$store.dispatch("app/toggleSideBarHide", true);
}
},
},
};
</script>
<style lang="scss">
.topmenu-container.el-menu--horizontal > .el-menu-item {
line-height: 26px !important;
float: left;
height: 50px !important;
line-height: 50px !important;
color: #999093 !important;
padding: 0 5px !important;
margin: 0 10px !important;
}
.topmenu-container.el-menu--horizontal > .el-menu-item.is-active, .el-menu--horizontal > .el-submenu.is-active .el-submenu__title {
border-bottom: 2px solid #{'var(--theme)'} !important;
.topmenu-container.el-menu--horizontal > .el-menu-item.is-active,
.el-menu--horizontal > .el-submenu.is-active .el-submenu__title {
border-bottom: 2px solid #{"var(--theme)"} !important;
color: #303133;
}
/* submenu item */
.topmenu-container.el-menu--horizontal > .el-submenu .el-submenu__title {
float: left;
height: 50px !important;
line-height: 50px !important;
line-height: 26px !important;
color: #999093 !important;
padding: 0 5px !important;
margin: 0 10px !important;

4
acupuncture-前台/src/layout/components/Navbar.vue

@ -15,7 +15,7 @@
<top-nav id="topmenu-container" class="topmenu-container" v-if="topNav" />
<div class="right-menu">
<template v-if="device !== 'mobile'">
<!-- <template v-if="device !== 'mobile'">
<search id="header-search" class="right-menu-item" />
<el-tooltip content="源码地址" effect="dark" placement="bottom">
@ -31,7 +31,7 @@
<el-tooltip content="布局大小" effect="dark" placement="bottom">
<size-select id="size-select" class="right-menu-item hover-effect" />
</el-tooltip>
</template>
</template> -->
<el-dropdown
class="avatar-container right-menu-item hover-effect"

37
acupuncture-前台/src/layout/components/Sidebar/Item.vue

@ -1,33 +1,42 @@
<script>
export default {
name: 'MenuItem',
name: "MenuItem",
functional: true,
props: {
icon: {
type: String,
default: ''
default: "",
},
title: {
type: String,
default: ''
}
default: "",
},
},
render(h, context) {
const { icon, title } = context.props
const vnodes = []
const { icon, title } = context.props;
const vnodes = [];
if (icon) {
vnodes.push(<svg-icon icon-class={icon}/>)
}
// if (icon) {
// // vnodes.push(<svg-icon icon-class={icon} />);
// vnodes.push(<img src={itmeIcon[title]} />);
// }
if (title) {
console.log("title", title);
if (title.length > 5) {
vnodes.push(<span slot='title' title={(title)}>{(title)}</span>)
vnodes.push(
<span slot="title" title={title}>
{title}
</span>
);
} else {
vnodes.push(<span slot='title'>{(title)}</span>)
}
vnodes.push(<span slot="title">{title}</span>);
}
return vnodes
}
}
return vnodes;
},
};
</script>

67
acupuncture-前台/src/layout/components/Sidebar/Logo.vue

@ -1,45 +1,80 @@
<template>
<div class="sidebar-logo-container" :class="{'collapse':collapse}" :style="{ backgroundColor: sideTheme === 'theme-dark' ? variables.menuBackground : variables.menuLightBackground }">
<div
class="sidebar-logo-container"
:class="{ collapse: collapse }"
:style="{
backgroundColor:
sideTheme === 'theme-dark'
? variables.menuBackground
: variables.menuLightBackground,
}"
>
<transition name="sidebarLogoFade">
<router-link v-if="collapse" key="collapse" class="sidebar-logo-link" to="/">
<router-link
v-if="collapse"
key="collapse"
class="sidebar-logo-link"
to="/"
>
<img v-if="logo" :src="logo" class="sidebar-logo" />
<h1 v-else class="sidebar-title" :style="{ color: sideTheme === 'theme-dark' ? variables.logoTitleColor : variables.logoLightTitleColor }">{{ title }} </h1>
<h1
v-else
class="sidebar-title"
:style="{
color:
sideTheme === 'theme-dark'
? variables.logoTitleColor
: variables.logoLightTitleColor,
}"
>
{{ title }}
</h1>
</router-link>
<router-link v-else key="expand" class="sidebar-logo-link" to="/">
<img v-if="logo" :src="logo" class="sidebar-logo" />
<h1 class="sidebar-title" :style="{ color: sideTheme === 'theme-dark' ? variables.logoTitleColor : variables.logoLightTitleColor }">{{ title }} </h1>
<h1
class="sidebar-title"
:style="{
color:
sideTheme === 'theme-dark'
? variables.logoTitleColor
: variables.logoLightTitleColor,
}"
>
{{ title }}
</h1>
</router-link>
</transition>
</div>
</template>
<script>
import logoImg from '@/assets/logo/logo.png'
import variables from '@/assets/styles/variables.scss'
import logoImg from "@/assets/logo/logo.png";
import variables from "@/assets/styles/variables.scss";
export default {
name: 'SidebarLogo',
name: "SidebarLogo",
props: {
collapse: {
type: Boolean,
required: true
}
required: true,
},
},
computed: {
variables() {
return variables;
},
sideTheme() {
return this.$store.state.settings.sideTheme
}
return this.$store.state.settings.sideTheme;
},
},
data() {
return {
title: process.env.VUE_APP_TITLE,
logo: logoImg
}
}
}
logo: logoImg,
};
},
};
</script>
<style lang="scss" scoped>
@ -57,7 +92,7 @@ export default {
width: 100%;
height: 50px;
line-height: 50px;
background: #2b2f3a;
background: #70483e;
text-align: center;
overflow: hidden;

113
acupuncture-前台/src/layout/components/Sidebar/SidebarItem.vue

@ -1,16 +1,44 @@
<template>
<div v-if="!item.hidden">
<template v-if="hasOneShowingChild(item.children,item) && (!onlyOneChild.children||onlyOneChild.noShowingChildren)&&!item.alwaysShow">
<app-link v-if="onlyOneChild.meta" :to="resolvePath(onlyOneChild.path, onlyOneChild.query)">
<el-menu-item :index="resolvePath(onlyOneChild.path)" :class="{'submenu-title-noDropdown':!isNest}">
<item :icon="onlyOneChild.meta.icon||(item.meta&&item.meta.icon)" :title="onlyOneChild.meta.title" />
<template
v-if="
hasOneShowingChild(item.children, item) &&
(!onlyOneChild.children || onlyOneChild.noShowingChildren) &&
!item.alwaysShow
"
>
<app-link
v-if="onlyOneChild.meta"
:to="resolvePath(onlyOneChild.path, onlyOneChild.query)"
>
<el-menu-item
:index="resolvePath(onlyOneChild.path)"
:class="{ 'submenu-title-noDropdown': !isNest }"
>
{{ sideTheme }}
<div v-if="onlyOneChild.meta.icon">
<img :src="itmeIcon[onlyOneChild.meta.title]" alt="" />
</div>
<item
:icon="onlyOneChild.meta.icon || (item.meta && item.meta.icon)"
:title="onlyOneChild.meta.title"
/>
</el-menu-item>
</app-link>
</template>
<el-submenu v-else ref="subMenu" :index="resolvePath(item.path)" popper-append-to-body>
<el-submenu
v-else
ref="subMenu"
:index="resolvePath(item.path)"
popper-append-to-body
>
<template slot="title">
<item v-if="item.meta" :icon="item.meta && item.meta.icon" :title="item.meta.title" />
<item
v-if="item.meta"
:icon="item.meta && item.meta.icon"
:title="item.meta.title"
/>
</template>
<sidebar-item
v-for="(child, index) in item.children"
@ -25,75 +53,90 @@
</template>
<script>
import path from 'path'
import { isExternal } from '@/utils/validate'
import Item from './Item'
import AppLink from './Link'
import FixiOSBug from './FixiOSBug'
import path from "path";
import { isExternal } from "@/utils/validate";
import Item from "./Item";
import AppLink from "./Link";
import FixiOSBug from "./FixiOSBug";
export default {
name: 'SidebarItem',
name: "SidebarItem",
components: { Item, AppLink },
mixins: [FixiOSBug],
props: {
// route object
item: {
type: Object,
required: true
required: true,
},
isNest: {
type: Boolean,
default: false
default: false,
},
basePath: {
type: String,
default: ''
}
default: "",
},
sideTheme: {},
},
data() {
this.onlyOneChild = null
return {}
this.onlyOneChild = null;
return {
itmeIcon: {
首页: require("@/assets/images/home_N@1x.png"),
患者档案: require("@/assets/images/dangan_n@1x.png"),
诊疗档案: require("@/assets/images/zhenliao_n@1x.png"),
随访档案: require("@/assets/images/suifang_n@1x.png"),
我的: require("@/assets/images/me_n@1x.png"),
},
itmeIcon1: {
首页: require("@/assets/images/home_S@1x.png"),
患者档案: require("@/assets/images/dangan_s@1x.png"),
诊疗档案: require("@/assets/images/zhenliao_s@1x.png"),
随访档案: require("@/assets/images/suifang_s@1x.png"),
我的: require("@/assets/images/me_s@1x.png"),
},
};
},
methods: {
hasOneShowingChild(children = [], parent) {
if (!children) {
children = [];
}
const showingChildren = children.filter(item => {
const showingChildren = children.filter((item) => {
if (item.hidden) {
return false
return false;
}
// Temp set(will be used if only has one showing child)
this.onlyOneChild = item
return true
})
this.onlyOneChild = item;
return true;
});
// When there is only one child router, the child router is displayed by default
if (showingChildren.length === 1) {
return true
return true;
}
// Show parent if there are no child router to display
if (showingChildren.length === 0) {
this.onlyOneChild = { ... parent, path: '', noShowingChildren: true }
return true
this.onlyOneChild = { ...parent, path: "", noShowingChildren: true };
return true;
}
return false
return false;
},
resolvePath(routePath, routeQuery) {
if (isExternal(routePath)) {
return routePath
return routePath;
}
if (isExternal(this.basePath)) {
return this.basePath
return this.basePath;
}
if (routeQuery) {
let query = JSON.parse(routeQuery);
return { path: path.resolve(this.basePath, routePath), query: query }
}
return path.resolve(this.basePath, routePath)
return { path: path.resolve(this.basePath, routePath), query: query };
}
}
}
return path.resolve(this.basePath, routePath);
},
},
};
</script>

31
acupuncture-前台/src/layout/components/Sidebar/index.vue

@ -1,12 +1,28 @@
<template>
<div :class="{'has-logo':showLogo}" :style="{ backgroundColor: settings.sideTheme === 'theme-dark' ? variables.menuBackground : variables.menuLightBackground }">
<div
:class="{ 'has-logo': showLogo }"
:style="{
backgroundColor:
settings.sideTheme === 'theme-dark'
? variables.menuBackground
: variables.menuLightBackground,
}"
>
<logo v-if="showLogo" :collapse="isCollapse" />
<el-scrollbar :class="settings.sideTheme" wrap-class="scrollbar-wrapper">
<el-menu
:default-active="activeMenu"
:collapse="isCollapse"
:background-color="settings.sideTheme === 'theme-dark' ? variables.menuBackground : variables.menuLightBackground"
:text-color="settings.sideTheme === 'theme-dark' ? variables.menuColor : variables.menuLightColor"
:background-color="
settings.sideTheme === 'theme-dark'
? variables.menuBackground
: variables.menuLightBackground
"
:text-color="
settings.sideTheme === 'theme-dark'
? variables.menuColor
: variables.menuLightColor
"
:unique-opened="true"
:active-text-color="settings.theme"
:collapse-transition="false"
@ -51,7 +67,12 @@ export default {
},
isCollapse() {
return !this.sidebar.opened;
}
}
},
},
};
</script>
<style scoped>
>>> .is-active {
background-color: #fff !important;
}
</style>

2
acupuncture-前台/src/store/modules/settings.js

@ -5,7 +5,7 @@ const { sideTheme, showSettings, topNav, tagsView, fixedHeader, sidebarLogo, dyn
const storageSetting = JSON.parse(localStorage.getItem('layout-setting')) || ''
const state = {
title: '',
theme: storageSetting.theme || '#409EFF',
theme: storageSetting.theme || '#70483E',
sideTheme: storageSetting.sideTheme || sideTheme,
showSettings: showSettings,
topNav: storageSetting.topNav === undefined ? topNav : storageSetting.topNav,

Loading…
Cancel
Save