Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
ant-design-pro
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
duanledexianxianxian
ant-design-pro
Commits
121c8808
Commit
121c8808
authored
Aug 28, 2018
by
afc163
Committed by
ιεΈ
Aug 29, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rename themeColor to primaryColor
parent
3bc8524f
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
15 additions
and
15 deletions
+15
-15
src/components/SettingDrawer/ThemeColor.js
src/components/SettingDrawer/ThemeColor.js
+1
-1
src/components/SettingDrawer/ThemeColor.less
src/components/SettingDrawer/ThemeColor.less
+1
-1
src/components/SettingDrawer/index.js
src/components/SettingDrawer/index.js
+3
-3
src/defaultSetting.js
src/defaultSetting.js
+1
-1
src/models/setting.js
src/models/setting.js
+9
-9
No files found.
src/components/SettingDrawer/ThemeColor.js
View file @
121c8808
...
@@ -30,7 +30,7 @@ const ThemeColor = ({ colors, title, value, onChange }) => {
...
@@ -30,7 +30,7 @@ const ThemeColor = ({ colors, title, value, onChange }) => {
];
];
}
}
return
(
return
(
<
div
className
=
{
styles
.
theme
Color
}
>
<
div
className
=
{
styles
.
primary
Color
}
>
<
h3
className
=
{
styles
.
title
}
>
{
title
}
<
/h3
>
<
h3
className
=
{
styles
.
title
}
>
{
title
}
<
/h3
>
<
div
className
=
{
styles
.
content
}
>
<
div
className
=
{
styles
.
content
}
>
{
colorList
.
map
(
color
=>
{
{
colorList
.
map
(
color
=>
{
...
...
src/components/SettingDrawer/ThemeColor.less
View file @
121c8808
.
theme
Color {
.
primary
Color {
overflow: hidden;
overflow: hidden;
margin-top: 24px;
margin-top: 24px;
.title {
.title {
...
...
src/components/SettingDrawer/index.js
View file @
121c8808
...
@@ -113,7 +113,7 @@ class SettingDarwer extends PureComponent {
...
@@ -113,7 +113,7 @@ class SettingDarwer extends PureComponent {
render
()
{
render
()
{
const
{
setting
}
=
this
.
props
;
const
{
setting
}
=
this
.
props
;
const
{
collapse
,
silderTheme
,
theme
Color
,
layout
,
colorWeak
}
=
setting
;
const
{
collapse
,
silderTheme
,
primary
Color
,
layout
,
colorWeak
}
=
setting
;
return
(
return
(
<
Drawer
<
Drawer
visible
=
{
collapse
}
visible
=
{
collapse
}
...
@@ -166,8 +166,8 @@ class SettingDarwer extends PureComponent {
...
@@ -166,8 +166,8 @@ class SettingDarwer extends PureComponent {
<
ThemeColor
<
ThemeColor
title
=
{
formatMessage
({
id
:
'
app.setting.themecolor
'
})}
title
=
{
formatMessage
({
id
:
'
app.setting.themecolor
'
})}
value
=
{
theme
Color
}
value
=
{
primary
Color
}
onChange
=
{
color
=>
this
.
changeSetting
(
'
theme
Color
'
,
color
)}
onChange
=
{
color
=>
this
.
changeSetting
(
'
primary
Color
'
,
color
)}
/
>
/
>
<
Divider
/>
<
Divider
/>
...
...
src/defaultSetting.js
View file @
121c8808
export
default
{
export
default
{
collapse
:
false
,
collapse
:
false
,
silderTheme
:
'
dark
'
,
silderTheme
:
'
dark
'
,
theme
Color
:
'
#1890FF
'
,
primary
Color
:
'
#1890FF
'
,
layout
:
'
sidemenu
'
,
layout
:
'
sidemenu
'
,
grid
:
'
Fluid
'
,
grid
:
'
Fluid
'
,
fixedHeader
:
false
,
fixedHeader
:
false
,
...
...
src/models/setting.js
View file @
121c8808
...
@@ -2,9 +2,9 @@ import { message } from 'antd';
...
@@ -2,9 +2,9 @@ import { message } from 'antd';
import
defaultSetting
from
'
../defaultSetting
'
;
import
defaultSetting
from
'
../defaultSetting
'
;
let
lessNodesAppended
;
let
lessNodesAppended
;
const
updateTheme
=
theme
Color
=>
{
const
updateTheme
=
primary
Color
=>
{
// Determine if the component is remounted
// Determine if the component is remounted
if
(
!
theme
Color
)
{
if
(
!
primary
Color
)
{
return
;
return
;
}
}
const
hideMessage
=
message
.
loading
(
'
ζ£ε¨ηΌθ―δΈ»ι’οΌ
'
,
0
);
const
hideMessage
=
message
.
loading
(
'
ζ£ε¨ηΌθ―δΈ»ι’οΌ
'
,
0
);
...
@@ -40,7 +40,7 @@ const updateTheme = themeColor => {
...
@@ -40,7 +40,7 @@ const updateTheme = themeColor => {
setTimeout
(()
=>
{
setTimeout
(()
=>
{
window
.
less
window
.
less
.
modifyVars
({
.
modifyVars
({
'
@primary-color
'
:
theme
Color
,
'
@primary-color
'
:
primary
Color
,
})
})
.
then
(()
=>
{
.
then
(()
=>
{
hideMessage
();
hideMessage
();
...
@@ -70,9 +70,9 @@ export default {
...
@@ -70,9 +70,9 @@ export default {
setting
[
key
]
=
value
===
'
1
'
?
true
:
value
;
setting
[
key
]
=
value
===
'
1
'
?
true
:
value
;
}
}
});
});
const
{
theme
Color
,
colorWeak
}
=
setting
;
const
{
primary
Color
,
colorWeak
}
=
setting
;
if
(
state
.
themeColor
!==
theme
Color
)
{
if
(
state
.
primaryColor
!==
primary
Color
)
{
updateTheme
(
theme
Color
);
updateTheme
(
primary
Color
);
}
}
updateColorWeak
(
colorWeak
);
updateColorWeak
(
colorWeak
);
return
{
return
{
...
@@ -99,9 +99,9 @@ export default {
...
@@ -99,9 +99,9 @@ export default {
urlParams
.
searchParams
.
set
(
key
,
value
);
urlParams
.
searchParams
.
set
(
key
,
value
);
}
}
});
});
const
{
theme
Color
,
colorWeak
}
=
payload
;
const
{
primary
Color
,
colorWeak
}
=
payload
;
if
(
state
.
themeColor
!==
theme
Color
)
{
if
(
state
.
primaryColor
!==
primary
Color
)
{
updateTheme
(
theme
Color
);
updateTheme
(
primary
Color
);
}
}
updateColorWeak
(
colorWeak
);
updateColorWeak
(
colorWeak
);
window
.
history
.
replaceState
(
null
,
'
setting
'
,
urlParams
.
href
);
window
.
history
.
replaceState
(
null
,
'
setting
'
,
urlParams
.
href
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment