Commit 877cada6 by ethanlamzs

加入直接显示结果功能

1 parent 819269f4
...@@ -4,7 +4,7 @@ const menuData = [{ ...@@ -4,7 +4,7 @@ const menuData = [{
name: 'dashboard', name: 'dashboard',
icon: 'dashboard', icon: 'dashboard',
path: 'dashboard', path: 'dashboard',
hideInMenu: true, hideInMenu: false,
children: [{ children: [{
name: '分析页', name: '分析页',
path: 'analysis', path: 'analysis',
...@@ -14,7 +14,7 @@ const menuData = [{ ...@@ -14,7 +14,7 @@ const menuData = [{
}, { }, {
name: '工作台', name: '工作台',
path: 'workplace', path: 'workplace',
hideInMenu: true, hideInMenu: false,
}], }],
}, { }, {
name: '表单页', name: '表单页',
...@@ -31,12 +31,12 @@ const menuData = [{ ...@@ -31,12 +31,12 @@ const menuData = [{
authority: 'admin', authority: 'admin',
path: 'advanced-form', path: 'advanced-form',
}], }],
hideInMenu: true, hideInMenu: false,
}, { }, {
name: '列表页', name: '列表页',
icon: 'table', icon: 'table',
path: 'list', path: 'list',
hideInMenu: true, hideInMenu: false,
children: [{ children: [{
name: '查询表格', name: '查询表格',
path: 'table-list', path: 'table-list',
...@@ -72,7 +72,7 @@ const menuData = [{ ...@@ -72,7 +72,7 @@ const menuData = [{
path: 'advanced', path: 'advanced',
authority: 'admin', authority: 'admin',
}], }],
hideInMenu: true, hideInMenu: false,
}, { }, {
name: '结果页', name: '结果页',
icon: 'check-circle-o', icon: 'check-circle-o',
...@@ -84,7 +84,7 @@ const menuData = [{ ...@@ -84,7 +84,7 @@ const menuData = [{
name: '失败', name: '失败',
path: 'fail', path: 'fail',
}], }],
hideInMenu: true, hideInMenu: false,
}, { }, {
name: '异常页', name: '异常页',
icon: 'warning', icon: 'warning',
......
import { qryTeams,qrySeasons } from '../services/fb' import { qryTeams,
qrySeasons,
genAnalyse } from '../services/fb'
export default{ export default{
...@@ -10,7 +12,8 @@ export default{ ...@@ -10,7 +12,8 @@ export default{
teams:{ teams:{
pagination:{}, pagination:{},
list:[] list:[]
} },
analyse_out:{},
}, },
...@@ -31,6 +34,16 @@ export default{ ...@@ -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{ ...@@ -48,6 +61,13 @@ export default{
teams:action.payload, teams:action.payload,
}; };
}, },
genAnalyse(state,action){
return {
...state,
analyse_out:action.payload,
};
},
}, },
......
...@@ -27,6 +27,7 @@ export default class schoollist extends PureComponent { ...@@ -27,6 +27,7 @@ export default class schoollist extends PureComponent {
addInputValue: '', addInputValue: '',
selectedRows: [], selectedRows: [],
formValues: {}, formValues: {},
analyse_out:{},
}; };
componentDidMount() { componentDidMount() {
...@@ -89,7 +90,37 @@ export default class schoollist extends PureComponent { ...@@ -89,7 +90,37 @@ export default class schoollist extends PureComponent {
} }
handleSelectRows = (rows) => { 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) => { handleSearch = (e) => {
...@@ -130,7 +161,6 @@ export default class schoollist extends PureComponent { ...@@ -130,7 +161,6 @@ export default class schoollist extends PureComponent {
renderSimpleForm() { renderSimpleForm() {
const { getFieldDecorator } = this.props.form; const { getFieldDecorator } = this.props.form;
console.log(this.props);
const { fb:{seasons}} = this.props; const { fb:{seasons}} = this.props;
let seasons_SellectOption = (seasons==null || seasons==undefined)?[]:seasons; let seasons_SellectOption = (seasons==null || seasons==undefined)?[]:seasons;
return ( return (
...@@ -152,6 +182,8 @@ export default class schoollist extends PureComponent { ...@@ -152,6 +182,8 @@ export default class schoollist extends PureComponent {
</span> </span>
</Col> </Col>
</Row> </Row>
<Row gutter={{ md: 8, lg: 24, xl: 48 }}>
</Row>
</Form> </Form>
); );
} }
...@@ -165,9 +197,7 @@ export default class schoollist extends PureComponent { ...@@ -165,9 +197,7 @@ export default class schoollist extends PureComponent {
render() { render() {
const { fb: {teams}, loading } = this.props; const { fb: {teams}, loading } = this.props;
const { selectedRows, modalVisible, addInputValue } = this.state; const { selectedRows, modalVisible,addInputValue,analyse_out} = this.state;
console.log(this.props);
const columns = [ const columns = [
{ {
...@@ -198,15 +228,8 @@ export default class schoollist extends PureComponent { ...@@ -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 ( return (
<PageHeaderLayout title="查询球队"> <PageHeaderLayout title="球队">
<Card bordered={false}> <Card bordered={false}>
<div className={styles.tableList}> <div className={styles.tableList}>
<div className={styles.tableListForm}> <div className={styles.tableListForm}>
...@@ -216,12 +239,9 @@ export default class schoollist extends PureComponent { ...@@ -216,12 +239,9 @@ export default class schoollist extends PureComponent {
{ {
selectedRows.length > 0 && ( selectedRows.length > 0 && (
<span> <span>
<Button>批量操作</Button> <Button icon="plus" type="primary" onClick={() => this.handleAnRun()}>
<Dropdown overlay={menu}> 处理
<Button> </Button>
更多操作 <Icon type="down" />
</Button>
</Dropdown>
</span> </span>
) )
} }
...@@ -236,7 +256,19 @@ export default class schoollist extends PureComponent { ...@@ -236,7 +256,19 @@ export default class schoollist extends PureComponent {
/> />
</div> </div>
</Card> </Card>
<Modal
title="分析结果"
visible={modalVisible}
onOk={() => this.handleModalVisible()}
onCancel={() => this.handleModalVisible()}
>
<div>
<img src={analyse_out}></img>
</div>
</Modal>
</PageHeaderLayout> </PageHeaderLayout>
); );
} }
} }
...@@ -17,3 +17,9 @@ export async function qryTeams(payload){ ...@@ -17,3 +17,9 @@ export async function qryTeams(payload){
return request('/teams/'+payload.league_id+`?${stringify(params)}`); return request('/teams/'+payload.league_id+`?${stringify(params)}`);
} }
export async function genAnalyse(params){
params = availToken(params);
return request('/analyse'+`?${stringify(params)}`);
}
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!