Merge remote-tracking branch 'origin/master'

dev_forum
杨树明 6 years ago
commit fbb0c0117f

@ -97,6 +97,13 @@ class CommonWorkItem extends Component{
setupdate = () => { setupdate = () => {
} }
toCreateProject = () => {
if (window.location.port == 3007) {
window.location.href = '/testbdweb.educoder.net/projects/new'
} else {
window.location.href = '/projects/new'
}
}
render(){ render(){
let { mainList,workType }=this.props; let { mainList,workType }=this.props;
const { aModalVisible, fileList, revise_reason } = this.state const { aModalVisible, fileList, revise_reason } = this.state
@ -195,12 +202,22 @@ class CommonWorkItem extends Component{
<li className="fr"> <li className="fr">
{ // { //
item.work_status && item.work_status.indexOf('关联项目') != -1 && item.work_status && item.work_status.indexOf('关联项目') != -1 &&
<WordsBtn style="blue" className={` font-16 fl}`} onClick={() => this.props.openConnectionProject(item)}>关联项目</WordsBtn> <React.Fragment>
<WordsBtn style="blue" className={` font-16 fl`} onClick={() => this.props.toCreateProject(item)}>创建项目</WordsBtn>
<WordsBtn style="blue" className={` font-16 fl ml28`} onClick={() => this.props.openConnectionProject(item)}>关联项目</WordsBtn>
</React.Fragment>
}
{ //
item.work_status && item.work_status.indexOf('取消关联') != -1 &&
<WordsBtn style="blue" className={` font-16 fl`} onClick={() => this.props.cancelConnectionProject(item)}>取消关联</WordsBtn>
} }
{ // { //
item.work_status && item.work_status.indexOf('提交作品') != -1 && item.work_status && item.work_status.indexOf('提交作品') != -1 &&
<WordsBtn style="blue" className="fl font-16 ml28" onClick={() => this.props.toWorkPostPage(this.props.match.params, item.homework_id)}>提交作品</WordsBtn> <WordsBtn style="blue" className="fl font-16 ml28" onClick={() => this.props.toWorkPostPage(this.props.match.params, item.homework_id)}>提交作品</WordsBtn>
} }
{ {
// //
item.work_status && item.work_status.indexOf('补交作品') != -1 && item.work_status && item.work_status.indexOf('补交作品') != -1 &&

@ -173,7 +173,7 @@ class CommonWorkPost extends Component{
} }
if(isGroup){ if(isGroup){
if(userids!=undefined){ if(userids!=undefined){
if(userids.length<memberNumMin){ if(userids.length + 1<memberNumMin){
this.setState({ this.setState({
minvalue: memberNumMin, minvalue: memberNumMin,
setvalue:"小于", setvalue:"小于",
@ -181,7 +181,7 @@ class CommonWorkPost extends Component{
}) })
return return
}else if(userids.length>memberNumMax){ }else if(userids.length + 1>memberNumMax){
this.setState({ this.setState({
minvalue: memberNumMax, minvalue: memberNumMax,
setvalue:"大于", setvalue:"大于",

@ -44,6 +44,7 @@ class ConnectProject extends Component{
}).then((result)=>{ }).then((result)=>{
if(result.data.status==0){ if(result.data.status==0){
this.closeConnectionProject() this.closeConnectionProject()
this.props.connectSuccess()
this.props.showNotification('关联成功') this.props.showNotification('关联成功')
} }
}).catch((error)=>{ }).catch((error)=>{
@ -122,7 +123,24 @@ class ConnectProject extends Component{
footer={null} footer={null}
destroyOnClose={true} destroyOnClose={true}
> >
<div className="newupload_conbox clearfix"> <style>{`
.connectProject .ant-radio {
float: left;
line-height: 18px;
}
.connectProject .ant-radio-wrapper .name {
max-width: 480px;
display: inline-block;
overflow: hidden;
text-overflow:ellipsis;
white-space: nowrap;
}
.connectProject .ant-radio-wrapper>span:last-child {
line-height: 18px;
}
`}</style>
<div className="newupload_conbox clearfix connectProject">
{ {
(projects && !!projects.length || this.state.keyword) && (projects && !!projects.length || this.state.keyword) &&
<div> <div>
@ -131,7 +149,7 @@ class ConnectProject extends Component{
onSearch={this.onSearchValue} onSearch={this.onSearchValue}
></Search> ></Search>
<Radio.Group onChange={this.onChange} value={this.state.radioValue} className={"with100"}> <Radio.Group onChange={this.onChange} value={this.state.radioValue} className={"with100"}>
<div className="mt15" style={{"maxHeight":"161px","overflow-y":"auto"}}> <div className="mt15" style={{"maxHeight":"228px","overflow-y":"auto", "overflow-x": 'hidden'}}>
<InfiniteScroll <InfiniteScroll
threshold={20} threshold={20}
initialLoad={false} initialLoad={false}
@ -141,7 +159,9 @@ class ConnectProject extends Component{
useWindow={false} useWindow={false}
> >
{ projects.map(item => { { projects.map(item => {
return <p className="mb7" key={item.id}><Radio value={item.id}>{item.name}</Radio></p> return <p className="mb7" key={item.id}><Radio value={item.id}>
<span title={item.name.length > 12 ? item.name : ''} className="name">{item.name}</span>
</Radio></p>
})} })}
</InfiniteScroll> </InfiniteScroll>
</div> </div>

@ -279,6 +279,26 @@ class commonWork extends Component{
console.log(error) console.log(error)
}) })
} }
connectSuccess = () => {
let {page,search,order}=this.state;
this.getList(page,search,order);
}
cancelConnectionProject = (work) => {
let workId=this.props.match.params.workId;
let courseId=this.props.match.params.coursesId;
const url = `/homework_commons/${work.homework_id}/student_works/cancel_relate_project.json`
axios.get(url).then((response)=> {
if (response.data.status == 0) {
let {page,search,order}=this.state;
this.getList(page,search,order);
this.props.showNotification('取消关联成功')
}
}).catch((error)=>{
console.log(error)
})
}
render(){ render(){
@ -341,7 +361,7 @@ class commonWork extends Component{
</div> </div>
</div> </div>
</div> */} </div> */}
<ConnectProject ref="connectProject" {...this.props}></ConnectProject> <ConnectProject ref="connectProject" {...this.props} connectSuccess={this.connectSuccess}></ConnectProject>
<Titlesearchsection <Titlesearchsection
@ -425,6 +445,7 @@ class commonWork extends Component{
<Checkbox.Group style={{"width":"100%"}} onChange={this.onChangeSelect} value={checkBoxValues}> <Checkbox.Group style={{"width":"100%"}} onChange={this.onChangeSelect} value={checkBoxValues}>
<CommonWorkItem mainList={mainList} {...this.props} workType={workType} onItemClick={this.onItemClick} <CommonWorkItem mainList={mainList} {...this.props} workType={workType} onItemClick={this.onItemClick}
openConnectionProject={this.openConnectionProject} openConnectionProject={this.openConnectionProject}
cancelConnectionProject={this.cancelConnectionProject}
></CommonWorkItem> ></CommonWorkItem>
</Checkbox.Group> </Checkbox.Group>
</Spin> </Spin>

@ -1,7 +1,7 @@
import React, {Component} from 'react'; import React, {Component} from 'react';
import {Link} from "react-router-dom"; import {Link} from "react-router-dom";
import axios from 'axios'; import axios from 'axios';
import {getImageUrl, trigger} from 'educoder'; import {getImageUrl, trigger, on, off} from 'educoder';
import { Tooltip, message,Popover} from 'antd'; import { Tooltip, message,Popover} from 'antd';
import CoursesListType from '../coursesPublic/CoursesListType'; import CoursesListType from '../coursesPublic/CoursesListType';
import Addcourses from '../coursesPublic/Addcourses'; import Addcourses from '../coursesPublic/Addcourses';
@ -48,9 +48,13 @@ class CoursesBanner extends Component {
componentDidMount() { componentDidMount() {
this.onloadupdatabanner() this.onloadupdatabanner()
on('updatabanner', this.updatabanner)
}
componentWillUnmount() {
off('updatabanner', this.updatabanner)
} }
onloadupdatabanner=()=>{ onloadupdatabanner=()=>{
this.updatabanner() this.updatabanner()
} }

@ -79,7 +79,7 @@ const buildColumns = (that) => {
return columns; return columns;
} }
// 1-按照学号排序 2-按照分班排序 // 1-按照学生学号 2-按照分班名称
const ORDER_BY_NUM = 1; const ORDER_BY_NUM = 1;
const ORDER_BY_GROUP = 2; const ORDER_BY_GROUP = 2;
@ -317,6 +317,8 @@ class studentsList extends Component{
if (result.data.status == 0) { if (result.data.status == 0) {
this.props.showNotification('移动成功') this.props.showNotification('移动成功')
this.fetchAll() this.fetchAll()
this.props.updataleftNavfun()
} }
}).catch((error)=>{ }).catch((error)=>{
console.log(error); console.log(error);
@ -362,6 +364,7 @@ class studentsList extends Component{
this.props.showNotification('删除成功') this.props.showNotification('删除成功')
this.fetchAll() this.fetchAll()
this.setState({checkBoxValues: []}) this.setState({checkBoxValues: []})
trigger('updatabanner')
} }
}).catch((error)=>{ }).catch((error)=>{
console.log(error); console.log(error);
@ -428,9 +431,9 @@ class studentsList extends Component{
checkBoxValues, checkBoxValues,
checkAllValue checkAllValue
}=this.state; }=this.state;
let currentOrderName = '学排序' let currentOrderName = '学生学号'
if (order == ORDER_BY_GROUP) { if (order == ORDER_BY_GROUP) {
currentOrderName = '分班排序' currentOrderName = '分班名称'
} }
const { coursesids } = this.props const { coursesids } = this.props
const course_group_id = this.props.match.params.course_group_id const course_group_id = this.props.match.params.course_group_id
@ -574,8 +577,8 @@ class studentsList extends Component{
<li className="drop_down"> <li className="drop_down">
{currentOrderName}<i className="iconfont icon-xiajiantou font-12 ml2"></i> {currentOrderName}<i className="iconfont icon-xiajiantou font-12 ml2"></i>
<ul className="drop_down_normal"> <ul className="drop_down_normal">
<li onClick={() => this.onSortTypeChange(ORDER_BY_NUM)} >排序</li> <li onClick={() => this.onSortTypeChange(ORDER_BY_NUM)} >生学</li>
<li onClick={() => this.onSortTypeChange(ORDER_BY_GROUP)} >分班排序</li> <li onClick={() => this.onSortTypeChange(ORDER_BY_GROUP)} >分班名称</li>
</ul> </ul>
</li> </li>
</div> </div>

@ -51,7 +51,7 @@ function buildColumns(that) {
dataIndex: 'role', dataIndex: 'role',
key: 'role', key: 'role',
}] }]
that.course_groups && that.course_groups.length && columns.push({ that.state.course_groups && that.state.course_groups.length && columns.push({
title: <Tooltip title="仅能批阅指定分班的作品">管理权限</Tooltip>, title: <Tooltip title="仅能批阅指定分班的作品">管理权限</Tooltip>,
width: 230, width: 230,
key: 'course_groups', key: 'course_groups',
@ -462,6 +462,7 @@ class studentsList extends Component{
if (response.data.status == 0) { if (response.data.status == 0) {
// {"status":1,"message":"删除成功"} // {"status":1,"message":"删除成功"}
this.props.showNotification('删除成功') this.props.showNotification('删除成功')
trigger('updatabanner')
this.fetchAll() this.fetchAll()
} }
}) })

@ -299,9 +299,11 @@ class Listofworks extends Component {
var data = { var data = {
search: "", search: "",
order: "", order: "",
b_order: "", b_order: "asc",
work_status: "", work_status: "",
course_group: "", course_group: "",
page:1,
limit:20,
} }
axios.post(urll, data).then((result) => { axios.post(urll, data).then((result) => {
if (result !== undefined) { if (result !== undefined) {

@ -90,7 +90,9 @@ class Listofworksstudentone extends Component {
var data = { var data = {
search: "", search: "",
order: "", order: "",
b_order: "", b_order: "asc",
page:1,
limit:20,
work_status: "", work_status: "",
course_group: "", course_group: "",
} }

@ -36,9 +36,11 @@ class TraineetraininginformationModal extends Component {
props: this.props, props: this.props,
userids: this.props.userids, userids: this.props.userids,
game_list:this.props.game_list, game_list:this.props.game_list,
gline:0,
}) })
// console.log("TraineetraininginformationModal") // console.log("TraineetraininginformationModal")
// console.log(JSON.stringify(this.props)) // console.log(this.props)
} }
@ -47,6 +49,7 @@ class TraineetraininginformationModal extends Component {
} }
componentDidMount() { componentDidMount() {
// this.seacthdata(); // this.seacthdata();
} }
// 设置数据 // 设置数据
// seacthdata = () => { // seacthdata = () => {
@ -54,68 +57,116 @@ class TraineetraininginformationModal extends Component {
// console.log(datalist) // console.log(datalist)
// } // }
render() { render() {
let columns = [ const columns = [
{ {
title: '关卡', title: '关卡',
dataIndex: 'number', dataIndex: 'number',
key: 'number', key: 'number',
width: 150, align: "center",
align: "center", render: (text, record) => (
render: (text, record) => ( <span >
<span > <a style={{"color":'#07111B', "text-align": "center"}}>{record.number}</a>
<a style={{"color":'#07111B', "text-align": "center"}}>{record.number}</a> </span>
),
},
{
title: '完成时间',
dataIndex: 'name',
key: 'name',
width: 178,
align: "center",
render: (text, record) => (
<span >
<a style={{"color":'#989898', "text-align": "center"}} >{record.name==='Invalid date'?"--":record.name}</a>
</span>
),
},
{
title: '耗时',
dataIndex: 'stduynumber',
key: 'stduynumber',
align: "center",
render: (text, record) => (
<span>
<a style={{"color":'#989898', "text-align": "center"}}>{record.stduynumber}</a>
</span>
),
},
{
title: '经验值',
key: 'classroom',
dataIndex: 'classroom',
align: "center",
render: (text, record) => (
<span>
<a style={{"color":'#29BD8B', "text-align": "center"}}>{record.classroom}</a>
</span> </span>
), ),
}, }
{ ];
title: '完成时间', const columnss = [
dataIndex: 'name', {
key: 'name', title: '关卡',
width: 150, dataIndex: 'number',
align: "center", key: 'number',
render: (text, record) => ( width: 92,
<span > align: "center",
render: (text, record) => (
<span >
<a style={{"color":'#07111B', "text-align": "center"}}>{record.number}</a>
</span>
),
},
{
title: '完成时间',
dataIndex: 'name',
key: 'name',
width: 178,
align: "center",
render: (text, record) => (
<span >
<a style={{"color":'#989898', "text-align": "center"}} >{record.name==='Invalid date'?"--":record.name}</a> <a style={{"color":'#989898', "text-align": "center"}} >{record.name==='Invalid date'?"--":record.name}</a>
</span> </span>
), ),
}, },
{ {
title: '', title: '',
dataIndex: 'complete_status', dataIndex: 'complete_status',
key: 'complete_status', key: 'complete_status',
width: 150, width: 100,
align: "center", align: "center",
render: (text, record) => ( render: (text, record) => (
<span> <span>
{record.complete_status===2?<img src={delay}/>:record.complete_status===3?<img src={invalid}/>:""} {record.complete_status===2?<img src={delay}/>:record.complete_status===3?<img src={invalid}/>:""}
</span> </span>
), ),
}, },
{ {
title: '耗时', title: '耗时',
dataIndex: 'stduynumber', dataIndex: 'stduynumber',
key: 'stduynumber', key: 'stduynumber',
width: 150, width: 92,
align: "center", align: "center",
render: (text, record) => ( render: (text, record) => (
<span> <span>
<a style={{"color":'#989898', "text-align": "center"}}>{record.stduynumber}</a> <a style={{"color":'#989898', "text-align": "center"}}>{record.stduynumber}</a>
</span> </span>
), ),
}, },
{ {
title: '经验值', title: '经验值',
key: 'classroom', key: 'classroom',
width: 150, width: 92,
dataIndex: 'classroom', dataIndex: 'classroom',
align: "center", align: "center",
render: (text, record) => ( render: (text, record) => (
<span> <span>
<a style={{"color":'#29BD8B', "text-align": "center"}}>{record.classroom}</a> <a style={{"color":'#29BD8B', "text-align": "center"}}>{record.classroom}</a>
</span> </span>
), ),
} }
]; ];
return ( return (
<div> <div>
@ -128,62 +179,81 @@ class TraineetraininginformationModal extends Component {
onCancel={this.Cancel} onCancel={this.Cancel}
> >
<div style={{width:"100%" }}className="login_register_content" > <div style={{width:"100%" }}className="login_register_content" >
<div style={{"width": "100%","text-align": "center"}}> <div style={{"width": "100%","text-align": "left","clear": "both"}}>
<a style={{"text-align": "center"}}>{this.props.viewtrainingdata === undefined ? "" : this.props.viewtrainingdata.shixun_name}</a> <div className="mt5 fl" >
<a className="ml20 " style={{"text-align": "center","color":'#29BD8B'}} >经验值<span style={{"color":'#29BD8B'}}> {this.props.viewtrainingdata === undefined ? "" : this.props.viewtrainingdata.shixun_score}</span></a> <span style={{"text-align": "left"}}>{this.props.viewtrainingdata === undefined ? "" : this.props.viewtrainingdata.shixun_name}</span>
<span className="ml10 " style={{"text-align": "left","color":'#29BD8B'}} >经验值<span style={{"color":'#29BD8B'}}> {this.props.viewtrainingdata === undefined ? "" : this.props.viewtrainingdata.shixun_score}</span></span>
</div>
{/*<Button type="primary" className="ml30" >实训报告</Button>*/} {/*<Button type="primary" className="ml30" >实训报告</Button>*/}
<a className="ml30 color-blue " style={{"text-align": "center"}} target={"_blank"} href={`/courses/${this.props.coursesId}/shixun_homeworks/${this.props.viewtrainingdata.work_id}/shixun_work_report`}> <Button type="primary" className="lh38 fr" style={{"text-align": "center","width": "100px",color: "#fff"}} href={`/courses/${this.props.coursesId}/shixun_homeworks/${this.props.viewtrainingdata.work_id}/shixun_work_report`}>
实训报告 实训报告
</a> </Button>
{/*这里到时候要做判断*/} {/*这里到时候要做判断*/}
</div> </div>
</div> </div>
<div className=" bor-bottom-greyE mt10"></div> <div className=" bor-bottom-greyE mt45 "></div>
<div style={{"clear": "both"}}>
<div className="fl edu-back-white ml10 "> <div className="fl edu-back-white ml10 ">
<img alt="头像" className="radius mt10" height="70" id="nh_user_logo" name="avatar_image" <img alt="头像" className="radius mt10" height="70" id="nh_user_logo" name="avatar_image"
src={this.props.viewtrainingdata === undefined ? "" : "https://www.educoder.net/images/" + `${this.props.viewtrainingdata.image_url}`} src={this.props.viewtrainingdata === undefined ? "" : "https://www.educoder.net/images/" + `${this.props.viewtrainingdata.image_url}`}
width="70"/> width="70"/>
</div>
<div className="fl edu-back-white ml20 mt10">
<li>{this.props.viewtrainingdata === undefined ? "" :this.props.viewtrainingdata.username}<span style={{"color":"#323232"}}> 通关</span><span style={{"color": '#FF6800'}}>{this.props.viewtrainingdata === undefined ? "" :this.props.viewtrainingdata.complete_count}/{this.props.viewtrainingdata === undefined ? "" :this.props.viewtrainingdata.challenges_count}</span></li>
<li><span style={{"color":"#989898"}} >完成效率</span><span style={{"color":"#4C4C4C"}}>{this.props.viewtrainingdata === undefined ? "" :this.props.viewtrainingdata.efficiency}</span></li>
<li><span style={{"color":"#989898"}}>通关时间</span> <span style={{"color":"#4C4C4C"}}>{this.props.viewtrainingdata === undefined ? "":moment(this.props.viewtrainingdata.passed_time).format('YYYY-MM-DD HH:mm')==="Invalid date"?"--":moment(this.props.viewtrainingdata.passed_time).format('YYYY-MM-DD HH:mm')}</span> </li>
</div> </div>
<div className="fl edu-back-white ml20 mt10"> <div className="fl edu-back-white ml20 mt10">
<li className="mt20"> <span style={{"color":"#989898"}}>课堂最高完成效率</span> <span style={{"color":"#4C4C4C"}}>{this.props.viewtrainingdata === undefined ? "" :this.props.viewtrainingdata.max_efficiency} </span> </li> <li>{this.props.viewtrainingdata === undefined ? "" :this.props.viewtrainingdata.username}<span style={{"color":"#323232"}}> 通关</span><span style={{"color": '#FF6800'}}>{this.props.viewtrainingdata === undefined ? "" :this.props.viewtrainingdata.complete_count}/{this.props.viewtrainingdata === undefined ? "" :this.props.viewtrainingdata.challenges_count}</span></li>
<li><span style={{"color":"#989898"}}>总耗时:</span> <span style={{"color":"#4C4C4C"}}> {this.props.viewtrainingdata === undefined ? "" :this.props.viewtrainingdata.total_spend_time}</span> </li> <li><span style={{"color":"#989898"}} >完成效率</span><span style={{"color":"#4C4C4C"}}>{this.props.viewtrainingdata === undefined ? "" :this.props.viewtrainingdata.efficiency}</span></li>
<li><span style={{"color":"#989898"}}>通关时间</span> <span style={{"color":"#4C4C4C"}}>{this.props.viewtrainingdata === undefined ? "":moment(this.props.viewtrainingdata.passed_time).format('YYYY-MM-DD HH:mm')==="Invalid date"?"--":moment(this.props.viewtrainingdata.passed_time).format('YYYY-MM-DD HH:mm')}</span> </li>
</div>
<div className="fl edu-back-white ml20 mt10">
<li className="mt20"> <span style={{"color":"#989898"}}>课堂最高完成效率</span> <span style={{"color":"#4C4C4C"}}>{this.props.viewtrainingdata === undefined ? "" :this.props.viewtrainingdata.max_efficiency} </span> </li>
<li><span style={{"color":"#989898"}}>总耗时:</span> <span style={{"color":"#4C4C4C"}}> {this.props.viewtrainingdata === undefined ? "" :this.props.viewtrainingdata.total_spend_time}</span> </li>
</div>
</div> </div>
{ {
this.props.game_list === undefined?"" : this.props.game_list.length<4? this.props.game_list === undefined?"" : this.props.game_list.length<4?
<style> <div>
{ <style>
` .ant-table-body{ {
overflow: hidden !important; ` .ant-table-body{
}` overflow: hidden !important;
} }`
}
</style>
:"" </style>
} <div className={"both"}></div>
{this.props.game_list === undefined ? "" : <Table
<div className={"both"}></div> className="mt20"
{this.props.game_list === undefined ? "" : <Table dataSource={this.props.game_list}
className="mt20" columns={columns}
dataSource={this.props.game_list} loading={false}
columns={columns} pagination={false}
pagination={{ //分页 onChange={this.TablePagination}
/>}
</div>
:
<div>
<div className={"both"}></div>
{this.props.game_list === undefined ? "" : <Table
className="mt20"
dataSource={this.props.game_list}
columns={columns}
pagination={{ //分页
total: this.props.game_list.length, //数据总数量 total: this.props.game_list.length, //数据总数量
pageSize: this.props.game_list.length, //一页显示几条 pageSize: this.props.game_list.length, //一页显示几条
current: 1, current: 1,
}} }}
loading={false} loading={false}
pagination={false} pagination={false}
onChange={this.TablePagination} onChange={this.TablePagination}
scroll={{ y: 300 }} scroll={{ y: 300 }}
/>} />}
</Modal> </div>
}
</Modal>
</div> </div>

@ -141,7 +141,7 @@ class Trainingjobsetting extends Component {
// console.log(homeworkid) // console.log(homeworkid)
let url = `/homework_commons/${homeworkid}/settings.json`; let url = `/homework_commons/${homeworkid}/settings.json`;
axios.get(url).then((result) => { axios.get(url).then((result) => {
if (result.status === 200) { if (result!=undefined) {
// console.log(result.data.code_review) // console.log(result.data.code_review)
// console.log("设置页") // console.log("设置页")
// console.log(JSON.stringify(result)) // console.log(JSON.stringify(result))
@ -637,12 +637,12 @@ class Trainingjobsetting extends Component {
//允许补交 //允许补交
onChanges = (e) => { onChanges = (e) => {
console.log("640"); // console.log("640");
console.log(this.state.end_time); // console.log(this.state.end_time);
if(e.target.value ==="允许补交"){ if(e.target.value ==="允许补交"){
if(this.state.end_time !== null && this.state.end_time!== undefined){ if(this.state.end_time !== null && this.state.end_time!== undefined){
// console.log(this.state.end_time); // console.log(this.state.end_time);
var times = this.state.end_time.format('YYYY-MM-DD HH:mm'); var times = this.state.deadline.format('YYYY-MM-DD HH:mm');
this.setState({ this.setState({
late_time:moment(handleDateString(times)).add(1, 'months'), late_time:moment(handleDateString(times)).add(1, 'months'),
late_times:moment(handleDateString(times)).add(1, 'months').format('YYYY-MM-DD HH:mm'), late_times:moment(handleDateString(times)).add(1, 'months').format('YYYY-MM-DD HH:mm'),
@ -983,16 +983,19 @@ class Trainingjobsetting extends Component {
if (!startValue || !endValue) { if (!startValue || !endValue) {
return false; return false;
} }
return startValue.valueOf() > endValue.valueOf(); var endValues= moment(endValue).subtract(1, 'days');
return startValue.valueOf() > endValues.valueOf();
}; };
disabledEndDateend = (endValue) => { disabledEndDateend = (endValue) => {
const startValue = this.state.publish_time; const startValue = this.state.publish_time;
if (!endValue || !startValue) { if (!endValue || !startValue) {
return false; return false;
} }
return endValue.valueOf() <= startValue.valueOf(); var endValuesys= moment(startValue).subtract(1, 'days');
};
return endValue.valueOf() <= endValuesys.valueOf();
};
disabledEndDateendd = (endsValue) => { disabledEndDateendd = (endsValue) => {
const endValues = this.state.end_time const endValues = this.state.end_time
@ -1000,7 +1003,9 @@ class Trainingjobsetting extends Component {
if (!endsValue|| !endValues) { if (!endsValue|| !endValues) {
return false; return false;
} }
return endsValue.valueOf() <= endValues.valueOf(); var endValuesyss= moment(endValues).subtract(1, 'days');
return endsValue.valueOf() <= endValuesyss.valueOf();
}; };
@ -1156,13 +1161,15 @@ class Trainingjobsetting extends Component {
deadline:undefined, deadline:undefined,
}) })
} else { } else {
// console.log(moment(value, "YYYY-MM-DD HH:mm"));
// console.log(moment(this.state.publish_time, "YYYY-MM-DD HH:mm"));
if (moment(value, "YYYY-MM-DD HH:mm") <= moment(this.state.publish_time, "YYYY-MM-DD HH:mm")) { if (moment(value, "YYYY-MM-DD HH:mm") <= moment(this.state.publish_time, "YYYY-MM-DD HH:mm")) {
this.setState({ this.setState({
unit_e_tip: "截止时间不能早于发布时间", unit_e_tip: "截止时间不能早于发布时间",
p_flag: true, p_flag: true,
borredss:"bor-reds", borredss:"bor-reds",
end_time:undefined, end_time:value.format('YYYY-MM-DD HH:mm'),
deadline:undefined, deadline:value.format('YYYY-MM-DD HH:mm'),
}) })
return return
@ -1180,8 +1187,8 @@ class Trainingjobsetting extends Component {
// this.onChangedata('end_time', value, dateString); // this.onChangedata('end_time', value, dateString);
if(this.state.allowreplenishment === "允许补交"){ if(this.state.allowreplenishment === "允许补交"){
this.setState({ this.setState({
end_time:moment(handleDateString(dateString)).add(1, 'months'), end_time:moment(handleDateString(dateString)),
deadline:moment(handleDateString(dateString)).add(1, 'months').format('YYYY-MM-DD HH:mm'), deadline:moment(handleDateString(dateString)).format('YYYY-MM-DD HH:mm'),
late_time:moment(handleDateString(dateString)).add(2, 'months'), late_time:moment(handleDateString(dateString)).add(2, 'months'),
late_times:moment(handleDateString(dateString)).add(2, 'months').format('YYYY-MM-DD HH:mm'), late_times:moment(handleDateString(dateString)).add(2, 'months').format('YYYY-MM-DD HH:mm'),
}) })
@ -1199,7 +1206,7 @@ class Trainingjobsetting extends Component {
}) })
return; return;
} }
let{publish_time,unifiedsetting,rulesdata}=this.state; let{publish_time,end_time,unifiedsetting,rulesdata}=this.state;
if(unifiedsetting===true){ if(unifiedsetting===true){
if (moment(value, "YYYY-MM-DD HH:mm") <= moment(publish_time)) { if (moment(value, "YYYY-MM-DD HH:mm") <= moment(publish_time)) {
@ -1207,20 +1214,30 @@ class Trainingjobsetting extends Component {
hand__e_tip: "补交时间不能早于发布时间", hand__e_tip: "补交时间不能早于发布时间",
hand_flags: true, hand_flags: true,
handclass:"bor-reds", handclass:"bor-reds",
late_times:undefined, late_times:value.format('YYYY-MM-DD HH:mm'),
late_time:undefined, late_time:value.format('YYYY-MM-DD HH:mm'),
}) })
} else { }
else if (moment(value, "YYYY-MM-DD HH:mm") <= moment(end_time)) {
this.setState({
hand__e_tip: "补交时间不能早于截止时间",
hand_flags: true,
handclass:"bor-reds",
late_times: value.format('YYYY-MM-DD HH:mm'),
late_time:value.format('YYYY-MM-DD HH:mm'),
})
}
else {
try { try {
this.setState({ this.setState({
late_times: value.format('YYYY-MM-DD HH:mm'), late_times: value.format('YYYY-MM-DD HH:mm'),
late_time:value.format('YYYY-MM-DD HH:mm'),
hand__e_tip: "", hand__e_tip: "",
hand_flags: false, hand_flags: false,
handclass:"", handclass:"",
}) })
this.onChangedata('late_time', value, dateString);
}catch (e) { }catch (e) {
} }
@ -1241,11 +1258,11 @@ class Trainingjobsetting extends Component {
}else{ }else{
this.setState({ this.setState({
late_times: value.format('YYYY-MM-DD HH:mm'), late_times: value.format('YYYY-MM-DD HH:mm'),
late_time:value.format('YYYY-MM-DD HH:mm'),
hand__e_tip: "", hand__e_tip: "",
hand_flags: false, hand_flags: false,
handclass:undefined, handclass:undefined,
}) })
this.onChangedata('late_time', value, dateString);
} }
} }
@ -1622,6 +1639,19 @@ class Trainingjobsetting extends Component {
{this.props.isAdmin()?this.state.code_review===false?"": <Link {this.props.isAdmin()?this.state.code_review===false?"": <Link
to={`/courses/${this.state.props.match.params.coursesId}/${this.state.shixuntypes}/${this.state.props.match.params.homeworkid}/student_work`}>代码查重</Link> : ""} to={`/courses/${this.state.props.match.params.coursesId}/${this.state.shixuntypes}/${this.state.props.match.params.homeworkid}/student_work`}>代码查重</Link> : ""}
<style>{
`
.poll_list a.active:after {
content: '';
width: 57px;
left: 10px;
bottom: 0px;
height: 2px;
background-color: #4CACFF;
position: absolute;
}
`
}</style>
<Link className="active" <Link className="active"
to={`/courses/${this.state.props.match.params.coursesId}/${this.state.shixuntypes}/${this.state.props.match.params.homeworkid}/settings`} to={`/courses/${this.state.props.match.params.coursesId}/${this.state.shixuntypes}/${this.state.props.match.params.homeworkid}/settings`}
>设置</Link> >设置</Link>
@ -1646,7 +1676,7 @@ class Trainingjobsetting extends Component {
<div className="stud-class-set bor-bottom-greyE edu-back-white"> <div className="stud-class-set bor-bottom-greyE edu-back-white">
<div className=" mt20 pl20"> <div className=" mt20 pl20">
<p className=" clearfix "> <p className=" clearfix ">
<span className="font-16 fl "style={{"color":"#05101A"}}>发布设置 <span className="ml15 color-grey-9" style={{"font-size":"14px","text-align":"left"}}>(课堂管理员教师助教拥有设置权限)</span></span> <span className="font-16 fl "style={{"color":"#05101A"}}>发布设置 <span className="ml15 color-grey-9" style={{"font-size":"14px","text-align":"left"}}>(选中则所有分班使用相同的发布设置否则各个分班单独设置)</span></span>
{ {
!flagPageEdit && this.props.isAdmin() === true ? !flagPageEdit && this.props.isAdmin() === true ?
<a className="fr" onClick={this.editSetting}><Tooltip title="编辑"><i <a className="fr" onClick={this.editSetting}><Tooltip title="编辑"><i
@ -1714,7 +1744,6 @@ class Trainingjobsetting extends Component {
<DatePicker <DatePicker
showToday={false} showToday={false}
id={"end_timeid"} id={"end_timeid"}
disabledDate={this.disabledEndDateend}
disabledTime={disabledDateTime} disabledTime={disabledDateTime}
showTime={{ format: 'HH:mm' }} showTime={{ format: 'HH:mm' }}
className={borredss} className={borredss}
@ -1747,6 +1776,7 @@ class Trainingjobsetting extends Component {
> >
<PollDetailTabForthRules <PollDetailTabForthRules
rules={rules} rules={rules}
moduleName={"作业"}
course_group={rulest} course_group={rulest}
flagPageEdit={flagPageEdit} flagPageEdit={flagPageEdit}
rulesCheckInfo={(info)=>this.rulesCheckInfo(info)} rulesCheckInfo={(info)=>this.rulesCheckInfo(info)}
@ -1795,7 +1825,6 @@ class Trainingjobsetting extends Component {
<DatePicker <DatePicker
showToday={false} showToday={false}
id={"late_timeid"} id={"late_timeid"}
disabledDate={this.disabledEndDateendd}
disabledTime={disabledDateTime} disabledTime={disabledDateTime}
format="YYYY-MM-DD HH:mm" format="YYYY-MM-DD HH:mm"
value={late_time && moment(late_time, dataformat)} value={late_time && moment(late_time, dataformat)}
@ -1841,7 +1870,7 @@ class Trainingjobsetting extends Component {
<RadioGroup className="ml60 mt20" onChange={this.onChangeslevel} value={this.state.level}> <RadioGroup className="ml60 mt20" onChange={this.onChangeslevel} value={this.state.level}>
<Radio style={radioStyle} disabled={!flagPageEdit} className="c_grey" value={"扣分"}>按查看答案级别扣分<span <Radio style={radioStyle} disabled={!flagPageEdit} className="c_grey" value={"扣分"}>按查看答案级别扣分<span
className="color-grey-9 font-14 ml15" style={{"text-align":"left"}}>(根据学员选择查看的实训答案级别(解题思路完整答案)扣减相应的分值)</span></Radio> className="color-grey-9 font-14 ml15" style={{"text-align":"left"}}>根据学员选择查看的实训答案级别(解题思路完整答案)扣减相应的分值</span></Radio>
<Radio style={radioStyle} disabled={!flagPageEdit} className="c_grey mt15" <Radio style={radioStyle} disabled={!flagPageEdit} className="c_grey mt15"
value={"满分"}>不扣分 </Radio> value={"满分"}>不扣分 </Radio>
</RadioGroup> </RadioGroup>
@ -1855,7 +1884,7 @@ class Trainingjobsetting extends Component {
checked={this.state.completionefficiencyscore} style={{"color":"#666666"}}>效率分<span checked={this.state.completionefficiencyscore} style={{"color":"#666666"}}>效率分<span
className={"font-14 color-grey-9 font-14 ml15"} style={{"text-align":"left"}}>(选中则学生最终成绩包含效率分)</span></Checkbox> className={"font-14 color-grey-9 font-14 ml15"} style={{"text-align":"left"}}>(选中则学生最终成绩包含效率分)</span></Checkbox>
</div> </div>
<div className="ml80 mt20"> <div className="ml80 mt30">
<span className="c_grey mr10" style={{"color":"#999999"}}>分值</span> <span className="c_grey mr10" style={{"color":"#999999"}}>分值</span>
<InputNumber min={0} disabled={!flagPageEdit} max={100} className="ml10 h40 mr10 color-grey-9" <InputNumber min={0} disabled={!flagPageEdit} max={100} className="ml10 h40 mr10 color-grey-9"
style={{width: "100px","color":"#999999"}} style={{width: "100px","color":"#999999"}}
@ -1902,7 +1931,7 @@ class Trainingjobsetting extends Component {
</div> </div>
</div> </div>
{/*公开设置*/} {/*公开设置*/}
<div className="stud-class-set bor-bottom-greyE bor-top-greyE edu-back-white mt35 "> <div className="stud-class-set bor-top-greyE edu-back-white mt35 pb5 ">
<div className=" clearfix edu-back-white poll_list mt20"> <div className=" clearfix edu-back-white poll_list mt20">
<div className={"font-16 color-dark fl pl20 "} style={{"color":"#05101A"}}>公开设置</div> <div className={"font-16 color-dark fl pl20 "} style={{"color":"#05101A"}}>公开设置</div>
</div> </div>
@ -1914,7 +1943,6 @@ class Trainingjobsetting extends Component {
</div> </div>
</div> </div>

@ -427,7 +427,7 @@ class Workquestionandanswer extends Component {
</div> </div>
</div> </div>
{jobsettingsdata === undefined|| jobsettingsdata.data.description===null? "" : <div className=" clearfix edu-back-white poll_list mt20 mr20 "> {jobsettingsdata === undefined|| jobsettingsdata.data.description===null? "" : <div className=" clearfix edu-back-white poll_list mt20 mr20 ">
<span> <span>
<div className={"font-16 color-dark fl pl20 "}> <div className={"font-16 color-dark fl pl20 "}>
<div dangerouslySetInnerHTML={{__html: markdownToHTML(jobsettingsdata.data.description).replace(/▁/g,"▁▁▁")}}></div> <div dangerouslySetInnerHTML={{__html: markdownToHTML(jobsettingsdata.data.description).replace(/▁/g,"▁▁▁")}}></div>
@ -466,8 +466,8 @@ class Workquestionandanswer extends Component {
<span> <span>
<div className="font-16 color-dark break_word flex1 pl20 " style={{"padding":"10px 10px 10px 20px"}}> <div className="font-16 color-dark break_word flex1 pl20 " style={{"padding":"10px 10px 10px 20px"}}>
{jobsettingsdata === undefined ? "" : jobsettingsdata === null ? "" : jobsettingsdata === "null" ? "" : {jobsettingsdata === undefined ? "" : jobsettingsdata === null ? "" : jobsettingsdata === "null" ? "" :
jobsettingsdata.data.explanation=== undefined?"" :jobsettingsdata.data.explanation=== null?"": jobsettingsdata.data.explanation=== undefined?"" :jobsettingsdata.data.explanation=== null?"":
<div dangerouslySetInnerHTML={{__html:markdownToHTML(jobsettingsdata.data.explanation).replace(/▁/g,"▁▁▁")}}></div> <div dangerouslySetInnerHTML={{__html:markdownToHTML(jobsettingsdata.data.explanation).replace(/▁/g,"▁▁▁")}}></div>
} }
</div> </div>

@ -61,6 +61,7 @@ h4{ font-size:14px;}/*color:#3b3b3b;*/
.lh24{line-height:24px;} .lh24{line-height:24px;}
.lh26{line-height:26px;} .lh26{line-height:26px;}
.lh27{line-height:27px;} .lh27{line-height:27px;}
.lh38{line-height: 38px !important;}
.fmYh{font-family:"微软雅黑";} .fmYh{font-family:"微软雅黑";}
.font999{ color:#999;} .font999{ color:#999;}
.fontRed{color:#770000;} .fontRed{color:#770000;}

Loading…
Cancel
Save