Commit 877cada6 by ethanlamzs

加入直接显示结果功能

1 parent 819269f4
......@@ -4,7 +4,7 @@ const menuData = [{
name: 'dashboard',
icon: 'dashboard',
path: 'dashboard',
hideInMenu: true,
hideInMenu: false,
children: [{
name: '分析页',
path: 'analysis',
......@@ -14,7 +14,7 @@ const menuData = [{
}, {
name: '工作台',
path: 'workplace',
hideInMenu: true,
hideInMenu: false,
}],
}, {
name: '表单页',
......@@ -31,12 +31,12 @@ const menuData = [{
authority: 'admin',
path: 'advanced-form',
}],
hideInMenu: true,
hideInMenu: false,
}, {
name: '列表页',
icon: 'table',
path: 'list',
hideInMenu: true,
hideInMenu: false,
children: [{
name: '查询表格',
path: 'table-list',
......@@ -72,7 +72,7 @@ const menuData = [{
path: 'advanced',
authority: 'admin',
}],
hideInMenu: true,
hideInMenu: false,
}, {
name: '结果页',
icon: 'check-circle-o',
......@@ -84,7 +84,7 @@ const menuData = [{
name: '失败',
path: 'fail',
}],
hideInMenu: true,
hideInMenu: false,
}, {
name: '异常页',
icon: 'warning',
......
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,
};
},
},
......
......@@ -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>
);
}
}
......@@ -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)}`);
}
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!