chromesetting
tangjiang 5 years ago
parent 531064d9e7
commit ae4a4a2f99

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

@ -4,7 +4,7 @@
* @Github: * @Github:
* @Date: 2019-11-23 10:53:19 * @Date: 2019-11-23 10:53:19
* @LastEditors: tangjiang * @LastEditors: tangjiang
* @LastEditTime: 2019-12-10 19:16:18 * @LastEditTime: 2019-12-11 17:35:49
*/ */
import './index.scss'; import './index.scss';
import React, { useEffect } from 'react'; import React, { useEffect } from 'react';
@ -70,7 +70,7 @@ const StudentStudy = (props) => {
</div> </div>
<div className={'study_quit'}> <div className={'study_quit'}>
{/* to={`/problems/${_hack_id}/edit`} */} {/* to={`/problems/${_hack_id}/edit`} */}
<span onClick={handleClickEditor} className="quit-btn"> <span onClick={handleClickEditor} className={`quit-btn`}>
<Icon type="form" className="quit-icon"/> 编辑 <Icon type="form" className="quit-icon"/> 编辑
</span> </span>
{/* to="/problems" */} {/* to="/problems" */}

Loading…
Cancel
Save