dev_static
杨树明 5 years ago
parent ade1dd7334
commit a2219e2aca

@ -109,19 +109,21 @@ class NewWorkForm extends Component{
// 输入title
changeTitle=(e)=>{
console.log(e.target.value.length);
this.setState({
title_num: parseInt(e.target.value.length)
})
}
handleSubmit = () => {
const courseId = this.state.course_id || this.props.match.params.coursesId ;
this.props.form.validateFieldsAndScroll((err, values) => {
if(err && err.personNum) delete err.personNum;
console.log(values)
const mdContnet = this.contentMdRef.current.getValue().trim();
console.log(mdContnet)
values.description = mdContnet;
// return;
@ -133,15 +135,19 @@ class NewWorkForm extends Component{
if (isGroup) {
if (!min_num) {
this.props.showNotification('最小人数不能为空');
this.props.scrollToAnchor("numberofgroups");
return;
} else if (min_num < 1) {
this.props.showNotification('最小人数不能小于1');
this.props.scrollToAnchor("numberofgroups");
return;
} else if (!max_num) {
this.props.showNotification('最大人数不能为空');
this.props.scrollToAnchor("numberofgroups");
return;
} else if (max_num < min_num) {
this.props.showNotification('最大人数不能小于最小人数');
this.props.scrollToAnchor("numberofgroups");
return;
}
@ -254,7 +260,7 @@ class NewWorkForm extends Component{
if (response.data) {
const { status } = response.data;
if (status == 0) {
console.log('--- success')
this.setState((state) => {
const index = state[stateName].indexOf(file);
@ -272,16 +278,16 @@ class NewWorkForm extends Component{
});
}
max_num_change = (val) => {
if (val < 2) {
// this.setState({
// max_num: 2,
// })
return;
}
// if (val < 2) {
// // this.setState({
// // max_num: 2,
// // })
// return;
// }
const { min_num } = this.state;
this.setState({
max_num: val,
min_num: val <= min_num ? val - 1 : min_num
// min_num: val <= min_num ? val - 1 : min_num
})
}
personNumValidator = (rule, value, callback) => {
@ -337,7 +343,7 @@ class NewWorkForm extends Component{
onChange: this.handleContentUploadChange,
onRemove: (file) => this.onAttachmentRemove(file, 'contentFileList'),
beforeUpload: (file) => {
console.log('beforeUpload', file.name);
const isLt150M = file.size / 1024 / 1024 < 150;
if (!isLt150M) {
this.props.showNotification('文件大小必须小于150MB!');
@ -356,7 +362,7 @@ class NewWorkForm extends Component{
onChange: this.handleAnswerUploadChange,
onRemove: (file) => this.onAttachmentRemove(file, 'answerFileList'),
beforeUpload: (file) => {
console.log('beforeUpload', file.name);
const isLt150M = file.size / 1024 / 1024 < 150;
if (!isLt150M) {
this.props.showNotification('文件大小必须小于150MB!');
@ -461,7 +467,7 @@ class NewWorkForm extends Component{
</Button>
(单个文件150M以内)
</Upload>
<span id={"numberofgroups"}></span>
{ isGroup &&
<Form.Item
@ -477,7 +483,7 @@ class NewWorkForm extends Component{
// required: true, message: '请输入最小人数和最大人数'
// }],
})(
<div>
<div >
<p className="clearfix">
<ConditionToolTip condition={has_commit} title={'已有提交作品,人数范围只能扩大'}>
{/* max={has_commit ? init_min_num : null } */}
@ -508,6 +514,7 @@ class NewWorkForm extends Component{
</Form.Item>
}
<div className="edu-back-white">
<Form.Item
label="参考答案"

@ -374,7 +374,7 @@ class GraduationTaskssettingapp extends Component{
funcrosscomment=(e)=>{
let {latetime,end_time,allowlate,commenttime,commenttimeone}=this.state;
let commenttimetype=commenttime===null||commenttime==="";
debugger
let newlatetimea=moment(new Date()).add(7, 'days').format("YYYY-MM-DD HH:mm");
let newcommenttimea=moment(new Date()).format("YYYY-MM-DD HH:mm");
@ -388,7 +388,7 @@ debugger
let newcommenttimed=moment(end_time).add(8, 'days').format("YYYY-MM-DD HH:mm");
if(e.target.checked===true){
debugger
if(allowlate===1||allowlate===true){
if(latetime===null||latetime===""){

@ -111,8 +111,10 @@ class PollDetailTabForth extends Component{
}
// 已有设置数据的查询
getSettingInfo=()=>{
this.props.newgetPollInfo();
getSettingInfo=(type)=>{
if(type!=1){
this.props.newgetPollInfo();
}
let pollId=this.props.match.params.pollId;
let url=`/polls/${pollId}/poll_setting.json`;
axios.get(url).then((result)=>{
@ -254,7 +256,7 @@ class PollDetailTabForth extends Component{
this.commitSetting((result)=>{
if(result.status==200){
this.props.showNotification(`${result.data.message}`);
this.getSettingInfo();
this.getSettingInfo(1);
this.setState({
flagPageEdit:false
})
@ -275,7 +277,7 @@ class PollDetailTabForth extends Component{
this.commitSetting((result)=>{
if(result.status==200){
this.props.showNotification(`${result.data.message}`);
this.getSettingInfo();
this.getSettingInfo(1);
this.setState({
flagPageEdit:false
})
@ -453,7 +455,7 @@ class PollDetailTabForth extends Component{
this.setState({
flagPageEdit:false
})
this.getSettingInfo();
this.getSettingInfo(1);
}

Loading…
Cancel
Save