check admin

dev_forum
hjm 6 years ago
parent d67952cef2
commit 02faf37431

@ -1,5 +1,5 @@
import React,{ Component } from "react"; import React,{ Component } from "react";
import { Input,Checkbox,Table, Pagination, Modal,Menu ,Spin} from "antd"; import { Input,Checkbox,Table, Pagination, Modal,Menu ,Spin, Tooltip} from "antd";
import ClipboardJS from 'clipboard' import ClipboardJS from 'clipboard'
import '../css/Courses.css' import '../css/Courses.css'
import '../css/members.css' import '../css/members.css'
@ -31,14 +31,6 @@ const dataSource = [{
const buildColumns = (that) => { const buildColumns = (that) => {
const columns=[{ const columns=[{
title: '',
dataIndex: 'check',
key: 'check',
render: (text, item) => {
return <Checkbox value={item.course_member_id}></Checkbox>
},
width:"5%"
},{
title: '序号', title: '序号',
dataIndex: 'id', dataIndex: 'id',
key: 'id', key: 'id',
@ -71,6 +63,19 @@ const buildColumns = (that) => {
width:"50%", width:"50%",
className:"color-grey-6" className:"color-grey-6"
}]; }];
const isAdmin = that.props.isAdmin()
if (isAdmin) {
columns.unshift({
title: '',
dataIndex: 'check',
key: 'check',
render: (text, item) => {
return <Checkbox value={item.course_member_id}></Checkbox>
},
width:"5%"
})
}
return columns; return columns;
} }
@ -445,7 +450,14 @@ class studentsList extends Component{
<span className="color-orange font-16"> <span className="color-orange font-16">
{invite_code} {invite_code}
</span> </span>
<i class="iconfont icon-fuzhi font-14 ml10 copybtn" style={{color: '#FF6800', cursor: 'pointer', verticalAlign: 'baseline'}} data-clipboard-text={invite_code} ></i> <Tooltip title={<div>
<div>成员可以通过邀请码主动加入课堂</div>
<div>点击立刻复制邀请码</div>
</div>}>
<span>
<i class="iconfont icon-fuzhi font-14 ml10 copybtn" style={{color: '#FF6800', cursor: 'pointer', verticalAlign: 'baseline'}} data-clipboard-text={invite_code} ></i>
</span>
</Tooltip>
</React.Fragment> </React.Fragment>
} }
@ -528,7 +540,7 @@ class studentsList extends Component{
total_count > 0 ? total_count > 0 ?
<div className="mt20 edu-back-white padding20"> <div className="mt20 edu-back-white padding20">
<div className="clearfix stu_head" style={{paddingLeft: '15px'}}> <div className="clearfix stu_head" style={{paddingLeft: '15px'}}>
<Checkbox className="fl" onChange={this.onCheckAll} checked={checkAllValue} >已选 {checkBoxValues.length} </Checkbox> {isAdmin && <Checkbox className="fl" onChange={this.onCheckAll} checked={checkAllValue} >已选 {checkBoxValues.length} </Checkbox>}
<div className="studentList_operation_ul"> <div className="studentList_operation_ul">
{isAdmin && <li className="li_line"><a href="javascript:void(0)" className="color-grey-9" onClick={this.onDelete}>删除</a></li>} {isAdmin && <li className="li_line"><a href="javascript:void(0)" className="color-grey-9" onClick={this.onDelete}>删除</a></li>}
{isAdmin && <li className="li_line drop_down"> {isAdmin && <li className="li_line drop_down">

Loading…
Cancel
Save