File tree Expand file tree Collapse file tree
pages/dashboard/components Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -112,7 +112,7 @@ class SiderMenu extends PureComponent {
112112 mode = "inline"
113113 theme = { theme }
114114 onOpenChange = { this . onOpenChange }
115- inlineCollapsed = { collapsed }
115+ collapsed = { String ( collapsed ) }
116116 selectedKeys = { selectedKeys }
117117 onClick = {
118118 isMobile
Original file line number Diff line number Diff line change @@ -40,7 +40,7 @@ class Sider extends PureComponent {
4040
4141 < div className = { styles . menuContainer } >
4242 < ScrollBar
43- option = { {
43+ options = { {
4444 // Disabled horizontal scrolling, https://github.com/utatti/perfect-scrollbar#options
4545 suppressScrollX : true ,
4646 } }
Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ import { message } from 'antd'
77import { ROLE_TYPE } from 'utils/constant'
88import { queryLayout , pathMatchRegexp } from 'utils'
99import { CANCEL_REQUEST_MESSAGE , USER_PERMISSION } from 'utils/constant'
10- import { find } from 'lodash'
10+ import { find , unionBy } from 'lodash'
1111import routes from 'utils/routes'
1212import api from 'api'
1313import config from 'config'
@@ -36,15 +36,7 @@ export default {
3636 permissions : {
3737 visit : [ ] ,
3838 } ,
39- routeList : [
40- {
41- id : '1' ,
42- icon : 'laptop' ,
43- name : 'Dashboard' ,
44- zhName : '仪表盘' ,
45- router : '/dashboard' ,
46- } ,
47- ] ,
39+ routeList : routes ,
4840 locationPathname : '' ,
4941 locationQuery : { } ,
5042 notifications : [
@@ -255,10 +247,12 @@ export default {
255247
256248 yield put ( { type : 'updateRoutes' , payload : { append : routesToAppend } } )
257249 } ,
258- * updateRoutes ( { payload } , { put } ) {
259- let routeList = routes
250+ * updateRoutes ( { payload } , { put, select } ) {
251+ const _app = yield select ( _ => _ . app )
252+ let routeList = _app . routeList
253+
260254 if ( payload && payload . append ) {
261- routeList = routeList . concat ( payload . append )
255+ routeList = unionBy ( routeList , payload . append , 'id' )
262256 }
263257
264258 let permissions = USER_PERMISSION . DEVELOPER
Original file line number Diff line number Diff line change @@ -71,17 +71,24 @@ class TaskList extends PureComponent {
7171 {
7272 title : 'Created' ,
7373 dataIndex : 'created' ,
74- render : text => moment ( text ) . format ( 'MM-DD HH:mm:ss' ) ,
74+ render : text => {
75+ let d = new Date ( text )
76+ return moment ( d ) . format ( 'MM-DD HH:mm:ss' )
77+ } ,
7578 } ,
7679 {
7780 title : 'Finished' ,
7881 dataIndex : 'finished' ,
79- render : text =>
80- text
81- ? moment ( text )
82- . startOf ( 'second' )
83- . fromNow ( )
84- : '-' ,
82+ render : text => {
83+ if ( text ) {
84+ let d = new Date ( text )
85+ return moment ( d )
86+ . startOf ( 'second' )
87+ . fromNow ( )
88+ } else {
89+ return '-'
90+ }
91+ } ,
8592 } ,
8693 {
8794 title : 'Details' ,
You can’t perform that action at this time.
0 commit comments