dev_hjm_a
hjm 5 years ago
parent 31d5e0ccc2
commit e67b8e3404

@ -8,15 +8,21 @@ class WordsBtn extends Component {
} }
render() { render() {
let{to, href,targets}=this.props let{to, href,targets, style2 }=this.props
return( return(
<React.Fragment> <React.Fragment>
{ {
to==undefined&&targets==undefined ? to==undefined&&targets==undefined ?
<a href={href || "javascript:void(0)"} onClick={this.props.onClick} className={"btn "+`${map[this.props.style]} ${this.props.className}`}>{this.props.children}</a>: <a href={href || "javascript:void(0)"} onClick={this.props.onClick} className={"btn "+`${map[this.props.style]} ${this.props.className}`}
targets!=undefined? <a href={to} target="_blank" className={"btn "+`${map[this.props.style]} ${this.props.className}`}>{this.props.children}</a> style={style2}
>{this.props.children}</a>:
targets!=undefined? <a href={to} target="_blank" className={"btn "+`${map[this.props.style]} ${this.props.className}`}
style={style2}
>{this.props.children}</a>
: :
<Link to={to} className={"btn "+`${map[this.props.style]} ${this.props.className}`}>{this.props.children}</Link> <Link to={to} className={"btn "+`${map[this.props.style]} ${this.props.className}`}
style={style2}
>{this.props.children}</Link>
} }
</React.Fragment> </React.Fragment>
) )

@ -117,7 +117,7 @@ function buildColumns(that) {
const hasGraduationModule = that.hasGraduationModule() const hasGraduationModule = that.hasGraduationModule()
if (hasGraduationModule && showSorter) { if (hasGraduationModule && showSorter) {
columns.push({ columns.push({
title: '答辩组', title: '所在答辩组',
// width: 90, // width: 90,
sorter: showSorter, sorter: showSorter,
sortDirections: sortDirections, sortDirections: sortDirections,
@ -141,6 +141,9 @@ function buildColumns(that) {
width: 150, width: 150,
align:'center', align:'center',
render: (text, record) => { render: (text, record) => {
const isAdmin = record.role == ROLE_ADMIN
const isTeacher = record.role == ROLE_TEACHER
const isAssitant = record.role == ROLE_TEACHER_ASSISTANT
if (record.application_id) { if (record.application_id) {
return ( return (
<span> <span>
@ -151,19 +154,19 @@ function buildColumns(that) {
} else { } else {
return ( return (
<React.Fragment> <React.Fragment>
<WordsBtn>删除</WordsBtn> <WordsBtn style2={{ marginRight: '12px' }} onClick={() => that.onDelete(record)} style={'grey'}>删除</WordsBtn>
<Popconfirm <Popconfirm
placement="right" placement="bottom"
icon={null} icon={null}
title={ title={
<React.Fragment> <React.Fragment>
<Checkbox >管理员</Checkbox> <Checkbox disable={isAdmin}>管理员</Checkbox>
<Checkbox >助教</Checkbox> <Checkbox disable={isAdmin}>助教</Checkbox>
<Checkbox >学生</Checkbox> <Checkbox >学生</Checkbox>
</React.Fragment> </React.Fragment>
} }
> >
<WordsBtn>修改角色</WordsBtn> <WordsBtn style={'blue'}>修改角色</WordsBtn>
</Popconfirm> </Popconfirm>
</React.Fragment> </React.Fragment>

Loading…
Cancel
Save