hjm 6 years ago
parent b66f5a67ad
commit e1c730d1e3

@ -33,6 +33,7 @@ class commonWork extends Component{
modalsBottomval:"", modalsBottomval:"",
modalCancel:"", modalCancel:"",
mainList:undefined, mainList:undefined,
selectedKeys: 'all',
order:"", order:"",
page:1, page:1,
search:"", search:"",
@ -77,7 +78,9 @@ class commonWork extends Component{
componentDidUpdate(prevProps, prevState) { componentDidUpdate(prevProps, prevState) {
if (prevProps.match.path != this.props.match.path) { if (prevProps.match.path != this.props.match.path) {
this.clearSelection() this.clearSelection()
this.setState({ selectedKeys: 'all', order: '' }, () => {
this._getList() this._getList()
})
} }
} }
@ -143,6 +146,7 @@ class commonWork extends Component{
this.clearSelection() this.clearSelection()
this.setState({ this.setState({
order:e.key==="all"?"":e.key, order:e.key==="all"?"":e.key,
selectedKeys: e.key,
page:1, page:1,
isSpin:true, isSpin:true,
checkBoxValues:[], checkBoxValues:[],
@ -403,7 +407,7 @@ class commonWork extends Component{
} }
secondRowBotton={ secondRowBotton={
<div className="fl mt6 task_menu_ul"> <div className="fl mt6 task_menu_ul">
<Menu mode="horizontal" defaultSelectedKeys="all" onClick={this.selectedStatus}> <Menu mode="horizontal" selectedKeys={this.state.selectedKeys} onClick={this.selectedStatus}>
<Menu.Item key="all">全部</Menu.Item> <Menu.Item key="all">全部</Menu.Item>
{isAdmin && <Menu.Item key="0">未发布</Menu.Item>} {isAdmin && <Menu.Item key="0">未发布</Menu.Item>}
<Menu.Item key="1">提交中</Menu.Item> <Menu.Item key="1">提交中</Menu.Item>

Loading…
Cancel
Save