diff --git a/public/react/src/modules/courses/busyWork/NewWorkForm.js b/public/react/src/modules/courses/busyWork/NewWorkForm.js index 1ae588db2..33d6e4cda 100644 --- a/public/react/src/modules/courses/busyWork/NewWorkForm.js +++ b/public/react/src/modules/courses/busyWork/NewWorkForm.js @@ -110,6 +110,19 @@ class NewWorkForm extends Component{ {/* min={has_commit ? init_max_num : (min_num == undefined ? 2 : min_num + 1) } */} // 已有提交作品,人数范围只能扩大 const { has_commit, max_num, init_max_num, min_num, init_min_num } = this.state; + if (!min_num) { + this.props.showNotification('最小人数不能为空'); + return; + } else if (min_num < 1) { + this.props.showNotification('最小人数不能小于1'); + return; + } else if (!max_num) { + this.props.showNotification('最大人数不能为空'); + return; + } else if (max_num < min_num) { + this.props.showNotification('最大人数不能小于最小人数'); + return; + } if (has_commit) { if (max_num < init_max_num || min_num > init_min_num) { this.props.showNotification(`已有提交作品,人数范围只能扩大(原设置为:${init_min_num} - ${init_max_num})`) @@ -237,9 +250,9 @@ class NewWorkForm extends Component{ } max_num_change = (val) => { if (val < 2) { - this.setState({ - max_num: 2, - }) + // this.setState({ + // max_num: 2, + // }) return; } const { min_num } = this.state; @@ -248,12 +261,31 @@ class NewWorkForm extends Component{ min_num: val <= min_num ? val - 1 : min_num }) } + personNumValidator = (rule, value, callback) => { + const { min_num, max_num } = this.state; + const form = this.props.form; + if (!min_num) { + callback('最小人数不能为空'); + } else if (min_num < 1) { + callback('最小人数不能小于1'); + } else if (!max_num) { + callback('最大人数不能为空'); + } else if (max_num < min_num) { + callback('最大人数不能小于最小人数'); + } else { + callback(); + } + } min_num_change = (val) => { this.setState({ min_num: val }) } base_on_project_change = () => { this.setState({ base_on_project: !this.state.base_on_project }) } + componentDidMount() { + window.$('.groupSetting .ant-form-item-label > label').addClass('ant-form-item-required') + } + render(){ let {typeId,coursesId,pageType}=this.props.match.params; const { getFieldDecorator } = this.props.form; @@ -411,11 +443,13 @@ class NewWorkForm extends Component{ { isGroup && {getFieldDecorator('personNum', { rules: [{ - required: false + // required: true, + // message: '人数不能为空' + // validator: this.personNumValidator // required: true, message: '请输入最小人数和最大人数' }], })( @@ -447,6 +481,7 @@ class NewWorkForm extends Component{

)} +
}
diff --git a/public/react/src/modules/courses/groupjobbank/Groupjobbandetails.js b/public/react/src/modules/courses/groupjobbank/Groupjobbandetails.js index 027c12d04..418d0ded6 100644 --- a/public/react/src/modules/courses/groupjobbank/Groupjobbandetails.js +++ b/public/react/src/modules/courses/groupjobbank/Groupjobbandetails.js @@ -67,7 +67,7 @@ class Groupjobbandetails extends Component {
{ - datas&&(datas.description===null? + ddatas.description===null? :datas.description==="null"? @@ -77,7 +77,6 @@ class Groupjobbandetails extends Component { : //
- ) } {/*
*/} {/*{datas.attachments === undefined ? "" : datas.attachments.map((item, key) => {*/} diff --git a/public/react/src/modules/courses/groupjobbank/Groupjobquesanswer.js b/public/react/src/modules/courses/groupjobbank/Groupjobquesanswer.js index 8e114722a..3d41ccb79 100644 --- a/public/react/src/modules/courses/groupjobbank/Groupjobquesanswer.js +++ b/public/react/src/modules/courses/groupjobbank/Groupjobquesanswer.js @@ -64,7 +64,7 @@ class Groupjobquesanswer extends Component {
{ - datas&&(datas.reference_answer===null? + datas.reference_answer===null? "" :datas.reference_answer==="null"? "" : @@ -72,25 +72,31 @@ class Groupjobquesanswer extends Component { "" : - ) } {datas.reference_attachments === undefined ? - (datas.reference_answer===undefined || datas.reference_answer===null? + (datas.reference_answer===undefined || datas.reference_answer===null|| datas.reference_answer===""? : "" ) : + datas.reference_attachments === "" ? + (datas.reference_answer===undefined || datas.reference_answer===null|| datas.reference_answer===""? + + : + "" + ) + : datas.reference_attachments === null ? - (datas.reference_answer===undefined || datas.reference_answer===null? + (datas.reference_answer===undefined || datas.reference_answer===null|| datas.reference_answer===""? : "" ) : datas.reference_attachments.length === 0 ? - (datas.reference_answer===undefined || datas.reference_answer===null? + (datas.reference_answer===undefined || datas.reference_answer===null|| datas.reference_answer===""? : "" diff --git a/public/react/src/modules/courses/poll/PollNewQuestbank.js b/public/react/src/modules/courses/poll/PollNewQuestbank.js index 3e9be6a74..e29acfc55 100644 --- a/public/react/src/modules/courses/poll/PollNewQuestbank.js +++ b/public/react/src/modules/courses/poll/PollNewQuestbank.js @@ -3249,7 +3249,7 @@ class PollNewQuestbank extends Component { // ) // "" // : - itemo.question.answers.length > 2 &&indext>1? + itemo.question.answers.length > 2 &&indext>=1? { indext > 1 ? @@ -3482,6 +3482,7 @@ class PollNewQuestbank extends Component {
: "") : + // 编辑
{resultDom} {this.state.Newdisplay === false ? @@ -3525,8 +3526,8 @@ class PollNewQuestbank extends Component { onInput={(e) => this.HandleInputTopic(e, indexo)}>{itemo.question.question_title} } {itemo.question.answers === undefined ? "" : itemo.question.answers.map((itemt, indext) => { - console.log("chishiyong1"); - console.log(itemo.question.answers[itemo.question.answers.length - 1]); + // console.log("chishiyong1"); + // console.log(itemo.question.answers[itemo.question.answers.length - 1]); // var bools=true; // if(){ // @@ -3576,7 +3577,7 @@ class PollNewQuestbank extends Component { // title="新增" placement={"bottom"}> // :"") - itemo.question.answers.length > 2 && indext>1 ? + itemo.question.answers.length > 2 && indext>=1 ? { indext > 1 ? diff --git a/public/react/src/modules/courses/questionbank/Generaljobanswer.js b/public/react/src/modules/courses/questionbank/Generaljobanswer.js index e821845b3..278cdd691 100644 --- a/public/react/src/modules/courses/questionbank/Generaljobanswer.js +++ b/public/react/src/modules/courses/questionbank/Generaljobanswer.js @@ -57,7 +57,10 @@ class Generaljobanswer extends Component { render() { - let{datas}=this.props + let{datas}=this.props; + console.log("Generaljobanswer"); + console.log(datas.reference_attachments); + console.log(datas.reference_answer); return (
@@ -82,7 +85,7 @@ class Generaljobanswer extends Component { {/*
*/} { - datas&&(datas.reference_answer===null? + datas.reference_answer===null? "" :datas.reference_answer==="null"? "" : @@ -90,25 +93,32 @@ class Generaljobanswer extends Component { "" : - ) + } {datas.reference_attachments === undefined ? - (datas.reference_answer===undefined || datas.reference_answer===null? + (datas.reference_answer===undefined || datas.reference_answer===undefined|| datas.reference_answer===""? : "" ) : + datas.reference_attachments === "" ? + (datas.reference_answer===undefined || datas.reference_answer===undefined|| datas.reference_answer===""? + + : + "" + ) + : datas.reference_attachments === null ? - (datas.reference_answer===undefined || datas.reference_answer===null? + (datas.reference_answer===undefined || datas.reference_answer===undefined|| datas.reference_answer===""? : "" ) : datas.reference_attachments.length === 0 ? - (datas.reference_answer===undefined || datas.reference_answer===null? + (datas.reference_answer===undefined || datas.reference_answer===undefined|| datas.reference_answer===""? : ""