|
|
|
@ -421,6 +421,7 @@ class DeveloperHome extends React.PureComponent {
|
|
|
|
|
// const { testReducer, handleClick } = this.props;
|
|
|
|
|
const {
|
|
|
|
|
ojListReducer: {hacks_list, top_data, hacks_count},
|
|
|
|
|
user,
|
|
|
|
|
pagination
|
|
|
|
|
} = this.props;
|
|
|
|
|
const {passed_count = 0, simple_count = 0, medium_count = 0, diff_count = 0} = top_data;
|
|
|
|
@ -443,7 +444,11 @@ class DeveloperHome extends React.PureComponent {
|
|
|
|
|
>{ctx}</Tag>
|
|
|
|
|
)});
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// console.log('=====>>>>>>>>>.', this.props);
|
|
|
|
|
|
|
|
|
|
const newBtnStyle = user && (user.admin || (user.is_teacher && user.professional_certification) || user.business)
|
|
|
|
|
? { display: 'block'}
|
|
|
|
|
: { display: 'none'};
|
|
|
|
|
return (
|
|
|
|
|
<div className="developer-list">
|
|
|
|
|
<div className="ant-spin-container">
|
|
|
|
@ -457,7 +462,8 @@ class DeveloperHome extends React.PureComponent {
|
|
|
|
|
<MultipTags type="warning" text="中等" numb={medium_count} style={{ marginRight: '20px' }}/>
|
|
|
|
|
<MultipTags type="error" text="困难" numb={diff_count}/>
|
|
|
|
|
</div>
|
|
|
|
|
<Button type="primary" onClick={this.handleClickNew}>新建
|
|
|
|
|
{/* 认证的老师, 超级管理员, 运营人员可见 */}
|
|
|
|
|
<Button style={ newBtnStyle } type="primary" onClick={this.handleClickNew}>新建
|
|
|
|
|
{/* <Link to="/problems/new">新建</Link> */}
|
|
|
|
|
</Button>
|
|
|
|
|
</div>
|
|
|
|
|