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
Show 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 {
...
@@ -12,7 +12,7 @@ class Bar extends Component {
};
};
componentDidMount
()
{
componentDidMount
()
{
window
.
addEventListener
(
'
resize
'
,
this
.
resize
);
window
.
addEventListener
(
'
resize
'
,
this
.
resize
,
{
passive
:
true
}
);
}
}
componentWillUnmount
()
{
componentWillUnmount
()
{
...
...
src/components/Charts/Pie/index.js
View file @
e0cf86a3
...
@@ -19,7 +19,7 @@ export default class Pie extends Component {
...
@@ -19,7 +19,7 @@ export default class Pie extends Component {
};
};
componentDidMount
()
{
componentDidMount
()
{
window
.
addEventListener
(
'
resize
'
,
this
.
resize
);
window
.
addEventListener
(
'
resize
'
,
this
.
resize
,
{
passive
:
true
}
);
}
}
componentDidUpdate
(
preProps
)
{
componentDidUpdate
(
preProps
)
{
...
...
src/components/Charts/TagCloud/index.js
View file @
e0cf86a3
...
@@ -23,7 +23,7 @@ class TagCloud extends Component {
...
@@ -23,7 +23,7 @@ class TagCloud extends Component {
this
.
initTagCloud
();
this
.
initTagCloud
();
this
.
renderChart
();
this
.
renderChart
();
});
});
window
.
addEventListener
(
'
resize
'
,
this
.
resize
);
window
.
addEventListener
(
'
resize
'
,
this
.
resize
,
{
passive
:
true
}
);
}
}
componentDidUpdate
(
preProps
)
{
componentDidUpdate
(
preProps
)
{
...
...
src/components/Charts/WaterWave/index.js
View file @
e0cf86a3
...
@@ -17,7 +17,7 @@ export default class WaterWave extends PureComponent {
...
@@ -17,7 +17,7 @@ export default class WaterWave extends PureComponent {
this
.
renderChart
();
this
.
renderChart
();
this
.
resize
();
this
.
resize
();
});
});
window
.
addEventListener
(
'
resize
'
,
this
.
resize
);
window
.
addEventListener
(
'
resize
'
,
this
.
resize
,
{
passive
:
true
}
);
}
}
componentWillUnmount
()
{
componentWillUnmount
()
{
...
...
src/components/GlobalHeader/RightContent.js
View file @
e0cf86a3
...
@@ -12,7 +12,7 @@ export default class GlobalHeaderRight extends PureComponent {
...
@@ -12,7 +12,7 @@ export default class GlobalHeaderRight extends PureComponent {
if
(
notices
.
length
===
0
)
{
if
(
notices
.
length
===
0
)
{
return
{};
return
{};
}
}
const
newNotices
=
notices
.
map
(
(
notice
)
=>
{
const
newNotices
=
notices
.
map
(
notice
=>
{
const
newNotice
=
{
...
notice
};
const
newNotice
=
{
...
notice
};
if
(
newNotice
.
datetime
)
{
if
(
newNotice
.
datetime
)
{
newNotice
.
datetime
=
moment
(
notice
.
datetime
).
fromNow
();
newNotice
.
datetime
=
moment
(
notice
.
datetime
).
fromNow
();
...
@@ -69,15 +69,15 @@ export default class GlobalHeaderRight extends PureComponent {
...
@@ -69,15 +69,15 @@ export default class GlobalHeaderRight extends PureComponent {
className
=
`
${
styles
.
right
}
${
styles
.
dark
}
`
;
className
=
`
${
styles
.
right
}
${
styles
.
dark
}
`
;
}
}
return
(
return
(
<
div
className
=
{
className
}
>
<
div
className
=
{
className
}
>
<
HeaderSearch
<
HeaderSearch
className
=
{
`
${
styles
.
action
}
${
styles
.
search
}
`
}
className
=
{
`
${
styles
.
action
}
${
styles
.
search
}
`
}
placeholder
=
"
站内搜索
"
placeholder
=
"
站内搜索
"
dataSource
=
{[
'
搜索提示一
'
,
'
搜索提示二
'
,
'
搜索提示三
'
]}
dataSource
=
{[
'
搜索提示一
'
,
'
搜索提示二
'
,
'
搜索提示三
'
]}
onSearch
=
{
(
value
)
=>
{
onSearch
=
{
value
=>
{
console
.
log
(
'
input
'
,
value
);
// eslint-disable-line
console
.
log
(
'
input
'
,
value
);
// eslint-disable-line
}}
}}
onPressEnter
=
{
(
value
)
=>
{
onPressEnter
=
{
value
=>
{
console
.
log
(
'
enter
'
,
value
);
// eslint-disable-line
console
.
log
(
'
enter
'
,
value
);
// eslint-disable-line
}}
}}
/
>
/
>
...
@@ -87,6 +87,7 @@ export default class GlobalHeaderRight extends PureComponent {
...
@@ -87,6 +87,7 @@ export default class GlobalHeaderRight extends PureComponent {
href
=
"
http://pro.ant.design/docs/getting-started
"
href
=
"
http://pro.ant.design/docs/getting-started
"
rel
=
"
noopener noreferrer
"
rel
=
"
noopener noreferrer
"
className
=
{
styles
.
action
}
className
=
{
styles
.
action
}
title
=
"
使用文档
"
>
>
<
Icon
type
=
"
question-circle-o
"
/>
<
Icon
type
=
"
question-circle-o
"
/>
<
/a
>
<
/a
>
...
@@ -124,11 +125,7 @@ export default class GlobalHeaderRight extends PureComponent {
...
@@ -124,11 +125,7 @@ export default class GlobalHeaderRight extends PureComponent {
{
currentUser
.
name
?
(
{
currentUser
.
name
?
(
<
Dropdown
overlay
=
{
menu
}
>
<
Dropdown
overlay
=
{
menu
}
>
<
span
className
=
{
`
${
styles
.
action
}
${
styles
.
account
}
`
}
>
<
span
className
=
{
`
${
styles
.
action
}
${
styles
.
account
}
`
}
>
<
Avatar
<
Avatar
size
=
"
small
"
className
=
{
styles
.
avatar
}
src
=
{
currentUser
.
avatar
}
/
>
size
=
"
small
"
className
=
{
styles
.
avatar
}
src
=
{
currentUser
.
avatar
}
/
>
<
span
className
=
{
styles
.
name
}
>
{
currentUser
.
name
}
<
/span
>
<
span
className
=
{
styles
.
name
}
>
{
currentUser
.
name
}
<
/span
>
<
/span
>
<
/span
>
<
/Dropdown
>
<
/Dropdown
>
...
...
src/components/HeaderSearch/index.js
View file @
e0cf86a3
...
@@ -75,10 +75,10 @@ export default class HeaderSearch extends PureComponent {
...
@@ -75,10 +75,10 @@ export default class HeaderSearch extends PureComponent {
onChange
=
{
this
.
onChange
}
onChange
=
{
this
.
onChange
}
>
>
<
Input
<
Input
placeholder
=
{
placeholder
}
ref
=
{
node
=>
{
ref
=
{
node
=>
{
this
.
input
=
node
;
this
.
input
=
node
;
}}
}}
placeholder
=
{
placeholder
}
onKeyDown
=
{
this
.
onKeyDown
}
onKeyDown
=
{
this
.
onKeyDown
}
onBlur
=
{
this
.
leaveSearchMode
}
onBlur
=
{
this
.
leaveSearchMode
}
/
>
/
>
...
...
src/components/SettingDarwer/index.js
View file @
e0cf86a3
...
@@ -21,10 +21,13 @@ const Body = ({ children, title, style }) => (
...
@@ -21,10 +21,13 @@ const Body = ({ children, title, style }) => (
@
connect
(({
setting
})
=>
({
setting
}))
@
connect
(({
setting
})
=>
({
setting
}))
class
SettingDarwer
extends
PureComponent
{
class
SettingDarwer
extends
PureComponent
{
componentDidMount
()
{
componentDidMount
()
{
const
{
themeColor
}
=
this
.
props
.
setting
;
const
{
themeColor
,
colorWeak
}
=
this
.
props
.
setting
;
if
(
themeColor
!==
'
#1890FF
'
)
{
if
(
themeColor
!==
'
#1890FF
'
)
{
this
.
colorChange
(
themeColor
);
this
.
colorChange
(
themeColor
);
}
}
if
(
colorWeak
===
'
open
'
)
{
document
.
body
.
className
=
'
colorWeak
'
;
}
}
}
getLayOutSetting
=
()
=>
{
getLayOutSetting
=
()
=>
{
const
{
grid
,
fixedHeader
,
autoHideHeader
,
fixSiderbar
}
=
this
.
props
.
setting
;
const
{
grid
,
fixedHeader
,
autoHideHeader
,
fixSiderbar
}
=
this
.
props
.
setting
;
...
@@ -85,6 +88,13 @@ class SettingDarwer extends PureComponent {
...
@@ -85,6 +88,13 @@ class SettingDarwer extends PureComponent {
nextState
.
grid
=
'
Fluid
'
;
nextState
.
grid
=
'
Fluid
'
;
}
}
}
}
if
(
key
===
'
colorWeak
'
)
{
if
(
value
===
'
open
'
)
{
document
.
body
.
className
=
'
colorWeak
'
;
}
else
{
document
.
body
.
className
=
''
;
}
}
this
.
setState
(
nextState
,
()
=>
{
this
.
setState
(
nextState
,
()
=>
{
this
.
props
.
dispatch
({
this
.
props
.
dispatch
({
type
:
'
setting/changeSetting
'
,
type
:
'
setting/changeSetting
'
,
...
@@ -112,7 +122,7 @@ class SettingDarwer extends PureComponent {
...
@@ -112,7 +122,7 @@ class SettingDarwer extends PureComponent {
},
200
);
},
200
);
};
};
render
()
{
render
()
{
const
{
collapse
,
silderTheme
,
themeColor
,
layout
}
=
this
.
props
.
setting
;
const
{
collapse
,
silderTheme
,
themeColor
,
layout
,
colorWeak
}
=
this
.
props
.
setting
;
return
(
return
(
<
div
className
=
{
styles
.
settingDarwer
}
>
<
div
className
=
{
styles
.
settingDarwer
}
>
<
div
className
=
{
styles
.
mini_bar
}
onClick
=
{
this
.
togglerContent
}
>
<
div
className
=
{
styles
.
mini_bar
}
onClick
=
{
this
.
togglerContent
}
>
...
@@ -177,6 +187,26 @@ class SettingDarwer extends PureComponent {
...
@@ -177,6 +187,26 @@ class SettingDarwer extends PureComponent {
dataSource
=
{
this
.
getLayOutSetting
()}
dataSource
=
{
this
.
getLayOutSetting
()}
renderItem
=
{
item
=>
<
List
.
Item
actions
=
{
item
.
action
}
>
{
item
.
title
}
<
/List.Item>
}
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
>
<
/div
>
<
/DrawerMenu
>
<
/DrawerMenu
>
<
/div
>
<
/div
>
...
...
src/index.less
View file @
e0cf86a3
...
@@ -5,6 +5,10 @@ body,
...
@@ -5,6 +5,10 @@ body,
overflow: auto;
overflow: auto;
}
}
:global(.colorWeak) {
filter: invert(80%);
}
:global(.ant-layout) {
:global(.ant-layout) {
min-height: 100%;
min-height: 100%;
}
}
...
...
src/routes/Forms/AdvancedForm.js
View file @
e0cf86a3
...
@@ -62,7 +62,7 @@ class AdvancedForm extends PureComponent {
...
@@ -62,7 +62,7 @@ class AdvancedForm extends PureComponent {
width
:
'
100%
'
,
width
:
'
100%
'
,
};
};
componentDidMount
()
{
componentDidMount
()
{
window
.
addEventListener
(
'
resize
'
,
this
.
resizeFooterToolbar
);
window
.
addEventListener
(
'
resize
'
,
this
.
resizeFooterToolbar
,
{
passive
:
true
}
);
}
}
componentWillUnmount
()
{
componentWillUnmount
()
{
window
.
removeEventListener
(
'
resize
'
,
this
.
resizeFooterToolbar
);
window
.
removeEventListener
(
'
resize
'
,
this
.
resizeFooterToolbar
);
...
...
src/routes/Profile/AdvancedProfile.js
View file @
e0cf86a3
...
@@ -197,7 +197,7 @@ export default class AdvancedProfile extends Component {
...
@@ -197,7 +197,7 @@ export default class AdvancedProfile extends Component {
});
});
this
.
setStepDirection
();
this
.
setStepDirection
();
window
.
addEventListener
(
'
resize
'
,
this
.
setStepDirection
);
window
.
addEventListener
(
'
resize
'
,
this
.
setStepDirection
,
{
passive
:
true
}
);
}
}
componentWillUnmount
()
{
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