Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
ethan
/
ant-admin-pro
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
Commit 877cada6
authored
2018-03-20 16:39:53 +0800
by
ethanlamzs
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
加入直接显示结果功能
1 parent
819269f4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
85 additions
and
27 deletions
src/common/menu.js
src/models/fb.js
src/routes/fb/teams.js
src/services/fb.js
src/common/menu.js
View file @
877cada
...
...
@@ -4,7 +4,7 @@ const menuData = [{
name
:
'dashboard'
,
icon
:
'dashboard'
,
path
:
'dashboard'
,
hideInMenu
:
tru
e
,
hideInMenu
:
fals
e
,
children
:
[{
name
:
'分析页'
,
path
:
'analysis'
,
...
...
@@ -14,7 +14,7 @@ const menuData = [{
},
{
name
:
'工作台'
,
path
:
'workplace'
,
hideInMenu
:
tru
e
,
hideInMenu
:
fals
e
,
}],
},
{
name
:
'表单页'
,
...
...
@@ -31,12 +31,12 @@ const menuData = [{
authority
:
'admin'
,
path
:
'advanced-form'
,
}],
hideInMenu
:
tru
e
,
hideInMenu
:
fals
e
,
},
{
name
:
'列表页'
,
icon
:
'table'
,
path
:
'list'
,
hideInMenu
:
tru
e
,
hideInMenu
:
fals
e
,
children
:
[{
name
:
'查询表格'
,
path
:
'table-list'
,
...
...
@@ -72,7 +72,7 @@ const menuData = [{
path
:
'advanced'
,
authority
:
'admin'
,
}],
hideInMenu
:
tru
e
,
hideInMenu
:
fals
e
,
},
{
name
:
'结果页'
,
icon
:
'check-circle-o'
,
...
...
@@ -84,7 +84,7 @@ const menuData = [{
name
:
'失败'
,
path
:
'fail'
,
}],
hideInMenu
:
tru
e
,
hideInMenu
:
fals
e
,
},
{
name
:
'异常页'
,
icon
:
'warning'
,
...
...
src/models/fb.js
View file @
877cada
import
{
qryTeams
,
qrySeasons
}
from
'../services/fb'
import
{
qryTeams
,
qrySeasons
,
genAnalyse
}
from
'../services/fb'
export
default
{
...
...
@@ -10,7 +12,8 @@ export default{
teams
:{
pagination
:{},
list
:[]
}
},
analyse_out
:{},
},
...
...
@@ -31,6 +34,16 @@ export default{
});
},
*
analyse
({
payload
,
callback
},{
call
,
put
}){
const
response
=
yield
call
(
genAnalyse
,
payload
);
yield
put
({
type
:
'genAnalyse'
,
payload
:
response
,
});
if
(
callback
)
callback
(
response
);
},
},
...
...
@@ -48,6 +61,13 @@ export default{
teams
:
action
.
payload
,
};
},
genAnalyse
(
state
,
action
){
return
{
...
state
,
analyse_out
:
action
.
payload
,
};
},
},
...
...
src/routes/fb/teams.js
View file @
877cada
...
...
@@ -27,6 +27,7 @@ export default class schoollist extends PureComponent {
addInputValue
:
''
,
selectedRows
:
[],
formValues
:
{},
analyse_out
:{},
};
componentDidMount
()
{
...
...
@@ -89,7 +90,37 @@ export default class schoollist extends PureComponent {
}
handleSelectRows
=
(
rows
)
=>
{
console
.
log
(
rows
);
this
.
setState
({
selectedRows
:
rows
});
}
handleModalVisible
=
(
flag
)
=>
{
this
.
setState
({
modalVisible
:
!!
flag
,
});
}
handleAnRun
=
()
=>
{
const
{
selectedRows
}
=
this
.
state
;
let
checkItems
=
[];
let
rowindex
=
null
;
for
(
rowindex
in
selectedRows
){
checkItems
.
push
(
selectedRows
[
rowindex
].
key
);
}
let
teamsStr
=
checkItems
.
join
(
','
);
this
.
props
.
dispatch
({
type
:
'fb/analyse'
,
payload
:
{
teams
:
teamsStr
,
},
callback
:(
response
)
=>
{
this
.
handleModalVisible
(
true
);
this
.
setState
({
analyse_out
:
response
.
pic_path
});
},
});
}
handleSearch
=
(
e
)
=>
{
...
...
@@ -130,7 +161,6 @@ export default class schoollist extends PureComponent {
renderSimpleForm
()
{
const
{
getFieldDecorator
}
=
this
.
props
.
form
;
console
.
log
(
this
.
props
);
const
{
fb
:{
seasons
}}
=
this
.
props
;
let
seasons_SellectOption
=
(
seasons
==
null
||
seasons
==
undefined
)?[]:
seasons
;
return
(
...
...
@@ -152,6 +182,8 @@ export default class schoollist extends PureComponent {
<
/span
>
<
/Col
>
<
/Row
>
<
Row
gutter
=
{{
md
:
8
,
lg
:
24
,
xl
:
48
}}
>
<
/Row>
<
/Form
>
);
}
...
...
@@ -165,9 +197,7 @@ export default class schoollist extends PureComponent {
render
()
{
const
{
fb
:
{
teams
},
loading
}
=
this
.
props
;
const
{
selectedRows
,
modalVisible
,
addInputValue
}
=
this
.
state
;
console
.
log
(
this
.
props
);
const
{
selectedRows
,
modalVisible
,
addInputValue
,
analyse_out
}
=
this
.
state
;
const
columns
=
[
{
...
...
@@ -198,15 +228,8 @@ export default class schoollist extends PureComponent {
];
const
menu
=
(
<
Menu
onClick
=
{
this
.
handleMenuClick
}
selectedKeys
=
{[]}
>
<
Menu
.
Item
key
=
"remove"
>
删除
<
/Menu.Item
>
<
Menu
.
Item
key
=
"approval"
>
批量审批
<
/Menu.Item
>
<
/Menu
>
);
return
(
<
PageHeaderLayout
title
=
"
查询
球队"
>
<
PageHeaderLayout
title
=
"球队"
>
<
Card
bordered
=
{
false
}
>
<
div
className
=
{
styles
.
tableList
}
>
<
div
className
=
{
styles
.
tableListForm
}
>
...
...
@@ -216,12 +239,9 @@ export default class schoollist extends PureComponent {
{
selectedRows
.
length
>
0
&&
(
<
span
>
<
Button
>
批量操作
<
/Button
>
<
Dropdown
overlay
=
{
menu
}
>
<
Button
>
更多操作
<
Icon
type
=
"down"
/>
<
/Button
>
<
/Dropdown
>
<
Button
icon
=
"plus"
type
=
"primary"
onClick
=
{()
=>
this
.
handleAnRun
()}
>
处理
<
/Button
>
<
/span
>
)
}
...
...
@@ -236,7 +256,19 @@ export default class schoollist extends PureComponent {
/
>
<
/div
>
<
/Card
>
<
Modal
title
=
"分析结果"
visible
=
{
modalVisible
}
onOk
=
{()
=>
this
.
handleModalVisible
()}
onCancel
=
{()
=>
this
.
handleModalVisible
()}
>
<
div
>
<
img
src
=
{
analyse_out
}
><
/img
>
<
/div
>
<
/Modal
>
<
/PageHeaderLayout
>
);
}
}
src/services/fb.js
View file @
877cada
...
...
@@ -17,3 +17,9 @@ export async function qryTeams(payload){
return
request
(
'/teams/'
+
payload
.
league_id
+
`?
${
stringify
(
params
)}
`
);
}
export
async
function
genAnalyse
(
params
){
params
=
availToken
(
params
);
return
request
(
'/analyse'
+
`?
${
stringify
(
params
)}
`
);
}
Write
Preview
Styling with
Markdown
is supported
Attach a file
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 post a comment