From 688d44314bec16ead2302fcf4cb326f4e180e0e6 Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Fri, 28 Jun 2019 10:26:58 +0800 Subject: [PATCH 1/6] 1 --- public/react/src/modules/tpm/challengesnew/TPMMDEditor.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/public/react/src/modules/tpm/challengesnew/TPMMDEditor.js b/public/react/src/modules/tpm/challengesnew/TPMMDEditor.js index 47efccf74..223065864 100644 --- a/public/react/src/modules/tpm/challengesnew/TPMMDEditor.js +++ b/public/react/src/modules/tpm/challengesnew/TPMMDEditor.js @@ -84,8 +84,9 @@ function md_elocalStorage(editor,mdu,id){ var textStart = " 数据已于 " var text = textStart + h + ':' + m + ':' + s +" 保存 "; // 占位符 - if ($(id2).html() && $(id2).html() != ' ' && $(id2).html().startWith(textStart) == false) { - $(id2).html( $(id2).html().split(' (')[0] + ` (${text})`); + var oldHtml = $(id2).html(); + if (oldHtml && oldHtml != ' ' && oldHtml.startsWith(textStart) == false) { + $(id2).html( oldHtml.split(' (')[0] + ` (${text})`); } else { $(id2).html(text); } From ed7acee3ec576946432bc2f41974a8c2cd6e073b Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Fri, 28 Jun 2019 10:44:47 +0800 Subject: [PATCH 2/6] padding --- .../tasks/GraduationTasksappraiseReply.js | 2 +- .../GraduationTasksappraiseReplyChild.js | 35 +++++++++---------- 2 files changed, 18 insertions(+), 19 deletions(-) diff --git a/public/react/src/modules/courses/graduation/tasks/GraduationTasksappraiseReply.js b/public/react/src/modules/courses/graduation/tasks/GraduationTasksappraiseReply.js index ec685c39f..1e0fb3071 100644 --- a/public/react/src/modules/courses/graduation/tasks/GraduationTasksappraiseReply.js +++ b/public/react/src/modules/courses/graduation/tasks/GraduationTasksappraiseReply.js @@ -158,7 +158,7 @@ class GraduationTasksappraiseReply extends Component{ return( - {comment_scores.length===0&&isStudent===true||comment_scores.length===0&&isNotMember===true? "":
+ {comment_scores.length===0&&isStudent===true||comment_scores.length===0&&isNotMember===true? "":
{isStudent===true? -
+
全部评阅 { !!comment_scores.length && - {comment_scores.length===0?"":(comment_scores.length)} + {comment_scores.length===0?"":`(${comment_scores.length})`} }
} -
- {/* style={{ display: (comments && !!comments.length) ? 'block' : 'none' }} */} - {/*
- -
*/} - - {this.props.ultimate===true?"": isAdmin && this.props.addSuccess()} > } - -
- { comment_scores.map(item => { - return - }) } -
+
+ + + +
+ { comment_scores.map(item => { + return + }) }
+
) } From f8d28efe043e074a3d9ba40b471bf322cbf9fcf0 Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Fri, 28 Jun 2019 10:56:10 +0800 Subject: [PATCH 3/6] css --- .../courses/graduation/tasks/GraduationTasksappraise.js | 2 +- .../courses/graduation/tasks/GraduationTasksappraiseReply.css | 4 ++-- .../graduation/tasks/GraduationTasksappraiseReplyChild.js | 3 ++- .../modules/courses/graduation/tasks/Graduationtaskitem.js | 2 +- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/public/react/src/modules/courses/graduation/tasks/GraduationTasksappraise.js b/public/react/src/modules/courses/graduation/tasks/GraduationTasksappraise.js index 562882bbb..6c017e060 100644 --- a/public/react/src/modules/courses/graduation/tasks/GraduationTasksappraise.js +++ b/public/react/src/modules/courses/graduation/tasks/GraduationTasksappraise.js @@ -159,7 +159,7 @@ class GraduationTasksappraise extends Component{ categoryid={category_id} setupdate={this.setupdate} /> -
+

diff --git a/public/react/src/modules/courses/graduation/tasks/GraduationTasksappraiseReply.css b/public/react/src/modules/courses/graduation/tasks/GraduationTasksappraiseReply.css index 9fa1579e5..203198685 100644 --- a/public/react/src/modules/courses/graduation/tasks/GraduationTasksappraiseReply.css +++ b/public/react/src/modules/courses/graduation/tasks/GraduationTasksappraiseReply.css @@ -18,8 +18,8 @@ color: #999999; } -.panel-comment_item .t_info { - width: 100%; +.graduationAppraise .panel-comment_item .t_info { + width: 1062px; } .course-message .panel-comment_item .comment_orig_content { width: 980px; diff --git a/public/react/src/modules/courses/graduation/tasks/GraduationTasksappraiseReplyChild.js b/public/react/src/modules/courses/graduation/tasks/GraduationTasksappraiseReplyChild.js index e1fa815a1..345a9874d 100644 --- a/public/react/src/modules/courses/graduation/tasks/GraduationTasksappraiseReplyChild.js +++ b/public/react/src/modules/courses/graduation/tasks/GraduationTasksappraiseReplyChild.js @@ -30,7 +30,8 @@ class GraduationTasksappraiseReplyChild extends Component{ return( -

+
{item.time} {/* 分数 */} - {item.score && {item.score}分} + {item.score >= 0 && {item.score}分} { !item.is_invalid && item.delete && Date: Fri, 28 Jun 2019 11:03:16 +0800 Subject: [PATCH 4/6] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../tasks/GraduationTasksSubmitnew.js | 4 +- .../graduation/tasks/GraduationTasksedit.js | 192 +++++++++++------- .../graduation/tasks/GraduationTasksnew.js | 64 +++++- 3 files changed, 175 insertions(+), 85 deletions(-) diff --git a/public/react/src/modules/courses/graduation/tasks/GraduationTasksSubmitnew.js b/public/react/src/modules/courses/graduation/tasks/GraduationTasksSubmitnew.js index 3e0972be2..45b0111ea 100644 --- a/public/react/src/modules/courses/graduation/tasks/GraduationTasksSubmitnew.js +++ b/public/react/src/modules/courses/graduation/tasks/GraduationTasksSubmitnew.js @@ -89,7 +89,7 @@ class GraduationTasksSubmitnew extends Component{ if(fileList.length === 0){ this.setState({ - tshixunsreplace:true, + shixunsreplace:true, }) return } @@ -355,8 +355,6 @@ class GraduationTasksSubmitnew extends Component{ for(var list of fileList){ listid.push(list.response.id) } - - // e.preventDefault(); if( GraduationTasksnewtype===true){ this.props.form.validateFields((err, values) => { if (!err) { diff --git a/public/react/src/modules/courses/graduation/tasks/GraduationTasksedit.js b/public/react/src/modules/courses/graduation/tasks/GraduationTasksedit.js index 515149fb0..a6b86ff81 100644 --- a/public/react/src/modules/courses/graduation/tasks/GraduationTasksedit.js +++ b/public/react/src/modules/courses/graduation/tasks/GraduationTasksedit.js @@ -27,6 +27,7 @@ class GraduationTasksedit extends Component{ tasktype:undefined, name:"", description:undefined, + shixunsreplace:false, } } @@ -73,74 +74,7 @@ class GraduationTasksedit extends Component{ } - handleSubmit=(e)=>{ - - let {fileList}=this.state; - let listid=[] - let graduation_id=this.state.data.graduation_id; - for(var list of fileList){ - if(list.response!=undefined){ - listid.push(list.response.id) - }else{ - listid.push(list.uid) - } - - } - - // console.log(listid) - e.preventDefault(); - if(GraduationTasksedittype===true){ - this.props.form.validateFields((err, values) => { - - if (!err) { - if(values.tasktype===undefined){ - this.scrollToAnchors("tasktypes"); - return - } - - if(values.name===undefined){ - this.scrollToAnchors("nametypes"); - return - } - - if(values.description===undefined){ - this.scrollToAnchors("descriptiontypes"); - return - }else if(values.description.length>5000){ - this.scrollToAnchors("descriptiontypes"); - return - } - - - console.log('Received values of form: ', values); - // console.log(fileList); - let tasksid=this.props.match.params.category_id; - - let url="/graduation_tasks/"+tasksid+".json" - axios.put(url, { - task_type:parseInt(values.tasktype), - name:values.name, - description:values.description, - attachment_ids:listid, - } - ).then((response) => { - if(response.status===200) { - // console.log(response) - GraduationTasksedittype=false; - // window.location.href="/courses/"+course_id+"/graduation/"+graduationId+"/graduation_tasks/"+category_id+"/questions"; - // this.goback() - this.props.history.push("/courses/"+this.props.match.params.coursesId+"/graduation_tasks/"+graduation_id+"/"+this.props.match.params.category_id +"/setting"); - } - }).catch((error) => { - console.log(error) - }) - - } - }); - } - - } goback=()=>{ // let courseId=this.props.match.params.coursesId; @@ -239,10 +173,100 @@ class GraduationTasksedit extends Component{ }); } + Commoninterface=(fileList)=>{ + let listid=[] + let graduation_id=this.state.data.graduation_id; + for(var list of fileList){ + if(list.response!=undefined){ + listid.push(list.response.id) + }else{ + listid.push(list.uid) + } + + } + + // console.log(listid) + if(GraduationTasksedittype===true){ + this.props.form.validateFields((err, values) => { + + if (!err) { + + if(values.tasktype===undefined){ + this.scrollToAnchors("tasktypes"); + return + } + + if(values.name===undefined){ + this.scrollToAnchors("nametypes"); + return + } + + if(values.description===undefined){ + this.scrollToAnchors("descriptiontypes"); + return + }else if(values.description.length>5000){ + this.scrollToAnchors("descriptiontypes"); + return + } + + + console.log('Received values of form: ', values); + // console.log(fileList); + let tasksid=this.props.match.params.category_id; + + let url="/graduation_tasks/"+tasksid+".json" + axios.put(url, { + task_type:parseInt(values.tasktype), + name:values.name, + description:values.description, + attachment_ids:listid, + } + ).then((response) => { + if(response.status===200) { + // console.log(response) + GraduationTasksedittype=false; + // window.location.href="/courses/"+course_id+"/graduation/"+graduationId+"/graduation_tasks/"+category_id+"/questions"; + // this.goback() + this.props.history.push("/courses/"+this.props.match.params.coursesId+"/graduation_tasks/"+graduation_id+"/"+this.props.match.params.category_id +"/setting"); + } + }).catch((error) => { + console.log(error) + }) + + } + }); + } + } + handleSubmit=(e)=>{ + + let {fileList}=this.state; + if(fileList.length===0){ + this.setState({ + shixunsreplace:true, + }) + return + } + + this.Commoninterface(fileList); + } + //确认 + hidestartshixunsreplace = ()=>{ + let {fileList}=this.state; + + this.Commoninterface(fileList); + + + } + //取消 + hidestartshixunsreplacetwo=()=>{ + this.setState({ + shixunsreplace:false, + }) + } render(){ const { getFieldDecorator } = this.props.form; let {title_num,pageType,name,description,Loadtype, - Modalstype,Modalstopval,ModalCancel,ModalSave} =this.state; + Modalstype,Modalstopval,ModalCancel,ModalSave,shixunsreplace} =this.state; let {coursedata}=this.props; let courseId=this.props.match.params.coursesId; @@ -280,6 +304,24 @@ class GraduationTasksedit extends Component{ modalSave={ModalSave} loadtype={Loadtype} /> + +
+

还未上传附件

+

是否确认提交作品?

+
+ +
@@ -302,8 +344,12 @@ class GraduationTasksedit extends Component{ 返回
- {description===undefined?"":
- {/*内容*/} + {description===undefined?"": +
+ {/**/} + {/* */} + + {/*内容*/}
@@ -406,11 +452,13 @@ class GraduationTasksedit extends Component{
- + 取消
- } + {/**/} +
+ }
diff --git a/public/react/src/modules/courses/graduation/tasks/GraduationTasksnew.js b/public/react/src/modules/courses/graduation/tasks/GraduationTasksnew.js index 6b9a96108..8ab9878da 100644 --- a/public/react/src/modules/courses/graduation/tasks/GraduationTasksnew.js +++ b/public/react/src/modules/courses/graduation/tasks/GraduationTasksnew.js @@ -23,7 +23,8 @@ class GraduationTasksnew extends Component { title_value: "", fileList: [], contents: [{val: "", id: 1}], - type: true + type: true, + shixunsreplace:false, } } @@ -47,15 +48,13 @@ class GraduationTasksnew extends Component { }) } + Commoninterface =(fileList)=>{ - handleSubmit = (e) => { - let {fileList} = this.state; let listid = [] for (var list of fileList) { listid.push(list.response.id) } - e.preventDefault(); if (GraduationTasksnewtype === true) { this.props.form.validateFields((err, values) => { if (!err) { @@ -100,9 +99,9 @@ class GraduationTasksnew extends Component { }); } + } - } goback = () => { @@ -210,11 +209,38 @@ class GraduationTasksnew extends Component { } } + // 提交按钮 + handleSubmit = (e) => { + let {fileList} = this.state; + if(fileList.length===0){ + this.setState({ + shixunsreplace:true, + }) + + return + } + + this.Commoninterface(fileList); + + } + //确认 + hidestartshixunsreplace =()=>{ + let {fileList} = this.state; + + this.Commoninterface(fileList); + } + //取消 + hidestartshixunsreplacetwo=()=>{ + this.setState({ + shixunsreplace:false, + }) + + } render() { const {getFieldDecorator} = this.props.form; let { coursename, coursesearch, title_num, title_value, pageType, fileList, contents, type, - Modalstype, Modalstopval, ModalCancel, ModalSave + Modalstype, Modalstopval, ModalCancel, ModalSave,shixunsreplace } = this.state; let {coursedata} = this.props; @@ -254,6 +280,24 @@ class GraduationTasksnew extends Component { modalCancel={ModalCancel} modalSave={ModalSave} /> + +
+

还未上传附件

+

是否确认提交作品?

+
+ +
@@ -273,8 +317,8 @@ class GraduationTasksnew extends Component {
-
+ {/**/}