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
P
pro-blocks
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
pro-blocks
Commits
e0cf86a3
Commit
e0cf86a3
authored
Jun 05, 2018
by
jim
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Increase color weakness
parent
55946fb2
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
49 additions
and
18 deletions
+49
-18
src/components/Charts/Bar/index.js
src/components/Charts/Bar/index.js
+1
-1
src/components/Charts/Pie/index.js
src/components/Charts/Pie/index.js
+1
-1
src/components/Charts/TagCloud/index.js
src/components/Charts/TagCloud/index.js
+1
-1
src/components/Charts/WaterWave/index.js
src/components/Charts/WaterWave/index.js
+1
-1
src/components/GlobalHeader/RightContent.js
src/components/GlobalHeader/RightContent.js
+6
-9
src/components/HeaderSearch/index.js
src/components/HeaderSearch/index.js
+1
-1
src/components/SettingDarwer/index.js
src/components/SettingDarwer/index.js
+32
-2
src/index.less
src/index.less
+4
-0
src/routes/Forms/AdvancedForm.js
src/routes/Forms/AdvancedForm.js
+1
-1
src/routes/Profile/AdvancedProfile.js
src/routes/Profile/AdvancedProfile.js
+1
-1
No files found.
src/components/Charts/Bar/index.js
View file @
e0cf86a3
...
...
@@ -12,7 +12,7 @@ class Bar extends Component {
};
componentDidMount
()
{
window
.
addEventListener
(
'
resize
'
,
this
.
resize
);
window
.
addEventListener
(
'
resize
'
,
this
.
resize
,
{
passive
:
true
}
);
}
componentWillUnmount
()
{
...
...
src/components/Charts/Pie/index.js
View file @
e0cf86a3
...
...
@@ -19,7 +19,7 @@ export default class Pie extends Component {
};
componentDidMount
()
{
window
.
addEventListener
(
'
resize
'
,
this
.
resize
);
window
.
addEventListener
(
'
resize
'
,
this
.
resize
,
{
passive
:
true
}
);
}
componentDidUpdate
(
preProps
)
{
...
...
src/components/Charts/TagCloud/index.js
View file @
e0cf86a3
...
...
@@ -23,7 +23,7 @@ class TagCloud extends Component {
this
.
initTagCloud
();
this
.
renderChart
();
});
window
.
addEventListener
(
'
resize
'
,
this
.
resize
);
window
.
addEventListener
(
'
resize
'
,
this
.
resize
,
{
passive
:
true
}
);
}
componentDidUpdate
(
preProps
)
{
...
...
src/components/Charts/WaterWave/index.js
View file @
e0cf86a3
...
...
@@ -17,7 +17,7 @@ export default class WaterWave extends PureComponent {
this
.
renderChart
();
this
.
resize
();
});
window
.
addEventListener
(
'
resize
'
,
this
.
resize
);
window
.
addEventListener
(
'
resize
'
,
this
.
resize
,
{
passive
:
true
}
);
}
componentWillUnmount
()
{
...
...
src/components/GlobalHeader/RightContent.js
View file @
e0cf86a3
...
...
@@ -12,7 +12,7 @@ export default class GlobalHeaderRight extends PureComponent {
if
(
notices
.
length
===
0
)
{
return
{};
}
const
newNotices
=
notices
.
map
(
(
notice
)
=>
{
const
newNotices
=
notices
.
map
(
notice
=>
{
const
newNotice
=
{
...
notice
};
if
(
newNotice
.
datetime
)
{
newNotice
.
datetime
=
moment
(
notice
.
datetime
).
fromNow
();
...
...
@@ -69,15 +69,15 @@ export default class GlobalHeaderRight extends PureComponent {
className
=
`
${
styles
.
right
}
${
styles
.
dark
}
`
;
}
return
(
<
div
className
=
{
className
}
>
<
div
className
=
{
className
}
>
<
HeaderSearch
className
=
{
`
${
styles
.
action
}
${
styles
.
search
}
`
}
placeholder
=
"
站内搜索
"
dataSource
=
{[
'
搜索提示一
'
,
'
搜索提示二
'
,
'
搜索提示三
'
]}
onSearch
=
{
(
value
)
=>
{
onSearch
=
{
value
=>
{
console
.
log
(
'
input
'
,
value
);
// eslint-disable-line
}}
onPressEnter
=
{
(
value
)
=>
{
onPressEnter
=
{
value
=>
{
console
.
log
(
'
enter
'
,
value
);
// eslint-disable-line
}}
/
>
...
...
@@ -87,6 +87,7 @@ export default class GlobalHeaderRight extends PureComponent {
href
=
"
http://pro.ant.design/docs/getting-started
"
rel
=
"
noopener noreferrer
"
className
=
{
styles
.
action
}
title
=
"
使用文档
"
>
<
Icon
type
=
"
question-circle-o
"
/>
<
/a
>
...
...
@@ -124,11 +125,7 @@ export default class GlobalHeaderRight extends PureComponent {
{
currentUser
.
name
?
(
<
Dropdown
overlay
=
{
menu
}
>
<
span
className
=
{
`
${
styles
.
action
}
${
styles
.
account
}
`
}
>
<
Avatar
size
=
"
small
"
className
=
{
styles
.
avatar
}
src
=
{
currentUser
.
avatar
}
/
>
<
Avatar
size
=
"
small
"
className
=
{
styles
.
avatar
}
src
=
{
currentUser
.
avatar
}
/
>
<
span
className
=
{
styles
.
name
}
>
{
currentUser
.
name
}
<
/span
>
<
/span
>
<
/Dropdown
>
...
...
src/components/HeaderSearch/index.js
View file @
e0cf86a3
...
...
@@ -75,10 +75,10 @@ export default class HeaderSearch extends PureComponent {
onChange
=
{
this
.
onChange
}
>
<
Input
placeholder
=
{
placeholder
}
ref
=
{
node
=>
{
this
.
input
=
node
;
}}
placeholder
=
{
placeholder
}
onKeyDown
=
{
this
.
onKeyDown
}
onBlur
=
{
this
.
leaveSearchMode
}
/
>
...
...
src/components/SettingDarwer/index.js
View file @
e0cf86a3
...
...
@@ -21,10 +21,13 @@ const Body = ({ children, title, style }) => (
@
connect
(({
setting
})
=>
({
setting
}))
class
SettingDarwer
extends
PureComponent
{
componentDidMount
()
{
const
{
themeColor
}
=
this
.
props
.
setting
;
const
{
themeColor
,
colorWeak
}
=
this
.
props
.
setting
;
if
(
themeColor
!==
'
#1890FF
'
)
{
this
.
colorChange
(
themeColor
);
}
if
(
colorWeak
===
'
open
'
)
{
document
.
body
.
className
=
'
colorWeak
'
;
}
}
getLayOutSetting
=
()
=>
{
const
{
grid
,
fixedHeader
,
autoHideHeader
,
fixSiderbar
}
=
this
.
props
.
setting
;
...
...
@@ -85,6 +88,13 @@ class SettingDarwer extends PureComponent {
nextState
.
grid
=
'
Fluid
'
;
}
}
if
(
key
===
'
colorWeak
'
)
{
if
(
value
===
'
open
'
)
{
document
.
body
.
className
=
'
colorWeak
'
;
}
else
{
document
.
body
.
className
=
''
;
}
}
this
.
setState
(
nextState
,
()
=>
{
this
.
props
.
dispatch
({
type
:
'
setting/changeSetting
'
,
...
...
@@ -112,7 +122,7 @@ class SettingDarwer extends PureComponent {
},
200
);
};
render
()
{
const
{
collapse
,
silderTheme
,
themeColor
,
layout
}
=
this
.
props
.
setting
;
const
{
collapse
,
silderTheme
,
themeColor
,
layout
,
colorWeak
}
=
this
.
props
.
setting
;
return
(
<
div
className
=
{
styles
.
settingDarwer
}
>
<
div
className
=
{
styles
.
mini_bar
}
onClick
=
{
this
.
togglerContent
}
>
...
...
@@ -177,6 +187,26 @@ class SettingDarwer extends PureComponent {
dataSource
=
{
this
.
getLayOutSetting
()}
renderItem
=
{
item
=>
<
List
.
Item
actions
=
{
item
.
action
}
>
{
item
.
title
}
<
/List.Item>
}
/>
<
Divider
/>
<
Body
title
=
"
导航设置
"
>
<
List
.
Item
actions
=
{[
<
Select
value
=
{
colorWeak
}
size
=
"
small
"
onSelect
=
{
value
=>
this
.
changeSetting
(
'
colorWeak
'
,
value
)}
style
=
{{
width
:
80
}}
>
<
Select
.
Option
value
=
"
close
"
>
close
<
/Select.Option
>
<
Select
.
Option
value
=
"
open
"
>
open
<
/Select.Option
>
<
/Select>
,
]}
>
色弱模式
<
/List.Item
>
<
/Body
>
<
/div
>
<
/DrawerMenu
>
<
/div
>
...
...
src/index.less
View file @
e0cf86a3
...
...
@@ -5,6 +5,10 @@ body,
overflow: auto;
}
:global(.colorWeak) {
filter: invert(80%);
}
:global(.ant-layout) {
min-height: 100%;
}
...
...
src/routes/Forms/AdvancedForm.js
View file @
e0cf86a3
...
...
@@ -62,7 +62,7 @@ class AdvancedForm extends PureComponent {
width
:
'
100%
'
,
};
componentDidMount
()
{
window
.
addEventListener
(
'
resize
'
,
this
.
resizeFooterToolbar
);
window
.
addEventListener
(
'
resize
'
,
this
.
resizeFooterToolbar
,
{
passive
:
true
}
);
}
componentWillUnmount
()
{
window
.
removeEventListener
(
'
resize
'
,
this
.
resizeFooterToolbar
);
...
...
src/routes/Profile/AdvancedProfile.js
View file @
e0cf86a3
...
...
@@ -197,7 +197,7 @@ export default class AdvancedProfile extends Component {
});
this
.
setStepDirection
();
window
.
addEventListener
(
'
resize
'
,
this
.
setStepDirection
);
window
.
addEventListener
(
'
resize
'
,
this
.
setStepDirection
,
{
passive
:
true
}
);
}
componentWillUnmount
()
{
...
...
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