Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
C
console
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
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
MyCard
console
Commits
c589b9f6
Commit
c589b9f6
authored
Apr 24, 2017
by
nano
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
init
parent
91e80f3a
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
190 additions
and
113 deletions
+190
-113
.idea/workspace.xml
.idea/workspace.xml
+116
-56
src/models/Common.js
src/models/Common.js
+0
-3
src/routes/Apps.js
src/routes/Apps.js
+51
-42
src/routes/Entry.js
src/routes/Entry.js
+23
-12
No files found.
.idea/workspace.xml
View file @
c589b9f6
This diff is collapsed.
Click to expand it.
src/models/Common.js
View file @
c589b9f6
...
@@ -35,9 +35,6 @@ export default {
...
@@ -35,9 +35,6 @@ export default {
subscriptions
:
{
subscriptions
:
{
setup
({
dispatch
,
history
})
{
setup
({
dispatch
,
history
})
{
if
(
location
.
pathname
!=
'
/loginCallback
'
)
{
dispatch
({
type
:
'
init
'
})
}
return
history
.
listen
(({
pathname
,
query
})
=>
{
return
history
.
listen
(({
pathname
,
query
})
=>
{
if
(
pathname
===
'
/login
'
)
{
if
(
pathname
===
'
/login
'
)
{
let
params
=
new
URLSearchParams
()
let
params
=
new
URLSearchParams
()
...
...
src/routes/Apps.js
View file @
c589b9f6
import
React
from
'
react
'
;
import
React
from
"
react
"
;
import
{
connect
}
from
'
dva
'
;
import
{
connect
}
from
"
dva
"
;
import
styles
from
'
./Apps.less
'
;
import
styles
from
"
./Apps.less
"
;
import
{
Link
}
from
'
dva/router
'
;
import
{
Link
}
from
"
dva/router
"
;
import
{
Button
,
Affix
,
Icon
,
Table
,
Tag
}
from
'
antd
'
import
{
Affix
,
Button
,
Icon
,
Table
}
from
"
antd
"
;
import
Create
from
'
../components/App/Create
'
import
Create
from
"
../components/App/Create
"
;
const
columns
=
[
const
columns
=
[
...
@@ -18,20 +18,20 @@ const columns = [
...
@@ -18,20 +18,20 @@ const columns = [
dataIndex
:
'
name
'
,
dataIndex
:
'
name
'
,
render
:
name
=>
name
&&
name
[
"
zh-CN
"
],
render
:
name
=>
name
&&
name
[
"
zh-CN
"
],
width
:
'
10%
'
,
width
:
'
10%
'
,
},{
},
{
title
:
"
author
"
,
title
:
"
author
"
,
dataIndex
:
'
author
'
,
dataIndex
:
'
author
'
,
width
:
'
10%
'
,
width
:
'
10%
'
,
},{
},
{
title
:
"
category
"
,
title
:
"
category
"
,
dataIndex
:
'
category
'
,
dataIndex
:
'
category
'
,
width
:
'
10%
'
,
width
:
'
10%
'
,
},{
},
{
title
:
"
homepage
"
,
title
:
"
homepage
"
,
dataIndex
:
'
homepage
'
,
dataIndex
:
'
homepage
'
,
render
:
homepage
=>
<
a
href
=
{
homepage
}
target
=
"
_blank
"
>
{
homepage
}
<
/a>
,
render
:
homepage
=>
<
a
href
=
{
homepage
}
target
=
"
_blank
"
>
{
homepage
}
<
/a>
,
width
:
'
10%
'
,
width
:
'
10%
'
,
},{
},
{
title
:
"
released_at
"
,
title
:
"
released_at
"
,
dataIndex
:
'
released_at
'
,
dataIndex
:
'
released_at
'
,
sorter
:
true
,
sorter
:
true
,
...
@@ -44,50 +44,59 @@ const columns = [
...
@@ -44,50 +44,59 @@ const columns = [
},
},
]
]
function
Apps
({
children
,
dispatch
,
isCreate
,
isSubmit
,
apps
})
{
class
Apps
extends
React
.
Component
{
const
CreateProps
=
{
componentWillMount
()
{
visible
:
isCreate
,
const
{
dispatch
}
=
this
.
props
isLoading
:
isSubmit
,
console
.
log
(
this
.
props
)
onCancel
:
()
=>
dispatch
({
type
:
'
App/onCancel
'
}),
onCreate
:
()
=>
dispatch
({
type
:
'
App/onCreate
'
}),
onSubmit
:
(
payload
)
=>
dispatch
({
type
:
'
App/create
'
,
payload
}),
}
}
const
CreateButtonProps
=
{
render
()
{
onClick
:
()
=>
dispatch
({
type
:
'
App/onCreate
'
}),
const
{
children
,
dispatch
,
isCreate
,
isSubmit
,
apps
}
=
this
.
props
className
:
styles
.
CreateBtn
,
shape
:
"
circle
"
,
type
:
"
primary
"
,
size
:
"
large
"
,
}
const
TableProps
=
{
const
CreateProps
=
{
rowKey
:
row
=>
row
.
id
,
visible
:
isCreate
,
columns
,
isLoading
:
isSubmit
,
dataSource
:
Object
.
values
(
apps
)
onCancel
:
()
=>
dispatch
({
type
:
'
App/onCancel
'
}),
}
onCreate
:
()
=>
dispatch
({
type
:
'
App/onCreate
'
}),
onSubmit
:
(
payload
)
=>
dispatch
({
type
:
'
App/create
'
,
payload
}),
}
const
CreateButtonProps
=
{
onClick
:
()
=>
dispatch
({
type
:
'
App/onCreate
'
}),
className
:
styles
.
CreateBtn
,
shape
:
"
circle
"
,
type
:
"
primary
"
,
size
:
"
large
"
,
}
return
(
const
TableProps
=
{
<
div
className
=
{
styles
.
normal
}
>
rowKey
:
row
=>
row
.
id
,
columns
,
dataSource
:
Object
.
values
(
apps
)
}
<
Table
{...
TableProps
}
/
>
return
(
<
div
className
=
{
styles
.
normal
}
>
<
Affix
style
=
{{
position
:
'
absolute
'
,
bottom
:
50
,
right
:
50
}}
>
<
Table
{...
TableProps
}
/
>
<
Button
{...
CreateButtonProps
}
>
<
Icon
type
=
"
plus
"
/>
<
/Button
>
<
/Affix
>
<
Create
{...
CreateProps
}
/
>
<
Affix
style
=
{{
position
:
'
absolute
'
,
bottom
:
50
,
right
:
50
}}
>
<
/div
>
<
Button
{...
CreateButtonProps
}
>
);
<
Icon
type
=
"
plus
"
/>
<
/Button
>
<
/Affix
>
<
Create
{...
CreateProps
}
/
>
<
/div
>
);
}
}
}
function
mapStateToProps
(
state
)
{
function
mapStateToProps
(
state
)
{
const
{
const
{
Apps
:
{
apps
},
Apps
:
{
apps
},
App
:
{
isCreate
,
isSubmit
},
App
:
{
isCreate
,
isSubmit
},
}
=
state
}
=
state
return
{
return
{
apps
,
apps
,
...
...
src/routes/Entry.js
View file @
c589b9f6
import
React
from
'
react
'
;
import
React
from
"
react
"
;
import
{
connect
}
from
'
dva
'
;
import
{
connect
}
from
"
dva
"
;
import
Nav
from
'
../components/Common/Nav
'
import
Nav
from
"
../components/Common/Nav
"
;
import
{
Layout
}
from
'
antd
'
import
{
Layout
}
from
"
antd
"
;
function
Entry
({
children
})
{
class
Entry
extends
React
.
Component
{
return
(
<
Layout
style
=
{{
flexDirection
:
'
row
'
,
minHeight
:
'
100%
'
}}
>
componentWillMount
()
{
<
Nav
/>
const
{
dispatch
,
location
:{
pathname
}}
=
this
.
props
<
Layout
style
=
{{
minHeight
:
'
400px
'
}}
>
if
(
pathname
!==
'
loginCallback
'
)
{
{
children
}
dispatch
({
type
:
'
Common/init
'
})
}
}
render
()
{
const
{
children
}
=
this
.
props
return
(
<
Layout
style
=
{{
flexDirection
:
'
row
'
,
minHeight
:
'
100%
'
}}
>
<
Nav
/>
<
Layout
style
=
{{
minHeight
:
'
400px
'
}}
>
{
children
}
<
/Layout
>
<
/Layout
>
<
/Layout
>
<
/Layout
>
);
);
}
}
}
function
mapStateToProps
(
state
)
{
function
mapStateToProps
(
state
)
{
...
...
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