|
|
|
@ -3,7 +3,7 @@ import React,{ Component } from "react";
|
|
|
|
|
import {
|
|
|
|
|
Form, Input, InputNumber, Switch, Radio,
|
|
|
|
|
Slider, Button, Upload, Icon, Rate, Checkbox, message,
|
|
|
|
|
Row, Col, Select, Modal, Divider
|
|
|
|
|
Row, Col, Select, Modal, Divider,Tooltip
|
|
|
|
|
} from 'antd';
|
|
|
|
|
import TPMMDEditor from '../../tpm/challengesnew/TPMMDEditor';
|
|
|
|
|
import axios from 'axios'
|
|
|
|
@ -29,7 +29,8 @@ class BoardsNew extends Component{
|
|
|
|
|
fileList: [],
|
|
|
|
|
boards: [],
|
|
|
|
|
title_num: 0,
|
|
|
|
|
email_notify:false
|
|
|
|
|
email_notify:false,
|
|
|
|
|
isemail_notify:false
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
addSuccess = () => {
|
|
|
|
@ -98,7 +99,7 @@ class BoardsNew extends Component{
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
this.setState({ fileList: _fileList, board_name: data.board_name, title_num: parseInt(data.subject.length) })
|
|
|
|
|
this.setState({ fileList: _fileList, board_name: data.board_name, title_num: parseInt(data.subject.length) ,isemail_notify:response.data.data.email_notify})
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
@ -136,6 +137,7 @@ class BoardsNew extends Component{
|
|
|
|
|
select_board_id: values.select_board_id,
|
|
|
|
|
content: values.content,
|
|
|
|
|
sticky: values.sticky,
|
|
|
|
|
email_notify:this.state.isemail_notify,
|
|
|
|
|
attachment_ids,
|
|
|
|
|
})
|
|
|
|
|
.then((response) => {
|
|
|
|
@ -160,7 +162,7 @@ class BoardsNew extends Component{
|
|
|
|
|
|
|
|
|
|
axios.post(url, {
|
|
|
|
|
...values,
|
|
|
|
|
email_notify:this.state.email_notify,
|
|
|
|
|
email_notify:this.state.isemail_notify,
|
|
|
|
|
course_id: cid,
|
|
|
|
|
attachment_ids,
|
|
|
|
|
})
|
|
|
|
@ -253,7 +255,7 @@ class BoardsNew extends Component{
|
|
|
|
|
|
|
|
|
|
setemailchange=(e)=>{
|
|
|
|
|
this.setState({
|
|
|
|
|
email_notify:e.target.checked
|
|
|
|
|
isemail_notify:e.target.checked
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
render() {
|
|
|
|
@ -299,6 +301,7 @@ class BoardsNew extends Component{
|
|
|
|
|
const isCourseEnd = this.props.isCourseEnd();
|
|
|
|
|
document.title=this.props.coursedata&&this.props.coursedata.name;
|
|
|
|
|
|
|
|
|
|
// console.log(this.state)
|
|
|
|
|
return(
|
|
|
|
|
<div className="newMain ">
|
|
|
|
|
<AddDirModal {...this.props}
|
|
|
|
@ -338,13 +341,17 @@ class BoardsNew extends Component{
|
|
|
|
|
{/* notRequired */}
|
|
|
|
|
<Form {...formItemLayout} onSubmit={this.handleSubmit}>
|
|
|
|
|
<div className="formBlock" style={{paddingBottom: '0px', position: 'relative'}}>
|
|
|
|
|
{this.state.boardsdata&&this.state.boardsdata.email_notify===true?this.props.isAdminOrTeacher()===true?<Tooltip placement="bottom" title={this.state.isemail_notify?"邮件只能发送一次":""}><span className={"setemail fr mr70 setemailposition"}>
|
|
|
|
|
<Checkbox onChange={this.setemailchange} checked={this.state.isemail_notify} disabled={this.state.isemail_notify}>发送邮件提醒</Checkbox>
|
|
|
|
|
</span></Tooltip>:"":""}
|
|
|
|
|
|
|
|
|
|
{ isAdmin &&
|
|
|
|
|
<React.Fragment>
|
|
|
|
|
{getFieldDecorator('sticky', {
|
|
|
|
|
valuePropName: 'checked',
|
|
|
|
|
})(
|
|
|
|
|
isAdmin && <Checkbox style={{ right: '22px',
|
|
|
|
|
top: '28px',
|
|
|
|
|
top: '17px',
|
|
|
|
|
position: 'absolute'
|
|
|
|
|
}}>置顶</Checkbox>
|
|
|
|
|
)}
|
|
|
|
@ -411,9 +418,7 @@ class BoardsNew extends Component{
|
|
|
|
|
</Select>
|
|
|
|
|
)}
|
|
|
|
|
</Form.Item>
|
|
|
|
|
{this.state.boardsdata&&this.state.boardsdata.email_notify===true?this.props.isAdminOrTeacher()===true?this.isEdit ?"":<span className={"setemail"}>
|
|
|
|
|
<Checkbox onChange={this.setemailchange} checked={this.state.email_notify}>发送邮件提醒</Checkbox>
|
|
|
|
|
</span>:"":""}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
{/* { isAdmin && <Form.Item
|
|
|
|
|