Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
S
shuniu-admin-react
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
superman
shuniu-admin-react
Commits
40acf81d
Commit
40acf81d
authored
Jul 28, 2016
by
superman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
24349b46
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
452 additions
and
745 deletions
+452
-745
workspace.xml
.idea/workspace.xml
+409
-732
proxy.config.js
proxy.config.js
+2
-2
const.js
src/const.js
+1
-0
AddItem.jsx
src/containers/Announcement/AddItem.jsx
+20
-0
EditItem.jsx
src/containers/Announcement/EditItem.jsx
+7
-4
BaseUpload.jsx
src/containers/BaseFunction/BaseUpload.jsx
+1
-1
Item.jsx
src/containers/Trade/Item.jsx
+1
-1
List.jsx
src/containers/Trade/List.jsx
+1
-1
announcement.js
src/reducers/announcement.js
+9
-4
announcement.js
src/sagas/announcement.js
+1
-0
No files found.
.idea/workspace.xml
View file @
40acf81d
This diff is collapsed.
Click to expand it.
proxy.config.js
View file @
40acf81d
...
...
@@ -2,6 +2,6 @@
// - https://github.com/dora-js/dora-plugin-proxy#规则定义
module
.
exports
=
{
'/api/*'
:
'http://react.yanky.cn/'
,
//
'/api/*': 'http://192.168.1.126:8080/'
//
'/api/*': 'http://react.yanky.cn/',
'/api/*'
:
'http://192.168.1.126:8080/'
};
src/const.js
0 → 100644
View file @
40acf81d
src/containers/Announcement/AddItem.jsx
View file @
40acf81d
...
...
@@ -27,6 +27,7 @@ import {formItemLayout, footerFormSubmitLayout} from '../../utils';
@
connect
(
state
=>
({
loading
:
state
.
announcement
.
loading
,
item
:
state
.
announcement
.
item
}))
@
Form
.
create
()
export
default
class
AddItem
extends
Component
{
...
...
@@ -34,6 +35,25 @@ export default class AddItem extends Component {
super
(
props
,
content
);
}
componentDidMount
(){
const
{
item
}
=
this
.
props
;
if
(
item
&&
item
.
id
)
{
this
.
props
.
dispatch
({
type
:
'INIT_ANNOUNCEMENT'
});
}
}
componentWillReceiveProps
(
nextProps
)
{
const
{
item
}
=
nextProps
;
if
(
item
&&
item
.
id
)
{
this
.
props
.
history
.
push
(
'/announcement/'
+
item
.
id
);
this
.
props
.
dispatch
({
type
:
'INIT_ANNOUNCEMENT'
});
}
}
handleSubmit
(
e
)
{
e
.
preventDefault
();
const
data
=
this
.
props
.
form
.
getFieldsValue
();
...
...
src/containers/Announcement/EditItem.jsx
View file @
40acf81d
...
...
@@ -43,8 +43,8 @@ export default class EditItem extends Component {
this
.
fetchItem
(
this
.
props
.
params
.
id
);
};
componentWillReceiveProps
(
nextProps
){
componentWillReceiveProps
(
nextProps
)
{
}
fetchItem
(
id
)
{
...
...
@@ -121,14 +121,17 @@ export default class EditItem extends Component {
{
...
getFieldProps
('
announcement
',
{
initialValue
:
item
.
announcement
})}
/>
:
item
.
announcement
:
<
p
style=
{
{
maxWidth
:
500
}
}
>
{
item
.
announcement
}
</
p
>
}
</
Form
.
Item
>
<
Form
.
Item
{
...
footerFormSubmitLayout
}
style=
{
{
marginTop
:
30
}
}
>
{
isEdit
?
<
Button
type=
"primary"
htmlType=
"submit"
loading=
{
loading
}
>
<
Icon
type=
"save"
/>
修改
<
Icon
type=
"save"
/>
保存
</
Button
>
:
<
Button
type=
"primary"
...
...
src/containers/BaseFunction/BaseUpload.jsx
View file @
40acf81d
...
...
@@ -50,7 +50,7 @@ export default class BaseUpload extends Component {
return
(
<
Layout
header=
{
header
}
>
<
Row
>
<
Row
style=
{
{
padding
:
'20px 20px 20px'
}
}
>
<
Col
span=
"24"
>
<
Upload
.
Dragger
action=
"/api/fileUpload/upload"
multiple=
{
true
}
...
...
src/containers/Trade/Item.jsx
View file @
40acf81d
...
...
@@ -126,7 +126,7 @@ export default class Item extends Component {
</
div
>
<
p
>
{
(
item
.
status
==
11
||
item
.
status
==
21
)
&&
(
item
.
status
==
11
||
item
.
status
==
21
)
&&
(
!
item
.
commissionId
)
&&
<
Link
to=
{
'/trades/commission/'
+
item
.
id
}
><
Button
>
发放佣金
</
Button
></
Link
>
}
<
Link
to=
{
'/trades/contract/'
+
item
.
id
}
><
Button
>
邮寄合同
</
Button
></
Link
>
...
...
src/containers/Trade/List.jsx
View file @
40acf81d
...
...
@@ -65,7 +65,7 @@ const columns = [
<
span
>
<
Link
to=
{
'/trades/contract/'
+
record
.
id
}
onClick=
{
e
=>
e
.
stopPropagation
()
}
>
合同
</
Link
>
{
(
record
.
status
==
11
||
record
.
status
==
21
)
&&
(
record
.
status
==
11
||
record
.
status
==
21
)
&&
(
!
record
.
commissionId
)
&&
<
span
>
<
span
className=
"ant-divider"
></
span
>
<
Link
to=
{
'/trades/commission/'
+
record
.
id
}
onClick=
{
e
=>
e
.
stopPropagation
()
}
>
佣金
</
Link
>
...
...
src/reducers/announcement.js
View file @
40acf81d
import
{
handleActions
}
from
'redux-actions'
;
import
{
combineReducer
}
from
'redux'
;
const
initState
=
{
items
:
[],
loading
:
false
,
};
const
announcement
=
handleActions
({
[
'INIT_ANNOUNCEMENT'
](){
return
initState
;
},
[
'FETCH_ANNOUNCEMENT_LIST'
](
state
)
{
return
{...
state
,
loading
:
true
,};
},
...
...
@@ -38,9 +46,6 @@ const announcement = handleActions({
[
'UPDATE_ANNOUNCEMENT_ITEM_FAILED'
](
state
,
action
){
return
{...
state
,
err
:
action
.
err
,
loading
:
false
}
},
},
{
items
:
[],
loading
:
false
,
});
},
initState
);
export
default
announcement
;
src/sagas/announcement.js
View file @
40acf81d
...
...
@@ -81,6 +81,7 @@ function* watchAdd() {
function
*
editItem
(
data
)
{
try
{
yield
call
(
updateItem
,
data
);
message
.
success
(
'修改成功!'
);
yield
put
({
type
:
'UPDATE_ANNOUNCEMENT_ITEM_SUCCESS'
,
item
:
data
...
...
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