From f142c7339d082e1406cc3ccb9029cbcb1972489c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Thu, 20 Jun 2019 16:58:04 +0800 Subject: [PATCH 01/10] =?UTF-8?q?=E8=B7=AF=E5=BE=84=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/react/src/modules/courses/Resource/index.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/public/react/src/modules/courses/Resource/index.js b/public/react/src/modules/courses/Resource/index.js index ec0f4c280..ac168d880 100644 --- a/public/react/src/modules/courses/Resource/index.js +++ b/public/react/src/modules/courses/Resource/index.js @@ -254,6 +254,7 @@ class Fileslists extends Component{ checkBoxValues:[], checkAllValue:false }) + this.props.updataleftNavfun() this.props.showNotification("删除成功"); } }) @@ -518,6 +519,7 @@ class Fileslists extends Component{ checkBoxValues:[], // checkAllValue:false }) + this.props.updataleftNavfun() this.props.showNotification('资源移动成功') } }) From 6787d59ec17161fb8b3cdff304265f6c162b26e5 Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Thu, 20 Jun 2019 17:17:04 +0800 Subject: [PATCH 02/10] font-16 --- .../modules/courses/common/titleSearch/TitleSearchSection.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/react/src/modules/courses/common/titleSearch/TitleSearchSection.js b/public/react/src/modules/courses/common/titleSearch/TitleSearchSection.js index c6530e855..4cb69a8d7 100644 --- a/public/react/src/modules/courses/common/titleSearch/TitleSearchSection.js +++ b/public/react/src/modules/courses/common/titleSearch/TitleSearchSection.js @@ -62,7 +62,7 @@ class Titlesearchsection extends Component{

{title} -

  • +
  • { firstRowRight }
  • From 01fd748038d54aa709630d9e48b0445dad287fcf Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Thu, 20 Jun 2019 17:19:48 +0800 Subject: [PATCH 03/10] =?UTF-8?q?=E5=85=88=E6=B3=A8=E9=87=8A=E4=BA=86?= =?UTF-8?q?=EF=BC=8C=E5=BD=B1=E5=93=8D=E5=88=B0=E4=BA=86md=E7=9A=84?= =?UTF-8?q?=E6=8B=96=E6=8B=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/react/src/modules/forums/MemoDetailMDEditor.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/public/react/src/modules/forums/MemoDetailMDEditor.js b/public/react/src/modules/forums/MemoDetailMDEditor.js index 17bc11212..caf8e5743 100644 --- a/public/react/src/modules/forums/MemoDetailMDEditor.js +++ b/public/react/src/modules/forums/MemoDetailMDEditor.js @@ -158,13 +158,15 @@ class MemoDetailMDEditor extends Component {
    From 268baa136d26846078621846f06f97498c732b67 Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Thu, 20 Jun 2019 19:03:00 +0800 Subject: [PATCH 04/10] canNotLink --- .../src/modules/courses/busyWork/CommonWorkItem.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/public/react/src/modules/courses/busyWork/CommonWorkItem.js b/public/react/src/modules/courses/busyWork/CommonWorkItem.js index 41b873bac..258a06332 100644 --- a/public/react/src/modules/courses/busyWork/CommonWorkItem.js +++ b/public/react/src/modules/courses/busyWork/CommonWorkItem.js @@ -104,6 +104,7 @@ class CommonWorkItem extends Component{ let coursesId = this.props.match.params.coursesId; const isStudent = this.props.isStudent() + const isAdmin = this.props.isAdmin() const isAdminOrStudent = this.props.isAdminOrStudent() return(
    @@ -128,19 +129,20 @@ class CommonWorkItem extends Component{ { mainList && mainList.homeworks.length>0 && mainList.homeworks.map((item,index)=>{ + let canNotLink = !isAdminOrStudent && item.private_icon == true return(
    { - mainList && mainList.course_identity < 5 && + mainList && isAdmin && }
    this.props.onItemClick(Object.assign({}, item, {id: item.homework_id})) }>

    this.onItemClick(item)} + className="fl font-16 font-bd mt2 comnonwidth580" style={{cursor: canNotLink ? 'normal' : 'poninter'}} + onClick={canNotLink ? () => {} : () => this.onItemClick(item)} >{item.name} {/* 只有非课堂成员且作业是私有的情况下才会为true */} @@ -155,7 +157,7 @@ class CommonWorkItem extends Component{ { - mainList && mainList.course_identity < 5 && + mainList && isAdmin &&

    • From 07e5760e2b0b067e8cb8457836619a95488b45e2 Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Thu, 20 Jun 2019 19:06:46 +0800 Subject: [PATCH 05/10] this.props.addSuccess --- .../graduation/tasks/GraduationTasksappraiseReplyChild.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/react/src/modules/courses/graduation/tasks/GraduationTasksappraiseReplyChild.js b/public/react/src/modules/courses/graduation/tasks/GraduationTasksappraiseReplyChild.js index 094f8d96f..1279b4907 100644 --- a/public/react/src/modules/courses/graduation/tasks/GraduationTasksappraiseReplyChild.js +++ b/public/react/src/modules/courses/graduation/tasks/GraduationTasksappraiseReplyChild.js @@ -83,7 +83,7 @@ class GraduationTasksappraiseReplyChild extends Component{
  • */} {this.props.ultimate===true?"": isAdmin && this.props.addSuccess()} > }
    @@ -696,7 +697,7 @@ class Selectsetting extends Component{ id={"startimes"} className={"Selectleft20"} width={"200px"} - value={item.publish_time===undefined||item.publish_time===""?"":moment(item.publish_time, dateFormat)} + value={item.publish_time===undefined||item.publish_time===""?"":item.publish_time===null?"":moment(item.publish_time, dateFormat)} onChange={(e,index)=>this.onChangeTimepublishs(e,index,key)} // onChange={ this.onChangeTimepublish } disabledTime={disabledDateTime} @@ -739,7 +740,7 @@ class Selectsetting extends Component{ {/*{this.state.course_group_idtypes===true?

    请选择分班

    :""}*/} {/*{course_group_publish_timestype===true?

    请填写完整

    :""}*/} - - {descriptiontype===true?

    描述不能超过最大限制:100个字符

    :""} + {descriptiontype===true?

    请输入资源描述,最大限制100个字符

    :""}
    {this.props.Cancelname} this.Saves()}>{this.props.Savesname} diff --git a/public/react/src/modules/courses/exercise/ExerciseListItem.js b/public/react/src/modules/courses/exercise/ExerciseListItem.js index 43210315d..eb0377022 100644 --- a/public/react/src/modules/courses/exercise/ExerciseListItem.js +++ b/public/react/src/modules/courses/exercise/ExerciseListItem.js @@ -85,11 +85,14 @@ class ExerciseListItem extends Component{ text-overflow: ellipsis; white-space: nowrap; } + .homepagePostSetting { + position: absolute; + } ` }
    -

    +

    {/*{item.exercise_name}*/} { @@ -132,7 +135,7 @@ class ExerciseListItem extends Component{ {/**/} {/**/}

    -

    +

    {item.exercise_status===1?"":{item.exercise_answer} 已答} {item.exercise_status===1?"":{item.exercise_unanswer} 未答} {item.unreview_count===null||item.exercise_status===1?"":{item.unreview_count} 未评数 } @@ -161,23 +164,32 @@ class ExerciseListItem extends Component{ {/*item.exercise_status ==2?"":*/} {/* 发布于{moment(item.exercise_left_time).fromNow()} */} {/*}*/} -

    - { - IsAdmin && -
    -
      -
    • - - -
    • -
    -
    - } + + + { IsAdmin &&
    + 编辑 + 设置 +
    } + +

    + {/*{*/} + {/*IsAdmin &&*/} + {/*
    */} + {/*
      */} + {/*
    • */} + {/**/} + {/*
        */} + {/*
      • 编辑
      • */} + {/*
      • 设置
      • */} + {/*
      */} + {/*
    • */} + {/*
    */} + {/*
    */} + {/*}*/} + + { IsStudent &&
    diff --git a/public/react/src/modules/courses/graduation/tasks/GraduateTaskItem.js b/public/react/src/modules/courses/graduation/tasks/GraduateTaskItem.js index 3e3259a72..ef23674fe 100644 --- a/public/react/src/modules/courses/graduation/tasks/GraduateTaskItem.js +++ b/public/react/src/modules/courses/graduation/tasks/GraduateTaskItem.js @@ -234,12 +234,20 @@ class GraduateTaskItem extends Component{

    - + {this.props.isAdmin?
    - + 编辑 From 2141b068f97e5f6830be88fe19fa4766ba544ca5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Thu, 20 Jun 2019 19:33:55 +0800 Subject: [PATCH 08/10] =?UTF-8?q?=E6=AF=95=E8=AE=BE=E6=97=B6=E9=97=B4?= =?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/GraduationTaskssetting.js | 46 ++++++++++--------- 1 file changed, 24 insertions(+), 22 deletions(-) diff --git a/public/react/src/modules/courses/graduation/tasks/GraduationTaskssetting.js b/public/react/src/modules/courses/graduation/tasks/GraduationTaskssetting.js index a002911ec..9ef3d7091 100644 --- a/public/react/src/modules/courses/graduation/tasks/GraduationTaskssetting.js +++ b/public/react/src/modules/courses/graduation/tasks/GraduationTaskssetting.js @@ -480,7 +480,7 @@ class GraduationTaskssettingapp extends Component{ saveTaskssetting=()=>{ - let {latepenalty,hascommit,minnums,max_nums,publish_time,end_time,crosscomment,latetime}=this.state; + let {latepenalty,hascommit,minnums,max_nums,publish_time,end_time,crosscomment,latetime,starttimetype}=this.state; if(latepenalty===undefined){ this.setState({ latepenaltytype:true, @@ -500,19 +500,19 @@ class GraduationTaskssettingapp extends Component{ } - - if(moment(publish_time) <= moment()){ - this.setState({ - publishTimetypes:true, - publishTimetypesval:"发布时间不能早于当前时间", - }) - return - }else{ - this.setState({ - publishTimetypes:false - }) - } - + if(starttimetype===false) { + if (moment(publish_time) <= moment()) { + this.setState({ + publishTimetypes: true, + publishTimetypesval: "发布时间不能早于当前时间", + }) + return + } else { + this.setState({ + publishTimetypes: false + }) + } + } if(moment(end_time) Date: Fri, 21 Jun 2019 01:03:26 +0800 Subject: [PATCH 09/10] =?UTF-8?q?=E6=AF=95=E8=AE=BE=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modules/courses/Resource/Fileslistitem.js | 46 +-- .../src/modules/courses/Resource/index.js | 4 +- .../courses/coursesHome/coursesHomeCard.js | 272 +++++++++--------- .../graduation/tasks/GraduateTaskItem.js | 5 +- .../tasks/GraduationTasksSubmitedit.js | 2 +- .../tasks/GraduationTasksSubmitnew.js | 2 +- .../tasks/GraduationTasksappraise.js | 10 +- .../tasks/GraduationTasksappraiseReply.js | 4 +- .../graduation/tasks/GraduationTasksedit.js | 13 +- .../tasks/GraduationTaskssetting.js | 52 ++-- .../tasks/GraduationTaskssettinglist.js | 64 +++-- .../tasks/GraduationTaskssettingquestions.js | 4 +- public/react/src/modules/forums/PostItem.js | 208 +++++++------- 13 files changed, 360 insertions(+), 326 deletions(-) diff --git a/public/react/src/modules/courses/Resource/Fileslistitem.js b/public/react/src/modules/courses/Resource/Fileslistitem.js index cc6304481..dd37c441c 100644 --- a/public/react/src/modules/courses/Resource/Fileslistitem.js +++ b/public/react/src/modules/courses/Resource/Fileslistitem.js @@ -248,20 +248,7 @@ class Fileslistitem extends Component{ } - {this.props.isAdmin ||this.props.current_user.username===discussMessage.author.name? - - - this.settingList()}>设置 - - - - this.onDelete(discussMessage.id)}>删除 - - - :""} {discussMessage.course_groups.length===0?"": -

    +

    {discussMessage.course_groups.map((item,key)=>{ return(

    {item.course_group_name} - 发布于 { moment(item.course_group_publish_time).format('YYYY-MM-DD hh:mm')} + 将发布于 { moment(item.course_group_publish_time).format('YYYY-MM-DD hh:mm')}
    ) })}

    } -

    +

    - {discussMessage.author.name} + {discussMessage.author.login} 大小 {discussMessage.filesize} 下载 {discussMessage.downloads_count} 引用 {discussMessage.quotes} @@ -299,15 +289,31 @@ class Fileslistitem extends Component{ { discussMessage.publish_time===null?"":discussMessage.is_publish===true?moment(discussMessage.publish_time).fromNow():moment(discussMessage.publish_time).format('YYYY-MM-DD hh:mm')} + {this.props.isAdmin ||this.props.current_user.login===discussMessage.author.login? + + + + this.settingList()}>设置 + + + + this.onDelete(discussMessage.id)}>删除 + + + :""}

    - 资源描述 : - {discussMessage.description} - {this.props.isAdmin ?this.settingList()}>:""} + {/**/} + +

    资源描述 :{discussMessage.description===null?"暂无描述":discussMessage.description}
    + + {/*{this.props.isAdmin ?this.settingList()}>:""}*/}

    diff --git a/public/react/src/modules/courses/Resource/index.js b/public/react/src/modules/courses/Resource/index.js index 5ad4b81d3..2cc5dbafb 100644 --- a/public/react/src/modules/courses/Resource/index.js +++ b/public/react/src/modules/courses/Resource/index.js @@ -655,8 +655,8 @@ class Fileslists extends Component{ secondRowLeft={
    共 {total_count} 个资源 - 公共资源:{public_count}个 - {this.props.isAdmin()||this.props.isStudent()?私有资源:{private_count}个:""} + 已发布:{public_count}个 + {this.props.isAdmin()||this.props.isStudent()?未发布:{private_count}个:""}
    } onPressEnter={this.onPressEnter} diff --git a/public/react/src/modules/courses/coursesHome/coursesHomeCard.js b/public/react/src/modules/courses/coursesHome/coursesHomeCard.js index 3f6d565cf..c5f6aeca7 100644 --- a/public/react/src/modules/courses/coursesHome/coursesHomeCard.js +++ b/public/react/src/modules/courses/coursesHome/coursesHomeCard.js @@ -1,136 +1,136 @@ -import React, { Component } from 'react'; -import {getImageUrl} from 'educoder'; -import { BrowserRouter as Router, Route, Link } from "react-router-dom"; -import {Tooltip,Spin,Alert} from 'antd'; -import ShowSpin from '../../../common/ShowSpin'; - -class coursesHomeCard extends Component{ - constructor(props) { - super(props) - } - render(){ - let {coursesHomelist}=this.props; - - return( -
    - -
    - - {/**/} - - { - coursesHomelist===undefined?"":coursesHomelist.courses.map((item,key)=>{ - - - return( -
    - -
    - -

    非成员不能访问

    -
    - - { - item.is_public===1&&item.id===1309? -
    -
    - - 公开 -
    - :"" - } - { - item.is_public===1&&item.id!=1309? -
    -
    - - 公开 -
    - :"" - } - {item.is_end===true?

    - -

    已结束
    -

    :""} -
    - -

    - {/*{item.name.length>32?*/} - {/**/} - {/**/} - {/*: {item.name}}*/} - 23?item.name:""}>{item.name} -

    - - - 用户 - - -

    {item.creator} {item.technical_title}

    -

    - - - {item.school} - - -

    -
    - -
    -
    - {item.visits===0?"": - - {item.visits} - - - } - - {item.course_members_count===0?"": - - {item.course_members_count} - - } - - {item.tasks_count===0?"": - - {item.tasks_count} - - } - - {/**/} - - {/**/} - {/*{item.attachment_count}*/} - {/**/} - - {/**/} - -
    -
    - -
    - ) - }) - } - - - - -
    -
    - ) - } - } -export default coursesHomeCard; - +import React, { Component } from 'react'; +import {getImageUrl} from 'educoder'; +import { BrowserRouter as Router, Route, Link } from "react-router-dom"; +import {Tooltip,Spin,Alert} from 'antd'; +import ShowSpin from '../../../common/ShowSpin'; + +class coursesHomeCard extends Component{ + constructor(props) { + super(props) + } + render(){ + let {coursesHomelist}=this.props; + + return( + + ) + } + } +export default coursesHomeCard; + diff --git a/public/react/src/modules/courses/graduation/tasks/GraduateTaskItem.js b/public/react/src/modules/courses/graduation/tasks/GraduateTaskItem.js index ef23674fe..942fa96ca 100644 --- a/public/react/src/modules/courses/graduation/tasks/GraduateTaskItem.js +++ b/public/react/src/modules/courses/graduation/tasks/GraduateTaskItem.js @@ -185,18 +185,21 @@ class GraduateTaskItem extends Component{ { this.props.isAdmin?{discussMessage.name}:"" } { this.props.isStudent? {discussMessage.name}:"" } { this.props.isNotMember?this.props.discussMessage.private_icon===true? - {discussMessage.name} + {discussMessage.name} : {discussMessage.name}:"" } diff --git a/public/react/src/modules/courses/graduation/tasks/GraduationTasksSubmitedit.js b/public/react/src/modules/courses/graduation/tasks/GraduationTasksSubmitedit.js index a708939ba..ec1cf4e48 100644 --- a/public/react/src/modules/courses/graduation/tasks/GraduationTasksSubmitedit.js +++ b/public/react/src/modules/courses/graduation/tasks/GraduationTasksSubmitedit.js @@ -473,7 +473,7 @@ class GraduationTasksSubmitedit extends Component{ {/*{workslist&&workslist.task_name}*/} {/*>*/} {/*
    */} - {this.props.user.username} 提交作品 + {this.props.user&&this.props.user.username} 提交作品

    diff --git a/public/react/src/modules/courses/graduation/tasks/GraduationTasksSubmitnew.js b/public/react/src/modules/courses/graduation/tasks/GraduationTasksSubmitnew.js index 2a0ffa8fb..e1284832c 100644 --- a/public/react/src/modules/courses/graduation/tasks/GraduationTasksSubmitnew.js +++ b/public/react/src/modules/courses/graduation/tasks/GraduationTasksSubmitnew.js @@ -459,7 +459,7 @@ render(){ {/*{workslist&&workslist.task_name}*/} {/*>*/} {/**/} - {this.props.user.username} 提交作品 + {this.props.user&&this.props.user.username} 提交作品

    diff --git a/public/react/src/modules/courses/graduation/tasks/GraduationTasksappraise.js b/public/react/src/modules/courses/graduation/tasks/GraduationTasksappraise.js index a76354481..374318af1 100644 --- a/public/react/src/modules/courses/graduation/tasks/GraduationTasksappraise.js +++ b/public/react/src/modules/courses/graduation/tasks/GraduationTasksappraise.js @@ -234,11 +234,11 @@ class GraduationTasksappraise extends Component{
    - 更新 - {datalist&&datalist.update_user_name} - - {moment(datalist&&datalist.update_time).format('YYYY-MM-DD HH:mm:ss')==="Invalid date"?"":moment(datalist&&datalist.update_time).format('YYYY-MM-DD HH:mm:ss')} - + {/*更新*/} + {/*{datalist&&datalist.update_user_name}*/} + {/**/} + {/*{moment(datalist&&datalist.update_time).format('YYYY-MM-DD HH:mm:ss')==="Invalid date"?"":moment(datalist&&datalist.update_time).format('YYYY-MM-DD HH:mm:ss')}*/} + {/**/} 提交 {datalist&&datalist.author_name} diff --git a/public/react/src/modules/courses/graduation/tasks/GraduationTasksappraiseReply.js b/public/react/src/modules/courses/graduation/tasks/GraduationTasksappraiseReply.js index 69ab8ba79..1c733868e 100644 --- a/public/react/src/modules/courses/graduation/tasks/GraduationTasksappraiseReply.js +++ b/public/react/src/modules/courses/graduation/tasks/GraduationTasksappraiseReply.js @@ -124,8 +124,9 @@ class GraduationTasksappraiseReply extends Component{ saveModulationModal=(value,num)=>{ console.log(value,num) let {operationId}=this.state; + let category_id= this.props.match.params.category_id; // console.log(value,num) - let url ="/graduation_works/"+operationId+"/adjust_score.json"; + let url ="/graduation_works/"+category_id+"/adjust_score.json"; axios.post(url,{ score:num, comment:value @@ -138,6 +139,7 @@ class GraduationTasksappraiseReply extends Component{ Modalstopval:result.data.message, ModalSave:this.cancelmodel, }) + this.fetchAllComments() } }).catch((error)=>{ diff --git a/public/react/src/modules/courses/graduation/tasks/GraduationTasksedit.js b/public/react/src/modules/courses/graduation/tasks/GraduationTasksedit.js index 8bd55dea9..36c2f9d3f 100644 --- a/public/react/src/modules/courses/graduation/tasks/GraduationTasksedit.js +++ b/public/react/src/modules/courses/graduation/tasks/GraduationTasksedit.js @@ -18,7 +18,7 @@ class GraduationTasksedit extends Component{ this.state={ coursename:"", coursesearch:"", - title_num:20, + title_num:60, title_value:"", fileList: [], contents: [{val:"",id:1}], @@ -138,8 +138,11 @@ class GraduationTasksedit extends Component{ } goback=()=>{ - let courseId=this.props.match.params.coursesId; - window.location.href="/courses/"+courseId+"/graduation_tasks/"+this.state.data.graduation_id; + // let courseId=this.props.match.params.coursesId; + // window.location.href="/courses/"+courseId+"/graduation_tasks/"+this.state.data.graduation_id; + // goback = () => { + window.history.go(-1) + } @@ -147,7 +150,7 @@ class GraduationTasksedit extends Component{ changeTitle=(e)=>{ this.setState({ - title_num:20-parseInt(e.target.value.length), + title_num:60-parseInt(e.target.value.length), title_value:e.target.value }) @@ -315,7 +318,7 @@ class GraduationTasksedit extends Component{ {getFieldDecorator('name', { rules: [{ required: true, message: "请输入标题" }], - })()} + })()}
    diff --git a/public/react/src/modules/courses/graduation/tasks/GraduationTaskssetting.js b/public/react/src/modules/courses/graduation/tasks/GraduationTaskssetting.js index 9ef3d7091..9d0b33e80 100644 --- a/public/react/src/modules/courses/graduation/tasks/GraduationTaskssetting.js +++ b/public/react/src/modules/courses/graduation/tasks/GraduationTaskssetting.js @@ -111,11 +111,11 @@ class GraduationTaskssettingapp extends Component{ max_nums: result.data.max_num, task_type: result.data.task_type, baseonproject: result.data.base_on_project, - publish_time: result.data.publish_time, - end_time: result.data.end_time, + publish_time:moment(moment(handleDateString(result.data.publish_time))).format("YYYY-MM-DD HH:mm"), + end_time:moment(moment(handleDateString(result.data.end_time))).format("YYYY-MM-DD HH:mm"), allowlate: result.data.allow_late, latepenalty: result.data.late_penalty, - latetime: result.data.late_time, + latetime:moment(moment(handleDateString(result.data.late_time))).format("YYYY-MM-DD HH:mm"), crosscomment: result.data.cross_comment, taskid: result.data.id, taskname: result.data.task_name, @@ -128,7 +128,7 @@ class GraduationTaskssettingapp extends Component{ hasproject: result.data.has_project, hascommit: result.data.has_commit, assigngroups: assigngroups, - commenttime: result.data.comment_time, + commenttime:moment(moment(handleDateString(result.data.comment_time))).format("YYYY-MM-DD HH:mm"), task_status: result.data.task_status }) } @@ -142,7 +142,9 @@ class GraduationTaskssettingapp extends Component{ componentDidMount(){ this.getsettings(); - + if(this.props.isAdmin()===true){ + this.editSetting() + } } @@ -210,17 +212,18 @@ class GraduationTaskssettingapp extends Component{ latetime:null }) }else{ - endtime=moment(handleDateString(dateString)).add(1, 'months') + + endtime= moment(moment(handleDateString(dateString))).add(1, 'months').format("YYYY-MM-DD HH:mm") let {allowlate}=this.state; if(allowlate===true||allowlate===1){ this.setState({ - publish_time:handleDateString(dateString), + publish_time:moment(moment(handleDateString(dateString))).format("YYYY-MM-DD HH:mm"), end_time:endtime, - latetime:moment(endtime).add(1, 'months'), + latetime:moment(moment(handleDateString(endtime))).add(1, 'months').format("YYYY-MM-DD HH:mm"), }) }else{ this.setState({ - publish_time:handleDateString(dateString), + publish_time:moment(moment(handleDateString(dateString))).format("YYYY-MM-DD HH:mm"), end_time:endtime }) } @@ -240,12 +243,12 @@ class GraduationTaskssettingapp extends Component{ let {allowlate}=this.state; if(allowlate===true||allowlate===1){ this.setState({ - end_time:handleDateString(dateString), - latetime:moment(handleDateString(dateString)).add(1, 'months'), + end_time:moment(moment(handleDateString(dateString))).format("YYYY-MM-DD HH:mm"), + latetime:moment(moment(handleDateString(dateString))).add(1, 'months').format("YYYY-MM-DD HH:mm"), }) }else{ this.setState({ - end_time:handleDateString(dateString) + end_time:moment(moment(handleDateString(dateString))).format("YYYY-MM-DD HH:mm"), }) } @@ -288,7 +291,7 @@ class GraduationTaskssettingapp extends Component{ this.setState({ latepenalty:5, allowlate:e.target.value, - latetime:end_time===null?"":moment(end_time).add(1, 'months'), + latetime:end_time===null?"":moment(moment(handleDateString(end_time))).add(1, 'months').format("YYYY-MM-DD HH:mm"), }) }else{ this.setState({ @@ -326,7 +329,7 @@ class GraduationTaskssettingapp extends Component{ this.setState({ crosscomment:e.target.checked, - commenttime:newtime + commenttime:moment(moment(newtime)).format("YYYY-MM-DD HH:mm"), }) }else{ @@ -410,7 +413,7 @@ class GraduationTaskssettingapp extends Component{ Topval:"发布设置均可修改", Botvalleft:"点击修改", Botval:"此设置将对所有分班生效", - starttime:moment(moment(handleDateString(this.props.getNowFormatDates(1))).add(1, 'months')).format("YYYY-MM-DD HH:mm"), + starttime:moment(moment(handleDateString(this.props.getNowFormatDates(1)))).format("YYYY-MM-DD HH:mm") , starttimes:this.props.getNowFormatDates(1), typs:"start", endtime:endtime, @@ -558,6 +561,7 @@ class GraduationTaskssettingapp extends Component{ commenttimetype:false }) } + debugger if(moment(this.state.commenttime) { - try { - if (this.state.settingdata.is_end === true) { + + if (this.state.settingdata&&this.state.settingdata.is_end === true) { // this.setState({ // modalsType: true, // modalsTopval: "课堂已结束不能再修改!", @@ -886,9 +892,7 @@ class GraduationTaskssettingapp extends Component{ flagPageEdit: true, }) } - } catch (e) { - } } @@ -1025,8 +1029,8 @@ class GraduationTaskssettingapp extends Component{
    -
    -
    +
    +
    任务列表 任务问答 @@ -1113,7 +1117,7 @@ class GraduationTaskssettingapp extends Component{ -
    +
    发布时间: @@ -1150,7 +1154,7 @@ class GraduationTaskssettingapp extends Component{ {this.state.publishTimetypesval}
    :""} -
    +
    截止时间: @@ -1166,7 +1170,7 @@ class GraduationTaskssettingapp extends Component{ value={end_time===null||end_time===""?"":moment(end_time, dateFormat)} onChange={this.onChangeTimeend} disabledTime={disabledDateTime} - disabled={this.props.isAdmin()===true?endtimetype===true?true:flagPageEdit===true?false:true:true} + disabled={this.props.isSuperAdmin()===true?flagPageEdit===true?false:true:this.props.isAdmin()===true?endtimetype===true?true:flagPageEdit===true?false:true:true} className={this.state.endTimetypes===true||end_timetype===true?"noticeTip":""} /> diff --git a/public/react/src/modules/courses/graduation/tasks/GraduationTaskssettinglist.js b/public/react/src/modules/courses/graduation/tasks/GraduationTaskssettinglist.js index 4c5496ad5..d0b30db93 100644 --- a/public/react/src/modules/courses/graduation/tasks/GraduationTaskssettinglist.js +++ b/public/react/src/modules/courses/graduation/tasks/GraduationTaskssettinglist.js @@ -105,10 +105,12 @@ class GraduationTaskssettinglist extends Component{ teacherrating: worklists[i].teacher_comment_score, crossrating: worklists[i].cross_comment_score, finalscore: worklists[i].final_score.work_score === null ? "--" : worklists[i].final_score.work_score, - operation: this.props.isAdmin()?[{name: worklists[i].assign === true ? "分配" : "", id: worklists[i].id}, { + operation: this.props.isAdmin()?[{name: worklists[i].assign === true ? "分配" : "", id: worklists[i].id,status:worklists[i].status}, { name: "调分", - id: worklists[i].id - }, {name:"评阅", id: worklists[i].id}]:[{name:"", id: worklists[i].id}], + id: worklists[i].id, + status:worklists[i].status + }, {name:"评阅", id: worklists[i].id, status:worklists[i].status}]:[{name:"", id: worklists[i].id, + status:worklists[i].status}], }) } } @@ -723,8 +725,8 @@ class GraduationTaskssettinglist extends Component{
    {this.props.isAdmin()?operation.map((tag,key) => { return( -
    - 调整学生最终成绩
    +
    + {tag.status===0?"--":调整学生最终成绩
    其它历史评分将全部失效:""}> {tag.name==="评阅"?{tag.name} @@ -734,7 +736,7 @@ class GraduationTaskssettinglist extends Component{ >{tag.name} } -
    + }
    ) }):""} @@ -742,8 +744,10 @@ class GraduationTaskssettinglist extends Component{ this.props.isStudent()? operation.map((tag,key) => { return( -
    +
    + {tag.status===0?"--": 查看 + }
    )} ):"" @@ -853,8 +857,9 @@ class GraduationTaskssettinglist extends Component{
    {this.props.isAdmin()?operation.map((tag,key) => { return( -
    - 调整学生最终成绩
    +
    + {tag.status===0?"--": + 调整学生最终成绩
    其它历史评分将全部失效:""}> {tag.name==="评阅"?{tag.name} @@ -865,6 +870,7 @@ class GraduationTaskssettinglist extends Component{ }
    + }
    ) }):""} @@ -872,8 +878,10 @@ class GraduationTaskssettinglist extends Component{ this.props.isStudent()? operation.map((tag,key) => { return( -
    +
    + {tag.status===0?"--": 查看 + }
    )} ):"" @@ -997,16 +1005,18 @@ class GraduationTaskssettinglist extends Component{
    {this.props.isAdmin()?operation.map((tag,key) => { return( -
    - 调整学生最终成绩
    - 其它历史评分将全部失效:""}> - {tag.name==="评阅"?{tag.name} - : - this.showModulationtype(tag.id):tag.name==="分配"?()=>this.showAllocationModal(tag.id):""} - >{tag.name} - } -
    +
    + {tag.status===0?"--": + 调整学生最终成绩
    + 其它历史评分将全部失效:""}> + {tag.name==="评阅"?{tag.name} + : + this.showModulationtype(tag.id):tag.name==="分配"?()=>this.showAllocationModal(tag.id):""} + >{tag.name} + } +
    + }
    ) }):""} @@ -1015,8 +1025,10 @@ class GraduationTaskssettinglist extends Component{ this.props.isStudent()? operation.map((tag,key) => { return( -
    +
    + {tag.status===0?"--": 查看 + }
    )} ):"" @@ -1125,7 +1137,8 @@ class GraduationTaskssettinglist extends Component{
    {this.props.isAdmin()?operation.map((tag,key) => { return( -
    +
    + {tag.status===0?"--": 调整学生最终成绩
    其它历史评分将全部失效:""}> {tag.name==="评阅"?{tag.name} @@ -1135,6 +1148,7 @@ class GraduationTaskssettinglist extends Component{ >{tag.name} }
    + }
    ) }):""} @@ -1143,8 +1157,10 @@ class GraduationTaskssettinglist extends Component{ this.props.isStudent()? operation.map((tag,key) => { return( -
    - 查看 +
    + {tag.status===0?"--": + 查看 + }
    )} ):"" diff --git a/public/react/src/modules/courses/graduation/tasks/GraduationTaskssettingquestions.js b/public/react/src/modules/courses/graduation/tasks/GraduationTaskssettingquestions.js index acf160c1f..f373af827 100644 --- a/public/react/src/modules/courses/graduation/tasks/GraduationTaskssettingquestions.js +++ b/public/react/src/modules/courses/graduation/tasks/GraduationTaskssettingquestions.js @@ -1,7 +1,7 @@ import React,{Component} from "React"; import { Form, Select, Input, Button,Checkbox,Upload,Icon,message,Modal, Table, Divider, Tag} from "antd"; import {Link} from 'react-router-dom'; -import { WordsBtn } from 'educoder'; +import { WordsBtn,markdownToHTML} from 'educoder'; import axios from 'axios'; import Modals from '../../../modals/Modals'; import HomeworkModal from "../../coursesPublic/HomeworkModal"; @@ -332,7 +332,7 @@ class GraduationTasksquestions extends Component{ width: '100%', border: '1px solid transparent' }}> - {questionslist.description} +
    :"" } diff --git a/public/react/src/modules/forums/PostItem.js b/public/react/src/modules/forums/PostItem.js index 2f79e6dc5..aa610184f 100644 --- a/public/react/src/modules/forums/PostItem.js +++ b/public/react/src/modules/forums/PostItem.js @@ -1,104 +1,104 @@ -import React, { Component } from 'react'; -import { Redirect } from 'react-router'; - -import { BrowserRouter as Router, Route, Link, Switch } from "react-router-dom"; - -import PropTypes from 'prop-types'; - -import classNames from 'classnames'; - -import { getImageUrl, toPath } from 'educoder'; - -import moment from 'moment'; - - -class PostItem extends Component { - _toTenThousand(num) { - if (num > 10000) { - return ( (num - 500)/ 10000 ).toFixed(1) + '万' - } - return num - } - - render() { - const { match, history, currentPage, memo, user, setTop, setDown } = this.props - return ( -
    -
    - - 用户头像 - -
    -

    - {/* target="_blank" */} - - {memo.subject} - - - { memo.sticky && 置顶 } - - { memo.reward && - - {memo.reward} - - } -

    - -
    - {memo.username} - {/*最后回复:todo{memo.username} - memo.language && memo.language != 'other' && {memo.language} - */} - {moment(memo.updated_at).fromNow()} - {memo.tag && memo.tag.length ? 来自 {memo.tag.join('/')} : ''} - - {/*C++*/} - -

    - {/* data-tip-down="回复数" {memo.replies_count} - {memo.praise_count}*/} - {memo.replies_count ? - - {memo.replies_count} 回复 - :''} - - {memo.praise_count ? - - {memo.praise_count} 赞 - :''} - - {memo.viewed_count ? - - {this._toTenThousand(memo.viewed_count)} 浏览 - :''} - -

    -
    - { user && (user.admin === true || user.user_id === memo.author_id) && - - } -
    -
    -
    - ); - } -} -export default PostItem +import React, { Component } from 'react'; +import { Redirect } from 'react-router'; + +import { BrowserRouter as Router, Route, Link, Switch } from "react-router-dom"; + +import PropTypes from 'prop-types'; + +import classNames from 'classnames'; + +import { getImageUrl, toPath } from 'educoder'; + +import moment from 'moment'; + + +class PostItem extends Component { + _toTenThousand(num) { + if (num > 10000) { + return ( (num - 500)/ 10000 ).toFixed(1) + '万' + } + return num + } + + render() { + const { match, history, currentPage, memo, user, setTop, setDown } = this.props + return ( +
    +
    + + 用户头像 + +
    +

    + {/* target="_blank" */} + + {memo.subject} + + + { memo.sticky && 置顶 } + + { memo.reward && + + {memo.reward} + + } +

    + +
    + {memo.username} + {/*最后回复:todo{memo.username} + memo.language && memo.language != 'other' && {memo.language} + */} + {moment(memo.updated_at).fromNow()} + {memo.tag && memo.tag.length ? 来自 {memo.tag.join('/')} : ''} + + {/*C++*/} + +

    + {/* data-tip-down="回复数" {memo.replies_count} + {memo.praise_count}*/} + {memo.replies_count ? + + {memo.replies_count} 回复 + :''} + + {memo.praise_count ? + + {memo.praise_count} 赞 + :''} + + {memo.viewed_count ? + + {this._toTenThousand(memo.viewed_count)} 浏览 + :''} + +

    +
    + { user && (user.admin === true || user.user_id === memo.author_id) && + + } +
    +
    +
    + ); + } +} +export default PostItem From 06367bf257790a1401be98a2e554822741d3d37e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Fri, 21 Jun 2019 09:05:22 +0800 Subject: [PATCH 10/10] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../courses/graduation/tasks/GraduationTasksappraise.js | 4 ++-- .../courses/graduation/tasks/GraduationTaskssetting.js | 8 ++++---- .../src/modules/tpm/shixunchild/Challenges/Challenges.js | 6 ++---- 3 files changed, 8 insertions(+), 10 deletions(-) diff --git a/public/react/src/modules/courses/graduation/tasks/GraduationTasksappraise.js b/public/react/src/modules/courses/graduation/tasks/GraduationTasksappraise.js index 374318af1..a45a105fd 100644 --- a/public/react/src/modules/courses/graduation/tasks/GraduationTasksappraise.js +++ b/public/react/src/modules/courses/graduation/tasks/GraduationTasksappraise.js @@ -1,7 +1,7 @@ import React,{Component} from "React"; import { Form, Select, Input, Button,Checkbox,Upload,Icon,message,Modal, Table, Divider, Tag} from "antd"; import {Link} from 'react-router-dom'; -import { WordsBtn } from 'educoder'; +import { WordsBtn,markdownToHTML } from 'educoder'; import axios from 'axios'; import moment from 'moment'; import Modals from '../../../modals/Modals'; @@ -205,7 +205,7 @@ class GraduationTasksappraise extends Component{
    - {datalist&&datalist.description} +
    {/*
    */} diff --git a/public/react/src/modules/courses/graduation/tasks/GraduationTaskssetting.js b/public/react/src/modules/courses/graduation/tasks/GraduationTaskssetting.js index 9d0b33e80..762fe1406 100644 --- a/public/react/src/modules/courses/graduation/tasks/GraduationTaskssetting.js +++ b/public/react/src/modules/courses/graduation/tasks/GraduationTaskssetting.js @@ -111,11 +111,11 @@ class GraduationTaskssettingapp extends Component{ max_nums: result.data.max_num, task_type: result.data.task_type, baseonproject: result.data.base_on_project, - publish_time:moment(moment(handleDateString(result.data.publish_time))).format("YYYY-MM-DD HH:mm"), - end_time:moment(moment(handleDateString(result.data.end_time))).format("YYYY-MM-DD HH:mm"), + publish_time:result.data.publish_time===null?"":moment(moment(handleDateString(result.data.publish_time))).format("YYYY-MM-DD HH:mm"), + end_time:result.data.end_time===null?"":moment(moment(handleDateString(result.data.end_time))).format("YYYY-MM-DD HH:mm"), allowlate: result.data.allow_late, latepenalty: result.data.late_penalty, - latetime:moment(moment(handleDateString(result.data.late_time))).format("YYYY-MM-DD HH:mm"), + latetime:result.data.late_time===null?"":moment(moment(handleDateString(result.data.late_time))).format("YYYY-MM-DD HH:mm"), crosscomment: result.data.cross_comment, taskid: result.data.id, taskname: result.data.task_name, @@ -128,7 +128,7 @@ class GraduationTaskssettingapp extends Component{ hasproject: result.data.has_project, hascommit: result.data.has_commit, assigngroups: assigngroups, - commenttime:moment(moment(handleDateString(result.data.comment_time))).format("YYYY-MM-DD HH:mm"), + commenttime:result.data.comment_time===null?"":moment(moment(handleDateString(result.data.comment_time))).format("YYYY-MM-DD HH:mm"), task_status: result.data.task_status }) } diff --git a/public/react/src/modules/tpm/shixunchild/Challenges/Challenges.js b/public/react/src/modules/tpm/shixunchild/Challenges/Challenges.js index c6870c2e9..38584c793 100644 --- a/public/react/src/modules/tpm/shixunchild/Challenges/Challenges.js +++ b/public/react/src/modules/tpm/shixunchild/Challenges/Challenges.js @@ -8,7 +8,7 @@ import PropTypes from 'prop-types'; import classNames from 'classnames'; -import { getImageUrl } from 'educoder' +import { getImageUrl ,markdownToHTML} from 'educoder' import { CircularProgress } from 'material-ui/Progress'; @@ -250,9 +250,7 @@ class Challenges extends Component { id="challenge_editorMd_description">

    {ChallengesDataList === undefined ? "" :ChallengesDataList.description===null?"": - +

    }