From 856942dbb0ff982c0885a301ebab2a36dbaa40b7 Mon Sep 17 00:00:00 2001 From: caicai8 <1149225589@qq.com> Date: Wed, 11 Sep 2019 19:14:20 +0800 Subject: [PATCH 01/23] =?UTF-8?q?=E4=BA=A4=E5=8F=89=E8=AF=84=E9=98=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modules/courses/graduation/tasks/GraduationAcrossCheck.js | 0 .../modules/courses/graduation/tasks/GraduationTaskDetail.js | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) create mode 100644 public/react/src/modules/courses/graduation/tasks/GraduationAcrossCheck.js diff --git a/public/react/src/modules/courses/graduation/tasks/GraduationAcrossCheck.js b/public/react/src/modules/courses/graduation/tasks/GraduationAcrossCheck.js new file mode 100644 index 000000000..e69de29bb diff --git a/public/react/src/modules/courses/graduation/tasks/GraduationTaskDetail.js b/public/react/src/modules/courses/graduation/tasks/GraduationTaskDetail.js index 0aff1a1bd..e228d4146 100644 --- a/public/react/src/modules/courses/graduation/tasks/GraduationTaskDetail.js +++ b/public/react/src/modules/courses/graduation/tasks/GraduationTaskDetail.js @@ -436,7 +436,7 @@ class GraduationTaskDetail extends Component{ {/*<a className={"fr color-blue font-16"}>项目在线质量检测</a>*/} { this.props.isAdmin() ? questionslist.status===1 ? <a className={"fr color-blue font-16 mr20"} onClick={() => { this.end()} }>立即截止</a> : "" : "" } { this.props.isAdmin() ? questionslist.status===0 ? <a className={"fr color-blue font-16 mr20"} onClick={() => { this.publish()} }>立即发布</a> : "" : "" } - + { this.props.isAdmin() ? <a className={"fr color-blue font-16"} href={"/courses/"+courseId+"/graduation_tasks/"+task_Id+"/edit"}>交叉评阅设置</a> : "" } { this.props.isAdmin() ? <a className={"fr color-blue font-16"} href={"/courses/"+courseId+"/graduation_tasks/"+task_Id+"/edit"}>编辑任务</a> : "" } </div> </div> From 2ef8fe31b5696e3e2285e4ed23e3c17d0980d752 Mon Sep 17 00:00:00 2001 From: caicai8 <1149225589@qq.com> Date: Wed, 18 Sep 2019 14:49:05 +0800 Subject: [PATCH 02/23] =?UTF-8?q?=E6=AF=95=E8=AE=BE=E4=BB=BB=E5=8A=A1-?= =?UTF-8?q?=E4=BA=A4=E5=8F=89=E8=AF=84=E9=98=85=E8=AE=BE=E7=BD=AE=E5=BC=B9?= =?UTF-8?q?=E6=A1=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/modules/courses/graduation/style.css | 11 + .../graduation/tasks/GraduationAcrossCheck.js | 475 ++++++++++++++++++ .../graduation/tasks/GraduationTaskDetail.js | 42 +- .../tasks/GraduationTaskssetting.js | 16 +- 4 files changed, 532 insertions(+), 12 deletions(-) diff --git a/public/react/src/modules/courses/graduation/style.css b/public/react/src/modules/courses/graduation/style.css index c704a9c93..5d78f3cb9 100644 --- a/public/react/src/modules/courses/graduation/style.css +++ b/public/react/src/modules/courses/graduation/style.css @@ -43,3 +43,14 @@ .TopicDetailTable .bottomBody li{border-bottom: 1px solid #eee;clear: both;} .TopicDetailTable .bottomBody li:last-child{border-bottom: none;} +.acrossSureBtn{ + width:40px; + height:24px; + line-height: 20px; + border:1px solid rgba(76,172,255,1); + color: #4CACFF!important; + float: left; + border-radius:4px; + text-align: center +} + diff --git a/public/react/src/modules/courses/graduation/tasks/GraduationAcrossCheck.js b/public/react/src/modules/courses/graduation/tasks/GraduationAcrossCheck.js index e69de29bb..2cca4ccae 100644 --- a/public/react/src/modules/courses/graduation/tasks/GraduationAcrossCheck.js +++ b/public/react/src/modules/courses/graduation/tasks/GraduationAcrossCheck.js @@ -0,0 +1,475 @@ +import React, { Component } from 'react'; + +import { Modal , Radio , Table , Pagination , Select ,Divider ,Icon , Input } from "antd"; +import {Link} from 'react-router-dom' +import axios from 'axios'; + +import '../style.css' + + +const RadioGroup = Radio.Group; + +const { Option } = Select; +const $ = window.$; + +const bindTableColumn=(that)=>{ + let { course_groups }=that.state + const filter=course_groups && course_groups.map((i,key)=>{ + let list={ + value: i.id, + text: i.name + } + return list; + }) + const columns = [ + { + title: '序号', + dataIndex: 'index', + key: 'index', + width:"50px", + className:"edu-txt-center", + render: (id, student, index) => { + return (that.state.page - 1) * that.state.limit + index + 1 + } + }, + { + title: '姓名', + dataIndex: 'user_name', + key: 'user_name', + render: (user_name, line, index) => { + return( + <span className="fl task-hide" style={{width:"69px"}} title={user_name}>{user_name}</span> + ) + } + },{ + title: '学号', + dataIndex: 'student_id', + key: 'student_id', + render: (student_id, line, index) => { + return( + <span className="fl task-hide" style={{width:"127px"}} title={student_id}>{student_id}</span> + ) + } + },{ + title: '分班', + dataIndex: 'course_group_name', + key: 'course_group_name', + filters:filter, + render: (course_group_name, line, index) => { + return( + <span className="fl task-hide" style={{width:"160px"}} title={course_group_name}>{course_group_name}</span> + ) + } + } + ]; + if(that.state.comment_status == 2){ + columns.push({ + title: '交叉评阅老师', + dataIndex: 'cross_teachers', + key: 'cross_teachers', + width:"200px", + render: (cross_teachers, line, index) => { + return( + <span className="fl task-hide" style={{width:"200px",paddingRight:"20px"}} title={cross_teachers}>{cross_teachers}</span> + ) + } + }) + }else{ + columns.push({ + title: '答辩组', + dataIndex: 'cross_groups', + key: 'cross_groups', + width:"200px", + render: (cross_groups, line, index) => { + return( + <span className="fl task-hide" style={{width:"200px",paddingRight:"20px"}} title={cross_groups}>{cross_groups}</span> + ) + } + }) + } + return columns; +} +class GraduationAcrossCheck extends Component{ + constructor(props){ + super(props); + this.state={ + comment_status:2, + page:1, + limit:7, + group_ids:undefined, + users:undefined, + user_count:undefined, + graduation_groups:undefined, + course_groups:undefined, + teachers:undefined, + tableLoading:false, + chooseCount:0, + chooseId:undefined, + AcrossTeamIds:undefined, + searchValue:undefined, + showflag:false + } + } + + + + // 根据分班筛选 + filterByGroup=(value,record)=>{ + console.log(value); + console.log(record) + } + + // 切换分配方式 + funcommentstatus = (e) =>{ + this.setState({ + comment_status:e.target.value, + chooseCount:0, + chooseId:[], + AcrossTeamIds:undefined, + searchValue:undefined, + showflag:false, + page:1 + }) + let { group_ids }=this.state; + this.getList(1,group_ids,e.target.value); + } + + componentDidMount =()=>{ + let { comment_status }=this.props; + let { page,group_ids }=this.state; + this.setState({ + comment_status + }) + + this.getList(page,group_ids,comment_status); + + window.addEventListener('click', this.clickOther) + } + + clickOther = (e) =>{ + if(e.target && e.target.matches('#acrossContent') || e.target.matches(".ant-modal-body") + || e.target.matches(".acrossfoot") || e.target.matches(".acrossHead") || e.target.matches ('.ant-radio-wrapper') || + e.target.matches("th") || e.target.matches("td")) { + this.setState({ + showflag:false + }) + } + } + + componentWillUnmount() { + window.removeEventListener('click', this.clickOther); + } + + getList=(page,group_ids,comment_status)=>{ + let { limit }=this.state; + let { task_Id }=this.props; + this.setState({ + tableLoading:true + }) + let url=`/graduation_tasks/${task_Id}/cross_comment_setting.json`; + axios.get((url),{params:{ + page,limit,group_ids,comment_status + }}).then((result)=>{ + if(result){ + this.setState({ + users:result.data.work_users && result.data.work_users.map((item,key)=>{ + let list = { + key:item.work_id, + course_group_name:item.course_group_name, + cross_teachers: item.cross_teachers, + student_id:item.student_id, + user_name:item.user_name, + work_id:item.work_id + } + return list; + }), + user_count:result.data.user_count, + graduation_groups:result.data.graduation_groups, + course_groups:result.data.course_groups, + teachers:result.data.teachers, + tableLoading:false, + // AcrossTeamIds:result.data + }) + } + }).catch((error)=>{ + this.setState({ + tableLoading:false + }) + console.log(error); + }) + } + + // 切换分页 + onPageChange=(page)=>{ + this.setState({ + page, + showflag:false + }) + let{group_ids,comment_status}=this.state; + this.getList(page,group_ids,comment_status); + } + + // 下拉切换 + changeSelect = (AcrossTeamIds) =>{ + this.setState({ + AcrossTeamIds + }) + } + + // 重置 + clearSelect =()=>{ + this.setState({ + AcrossTeamIds:undefined, + searchValue:undefined + }) + } + + // 确定分配 + sureAcross=()=>{ + let { AcrossTeamIds , chooseId , group_ids , comment_status }=this.state; + let { task_Id }=this.props; + + let type = comment_status == 2 ? "user_ids" : "graduation_group_ids"; + + let url=`/graduation_tasks/${task_Id}/assign_works.json`; + if(!AcrossTeamIds || (AcrossTeamIds && AcrossTeamIds.length==0)){ + this.props.showNotification(`请先选择${ comment_status == 2 ? "老师": "答辩组" }!`); + return; + } + if(!chooseId || (chooseId && chooseId.length==0)){ + this.props.showNotification("请先选择毕设作品!"); + return; + } + axios.post((url),{ + [type]:AcrossTeamIds, + work_ids:chooseId + }).then((result)=>{ + if(result){ + this.props.showNotification(result.data.message); + this.getList(1,group_ids,comment_status); + this.setState({ + showflag:false, + AcrossTeamIds:undefined, + chooseCount:0, + chooseId:[] + }) + } + }).catch((error)=>{ + console.log(error); + }) + } + + // 筛选 + handleTableChange =(pagination, filters, sorter)=>{ + console.log(filters.course_group_name) + // if(filters.course_group_name.length > 0){ + this.setState({ + page:1, + group_ids:filters.course_group_name + }) + let { comment_status }= this.state; + this.getList(1,filters.course_group_name,comment_status); + // } + } + + // 下拉搜索 + changeSearchValue=(e)=>{ + this.setState({ + searchValue:e.target.value + }) + } + // 显示下拉 + changeFlag=(flag)=>{ + this.setState({ + showflag:flag + }) + } + + + render(){ + let { + comment_status, + users, + user_count, + graduation_groups, + course_groups, + teachers, + page, + limit, + tableLoading, + chooseCount, + chooseId, + AcrossTeamIds, + searchValue,showflag + } = this.state; + let { modalVisible } = this.props; + let courseId = this.props.match.params.coursesId; + + const radioStyle = { + display: 'block', + height: '30px', + lineHeight: '30px', + marginRight:'0px' + }; + + + + const rowSelection = { + // 选中行的key,选中行 + onChange: (selectedRowKeys, selectedRows) => { + this.setState({ + chooseId:selectedRowKeys, + chooseCount:selectedRowKeys.length, + showflag:false + }) + console.log(selectedRowKeys); + }, + selectedRowKeys:chooseId, + getCheckboxProps: record => ({ + disabled: record.name === 'Disabled User', // Column configuration not to be checked + name: record.name, + }), + }; + + // 筛选下拉列表 + const teacherList = searchValue ? teachers.filter(e=>e.user_name.indexOf(searchValue)>-1) : teachers; + const course_groupsList = searchValue ? course_groups.filter(e=>e.name.indexOf(searchValue)>-1) : course_groups; + return( + <Modal + className={"AcrossModal"} + title={"交叉评阅设置"} + visible={modalVisible} + closable={false} + footer={null} + width="775px" + destroyOnClose={true} + > + <style> + {` + .AcrossModal .ant-modal-body{ + padding:0px; + } + .AcrossModal span.ant-radio + *{ + padding-right:0px; + } + .AcrossModal .ant-table-thead > tr > th,.AcrossModal .ant-table-tbody > tr > td{ + padding:7px 5px; + border-bottom:none!important; + } + .AcrossModal .ant-table-tbody{ + background:#F7FBFF; + } + .AcrossModal .ant-table-placeholder{ + border:none!important; + } + .AcrossModal .ant-table-tbody .ant-table-selection-column,.AcrossModal .ant-table-thead .ant-table-selection-column{ + padding-left: 23px!important; + } + .AcrossModal .ant-select-selection--multiple{ + padding-top:0px; + } + .AcrossModal .ant-select-selection--multiple .ant-select-selection__rendered>ul>li,.AcrossModal .ant-select-selection--multiple>ul>li{ + margin-top:3px; + margin-bottom:0px; + } + .AcrossModal .ant-select-selection__rendered{ + height:30px; + line-height:30px; + overflow-y:auto; + overflow-x:hidden; + margin-right:0px; + } + .ant-table-filter-dropdown{ + width:200px; + } + .ant-table-filter-dropdown .ant-dropdown-menu{ + height:200px + } + .ant-dropdown-menu-item > label{ + float:left + } + .ant-dropdown-menu-item > span{ + float: left; + max-width: 153px; + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis; + } + `} + </style> + <div className="pt20 pl30 pr30 acrossHead"> + <span className={"fl mt5"} style={{fontWeight: "400",color: "#05101A"}}>评阅分配方式:</span> + <span> + <RadioGroup onChange={this.funcommentstatus} value={comment_status}> + <Radio style={radioStyle} value={2}>手动分配评阅<span className={"font-14 color-grey-c ml5"}>(逐一指定每个学生的交叉评阅老师)</span></Radio> + <Radio style={radioStyle} value={4}>答辩组分配评阅<span className={"font-14 color-grey-c ml5"}>(将老师加入不同答辩组,指定每个学生的交叉评阅答辩组, + <a href={"/courses/"+courseId+"/teachers"} target="_blank"> + <span className={"color-blue"}>立即设置答辩组</span></a> + </span>)</Radio> + </RadioGroup> + </span> + </div> + <div className="clearfix mb15 mt15 pl30 pr30" id="acrossContent"> + <span className="fl color-grey-c mt5">已选 { chooseCount == 0 ? 0 : <span className="color-blue">{chooseCount}</span>} 个</span> + <span className="fr"> + <span className={"fl mt5"}>分配给{ comment_status && comment_status == 2 ? "老师":"答辩组"}:</span> + <span className={"fl"} style={{height:"32px"}} id="selectTags"> + <Select + mode="tags" + placeholder={ comment_status && comment_status == 2 ? "请选择老师":"请选择答辩组"} + value={AcrossTeamIds} + style={{width:"300px",height:"30px"}} + onChange={this.changeSelect} + open={showflag} + onFocus={()=>this.changeFlag(true)} + dropdownRender={menu => ( + <div id="selectDropdown"> + <div className="padding10-20"> + <Input + type='input' + value={searchValue} + onChange={this.changeSearchValue} + placeholder='请输入名称搜索' + style={{height:"30px"}} + className="searchInput" + ></Input> + </div> + {menu} + <Divider style={{ margin: '4px 0 0' }} /> + <div style={{ padding: '8px 12px', cursor: 'pointer' }}> + <a onClick={this.sureAcross} className="acrossSureBtn">确定</a> + <a onClick={this.clearSelect} className="ml20"><span className="acrossResetBtn color-blue">重置</span></a> + </div> + </div> + )} + > + { comment_status == 2 ? + teacherList && teacherList.map((i,key)=>{ + return <Option key={i.user_id} value={String(i.user_id)}>{i.user_name}</Option> + }): + course_groupsList && course_groupsList.map((i,key)=>{ + return <Option key={i.id} value={String(i.id)}>{i.name}</Option> + }) + } + </Select> + </span> + </span> + </div> + <Table rowSelection={rowSelection} columns={bindTableColumn(this)} dataSource={users} pagination={false} onChange={this.handleTableChange} loading={tableLoading}></Table> + <div className="clearfix mt20 pb30 pl30 pr30 acrossfoot"> + <div className="fl"> + { + user_count > limit ? + <Pagination defaultCurrent={page} current={page} pageSize={limit} total={user_count} onChange={this.onPageChange}></Pagination>:"" + } + </div> + <div className="fr"> + <a className="task-btn color-white mr30" onClick={this.props.modalCloss}>关闭</a> + <a className="task-btn task-btn-orange" onClick={this.props.modalCloss}>确认</a> + </div> + </div> + </Modal> + ) + } +} +export default GraduationAcrossCheck; \ No newline at end of file diff --git a/public/react/src/modules/courses/graduation/tasks/GraduationTaskDetail.js b/public/react/src/modules/courses/graduation/tasks/GraduationTaskDetail.js index e228d4146..dc5e4d602 100644 --- a/public/react/src/modules/courses/graduation/tasks/GraduationTaskDetail.js +++ b/public/react/src/modules/courses/graduation/tasks/GraduationTaskDetail.js @@ -10,6 +10,7 @@ import HomeworkModal from "../../coursesPublic/HomeworkModal"; import AccessoryModal from "../../coursesPublic/AccessoryModal"; import Associationmodel from '../../coursesPublic/Associationmodel'; import CoursesListType from '../../coursesPublic/CoursesListType'; +import GraduationAcrossCheck from "./GraduationAcrossCheck"; import moment from 'moment'; import "../../css/members.css" import "../../css/Courses.css" @@ -58,7 +59,8 @@ class GraduationTaskDetail extends Component{ Modalstype:undefined, Modalstopval:undefined, ModalCancel:undefined, - ModalSave:undefined + ModalSave:undefined, + acrossVisible:undefined } } componentDidMount(){ @@ -80,6 +82,21 @@ class GraduationTaskDetail extends Component{ }) } + + // 交叉评阅设置弹框 + openAcross=()=>{ + this.setState({ + acrossVisible:true + }) + } + closeAcross=()=>{ + this.setState({ + acrossVisible:false + }) + } + + + //返回 goback=()=>{ // let courseId=this.props.match.params.coursesId; @@ -190,7 +207,6 @@ class GraduationTaskDetail extends Component{ } // 取消 cancelmodel=()=>{ - debugger this.setState({ Modalstype:false, Loadtype:false, @@ -291,11 +307,13 @@ class GraduationTaskDetail extends Component{ Modalstype, Modalstopval, ModalCancel, - ModalSave + ModalSave, + acrossVisible } = this.state const commom = { - setTab:this.setTab + setTab:this.setTab, + getdatas:this.getdatas } return( <div className="newMain clearfix"> @@ -353,6 +371,20 @@ class GraduationTaskDetail extends Component{ destroyOnClose={true} centered={true} /> + + { + acrossVisible && + <GraduationAcrossCheck + {...this.props} + {...this.state} + task_Id={task_Id} + modalVisible={acrossVisible} + modalCloss={this.closeAcross} + resetFun={this.resetList} + comment_status={ questionslist && questionslist.comment_status } + /> + } + <p className="clearfix mt10"> <a onClick={this.goback} className="color-grey-9 fl">{questionslist.course_name}</a> <span className="color-grey-9 fl ml3 mr3">></span> @@ -436,7 +468,7 @@ class GraduationTaskDetail extends Component{ {/*<a className={"fr color-blue font-16"}>项目在线质量检测</a>*/} { this.props.isAdmin() ? questionslist.status===1 ? <a className={"fr color-blue font-16 mr20"} onClick={() => { this.end()} }>立即截止</a> : "" : "" } { this.props.isAdmin() ? questionslist.status===0 ? <a className={"fr color-blue font-16 mr20"} onClick={() => { this.publish()} }>立即发布</a> : "" : "" } - { this.props.isAdmin() ? <a className={"fr color-blue font-16"} href={"/courses/"+courseId+"/graduation_tasks/"+task_Id+"/edit"}>交叉评阅设置</a> : "" } + { this.props.isAdmin() && questionslist.cross_comment ? <a className={"fr color-blue font-16"} onClick={this.openAcross}>交叉评阅设置</a> : "" } { this.props.isAdmin() ? <a className={"fr color-blue font-16"} href={"/courses/"+courseId+"/graduation_tasks/"+task_Id+"/edit"}>编辑任务</a> : "" } </div> </div> diff --git a/public/react/src/modules/courses/graduation/tasks/GraduationTaskssetting.js b/public/react/src/modules/courses/graduation/tasks/GraduationTaskssetting.js index 874a69ca5..74300bf5d 100644 --- a/public/react/src/modules/courses/graduation/tasks/GraduationTaskssetting.js +++ b/public/react/src/modules/courses/graduation/tasks/GraduationTaskssetting.js @@ -79,7 +79,7 @@ class GraduationTaskssettingapp extends Component{ visible:false, starttime:undefined, DownloadType:false, - DownloadMessageval:undefined, + DownloadMessageval:undefined } } @@ -166,7 +166,7 @@ class GraduationTaskssettingapp extends Component{ } } - + baseprojectfun=(e)=>{ this.setState({ baseonproject:e.target.checked @@ -711,7 +711,9 @@ class GraduationTaskssettingapp extends Component{ starttime:undefined, course_groupslist:[], }) - this.props.showNotification(resulet.data.message); + this.props.showNotification(resulet.data.message); + //调用父组件方法,刷新按钮 + this.props.getdatas(); } } }).catch((error)=>{ @@ -1188,7 +1190,7 @@ class GraduationTaskssettingapp extends Component{ {crosscomment===true&&commenttimetype===true?<div className={"color-red ml70"}>{commenttimevalue}</div>:""} </div> - <div className={"mb20 ml30 ml87 ml87"}> + {/* <div className={"mb20 ml30 ml87 ml87"}> <span className={"fl mt6"}>评阅方式:</span> <span> @@ -1203,10 +1205,10 @@ class GraduationTaskssettingapp extends Component{ </RadioGroup> </span> - </div> + </div> */} - <div style={{display:crosscomment===false?"none":commentstatus===0?"none":commentstatus===2?"none":commentstatus===4?"":"none"}}> + {/* <div style={{display:crosscomment===false?"none":commentstatus===0?"none":commentstatus===2?"none":commentstatus===4?"":"none"}}> <div className={"h20 mb30 ml30 ml87"}> <span>评阅数:</span> <Input className="mr20" style={{width:"200px" }} value={commentnum} disabled={this.props.isAdmin()===true?flagPageEdit===true?false:true:true} onInput={this.setcommentnum} /> @@ -1243,7 +1245,7 @@ class GraduationTaskssettingapp extends Component{ ) })} - </div> + </div> */} </div>:""} From c77d45f0ca63132a1d19e181e83371f68cd91c27 Mon Sep 17 00:00:00 2001 From: caicai8 <1149225589@qq.com> Date: Wed, 18 Sep 2019 14:53:17 +0800 Subject: [PATCH 03/23] =?UTF-8?q?=E4=BA=A4=E5=8F=89=E8=AF=84=E9=98=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../tasks/{GraduationAcrossCheck.js => GraduationAcross.js} | 4 ++-- .../modules/courses/graduation/tasks/GraduationTaskDetail.js | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) rename public/react/src/modules/courses/graduation/tasks/{GraduationAcrossCheck.js => GraduationAcross.js} (99%) diff --git a/public/react/src/modules/courses/graduation/tasks/GraduationAcrossCheck.js b/public/react/src/modules/courses/graduation/tasks/GraduationAcross.js similarity index 99% rename from public/react/src/modules/courses/graduation/tasks/GraduationAcrossCheck.js rename to public/react/src/modules/courses/graduation/tasks/GraduationAcross.js index 2cca4ccae..809ad72ff 100644 --- a/public/react/src/modules/courses/graduation/tasks/GraduationAcrossCheck.js +++ b/public/react/src/modules/courses/graduation/tasks/GraduationAcross.js @@ -89,7 +89,7 @@ const bindTableColumn=(that)=>{ } return columns; } -class GraduationAcrossCheck extends Component{ +class GraduationAcross extends Component{ constructor(props){ super(props); this.state={ @@ -472,4 +472,4 @@ class GraduationAcrossCheck extends Component{ ) } } -export default GraduationAcrossCheck; \ No newline at end of file +export default GraduationAcross; \ No newline at end of file diff --git a/public/react/src/modules/courses/graduation/tasks/GraduationTaskDetail.js b/public/react/src/modules/courses/graduation/tasks/GraduationTaskDetail.js index dc5e4d602..abd40784a 100644 --- a/public/react/src/modules/courses/graduation/tasks/GraduationTaskDetail.js +++ b/public/react/src/modules/courses/graduation/tasks/GraduationTaskDetail.js @@ -10,7 +10,7 @@ import HomeworkModal from "../../coursesPublic/HomeworkModal"; import AccessoryModal from "../../coursesPublic/AccessoryModal"; import Associationmodel from '../../coursesPublic/Associationmodel'; import CoursesListType from '../../coursesPublic/CoursesListType'; -import GraduationAcrossCheck from "./GraduationAcrossCheck"; +import GraduationAcross from "./GraduationAcross"; import moment from 'moment'; import "../../css/members.css" import "../../css/Courses.css" @@ -374,7 +374,7 @@ class GraduationTaskDetail extends Component{ { acrossVisible && - <GraduationAcrossCheck + <GraduationAcross {...this.props} {...this.state} task_Id={task_Id} From 7c7b88b32ec5d6c4d931b8c1b1350e6c84cc662b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Mon, 23 Sep 2019 14:16:18 +0800 Subject: [PATCH 04/23] =?UTF-8?q?=20=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../courses/coursesDetail/CoursesLeftNav.js | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/public/react/src/modules/courses/coursesDetail/CoursesLeftNav.js b/public/react/src/modules/courses/coursesDetail/CoursesLeftNav.js index 35b06f305..4715132f4 100644 --- a/public/react/src/modules/courses/coursesDetail/CoursesLeftNav.js +++ b/public/react/src/modules/courses/coursesDetail/CoursesLeftNav.js @@ -235,6 +235,7 @@ class Coursesleftnav extends Component{ navidtype=true } this.props.updataleftNavfun() + // this.scrollToAnchor() } setnavid=(e,key,id,type,url)=>{ @@ -802,6 +803,11 @@ class Coursesleftnav extends Component{ chapterupdate:false, }) } + + //跳转道描点的地方 + scrollToAnchor = () => { + + } render(){ let { twosandiantype, @@ -823,7 +829,6 @@ class Coursesleftnav extends Component{ // console.log("778"); // console.log("CoursesLeftNav"); - // console.log(course_modules); return( @@ -976,6 +981,7 @@ class Coursesleftnav extends Component{ ref={provided.innerRef} {...provided.droppableProps} className={"droppableul"} + id={this.props.mainurl===item.category_url&&key===this.props.indexs?"scrolldroppableul"+this.props.match.params.category_id:""} style={{display: this.props.mainurl===item.category_url&&key===this.props.indexs?"":"none"}} > {item.second_category===undefined?"":item.second_category.map((iem,index)=>{ @@ -999,7 +1005,7 @@ class Coursesleftnav extends Component{ visible={false} > {/*"/courses/"+this.props.match.params.coursesId+"/"+item.type+"/"+iem.category_type+"/"+iem.category_id*/} - <a className={"Draggablelichild"}> + <a className={"Draggablelichild"} id={"scroll"+iem.category_id} ref={"scroll"+iem.category_id}> <li className="clearfix width93 Draggableli" key={index} onClick={(e)=>this.selectnavids(e,key,iem.category_id,item.type+"child",iem.second_category_url,key)} onMouseLeave={(e)=>this.twosandianhide(e,index,item.type)} onMouseEnter={(e)=>this.twosandianshow(e,index,item.type)} key={index} ref={provided.innerRef} @@ -1073,7 +1079,11 @@ class Coursesleftnav extends Component{ {/*下拉列表*/} {/* className={this.props.location.pathname===item.category_url||this.props.location.pathname===this.state.url&&key===this.state.indexs?"":""}*/} - <ul style={{display:this.props.mainurl===item.category_url&&key===this.props.indexs?"":"none"}} class="droppableul"> + <ul + style={{display:this.props.mainurl===item.category_url&&key===this.props.indexs?"":"none"}} + class="droppableul" + id={this.props.mainurl===item.category_url&&key===this.props.indexs?"scrolldroppableul"+this.props.match.params.category_id:""} + > { item.second_category===undefined?"":item.second_category.map((iem,index)=>{ @@ -1085,7 +1095,7 @@ class Coursesleftnav extends Component{ } } return( - <a > + <a id={"scroll"+iem.category_id} ref={"scroll"+iem.category_id}> <li className="clearfix Draggableli" key={index} style={{ width: '244px'}} title={iem.category_name.length<10?"":iem.category_name}> <a className="fl pl46 pd0 Draggablelichild" onClick={(e)=>this.selectnavids(e,key,iem.category_id,item.type+"child",iem.second_category_url,key)} > From b01ed8348a9ca91786314e50b7486c8ccf9c020f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Tue, 24 Sep 2019 09:58:03 +0800 Subject: [PATCH 05/23] =?UTF-8?q?=E5=90=88=E5=B9=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Gemfile.lock | 1 - app/controllers/polls_controller.rb | 2 +- app/models/homework_common.rb | 5 ++ app/models/poll.rb | 2 +- .../homework_commons/works_list.json.jbuilder | 1 + .../modules/courses/busyWork/NewWorkForm.js | 4 +- .../tasks/GraduationTasksSubmitedit.js | 2 +- .../tasks/GraduationTasksSubmitnew.js | 21 +++-- .../tasks/GraduationTaskssetting.js | 88 +++++++++++-------- .../tasks/GraduationTaskssettinglist.js | 82 ++++++++--------- .../modules/courses/graduation/tasks/index.js | 7 +- .../topics/GraduateTopicPostWorksNew.js | 4 +- .../react/src/modules/courses/poll/PollNew.js | 30 +++---- .../shixunHomework/Listofworksstudentone.js | 24 +++-- .../shixunHomework/Trainingjobsetting.js | 83 ++++++++++++++--- .../modules/paths/PathDetail/DetailTop.css | 9 +- .../src/modules/paths/PathDetail/DetailTop.js | 67 +++++++++++--- .../paths/PathDetail/PathDetailIndex.js | 13 ++- .../src/modules/user/usersInfo/InfosBanner.js | 14 +-- .../src/modules/user/usersInfo/usersInfo.css | 1 + 20 files changed, 310 insertions(+), 150 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 8aa2daa6a..6a4a7e08f 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -378,7 +378,6 @@ DEPENDENCIES kaminari (~> 1.1, >= 1.1.1) listen (>= 3.0.5, < 3.2) mysql2 (>= 0.4.4, < 0.6.0) - newrelic_rpm oauth2 pdfkit puma (~> 3.11) diff --git a/app/controllers/polls_controller.rb b/app/controllers/polls_controller.rb index 7cb7ee800..6ffe277a3 100644 --- a/app/controllers/polls_controller.rb +++ b/app/controllers/polls_controller.rb @@ -692,7 +692,7 @@ class PollsController < ApplicationController else unified_setting = @poll.unified_setting end - show_result = params[:show_result] ? 1 : 0 + show_result = params[:show_result].to_i un_anonymous = params[:un_anonymous] ? true : false # 统一设置或者分班为0,则更新问卷,并删除问卷分组 if unified_setting || (course_group_ids.size == 0) diff --git a/app/models/homework_common.rb b/app/models/homework_common.rb index 4c8f94a42..40de5a87c 100644 --- a/app/models/homework_common.rb +++ b/app/models/homework_common.rb @@ -134,6 +134,11 @@ class HomeworkCommon < ApplicationRecord self.homework_type == 'practice' && self.publish_time.present? && self.publish_time < Time.now && self.homework_group_reviews.count == 0 end + # 作业查看最新成绩 + def update_score identity + identity < Course::NORMAL && publish_time.present? && publish_time < Time.now && !course.is_end + end + # 作业能否立即发布 def publish_immediately user homework_detail_manual.try(:comment_status) == 0 || homework_group_settings.where(course_group_id: course.charge_group_ids(user)). diff --git a/app/models/poll.rb b/app/models/poll.rb index 7f0d2fd94..9cb860f61 100644 --- a/app/models/poll.rb +++ b/app/models/poll.rb @@ -104,7 +104,7 @@ class Poll < ApplicationRecord status = 4 else if user.present? && user.student_of_course?(course) - ex_time = get_poll_times(user_id,false) + ex_time = get_poll_times(user.id,false) pb_time = ex_time[:publish_time] ed_time = ex_time[:end_time] if pb_time.present? && ed_time.present? && pb_time <= Time.now && ed_time > Time.now diff --git a/app/views/homework_commons/works_list.json.jbuilder b/app/views/homework_commons/works_list.json.jbuilder index 08c269670..e567ea79a 100644 --- a/app/views/homework_commons/works_list.json.jbuilder +++ b/app/views/homework_commons/works_list.json.jbuilder @@ -4,6 +4,7 @@ json.partial! "homework_btn_check", locals: {identity: @user_course_identity, ho json.partial! "student_btn_check", locals: {identity: @user_course_identity, homework: @homework, work: @work} +json.update_score @homework.update_score(@user_course_identity) if @homework.homework_type == "practice" json.work_count @work_count json.all_member_count @all_member_count json.course_group_count @course.course_groups_count diff --git a/public/react/src/modules/courses/busyWork/NewWorkForm.js b/public/react/src/modules/courses/busyWork/NewWorkForm.js index 27413ba04..bc74576d3 100644 --- a/public/react/src/modules/courses/busyWork/NewWorkForm.js +++ b/public/react/src/modules/courses/busyWork/NewWorkForm.js @@ -479,7 +479,7 @@ class NewWorkForm extends Component{ <InputNumber className="winput-240-40" placeholder="请填写每组最大人数" value={max_num} max={10} onChange={this.max_num_change} style={{width:'180px'}} /> </ConditionToolTip> - <label className="color-grey-9 ml20 font-14">(项目管理员角色的成员都可以提交作品,提交作品时需要关联同组成员,组内成员作品共享)</label> + <label className="color-grey-9 ml20 font-14">(学生提交作品时需要关联同组成员,组内成员作品共享)</label> </p> <p className="mt20"> <ConditionToolTip condition={has_commit || has_project} title={'已有关联项目或作品,不能修改'}> @@ -488,7 +488,7 @@ class NewWorkForm extends Component{ >基于项目实施</Checkbox> </ConditionToolTip> - <label className="color-grey-9 ml12 font-14">(勾选后各小组必须在educoder平台创建项目,教师可随时观察平台对各小组最新进展的实时统计)</label> + <label className="color-grey-9 ml12 font-14">(选中,则必须在本平台创建项目,项目管理员可以提交作品;不选中,无需在平台创建项目,任意小组成员均可以提交作品)</label> </p> </div> )} diff --git a/public/react/src/modules/courses/graduation/tasks/GraduationTasksSubmitedit.js b/public/react/src/modules/courses/graduation/tasks/GraduationTasksSubmitedit.js index 41768333a..7c697e31b 100644 --- a/public/react/src/modules/courses/graduation/tasks/GraduationTasksSubmitedit.js +++ b/public/react/src/modules/courses/graduation/tasks/GraduationTasksSubmitedit.js @@ -285,7 +285,7 @@ class GraduationTasksSubmitedit extends Component{ let{ search,page,limit,workslist}=this.state; - let newpage=page+2 + let newpage=page+1 this.searchList(search,newpage,limit,workslist.task_id,1) diff --git a/public/react/src/modules/courses/graduation/tasks/GraduationTasksSubmitnew.js b/public/react/src/modules/courses/graduation/tasks/GraduationTasksSubmitnew.js index be29d45a4..7438b36a4 100644 --- a/public/react/src/modules/courses/graduation/tasks/GraduationTasksSubmitnew.js +++ b/public/react/src/modules/courses/graduation/tasks/GraduationTasksSubmitnew.js @@ -271,20 +271,27 @@ class GraduationTasksSubmitnew extends Component{ contentViewScroll=(e)=>{ - //滑动到底判断 + + + //滑动到底判断 + const {memberslist} = this.state; let newscrollTop=parseInt(e.currentTarget.scrollTop); let allclientHeight=e.currentTarget.clientHeight+newscrollTop; - if(e.currentTarget.scrollHeight-allclientHeight===0||e.currentTarget.scrollHeight-allclientHeight===1||e.currentTarget.scrollHeight-allclientHeight===-1){ - // console.log("到达底部"); - let{ search,page,limit }=this.state; + if(memberslist.length===0){ + return; + }else{ + let{ search,page,limit }=this.state; - let newpage=page+2 + let newpage=page+1 + + this.searchList(search,newpage,limit,1) + + } + } - this.searchList(search,newpage,limit,1) - } } diff --git a/public/react/src/modules/courses/graduation/tasks/GraduationTaskssetting.js b/public/react/src/modules/courses/graduation/tasks/GraduationTaskssetting.js index 74300bf5d..2cb906b94 100644 --- a/public/react/src/modules/courses/graduation/tasks/GraduationTaskssetting.js +++ b/public/react/src/modules/courses/graduation/tasks/GraduationTaskssetting.js @@ -79,7 +79,9 @@ class GraduationTaskssettingapp extends Component{ visible:false, starttime:undefined, DownloadType:false, - DownloadMessageval:undefined + DownloadMessageval:undefined, + commentstatustype:undefined, + commenttimeone:undefined } } @@ -102,10 +104,10 @@ class GraduationTaskssettingapp extends Component{ } let starttype=false; let endtype=false; - if(moment(result.data.publish_time)<moment()){ + if(moment(result.data.publish_time)<=moment()){ starttype=true } - if(moment(result.data.end_time)<moment()){ + if(moment(result.data.end_time)<=moment()){ endtype=true } @@ -130,6 +132,7 @@ class GraduationTaskssettingapp extends Component{ taskname: result.data.task_name, coursename: result.data.course_name, commentstatus: result.data.comment_status, + commentstatustype:result.data.status, commentnum: result.data.comment_num, operworks: result.data.open_work, opergrade: result.data.open_score, @@ -166,7 +169,7 @@ class GraduationTaskssettingapp extends Component{ } } - + baseprojectfun=(e)=>{ this.setState({ baseonproject:e.target.checked @@ -343,28 +346,33 @@ class GraduationTaskssettingapp extends Component{ let {endtimetype}=this.state; if(types===1){ this.setState({ - latetime:newlatetime, + // latetime:newlatetime, crosscomment:true, - commenttime:newcommenttime + commenttime:newlatetime, + commenttimeone:newlatetime, }) }else{ if(endtimetype===true){ this.setState({ crosscomment:true, - commenttime:newcommenttime + commenttime:newlatetime, + commenttimeone:newlatetime, }) }else{ this.setState({ - end_time:newlatetime, + // end_time:newlatetime, crosscomment:true, - commenttime:newcommenttime + commenttime:newlatetime, + commenttimeone:newlatetime, }) } } } funcrosscomment=(e)=>{ - let {latetime,end_time,allowlate}=this.state; + let {latetime,end_time,allowlate,commenttime,commenttimeone}=this.state; + let commenttimetype=commenttime===null||commenttime===""; + let newlatetimea=moment(new Date()).add(7, 'days').format("YYYY-MM-DD HH:mm"); let newcommenttimea=moment(new Date()).format("YYYY-MM-DD HH:mm"); @@ -377,26 +385,33 @@ class GraduationTaskssettingapp extends Component{ let newend_timed=moment(end_time).add(7, 'days').format("YYYY-MM-DD HH:mm"); let newcommenttimed=moment(end_time).add(8, 'days').format("YYYY-MM-DD HH:mm"); - let newtime; if(e.target.checked===true){ - - if(allowlate===1||allowlate===true){ - if(latetime===null||latetime===""){ - this.updatesfuncrosscomment(1,newlatetimea,newcommenttimea) - }else{ - this.updatesfuncrosscomment(1,newlatetimes,newcommenttimes) - } - }else{ - if(end_time===null||end_time===""){ - this.updatesfuncrosscomment(2,newend_timeb,newcommenttimeb) + if(commenttimetype===true){ + + if(allowlate===1||allowlate===true){ + if(latetime===null||latetime===""){ + this.updatesfuncrosscomment(1,newlatetimea,newcommenttimea) + }else{ + this.updatesfuncrosscomment(1,newlatetimes,newcommenttimes) + } + }else{ + if(end_time===null||end_time===""){ + this.updatesfuncrosscomment(2,newend_timeb,newcommenttimeb) + }else{ + this.updatesfuncrosscomment(2,newend_timed,newcommenttimed) + } + } }else{ - this.updatesfuncrosscomment(2,newend_timed,newcommenttimed) - } - } + this.setState({ + crosscomment:e.target.checked, + commenttime:commenttimeone, + }) + } + }else{ this.setState({ crosscomment:e.target.checked, - commenttime:undefined + commenttime:undefined }) } } @@ -519,10 +534,10 @@ class GraduationTaskssettingapp extends Component{ } - if(moment(end_time)<moment(publish_time)){ + if(moment(end_time)<=moment(publish_time)){ this.setState({ endTimetypes:true, - endTimetypesval:"截止时间不能早于发布时间" + endTimetypesval:"截止时间必须晚于发布时间" }) return }else{ @@ -531,16 +546,16 @@ class GraduationTaskssettingapp extends Component{ }) } - if(moment(latetime)<moment(publish_time)){ + if(moment(latetime)<=moment(publish_time)){ this.setState({ latetimetype:true, - latetimetypeval:"结束时间不能早于发布时间" + latetimetypeval:"结束时间必须晚于发布时间" }) return - }else if(moment(latetime)<moment(end_time)){ + }else if(moment(latetime)<=moment(end_time)){ this.setState({ latetimetype:true, - latetimetypeval:"结束时间不能早于截止时间" + latetimetypeval:"结束时间必须晚于截止时间" }) return }else{ @@ -562,7 +577,7 @@ class GraduationTaskssettingapp extends Component{ commenttimetype:false }) } - if(moment(this.state.commenttime)<moment(publish_time)){ + if(moment(this.state.commenttime)<=moment(publish_time)){ this.setState({ commenttimetype:true, commenttimevalue:"开始时间不能小于发布时间", @@ -574,7 +589,7 @@ class GraduationTaskssettingapp extends Component{ }) } - if(moment(this.state.commenttime)<moment(end_time)){ + if(moment(this.state.commenttime)<=moment(end_time)){ this.setState({ commenttimetype:true, commenttimevalue:"开始时间不能小于截止时间", @@ -920,7 +935,8 @@ class GraduationTaskssettingapp extends Component{ endtimetype, commenttimetype, commenttimevalue, - flagPageEdit + flagPageEdit, + commentstatustype } =this.state; let courseId=this.props.match.params.coursesId; @@ -994,7 +1010,7 @@ class GraduationTaskssettingapp extends Component{ } {/*内容*/} {task_type===2?<div className="stud-class-set bor-bottom-greyE pd20 edu-back-white pl30" > - <div className={"xingrequired font-16 color-dark h20 mb20"}>分组设置 <span className={"font-14 color-grey-c"}>(提交作品时需要关联同组成员,组内成员作品共享)</span></div> + <div className={"xingrequired font-16 color-dark h20 mb20"}>分组设置 <span className={"font-14 color-grey-c"}></span></div> <div className={"mb30 h20 ml40"}> <Input className={numtype===true?"noticeTip mr20":"mr20"} style={{ width:"100px" }} value={minnum} onInput={this.setminnum} disabled={this.props.isAdmin()===true?flagPageEdit===true?false:true:true}/> <span className="mr20">~</span> @@ -1156,7 +1172,7 @@ class GraduationTaskssettingapp extends Component{ <div className={" font-16 color-dark h20 mb20"}>评分设置 </div> <div className={"font-16 h20 mb20"}>最终成绩组成 <span className={"font-14 color-grey-c"}>(取各教师最终评分的平均分)</span></div> <Checkbox className="ml40 font-16" checked={crosscomment} onChange={this.funcrosscomment} - disabled={this.props.isAdmin()===true?flagPageEdit===true?false:true:true} >启用交叉评阅 <span className={"font-14 color-grey-c"}>(给老师分配其他指导老师的学生作品)</span> + disabled={this.props.isAdmin()===true?flagPageEdit===true?commentstatustype===3?true:false:true:true} >启用交叉评阅 <span className={"font-14 color-grey-c"}>(给老师分配其他指导老师的学生作品)</span> </Checkbox> {crosscomment===true?<div> <div className={"h20 mb30 ml30 mt20 ml87"}> diff --git a/public/react/src/modules/courses/graduation/tasks/GraduationTaskssettinglist.js b/public/react/src/modules/courses/graduation/tasks/GraduationTaskssettinglist.js index 20a34ab89..0469d5d9c 100644 --- a/public/react/src/modules/courses/graduation/tasks/GraduationTaskssettinglist.js +++ b/public/react/src/modules/courses/graduation/tasks/GraduationTaskssettinglist.js @@ -850,47 +850,47 @@ class GraduationTaskssettinglist extends Component{ </span> ), }, { - title: '操作', - key: 'operation', - width:'100px', - dataIndex: 'operation', - className:'edu-txt-center', - render: operation => ( - <div> - {this.props.isAdmin()?operation.map((tag,key) => { - return( - <React.Fragment> - { - tag.name && - <Tooltip key={key} placement="bottom" title={tag.name==="分配"?"指定该作品的交叉评阅人":tag.name==="调分"?<pre>调整学生最终成绩<br/>其它历史评分将全部失效</pre>:""}> - {tag.name==="评阅"?<a style={{color:'#4CACFF',padding:"0px 5px"}} href={"/courses/"+courseId+"/graduation_tasks/"+tag.id+"/appraise"} > - {tag.name} - </a> - : - <a style={{color:tag.name==="调分"?"#000":'#4CACFF',padding:"0px 5px"}} - onClick={tag.name==="调分"?()=>this.showModulationtype(tag.id):tag.name==="分配"?()=>this.showAllocationModal(tag.id):""}> - {tag.name} - </a> - } - </Tooltip> - } - </React.Fragment> - ) - }):""} - { - this.props.isStudent()? - operation.map((tag,key) => { - return( - <div key={key}> - {tag.view_work===false?"--":<a style={{color:'#4CACFF'}} href={"/courses/"+courseId+"/graduation_tasks/"+tag.id+"/appraise"} >查看</a>} - </div> - )} - ):"" - } - </div> + title: '操作', + key: 'operation', + width:'100px', + dataIndex: 'operation', + className:'edu-txt-center', + render: operation => ( + <div> + {this.props.isAdmin()?operation.map((tag,key) => { + return( + <React.Fragment> + { + tag.name && + <Tooltip key={key} placement="bottom" title={tag.name==="分配"?"指定该作品的交叉评阅人":tag.name==="调分"?<pre>调整学生最终成绩<br/>其它历史评分将全部失效</pre>:""}> + {tag.name==="评阅"?<a style={{color:'#4CACFF',padding:"0px 5px"}} href={"/courses/"+courseId+"/graduation_tasks/"+tag.id+"/appraise"} > + {tag.name} + </a> + : + <a style={{color:tag.name==="调分"?"#000":'#4CACFF',padding:"0px 5px"}} + onClick={tag.name==="调分"?()=>this.showModulationtype(tag.id):tag.name==="分配"?()=>this.showAllocationModal(tag.id):""}> + {tag.name} + </a> + } + </Tooltip> + } + </React.Fragment> + ) + }):""} + { + this.props.isStudent()? + operation.map((tag,key) => { + return( + <div key={key}> + {tag.view_work===false?"--":<a style={{color:'#4CACFF'}} href={"/courses/"+courseId+"/graduation_tasks/"+tag.id+"/appraise"} >查看</a>} + </div> + )} + ):"" + } + </div> - ), - }]; + ), + }]; let courseId=this.props.match.params.coursesId; let position=this.props.match.params.position; @@ -972,7 +972,7 @@ class GraduationTaskssettinglist extends Component{ text-overflow: ellipsis; white-space: nowrap; } - .ant-table-tbody>tr>td, .ant-table-thead>tr>th{ + .ant-table-tbody>tr>td, .ant-table-thead>tr>th{ padding: 16px 10px } diff --git a/public/react/src/modules/courses/graduation/tasks/index.js b/public/react/src/modules/courses/graduation/tasks/index.js index ed52d5cbc..ae764cc95 100644 --- a/public/react/src/modules/courses/graduation/tasks/index.js +++ b/public/react/src/modules/courses/graduation/tasks/index.js @@ -88,7 +88,7 @@ class GraduationTasks extends Component{ savedelete=()=>{ this.setState({ - Modalstype:false, + Modalstype:false, }) let {checkAllValue,checkBoxValues,search,page,order} = this.state; // let all_check; @@ -107,9 +107,10 @@ class GraduationTasks extends Component{ if (response.data.status == 0) { // {"status":1,"message":"删除成功"} this.fetchAll(search,page,order) + this.props.showNotification(response.data.message); this.setState({ - Modalstype:true, - Modalstopval:response.data.message, + // Modalstype:true, + // Modalstopval:response.data.message, ModalsBottomval:"", ModalSave:this.cancelmodel, Loadtype:true, diff --git a/public/react/src/modules/courses/graduation/topics/GraduateTopicPostWorksNew.js b/public/react/src/modules/courses/graduation/topics/GraduateTopicPostWorksNew.js index b53e4528b..38e68ad32 100644 --- a/public/react/src/modules/courses/graduation/topics/GraduateTopicPostWorksNew.js +++ b/public/react/src/modules/courses/graduation/topics/GraduateTopicPostWorksNew.js @@ -382,7 +382,7 @@ class GraduateTopicPostWorksNew extends Component{ )} </Form.Item> - <span className="tag color-grey9 ">(项目管理员角色的成员都可以提交作品,提交作品时需要关联同组成员,组内成员作品共享)</span> + <span className="tag color-grey9 ">(学生提交作品时需要关联同组成员,组内成员作品共享)</span> <Form.Item label="" className=" " @@ -394,7 +394,7 @@ class GraduateTopicPostWorksNew extends Component{ <Checkbox >基于项目实施</Checkbox> )} </Form.Item> - <span className="tag color-grey9 ">(勾选后各小组必须在educoder平台创建项目,教师可随时观察平台对各小组最小进展的实时统计)</span> + <span className="tag color-grey9 ">(选中,则必须在本平台创建项目,项目管理员可以提交作品;不选中,无需在平台创建项目,任意小组成员均可以提交作品)</span> </div> <div className="formBlock"> diff --git a/public/react/src/modules/courses/poll/PollNew.js b/public/react/src/modules/courses/poll/PollNew.js index 9d34b7036..5aa7f8f72 100644 --- a/public/react/src/modules/courses/poll/PollNew.js +++ b/public/react/src/modules/courses/poll/PollNew.js @@ -2863,7 +2863,7 @@ class PollNew extends Component { } </style> <Input placeholder="请输入问卷标题,最大限制60个字符" maxLength="60" - style={{"margin-top": "15px", "text-align": "left"}} + style={{"margin-top": "15px", textAlign: "left"}} onInput={this.changeTopicName} readOnly={readOnlys} autoComplete="off" @@ -2887,7 +2887,7 @@ class PollNew extends Component { <div style={{"color": "#212121", "font-size": "16px"}}>问卷须知</div> <TextArea placeholder="请输入本次问卷答题的相关说明,最大限制100个字符" - style={{"height": "120px", "margin-top": "15px", "text-align": "left"}} + style={{"height": "120px", "margin-top": "15px", textAlign: "left"}} maxLength="100" readOnly={readOnlys} onInput={this.changeTopicNametwo} @@ -3012,8 +3012,8 @@ class PollNew extends Component { {item.question.answers === undefined ? "" : item.question.answers.map((items, i) => { return ( <div className="h20 pt20" style={{"clear": "both"}}> - <Radio value={i} className={"fl"} style={{"text-align": "left",marginTop:"3px"}}></Radio> - <span className={" flex1 "} style={{"text-align": "left","white-space":"pre-wrap","word-break": "break-all","word-wrap": "break-word","float": "left","width":"1116px"}} >{items.answer_text}</span> + <Radio value={i} className={"fl"} style={{textAlign: "left",marginTop:"3px"}}></Radio> + <span className={" flex1 "} style={{textAlign: "left","white-space":"pre-wrap","word-break": "break-all","word-wrap": "break-word","float": "left","width":"1116px"}} >{items.answer_text}</span> </div> ) @@ -3029,8 +3029,8 @@ class PollNew extends Component { {item.question.answers === undefined ? "" : item.question.answers.map((items, i) => { return ( <div className="mt10 pt20 " style={{"clear": "both"}}> - <Checkbox value={i} key={i} className={"fl"} style={{"text-align": "left"}}></Checkbox> - <span className={" flex1"} style={{"text-align": "left","white-space":"pre-wrap","word-break": "break-all","word-wrap": "break-word","float": "left","width":"1120px"}}>{items.answer_text}</span> + <Checkbox value={i} key={i} className={"fl"} style={{textAlign: "left",marginRight:"8px"}}></Checkbox> + <span className={" flex1"} style={{textAlign: "left","white-space":"pre-wrap","word-break": "break-all","word-wrap": "break-word","float": "left","width":"1116px"}}>{items.answer_text}</span> </div> ) })} @@ -3086,7 +3086,7 @@ class PollNew extends Component { <p className="df mb20"> <span className="color-grey-6 mr3 w60 font-16 lineh-40" - style={{"text-align": "center"}}>其它</span> + style={{textAlign: "center"}}>其它</span> <input className="mr20 input-flex-40 TextAreainput" disabled @@ -3100,7 +3100,7 @@ class PollNew extends Component { : ""} </p>) : (<p className="df mb20"> <span className="color-grey-6 mr10 w60 font-16 lineh-40" - style={{"text-align": "center"}}>选项</span> + style={{textAlign: "center"}}>选项</span> <TextArea autosize={{minRows: 1, maxRows: 5}} @@ -3172,7 +3172,7 @@ class PollNew extends Component { "height": "80%"; "margin-top": "5px"; "margin-left": "5px"; - "text-align": "center"; + textAlign: "center"; "display": "block"; "opacity": "1"; } @@ -3328,7 +3328,7 @@ class PollNew extends Component { <p className="df mb20"> <span className="color-grey-6 mr3 w60 font-16 lineh-40" - style={{"text-align": "center"}}>其它</span> + style={{textAlign: "center"}}>其它</span> <input className="mr20 input-flex-40 TextAreainput" disabled @@ -3342,7 +3342,7 @@ class PollNew extends Component { : ""} </p>) : (<p className="df mb20"> <span className="color-grey-6 mr10 w60 font-16 lineh-40" - style={{"text-align": "center"}}>选项</span> + style={{textAlign: "center"}}>选项</span> <TextArea autosize={{minRows: 1, maxRows: 5}} @@ -3414,7 +3414,7 @@ class PollNew extends Component { "height": "80%"; "margin-top": "5px"; "margin-left": "5px"; - "text-align": "center"; + textAlign: "center"; "display": "block"; "opacity": "1"; } @@ -3579,7 +3579,7 @@ class PollNew extends Component { <p className="df mb20"> <span className="color-grey-6 mr3 w60 font-16 lineh-40" - style={{"text-align": "center"}}>其它</span> + style={{textAlign: "center"}}>其它</span> <input className="mr20 input-flex-40 TextAreainput" disabled @@ -3593,7 +3593,7 @@ class PollNew extends Component { : ""} </p>) : (<p className="df mb20"> <span className="color-grey-6 mr10 w60 font-16 lineh-40" - style={{"text-align": "center"}}>选项</span> + style={{textAlign: "center"}}>选项</span> <TextArea autosize={{minRows: 1, maxRows: 5}} @@ -3665,7 +3665,7 @@ class PollNew extends Component { "height": "80%"; "margin-top": "5px"; "margin-left": "5px"; - "text-align": "center"; + textAlign: "center"; "display": "block"; "opacity": "1"; } diff --git a/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js b/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js index c600e01ff..93ed7ff7d 100644 --- a/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js +++ b/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js @@ -3231,7 +3231,7 @@ class Listofworksstudentone extends Component { <div className="fr mr5 search-newysl" style={{marginBottom: '1px'}}> {course_is_end===true?"":<span> - {teacherdata&&teacherdata.publish_immediately===false&&computeTimetype===true? + {teacherdata&&teacherdata.update_score===true&&computeTimetype===true? (this.props.isNotMember()===false?<div className={"computeTime font-16"} onClick={this.setComputeTimet}> 查看最新成绩 </div>:""): @@ -3555,9 +3555,13 @@ class Listofworksstudentone extends Component { { course_is_end===true?"":teacherdata&&teacherdata.task_operation[0]==="开启挑战"?"":<span> {computeTimetype===true? (this.props.isNotMember()===false? - <div className={"computeTime font-16"} onClick={this.setComputeTime}> - 查看最新成绩 - </div> + ( + teacherdata&&teacherdata.update_score===true? + <div className={"computeTime font-16"} onClick={this.setComputeTime}> + 查看最新成绩 + </div> + :"" + ) :"") : (teacherdata&&teacherdata.homework_status!==undefined&&teacherdata.homework_status[0]=== "未发布"? "": @@ -3783,9 +3787,15 @@ class Listofworksstudentone extends Component { <span className="fl mr10 color-grey-6 ">计算成绩时间:{teacherdata&&teacherdata.calculation_time==null?"--": moment(teacherdata&&teacherdata.calculation_time).format('YYYY-MM-DD HH:mm')}</span> { course_is_end===true?"":teacherdata&&teacherdata.task_operation&&teacherdata.task_operation[0]==="开启挑战"?"":<span> {computeTimetype===true? - (this.props.isNotMember()===false?<div className={"computeTime font-16"} onClick={this.setComputeTime}> - 查看最新成绩 - </div>:""): + + (this.props.isNotMember()===false? + ( + teacherdata&&teacherdata.update_score===true? + <div className={"computeTime font-16"} onClick={this.setComputeTime}> + 查看最新成绩 + </div>:"" + ) + :""): teacherdata&&teacherdata.homework_status!==undefined&&teacherdata.homework_status[0]=== "未发布"? "": (this.props.isNotMember()===false?<div className={"computeTimes font-16"}> 查看最新成绩 diff --git a/public/react/src/modules/courses/shixunHomework/Trainingjobsetting.js b/public/react/src/modules/courses/shixunHomework/Trainingjobsetting.js index 0046afb19..366f239d0 100644 --- a/public/react/src/modules/courses/shixunHomework/Trainingjobsetting.js +++ b/public/react/src/modules/courses/shixunHomework/Trainingjobsetting.js @@ -1699,16 +1699,79 @@ class Trainingjobsetting extends Component { if(this.state.allowreplenishment === false){ whethertopays=false; } - this.setState({ - flagPageEditsbox:true, - flagPageEdit: true, - whethertopay:whethertopays, - flagPageEditstwo:releasetime, - flagPageEditsthrees:deadline, - flagPageEditsfor:endtime, - completionefficiencyscore:true, - unifiedsetting:this.state.unifiedsetting, - }) + if(this.state.jobsettingsdata!==undefined){ + + } + + try { + if(this.state.jobsettingsdata&& this.state.jobsettingsdata.data.homework_status[0]==="未发布"){ + this.setState({ + flagPageEditsbox:true, + flagPageEdit: true, + whethertopay:whethertopays, + flagPageEditstwo:releasetime, + flagPageEditsthrees:deadline, + flagPageEditsfor:endtime, + completionefficiencyscore:true, + work_efficiencys:true, + unifiedsetting:this.state.unifiedsetting, + latedeductiontwo:20, + }); + //均分比例 + try { + if(this.state.proportion==="均分比例"){ + this.Equalproportion(20); + + }else if(this.state.proportion==="经验值比例"){ + this.Empiricalvalueratio(20); + + } + }catch (e) { + + } + + }else { + this.setState({ + flagPageEditsbox:true, + flagPageEdit: true, + whethertopay:whethertopays, + flagPageEditstwo:releasetime, + flagPageEditsthrees:deadline, + flagPageEditsfor:endtime, + + unifiedsetting:this.state.unifiedsetting, + }); + if(this.state.work_efficiencys===true){ + this.setState({ + completionefficiencyscore:true, + }) + }else{ + this.setState({ + completionefficiencyscore:false, + }) + } + } + }catch (e) { + this.setState({ + flagPageEditsbox:true, + flagPageEdit: true, + whethertopay:whethertopays, + flagPageEditstwo:releasetime, + flagPageEditsthrees:deadline, + flagPageEditsfor:endtime, + unifiedsetting:this.state.unifiedsetting, + }); + if(this.state.work_efficiencys===true){ + this.setState({ + completionefficiencyscore:true, + }) + }else{ + this.setState({ + completionefficiencyscore:false, + }) + } + } + if(this.state.proportion === "自定义分值"){ this.setState({ boolUnitetwoname:"自定义分值", diff --git a/public/react/src/modules/paths/PathDetail/DetailTop.css b/public/react/src/modules/paths/PathDetail/DetailTop.css index 40363f056..7656bb77d 100644 --- a/public/react/src/modules/paths/PathDetail/DetailTop.css +++ b/public/react/src/modules/paths/PathDetail/DetailTop.css @@ -17,7 +17,7 @@ box-sizing: border-box; } .userNavs{ - line-height: 96px; + line-height: 75px; background: #fff; height:96px; background:rgba(255,255,255,1); @@ -79,3 +79,10 @@ margin-top: 43px; } +.mb120{ + margin-bottom: 120px !important; +} + +.mb80{ + margin-bottom: 80px !important; +} \ No newline at end of file diff --git a/public/react/src/modules/paths/PathDetail/DetailTop.js b/public/react/src/modules/paths/PathDetail/DetailTop.js index c6c2f1a75..9b85f6498 100644 --- a/public/react/src/modules/paths/PathDetail/DetailTop.js +++ b/public/react/src/modules/paths/PathDetail/DetailTop.js @@ -5,10 +5,12 @@ import SendPanel from "./sendPanel.js"; import { getImageUrl } from 'educoder'; import axios from 'axios'; import Modals from '../../modals/Modals'; +import AccountProfile from"../../user/AccountProfile"; import OpenCourse from './OpenCourse'; -import Jointheclass from '../../modals/Jointheclass' +import Jointheclass from '../../modals/Jointheclass'; import './DetailTop.css'; + const Search = Input.Search; const RadioGroup = Radio.Group; class DetailTop extends Component{ @@ -262,6 +264,18 @@ class DetailTop extends Component{ } putappointment=()=>{ + if(this.props.checkIfLogin()===false){ + this.props.showLoginDialog() + return + } + + if(this.props.current_user&&this.props.current_user.profile_completed===false){ + this.setState({ + AccountProfiletype:true + }) + return + } + this.setState({ Modalstype:true, Modalstopval:"是否确认立即预约?", @@ -321,9 +335,15 @@ class DetailTop extends Component{ this.cardsModalcancel() }) } + + hideAccountProfile=()=>{ + this.setState({ + AccountProfiletype:false + }) + } render(){ let{detailInfoList}=this.props; - let{Modalstype,Modalstopval,cardsModalcancel,putappointmenttype,Modalsbottomval,cardsModalsavetype,loadtype,getappointmenttype}=this.state; + let{Modalstype,Modalstopval,cardsModalcancel,putappointmenttype,Modalsbottomval,cardsModalsavetype,loadtype,getappointmenttype,AccountProfiletype}=this.state; const radioStyle = { display: 'block', height: '30px', @@ -352,7 +372,13 @@ class DetailTop extends Component{ return( - <div className={this.props.courses===undefined||this.props.courses.length===0?"subhead":applypath===false?"subhead mb70":this.state.MenuItemskey===this.props.courses.length?"subhead mb100":"subhead mb70"}> + <div className={this.props.courses===undefined?"subhead":this.props.courses.length===0?applypath===true?"subhead mb100":"subhead":applypath===false?detailInfoList.name.length>40?"subhead mb100":"subhead mb70":this.state.MenuItemskey===this.props.courses.length?"subhead mb120":detailInfoList.name.length>40?"subhead mb100":"subhead mb80"}> + {AccountProfiletype===true?<AccountProfile + hideAccountProfile={()=>this.hideAccountProfile()} + {...this.props} + {...this.state} + />:""} + <Modals modalsType={Modalstype} modalsTopval={Modalstopval} @@ -364,10 +390,24 @@ class DetailTop extends Component{ </Modals> {this.state.yslJointhe===true?<Jointheclass {...this.props} {...this.state} ysljoinmodalCancel={()=>this.ysljoinmodalCancel()} ysljoinmodalCanceltwo={()=>this.ysljoinmodalCanceltwo(this.state.MenuItemskey)}></Jointheclass>:""} {this.state.OpenCourseTypes===true?<OpenCourse {...this.props} {...this.state} OpenCourseCancel={()=>this.OpenCourseCancel()}/>:""} + <style> + { + + ` + .subhead_content{ + position: relative; + } + .userNavs{ + position: absolute; + width: 1200px; + } + ` + } + </style> { detailInfoList && - <div className={this.props.courses===undefined?"subhead_content":this.props.courses.length===0?"subhead_content pt40":"subhead_content pt100"}> + <div className={this.props.courses===undefined?"subhead_content":this.props.courses.length===0?"subhead_content pt40":"subhead_content "}> <div className="font-28 color-white clearfix"> {/*<Tooltip placement="bottom" title={detailInfoList.name.length>27?detailInfoList.name:""}>*/} @@ -486,7 +526,7 @@ class DetailTop extends Component{ </div> - {this.props.courses===undefined||isadminallow_statistics===true?"":<div className="userNavs mt20" style={applypath===false?{}:this.state.MenuItemskey===this.props.courses.length?{height:'158px'}:{}}> + {this.props.courses===undefined||isadminallow_statistics===true?"":<div className="userNavs mt20" style={applypath===false?{}:this.state.MenuItemskey===this.props.courses.length?{height:'135px'}:{}}> <style> { ` @@ -509,7 +549,7 @@ class DetailTop extends Component{ ` } </style> - {this.props.courses===undefined||this.props.courses.length===0?"":<li className={"fl pd4020"}> + {this.props.courses===undefined||this.props.courses.length===0?"":<li className={"fl pd4020 mt10"}> {this.state.courseslist.map((item,key)=>{ if(item.course_identity<4){ @@ -651,7 +691,10 @@ class DetailTop extends Component{ .mt26{ margin-top:26px; } - + .mt10block{ + margin-top: 10px; + display: inline-block; + } ` } </style> @@ -671,8 +714,8 @@ class DetailTop extends Component{ <span className={coursestypes===true?"fr user_default_btn background191 font-18 pathbtensbox mt5":"fr user_default_btn background191 font-18 pathbtensbox mt26"}>预约报名成功</span>:""} {/*{item.course_status.status===0?<div className="mr51 shixun_detail pointer fl user-colorgrey-green pathdefault">即将开课</div>:""}*/} - {item.course_status.status===1?<div className="mr51 shixun_detail pointer fl color-orange pathdefault">{item.course_status.time}</div>:""} - {item.course_status.status===2&&item.course_identity<6?<div className="mr20 shixun_detail pointer fl user-colorgrey-9b pathdefault">已结束</div>:""} + {item.course_status.status===1?<div className="mr51 shixun_detail pointer fl color-orange pathdefault mt10">{item.course_status.time}</div>:""} + {item.course_status.status===2&&item.course_identity<6?<div className="mr20 shixun_detail pointer fl user-colorgrey-9b pathdefault mt10">已结束</div>:""} {/*<div className="fr user_default_btn background191 font-18 mt28 pathbtens pathdefault">已结束</div>*/} {item.course_status.status===0? item.course_identity<5?<a className="fr user_default_btn task-btn-orange font-18 mt28 pathbtens courseslistsa mr20" href={item.first_category_url} target="_blank"> @@ -690,7 +733,7 @@ class DetailTop extends Component{ {item.course_status.status===2? item.course_identity<6?<a className="fr user_default_btn task-btn-orange font-18 mt28 pathbtens courseslistsa mr20" href={item.first_category_url} target="_blank"> 进入课堂 - </a>:<div className="mr20 shixun_detail pointer fl user-colorgrey-9b pathdefault">已结束</div>:""} + </a>:<div className="mr20 shixun_detail pointer fl user-colorgrey-9b pathdefault mt10">已结束</div>:""} </div> )})} @@ -712,8 +755,8 @@ class DetailTop extends Component{ :""} {applypath===true&&this.props.courses.length===0?this.state.MenuItemskey===this.props.courses.length||coursestypes===true?<span className={coursestypes===true?"fl ml20 lineHeight0 relativewidth":"fl ml20 lineHeight0 relativewidth"}> - <span>当前预约报名人数:<span className={"color-red mr5"}>{getappointmenttype===true?this.props.detailInfoList&&this.props.detailInfoList.participant_count+1:this.props.detailInfoList&&this.props.detailInfoList.participant_count}</span>人</span> - <span className={"font153"}>当预约报名人数达到 {this.props.detailInfoList&&this.props.detailInfoList.student_count} 人时即将开课</span> + <span className={"mt10block"}>当前预约报名人数:<span className={"color-red mr5"}>{getappointmenttype===true?this.props.detailInfoList&&this.props.detailInfoList.participant_count+1:this.props.detailInfoList&&this.props.detailInfoList.participant_count}</span>人</span> + <span className={"font153 mt10block"}>当预约报名人数达到 {this.props.detailInfoList&&this.props.detailInfoList.student_count} 人时即将开课</span> {this.props.detailInfoList&&this.props.detailInfoList.has_participate===false? getappointmenttype===true?<span className={coursestypes===true?"fr user_default_btn background191 font-18 pathbtensbox absolutewidth mt5":"fr user_default_btn background191 font-18 pathbtensbox absolutewidth"}>预约报名成功</span>:<a className={coursestypes===true?"fr user_default_btn task-btn-28BE6C font-18 pathbtensbox absolutewidth mt5":"fr user_default_btn task-btn-28BE6C font-18 pathbtensbox absolutewidth"} onClick={()=>this.putappointment()}>期待开课并预约报名</a>: <span className={coursestypes===true?"fr user_default_btn background191 font-18 pathbtensbox absolutewidth mt5":"fr user_default_btn background191 font-18 pathbtensbox absolutewidth"}>预约报名成功</span>} diff --git a/public/react/src/modules/paths/PathDetail/PathDetailIndex.js b/public/react/src/modules/paths/PathDetail/PathDetailIndex.js index f4ddc75ef..b0f64abde 100644 --- a/public/react/src/modules/paths/PathDetail/PathDetailIndex.js +++ b/public/react/src/modules/paths/PathDetail/PathDetailIndex.js @@ -621,7 +621,10 @@ class PathDetailIndex extends Component{ {/*}*/} </p> <div className="clearfix"> - <p className="color-grey-9 font-12 fl"><span className="mr10">{item.school}</span><span>{item.identity}</span></p> + <p className="color-grey-9 font-12 fl"> + <span className="mr10">{item.school}</span> + {/*<span>{item.identity}</span>*/} + </p> </div> </div> </div> @@ -645,7 +648,9 @@ class PathDetailIndex extends Component{ } </p> <div className="clearfix"> - <p className="color-grey-9 font-12 fl"><span className="mr10">{item.school}</span><span>{item.identity}</span></p> + <p className="color-grey-9 font-12 fl"><span className="mr10">{item.school}</span> + {/*<span>{item.identity}</span>*/} + </p> </div> { detailInfoList===undefined?"":detailInfoList.allow_add_member===true? <div> @@ -674,7 +679,9 @@ class PathDetailIndex extends Component{ {/*}*/} </p> <div className="clearfix"> - <p className="color-grey-9 font-12 fl"><span className="mr10">{item.school}</span><span>{item.identity}</span></p> + <p className="color-grey-9 font-12 fl"><span className="mr10">{item.school}</span> + {/*<span>{item.identity}</span>*/} + </p> </div> </div> </div> diff --git a/public/react/src/modules/user/usersInfo/InfosBanner.js b/public/react/src/modules/user/usersInfo/InfosBanner.js index 23037f360..a3b834493 100644 --- a/public/react/src/modules/user/usersInfo/InfosBanner.js +++ b/public/react/src/modules/user/usersInfo/InfosBanner.js @@ -39,21 +39,21 @@ class InfosBanner extends Component{ <div className="bannerPanel mb60"> <div className="educontent"> <div className="clearfix color-white mb25"> - <p className="myPhoto mr20 fl"><img alt="头像" src={data && `${getImageUrl('images/'+data.avatar_url)}`}/></p> + <p className="myPhoto mr20 fl"><img alt="头像" src={data && `${getImageUrl('images/'+data.avatar_url)}?t=${new Date().getTime()}`}/></p> <div className="fl"> <p className="clearfix mt20"> <span className="username task-hide" style={{"maxWidth":'370px'}}>{data && data.name}</span> - { - data && is_current == false && data.identity =="学生" ? "" : - <span className="userpost"><label>{data && data.identity}</label></span> - } + {/*{*/} + {/*data && is_current == false && data.identity =="学生" ? "" : */} + {/*<span className="userpost"><label>{data && data.identity}</label></span>*/} + {/*}*/} </p> <p className="mt15"> <Tooltip placement='bottom' title={ data && data.professional_certification ?"已职业认证":"未职业认证"}> - <i className={ data && data.professional_certification ? "iconfont icon-shenfenzhenghaomaguizheng font-18 user-colorgrey-green mr20 ml2":"iconfont icon-shenfenzhenghaomaguizheng font-18 user-colorgrey-B8 mr20 ml2"}></i> + <i className={ data && data.professional_certification ? "iconfont icon-shenfenzhenghaomaguizheng font-18 user-colorgrey-blue mr20 ml2":"iconfont icon-shenfenzhenghaomaguizheng font-18 user-colorgrey-B8 mr20 ml2"}></i> </Tooltip> <Tooltip placement='bottom' title={ data && data.authentication ?"已实名认证":"未实名认证"}> - <i className={ data && data.authentication ? "iconfont icon-renzhengshangjia font-18 user-colorgrey-green":"iconfont icon-renzhengshangjia font-18 user-colorgrey-B8"}></i> + <i className={ data && data.authentication ? "iconfont icon-renzhengshangjia font-18 user-colorgrey-blue":"iconfont icon-renzhengshangjia font-18 user-colorgrey-B8"}></i> </Tooltip> </p> </div> diff --git a/public/react/src/modules/user/usersInfo/usersInfo.css b/public/react/src/modules/user/usersInfo/usersInfo.css index 69b4bcd00..6d8857acc 100644 --- a/public/react/src/modules/user/usersInfo/usersInfo.css +++ b/public/react/src/modules/user/usersInfo/usersInfo.css @@ -168,6 +168,7 @@ } .user-colorgrey-B8{color:#B8B8B8} .user-colorgrey-green{color:#7ED321} +.user-colorgrey-blue{color:#98EBFF} .user_yellow_btn { color: #fff!important; background-color: #FF8E02; From 2161d292c1af7a16a88633bb476a3f86c325d403 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Tue, 24 Sep 2019 10:09:19 +0800 Subject: [PATCH 06/23] b --- public/react/src/AppConfig.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/public/react/src/AppConfig.js b/public/react/src/AppConfig.js index 025db7f5c..4de5d9d88 100644 --- a/public/react/src/AppConfig.js +++ b/public/react/src/AppConfig.js @@ -83,9 +83,9 @@ export function initAxiosInterceptors(props) { } config.url = `${proxy}${url}`; if (config.url.indexOf('?') == -1) { - config.url = `${config.url}?debug=${debugType}` + config.url = `${config.url}?debug=${'student'}` } else { - config.url = `${config.url}&debug=${debugType}` + config.url = `${config.url}&debug=${'student'}` } } else { // 加api前缀 From 6e5afff47f14fc9198906a00b7972397329f05c4 Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Tue, 24 Sep 2019 15:12:28 +0800 Subject: [PATCH 07/23] =?UTF-8?q?=E6=89=80=E6=9C=89=E4=BA=8C=E7=BA=A7?= =?UTF-8?q?=E5=9B=9E=E5=A4=8D=20https://www.trustie.net/issues/24302?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/react/src/modules/comment/CommentItemMDEditor.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/react/src/modules/comment/CommentItemMDEditor.js b/public/react/src/modules/comment/CommentItemMDEditor.js index 98afa4228..8c49d356f 100644 --- a/public/react/src/modules/comment/CommentItemMDEditor.js +++ b/public/react/src/modules/comment/CommentItemMDEditor.js @@ -110,7 +110,7 @@ class CommentItemMDEditor extends Component { <img alt="0?1442652658" height="33" src={`/images/${user.image_url}`} width="33"></img> </a> </div> - <div id={`reply_message_${item.id}`} className="reply_to_message commentItemMDEditor" + <div id={`reply_message_${item.id}`} className="reply_to_message commentItemMDEditor editormd-image-click-expand" style={{ paddingTop: '0px', paddingBottom: '0px', marginTop: '36px' }} > <div id={`reply_message_editorMd_${item.id}`} className="editorMD" style={{ marginBottom: '0px'}}> From f90e08c49fc8ab6eb505032978cca7e18f34c5ec Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Tue, 24 Sep 2019 15:32:16 +0800 Subject: [PATCH 08/23] =?UTF-8?q?=E4=BD=9C=E4=B8=9A=E8=AF=84=E9=98=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../graduation/tasks/GraduationTasksappraiseMainEditor.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/react/src/modules/courses/graduation/tasks/GraduationTasksappraiseMainEditor.js b/public/react/src/modules/courses/graduation/tasks/GraduationTasksappraiseMainEditor.js index 9222d3af2..5494ba05f 100644 --- a/public/react/src/modules/courses/graduation/tasks/GraduationTasksappraiseMainEditor.js +++ b/public/react/src/modules/courses/graduation/tasks/GraduationTasksappraiseMainEditor.js @@ -209,7 +209,7 @@ class GraduationTasksappraiseMainEditor extends Component{ `}</style> {this.props.title && <span className="mainEditorTitle color-grey-6">{this.props.title}</span>} <TPMMDEditor ref={this.mdRef} mdID={'appraiseEditor'} placeholder={placeholder || "请在此输入对本作品的评语,最大限制2000个字符"} - watch={false} height={160} className={errorMessage ? 'editorInputError' : ''}></TPMMDEditor> + watch={false} height={160} className={errorMessage ? 'editorInputError' : ''} imageExpand={true}></TPMMDEditor> { showSameScore == true && <div> <Checkbox checked={same_score} onChange={this.same_score_change}>整组同评</Checkbox> <span className={"font-14 color-grey-9"}>(选中,则本次评阅对象指小组全部成员,否则仅评阅此成员1人 )</span> From 2bb947e5da6ea8ac436a8f99ad40c82044cd6e7f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Wed, 25 Sep 2019 16:45:05 +0800 Subject: [PATCH 09/23] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/react/src/AppConfig.js | 4 ++-- .../tasks/GraduationTaskssettinglist.js | 18 +++++++++--------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/public/react/src/AppConfig.js b/public/react/src/AppConfig.js index 4de5d9d88..025db7f5c 100644 --- a/public/react/src/AppConfig.js +++ b/public/react/src/AppConfig.js @@ -83,9 +83,9 @@ export function initAxiosInterceptors(props) { } config.url = `${proxy}${url}`; if (config.url.indexOf('?') == -1) { - config.url = `${config.url}?debug=${'student'}` + config.url = `${config.url}?debug=${debugType}` } else { - config.url = `${config.url}&debug=${'student'}` + config.url = `${config.url}&debug=${debugType}` } } else { // 加api前缀 diff --git a/public/react/src/modules/courses/graduation/tasks/GraduationTaskssettinglist.js b/public/react/src/modules/courses/graduation/tasks/GraduationTaskssettinglist.js index 0720d7240..c18dcfc53 100644 --- a/public/react/src/modules/courses/graduation/tasks/GraduationTaskssettinglist.js +++ b/public/react/src/modules/courses/graduation/tasks/GraduationTaskssettinglist.js @@ -847,28 +847,28 @@ class GraduationTaskssettinglist extends Component{ </Tooltip> </span> ), - }, { + }, { title: '操作', key: 'operation', width:'100px', dataIndex: 'operation', className:'edu-txt-center', render: operation => ( - <div> + <div style={{cursor: 'pointer'}}> {this.props.isAdmin()?operation.map((tag,key) => { return( <React.Fragment> { tag.name && - <Tooltip key={key} placement="bottom" title={tag.name==="分配"?"指定该作品的交叉评阅人":tag.name==="调分"?<pre>调整学生最终成绩<br/>其它历史评分将全部失效</pre>:""}> - {tag.name==="评阅"?<a style={{color:'#4CACFF',padding:"0px 5px"}} href={"/courses/"+courseId+"/graduation_tasks/"+tag.id+"/appraise"} > + <Tooltip key={key} placement="bottom" title={tag.name==="分配"?taskslistdata&&taskslistdata.cross_comment===true?"":"指定该作品的交叉评阅人":tag.name==="调分"?<pre>调整学生最终成绩<br/>其它历史评分将全部失效</pre>:""}> + {tag.name==="评阅"?<p style={{color:'#4CACFF',padding:"0px 5px"}} href={"/courses/"+courseId+"/graduation_tasks/"+tag.id+"/appraise"} > {tag.name} - </a> + </p> : - <a style={{color:tag.name==="调分"?"#000":'#4CACFF',padding:"0px 5px"}} - onClick={tag.name==="调分"?()=>this.showModulationtype(tag.id):tag.name==="分配"?()=>this.showAllocationModal(tag.id):""}> - {tag.name} - </a> + <p style={{color:tag.name==="调分"?"#000":'#4CACFF',padding:"0px 5px"}} + onClick={tag.name==="调分"?()=>this.showModulationtype(tag.id):tag.name==="分配"?taskslistdata&&taskslistdata.cross_comment===true?"":()=>this.showAllocationModal(tag.id):""}> + {tag.name==="分配"?taskslistdata&&taskslistdata.cross_comment===true?"":tag.name:tag.name} + </p> } </Tooltip> } From 2881ac625418926627a5990de903535d763de021 Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Thu, 26 Sep 2019 10:42:16 +0800 Subject: [PATCH 10/23] this.props.updataleftNavfun() --- public/react/src/App.css | 4 ++++ .../src/modules/courses/members/modal/AddStudentModal.js | 3 ++- public/react/src/modules/courses/members/studentsList.js | 4 +++- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/public/react/src/App.css b/public/react/src/App.css index 1c8ce15e1..07d3d718d 100644 --- a/public/react/src/App.css +++ b/public/react/src/App.css @@ -92,6 +92,10 @@ html, body { .formItemInline .ant-form-item-control-wrapper { flex: 1; } +/* AutoComplete placeholder 不显示的问题 */ +.ant-select-auto-complete.ant-select .ant-select-selection__placeholder { + z-index: 2; +} /* 兼容性 */ diff --git a/public/react/src/modules/courses/members/modal/AddStudentModal.js b/public/react/src/modules/courses/members/modal/AddStudentModal.js index ddd1164ea..efa801182 100644 --- a/public/react/src/modules/courses/members/modal/AddStudentModal.js +++ b/public/react/src/modules/courses/members/modal/AddStudentModal.js @@ -68,7 +68,7 @@ class AddStudentModal extends Component{ if (response.data.course_groups && response.data.course_groups.length) { this.setState({ course_groups: response.data.course_groups, - courseGroup: response.data.course_groups[0].id + courseGroup: '0' // response.data.course_groups[0].id }) } else { // showNotification('') @@ -268,6 +268,7 @@ class AddStudentModal extends Component{ {course_groups && course_groups.length && <div className="df" style={{ marginTop: '12px' }} > <span className="mr10" style={{ width: '148px' }}>所选学生分班至(选填):</span> <Select style={{ width: 236 }} onChange={this.handleCourseGroupChange} value={courseGroup}> + <Option value={'0'}>{'未分班'}</Option> { course_groups.map((item) => { return <Option value={item.id}>{item.name}</Option> })} diff --git a/public/react/src/modules/courses/members/studentsList.js b/public/react/src/modules/courses/members/studentsList.js index 76e0a7b7c..5496dda01 100644 --- a/public/react/src/modules/courses/members/studentsList.js +++ b/public/react/src/modules/courses/members/studentsList.js @@ -270,12 +270,13 @@ class studentsList extends Component{ addStudentSuccessListener=(e, data)=>{ const params = JSON.parse(data) + this.props.updataleftNavfun() const course_group_id = this.props.match.params.course_group_id const coursesId = this.props.match.params.coursesId if (params.course_group_id == course_group_id) { this.fetchAll(1) } else { - this.props.history.push(`/courses/${coursesId}/course_groups/${params.course_group_id}`) + this.props.history.push(`/courses/${coursesId}/course_groups/${params.course_group_id || '0'}`) } // console.log('addStudentSuccessListener', data) } @@ -465,6 +466,7 @@ class studentsList extends Component{ }).then((result)=>{ if (result.data.status == 0) { this.props.showNotification('删除成功') + this.props.updataleftNavfun() this.fetchAll() this.setState({checkBoxValues: []}) trigger('updatabanner') From de0fe99b3173c7f7bf5a4ab71e2e2bcf3ea282b5 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, 26 Sep 2019 14:34:46 +0800 Subject: [PATCH 11/23] =?UTF-8?q?=E8=B0=83=E6=95=B4=E6=AF=95=E8=AE=BE?= =?UTF-8?q?=E5=BC=B9=E7=AA=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/react/config/webpack.config.dev.js | 2 +- public/react/src/AppConfig.js | 4 +-- .../src/modules/courses/graduation/style.css | 4 +-- .../graduation/tasks/GraduationAcross.js | 28 +++++++++++++------ .../tasks/GraduationTaskssetting.js | 23 +++++++-------- 5 files changed, 35 insertions(+), 26 deletions(-) diff --git a/public/react/config/webpack.config.dev.js b/public/react/config/webpack.config.dev.js index aabcd8fb7..7990f9557 100644 --- a/public/react/config/webpack.config.dev.js +++ b/public/react/config/webpack.config.dev.js @@ -32,7 +32,7 @@ module.exports = { // See the discussion in https://github.com/facebookincubator/create-react-app/issues/343.s // devtool: "cheap-module-eval-source-map", // 开启调试 - // devtool: "eval-source-map", // 开启调试 + // devtool: "eval-source-map", // 开启调试 // These are the "entry points" to our application. // This means they will be the "root" imports that are included in JS bundle. // The first two entry points enable "hot" CSS and auto-refreshes for JS. diff --git a/public/react/src/AppConfig.js b/public/react/src/AppConfig.js index 4de5d9d88..025db7f5c 100644 --- a/public/react/src/AppConfig.js +++ b/public/react/src/AppConfig.js @@ -83,9 +83,9 @@ export function initAxiosInterceptors(props) { } config.url = `${proxy}${url}`; if (config.url.indexOf('?') == -1) { - config.url = `${config.url}?debug=${'student'}` + config.url = `${config.url}?debug=${debugType}` } else { - config.url = `${config.url}&debug=${'student'}` + config.url = `${config.url}&debug=${debugType}` } } else { // 加api前缀 diff --git a/public/react/src/modules/courses/graduation/style.css b/public/react/src/modules/courses/graduation/style.css index 5d78f3cb9..e2f497046 100644 --- a/public/react/src/modules/courses/graduation/style.css +++ b/public/react/src/modules/courses/graduation/style.css @@ -47,8 +47,8 @@ width:40px; height:24px; line-height: 20px; - border:1px solid rgba(76,172,255,1); - color: #4CACFF!important; + /*border:1px solid rgba(76,172,255,1);*/ + /*color: #4CACFF!important;*/ float: left; border-radius:4px; text-align: center diff --git a/public/react/src/modules/courses/graduation/tasks/GraduationAcross.js b/public/react/src/modules/courses/graduation/tasks/GraduationAcross.js index 809ad72ff..d4ed5b917 100644 --- a/public/react/src/modules/courses/graduation/tasks/GraduationAcross.js +++ b/public/react/src/modules/courses/graduation/tasks/GraduationAcross.js @@ -226,7 +226,7 @@ class GraduationAcross extends Component{ // 确定分配 sureAcross=()=>{ - let { AcrossTeamIds , chooseId , group_ids , comment_status }=this.state; + let { AcrossTeamIds , chooseId , group_ids , comment_status,page }=this.state; let { task_Id }=this.props; let type = comment_status == 2 ? "user_ids" : "graduation_group_ids"; @@ -246,7 +246,7 @@ class GraduationAcross extends Component{ }).then((result)=>{ if(result){ this.props.showNotification(result.data.message); - this.getList(1,group_ids,comment_status); + this.getList(page,group_ids,comment_status); this.setState({ showflag:false, AcrossTeamIds:undefined, @@ -344,6 +344,18 @@ class GraduationAcross extends Component{ width="775px" destroyOnClose={true} > + {modalVisible===true?<style> + { + ` + bady{ + overflow: hidden !important; + } + ` + } + </style>:""} + <div id="closeIcon" onClick={()=>this.props.modalCloss()}> + <i className="iconfont icon-shanchudiao"></i> + </div> <style> {` .AcrossModal .ant-modal-body{ @@ -412,7 +424,7 @@ class GraduationAcross extends Component{ <div className="clearfix mb15 mt15 pl30 pr30" id="acrossContent"> <span className="fl color-grey-c mt5">已选 { chooseCount == 0 ? 0 : <span className="color-blue">{chooseCount}</span>} 个</span> <span className="fr"> - <span className={"fl mt5"}>分配给{ comment_status && comment_status == 2 ? "老师":"答辩组"}:</span> + <span className={"fl mt5"}><span className={"color-orange"}>分配</span>给{ comment_status && comment_status == 2 ? "老师":"答辩组"}:</span> <span className={"fl"} style={{height:"32px"}} id="selectTags"> <Select mode="tags" @@ -437,7 +449,7 @@ class GraduationAcross extends Component{ {menu} <Divider style={{ margin: '4px 0 0' }} /> <div style={{ padding: '8px 12px', cursor: 'pointer' }}> - <a onClick={this.sureAcross} className="acrossSureBtn">确定</a> + <a onClick={this.sureAcross} className="acrossSureBtn color-orange">提交</a> <a onClick={this.clearSelect} className="ml20"><span className="acrossResetBtn color-blue">重置</span></a> </div> </div> @@ -463,10 +475,10 @@ class GraduationAcross extends Component{ <Pagination defaultCurrent={page} current={page} pageSize={limit} total={user_count} onChange={this.onPageChange}></Pagination>:"" } </div> - <div className="fr"> - <a className="task-btn color-white mr30" onClick={this.props.modalCloss}>关闭</a> - <a className="task-btn task-btn-orange" onClick={this.props.modalCloss}>确认</a> - </div> + {/*<div className="fr">*/} + {/*<a className="task-btn color-white mr30" onClick={this.props.modalCloss}>关闭</a>*/} + {/*<a className="task-btn task-btn-orange" onClick={this.props.modalCloss}>确认</a>*/} + {/*</div>*/} </div> </Modal> ) diff --git a/public/react/src/modules/courses/graduation/tasks/GraduationTaskssetting.js b/public/react/src/modules/courses/graduation/tasks/GraduationTaskssetting.js index 3d7327956..ff7564b8f 100644 --- a/public/react/src/modules/courses/graduation/tasks/GraduationTaskssetting.js +++ b/public/react/src/modules/courses/graduation/tasks/GraduationTaskssetting.js @@ -343,6 +343,7 @@ class GraduationTaskssettingapp extends Component{ } updatesfuncrosscomment=(types,newlatetime,newcommenttime)=>{ + debugger let {endtimetype}=this.state; if(types===1){ this.setState({ @@ -372,7 +373,7 @@ class GraduationTaskssettingapp extends Component{ funcrosscomment=(e)=>{ let {latetime,end_time,allowlate,commenttime,commenttimeone}=this.state; let commenttimetype=commenttime===null||commenttime===""; - +debugger let newlatetimea=moment(new Date()).add(7, 'days').format("YYYY-MM-DD HH:mm"); let newcommenttimea=moment(new Date()).format("YYYY-MM-DD HH:mm"); @@ -386,7 +387,7 @@ class GraduationTaskssettingapp extends Component{ let newcommenttimed=moment(end_time).add(8, 'days').format("YYYY-MM-DD HH:mm"); if(e.target.checked===true){ - if(commenttimetype===true){ + debugger if(allowlate===1||allowlate===true){ if(latetime===null||latetime===""){ @@ -401,12 +402,6 @@ class GraduationTaskssettingapp extends Component{ this.updatesfuncrosscomment(2,newend_timed,newcommenttimed) } } - }else{ - this.setState({ - crosscomment:e.target.checked, - commenttime:commenttimeone, - }) - } }else{ this.setState({ @@ -545,25 +540,29 @@ class GraduationTaskssettingapp extends Component{ endTimetypes:false }) } - + debugger if(moment(latetime)<=moment(publish_time)){ + + debugger this.setState({ latetimetype:true, latetimetypeval:"结束时间必须晚于发布时间" }) return }else if(moment(latetime)<=moment(end_time)){ + debugger this.setState({ latetimetype:true, latetimetypeval:"结束时间必须晚于截止时间" }) return }else{ + debugger this.setState({ latetimetype:false }) } - + debugger if(crosscomment===true){ if(this.state.commenttime===undefined||this.state.commenttime===null||this.state.commenttime===""){ @@ -950,9 +949,7 @@ class GraduationTaskssettingapp extends Component{ // // console.log(moment(publish_time)) - // console.log(this.props.isSuperAdmin()) - - + console.log(commenttime) return( <React.Fragment> From bb49f978c923e5d310a023e4eb821eac4badaab3 Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Thu, 26 Sep 2019 15:40:47 +0800 Subject: [PATCH 12/23] loading --- .../modules/courses/common/ModalWrapper.js | 6 +++-- .../user/account/ChangeHeaderPicModal.js | 22 ++++++++++++++++--- 2 files changed, 23 insertions(+), 5 deletions(-) diff --git a/public/react/src/modules/courses/common/ModalWrapper.js b/public/react/src/modules/courses/common/ModalWrapper.js index e92a508d6..8b7e87692 100644 --- a/public/react/src/modules/courses/common/ModalWrapper.js +++ b/public/react/src/modules/courses/common/ModalWrapper.js @@ -1,5 +1,5 @@ import React,{ Component } from "react"; -import { Modal,Input, Checkbox} from "antd"; +import { Modal,Input, Checkbox, Spin} from "antd"; import '../css/members.css' class ModalWrapper extends Component{ @@ -23,7 +23,7 @@ class ModalWrapper extends Component{ } render(){ let {flag, visible}=this.state - let { onOk, cancelText, okText, title, width, className, bottomRender}=this.props; + let { onOk, cancelText, okText, title, width, className, bottomRender, loading}=this.props; return( <Modal @@ -48,6 +48,7 @@ class ModalWrapper extends Component{ } </style>:"" } + <Spin spinning={!!this.props.loading}> <div className="newupload_conbox clearfix"> {this.props.children} {this.props.checkBoxValuestype===true?<div className={"mt10 color-red"}> @@ -59,6 +60,7 @@ class ModalWrapper extends Component{ </div> { bottomRender } </div> + </Spin> </Modal> ) } diff --git a/public/react/src/modules/user/account/ChangeHeaderPicModal.js b/public/react/src/modules/user/account/ChangeHeaderPicModal.js index 197e84a5c..0a2205261 100644 --- a/public/react/src/modules/user/account/ChangeHeaderPicModal.js +++ b/public/react/src/modules/user/account/ChangeHeaderPicModal.js @@ -1,5 +1,5 @@ import React, { Component } from "react"; -import { Modal } from "antd"; +import { Spin } from "antd"; import axios from 'axios' import ModalWrapper from "../../courses/common/ModalWrapper" import { Cropper, getUrl } from 'educoder' @@ -13,7 +13,7 @@ class ChangeHeaderPicModal extends Component{ constructor(props){ super(props); this.state={ - + uploading: false } } init = () => { @@ -85,12 +85,23 @@ class ChangeHeaderPicModal extends Component{ } - onOk = () => { + if (this.state.uploading == true) return; if (this.fileUploaded != true) { this.props.showNotification("请先上传图片") return; } + console.log(new Date().getTime()) + this.setState({ uploading: true }, () => { + window.setTimeout(() => { + console.log(new Date().getTime()) + this._onOk() + }, 10) + + }) + } + _onOk = () => { + var img_lg = document.getElementById(previewId); // https://github.com/niklasvh/html2canvas/issues/1908 // 截图小的显示框内的内容 @@ -115,9 +126,12 @@ class ChangeHeaderPicModal extends Component{ } else { this.doAfterUpdated(); } + this.setState({ uploading: false }) } }) .catch(function (error) { + this.setState({ uploading: false }) + console.log(error); }); }); @@ -142,6 +156,8 @@ class ChangeHeaderPicModal extends Component{ okText="保存" width={552} className="changeHeaderModal" + loading={this.state.uploading} + onCancel={() => this.setState({ uploading: false })} > <style>{` #changeHeader_imagePreview { From be1d2f76d476ba14f0244773e1f3a626b9350628 Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Thu, 26 Sep 2019 15:46:42 +0800 Subject: [PATCH 13/23] cleare --- public/react/src/modules/courses/boards/index.js | 1 + 1 file changed, 1 insertion(+) diff --git a/public/react/src/modules/courses/boards/index.js b/public/react/src/modules/courses/boards/index.js index 6d1c402ce..b1ada5bb5 100644 --- a/public/react/src/modules/courses/boards/index.js +++ b/public/react/src/modules/courses/boards/index.js @@ -116,6 +116,7 @@ class Boards extends Component{ this.setState({ isSpin:true }) + this.clearAllCheck() this.fetchAll(null, 1) } } From 83c8080430d930a6cb1bf5bfbf624728a6bc0bd2 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, 26 Sep 2019 16:47:03 +0800 Subject: [PATCH 14/23] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../graduation/tasks/GraduationAcross.js | 67 +++++++++++++++++-- 1 file changed, 60 insertions(+), 7 deletions(-) diff --git a/public/react/src/modules/courses/graduation/tasks/GraduationAcross.js b/public/react/src/modules/courses/graduation/tasks/GraduationAcross.js index d4ed5b917..cb322e1e7 100644 --- a/public/react/src/modules/courses/graduation/tasks/GraduationAcross.js +++ b/public/react/src/modules/courses/graduation/tasks/GraduationAcross.js @@ -1,6 +1,6 @@ import React, { Component } from 'react'; -import { Modal , Radio , Table , Pagination , Select ,Divider ,Icon , Input } from "antd"; +import { Modal , Radio , Table , Pagination , Select ,Divider ,Icon , Input,Checkbox } from "antd"; import {Link} from 'react-router-dom' import axios from 'axios'; @@ -87,6 +87,16 @@ const bindTableColumn=(that)=>{ } }) } + + if(course_groups&&course_groups.length===0){ + columns.some((item,key)=> { + if (item.title === "分班") { + columns.splice(key, 1) + return true + } + } + ) + } return columns; } class GraduationAcross extends Component{ @@ -211,6 +221,7 @@ class GraduationAcross extends Component{ // 下拉切换 changeSelect = (AcrossTeamIds) =>{ + console.log(AcrossTeamIds) this.setState({ AcrossTeamIds }) @@ -274,6 +285,7 @@ class GraduationAcross extends Component{ // 下拉搜索 changeSearchValue=(e)=>{ + this.setState({ searchValue:e.target.value }) @@ -285,7 +297,32 @@ class GraduationAcross extends Component{ }) } - + checkonChange=(e,list)=>{ + let newlist=[] + // AcrossTeamIds + let {comment_status}=this.state; + if(e.target.checked===true){ + if(comment_status===2){ + list.map((item,key)=>{ + newlist.push(String(item.user_id)) + }) + this.setState({ + AcrossTeamIds:newlist + }) + }else{ + list.map((item,key)=>{ + newlist.push(String(item.id)) + }) + this.setState({ + AcrossTeamIds:newlist + }) + } + }else{ + this.setState({ + AcrossTeamIds:undefined + }) + } + } render(){ let { comment_status, @@ -331,9 +368,10 @@ class GraduationAcross extends Component{ }), }; + // 筛选下拉列表 - const teacherList = searchValue ? teachers.filter(e=>e.user_name.indexOf(searchValue)>-1) : teachers; - const course_groupsList = searchValue ? course_groups.filter(e=>e.name.indexOf(searchValue)>-1) : course_groups; + const teacherList = searchValue ? teachers&&teachers.filter(e=>e.user_name.indexOf(searchValue)>-1) : teachers; + const course_groupsList = searchValue ? course_groups&&course_groups.filter(e=>e.name.indexOf(searchValue)>-1) : course_groups; return( <Modal className={"AcrossModal"} @@ -347,7 +385,7 @@ class GraduationAcross extends Component{ {modalVisible===true?<style> { ` - bady{ + body{ overflow: hidden !important; } ` @@ -407,6 +445,9 @@ class GraduationAcross extends Component{ white-space: nowrap; text-overflow: ellipsis; } + .pd8px{ + padding: 8px; + } `} </style> <div className="pt20 pl30 pr30 acrossHead"> @@ -436,7 +477,7 @@ class GraduationAcross extends Component{ onFocus={()=>this.changeFlag(true)} dropdownRender={menu => ( <div id="selectDropdown"> - <div className="padding10-20"> + {comment_status == 2 &&teachers&&teachers.length>10?<div className="padding10-20"> <Input type='input' value={searchValue} @@ -445,7 +486,19 @@ class GraduationAcross extends Component{ style={{height:"30px"}} className="searchInput" ></Input> - </div> + </div>:""} + {comment_status != 2 &&course_groups&&course_groups.length>10?<div className="padding10-20"> + <Input + type='input' + value={searchValue} + onChange={this.changeSearchValue} + placeholder='请输入名称搜索' + style={{height:"30px"}} + className="searchInput" + ></Input> + </div>:""} + {comment_status == 2 &&teacherList&&teacherList.length>2? <Checkbox className={"pd8px"} onChange={(e)=>this.checkonChange(e,teacherList)}>全选</Checkbox>:""} + {comment_status != 2 &&course_groupsList&&course_groupsList.length>2? <Checkbox className={"pd8px"} onChange={(e)=>this.checkonChange(e,course_groupsList)}>全选</Checkbox>:""} {menu} <Divider style={{ margin: '4px 0 0' }} /> <div style={{ padding: '8px 12px', cursor: 'pointer' }}> From 994ad50fd5df42c83f188b443a0353dab93a3df9 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, 27 Sep 2019 10:06:36 +0800 Subject: [PATCH 15/23] =?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/GraduationTaskssettinglist.js | 3 +-- 1 file changed, 1 insertion(+), 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 c18dcfc53..30dd831bd 100644 --- a/public/react/src/modules/courses/graduation/tasks/GraduationTaskssettinglist.js +++ b/public/react/src/modules/courses/graduation/tasks/GraduationTaskssettinglist.js @@ -971,9 +971,8 @@ class GraduationTaskssettinglist extends Component{ white-space: nowrap; } .ant-table-tbody>tr>td, .ant-table-thead>tr>th{ - padding: 16px 10px + padding:16px 8px; } - ` } </style> From f1dd73de1c88ebaf3dc8340dfb8fc9ff2444384d 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, 27 Sep 2019 10:26:30 +0800 Subject: [PATCH 16/23] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/modules/courses/graduation/style.css | 16 ++++++++-------- .../courses/graduation/tasks/GraduationAcross.js | 3 +++ .../shixunchild/Repository/RepositoryAddFile.js | 4 ++-- 3 files changed, 13 insertions(+), 10 deletions(-) diff --git a/public/react/src/modules/courses/graduation/style.css b/public/react/src/modules/courses/graduation/style.css index e2f497046..cf438a6a4 100644 --- a/public/react/src/modules/courses/graduation/style.css +++ b/public/react/src/modules/courses/graduation/style.css @@ -44,13 +44,13 @@ .TopicDetailTable .bottomBody li:last-child{border-bottom: none;} .acrossSureBtn{ - width:40px; - height:24px; - line-height: 20px; - /*border:1px solid rgba(76,172,255,1);*/ - /*color: #4CACFF!important;*/ - float: left; - border-radius:4px; - text-align: center + width: 40px; + height: 24px; + line-height: 18px; + /* border: 1px solid rgba(76,172,255,1); */ + /* color: #4CACFF!important; */ + float: left; + /* border-radius: 4px; */ + text-align: center; } diff --git a/public/react/src/modules/courses/graduation/tasks/GraduationAcross.js b/public/react/src/modules/courses/graduation/tasks/GraduationAcross.js index cb322e1e7..98cb883d8 100644 --- a/public/react/src/modules/courses/graduation/tasks/GraduationAcross.js +++ b/public/react/src/modules/courses/graduation/tasks/GraduationAcross.js @@ -388,6 +388,9 @@ class GraduationAcross extends Component{ body{ overflow: hidden !important; } + .closeIcon{ + font-size: 22px !important; + } ` } </style>:""} diff --git a/public/react/src/modules/tpm/shixunchild/Repository/RepositoryAddFile.js b/public/react/src/modules/tpm/shixunchild/Repository/RepositoryAddFile.js index 7fe6e2bcd..9ca535bb4 100644 --- a/public/react/src/modules/tpm/shixunchild/Repository/RepositoryAddFile.js +++ b/public/react/src/modules/tpm/shixunchild/Repository/RepositoryAddFile.js @@ -92,7 +92,7 @@ class RepositoryAddFile extends Component { if(!value){ callback('文件名不能为空'); }else if (value == "/" || value.indexOf('.') == -1 ) { - callback('请输入正确的文件路径,如:src/HelloWord.java'); + callback('请输入正确的文件路径,如:src/HelloWorld.java'); }else{ callback(); } @@ -162,7 +162,7 @@ class RepositoryAddFile extends Component { validator:this.checkPath }] })( - <Input placeholder="输入文件路径名,如:src/HelloWord.java" className="winput-300-35 fl"/> + <Input placeholder="输入文件路径名,如:src/HelloWorld.java" className="winput-300-35 fl"/> )} </Form.Item> </div> From 0de464db476a850d5d159cea7d53df8035f6ce4d Mon Sep 17 00:00:00 2001 From: p31729568 <winse.wang@foxmail.com> Date: Fri, 27 Sep 2019 11:06:56 +0800 Subject: [PATCH 17/23] fix user center page limit --- app/controllers/users/courses_controller.rb | 2 +- app/controllers/users/projects_controller.rb | 2 +- app/controllers/users/shixuns_controller.rb | 2 +- app/controllers/users/subjects_controller.rb | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/controllers/users/courses_controller.rb b/app/controllers/users/courses_controller.rb index c7e957e1a..2c5e29d2b 100644 --- a/app/controllers/users/courses_controller.rb +++ b/app/controllers/users/courses_controller.rb @@ -3,7 +3,7 @@ class Users::CoursesController < Users::BaseController courses = Users::CourseService.new(observed_user, query_params).call @count = courses.count - @courses = paginate(courses.includes(teacher: { user_extension: :school }), special: true) + @courses = paginate(courses.includes(teacher: { user_extension: :school }), special: observed_user.is_teacher?) end private diff --git a/app/controllers/users/projects_controller.rb b/app/controllers/users/projects_controller.rb index 07f4d5cac..8ffa8fa85 100644 --- a/app/controllers/users/projects_controller.rb +++ b/app/controllers/users/projects_controller.rb @@ -5,7 +5,7 @@ class Users::ProjectsController < Users::BaseController projects = Users::ProjectService.new(observed_user, query_params).call @count = projects.count - @projects = paginate(projects.includes(:project_score, owner: { user_extension: :school }), special: true) + @projects = paginate(projects.includes(:project_score, owner: { user_extension: :school }), special: observed_user.is_teacher?) end def search diff --git a/app/controllers/users/shixuns_controller.rb b/app/controllers/users/shixuns_controller.rb index 7b840a0a1..5d8da9684 100644 --- a/app/controllers/users/shixuns_controller.rb +++ b/app/controllers/users/shixuns_controller.rb @@ -3,7 +3,7 @@ class Users::ShixunsController < Users::BaseController shixuns = Users::ShixunService.new(observed_user, query_params).call @count = shixuns.count - @shixuns = paginate(shixuns.includes(:first_tag_repertoire), special: true) + @shixuns = paginate(shixuns.includes(:first_tag_repertoire), special: observed_user.is_teacher?) ids = @shixuns.map(&:id) @finished_challenges_count_map = Game.joins(:myshixun).where(user_id: observed_user.id, status: 2) diff --git a/app/controllers/users/subjects_controller.rb b/app/controllers/users/subjects_controller.rb index 2a4a7975f..2f8f308df 100644 --- a/app/controllers/users/subjects_controller.rb +++ b/app/controllers/users/subjects_controller.rb @@ -3,7 +3,7 @@ class Users::SubjectsController < Users::BaseController subjects = Users::SubjectService.new(observed_user, query_params).call @count = subjects.count - @subjects = paginate(subjects.includes(:user, :repertoire), special: true) + @subjects = paginate(subjects.includes(:user, :repertoire), special: observed_user.is_teacher?) end private From 28b258f1cdb7f62fb31dead3bb98a9a160fdba6f Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Fri, 27 Sep 2019 11:27:07 +0800 Subject: [PATCH 18/23] =?UTF-8?q?=E5=8E=BB=E6=97=B6=E9=97=B4=E5=8F=82?= =?UTF-8?q?=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/react/src/modules/tpm/TPMIndexHOC.js | 4 ++-- public/react/src/modules/user/AccountPage.js | 2 +- public/react/src/modules/user/usersInfo/InfosBanner.js | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/public/react/src/modules/tpm/TPMIndexHOC.js b/public/react/src/modules/tpm/TPMIndexHOC.js index 4d2e4fbba..d4142bd06 100644 --- a/public/react/src/modules/tpm/TPMIndexHOC.js +++ b/public/react/src/modules/tpm/TPMIndexHOC.js @@ -89,8 +89,8 @@ export function TPMIndexHOC(WrappedComponent) { // header里面需要有user initCommonState(user) { - // 更新头像后,需要改变参数,不然会被图片缓存影响到 - const newUser = Object.assign({}, {...user}, { image_url: `${user.image_url}?t=${new Date().getTime()}`}); + // 更新头像后,需要改变参数,不然会被图片缓存影响到 --> 后台已加 ?t=${new Date().getTime() + const newUser = Object.assign({}, {...user}, { image_url: `${user.image_url}`}); this.setState({ user: newUser, current_user: newUser diff --git a/public/react/src/modules/user/AccountPage.js b/public/react/src/modules/user/AccountPage.js index 3d34b3e13..7268bd7bb 100644 --- a/public/react/src/modules/user/AccountPage.js +++ b/public/react/src/modules/user/AccountPage.js @@ -60,7 +60,7 @@ class AccountPage extends Component { // "authentication": "uncertified", // "uncertified" | "applying" | "certified" this.setState({ basicInfo: Object.assign({}, {...result.data}, { - avatar_url: `${result.data.avatar_url}?t=${new Date().getTime()}`, + avatar_url: `${result.data.avatar_url}`, gender: result.data.gender == null || result.data.gender == undefined ? 0 : result.data.gender }) }) diff --git a/public/react/src/modules/user/usersInfo/InfosBanner.js b/public/react/src/modules/user/usersInfo/InfosBanner.js index a3b834493..40732d757 100644 --- a/public/react/src/modules/user/usersInfo/InfosBanner.js +++ b/public/react/src/modules/user/usersInfo/InfosBanner.js @@ -39,7 +39,7 @@ class InfosBanner extends Component{ <div className="bannerPanel mb60"> <div className="educontent"> <div className="clearfix color-white mb25"> - <p className="myPhoto mr20 fl"><img alt="头像" src={data && `${getImageUrl('images/'+data.avatar_url)}?t=${new Date().getTime()}`}/></p> + <p className="myPhoto mr20 fl"><img alt="头像" src={data && `${getImageUrl('images/'+data.avatar_url)}`}/></p> <div className="fl"> <p className="clearfix mt20"> <span className="username task-hide" style={{"maxWidth":'370px'}}>{data && data.name}</span> From d1a77755d86de418097a8a3a7ce27ec39d12db87 Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Fri, 27 Sep 2019 14:23:43 +0800 Subject: [PATCH 19/23] =?UTF-8?q?=E7=BD=91=E7=BB=9C=E6=81=A2=E5=A4=8D?= =?UTF-8?q?=E6=AD=A3=E5=B8=B8=EF=BC=8C=E6=84=9F=E8=B0=A2=E4=BD=BF=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/react/src/AppConfig.js | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/public/react/src/AppConfig.js b/public/react/src/AppConfig.js index 025db7f5c..a92b83b4b 100644 --- a/public/react/src/AppConfig.js +++ b/public/react/src/AppConfig.js @@ -33,6 +33,7 @@ if (isDev) { } window._debugType = debugType; export function initAxiosInterceptors(props) { + initOnlineOfflineListener() // TODO 避免重复的请求 https://github.com/axios/axios#cancellation // https://github.com/axios/axios/issues/1497 @@ -203,4 +204,27 @@ export function initAxiosInterceptors(props) { }); // ----------------------------------------------------------------------------------- +} + + +function initOnlineOfflineListener() { + $(window).bind("online", () => { + notification.destroy() + notification.success({ + duration: null, + message: '网络恢复正常', + description: + '网络恢复正常,感谢使用。', + }) + }); + $(window).bind("offline", () => { + notification.destroy() + + notification.warning({ + duration: null, + message: '网络异常', + description: + '网络异常,请检测网络后重试。', + }) + }); } \ No newline at end of file From 11253a8cf83367b40134bdbf4dea3bf713dc3985 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, 27 Sep 2019 14:40:53 +0800 Subject: [PATCH 20/23] =?UTF-8?q?=E6=96=B0=E7=89=88=E5=AE=9E=E8=AE=AD?= =?UTF-8?q?=E8=AF=BE=E7=A8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/react/config/webpack.config.dev.js | 2 +- .../courses/coursesPublic/NewShixunModel.js | 204 +++++++++++++----- .../courses/shixunHomework/shixunHomework.js | 54 ++--- 3 files changed, 169 insertions(+), 91 deletions(-) diff --git a/public/react/config/webpack.config.dev.js b/public/react/config/webpack.config.dev.js index aabcd8fb7..e504d2fb6 100644 --- a/public/react/config/webpack.config.dev.js +++ b/public/react/config/webpack.config.dev.js @@ -32,7 +32,7 @@ module.exports = { // See the discussion in https://github.com/facebookincubator/create-react-app/issues/343.s // devtool: "cheap-module-eval-source-map", // 开启调试 - // devtool: "eval-source-map", // 开启调试 + devtool: "eval-source-map", // 开启调试 // These are the "entry points" to our application. // This means they will be the "root" imports that are included in JS bundle. // The first two entry points enable "hot" CSS and auto-refreshes for JS. diff --git a/public/react/src/modules/courses/coursesPublic/NewShixunModel.js b/public/react/src/modules/courses/coursesPublic/NewShixunModel.js index bae89a7ba..e3c90c7eb 100644 --- a/public/react/src/modules/courses/coursesPublic/NewShixunModel.js +++ b/public/react/src/modules/courses/coursesPublic/NewShixunModel.js @@ -19,19 +19,30 @@ class NewShixunModel extends Component{ order:'desc', diff:0, limit:15, + sort:"myshixuns_count" } } componentDidMount() { - let{page,type,keyword,order,diff,limit,status}=this.state; - this.getdatalist(page,type,status,keyword,order,diff,limit) + let{page,type,keyword,order,diff,limit,status,sort}=this.state; + if(this.props.type==='shixuns'){ + this.getdatalist(page,type,status,keyword,order,diff,limit) + }else{ + this.getdatalist(page,type,undefined,keyword,order,undefined,limit,undefined,sort); + } + } - getdatalist=(page,type,newstatus,keyword,order,diff,limit,pagetype)=>{ + getdatalist=(page,type,newstatus,keyword,order,diff,limit,pagetype,sort)=>{ this.setState({ isspinning:true }) let status=this.props.statustype===undefined?newstatus:'published'; - let url="/shixun_lists.json" + let url; + if(this.props.type==='shixuns'){ + url="/shixun_lists.json"; + }else{ + url="/subject_lists.json"; + } axios.get(url,{params:{ page, type, @@ -39,20 +50,21 @@ class NewShixunModel extends Component{ keyword, order, diff, - limit + limit, + sort }}).then((response) => { if(response.data){ if(pagetype===undefined){ this.setState({ - shixun_list:response.data.shixun_list, - shixuns_count:response.data.shixuns_count, + shixun_list:response.data.shixun_list===undefined?response.data.subject_list:response.data.shixun_list, + shixuns_count:response.data.shixuns_count===undefined?response.data.subjects_count:response.data.shixuns_count, Grouplist:[], isspinning:false }) }else if(pagetype==="pagetype"){ this.setState({ - shixun_list:response.data.shixun_list, - shixuns_count:response.data.shixuns_count, + shixun_list:response.data.shixun_list===undefined?response.data.subject_list:response.data.shixun_list, + shixuns_count:response.data.shixuns_count===undefined?response.data.subjects_count:response.data.shixuns_count, isspinning:false }) } @@ -127,8 +139,13 @@ class NewShixunModel extends Component{ newallGrouplist.push({page:pageNumber,list:[]}) } - let{type,status,keyword,order,diff,limit}=this.state; - this.getdatalist(pageNumber,type,status,keyword,order,diff,limit,"pagetype") + let{type,status,keyword,order,diff,limit,sort}=this.state; + if(this.props.type==='shixuns'){ + this.getdatalist(pageNumber,type,status,keyword,order,diff,limit,"pagetype") + }else{ + this.getdatalist(pageNumber,type,undefined,keyword,order,undefined,limit,"pagetype",sort); + } + this.setState({ page:pageNumber, allGrouplist:newallGrouplist @@ -142,8 +159,14 @@ class NewShixunModel extends Component{ keyword:undefined, page:1 }) - let{status,order,diff,limit}=this.state; - this.getdatalist(1,value,status,undefined,order,diff,limit) + let{status,order,diff,limit,sort}=this.state; + if(this.props.type==='shixuns'){ + this.getdatalist(1,value,status,undefined,order,diff,limit) + }else{ + this.getdatalist(1,value,undefined,undefined,order,undefined,limit,undefined,sort) + } + + } updatedlist=(order)=>{ @@ -205,7 +228,7 @@ class NewShixunModel extends Component{ this.setState({ hometypepvisible:false }) - this.showNotification("请先选择实训") + this.showNotification(this.props.type==='shixuns'?"请先选择实训":"请先选择课程") return } @@ -231,33 +254,64 @@ class NewShixunModel extends Component{ this.props.pathShixun(Grouplist) return; } - let url="/courses/"+coursesId+"/homework_commons/create_shixun_homework.json"; - axios.post(url, { - category_id:this.props.category_id===null||this.props.category_id===undefined?undefined:parseInt(this.props.category_id), - shixun_ids:Grouplist, - } - ).then((response) => { - if(response.data.status===-1){ - // this.props.showNotification(response.data.message) + if(this.props.type==='shixuns'){ + let url="/courses/"+coursesId+"/homework_commons/create_shixun_homework.json"; + axios.post(url, { + category_id:this.props.category_id===null||this.props.category_id===undefined?undefined:parseInt(this.props.category_id), + shixun_ids:Grouplist, + } + ).then((response) => { + if(response.data.status===-1){ + // this.props.showNotification(response.data.message) - }else{ - // this.props.courseshomeworkstart(response.data.category_id,response.data.homework_ids) - this.showNotification("操作成功") - this.props.homeworkupdatalists(this.props.Coursename,this.props.page,this.props.order); - this.props.hideNewShixunModelType() + }else{ + // this.props.courseshomeworkstart(response.data.category_id,response.data.homework_ids) + this.showNotification("操作成功") + this.props.homeworkupdatalists(this.props.Coursename,this.props.page,this.props.order); + this.props.hideNewShixunModelType() - } - this.setState({ - hometypepvisible:false + } + this.setState({ + hometypepvisible:false + }) + // category_id: 3 + // homework_ids: (5) [9171, 9172, 9173, 9174, 9175] + }).catch((error) => { + console.log(error) + this.setState({ + hometypepvisible:false + }) }) - // category_id: 3 - // homework_ids: (5) [9171, 9172, 9173, 9174, 9175] - }).catch((error) => { - console.log(error) - this.setState({ - hometypepvisible:false + }else{ + let url="/courses/"+coursesId+"/homework_commons/create_subject_homework.json"; + axios.post(url, { + category_id:this.props.category_id===null||this.props.category_id===undefined?undefined:parseInt(this.props.category_id), + subject_ids:Grouplist, + } + ).then((response) => { + if(response.data.status===-1){ + // this.props.showNotification(response.data.message) + + }else{ + // this.props.courseshomeworkstart(response.data.category_id,response.data.homework_ids) + this.showNotification("操作成功") + this.props.homeworkupdatalists(this.props.Coursename,this.props.page,this.props.order); + this.props.hideNewShixunModelType() + + } + this.setState({ + hometypepvisible:false + }) + // category_id: 3 + // homework_ids: (5) [9171, 9172, 9173, 9174, 9175] + }).catch((error) => { + console.log(error) + this.setState({ + hometypepvisible:false + }) }) - }) + } + } poststatus=(status)=>{ @@ -268,9 +322,37 @@ class NewShixunModel extends Component{ this.getdatalist(page,type,status,keyword,order,diff,limit) } + updatepathlist=(sorts,orders)=>{ + let{page,type,keyword,order,diff,limit,status,sort}=this.state; + let seartorders; + if(sort===sorts){ + if(orders==="desc"){ + this.setState({ + sort:sorts, + order:"asc" + }) + seartorders="asc" + }else{ + this.setState({ + sort:sorts, + order:"desc" + }) + seartorders="desc" + } + }else{ + this.setState({ + sort:sorts, + order:"desc" + }) + seartorders=orders + } + + this.getdatalist(page,type,undefined,keyword,seartorders,undefined,limit,undefined,sorts) + + } render() { - let {diff,Grouplist,status,shixun_list,shixuns_count,page,type,order}=this.state; + let {diff,Grouplist,status,shixun_list,shixuns_count,page,type,order,sort}=this.state; // let {visible,patheditarry}=this.props; // console.log(Grouplist) // console.log(allGrouplist) @@ -331,7 +413,7 @@ class NewShixunModel extends Component{ ); - + console.log(shixun_list) return( <div> @@ -355,7 +437,7 @@ class NewShixunModel extends Component{ closable={true} destroyOnClose={true} onClose={()=>this.props.hideNewShixunModelType()} - visible={this.props.NewShixunModelType} + visible={this.props.type==='shixuns'?this.props.NewShixunModelType:this.props.shixunpath} height={'100%'} > <Spin spinning={this.state.isspinning}> @@ -380,7 +462,7 @@ class NewShixunModel extends Component{ <Search style={{ width: "780px"}} className="packinput" - placeholder="实训信息 / 院校名称 / 创建者" + placeholder={this.props.type==='shixuns'?"实训信息 / 院校名称 / 创建者":"课程名称 / 院校名称 / 创建者"} value={this.state.keyword} enterButton={<span>搜索</span>} onInput={(e)=>this.setdatafunsval(e)} @@ -391,34 +473,50 @@ class NewShixunModel extends Component{ <div className="font-12 ml5 fl"> - <span className="fl color-grey-9 mr20">已选 <span className={"color-blue"}>{Grouplist.length}</span> 个实训</span> - <span className="fl color-grey-9 mr20">共 <span className={"color-blue"}>{shixuns_count===undefined?"":shixuns_count}</span> 个实训</span> + <span className="fl color-grey-9 mr20">已选 <span className={"color-blue"}>{Grouplist.length}</span> 个{this.props.type==='shixuns'?'实训':'课程'}</span> + <span className="fl color-grey-9 mr20">共 <span className={"color-blue"}>{shixuns_count===undefined?"":shixuns_count}</span> 个{this.props.type==='shixuns'?'实训':'课程'}</span> - <span className="fl color-grey-9 pointer mr30"> + {this.props.type==='shixuns'?"":<span className="fl color-grey-9 pointer mr30"> + <a className={" color-grey-6"} onClick={()=>this.updatepathlist("shixuns_count",order)}>实训数</a> + <sapn className="relativef ml5 " > + <i className={order==="asc"&&sort==="shixuns_count"?"iconfont icon-sanjiaoxing-up font-12 ntopsj color-grey-9 color-blue":"iconfont icon-sanjiaoxing-up font-12 ntopsj color-grey-9"}></i> + <i className={order==="desc"&&sort==="shixuns_count"?"iconfont icon-sanjiaoxing-down font-12 nyslbottomsj color-grey-9 color-blue":"iconfont icon-sanjiaoxing-down font-12 nyslbottomsj color-grey-9"}></i> + </sapn> + </span>} + + {this.props.type==='shixuns'?"":<span className="fl color-grey-9 pointer mr30"> + <a className={" color-grey-6"} onClick={()=>this.updatepathlist("myshixuns_count",order)}>使用人数</a> + <sapn className="relativef ml5 " > + <i className={order==="asc"&&sort==="myshixuns_count"?"iconfont icon-sanjiaoxing-up font-12 ntopsj color-grey-9 color-blue":"iconfont icon-sanjiaoxing-up font-12 ntopsj color-grey-9"}></i> + <i className={order==="desc"&&sort==="myshixuns_count"?"iconfont icon-sanjiaoxing-down font-12 nyslbottomsj color-grey-9 color-blue":"iconfont icon-sanjiaoxing-down font-12 nyslbottomsj color-grey-9"}></i> + </sapn> + </span>} + + {this.props.type==='shixuns'?<span className="fl color-grey-9 pointer mr30"> <a className={" color-grey-6"} onClick={()=>this.updatedlist(order)}>学习人数</a> <sapn className="relativef ml5 " > <i className={order==="asc"?"iconfont icon-sanjiaoxing-up font-12 ntopsj color-grey-9 color-blue":"iconfont icon-sanjiaoxing-up font-12 ntopsj color-grey-9"}></i> <i className={order==="desc"?"iconfont icon-sanjiaoxing-down font-12 nyslbottomsj color-grey-9 color-blue":"iconfont icon-sanjiaoxing-down font-12 nyslbottomsj color-grey-9"}></i> </sapn> - </span> + </span>:""} - {this.props.statustype===undefined?<Dropdown overlay={statusmenus}> + {this.props.type==='shixuns'?this.props.statustype===undefined?<Dropdown overlay={statusmenus}> <a className="ant-dropdown-link color-grey-6 mr20"> {status==='all'?"发布状态":status==='published'?"已发布":status==="unpublished"?"未发布":""}<Icon type="down" className={"color-grey-6"}/> </a> - </Dropdown>:""} + </Dropdown>:"":""} - <Dropdown overlay={menus}> + {this.props.type==='shixuns'? <Dropdown overlay={menus}> <a className="ant-dropdown-link color-grey-6"> {diff===0?"难度":diff===1?"初级":diff===2?"中级":diff===3?"高级":diff===4?"顶级":""}<Icon type="down" className={"color-grey-6"}/> </a> - </Dropdown> + </Dropdown>:""} </div> <div className="font-12 alltopiscright ml25 fr"> {/*<span className={"fr pointer color-grey-3"} onClick={()=>this.props.hideNewShixunModelType()}>返回</span>*/} - <span className={type==="mine"?"fr topcsactive pointer color-grey-3 color-blue":"fr pointer color-grey-3"} onClick={()=>this.belongto("mine")}>我的实训</span> - <span className={type==="all"?"fr mr30 topcsactive pointer color-grey-3 color-blue":"fr mr30 pointer color-grey-3"} onClick={()=>this.belongto("all")}>全部实训</span> + <span className={type==="mine"?"fr topcsactive pointer color-grey-3 color-blue":"fr pointer color-grey-3"} onClick={()=>this.belongto("mine")}>我的{this.props.type==='shixuns'?'实训':"课程"}</span> + <span className={type==="all"?"fr mr30 topcsactive pointer color-grey-3 color-blue":"fr mr30 pointer color-grey-3"} onClick={()=>this.belongto("all")}>全部{this.props.type==='shixuns'?'实训':"课程"}</span> </div> </div> @@ -461,7 +559,7 @@ class NewShixunModel extends Component{ {JSON.stringify(item.description) == "{}"?"":<div className="newshixunmodelmidfont newradioStyles" dangerouslySetInnerHTML={{__html: item.description}}> </div>} - {item.challenge_names.length===0?"":<div className="newshixunmodelbotfont"> + {item.challenge_names===undefined?"":item.challenge_names.length===0?"":<div className="newshixunmodelbotfont"> {item.challenge_names.map((item,key)=>{ return( <span>第{key+1}关:{item}</span> @@ -498,7 +596,7 @@ class NewShixunModel extends Component{ </Breadcrumb> </div> - {item.subjects.length===0?"":<Dropdown overlay={()=>this.ItsCourse(item.subjects)}> + {item.subjects===undefined?"":item.subjects.length===0?"":<Dropdown overlay={()=>this.ItsCourse(item.subjects)}> <a className="ant-dropdown-link fl ml30 newshixunfont12 color-blue" > 所属课程<Icon className={"color-blue"} type="down" /> </a> diff --git a/public/react/src/modules/courses/shixunHomework/shixunHomework.js b/public/react/src/modules/courses/shixunHomework/shixunHomework.js index 5298baffc..c15a19f8f 100644 --- a/public/react/src/modules/courses/shixunHomework/shixunHomework.js +++ b/public/react/src/modules/courses/shixunHomework/shixunHomework.js @@ -908,7 +908,8 @@ class ShixunHomework extends Component{ } hideNewShixunModelType=()=>{ this.setState({ - NewShixunModelType:false + NewShixunModelType:false, + shixunpath:false }) } render(){ @@ -971,6 +972,20 @@ class ShixunHomework extends Component{ statustype={'published'} />:""} + {/*新版实训model*/} + {shixunpath===true?<NewShixunModel + {...this.props} + {...this.state} + category_id={this.props.match.params.category_id} + type={'path'} + hideNewShixunModelType={()=>this.hideNewShixunModelType()} + coursesId={this.props.match.params.coursesId} + homeworkupdatalists={(Coursename,page,order)=>this.homeworkupdatalist(Coursename,page,order)} + Coursename={Coursename} + page={page} + order={order} + />:""} + {/*提示*/} {Modalstype&&Modalstype===true?<Modals @@ -1005,23 +1020,6 @@ class ShixunHomework extends Component{ getcourse_groupslist={(id)=>this.getcourse_groupslist(id)} />:""} - {/*/!*选择实训*!/*/} - {/*{shixunmodal===true?<ShixunModal*/} - {/*{...this.props}*/} - {/*{...this.state}*/} - {/*datas={datas}*/} - {/*category_id={this.props.match.params.category_id}*/} - {/*visible={shixunmodal}*/} - {/*shixunmodallist={shixunmodallist}*/} - {/*homeworkupdatalists={(Coursename,page,order)=>this.homeworkupdatalist(Coursename,page,order)}*/} - {/*hometypepvisible={hometypepvisible}*/} - {/*hidecouseShixunModal={this.hidecouseShixunModal}*/} - {/*newshixunmodallist={newshixunmodallist}*/} - {/*coursesId={this.props.match.params.coursesId}*/} - {/*courseshomeworkstart={(category_id,homework_ids)=>this.newhomeworkstart(category_id,homework_ids)}*/} - {/*funpatheditarry={(patheditarry)=>this.funpatheditarry(patheditarry)}*/} - {/*patheditarry={patheditarry}*/} - {/*/>:""}*/} {shixunmodal===true||shixunpath===true?<style> { @@ -1032,25 +1030,7 @@ class ShixunHomework extends Component{ ` } </style>:""} - {/*选择实训路径*/} - {shixunpath===true? <PathModal - {...this.props} - {...this.state} - datas={datas} - visible={shixunpath} - shixunmodallist={this.state.shixunpathlist} - newshixunmodallist={this.state.newshixunpathlist} - // funshixunpathlist={(search,type,loading,page)=>this.funshixunpathlist(search,type,loading,page)} - hometypepvisible={hometypepvisible} - hidecouseShixunModal={this.hidecouseShixunModal} - coursesId={this.props.match.params.coursesId} - homeworkupdatalists={(Coursename,page,order)=>this.homeworkupdatalist(Coursename,page,order)} - courseshomeworkstart={(category_id,homework_ids)=>this.newhomeworkstart(category_id,homework_ids)} - Coursename={Coursename} - page={page} - order={order} - // courseshomeworkstart={(category_id,homework_ids)=>this.newhomeworkstart(category_id,homework_ids)} - />:""} + {/*添加目录/选择目录*/} From f9d576bbc8abc3247529886e6e8513ae443ab177 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, 27 Sep 2019 14:43:44 +0800 Subject: [PATCH 21/23] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../react/src/modules/courses/coursesPublic/NewShixunModel.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/public/react/src/modules/courses/coursesPublic/NewShixunModel.js b/public/react/src/modules/courses/coursesPublic/NewShixunModel.js index e3c90c7eb..062390f1e 100644 --- a/public/react/src/modules/courses/coursesPublic/NewShixunModel.js +++ b/public/react/src/modules/courses/coursesPublic/NewShixunModel.js @@ -269,7 +269,7 @@ class NewShixunModel extends Component{ this.showNotification("操作成功") this.props.homeworkupdatalists(this.props.Coursename,this.props.page,this.props.order); this.props.hideNewShixunModelType() - + this.props.updataleftNavfun() } this.setState({ hometypepvisible:false @@ -297,7 +297,7 @@ class NewShixunModel extends Component{ this.showNotification("操作成功") this.props.homeworkupdatalists(this.props.Coursename,this.props.page,this.props.order); this.props.hideNewShixunModelType() - + this.props.updataleftNavfun() } this.setState({ hometypepvisible:false From c941152e721d4a1f094d0a17c14f4ea0737e3790 Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Fri, 27 Sep 2019 15:01:33 +0800 Subject: [PATCH 22/23] const $ = window.$ --- public/react/src/AppConfig.js | 1 + 1 file changed, 1 insertion(+) diff --git a/public/react/src/AppConfig.js b/public/react/src/AppConfig.js index a92b83b4b..d402da0ec 100644 --- a/public/react/src/AppConfig.js +++ b/public/react/src/AppConfig.js @@ -208,6 +208,7 @@ export function initAxiosInterceptors(props) { function initOnlineOfflineListener() { + const $ = window.$ $(window).bind("online", () => { notification.destroy() notification.success({ From e540aa155828cf6feecaeba8f22aa2b10a85b0a0 Mon Sep 17 00:00:00 2001 From: SylorHuang <sylor_huang@126.com> Date: Fri, 27 Sep 2019 15:14:44 +0800 Subject: [PATCH 23/23] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=AB=8B=E5=8D=B3?= =?UTF-8?q?=E6=88=AA=E6=AD=A2=E5=90=8E=EF=BC=8C=E7=BB=9F=E8=AE=A1=E5=AD=A6?= =?UTF-8?q?=E7=94=9F=E6=88=90=E7=BB=A9=E7=9A=84=E8=AE=A1=E7=AE=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/exercises_controller.rb | 38 ++++++++++++++----------- app/jobs/end_exercise_calculate_job.rb | 29 +++++++++++++++++++ 2 files changed, 50 insertions(+), 17 deletions(-) create mode 100644 app/jobs/end_exercise_calculate_job.rb diff --git a/app/controllers/exercises_controller.rb b/app/controllers/exercises_controller.rb index 3be35345e..8a02ba06f 100644 --- a/app/controllers/exercises_controller.rb +++ b/app/controllers/exercises_controller.rb @@ -844,23 +844,27 @@ class ExercisesController < ApplicationController exercise_users = exercise.exercise_users exercise.update_attributes(:exercise_status => 3, :end_time => Time.now,:unified_setting => true) end - exercise_users.each do |user| - if user.commit_status == 0 && user.start_at.present? - objective_score = calculate_student_score(exercise,user.user)[:total_score] - user_sub_score = user.subjective_score - subjective_score = user_sub_score < 0.0 ? 0.0 : user_sub_score - total_score = objective_score + subjective_score - commit_option = { - :status => 1, - :commit_status => 1, - :end_at => Time.now, - :objective_score => objective_score, - :score => total_score, - :subjective_score => user_sub_score - } - user.update_attributes(commit_option) - end - end + + ex_user_ids = exercise_users.pluck(:id) + + EndExerciseCalculateJob.perform_later(ex_user_ids,exercise) + # exercise_users.each do |user| + # if user.commit_status == 0 && user.start_at.present? + # objective_score = calculate_student_score(exercise,user.user)[:total_score] + # user_sub_score = user.subjective_score + # subjective_score = user_sub_score < 0.0 ? 0.0 : user_sub_score + # total_score = objective_score + subjective_score + # commit_option = { + # :status => 1, + # :commit_status => 1, + # :end_at => Time.now, + # :objective_score => objective_score, + # :score => total_score, + # :subjective_score => user_sub_score + # } + # user.update_attributes(commit_option) + # end + # end end end normal_status(0, "试卷截止成功!") diff --git a/app/jobs/end_exercise_calculate_job.rb b/app/jobs/end_exercise_calculate_job.rb new file mode 100644 index 000000000..39d8bb1db --- /dev/null +++ b/app/jobs/end_exercise_calculate_job.rb @@ -0,0 +1,29 @@ +class EndExerciseCalculateJob < ApplicationJob + + include ExercisesHelper + include GitHelper + + queue_as :default + + def perform(ex_user_ids,exercise) + exercise_users = ExerciseUser.where(id: ex_user_ids) + exercise_users.each do |user| + if user.commit_status == 0 && user.start_at.present? + objective_score = calculate_student_score(exercise,user.user)[:total_score] + user_sub_score = user.subjective_score + subjective_score = user_sub_score < 0.0 ? 0.0 : user_sub_score + total_score = objective_score + subjective_score + commit_option = { + :status => 1, + :commit_status => 1, + :end_at => Time.now, + :objective_score => objective_score, + :score => total_score, + :subjective_score => user_sub_score + } + user.update_attributes(commit_option) + end + end + end + +end