Skip to content

Commit 6efd7e1

Browse files
committed
Update theme
1 parent 506be79 commit 6efd7e1

3 files changed

Lines changed: 12 additions & 7 deletions

File tree

config/config.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ const plugins = [
2626
include: ['dva', 'dva/router', 'dva/saga', 'dva/fetch'],
2727
exclude: ['@babel/runtime'],
2828
},
29-
hardSource: true,
29+
hardSource: false,
3030
}
3131
: {}),
3232
},
@@ -45,7 +45,7 @@ export default {
4545
// Theme for antd
4646
// https://ant.design/docs/react/customize-theme-cn
4747
theme: {
48-
'primary-color': '#FA8C16',
48+
'primary-color': '#2F54EB',
4949
},
5050
proxy: {
5151
'/api/': {

src/layouts/AdminLayout.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ const query = {
4545
selectedKeys: state.global.selectedKeys,
4646
user: state.global.user,
4747
menuPaths: state.global.menuPaths,
48+
menuMap: state.global.menuMap,
4849
menus: state.global.menus,
4950
global: state.global,
5051
}))
@@ -91,9 +92,11 @@ class AdminLayout extends React.PureComponent {
9192
};
9293

9394
onMenuOpenChange = openKeys => {
95+
const { menuMap } = this.props;
96+
9497
if (openKeys.length > 1) {
9598
const lastKey = openKeys[openKeys.length - 1];
96-
if (lastKey.length === openKeys[0].length) {
99+
if (!menuMap[lastKey].parent_path.startsWith(openKeys[0])) {
97100
this.dispatch({
98101
type: 'global/changeOpenKeys',
99102
payload: [lastKey],
@@ -246,6 +249,7 @@ class AdminLayout extends React.PureComponent {
246249
</Link>
247250
</div>
248251
<Menu
252+
theme="dark"
249253
mode="inline"
250254
{...menuProps}
251255
onOpenChange={this.onMenuOpenChange}

src/layouts/AdminLayout.less

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
.header {
44
padding: 0 12px 0 0;
5-
background: #fff;
5+
background: #002140;
66
box-shadow: 0 1px 4px rgba(0, 21, 41, 0.08);
77
position: relative;
88
}
@@ -13,15 +13,15 @@
1313
line-height: 64px;
1414
padding-left: (@menu-collapsed-width - 32px) / 2;
1515
transition: all 0.3s;
16-
background: #f0f2f5;
16+
background: #002140;
1717
overflow: hidden;
1818
img {
1919
display: inline-block;
2020
vertical-align: middle;
2121
height: 32px;
2222
}
2323
h1 {
24-
color: #000;
24+
color: #fff;
2525
display: inline-block;
2626
vertical-align: middle;
2727
font-size: 18px;
@@ -31,6 +31,7 @@
3131
}
3232

3333
i.trigger {
34+
color: #fff;
3435
font-size: 20px;
3536
line-height: 64px;
3637
cursor: pointer;
@@ -50,6 +51,7 @@ i.trigger {
5051
.right {
5152
float: right;
5253
height: 100%;
54+
color: #fff;
5355
.action {
5456
cursor: pointer;
5557
padding: 0 12px;
@@ -98,7 +100,6 @@ i.trigger {
98100
}
99101

100102
.sider {
101-
background: #fff;
102103
min-height: 100vh;
103104
position: relative;
104105
z-index: 10;

0 commit comments

Comments
 (0)