From ee6d0ee4aef0c5f690d748e4c1c7fee5e844b5dd Mon Sep 17 00:00:00 2001 From: caishi <1149225589@qq.com> Date: Thu, 20 Jun 2019 17:06:27 +0800 Subject: [PATCH 1/7] =?UTF-8?q?=E9=80=89=E9=A2=98=E6=96=B0=E5=BB=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../courses/graduation/topics/GraduateTopicNew.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/public/react/src/modules/courses/graduation/topics/GraduateTopicNew.js b/public/react/src/modules/courses/graduation/topics/GraduateTopicNew.js index 876f2e4d0..7c0811615 100644 --- a/public/react/src/modules/courses/graduation/topics/GraduateTopicNew.js +++ b/public/react/src/modules/courses/graduation/topics/GraduateTopicNew.js @@ -38,7 +38,7 @@ class GraduateTopicNew extends Component{ topic_source:[], topic_type:[], attachments:undefined, - addonAfter:20, + addonAfter:60, left_banner_id:undefined, course_name:undefined } @@ -257,7 +257,7 @@ class GraduateTopicNew extends Component{ // 附件相关 ------------ END changeTopicName=(e)=>{ - let num= 20 - parseInt(e.target.value.length); + let num= 60 - parseInt(e.target.value.length); this.setState({ addonAfter:num < 0 ? 0 : num }) @@ -357,10 +357,10 @@ class GraduateTopicNew extends Component{ rules: [{ required: true, message: '请输入选题名称', }, { - max: 20, message: '最大限制为20个字符', + max: 60, message: '最大限制为60个字符', }], })( - + )} @@ -381,6 +381,9 @@ class GraduateTopicNew extends Component{ width: 350px; margin-bottom:10px; } + .ant-upload-list-item{ + margin-top:0px!important; + } `} From 86a20e86803fce6131d1ce664a78f395a3257341 Mon Sep 17 00:00:00 2001 From: caishi <1149225589@qq.com> Date: Fri, 21 Jun 2019 10:09:35 +0800 Subject: [PATCH 2/7] =?UTF-8?q?=E4=B8=AA=E4=BA=BA=E4=B8=BB=E9=A1=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../graduation/topics/GraduateTopicDetail.js | 46 +++++++++++++------ .../topics/GraduateTopicDetailInfo.js | 7 ++- .../topics/GraduateTopicDetailTable.js | 2 +- .../graduation/topics/GraduateTopicItem.js | 14 +++--- .../graduation/topics/GraduateTopicNew.js | 43 +++++++++++++++-- .../courses/graduation/topics/index.js | 18 +++++++- .../courses/poll/PollDetailTabFirst.js | 2 +- .../src/modules/courses/poll/PollListItem.js | 29 +++++------- .../modules/tpm/challengesnew/TPMMDEditor.js | 2 +- .../react/src/modules/user/usersInfo/Infos.js | 2 +- .../src/modules/user/usersInfo/InfosCourse.js | 17 ++++--- .../src/modules/user/usersInfo/InfosPath.js | 8 ++-- .../modules/user/usersInfo/InfosProject.js | 17 ++++--- .../src/modules/user/usersInfo/InfosShixun.js | 8 ++-- 14 files changed, 143 insertions(+), 72 deletions(-) diff --git a/public/react/src/modules/courses/graduation/topics/GraduateTopicDetail.js b/public/react/src/modules/courses/graduation/topics/GraduateTopicDetail.js index e0eb07d56..27c27c64a 100644 --- a/public/react/src/modules/courses/graduation/topics/GraduateTopicDetail.js +++ b/public/react/src/modules/courses/graduation/topics/GraduateTopicDetail.js @@ -67,25 +67,35 @@ class GraduateTopicDetail extends Component{ let course_id=this.props.match.params.course_id; let {tableData}=this.state; - let url="/courses/"+course_id+"/graduation_topics/"+graduation_topic_id+"/" - if(tableData.user_selected_topic){ - url+="student_cancel_topic.json" - }else{ - url+="student_select_topic.json" - } - axios.post((url)).then((result)=>{ - console.log(result); - if(result.data.status == 0){ - this.getDetailList(); - this.props.showNotification(`${result.data.message}`); + this.props.confirm({ + content: tableData.user_selected_topic==0?`是否确认取消选题?`:"是否确认选题?", + onOk: () => { + let url="/courses/"+course_id+"/graduation_topics/"+graduation_topic_id+"/" + if(tableData.user_selected_topic==0){ + url+="student_cancel_topic.json" + }else if(tableData.user_selected_topic==null || tableData.user_selected_topic==2){ + url+="student_select_topic.json" + } + axios.post((url)).then((result)=>{ + console.log(result); + if(result.data.status == 0){ + this.getDetailList(); + this.props.showNotification(`${result.data.message}`); + } + }).catch((error)=>{ + console.log(error); + }) } - }).catch((error)=>{ - console.log(error); }) } render(){ - let {tableData,tablePage,tablePageSize,tab}=this.state + let { + tableData, + tablePage, + tablePageSize, + tab, + }=this.state let {course_id,graduation_topic_id}=this.props.match.params; const isStudent =this.props.isStudent(); const isAdmin =this.props.isAdmin(); @@ -113,8 +123,14 @@ class GraduateTopicDetail extends Component{ 课题详情 + {/* null: 未选题 0:待确认 1:已同意 2:已拒绝 */} + { + isStudent && tableData.user_selected == false && (tableData.user_selected_topic==null || tableData.user_selected_topic==2) && + 选题 + } { - isStudent && {tableData.user_selected_topic ? "取消选题":"选题"} + isStudent && tableData.user_selected == true && tableData.user_selected_topic==0 && + 取消选题 } { isAdmin && 编辑 diff --git a/public/react/src/modules/courses/graduation/topics/GraduateTopicDetailInfo.js b/public/react/src/modules/courses/graduation/topics/GraduateTopicDetailInfo.js index 708de6dcb..f0694964c 100644 --- a/public/react/src/modules/courses/graduation/topics/GraduateTopicDetailInfo.js +++ b/public/react/src/modules/courses/graduation/topics/GraduateTopicDetailInfo.js @@ -57,12 +57,17 @@ class GraduateTopicDetailTable extends Component{ return(
+
{ topicInfo && topicInfo.description!="" && - + }
{ diff --git a/public/react/src/modules/courses/graduation/topics/GraduateTopicDetailTable.js b/public/react/src/modules/courses/graduation/topics/GraduateTopicDetailTable.js index 7dbbf21f7..963c7a4f9 100644 --- a/public/react/src/modules/courses/graduation/topics/GraduateTopicDetailTable.js +++ b/public/react/src/modules/courses/graduation/topics/GraduateTopicDetailTable.js @@ -254,7 +254,7 @@ class GraduateTopicDetailTable extends Component{ tableData.users_list && tableData.users_list.length > 0 && tableData.users_list.map((item,key)=>{ return(
  • - {parseInt(key)*parseInt(page*15)+1} + {parseInt(key+1)+(parseInt(page-1)*15)} {item.student_name} {item.student_id} {item.class_group_name || "--"} diff --git a/public/react/src/modules/courses/graduation/topics/GraduateTopicItem.js b/public/react/src/modules/courses/graduation/topics/GraduateTopicItem.js index 136280943..17a1b070e 100644 --- a/public/react/src/modules/courses/graduation/topics/GraduateTopicItem.js +++ b/public/react/src/modules/courses/graduation/topics/GraduateTopicItem.js @@ -96,26 +96,26 @@ class GraduateTopicItem extends Component{

    - + {discussMessage.author} - {discussMessage.selected_count} 已选 - {discussMessage.confirmation_count} 已确认 + {discussMessage.selected_count} 已选 + {discussMessage.confirmation_count} 已确认 { isAdmin && this.editTopic(`${discussMessage.id}`)} style="blue" className="font-16">编辑 } { - isStudent && data.user_selected == true && discussMessage.user_selected==true && - chooseTopic(`${discussMessage.id}`,index,discussMessage.user_selected)} style="blue" className="font-16"> + isStudent && data.user_selected == true && discussMessage.user_topic_status==0 && + chooseTopic(`${discussMessage.id}`,index,true)} style="blue" className="font-16"> 取消选题 } { - isStudent && data.user_selected == false && discussMessage.user_selected == false && - chooseTopic(`${discussMessage.id}`,index,discussMessage.user_selected)} style="blue" className="font-16"> + isStudent && data.user_selected==false && (discussMessage.user_topic_status == null || discussMessage.user_topic_status == 2) && + chooseTopic(`${discussMessage.id}`,index,false)} style="blue" className="font-16"> 选题 } diff --git a/public/react/src/modules/courses/graduation/topics/GraduateTopicNew.js b/public/react/src/modules/courses/graduation/topics/GraduateTopicNew.js index 7c0811615..c3c0d18e2 100644 --- a/public/react/src/modules/courses/graduation/topics/GraduateTopicNew.js +++ b/public/react/src/modules/courses/graduation/topics/GraduateTopicNew.js @@ -87,7 +87,7 @@ class GraduateTopicNew extends Component{ let topicId=this.props.match.params.topicId let url=`/courses/${cid}/graduation_topics/${topicId}/edit.json`; axios.get((url)).then((result)=>{ - if(result.status==200){ + if(result){ this.setState({ left_banner_id:result.data.left_banner_id, course_name:result.data.course_name, @@ -315,6 +315,11 @@ class GraduateTopicNew extends Component{ console.log(this.props); return(

    +

    {course_name} @@ -384,6 +389,31 @@ class GraduateTopicNew extends Component{ .ant-upload-list-item{ margin-top:0px!important; } + + .ant-form-item-children{ + position:unset + } + .rememberTip{ + position:absolute; + right:0px; + bottom:-10px; + } + .chooseDes .ant-form-explain{ + position:absolute; + bottom:-10px; + left:0px; + } + .setUploadStyle .uploadBtn{ + height:20px; + line-height:20px; + } + .setUploadStyle .ant-form-item-control{ + margin-top:15px!important; + line-height:22px!important; + } + .setUploadStyle .ant-upload-list{ + margin-top:5px; + } `} @@ -392,7 +422,7 @@ class GraduateTopicNew extends Component{ {getFieldDecorator('description', { rules: [{ @@ -405,7 +435,9 @@ class GraduateTopicNew extends Component{ mdID={'courseMessageMD'} initValue={this.editTopic ? this.editTopic.content : ''} className="courseMessageMD"> )} - + { getFieldDecorator('file',{ rules:[{ @@ -508,6 +540,9 @@ class GraduateTopicNew extends Component{ .flexBlock .ant-row.ant-form-item { margin-bottom: 6px; } + .ant-cascader-menu{ + min-width:125px!important; + } `} @@ -546,7 +581,7 @@ class GraduateTopicNew extends Component{ {getFieldDecorator('city', { rules: [{ diff --git a/public/react/src/modules/courses/graduation/topics/index.js b/public/react/src/modules/courses/graduation/topics/index.js index d7d6852f2..f84f53952 100644 --- a/public/react/src/modules/courses/graduation/topics/index.js +++ b/public/react/src/modules/courses/graduation/topics/index.js @@ -223,7 +223,23 @@ onDelete=(index)=>{ }) }else{ // 加入题库 - + let courseid=this.props.match.params.coursesId + let url=`/courses/${courseid}/graduation_topics/add_to_bank.json`; + axios.post((url),{ + topic_ids:checkBoxValues + }).then((result)=>{ + if(result){ + this.props.showNotification(`题库更新成功`); + let {searchValue,page,status} =this.state + this.fetchAll(searchValue,page,status); + this.setState({ + checkBoxValues:[], + checkAllValue:false + }) + } + }).catch((error)=>{ + console.log(error) + }) } }else{ diff --git a/public/react/src/modules/courses/poll/PollDetailTabFirst.js b/public/react/src/modules/courses/poll/PollDetailTabFirst.js index 4166895e1..6a5be2e8d 100644 --- a/public/react/src/modules/courses/poll/PollDetailTabFirst.js +++ b/public/react/src/modules/courses/poll/PollDetailTabFirst.js @@ -187,7 +187,7 @@ class PollDetailTabFirst extends Component{ key: 'classes', dataIndex: 'classes', width:160, - className:course_groups && course_groups.length > 0?"edu-txt-center":"edu-txt-center none" + className:poll_types && poll_types.groups_count > 0 ? "edu-txt-center":"edu-txt-center none" }, { title: '提交状态', dataIndex: 'status', diff --git a/public/react/src/modules/courses/poll/PollListItem.js b/public/react/src/modules/courses/poll/PollListItem.js index 769b4db33..3ebb6eb73 100644 --- a/public/react/src/modules/courses/poll/PollListItem.js +++ b/public/react/src/modules/courses/poll/PollListItem.js @@ -49,23 +49,23 @@ class PollListItem extends Component{

    { item.polls_status !=1 && - + {item.poll_answer} 已答 {item.poll_unanswer} 未答 } { item.polls_status ==1 && item.publish_time ==null && item.created_at && - 创建于{moment(item.created_at).format(dataformat)} + 创建于{moment(item.created_at).format(dataformat)} } { item.polls_status ==1 && item.publish_time !=null && - 将发布于{moment(item.publish_time).format(dataformat)} + 将发布于{moment(item.publish_time).format(dataformat)} } { item.polls_status ==2 && item.publish_time !=null && - {formatDuring(t)} + {formatDuring(t)} } { @@ -81,21 +81,14 @@ class PollListItem extends Component{ } :"" } -

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

    ) diff --git a/public/react/src/modules/tpm/challengesnew/TPMMDEditor.js b/public/react/src/modules/tpm/challengesnew/TPMMDEditor.js index 30fa1c803..4af26d698 100644 --- a/public/react/src/modules/tpm/challengesnew/TPMMDEditor.js +++ b/public/react/src/modules/tpm/challengesnew/TPMMDEditor.js @@ -300,7 +300,7 @@ export default class TPMMDEditor extends Component {
  • -
    +
    {noStorage == true ? '' :

    } {noStorage == true ? '' :

    }
    diff --git a/public/react/src/modules/user/usersInfo/Infos.js b/public/react/src/modules/user/usersInfo/Infos.js index 0f608426c..8d77a1b29 100644 --- a/public/react/src/modules/user/usersInfo/Infos.js +++ b/public/react/src/modules/user/usersInfo/Infos.js @@ -268,7 +268,7 @@ class Infos extends Component{ 实训 实训课程 项目 - { isAdmin && 题库 } + { data && data.identity !="学生" && this.ToBank(`/`)}>题库 }
    diff --git a/public/react/src/modules/user/usersInfo/InfosCourse.js b/public/react/src/modules/user/usersInfo/InfosCourse.js index 1a6b78542..b864dff63 100644 --- a/public/react/src/modules/user/usersInfo/InfosCourse.js +++ b/public/react/src/modules/user/usersInfo/InfosCourse.js @@ -41,7 +41,7 @@ class InfosCourse extends Component{ category, status, page, - per_page:category && page ==1?17:16 + per_page: this.props.is_current && category && page ==1?17:16 }}).then((result)=>{ if(result){ this.setState({ @@ -111,18 +111,21 @@ class InfosCourse extends Component{
  • this.changeCategory("manage")}>{is_current ? "我":"TA"}管理的
  • this.changeCategory("study")}>{is_current ? "我":"TA"}学习的
  • -
    -
  • this.changeStatus()}>全部
  • -
  • this.changeStatus("processing")}>正在进行
  • -
  • this.changeStatus("end")}>已结束
  • -
    + { + is_current && +
    +
  • this.changeStatus()}>全部
  • +
  • this.changeStatus("processing")}>正在进行
  • +
  • this.changeStatus("end")}>已结束
  • +
    + }

    共参与{totalCount}个{category?category=="manage"?"发布":"学习":"课堂"} 时间最新

    { - !isStudent && page == 1 && !category && + !isStudent && page == 1 && !category && is_current && } { diff --git a/public/react/src/modules/user/usersInfo/InfosPath.js b/public/react/src/modules/user/usersInfo/InfosPath.js index 156370f05..55422f208 100644 --- a/public/react/src/modules/user/usersInfo/InfosPath.js +++ b/public/react/src/modules/user/usersInfo/InfosPath.js @@ -44,7 +44,7 @@ class InfosPath extends Component{ status, sort_by, page, - per_page:category && page ==1?17:16 + per_page:this.props.is_current && category && page ==1?17:16 }}).then((result)=>{ if(result){ this.setState({ @@ -126,7 +126,7 @@ class InfosPath extends Component{
  • this.changeCategory("study")}>{is_current ? "我":"TA"}学习的
  • { - category && category == "manage" && + category && category == "manage" && is_current &&
  • this.changeStatus()}>全部
  • this.changeStatus("editing")}>编辑中
  • @@ -135,7 +135,7 @@ class InfosPath extends Component{
    } { - category && category == "study" && + category && category == "study" && is_current &&
  • this.changeStatus()}>全部
  • this.changeStatus("unfinished")}>未完成
  • @@ -148,7 +148,7 @@ class InfosPath extends Component{
    { - isStudent ==false && page == 1 && !category && + !isStudent && page == 1 && !category && is_current && } { diff --git a/public/react/src/modules/user/usersInfo/InfosProject.js b/public/react/src/modules/user/usersInfo/InfosProject.js index eb3ef9b65..fab96f59e 100644 --- a/public/react/src/modules/user/usersInfo/InfosProject.js +++ b/public/react/src/modules/user/usersInfo/InfosProject.js @@ -37,7 +37,7 @@ class InfosProject extends Component{ category, status, page, - per_page:category && page ==1?17:16 + per_page:this.props.is_current && category && page ==1?17:16 }}).then((result)=>{ if(result){ this.setState({ @@ -107,18 +107,21 @@ class InfosProject extends Component{
  • this.changeCategory("manage")}>{is_current ? "我":"TA"}管理的
  • this.changeCategory("study")}>{is_current ? "我":"TA"}学习的
  • -
    -
  • this.changeStatus()}>全部
  • -
  • this.changeStatus("publicly")}>公开
  • -
  • this.changeStatus("personal")}>私有
  • -
    + { + is_current && +
    +
  • this.changeStatus()}>全部
  • +
  • this.changeStatus("publicly")}>公开
  • +
  • this.changeStatus("personal")}>私有
  • +
    + }

    共参与{totalCount}个{category?category=="manage"?"发布":"学习":"项目"} 时间最新

    { - !isStudent && page == 1 && !category && + !isStudent && page == 1 && !category && is_current && } { diff --git a/public/react/src/modules/user/usersInfo/InfosShixun.js b/public/react/src/modules/user/usersInfo/InfosShixun.js index 1fcd86b98..90575f9f0 100644 --- a/public/react/src/modules/user/usersInfo/InfosShixun.js +++ b/public/react/src/modules/user/usersInfo/InfosShixun.js @@ -44,7 +44,7 @@ class InfosShixun extends Component{ status, sort_by, page, - per_page:category && page ==1?17:16 + per_page:this.props.is_current && category && page ==1?17:16 }}).then((result)=>{ if(result){ this.setState({ @@ -126,7 +126,7 @@ class InfosShixun extends Component{
  • this.changeCategory("study")}>{is_current ? "我":"TA"}学习的
  • { - category && category == "manage" && + category && category == "manage" && is_current &&
  • this.changeStatus()}>全部
  • this.changeStatus("editing")}>编辑中
  • @@ -136,7 +136,7 @@ class InfosShixun extends Component{
    } { - category && category == "study" && + category && category == "study" && is_current &&
  • this.changeStatus()}>全部
  • this.changeStatus("processing")}>未通关
  • @@ -157,7 +157,7 @@ class InfosShixun extends Component{
    { - isStudent ==false && page == 1 && !category && + !isStudent && page == 1 && !category && is_current && } { From 19bf3d635a08b619d67898ee667fcb61f209dc5f Mon Sep 17 00:00:00 2001 From: caishi <1149225589@qq.com> Date: Fri, 21 Jun 2019 11:19:04 +0800 Subject: [PATCH 3/7] =?UTF-8?q?=E6=AF=95=E8=AE=BE=E4=BB=BB=E5=8A=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modules/courses/graduation/tasks/index.js | 38 +++++++++---------- .../graduation/topics/GraduateTopicDetail.js | 2 +- .../topics/GraduateTopicDetailInfo.js | 17 +-------- .../react/src/modules/user/usersInfo/Infos.js | 21 ++++++++-- 4 files changed, 38 insertions(+), 40 deletions(-) diff --git a/public/react/src/modules/courses/graduation/tasks/index.js b/public/react/src/modules/courses/graduation/tasks/index.js index fa86da93d..5553db968 100644 --- a/public/react/src/modules/courses/graduation/tasks/index.js +++ b/public/react/src/modules/courses/graduation/tasks/index.js @@ -744,24 +744,20 @@ class GraduationTasks extends Component{ -
    - -
    - + { + all_count > 15 && +
    + +
    + }
    -
    -

    暂无数据哦~

    +
    + +

    暂无数据哦~

    diff --git a/public/react/src/modules/courses/graduation/topics/GraduateTopicDetail.js b/public/react/src/modules/courses/graduation/topics/GraduateTopicDetail.js index 27c27c64a..2f6a364a5 100644 --- a/public/react/src/modules/courses/graduation/topics/GraduateTopicDetail.js +++ b/public/react/src/modules/courses/graduation/topics/GraduateTopicDetail.js @@ -120,7 +120,7 @@ class GraduateTopicDetail extends Component{
    选题列表 - 课题详情 + 选题问答
    {/* null: 未选题 0:待确认 1:已同意 2:已拒绝 */} diff --git a/public/react/src/modules/courses/graduation/topics/GraduateTopicDetailInfo.js b/public/react/src/modules/courses/graduation/topics/GraduateTopicDetailInfo.js index f0694964c..b1cfe7c6e 100644 --- a/public/react/src/modules/courses/graduation/topics/GraduateTopicDetailInfo.js +++ b/public/react/src/modules/courses/graduation/topics/GraduateTopicDetailInfo.js @@ -6,7 +6,7 @@ import '../style.css' import axios from "axios"; import GraduateTopicReply from './GraduateTopicReply' -import { ConditionToolTip,markdownToHTML } from 'educoder' +import { ConditionToolTip,MarkdownToHtml } from 'educoder' const $=window.$; const type={1: "设计",2: "论文", 3: "创作"} @@ -21,18 +21,6 @@ class GraduateTopicDetailTable extends Component{ topicInfo:undefined } } - updatamakedown=(id)=>{ - setTimeout(()=>{ - var shixunDescr = window.editormd.markdownToHTML(id, { - htmlDecode: "style,script,iframe", - taskList: true, - tex: true, - flowChart: true, - sequenceDiagram: true - }); - $("#"+id+" p:first").addClass("ReactMarkdown"); - }, 200) - } componentDidMount=()=>{ let course_id=this.props.match.params.course_id; let graduation_topic_id=this.props.match.params.graduation_topic_id; @@ -47,7 +35,6 @@ class GraduateTopicDetailTable extends Component{ }).catch((error)=>{ console.log(error); }) - this.updatamakedown("gratuationTopic_Detail"); } render(){ let{topicInfo}=this.state @@ -67,7 +54,7 @@ class GraduateTopicDetailTable extends Component{
    { topicInfo && topicInfo.description!="" && - + }
    { diff --git a/public/react/src/modules/user/usersInfo/Infos.js b/public/react/src/modules/user/usersInfo/Infos.js index 8d77a1b29..e5f1e99dd 100644 --- a/public/react/src/modules/user/usersInfo/Infos.js +++ b/public/react/src/modules/user/usersInfo/Infos.js @@ -15,6 +15,8 @@ import "../../courses/css/members.css" import "../../courses/css/Courses.css" import update from 'immutability-helper' +import Trialapplication from '../../login/Trialapplication' + const $ = window.$; class Infos extends Component{ @@ -26,7 +28,8 @@ class Infos extends Component{ is_edit:false, sign:undefined, type:0, - login:undefined + login:undefined, + isRenders:false } } componentDidMount =()=>{ @@ -44,6 +47,14 @@ class Infos extends Component{ } } } + + // 试用申请 + trialapplications =()=>{ + this.setState({ + isRenders: true, + }) + } + //获取个人主页信息 getInfo = (user_login) =>{ let url =`/users/${user_login}/homepage_info.json`; @@ -155,12 +166,16 @@ class Infos extends Component{ type, followed, id, - login + login, + isRenders }=this.state; let {username}= this.props.match.params; let {isAdmin}=this.props.isAdmin(); return(
    + { + isRenders && + }
    @@ -251,7 +266,7 @@ class Infos extends Component{ : 签到 : - 试用申请 + 试用申请 }
    : From 05a22b7e9c97ab7a15e8fd07301b68d5a57970f6 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 12:31:40 +0800 Subject: [PATCH 4/7] =?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/busyWork/CommonWorkSetting.js | 2 +- .../courses/coursesPublic/Associationmodel.js | 476 +++---- .../src/modules/courses/exercise/Exercise.js | 2 +- .../graduation/tasks/GraduateTaskItem.js | 1 + .../tasks/GraduationTaskssetting.js | 10 +- .../tasks/GraduationTaskssettinglist.js | 15 +- .../tasks/GraduationTaskssettingquestions.js | 2 +- .../modules/courses/graduation/tasks/index.js | 2 +- public/react/src/modules/courses/poll/Poll.js | 1240 ++++++++--------- .../poll/pollPublicBtn/ImmediatelyPublish.js | 562 ++++---- .../courses/shixunHomework/Listofworks.js | 2 +- .../shixunHomework/ShixunStudentWork.js | 2 +- .../shixunHomework/Trainingjobsetting.js | 2 +- .../shixunHomework/Workquestionandanswer.js | 2 +- .../courses/shixunHomework/shixunHomework.js | 4 +- 15 files changed, 1165 insertions(+), 1159 deletions(-) diff --git a/public/react/src/modules/courses/busyWork/CommonWorkSetting.js b/public/react/src/modules/courses/busyWork/CommonWorkSetting.js index 3ef242a44..5ce5a5df3 100644 --- a/public/react/src/modules/courses/busyWork/CommonWorkSetting.js +++ b/public/react/src/modules/courses/busyWork/CommonWorkSetting.js @@ -421,7 +421,7 @@ class CommonWorkSetting extends Component{ Topval:"本操作只对“未发布”的对象生效", Botvalleft:"暂不发布", Botval:"则通过后续手动设置,定时发布", - starttime:starttime, + starttime:moment(moment(new Date())).format("YYYY-MM-DD HH:mm"), endtime:endtime, Cancelname:"暂不发布", Savesname:"立即发布", diff --git a/public/react/src/modules/courses/coursesPublic/Associationmodel.js b/public/react/src/modules/courses/coursesPublic/Associationmodel.js index 48616ef1f..1f10caa5f 100644 --- a/public/react/src/modules/courses/coursesPublic/Associationmodel.js +++ b/public/react/src/modules/courses/coursesPublic/Associationmodel.js @@ -1,239 +1,239 @@ -import React,{ Component } from "react"; -import { Modal,Checkbox,Upload,Button,Icon,message,Input,Radio} from "antd"; -import axios from 'axios'; -import Modals from '../../modals/Modals'; -const RadioGroup = Radio.Group; -const Search = Input.Search; - -class Associationmodel extends Component{ - constructor(props){ - super(props); - this.state={ - group_ids:[], - fileList:[], - Modalstype:false, - Modalstopval:"", - ModalCancel:"", - ModalSave:"", - loadtype:false, - search:undefined, - page:1, - limit:"", - projects:undefined, - projectvalue:undefined, - projectvaluetype:false, - } - } - - - componentDidMount() { - this.searchValue(); - } - - searchValue=()=>{ - let {search}=this.state; - let url="/users/search_user_projects.json"; - axios.get(url, { - params: { - search: search - } - }).then((result)=>{ - console.log(result) - if(result.status===200){ - this.setState({ - projects:result.data.projects - }) - } - - }).catch((error)=>{ - console.log(error) - }) - } - - inputSearchValue=(e)=>{ - this.setState({ - search:e.target.value - }) - } - - - goback=()=>{ - this.props.funlist() - this.props.Cancel() - console.log(this.props) - this.setState({ - Modalstype:false, - - }) - } - - - setSaves=()=>{ - let {projectvalue}=this.state; - let taskid=this.props.taskid; - let url="/graduation_tasks/"+taskid+"/graduation_works/relate_project.json"; - - axios.post(url, { - project_id: projectvalue - }).then((result)=>{ - - if(result.status===200){ - if(result.data.status===0){ - - this.setState({ - Modalstype:true, - Modalstopval:result.data.message, - ModalSave:this.goback, - loadtype:true - }) - - } - - } - - }).catch((error)=>{ - console.log(error) - }) - } - Saves=()=>{ - let {projectvalue}=this.state; - if(projectvalue===undefined||projectvalue===""){ - this.setState({ - projectvaluetype:true, - }) - }else{ - this.setState({ - projectvaluetype:false, - }) - } - let taskid=this.props.taskid; - console.log(this.props) - let url="/graduation_tasks/"+taskid+"/graduation_works/check_project.json"; - axios.get(url, { - params: { - project_id: projectvalue - } - }).then((result)=>{ - - if(result.status===200){ - - if(result.data.is_relate===false){ - - this.setSaves() - - }else{ - - this.setState({ - Modalstype:true, - Modalstopval:"该项目已被"+result.data.relate_user+"关联", - ModalSave:this.ModalSave, - loadtype:true - }) - - } - - } - - }).catch((error)=>{ - console.log(error) - }) - } - - onChange = (e) => { - - this.setState({ - projectvalue: e.target.value, - }); - - } - - ModalSave=()=>{ - this.setState({ - Modalstype:false - }) - } - - render(){ - let { - Modalstype, - Modalstopval, - ModalCancel, - ModalSave, - loadtype, - search, - projects, - projectvalue, - projectvaluetype - }=this.state; - - - - return( -
    - {/*提示*/} - - -
    -

    - - - -

    - -
    - - - - {projects&&projects.map((item,key)=>{ - return( -
    - -
    {item.project_name}
    -
    - ) - })} - -
    - -
    - - {projectvaluetype===true?请先选择项目:""} - -
    - 取消 - 确认 -
    - -
    -
    -
    - ) - } -} +import React,{ Component } from "react"; +import { Modal,Checkbox,Upload,Button,Icon,message,Input,Radio} from "antd"; +import axios from 'axios'; +import Modals from '../../modals/Modals'; +const RadioGroup = Radio.Group; +const Search = Input.Search; + +class Associationmodel extends Component{ + constructor(props){ + super(props); + this.state={ + group_ids:[], + fileList:[], + Modalstype:false, + Modalstopval:"", + ModalCancel:"", + ModalSave:"", + loadtype:false, + search:undefined, + page:1, + limit:"", + projects:undefined, + projectvalue:undefined, + projectvaluetype:false, + } + } + + + componentDidMount() { + this.searchValue(); + } + + searchValue=()=>{ + let {search}=this.state; + let url="/users/search_user_projects.json"; + axios.get(url, { + params: { + search: search + } + }).then((result)=>{ + console.log(result) + if(result.status===200){ + this.setState({ + projects:result.data.projects + }) + } + + }).catch((error)=>{ + console.log(error) + }) + } + + inputSearchValue=(e)=>{ + this.setState({ + search:e.target.value + }) + } + + + goback=()=>{ + this.props.funlist() + this.props.Cancel() + console.log(this.props) + this.setState({ + Modalstype:false, + + }) + } + + + setSaves=()=>{ + let {projectvalue}=this.state; + let taskid=this.props.taskid; + let url="/graduation_tasks/"+taskid+"/graduation_works/relate_project.json"; + + axios.post(url, { + project_id: projectvalue + }).then((result)=>{ + + if(result.status===200){ + if(result.data.status===0){ + + this.setState({ + Modalstype:true, + Modalstopval:result.data.message, + ModalSave:this.goback, + loadtype:true + }) + this.props.funlist() + } + + } + + }).catch((error)=>{ + console.log(error) + }) + } + Saves=()=>{ + let {projectvalue}=this.state; + if(projectvalue===undefined||projectvalue===""){ + this.setState({ + projectvaluetype:true, + }) + }else{ + this.setState({ + projectvaluetype:false, + }) + } + let taskid=this.props.taskid; + console.log(this.props) + let url="/graduation_tasks/"+taskid+"/graduation_works/check_project.json"; + axios.get(url, { + params: { + project_id: projectvalue + } + }).then((result)=>{ + + if(result.status===200){ + + if(result.data.is_relate===false){ + + this.setSaves() + + }else{ + + this.setState({ + Modalstype:true, + Modalstopval:"该项目已被"+result.data.relate_user+"关联", + ModalSave:this.ModalSave, + loadtype:true + }) + + } + + } + + }).catch((error)=>{ + console.log(error) + }) + } + + onChange = (e) => { + + this.setState({ + projectvalue: e.target.value, + }); + + } + + ModalSave=()=>{ + this.setState({ + Modalstype:false + }) + } + + render(){ + let { + Modalstype, + Modalstopval, + ModalCancel, + ModalSave, + loadtype, + search, + projects, + projectvalue, + projectvaluetype + }=this.state; + + + + return( +
    + {/*提示*/} + + +
    +

    + + + +

    + +
    + + + + {projects&&projects.map((item,key)=>{ + return( +
    + +
    {item.project_name}
    +
    + ) + })} + +
    + +
    + + {projectvaluetype===true?请先选择项目:""} + +
    + 取消 + 确认 +
    + +
    +
    +
    + ) + } +} export default Associationmodel; \ No newline at end of file diff --git a/public/react/src/modules/courses/exercise/Exercise.js b/public/react/src/modules/courses/exercise/Exercise.js index 608bdf166..a6791fb54 100644 --- a/public/react/src/modules/courses/exercise/Exercise.js +++ b/public/react/src/modules/courses/exercise/Exercise.js @@ -213,7 +213,7 @@ class Exercise extends Component{ Topval:"本操作只对“未发布”的对象生效", Botvalleft:"暂不发布", Botval:"则通过后续手动设置,定时发布", - starttime:"发布时间:"+this.props.getNowFormatDates(1), + starttime:"发布时间:"+moment(moment(new Date())).format("YYYY-MM-DD HH:mm"), starttimes:this.props.getNowFormatDates(1), endtime:"截止时间:"+this.props.getNowFormatDates(2), Cancelname:"暂不发布", diff --git a/public/react/src/modules/courses/graduation/tasks/GraduateTaskItem.js b/public/react/src/modules/courses/graduation/tasks/GraduateTaskItem.js index 942fa96ca..4d6c6777b 100644 --- a/public/react/src/modules/courses/graduation/tasks/GraduateTaskItem.js +++ b/public/react/src/modules/courses/graduation/tasks/GraduateTaskItem.js @@ -65,6 +65,7 @@ class GraduateTaskItem extends Component{ cardsModalsavetype:this.cannerassocition, loadtype:true }) + this.props.funlist() } }).catch((error)=>{ diff --git a/public/react/src/modules/courses/graduation/tasks/GraduationTaskssetting.js b/public/react/src/modules/courses/graduation/tasks/GraduationTaskssetting.js index c74f8a1d7..dfa6879f5 100644 --- a/public/react/src/modules/courses/graduation/tasks/GraduationTaskssetting.js +++ b/public/react/src/modules/courses/graduation/tasks/GraduationTaskssetting.js @@ -415,7 +415,7 @@ class GraduationTaskssettingapp extends Component{ Topval:"发布设置均可修改", Botvalleft:"点击修改", Botval:"此设置将对所有分班生效", - starttime:moment(moment(handleDateString(this.props.getNowFormatDates(1)))).format("YYYY-MM-DD HH:mm") , + starttime:moment(moment(new Date())).format("YYYY-MM-DD HH:mm") , starttimes:this.props.getNowFormatDates(1), typs:"start", endtime:endtime, @@ -1164,7 +1164,7 @@ class GraduationTaskssettingapp extends Component{
    截止时间: - + 指导老师手动分配 (由指导老师在作品列表中,手动选择每个作品被分配的评阅老师) - 答辩组间老师互评 (由系统按照设置在答辩组之间自动分配: - 答辩组设置 + 答辩组间老师互评 (由系统按照设置在答辩组之间自动分配: + + 答辩组设置 + diff --git a/public/react/src/modules/courses/graduation/tasks/GraduationTaskssettinglist.js b/public/react/src/modules/courses/graduation/tasks/GraduationTaskssettinglist.js index 7ef1f99c5..019b739c9 100644 --- a/public/react/src/modules/courses/graduation/tasks/GraduationTaskssettinglist.js +++ b/public/react/src/modules/courses/graduation/tasks/GraduationTaskssettinglist.js @@ -332,7 +332,7 @@ class GraduationTaskssettinglist extends Component{ Topval:"发布设置均可修改", Botvalleft:"点击修改", Botval:"此设置将对所有分班生效", - starttime:moment(new Date()).format('YYYY-MM-DD 00:00'), + starttime:moment(moment(new Date())).format("YYYY-MM-DD HH:mm") , starttimes:this.props.getNowFormatDates(1), typs:"start", endtime:endtime, @@ -544,6 +544,7 @@ class GraduationTaskssettinglist extends Component{ axios.get(url).then((result)=>{ if(result.data.status===0){ + this.searchValue() this.setState({ Modalstype:true, Modalstopval:result.data.message, @@ -730,7 +731,7 @@ class GraduationTaskssettinglist extends Component{ 其它历史评分将全部失效:""}> {tag.name==="评阅"?tag.status===0?"--": - tag.name + {tag.name} : :""}> {tag.name==="评阅"?tag.status===0?"--": - tag.name + {tag.name} : 调整学生最终成绩
    其它历史评分将全部失效:""}> {tag.name==="评阅"?tag.status===0?"--":
    - tag.name + {tag.name} + : this.showModulationtype(tag.id):tag.name==="分配"?()=>this.showAllocationModal(tag.id):""} @@ -1145,7 +1147,7 @@ class GraduationTaskssettinglist extends Component{ 调整学生最终成绩
    其它历史评分将全部失效:""}> {tag.name==="评阅"?tag.status===0?"--":
    - tag.name + {tag.name} : :""} {taskslistdata&&taskslistdata? @@ -1551,7 +1554,7 @@ class GraduationTaskssettinglist extends Component{ to={"/courses/"+courseId+"/graduation_tasks/"+category_id+"/"+task_Id+"/setting"}>设置 - {taskslistdata.work_status===undefined?"":taskslistdata.work_status.map((item,key)=>{ + {taskslistdata.work_status===undefined||taskslistdata.work_status===null||taskslistdata.work_status.length===0?"":taskslistdata.work_status.map((item,key)=>{ return( {item==="提交作品"?提交作品:""} diff --git a/public/react/src/modules/courses/graduation/tasks/GraduationTaskssettingquestions.js b/public/react/src/modules/courses/graduation/tasks/GraduationTaskssettingquestions.js index 80055f5d3..997085d13 100644 --- a/public/react/src/modules/courses/graduation/tasks/GraduationTaskssettingquestions.js +++ b/public/react/src/modules/courses/graduation/tasks/GraduationTaskssettingquestions.js @@ -81,7 +81,7 @@ class GraduationTasksquestions extends Component{ Topval:"发布设置均可修改", Botvalleft:"点击修改", Botval:"此设置将对所有分班生效", - starttime:moment(new Date()).format('YYYY-MM-DD 00:00'), + starttime:moment(moment(new Date())).format("YYYY-MM-DD HH:mm") , starttimes:this.props.getNowFormatDates(1), typs:"start", endtime:endtime, diff --git a/public/react/src/modules/courses/graduation/tasks/index.js b/public/react/src/modules/courses/graduation/tasks/index.js index fa86da93d..f2fc3845e 100644 --- a/public/react/src/modules/courses/graduation/tasks/index.js +++ b/public/react/src/modules/courses/graduation/tasks/index.js @@ -413,7 +413,7 @@ class GraduationTasks extends Component{ Topval:"本操作只对“未发布”的对象生效", Botvalleft:"暂不发布", Botval:"则通过后续手动设置,定时发布", - starttime:"发布时间:"+starttime, + starttime:"发布时间:"+moment(moment(new Date())).format("YYYY-MM-DD HH:mm"), starttimes:this.props.getNowFormatDates(1), typs:"start", endtime:"截止时间:"+endtime, diff --git a/public/react/src/modules/courses/poll/Poll.js b/public/react/src/modules/courses/poll/Poll.js index 2d0aedd7a..aa01bcf47 100644 --- a/public/react/src/modules/courses/poll/Poll.js +++ b/public/react/src/modules/courses/poll/Poll.js @@ -1,621 +1,621 @@ -import React,{ Component } from "react"; -import { Input,Checkbox,Table, Pagination, Modal,Menu, Tooltip ,Spin} from "antd"; -import CourseLayoutcomponent from '../common/CourseLayoutComponent'; -import HomeworkModal from "../coursesPublic/HomeworkModal"; -import ShixunModal from "../coursesPublic/ShixunModal"; -import PathModal from "../coursesPublic/PathModal"; -import AddcoursesNav from "../coursesPublic/AddcoursesNav"; -import ImmediatelyPublish from './pollPublicBtn/ImmediatelyPublish' -import ImmediatelyEnd from './pollPublicBtn/ImmediatelyEnd' -import PollListItem from './PollListItem' -import NoneData from '../coursesPublic/NoneData' -import UseBank from '../busyWork/UseBank' - -import _ from 'lodash'; - -import '../css/members.css' -import '../css/busyWork.css' - - -import { WordsBtn } from 'educoder' -import Modals from '../../modals/Modals' - -import axios from 'axios' - -const Search = Input.Search; - - -class Poll extends Component{ - constructor(props){ - super(props); - this.state={ - modalname:undefined, - modaltype:undefined, - visible:false, - Topval:undefined, - Topvalright:undefined, - Botvalleft:undefined, - Botval:undefined, - starttime:undefined, - endtime:undefined, - Cancelname:undefined, - Savesname:undefined, - Cancel:undefined, - Saves:undefined, - StudentList_value:undefined, - addname:undefined, - addnametype:false, - addnametab:undefined, - addcanner:undefined, - addsave:undefined, - course_groups:[], - chooseId:undefined, - // 列表相关 - checkBoxValues:[], - checkAllValue:false, - pollsList:undefined, - course_types:undefined, - page:1, - pageSize:15, - type:0, - polls_counts:undefined, - - //公用提示弹框相关 - modalsType:false, - modalsTopval:"", - modalsBottomval:"", - loadtype:false, - boxType:"delete", - isSpin:false - } - - } - - inputStudent=(e)=>{ - this.setState({ - StudentList_value:e.target.value - }) - } - - - // 题库选用 - selectBlank=(type)=>{ - if(type===2){ - this.setState({ - addname:"添加目录", - addnametype:true, - addnametab:type, - addcanner:this.homeworkhide, - addsave:undefined - }) - }else if(type===4){ - this.setState({ - addname:"移动到目录", - addnametype:true, - addnametab:type, - addcanner:this.homeworkhide, - addsave:undefined - }) - } - - } - // 切换菜单选项 - changeType=(e)=>{ - this.setState({ - type:e.key, - checkBoxValues:[], - checkAllValue:false - }) - let{StudentList_value,page}=this.state; - this.InitList(e.key,StudentList_value,page); - } - // 获取列表数据 - InitList=(type,search,page)=>{ - this.setState({ - isSpin:true - }) - let {pageSize}=this.state - let coursesId=this.props.match.params.coursesId; - let url='/courses/'+coursesId+'/polls.json?limit='+pageSize+'&page='+page - if(type!="0"){ - url+="&type="+type - } - if(search!=""&&search!=undefined){ - url+="&search="+search - } - axios.get(url).then((result)=>{ - if(result){ - this.setState({ - pollsList:result.data.polls, - course_types:result.data.course_types, - polls_counts:result.data.polls_counts, - isSpin:false, - checkBoxValues:[] - }) - } - }).catch((error)=>{ - console.log(error); - }) - } - // 加载列表 - componentDidMount(){ - this.setState({ - isSpin:true - }) - let{type,StudentList_value,page}=this.state - this.InitList(type,StudentList_value,page); - } - //切换分页 - changePage=(pageNumber)=>{ - - this.setState({ - page:pageNumber - }) - let{type,StudentList_value}=this.state - this.InitList(type,StudentList_value,pageNumber); - } - // 搜索 - searchInfo=()=>{ - this.setState({ - page:1 - }) - let{type,StudentList_value}=this.state; - this.InitList(type,StudentList_value,1) - } - // checkbox - onItemClick = (item) => { - const checkBoxValues = this.state.checkBoxValues.slice(0); - const index = checkBoxValues.indexOf(item.id); - if (index != -1) { - _.remove(checkBoxValues, (listItem)=> listItem === item.id) - } else { - checkBoxValues.push(item.id); - } - this.onCheckBoxChange(checkBoxValues) - } - // 全选or反选 - onCheckAll = (e) => { - this.setState({ - checkAllValue: e.target.checked - }) - const values = this.state.pollsList.map(item => { - return item.id - }) - if (e.target.checked) { - const concated = this.state.checkBoxValues.concat(values); - const uniq=_.uniq(concated) - this.setState({ - checkBoxValues: uniq - }) - } else { - this.setState({ - checkBoxValues: _.difference(this.state.checkBoxValues, values) - }) - } - } - - onCheckBoxChange = (checkedValues) => { - this.setState({ - checkBoxValues: checkedValues, - checkAllValue: checkedValues.length == this.state.pollsList.length - }) - } - - //删除或者设为公开 - ActionPoll=(value)=>{ - let CourseId=this.props.match.params.coursesId; - //判断是否有选中数据 - if(this.state.checkBoxValues.length==0){ - this.props.showNotification("请先在列表中选择数据"); - // this.setState({ - // modalsType:true, - // modalsTopval:"请先在列表中选择数据", - // modalsBottomval:'', - // loadtype:true - // }) - }else{ - if(value != "bank"){ - this.setState({ - modalsType:true, - modalsTopval:value=="delete"?"已提交作品将全部被删除,不可恢复":"公开后非课堂成员也可以访问查看", - modalsBottomval:value=="delete"?"您确定要删除吗?":"是否确认公开?", - loadtype:false, - boxType:value - }) - }else{ - //加入题库 - let url=`/courses/${CourseId}/polls/join_poll_banks.json`; - axios.post((url), { - check_ids: this.state.checkBoxValues - }) - .then((result)=>{ - if(result){ - this.props.showNotification(`${result.data.message}`); - this.setState({ - modalsType:false, - modalsTopval:"", - modalsBottomval:"", - loadtype:false, - checkBoxValues:[], - checkAllValue:false - }) - let{type,StudentList_value}=this.state - this.InitList(type,StudentList_value,1); - } - }).catch((error)=>{ - console.log(error); - }) - } - } - } - //取消删除或者设为公开 - modalCancel=()=>{ - this.setState({ - modalsType:false, - modalsTopval:"", - modalsBottomval:"", - loadtype:false - }) - } - //确定删除或者设为公开 - ModalAction=()=>{ - let CourseId=this.props.match.params.coursesId; - if(this.state.checkBoxValues.length==0){ - this.setState({ - modalsType:false, - modalsTopval:"", - loadtype:false, - checkBoxValues:[] - }) - }else{ - if(this.state.boxType=="delete"){ - //删除 - let url=`/courses/${CourseId}/polls/destroys.json`; - axios.post((url), { - check_ids: this.state.checkBoxValues - }) - .then((result)=>{ - if(result){ - this.props.showNotification(`${result.data.message}`); - this.setState({ - modalsType:false, - modalsTopval:"", - modalsBottomval:"", - loadtype:false, - checkBoxValues:[] - }) - let{type,StudentList_value}=this.state - this.InitList(type,StudentList_value,1); - } - }).catch((error)=>{ - console.log(error); - }) - }else if(this.state.boxType=="public"){ - //设为公开 - let url=`/courses/${CourseId}/polls/set_public.json`; - axios.post((url), { - check_ids: this.state.checkBoxValues - }) - .then((result)=>{ - if(result){ - this.props.showNotification(`${result.data.message}`); - this.setState({ - modalsType:false, - modalsTopval:"", - loadtype:false, - checkBoxValues:[] - }) - let{type,StudentList_value}=this.state - this.InitList(type,StudentList_value,1); - } - }).catch((error)=>{ - console.log(error); - }) - } - } - } - - successFun=()=>{ - let{type,StudentList_value,page}=this.state - this.InitList(type,StudentList_value,page) - - } - // 题库选用成功后,立即发布,刷新页面 - useBankSuccess=(checkValue,value)=>{ - // let{type,StudentList_value,page}=this.state - // this.InitList(type,StudentList_value,page); - this.setState({ - checkBoxValues:[] - }) - let coursesId=this.props.match.params.coursesId; - let url=`/courses/${coursesId}/polls/publish_modal.json`; - axios.get(url,{ - params:{ - check_ids:value - } - }).then((response) => { - if(response){ - let list=[]; - if(response.data.course_info){ - for(var i=0;i 0 ? 1 : 2, - visible:true, - Topval:"本操作只对“未发布”的对象生效", - Botvalleft:"暂不发布", - Botval:"则通过后续手动设置,定时发布", - starttime:"发布时间:"+this.props.getNowFormatDates(1), - starttimes:this.props.getNowFormatDates(1), - endtime:"截止时间:"+this.props.getNowFormatDates(2), - Cancelname:"暂不发布", - Savesname:"立即发布", - Cancel:this.homeworkhide, - Saves:this.homeworkstartend, - }) - } - }).catch((error) => { - console.log(error) - }); - } - - getcourse_groupslist=(id)=>{ - this.setState({ - chooseId:id - }) - } - - // 确定立即发布 - homeworkstartend=(value,endtime)=>{ - - let {checkBoxValues}=this.state; - let coursesId=this.props.match.params.coursesId; - - let url=`/courses/${coursesId}/polls/publish.json` - axios.post(url,{ - check_ids:checkBoxValues, - group_ids:value, - end_time:endtime - }).then((result)=>{ - if(result){ - let{type,StudentList_value,page}=this.state - this.InitList(type,StudentList_value,page); - this.props.showNotification(result.data.message); - this.homeworkhide(); - } - }).catch((error)=>{ - console.log(error); - }) - } - - //暂不发布 - homeworkhide=()=>{ - this.setState({ - modalname:undefined, - modaltype:undefined, - visible:false, - Topval:undefined, - Topvalright:undefined, - Botvalleft:undefined, - Botval:undefined, - starttime:undefined, - endtime:undefined, - Cancelname:undefined, - Savesname:undefined, - Cancel:undefined, - Saves:undefined, - StudentList_value:undefined, - addname:undefined, - addnametype:false, - addnametab:undefined, - checkBoxValues:[] - }) - } - - render(){ - let { - modalname, - modaltype, - visible, - Topval, - Topvalright, - Botvalleft, - Botval, - starttime, - endtime, - Cancelname, - Savesname, - Cancel, - Saves, - StudentList_value, - addname, - addnametype, - addnametab, - addcanner, - addsave, - course_groups, - - checkAllValue, - checkBoxValues, - course_types, - pollsList, - page, - pageSize, - polls_counts, - - modalsType, - modalsTopval, - modalsBottomval, - loadtype - }=this.state; - console.log(this.props); - let {child}=this.props; - let {coursesId,Id}=this.props.match.params - const isAdmin = this.props.isAdmin() - const isStudent=this.props.isStudent(); - // console.log(child) - return( - - - {visible===true?this.getcourse_groupslist(id)} - />:""} - - {/*添加目录/选择目录*/} - - - {/* 公用的提示弹框 */} - - - -
    -

    - {polls_counts&&polls_counts.left_banner_name} - { - isAdmin && -

  • -

    - 新建 -
  • - } -

    -
    -

    - 共{polls_counts && polls_counts.polls_total_counts}个问卷 - 已发布:{polls_counts && polls_counts.polls_published_counts}个 - { - isAdmin && 未发布:{polls_counts && polls_counts.polls_unpublish_counts}个 - } -

    -
    - -
    -
    -
    - - 全部 - { course_types && course_types.user_permission == 1 && 未发布 } - 提交中 - 已截止 - -
    -
    - - { - pollsList && pollsList.length > 0 && isAdmin && -
    -
    - 已选 {checkBoxValues.length} 个 -
    -
  • this.ActionPoll("delete")}>删除
  • -
  • - -
  • -
  • - -
  • - { - course_types && course_types.course_is_public == 1 &&
  • this.ActionPoll("public")}>设为公开
  • - } -
  • this.ActionPoll("bank")}>加入题库
  • -
    -
    -
    - } - - { - pollsList && pollsList.length > 0 && - - -
    - { - pollsList && pollsList.map((item,key)=>{ - return( - this.onItemClick(item)}>} - > - ) - }) - } -
    -
    - } -
    - { - pollsList && pollsList.length==0 && - } - { - course_types && polls_counts.polls_all_counts > pageSize ? -
    - -
    - : - "" - } - - -
    - ) - } -} +import React,{ Component } from "react"; +import { Input,Checkbox,Table, Pagination, Modal,Menu, Tooltip ,Spin} from "antd"; +import CourseLayoutcomponent from '../common/CourseLayoutComponent'; +import HomeworkModal from "../coursesPublic/HomeworkModal"; +import ShixunModal from "../coursesPublic/ShixunModal"; +import PathModal from "../coursesPublic/PathModal"; +import AddcoursesNav from "../coursesPublic/AddcoursesNav"; +import ImmediatelyPublish from './pollPublicBtn/ImmediatelyPublish' +import ImmediatelyEnd from './pollPublicBtn/ImmediatelyEnd' +import PollListItem from './PollListItem' +import NoneData from '../coursesPublic/NoneData' +import UseBank from '../busyWork/UseBank' + +import _ from 'lodash'; + +import '../css/members.css' +import '../css/busyWork.css' + + +import { WordsBtn } from 'educoder' +import Modals from '../../modals/Modals' + +import axios from 'axios' + +const Search = Input.Search; + + +class Poll extends Component{ + constructor(props){ + super(props); + this.state={ + modalname:undefined, + modaltype:undefined, + visible:false, + Topval:undefined, + Topvalright:undefined, + Botvalleft:undefined, + Botval:undefined, + starttime:undefined, + endtime:undefined, + Cancelname:undefined, + Savesname:undefined, + Cancel:undefined, + Saves:undefined, + StudentList_value:undefined, + addname:undefined, + addnametype:false, + addnametab:undefined, + addcanner:undefined, + addsave:undefined, + course_groups:[], + chooseId:undefined, + // 列表相关 + checkBoxValues:[], + checkAllValue:false, + pollsList:undefined, + course_types:undefined, + page:1, + pageSize:15, + type:0, + polls_counts:undefined, + + //公用提示弹框相关 + modalsType:false, + modalsTopval:"", + modalsBottomval:"", + loadtype:false, + boxType:"delete", + isSpin:false + } + + } + + inputStudent=(e)=>{ + this.setState({ + StudentList_value:e.target.value + }) + } + + + // 题库选用 + selectBlank=(type)=>{ + if(type===2){ + this.setState({ + addname:"添加目录", + addnametype:true, + addnametab:type, + addcanner:this.homeworkhide, + addsave:undefined + }) + }else if(type===4){ + this.setState({ + addname:"移动到目录", + addnametype:true, + addnametab:type, + addcanner:this.homeworkhide, + addsave:undefined + }) + } + + } + // 切换菜单选项 + changeType=(e)=>{ + this.setState({ + type:e.key, + checkBoxValues:[], + checkAllValue:false + }) + let{StudentList_value,page}=this.state; + this.InitList(e.key,StudentList_value,page); + } + // 获取列表数据 + InitList=(type,search,page)=>{ + this.setState({ + isSpin:true + }) + let {pageSize}=this.state + let coursesId=this.props.match.params.coursesId; + let url='/courses/'+coursesId+'/polls.json?limit='+pageSize+'&page='+page + if(type!="0"){ + url+="&type="+type + } + if(search!=""&&search!=undefined){ + url+="&search="+search + } + axios.get(url).then((result)=>{ + if(result){ + this.setState({ + pollsList:result.data.polls, + course_types:result.data.course_types, + polls_counts:result.data.polls_counts, + isSpin:false, + checkBoxValues:[] + }) + } + }).catch((error)=>{ + console.log(error); + }) + } + // 加载列表 + componentDidMount(){ + this.setState({ + isSpin:true + }) + let{type,StudentList_value,page}=this.state + this.InitList(type,StudentList_value,page); + } + //切换分页 + changePage=(pageNumber)=>{ + + this.setState({ + page:pageNumber + }) + let{type,StudentList_value}=this.state + this.InitList(type,StudentList_value,pageNumber); + } + // 搜索 + searchInfo=()=>{ + this.setState({ + page:1 + }) + let{type,StudentList_value}=this.state; + this.InitList(type,StudentList_value,1) + } + // checkbox + onItemClick = (item) => { + const checkBoxValues = this.state.checkBoxValues.slice(0); + const index = checkBoxValues.indexOf(item.id); + if (index != -1) { + _.remove(checkBoxValues, (listItem)=> listItem === item.id) + } else { + checkBoxValues.push(item.id); + } + this.onCheckBoxChange(checkBoxValues) + } + // 全选or反选 + onCheckAll = (e) => { + this.setState({ + checkAllValue: e.target.checked + }) + const values = this.state.pollsList.map(item => { + return item.id + }) + if (e.target.checked) { + const concated = this.state.checkBoxValues.concat(values); + const uniq=_.uniq(concated) + this.setState({ + checkBoxValues: uniq + }) + } else { + this.setState({ + checkBoxValues: _.difference(this.state.checkBoxValues, values) + }) + } + } + + onCheckBoxChange = (checkedValues) => { + this.setState({ + checkBoxValues: checkedValues, + checkAllValue: checkedValues.length == this.state.pollsList.length + }) + } + + //删除或者设为公开 + ActionPoll=(value)=>{ + let CourseId=this.props.match.params.coursesId; + //判断是否有选中数据 + if(this.state.checkBoxValues.length==0){ + this.props.showNotification("请先在列表中选择数据"); + // this.setState({ + // modalsType:true, + // modalsTopval:"请先在列表中选择数据", + // modalsBottomval:'', + // loadtype:true + // }) + }else{ + if(value != "bank"){ + this.setState({ + modalsType:true, + modalsTopval:value=="delete"?"已提交作品将全部被删除,不可恢复":"公开后非课堂成员也可以访问查看", + modalsBottomval:value=="delete"?"您确定要删除吗?":"是否确认公开?", + loadtype:false, + boxType:value + }) + }else{ + //加入题库 + let url=`/courses/${CourseId}/polls/join_poll_banks.json`; + axios.post((url), { + check_ids: this.state.checkBoxValues + }) + .then((result)=>{ + if(result){ + this.props.showNotification(`${result.data.message}`); + this.setState({ + modalsType:false, + modalsTopval:"", + modalsBottomval:"", + loadtype:false, + checkBoxValues:[], + checkAllValue:false + }) + let{type,StudentList_value}=this.state + this.InitList(type,StudentList_value,1); + } + }).catch((error)=>{ + console.log(error); + }) + } + } + } + //取消删除或者设为公开 + modalCancel=()=>{ + this.setState({ + modalsType:false, + modalsTopval:"", + modalsBottomval:"", + loadtype:false + }) + } + //确定删除或者设为公开 + ModalAction=()=>{ + let CourseId=this.props.match.params.coursesId; + if(this.state.checkBoxValues.length==0){ + this.setState({ + modalsType:false, + modalsTopval:"", + loadtype:false, + checkBoxValues:[] + }) + }else{ + if(this.state.boxType=="delete"){ + //删除 + let url=`/courses/${CourseId}/polls/destroys.json`; + axios.post((url), { + check_ids: this.state.checkBoxValues + }) + .then((result)=>{ + if(result){ + this.props.showNotification(`${result.data.message}`); + this.setState({ + modalsType:false, + modalsTopval:"", + modalsBottomval:"", + loadtype:false, + checkBoxValues:[] + }) + let{type,StudentList_value}=this.state + this.InitList(type,StudentList_value,1); + } + }).catch((error)=>{ + console.log(error); + }) + }else if(this.state.boxType=="public"){ + //设为公开 + let url=`/courses/${CourseId}/polls/set_public.json`; + axios.post((url), { + check_ids: this.state.checkBoxValues + }) + .then((result)=>{ + if(result){ + this.props.showNotification(`${result.data.message}`); + this.setState({ + modalsType:false, + modalsTopval:"", + loadtype:false, + checkBoxValues:[] + }) + let{type,StudentList_value}=this.state + this.InitList(type,StudentList_value,1); + } + }).catch((error)=>{ + console.log(error); + }) + } + } + } + + successFun=()=>{ + let{type,StudentList_value,page}=this.state + this.InitList(type,StudentList_value,page) + + } + // 题库选用成功后,立即发布,刷新页面 + useBankSuccess=(checkValue,value)=>{ + // let{type,StudentList_value,page}=this.state + // this.InitList(type,StudentList_value,page); + this.setState({ + checkBoxValues:[] + }) + let coursesId=this.props.match.params.coursesId; + let url=`/courses/${coursesId}/polls/publish_modal.json`; + axios.get(url,{ + params:{ + check_ids:value + } + }).then((response) => { + if(response){ + let list=[]; + if(response.data.course_info){ + for(var i=0;i 0 ? 1 : 2, + visible:true, + Topval:"本操作只对“未发布”的对象生效", + Botvalleft:"暂不发布", + Botval:"则通过后续手动设置,定时发布", + starttime:"发布时间:"+moment(moment(new Date())).format("YYYY-MM-DD HH:mm"), + starttimes:this.props.getNowFormatDates(1), + endtime:"截止时间:"+this.props.getNowFormatDates(2), + Cancelname:"暂不发布", + Savesname:"立即发布", + Cancel:this.homeworkhide, + Saves:this.homeworkstartend, + }) + } + }).catch((error) => { + console.log(error) + }); + } + + getcourse_groupslist=(id)=>{ + this.setState({ + chooseId:id + }) + } + + // 确定立即发布 + homeworkstartend=(value,endtime)=>{ + + let {checkBoxValues}=this.state; + let coursesId=this.props.match.params.coursesId; + + let url=`/courses/${coursesId}/polls/publish.json` + axios.post(url,{ + check_ids:checkBoxValues, + group_ids:value, + end_time:endtime + }).then((result)=>{ + if(result){ + let{type,StudentList_value,page}=this.state + this.InitList(type,StudentList_value,page); + this.props.showNotification(result.data.message); + this.homeworkhide(); + } + }).catch((error)=>{ + console.log(error); + }) + } + + //暂不发布 + homeworkhide=()=>{ + this.setState({ + modalname:undefined, + modaltype:undefined, + visible:false, + Topval:undefined, + Topvalright:undefined, + Botvalleft:undefined, + Botval:undefined, + starttime:undefined, + endtime:undefined, + Cancelname:undefined, + Savesname:undefined, + Cancel:undefined, + Saves:undefined, + StudentList_value:undefined, + addname:undefined, + addnametype:false, + addnametab:undefined, + checkBoxValues:[] + }) + } + + render(){ + let { + modalname, + modaltype, + visible, + Topval, + Topvalright, + Botvalleft, + Botval, + starttime, + endtime, + Cancelname, + Savesname, + Cancel, + Saves, + StudentList_value, + addname, + addnametype, + addnametab, + addcanner, + addsave, + course_groups, + + checkAllValue, + checkBoxValues, + course_types, + pollsList, + page, + pageSize, + polls_counts, + + modalsType, + modalsTopval, + modalsBottomval, + loadtype + }=this.state; + console.log(this.props); + let {child}=this.props; + let {coursesId,Id}=this.props.match.params + const isAdmin = this.props.isAdmin() + const isStudent=this.props.isStudent(); + // console.log(child) + return( + + + {visible===true?this.getcourse_groupslist(id)} + />:""} + + {/*添加目录/选择目录*/} + + + {/* 公用的提示弹框 */} + + + +
    +

    + {polls_counts&&polls_counts.left_banner_name} + { + isAdmin && +

  • +

    + 新建 +
  • + } +

    +
    +

    + 共{polls_counts && polls_counts.polls_total_counts}个问卷 + 已发布:{polls_counts && polls_counts.polls_published_counts}个 + { + isAdmin && 未发布:{polls_counts && polls_counts.polls_unpublish_counts}个 + } +

    +
    + +
    +
    +
    + + 全部 + { course_types && course_types.user_permission == 1 && 未发布 } + 提交中 + 已截止 + +
    +
    + + { + pollsList && pollsList.length > 0 && isAdmin && +
    +
    + 已选 {checkBoxValues.length} 个 +
    +
  • this.ActionPoll("delete")}>删除
  • +
  • + +
  • +
  • + +
  • + { + course_types && course_types.course_is_public == 1 &&
  • this.ActionPoll("public")}>设为公开
  • + } +
  • this.ActionPoll("bank")}>加入题库
  • +
    +
    +
    + } + + { + pollsList && pollsList.length > 0 && + + +
    + { + pollsList && pollsList.map((item,key)=>{ + return( + this.onItemClick(item)}>} + > + ) + }) + } +
    +
    + } +
    + { + pollsList && pollsList.length==0 && + } + { + course_types && polls_counts.polls_all_counts > pageSize ? +
    + +
    + : + "" + } + + +
    + ) + } +} export default Poll; \ No newline at end of file diff --git a/public/react/src/modules/courses/poll/pollPublicBtn/ImmediatelyPublish.js b/public/react/src/modules/courses/poll/pollPublicBtn/ImmediatelyPublish.js index e0424aa93..95e5ba2ad 100644 --- a/public/react/src/modules/courses/poll/pollPublicBtn/ImmediatelyPublish.js +++ b/public/react/src/modules/courses/poll/pollPublicBtn/ImmediatelyPublish.js @@ -1,282 +1,282 @@ -import React,{ Component } from "react"; - - -import Modals from '../../../modals/Modals' -import { WordsBtn } from 'educoder' -import HomeworkModal from "../../coursesPublic/HomeworkModal"; - -import axios from 'axios' -import moment from 'moment'; - - - - -class Immediatelypublish extends Component{ - constructor(props){ - super(props) - this.state={ - modalname:undefined, - modaltype:undefined, - visible:false, - Topval:undefined, - Topvalright:undefined, - Botvalleft:undefined, - Botval:undefined, - starttime:undefined, - starttimes:undefined, - endtime:undefined, - Cancelname:undefined, - Savesname:undefined, - Cancel:undefined, - Saves:undefined, - course_groups:undefined, - - modalsType:false, - modalsTopval:"", - loadtype:false, - chooseId:undefined - } - } - //立即发布 - homeworkstart=()=>{ - let {checkBoxValues}=this.props - - - // console.log(this.props.Exercisetype==="exercise") - - - if(checkBoxValues.length==0){ - this.props.showNotification("请先在列表中选择数据"); - // this.setState({ - // modalsType:true, - // modalsTopval:"请先在列表中选择数据", - // loadtype:true - // }) - }else{ - let coursesId=this.props.match.params.coursesId; - if(this.props.Exercisetype==="exercise"){ - let url=`/courses/${coursesId}/exercises/publish_modal.json`; - axios.get(url,{ - params:{ - check_ids:checkBoxValues - } - }).then((response) => { - if(response.status===200){ - let list=[]; - if(response.data.course_info){ - for(var i=0;i 0 ? 1 : 2, - visible:true, - Topval:"本操作只对“未发布”的对象生效", - Botvalleft:"暂不发布", - Botval:"则通过后续手动设置,定时发布", - starttime:"发布时间:"+this.props.getNowFormatDates(1), - starttimes:this.props.getNowFormatDates(1), - endtime:"截止时间:"+this.props.getNowFormatDates(2), - Cancelname:"暂不发布", - Savesname:"立即发布", - Cancel:this.homeworkhide, - Saves:this.homeworkstartend, - }) - } - }).catch((error) => { - console.log(error) - }); - }else{ - let url=`/courses/${coursesId}/polls/publish_modal.json`; - axios.get(url,{ - params:{ - check_ids:checkBoxValues - } - }).then((response) => { - if(response){ - let list=[]; - if(response.data.course_info){ - for(var i=0;i 0 ? 1 : 2, - visible:true, - Topval:"本操作只对“未发布”的对象生效", - Botvalleft:"暂不发布", - Botval:"则通过后续手动设置,定时发布", - starttime:"发布时间:"+this.props.getNowFormatDates(1), - starttimes:this.props.getNowFormatDates(1), - endtime:"截止时间:"+this.props.getNowFormatDates(2), - Cancelname:"暂不发布", - Savesname:"立即发布", - Cancel:this.homeworkhide, - Saves:this.homeworkstartend, - }) - } - }).catch((error) => { - console.log(error) - }); - - } - - } - } - - //取消提示弹框 - modalCancel=()=>{ - this.setState({ - modalsType:false, - modalsTopval:"", - loadtype:false - }) - } - //暂不发布 - homeworkhide=()=>{ - this.setState({ - modalname:undefined, - modaltype:undefined, - visible:false, - Topval:undefined, - Topvalright:undefined, - Botvalleft:undefined, - Botval:undefined, - starttime:undefined, - starttimes:undefined, - endtime:undefined, - Cancelname:undefined, - Savesname:undefined, - Cancel:undefined, - Saves:undefined, - StudentList_value:undefined, - addname:undefined, - addnametype:false, - addnametab:undefined - }) - } - // 确定立即发布 - homeworkstartend=(ids,endtime)=>{ - - let {checkBoxValues}=this.props - let {chooseId}=this.state; - let coursesId=this.props.match.params.coursesId; - - if(this.props.Exercisetype==="exercise"){ - - let url=`/courses/${coursesId}/exercises/publish.json` - axios.post(url,{ - check_ids:checkBoxValues, - group_ids:chooseId, - end_time:endtime - }).then((result)=>{ - if(result){ - this.props.showNotification(result.data.message); - this.homeworkhide(); - - // 调用父级公共头部的接口刷新 - this.props.action() - } - }).catch((error)=>{ - console.log(error); - }) - - }else{ - let url=`/courses/${coursesId}/polls/publish.json` - axios.post(url,{ - check_ids:checkBoxValues, - group_ids:chooseId, - end_time:endtime - }).then((result)=>{ - if(result){ - this.props.showNotification(result.data.message); - this.homeworkhide(); - - // 调用父级公共头部的接口刷新 - this.props.action() - } - }).catch((error)=>{ - console.log(error); - }) - } - - } - - getcourse_groupslist=(id)=>{ - this.setState({ - chooseId:id - }) - } - - render(){ - let{ - modalname, - modaltype, - visible, - Topval, - Topvalright, - Botvalleft, - Botval, - starttime, - starttimes, - endtime, - Cancelname, - Savesname, - Cancel, - Saves, - course_groups, - - modalsType, - modalsTopval, - loadtype, - }=this.state - return( - - this.getcourse_groupslist(id)} - /> - {/* 公用的提示弹框 */} - - - 立即发布 - - ) - } -} +import React,{ Component } from "react"; + + +import Modals from '../../../modals/Modals' +import { WordsBtn } from 'educoder' +import HomeworkModal from "../../coursesPublic/HomeworkModal"; + +import axios from 'axios' +import moment from 'moment'; + + + + +class Immediatelypublish extends Component{ + constructor(props){ + super(props) + this.state={ + modalname:undefined, + modaltype:undefined, + visible:false, + Topval:undefined, + Topvalright:undefined, + Botvalleft:undefined, + Botval:undefined, + starttime:undefined, + starttimes:undefined, + endtime:undefined, + Cancelname:undefined, + Savesname:undefined, + Cancel:undefined, + Saves:undefined, + course_groups:undefined, + + modalsType:false, + modalsTopval:"", + loadtype:false, + chooseId:undefined + } + } + //立即发布 + homeworkstart=()=>{ + let {checkBoxValues}=this.props + + + // console.log(this.props.Exercisetype==="exercise") + + + if(checkBoxValues.length==0){ + this.props.showNotification("请先在列表中选择数据"); + // this.setState({ + // modalsType:true, + // modalsTopval:"请先在列表中选择数据", + // loadtype:true + // }) + }else{ + let coursesId=this.props.match.params.coursesId; + if(this.props.Exercisetype==="exercise"){ + let url=`/courses/${coursesId}/exercises/publish_modal.json`; + axios.get(url,{ + params:{ + check_ids:checkBoxValues + } + }).then((response) => { + if(response.status===200){ + let list=[]; + if(response.data.course_info){ + for(var i=0;i 0 ? 1 : 2, + visible:true, + Topval:"本操作只对“未发布”的对象生效", + Botvalleft:"暂不发布", + Botval:"则通过后续手动设置,定时发布", + starttime:"发布时间:"+moment(moment(new Date())).format("YYYY-MM-DD HH:mm"), + starttimes:this.props.getNowFormatDates(1), + endtime:"截止时间:"+this.props.getNowFormatDates(2), + Cancelname:"暂不发布", + Savesname:"立即发布", + Cancel:this.homeworkhide, + Saves:this.homeworkstartend, + }) + } + }).catch((error) => { + console.log(error) + }); + }else{ + let url=`/courses/${coursesId}/polls/publish_modal.json`; + axios.get(url,{ + params:{ + check_ids:checkBoxValues + } + }).then((response) => { + if(response){ + let list=[]; + if(response.data.course_info){ + for(var i=0;i 0 ? 1 : 2, + visible:true, + Topval:"本操作只对“未发布”的对象生效", + Botvalleft:"暂不发布", + Botval:"则通过后续手动设置,定时发布", + starttime:"发布时间:"+moment(moment(new Date())).format("YYYY-MM-DD HH:mm"), + starttimes:this.props.getNowFormatDates(1), + endtime:"截止时间:"+this.props.getNowFormatDates(2), + Cancelname:"暂不发布", + Savesname:"立即发布", + Cancel:this.homeworkhide, + Saves:this.homeworkstartend, + }) + } + }).catch((error) => { + console.log(error) + }); + + } + + } + } + + //取消提示弹框 + modalCancel=()=>{ + this.setState({ + modalsType:false, + modalsTopval:"", + loadtype:false + }) + } + //暂不发布 + homeworkhide=()=>{ + this.setState({ + modalname:undefined, + modaltype:undefined, + visible:false, + Topval:undefined, + Topvalright:undefined, + Botvalleft:undefined, + Botval:undefined, + starttime:undefined, + starttimes:undefined, + endtime:undefined, + Cancelname:undefined, + Savesname:undefined, + Cancel:undefined, + Saves:undefined, + StudentList_value:undefined, + addname:undefined, + addnametype:false, + addnametab:undefined + }) + } + // 确定立即发布 + homeworkstartend=(ids,endtime)=>{ + + let {checkBoxValues}=this.props + let {chooseId}=this.state; + let coursesId=this.props.match.params.coursesId; + + if(this.props.Exercisetype==="exercise"){ + + let url=`/courses/${coursesId}/exercises/publish.json` + axios.post(url,{ + check_ids:checkBoxValues, + group_ids:chooseId, + end_time:endtime + }).then((result)=>{ + if(result){ + this.props.showNotification(result.data.message); + this.homeworkhide(); + + // 调用父级公共头部的接口刷新 + this.props.action() + } + }).catch((error)=>{ + console.log(error); + }) + + }else{ + let url=`/courses/${coursesId}/polls/publish.json` + axios.post(url,{ + check_ids:checkBoxValues, + group_ids:chooseId, + end_time:endtime + }).then((result)=>{ + if(result){ + this.props.showNotification(result.data.message); + this.homeworkhide(); + + // 调用父级公共头部的接口刷新 + this.props.action() + } + }).catch((error)=>{ + console.log(error); + }) + } + + } + + getcourse_groupslist=(id)=>{ + this.setState({ + chooseId:id + }) + } + + render(){ + let{ + modalname, + modaltype, + visible, + Topval, + Topvalright, + Botvalleft, + Botval, + starttime, + starttimes, + endtime, + Cancelname, + Savesname, + Cancel, + Saves, + course_groups, + + modalsType, + modalsTopval, + loadtype, + }=this.state + return( + + this.getcourse_groupslist(id)} + /> + {/* 公用的提示弹框 */} + + + 立即发布 + + ) + } +} export default Immediatelypublish \ No newline at end of file diff --git a/public/react/src/modules/courses/shixunHomework/Listofworks.js b/public/react/src/modules/courses/shixunHomework/Listofworks.js index e38a0c453..ba3c34c51 100644 --- a/public/react/src/modules/courses/shixunHomework/Listofworks.js +++ b/public/react/src/modules/courses/shixunHomework/Listofworks.js @@ -821,7 +821,7 @@ class Listofworks extends Component { Topval: "本操作只对“未发布”的对象生效", Botvalleft: "暂不发布", Botval: "则通过后续手动设置,定时发布", - starttime: "发布时间:" + starttime, + starttime: "发布时间:" + moment(moment(new Date())).format("YYYY-MM-DD HH:mm"), endtime: "截止时间:" + endtime, starttimes:starttime, typs:"start", diff --git a/public/react/src/modules/courses/shixunHomework/ShixunStudentWork.js b/public/react/src/modules/courses/shixunHomework/ShixunStudentWork.js index 461c4d74d..a62e815ef 100644 --- a/public/react/src/modules/courses/shixunHomework/ShixunStudentWork.js +++ b/public/react/src/modules/courses/shixunHomework/ShixunStudentWork.js @@ -304,7 +304,7 @@ class ShixunStudentWork extends Component { Topval:"本操作只对“未发布”的对象生效", Botvalleft:"暂不发布", Botval:"则通过后续手动设置,定时发布", - starttime:"发布时间:"+starttime, + starttime:"发布时间:"+moment(moment(new Date())).format("YYYY-MM-DD HH:mm"), endtime:"截止时间:"+endtime, Cancelname:"暂不发布", Savesname:"立即发布", diff --git a/public/react/src/modules/courses/shixunHomework/Trainingjobsetting.js b/public/react/src/modules/courses/shixunHomework/Trainingjobsetting.js index 919a744cf..108ab58f0 100644 --- a/public/react/src/modules/courses/shixunHomework/Trainingjobsetting.js +++ b/public/react/src/modules/courses/shixunHomework/Trainingjobsetting.js @@ -1237,7 +1237,7 @@ class Trainingjobsetting extends Component { Topval: "本操作只对“未发布”的对象生效", Botvalleft: "暂不发布", Botval: "则通过后续手动设置,定时发布", - starttime: "发布时间:" + starttime, + starttime: "发布时间:" + moment(moment(new Date())).format("YYYY-MM-DD HH:mm"), starttimes:starttime, typs:"start", endtime: "截止时间:" + endtime, diff --git a/public/react/src/modules/courses/shixunHomework/Workquestionandanswer.js b/public/react/src/modules/courses/shixunHomework/Workquestionandanswer.js index a06a5be32..7808355e8 100644 --- a/public/react/src/modules/courses/shixunHomework/Workquestionandanswer.js +++ b/public/react/src/modules/courses/shixunHomework/Workquestionandanswer.js @@ -148,7 +148,7 @@ class Workquestionandanswer extends Component { Topval: "本操作只对“未发布”的对象生效", Botvalleft: "暂不发布", Botval: "则通过后续手动设置,定时发布", - starttime: "发布时间:" + starttime, + starttime: "发布时间:" + moment(moment(new Date())).format("YYYY-MM-DD HH:mm"), endtime: "截止时间:" + endtime, Cancelname: "暂不发布", Savesname: "立即发布", diff --git a/public/react/src/modules/courses/shixunHomework/shixunHomework.js b/public/react/src/modules/courses/shixunHomework/shixunHomework.js index 9589d4515..5970a8907 100644 --- a/public/react/src/modules/courses/shixunHomework/shixunHomework.js +++ b/public/react/src/modules/courses/shixunHomework/shixunHomework.js @@ -209,7 +209,7 @@ class ShixunHomework extends Component{ Topval:"本操作只对“未发布”的对象生效", Botvalleft:"暂不发布", Botval:"则通过后续手动设置,定时发布", - starttime:"发布时间:"+starttime, + starttime:"发布时间:"+moment(moment(new Date())).format("YYYY-MM-DD HH:mm"), starttimes:starttime, endtime:"截止时间:"+endtime, Cancelname:"暂不发布", @@ -403,7 +403,7 @@ class ShixunHomework extends Component{ Topval:"本操作只对“未发布”的对象生效", Botvalleft:"暂不发布", Botval:"则通过后续手动设置,定时发布", - starttime:"发布时间:"+ starttime, + starttime:"发布时间:"+ moment(moment(new Date())).format("YYYY-MM-DD HH:mm"), starttimes:starttime, typs:"start", endtime:"截止时间:"+ endtime, From a8a33ebd7d24e54c70d5e5da01373f9f1a5f8d5e Mon Sep 17 00:00:00 2001 From: caishi <1149225589@qq.com> Date: Fri, 21 Jun 2019 13:50:17 +0800 Subject: [PATCH 5/7] =?UTF-8?q?=E6=AF=95=E8=AE=BE=E4=BB=BB=E5=8A=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../courses/graduation/tasks/GraduationTaskssettinglist.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/public/react/src/modules/courses/graduation/tasks/GraduationTaskssettinglist.js b/public/react/src/modules/courses/graduation/tasks/GraduationTaskssettinglist.js index 7ef1f99c5..9e0573a1c 100644 --- a/public/react/src/modules/courses/graduation/tasks/GraduationTaskssettinglist.js +++ b/public/react/src/modules/courses/graduation/tasks/GraduationTaskssettinglist.js @@ -1357,7 +1357,7 @@ class GraduationTaskssettinglist extends Component{ 不限 this.funteachercomment(e,taskslistdata.search_assistants&&taskslistdata.search_assistants.teacher_comment.length)} style={{ paddingTop: '4px'}}> - {taskslistdata.search_assistants&&taskslistdata.search_assistants.teacher_comment.map((item,key)=>{ + {taskslistdata.search_assistants && taskslistdata.search_assistants.teacher_comment && taskslistdata.search_assistants.teacher_comment.map((item,key)=>{ return( {item.name} @@ -1499,7 +1499,7 @@ class GraduationTaskssettinglist extends Component{ pagination={false} loading={loadingstate} onChange={this.TablePagination} - + className="edu-txt-center" />}
    @@ -1740,6 +1740,7 @@ class GraduationTaskssettinglist extends Component{ pagination={false} loading={loadingstate} onChange={this.TablePagination} + className="edu-txt-center" />}
    From 0780f2027bff41bb9c5674e5f75d2a7b05befb50 Mon Sep 17 00:00:00 2001 From: caishi <1149225589@qq.com> Date: Fri, 21 Jun 2019 13:58:46 +0800 Subject: [PATCH 6/7] =?UTF-8?q?=E4=B8=AA=E4=BA=BA=E4=B8=BB=E9=A1=B5-?= =?UTF-8?q?=E4=BD=BF=E7=94=A8=E7=94=B3=E8=AF=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../react/src/modules/user/usersInfo/Infos.js | 21 ++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/public/react/src/modules/user/usersInfo/Infos.js b/public/react/src/modules/user/usersInfo/Infos.js index e5f1e99dd..0ce102eb5 100644 --- a/public/react/src/modules/user/usersInfo/Infos.js +++ b/public/react/src/modules/user/usersInfo/Infos.js @@ -48,12 +48,6 @@ class Infos extends Component{ } } - // 试用申请 - trialapplications =()=>{ - this.setState({ - isRenders: true, - }) - } //获取个人主页信息 getInfo = (user_login) =>{ @@ -157,6 +151,19 @@ class Infos extends Component{ } } + // 试用申请 + trialapplications =()=>{ + this.setState({ + isRenders: true, + showTrial:true + }) + } + cancelModulationModels=()=>{ + this.setState({ + isRenders: false + }) + } + render(){ let { data , @@ -174,7 +181,7 @@ class Infos extends Component{ return(
    { - isRenders && + isRenders && this.cancelModulationModels()}/> }
    From d276fee00b15bd3b9ae4ee2c4cdc85fd906cfd5c Mon Sep 17 00:00:00 2001 From: caishi <1149225589@qq.com> Date: Fri, 21 Jun 2019 14:07:35 +0800 Subject: [PATCH 7/7] =?UTF-8?q?=E9=A2=98=E5=BA=93=E8=B7=B3=E8=BD=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/react/src/modules/user/usersInfo/Infos.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/public/react/src/modules/user/usersInfo/Infos.js b/public/react/src/modules/user/usersInfo/Infos.js index 0ce102eb5..3300423a1 100644 --- a/public/react/src/modules/user/usersInfo/Infos.js +++ b/public/react/src/modules/user/usersInfo/Infos.js @@ -163,6 +163,9 @@ class Infos extends Component{ isRenders: false }) } + ToBank=(url)=>{ + window.location.href=url; + } render(){ let { @@ -290,7 +293,7 @@ class Infos extends Component{ 实训 实训课程 项目 - { data && data.identity !="学生" && this.ToBank(`/`)}>题库 } + { data && data.identity !="学生" && this.ToBank(`/users/${username}?type=a_project`)}>题库 }