Conflicts:
	public/react/src/AppConfig.js
	public/react/src/modules/courses/graduation/tasks/GraduationTasksappraise.js
dev_forum
caishi 6 years ago
commit 7cd8b09b14

@ -3,10 +3,9 @@
"version": "0.1.0", "version": "0.1.0",
"private": true, "private": true,
"dependencies": { "dependencies": {
"@novnc/novnc": "^1.1.0",
"@flatten/array": "^1.1.7", "@flatten/array": "^1.1.7",
"@icedesign/base": "^0.2.5", "@icedesign/base": "^0.2.5",
"@novnc/novnc": "^1.1.0",
"antd": "^3.6.5", "antd": "^3.6.5",
"array-flatten": "^2.1.2", "array-flatten": "^2.1.2",
"autoprefixer": "7.1.6", "autoprefixer": "7.1.6",
@ -41,6 +40,7 @@
"fs-extra": "3.0.1", "fs-extra": "3.0.1",
"html-webpack-plugin": "2.29.0", "html-webpack-plugin": "2.29.0",
"immutability-helper": "^2.6.6", "immutability-helper": "^2.6.6",
"install": "^0.12.2",
"jest": "20.0.4", "jest": "20.0.4",
"js-file-download": "^0.4.7", "js-file-download": "^0.4.7",
"lodash": "^4.17.5", "lodash": "^4.17.5",

@ -296,7 +296,7 @@ label.infolabel{display: block;float: left;width: 56px;text-align: right;margin-
.subshaicontent a{float: left;margin-right: 20px;color: #999;cursor: pointer} .subshaicontent a{float: left;margin-right: 20px;color: #999;cursor: pointer}
.search-new{width: 248px;height:32px;position: relative} .search-new{width: 248px;height:32px;position: relative;margin-right: 35px;}
.search-span{display: block;position: absolute;width: 100%;height: 100%;left:0px;top:0px;background-color: #F4F4F4;border: 1px solid #EAEAEA; border-radius: 4px;z-index: 1} .search-span{display: block;position: absolute;width: 100%;height: 100%;left:0px;top:0px;background-color: #F4F4F4;border: 1px solid #EAEAEA; border-radius: 4px;z-index: 1}
.search-new-input{height: 32px;padding-left: 5px;width: 225px;border: none;box-sizing: border-box;background: none;outline: none;position: absolute;left:0px;top:1px;z-index: 2} .search-new-input{height: 32px;padding-left: 5px;width: 225px;border: none;box-sizing: border-box;background: none;outline: none;position: absolute;left:0px;top:1px;z-index: 2}
.search-new img,.search-new a,.search-new .searchicon{cursor: pointer;position: absolute;right:2px;top:2px;z-index: 2} .search-new img,.search-new a,.search-new .searchicon{cursor: pointer;position: absolute;right:2px;top:2px;z-index: 2}

@ -4,6 +4,7 @@ import axios from 'axios';
import { requestProxy } from "./indexEduplus2RequestProxy"; import { requestProxy } from "./indexEduplus2RequestProxy";
import { broadcastChannelOnmessage } from 'educoder' import { broadcastChannelOnmessage } from 'educoder'
import { notification } from 'antd'; import { notification } from 'antd';
import './index.css'
broadcastChannelOnmessage('refreshPage', () => { broadcastChannelOnmessage('refreshPage', () => {
window.location.reload() window.location.reload()
}) })
@ -30,8 +31,7 @@ export function initAxiosInterceptors(props) {
// proxy = "http://testbdweb.trustie.net" // proxy = "http://testbdweb.trustie.net"
// proxy = "http://testbdweb.educoder.net" // proxy = "http://testbdweb.educoder.net"
proxy = "https://testeduplus2.educoder.net" proxy = "https://testeduplus2.educoder.net"
proxy = "http://47.96.87.25:48080" //proxy="http://47.96.87.25:48080"
// 在这里使用requestMap控制避免用户通过双击等操作发出重复的请求 // 在这里使用requestMap控制避免用户通过双击等操作发出重复的请求
// 如果需要支持重复的请求考虑config里面自定义一个allowRepeat参考来控制 // 如果需要支持重复的请求考虑config里面自定义一个allowRepeat参考来控制
@ -115,7 +115,9 @@ export function initAxiosInterceptors(props) {
notification.open({ notification.open({
message:"提示", message:"提示",
description: response.data.message || '服务器异常,请联系管理员。', description: response.data.message || '服务器异常,请联系管理员。',
style: {
zIndex: 99999999
},
}); });
// notification['error']({ // notification['error']({
// message:"提示", // message:"提示",

@ -1,7 +1,19 @@
/**
EDU_ADMIN = 1 # 超级管理员
EDU_BUSINESS = 2 # 运营人员
EDU_SHIXUN_MANAGER = 3 # 实训管理员
EDU_SHIXUN_MEMBER = 4 # 实训成员
EDU_CERTIFICATION_TEACHER = 5 # 平台认证的老师
EDU_GAME_MANAGER = 6 # TPI的创建者
EDU_TEACHER = 7 # 平台老师,但是未认证
EDU_NORMAL = 8 # 普通用户
*/
export const EDU_ADMIN = 1 // 超级管理员 export const EDU_ADMIN = 1 // 超级管理员
export const EDU_SHIXUN_MANAGER = 2 // 实训管理员 export const EDU_BUSINESS = 2 // # 运营人员
export const EDU_SHIXUN_MEMBER = 3 // 实训成员 export const EDU_SHIXUN_MANAGER = 3 // 实训管理员
export const EDU_CERTIFICATION_TEACHER = 4 // 平台认证的老师 export const EDU_SHIXUN_MEMBER = 4 // 实训成员
export const EDU_GAME_MANAGER = 5 // TPI的创建者 export const EDU_CERTIFICATION_TEACHER = 5 // 平台认证的老师
export const EDU_TEACHER = 6 // 平台老师,但是未认证 export const EDU_GAME_MANAGER = 6 // TPI的创建者
export const EDU_NORMAL = 7 // 普通用户 export const EDU_TEACHER = 7 // 平台老师,但是未认证
export const EDU_NORMAL = 8 // 普通用户

@ -24,7 +24,7 @@ export { toStore as toStore, fromStore as fromStore } from './Store'
export { trace_collapse, trace, debug, info, warn, error, trace_c, debug_c, info_c, warn_c, error_c } from './LogUtil' export { trace_collapse, trace, debug, info, warn, error, trace_c, debug_c, info_c, warn_c, error_c } from './LogUtil'
export { EDU_ADMIN, EDU_SHIXUN_MANAGER, EDU_SHIXUN_MEMBER, EDU_CERTIFICATION_TEACHER export { EDU_ADMIN, EDU_BUSINESS, EDU_SHIXUN_MANAGER, EDU_SHIXUN_MEMBER, EDU_CERTIFICATION_TEACHER
, EDU_GAME_MANAGER, EDU_TEACHER, EDU_NORMAL} from './Const' , EDU_GAME_MANAGER, EDU_TEACHER, EDU_NORMAL} from './Const'
export { ModalHOC } from './components/ModalHOC' export { ModalHOC } from './components/ModalHOC'

@ -32,7 +32,7 @@ import _ from 'lodash'
import TPIContext from './TPIContext' import TPIContext from './TPIContext'
import { EDU_ADMIN, EDU_SHIXUN_MANAGER, EDU_SHIXUN_MEMBER, EDU_CERTIFICATION_TEACHER import { EDU_ADMIN, EDU_SHIXUN_MANAGER, EDU_SHIXUN_MEMBER, EDU_CERTIFICATION_TEACHER
, EDU_GAME_MANAGER, EDU_TEACHER, EDU_NORMAL} from 'educoder' , EDU_GAME_MANAGER, EDU_TEACHER, EDU_NORMAL, EDU_BUSINESS} from 'educoder'
import { MuiThemeProvider, createMuiTheme, withStyles } from 'material-ui/styles'; import { MuiThemeProvider, createMuiTheme, withStyles } from 'material-ui/styles';
import MUIDialogStyleUtil from '../modules/page/component/MUIDialogStyleUtil' import MUIDialogStyleUtil from '../modules/page/component/MUIDialogStyleUtil'
@ -447,6 +447,18 @@ pop_box_new(htmlvalue, 480, 182);
// const EDU_TEACHER = 6 // 平台老师,但是未认证 // const EDU_TEACHER = 6 // 平台老师,但是未认证
// const EDU_NORMAL = 7 // 普通用户 // const EDU_NORMAL = 7 // 普通用户
/**
EDU_ADMIN = 1 # 超级管理员
EDU_BUSINESS = 2 # 运营人员
EDU_SHIXUN_MANAGER = 3 # 实训管理员
EDU_SHIXUN_MEMBER = 4 # 实训成员
EDU_CERTIFICATION_TEACHER = 5 # 平台认证的老师
EDU_GAME_MANAGER = 6 # TPI的创建者
EDU_TEACHER = 7 # 平台老师,但是未认证
EDU_NORMAL = 8 # 普通用户
*/
// myshixun_manager power is_teacher // myshixun_manager power is_teacher
resData.power = 0 resData.power = 0
resData.myshixun_manager = false resData.myshixun_manager = false
@ -455,6 +467,9 @@ pop_box_new(htmlvalue, 480, 182);
if (resData.user.identity === EDU_ADMIN) { if (resData.user.identity === EDU_ADMIN) {
resData.power = 1 resData.power = 1
resData.myshixun_manager = true resData.myshixun_manager = true
} else if (resData.user.identity === EDU_BUSINESS) {
resData.power = 1
resData.myshixun_manager = true
} else if (resData.user.identity === EDU_SHIXUN_MANAGER) { } else if (resData.user.identity === EDU_SHIXUN_MANAGER) {
resData.power = 1 resData.power = 1
resData.myshixun_manager = true resData.myshixun_manager = true
@ -820,7 +835,7 @@ pop_box_new(htmlvalue, 480, 182);
{this.state.gDialogContentText} {this.state.gDialogContentText}
</DialogContentText> </DialogContentText>
</DialogContent> </DialogContent>
<DialogActions id="dialog-actions"> <DialogActions className={"mb20"} id="dialog-actions">
{ this.isSingleButton ? <div className="task-popup-submit clearfix" { this.isSingleButton ? <div className="task-popup-submit clearfix"
style={{ textAlign: 'center' }}> style={{ textAlign: 'center' }}>
<a className="task-btn task-btn-orange" <a className="task-btn task-btn-orange"

@ -34,3 +34,6 @@ body {
.anticon anticon-paper-clip{ .anticon anticon-paper-clip{
color: #29bd8b !important; color: #29bd8b !important;
} }
.notificationmystyle{
z-index: 99999999;
}

@ -180,6 +180,12 @@ class CommonWorkAppraise extends Component{
</div> */} </div> */}
<div className={" "} style={{}}> <div className={" "} style={{}}>
<style>{`
.workAppraise>div:last-child {
border-bottom: none !important;
}
`}</style>
<div className={"workAppraise"}>
{(description || (attachments && attachments.length != 0)) && <div className={"stud-class-set bor-bottom-greyE edu-back-white"} style={{ padding: '20px 20px 20px 20px'}}> {(description || (attachments && attachments.length != 0)) && <div className={"stud-class-set bor-bottom-greyE edu-back-white"} style={{ padding: '20px 20px 20px 20px'}}>
<div className={"color-grey-6 h20 mb20 font-16"}> <div className={"color-grey-6 h20 mb20 font-16"}>
内容 内容
@ -209,7 +215,7 @@ class CommonWorkAppraise extends Component{
{ update_time && { update_time &&
<React.Fragment> <React.Fragment>
<span className={"color9B9B fr"}>更新</span> <span className={"color9B9B fr"}>更新</span>
<span className={"fr font-13 mr10 ml10"}>{update_user_name}</span> <span className={"fr font-14 mr10 ml10"}>{update_user_name}</span>
<span className={"color9B9B fr"}> <span className={"color9B9B fr"}>
{moment(update_time).format('YYYY-MM-DD HH:mm')==="Invalid date"?"":moment(update_time).format('YYYY-MM-DD HH:mm')} {moment(update_time).format('YYYY-MM-DD HH:mm')==="Invalid date"?"":moment(update_time).format('YYYY-MM-DD HH:mm')}
</span> </span>
@ -218,7 +224,7 @@ class CommonWorkAppraise extends Component{
{ commit_time && { commit_time &&
<React.Fragment> <React.Fragment>
<span className={"color9B9B fr mr30"}>提交</span> <span className={"color9B9B fr mr30"}>提交</span>
<span className={"fr font-13 mr10 ml10"}>{author_name}</span> <span className={"fr font-14 mr10 ml10"}>{author_name}</span>
<span className={" color9B9B fr"}> <span className={" color9B9B fr"}>
{moment(commit_time).format('YYYY-MM-DD HH:mm')==="Invalid date"?"":moment(commit_time).format('YYYY-MM-DD HH:mm')} {moment(commit_time).format('YYYY-MM-DD HH:mm')==="Invalid date"?"":moment(commit_time).format('YYYY-MM-DD HH:mm')}
</span> </span>
@ -286,6 +292,7 @@ class CommonWorkAppraise extends Component{
</div> </div>
</div> </div>
} }
</div>
{/* task_type={datalist&&datalist.task_type} */} {/* task_type={datalist&&datalist.task_type} */}

@ -8,7 +8,6 @@ import { WordsBtn } from 'educoder'
import AccessoryModal2 from '../coursesPublic/AccessoryModal2' import AccessoryModal2 from '../coursesPublic/AccessoryModal2'
import AccessoryModal from '../coursesPublic/AccessoryModal' import AccessoryModal from '../coursesPublic/AccessoryModal'
import axios from 'axios' import axios from 'axios'
import ConnectProject from './ConnectProject'
class CommonWorkItem extends Component{ class CommonWorkItem extends Component{
constructor(props){ constructor(props){
super(props); super(props);
@ -98,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
@ -128,7 +134,7 @@ class CommonWorkItem extends Component{
} }
</style> </style>
{ {
mainList && mainList.homeworks.length>0 && mainList.homeworks.map((item,index)=>{ mainList && mainList.homeworks && mainList.homeworks.length>0 && mainList.homeworks.map((item,index)=>{
let canNotLink = !isAdminOrStudent && item.private_icon == true let canNotLink = !isAdminOrStudent && item.private_icon == true
return( return(
<div className="mt20 edu-back-white padding02010" key={index} > <div className="mt20 edu-back-white padding02010" key={index} >
@ -196,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 &&
<ConnectProject className="fl" {...this.props} work={item}></ConnectProject> <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 &&

@ -31,7 +31,9 @@ function renderScore(score, content) {
} else if (score >= 60) { } else if (score >= 60) {
color = '#FF6800' color = '#FF6800'
} }
return <a href="javascript:;" style={{ color, minWidth: '30px', display: 'inline-block', textAlign: 'center' }}>{score == '--' ? '--': (content || score)}</a> return <a href="javascript:;" style={{ color, minWidth: '30px', display: 'inline-block', textAlign: 'center' }}>
{score == null || score == undefined || score == '--' ? '--': (content || score)}
</a>
} }
function getScoreTip(score, dom) { function getScoreTip(score, dom) {
return score == '--' ? '未评分' : score == '**' ? '未公开' : dom return score == '--' ? '未评分' : score == '**' ? '未公开' : dom
@ -47,9 +49,14 @@ function buildColumns(that, student_works) {
} }
let courseId= that.props.match.params.coursesId; let courseId= that.props.match.params.coursesId;
let workId= that.props.match.params.workId; let workId= that.props.match.params.workId;
const { course_group_count } = that.state; const { course_group_count, homework_status } = that.state;
const isAdmin = that.props.isAdmin() const isAdmin = that.props.isAdmin()
const isAdminOrStudent = that.props.isAdminOrStudent() const isAdminOrStudent = that.props.isAdminOrStudent()
const isStudent = that.props.isStudent()
const isNiPing = homework_status && homework_status.indexOf('匿评中') != -1
// https://www.trustie.net/issues/21450 分组作业作品列表 学时视角,匿评阶段的列表显示信息不正确
const niPingAndIsStudent = isStudent && isNiPing
let columns = [{ let columns = [{
width: 60, width: 60,
title: '序号', title: '序号',
@ -76,8 +83,10 @@ function buildColumns(that, student_works) {
{text} {text}
</div> </div>
), ),
}, { }]
width: 180, if (!niPingAndIsStudent) {
columns.push({
width: 88,
title: '学号', title: '学号',
dataIndex: 'student_id', dataIndex: 'student_id',
key: 'student_id', key: 'student_id',
@ -87,10 +96,11 @@ function buildColumns(that, student_works) {
<a href="javascript:;" style={{color:'#9A9A9A'}}>{record.student_id}</a> <a href="javascript:;" style={{color:'#9A9A9A'}}>{record.student_id}</a>
</span> </span>
), ),
}] })
}
// TODO 只有有分班时才显示分班列 // TODO 只有有分班时才显示分班列
if (course_group_count != 0) { if (course_group_count != 0 && !niPingAndIsStudent) {
columns.push( { columns.push( {
title: '分班', title: '分班',
key: 'group_name', key: 'group_name',
@ -103,7 +113,7 @@ function buildColumns(that, student_works) {
), ),
} ) } )
} }
if (gotWorkGroup) { if (gotWorkGroup && !niPingAndIsStudent) {
columns.push({ columns.push({
width: 72, width: 72,
title: '分组', title: '分组',
@ -144,7 +154,7 @@ function buildColumns(that, student_works) {
</span> </span>
)}, )},
}, { }, {
width: 133, width: 150,
title: '更新时间', title: '更新时间',
dataIndex: 'update_time', dataIndex: 'update_time',
key: 'update_time', key: 'update_time',
@ -154,7 +164,9 @@ function buildColumns(that, student_works) {
<a href="javascript:;" style={{color:'#989898'}}>{update_time ? moment(update_time).format('YYYY-MM-DD hh:mm') : '--'}</a> <a href="javascript:;" style={{color:'#989898'}}>{update_time ? moment(update_time).format('YYYY-MM-DD hh:mm') : '--'}</a>
</span> </span>
), ),
}, { }])
if (!niPingAndIsStudent) {
columns.push({
width: 72, width: 72,
title: '教师评分', title: '教师评分',
key: 'teacher_score', key: 'teacher_score',
@ -168,14 +180,16 @@ function buildColumns(that, student_works) {
</span> </span>
</Tooltip> </Tooltip>
), ),
}, { })
columns.push({
width: 72, width: 72,
title: '助教评分', title: '助教评分',
key: 'teaching_asistant_score', key: 'teaching_asistant_score',
dataIndex: 'teaching_asistant_score', dataIndex: 'teaching_asistant_score',
/** /**
* 2名助教进行了评分 * 2名助教进行了评分
平均分85.0 平均分85.0
* *
*/ */
render: (teaching_asistant_score, record) => ( render: (teaching_asistant_score, record) => (
@ -192,7 +206,10 @@ function buildColumns(that, student_works) {
</Tooltip> } </Tooltip> }
</span> </span>
), ),
}]) })
}
if (that.state.anonymous_comment) { if (that.state.anonymous_comment) {
/** /**
@ -211,7 +228,7 @@ function buildColumns(that, student_works) {
<Tooltip title={ <Tooltip title={
getScoreTip(student_score, getScoreTip(student_score,
<div> <div>
<div>{`${record.student_comment_count}名学生进行了匿评`}</div> {record.student_comment_count && <div>{`${record.student_comment_count}名学生进行了匿评`}</div>}
<div>有效平均分{record.student_score}</div> <div>有效平均分{record.student_score}</div>
</div> </div>
) )
@ -235,14 +252,15 @@ function buildColumns(that, student_works) {
{ !!appeal_all_count && { !!appeal_all_count &&
<Tooltip placement="bottom" title={`共有${appeal_all_count}条匿评申诉,${record.appeal_deal_count}条待处理`}> <Tooltip placement="bottom" title={`共有${appeal_all_count}条匿评申诉,${record.appeal_deal_count}条待处理`}>
<span style={{ minWidth: '30px', display: 'inline-block', textAlign: 'center' }}> <span style={{ minWidth: '30px', display: 'inline-block', textAlign: 'center' }}>
{`${appeal_all_count}/${record.appeal_deal_count}`} {`${record.appeal_deal_count}/${appeal_all_count}`}
</span> </span>
</Tooltip> } </Tooltip> }
{ !appeal_all_count && '-/-'}
</span> </span>
), ),
}) })
} }
if (!niPingAndIsStudent) {
columns.push({ columns.push({
width: 72, width: 72,
title: '最终成绩', title: '最终成绩',
@ -272,6 +290,7 @@ function buildColumns(that, student_works) {
) )
}, },
}) })
}
if (isAdminOrStudent || that.props.work_public == true) { if (isAdminOrStudent || that.props.work_public == true) {
columns.push({ columns.push({
width: 92, width: 92,

@ -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:"大于",

@ -101,14 +101,13 @@ class CommonWorkQuestion extends Component{
{isGroup && <div className="df mt10"> {isGroup && <div className="df mt10">
<div style={{flex: '0 0 160px'}}> <div style={{flex: '0 0 160px'}}>
<div>分组要求</div> <div>分组要求 {group_info.min_num} ~ {group_info.max_num}</div>
<div>分组人数 {group_info.min_num} - {group_info.max_num} </div> <div>{group_info.base_on_project ? '基于项目实施' : '不基于项目'}</div>
<div>{group_info.base_on_project ? '基于项目实施' : '不基于项目实施'}</div>
</div> </div>
<div style={{color: '#9B9B9B'}}> <div style={{color: '#9B9B9B'}}>
<div>提交作品时需要关联同组成员组内成员作品共享</div> <div>学生提交作品时需要关联同组成员组内成员作品共享</div>
<div>{group_info.base_on_project ? '基于项目,则项目管理员角色的成员可以提交作品' : '非基于项目,则任意小组成员可以提交作品'}</div> <div>{group_info.base_on_project ? '学生必须在本平台创建项目,项目管理员可以提交作品' : '无需再平台创建项目,任意小组成员均可以提交作品'}</div>
<div>各小组必须在educoder平台创建项目</div> {/* <div>各小组必须在educoder平台创建项目</div> */}
</div> </div>
</div>} </div>}

@ -259,15 +259,20 @@ class CommonWorkSetting extends Component{
unified_setting: checked unified_setting: checked
}) })
} }
// 启用匿评
anonymous_comment_change = (e) => { anonymous_comment_change = (e) => {
const checked = e.target.checked; const checked = e.target.checked;
const { end_time } = this.state; const currentEndTime = this._getCurrentEndTime()
let evaluation_start, evaluation_end, evaluation_num = 0, absence_penalty = 0; let evaluation_start, evaluation_end, evaluation_num = 0, absence_penalty = 0;
if (checked) { if (checked) {
if (end_time) { if (currentEndTime) {
evaluation_start = moment(end_time).add(7, 'days').format(dateFormat) evaluation_start = moment(currentEndTime).add(7, 'days').format(dateFormat)
evaluation_end = moment(end_time).add(21, 'days').format(dateFormat) evaluation_end = moment(currentEndTime).add(21, 'days').format(dateFormat)
}
if (!this.state.evaluation_num) {
evaluation_num = 3 evaluation_num = 3
}
if (!this.state.absence_penalty) {
absence_penalty = 2 absence_penalty = 2
} }
} else { } else {
@ -310,6 +315,7 @@ class CommonWorkSetting extends Component{
absence_penalty:value absence_penalty:value
}) })
} }
// 启用匿评申诉
anonymous_appeal_change = (e) => { anonymous_appeal_change = (e) => {
const { evaluation_end } = this.state; const { evaluation_end } = this.state;
const anonymous_appeal = e.target.checked const anonymous_appeal = e.target.checked
@ -389,9 +395,10 @@ class CommonWorkSetting extends Component{
this.setState({ this.setState({
late_penalty: 5 late_penalty: 5
}) })
if (this.state.end_time && !this.state.late_time) { const currentEndTime = this._getCurrentEndTime();
if (currentEndTime && !this.state.late_time) {
this.setState({ this.setState({
late_time: moment(handleDateString(this.state.end_time)).add(1, 'months').format(dateFormat) late_time: moment(handleDateString(currentEndTime)).add(1, 'months').format(dateFormat)
}) })
} }
} }
@ -469,6 +476,20 @@ class CommonWorkSetting extends Component{
// } // }
} }
_getCurrentEndTime = () => {
const { unified_setting, end_time, rules } = this.state;
if (unified_setting) {
return end_time
} else {
let max_un_unified_setting_end_time = null;
rules.map(item => {
if (!max_un_unified_setting_end_time || moment(item.end_time) > moment(max_un_unified_setting_end_time)) {
max_un_unified_setting_end_time = item.end_time;
}
})
return max_un_unified_setting_end_time
}
}
saveWorkSetting=()=>{ saveWorkSetting=()=>{
let workId=this.props.match.params.workId; let workId=this.props.match.params.workId;
@ -524,8 +545,8 @@ class CommonWorkSetting extends Component{
let temp_publish_time let temp_publish_time
let temp_end_time let temp_end_time
if (unified_setting) { if (unified_setting) {
let temp_publish_time = publish_time temp_publish_time = publish_time
let temp_end_time = end_time temp_end_time = end_time
if (!temp_publish_time) { if (!temp_publish_time) {
const publish_time_moment = getNextHalfHourOfMoment(moment()); const publish_time_moment = getNextHalfHourOfMoment(moment());
temp_publish_time = publish_time_moment.format(dateFormat); temp_publish_time = publish_time_moment.format(dateFormat);
@ -1077,6 +1098,7 @@ class CommonWorkSetting extends Component{
course_group={adaptered_group_settings} course_group={adaptered_group_settings}
rulesCheckInfo={(info)=>this.rulesCheckInfo(info)} rulesCheckInfo={(info)=>this.rulesCheckInfo(info)}
flagPageEdit={true} flagPageEdit={true}
moduleName="作业"
></PollDetailTabForthRules> ></PollDetailTabForthRules>
} }
@ -1254,7 +1276,7 @@ class CommonWorkSetting extends Component{
margin-left: 18px; margin-left: 18px;
} }
`}</style> `}</style>
<PopInstruction width={448} id={1}> <PopInstruction width={458} id={1}>
<p className="font-14 edu-txt-left pop-instruction"> <p className="font-14 edu-txt-left pop-instruction">
允许学生对自己作品的匿评评分进行申诉由教师和助教处理申诉<br/> 允许学生对自己作品的匿评评分进行申诉由教师和助教处理申诉<br/>
@ -1297,7 +1319,7 @@ class CommonWorkSetting extends Component{
</span> </span>
</Tooltip> </Tooltip>
<span className={"font-14 color-grey-9 ml10"}></span> <span className={"font-14 color-grey-9 ml10"}>学生提交匿评申诉的时间截点</span>
</div> </div>
{<div className={" appeal_time_tip color-red ml60 mb6"}>{appeal_time_tip}</div>} {<div className={" appeal_time_tip color-red ml60 mb6"}>{appeal_time_tip}</div>}
@ -1311,7 +1333,7 @@ class CommonWorkSetting extends Component{
/> />
</span> </span>
</Tooltip> </Tooltip>
<span className={"font-14 color-grey-9 ml10"}></span> <span className={"font-14 color-grey-9 ml10"}>学生违规匿评TA人作品时其成绩将被扣减的分值</span>
</div> </div>
{this.state.appeal_penalty_tip && <div className={" appeal_penalty_tip color-red ml60"} style={{marginTop: '-6px'}}>{this.state.appeal_penalty_tip}</div>} {this.state.appeal_penalty_tip && <div className={" appeal_penalty_tip color-red ml60"} style={{marginTop: '-6px'}}>{this.state.appeal_penalty_tip}</div>}
@ -1346,21 +1368,17 @@ class CommonWorkSetting extends Component{
<RadioGroup onChange={this.final_mode_change} value={final_mode}> <RadioGroup onChange={this.final_mode_change} value={final_mode}>
<Radio style={radioStyle} value={false} disabled={noAuth}> <Radio style={radioStyle} value={false} disabled={noAuth}>
多项评分配比<span className={"font-14 color-grey-9 ml10"}>选中则按照比例计算最终成绩</span> 多项评分配比<span className={"font-14 color-grey-9 ml10"}>选中则按照比例计算最终成绩</span>
<PopInstruction width={500} id={2}> <PopInstruction width={512} id={2}>
<p className="font-14 edu-txt-left pop-instruction"> <p className="font-14 edu-txt-left pop-instruction">
计算说明<br/> 计算说明<br/>
优先顺序排前的非零评分 * 100% - <br/> 教师评分 * 其百分比 + 助教评分 * 其百分比 + 学生匿评平均分 * 其百分比 - ( <br/>
( 迟交扣分 + 缺评扣分 * 缺评数 + 违规匿评扣分 * 违规匿评数 )<br/> 迟交扣分 + 缺评扣分 * 缺评数 + 违规匿评扣分 * 违规匿评数 )<br/><br/>
有教师评分则教师评分100%否则教辅评分100%依次类推
{/* 教师评分 * 其百分比 + 助教评分 * 其百分比 + 学生匿评平均分 * 其百分比 - <br/>
( 迟交扣分 + 缺评扣分 * 缺评数 + 违规匿评扣分 * 违规匿评数 )<br/>
<br/>
注意<br/> 注意<br/>
非零百分比的评分选项在没有评分记录的情况下其百分比平摊到另外的评<br/> 非零百分比的评分选项若评分记录为空则其百分比将自动平摊到其它非零<br/>
分选项上例如教师评分40% + 助教评分35% + 学生匿评25%学生A没<br/> 评分选项上<br/>
有得到教师评分则最终成绩将按照助教评分55% + 学生匿评45%进行计算 */} 教师评分40% + 助教评分35% + 学生匿评25%学生A没有教师评分记<br/>
则其最终成绩按照助教评分55% + 学生匿评45%进行计算
</p> </p>
</PopInstruction> </PopInstruction>
@ -1392,12 +1410,30 @@ class CommonWorkSetting extends Component{
{<div className={"color-red ml30 final_mode_false_tip"}>{final_mode_false_tip}</div>} {<div className={"color-red ml30 final_mode_false_tip"}>{final_mode_false_tip}</div>}
<Radio style={radioStyle} value={true} disabled={noAuth}> <Radio style={radioStyle} value={true} disabled={noAuth}>
单项评分优先<span className={"font-14 color-grey-9 ml10"}>选中则按照优先顺序计算最终成绩</span> 单项评分优先<span className={"font-14 color-grey-9 ml10"}>选中则按照优先顺序计算最终成绩</span>
<PopInstruction width={500} id={3}>
<p className="font-14 edu-txt-left pop-instruction">
计算说明<br/>
优先顺序排前的非零评分 * 100% - <br/>
( 迟交扣分 + 缺评扣分 * 缺评数 + 违规匿评扣分 * 违规匿评数 )<br/>
有教师评分则教师评分100%否则教辅评分100%依次类推
{/* 教师评分 * 其百分比 + 助教评分 * 其百分比 + 学生匿评平均分 * 其百分比 - <br/>
( 迟交扣分 + 缺评扣分 * 缺评数 + 违规匿评扣分 * 违规匿评数 )<br/>
<br/>
注意<br/>
非零百分比的评分选项在没有评分记录的情况下其百分比平摊到另外的评<br/>
分选项上例如教师评分40% + 助教评分35% + 学生匿评25%学生A没<br/>
有得到教师评分则最终成绩将按照助教评分55% + 学生匿评45%进行计算 */}
</p>
</PopInstruction>
</Radio> </Radio>
</RadioGroup> </RadioGroup>
<div className={"font-16"} style={{ marginLeft: '25px' }}> <div className={"font-16"} style={{ marginLeft: '25px' }}>
<span>教师评分 教辅评分 学生匿评评分</span> <span>教师评分 教辅评分 学生匿评评分</span>
<span className={"font-14 color-grey-9 ml10"}>有教师评分则教师评分100%否则教辅评分100%依次类推 </span> {/* <span className={"font-14 color-grey-9 ml10"}>有教师评分则教师评分100%否则教辅评分100%,依次类推 </span> */}
</div> </div>
</div> </div>

@ -5,6 +5,7 @@ import '../css/members.css'
import { WordsBtn } from 'educoder' import { WordsBtn } from 'educoder'
import axios from 'axios' import axios from 'axios'
import InfiniteScroll from 'react-infinite-scroller'; import InfiniteScroll from 'react-infinite-scroller';
import NoneData from "../coursesPublic/NoneData"
const Search =Input.Search; const Search =Input.Search;
const LIMIT = 15 const LIMIT = 15
@ -36,13 +37,14 @@ class ConnectProject extends Component{
this.connectProject(radioValue) this.connectProject(radioValue)
} }
connectProject = (project_id) => { connectProject = (project_id) => {
let workId=this.props.work.homework_id; let workId=this.work.homework_id;
const url = `/homework_commons/${workId}/student_works/relate_project.json` const url = `/homework_commons/${workId}/student_works/relate_project.json`
axios.post(url, { axios.post(url, {
project_id: project_id project_id: project_id
}).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)=>{
@ -75,6 +77,9 @@ class ConnectProject extends Component{
loading: false, loading: false,
hasMore: result.data.projects.length != 0 hasMore: result.data.projects.length != 0
}) })
if (page == 1) {
this.setState({ haveProjects: result.data.projects.length > 0 })
}
} }
}).catch((error)=>{ }).catch((error)=>{
console.log(error); console.log(error);
@ -84,11 +89,12 @@ class ConnectProject extends Component{
if (window.location.port == 3007) { if (window.location.port == 3007) {
window.location.href = '/testbdweb.educoder.net/projects/new' window.location.href = '/testbdweb.educoder.net/projects/new'
} else { } else {
window.location.href = '/educoder.net/projects/new' window.location.href = '/projects/new'
} }
} }
//关联项目 //关联项目
openConnectionProject=()=>{ openConnectionProject=(work)=>{
this.work = work;
this.fetchData() this.fetchData()
this.setState({ this.setState({
project_flag:true project_flag:true
@ -104,10 +110,9 @@ class ConnectProject extends Component{
} }
render(){ render(){
let {project_flag, projects, loading, hasMore }=this.state; let {project_flag, projects, loading, hasMore, haveProjects }=this.state;
return( return(
<React.Fragment> <React.Fragment>
<WordsBtn style="blue" className={` font-16 ${this.props.className || ''}`} onClick={this.openConnectionProject}>关联项目</WordsBtn>
<Modal <Modal
visible={project_flag} visible={project_flag}
title="关联项目" title="关联项目"
@ -118,16 +123,33 @@ 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 && (projects && !!projects.length || this.state.keyword) &&
<div> <div>
<Search placeholder="请输入项目名称进行搜索" className="with100" <Search placeholder="请输入项目名称进行搜索" className="with100"
value={this.state.keyword} onInput={(e) => {this.setState({keyword: e.target.value})}} value={this.state.keyword} onInput={(e) => {this.setState({keyword: e.target.value})}}
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}
@ -137,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>
@ -145,7 +169,11 @@ class ConnectProject extends Component{
</div> </div>
} }
{ {
(!projects || projects.length == 0) && haveProjects && projects.length == 0 &&
<NoneData></NoneData>
}
{
(!haveProjects) &&
<div className="edu-txt-center"> <div className="edu-txt-center">
您当前尚未管理任何项目请先<WordsBtn style="blue" className="" onClick={this.toCreateProject}>创建项目</WordsBtn> 您当前尚未管理任何项目请先<WordsBtn style="blue" className="" onClick={this.toCreateProject}>创建项目</WordsBtn>
</div> </div>

@ -75,12 +75,6 @@ class CoursesWorkIndex extends Component{
(props) => (<CommonWorkDetailIndex {...this.props} {...props} {...this.state} />) (props) => (<CommonWorkDetailIndex {...this.props} {...props} {...this.state} />)
} }
></Route> ></Route>
<Route exact path="/courses/:coursesId/common_homeworks/new"
render={
(props) => (<NewWork {...this.props} {...props} {...this.state} />)
}
></Route>
{/* 作业问答 */} {/* 作业问答 */}
<Route exact path="/courses/:coursesId/common_homeworks/:workId/question" <Route exact path="/courses/:coursesId/common_homeworks/:workId/question"
render={ render={
@ -120,7 +114,7 @@ class CoursesWorkIndex extends Component{
(props) => (<NewWork {...this.props} {...props} {...this.state} />) (props) => (<NewWork {...this.props} {...props} {...this.state} />)
} }
></Route> ></Route>
<Route exact path="/courses/:coursesId/common_homeworks/new" <Route exact path="/courses/:coursesId/common_homeworks/:categroy_id/new"
render={ render={
(props) => (<NewWork {...this.props} {...props} {...this.state} />) (props) => (<NewWork {...this.props} {...props} {...this.state} />)
} }

@ -117,7 +117,7 @@ class CoursesWorkIndex extends Component{
(props) => (<NewWork {...this.props} {...props} {...this.state} />) (props) => (<NewWork {...this.props} {...props} {...this.state} />)
} }
></Route> ></Route>
<Route exact path="/courses/:coursesId/group_homeworks/new" <Route exact path="/courses/:coursesId/group_homeworks/:categroy_id/new"
render={ render={
(props) => (<NewWork {...this.props} {...props} {...this.state} />) (props) => (<NewWork {...this.props} {...props} {...this.state} />)
} }

@ -52,9 +52,9 @@ class PublishRightnow extends Component{
modalname: isPublish ? "立即发布" : "立即截止", modalname: isPublish ? "立即发布" : "立即截止",
modaltype:1, modaltype:1,
visible:true, visible:true,
Topval: isPublish ? "本操作只对“未发布”的对象生效" : "本操作只对“提交中”的对象生效", Topval: isPublish ? "学生将立即收到作业" : "学生将不能再提交作品",
Botvalleft: isPublish ? "暂不发布" : "暂不截止", // Botvalleft: isPublish ? "暂不发布" : "暂不截止",
Botval: isPublish ? "则通过后续手动设置,定时发布" : "则将根据已设置的截止时间,定时截止", Botval: this.props.fromListPage ? (isPublish ? "本操作只对“未发布”的分班有效" : "本操作只对“提交中”的分班有效") : '',
starttime: isPublish ? `发布时间:${startMoment.format(dateFormat)}` : '', starttime: isPublish ? `发布时间:${startMoment.format(dateFormat)}` : '',
starttimes:isPublish ? `${startMoment.format(dateFormat)}` : '', starttimes:isPublish ? `${startMoment.format(dateFormat)}` : '',
endtime: isPublish ? `截止时间:${startMoment.add(1, 'months').add(1, 'hours').minutes(0).format(dateFormat)}` : '', endtime: isPublish ? `截止时间:${startMoment.add(1, 'months').add(1, 'hours').minutes(0).format(dateFormat)}` : '',

@ -67,9 +67,9 @@ export function RouteHOC(options = {}) {
this.props.history.push(`/courses/${_courseId}/${secondName}/${_workId}/${_studentWorkId}/appraise`) this.props.history.push(`/courses/${_courseId}/${secondName}/${_workId}/${_studentWorkId}/appraise`)
} }
} }
toNewPage = (courseId, workId) => { toNewPage = (courseId) => {
const secondName = this.getModuleName() const secondName = this.getModuleName()
this.props.history.push(`/courses/${courseId.coursesId}/${secondName}/new`) this.props.history.push(`/courses/${courseId.coursesId}/${secondName}/${courseId.category_id}/new`)
} }
toListPage = (_courseId, _workId) => { toListPage = (_courseId, _workId) => {
const secondName = this.getModuleName() const secondName = this.getModuleName()

@ -9,6 +9,7 @@ import '../css/busyWork.css'
import CoursesListType from '../coursesPublic/CoursesListType' import CoursesListType from '../coursesPublic/CoursesListType'
import CommonWorkItem from './CommonWorkItem' import CommonWorkItem from './CommonWorkItem'
import PublishRightnow from './PublishRightnow' import PublishRightnow from './PublishRightnow'
import ConnectProject from './ConnectProject'
import { WordsBtn } from 'educoder' import { WordsBtn } from 'educoder'
import Modals from '../../modals/Modals' import Modals from '../../modals/Modals'
@ -53,7 +54,9 @@ class commonWork extends Component{
let {page,search,order}=this.state; let {page,search,order}=this.state;
this.getList(page,search,order); this.getList(page,search,order);
} }
openConnectionProject = (work) => {
this.refs['connectProject'].openConnectionProject(work)
}
// 新建 // 新建
createCommonWork=(type)=>{ createCommonWork=(type)=>{
@ -72,7 +75,6 @@ class commonWork extends Component{
} }
componentDidUpdate(prevProps, prevState) { componentDidUpdate(prevProps, prevState) {
debugger;
if (prevProps.match.path != this.props.match.path) { if (prevProps.match.path != this.props.match.path) {
this.componentDidMount() this.componentDidMount()
} }
@ -195,6 +197,7 @@ class commonWork extends Component{
this.clearSelection() this.clearSelection()
let {search,order}=this.state; let {search,order}=this.state;
this.getList(1,search,order); this.getList(1,search,order);
this.props.updataleftNavfun()
} }
console.log(response) console.log(response)
}).catch((error) => { }).catch((error) => {
@ -276,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(){
@ -338,6 +361,8 @@ class commonWork extends Component{
</div> </div>
</div> </div>
</div> */} </div> */}
<ConnectProject ref="connectProject" {...this.props} connectSuccess={this.connectSuccess}></ConnectProject>
<Titlesearchsection <Titlesearchsection
title={main_category_name} title={main_category_name}
@ -390,11 +415,11 @@ class commonWork extends Component{
</li> </li>
<li className="li_line"> <li className="li_line">
<PublishRightnow showActionButton={true} {...this.props} checkBoxValues={checkBoxValues} <PublishRightnow showActionButton={true} {...this.props} checkBoxValues={checkBoxValues}
isPublish={true} doWhenSuccess={this.doWhenSuccess}></PublishRightnow> isPublish={true} doWhenSuccess={this.doWhenSuccess} fromListPage={true}></PublishRightnow>
</li> </li>
<li className="li_line"> <li className="li_line">
<PublishRightnow showActionButton={true} {...this.props} checkBoxValues={checkBoxValues} <PublishRightnow showActionButton={true} {...this.props} checkBoxValues={checkBoxValues}
isPublish={false} doWhenSuccess={this.doWhenSuccess}></PublishRightnow> isPublish={false} doWhenSuccess={this.doWhenSuccess} fromListPage={true}></PublishRightnow>
</li> </li>
{ !!course_public && <li className="li_line"><a href="javascript:void(0)" onClick={this.onSetPublic} className="color-grey-9">设为公开</a></li>} { !!course_public && <li className="li_line"><a href="javascript:void(0)" onClick={this.onSetPublic} className="color-grey-9">设为公开</a></li>}
@ -418,12 +443,15 @@ class commonWork extends Component{
<Spin size="large" spinning={this.state.isSpin}> <Spin size="large" spinning={this.state.isSpin}>
<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> <CommonWorkItem mainList={mainList} {...this.props} workType={workType} onItemClick={this.onItemClick}
openConnectionProject={this.openConnectionProject}
cancelConnectionProject={this.cancelConnectionProject}
></CommonWorkItem>
</Checkbox.Group> </Checkbox.Group>
</Spin> </Spin>
{ {
mainList && mainList.homeworks.length==0 && <NoneData></NoneData> mainList && mainList.homeworks && mainList.homeworks.length==0 && <NoneData></NoneData>
} }
{ {

@ -28,6 +28,14 @@ export function CNotificationHOC(options = {}) {
notification.open(data); notification.open(data);
} }
bytesToSize = (bytes) => {
if (bytes === 0) return '0 B';
let k = 1024,
sizes = ['B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'],
i = Math.floor(Math.log(bytes) / Math.log(k));
return (bytes / Math.pow(k, i)). toFixed(2) + ' ' + sizes[i];
}
configNotification = (placement) => { configNotification = (placement) => {
placement && notification.config({ placement && notification.config({
placement: placement, placement: placement,
@ -127,6 +135,7 @@ export function CNotificationHOC(options = {}) {
</Modals> </Modals>
<WrappedComponent {...this.props} <WrappedComponent {...this.props}
showNotification= { this.showNotification } showNotification= { this.showNotification }
bytesToSize={this.bytesToSize}
getNowFormatDates={(value,type)=>this.getNowFormatDates(value,type)} getNowFormatDates={(value,type)=>this.getNowFormatDates(value,type)}
configNotification={ this.configNotification } configNotification={ this.configNotification }
confirm={ this.confirm } confirm={ this.confirm }

@ -46,9 +46,9 @@ class CCommentItem extends Component{
let { item, commentIndex }=this.props; let { item, commentIndex }=this.props;
const url = `/student_works/${studentWorkId}/cancel_appeal.json` const url = `/student_works/${studentWorkId}/cancel_appeal.json`
axios.post(url, { data: { axios.post(url, {
score_id: item.id score_id: item.id
}}) })
.then((response) => { .then((response) => {
if (response.data.status == 0) { if (response.data.status == 0) {
this.showNotification('撤销成功') this.showNotification('撤销成功')
@ -262,9 +262,21 @@ class CCommentItem extends Component{
return( return(
<div className="ccomment comment_item_cont df clearfix" key={item.id}> <div className="ccomment comment_item_cont df clearfix" key={item.id}>
<div className="J_Comment_Face fl"> <div className="J_Comment_Face fl">
<a href={`${_origin}/users/${item.user_login}`} target="_blank">
<img alt="用户头像" height="50" src={getImageUrl(`images/${item.image_url}`)} width="50"/> {item.image_url == '--' ?
<a href={`javascript:void(0)`} >
<img alt="用户头像" height="50"
src={`${getUrl()}/images/edu_user/anony.png`} width="50"/>
</a> </a>
: <a href={`${_origin}/users/${item.user_login}`} target="_blank">
<img alt="用户头像" height="50"
src={`${getUrl()}/images/${item.image_url}`}
width="50"/>
</a>}
{/* <a href={`${_origin}/users/${item.user_login}`} target="_blank">
<img alt="用户头像" height="50" src={getImageUrl(`images/${item.image_url}`)} width="50"/>
</a> */}
</div> </div>
<div className="t_content fl"> <div className="t_content fl">

@ -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';
@ -9,7 +9,6 @@ import '../css/Courses.css';
import Modals from "../../modals/Modals"; import Modals from "../../modals/Modals";
import AddStudentModal from '../members/modal/AddStudentModal' import AddStudentModal from '../members/modal/AddStudentModal'
import AddTeacherModal from '../members/modal/AddTeacherModal' import AddTeacherModal from '../members/modal/AddTeacherModal'
import Trialapplication from "../../login/Trialapplication";
// 点击按钮复制功能 // 点击按钮复制功能
// function jsCopy(){ // function jsCopy(){
@ -44,19 +43,20 @@ class CoursesBanner extends Component {
modalsBottomval: "", modalsBottomval: "",
antIcon:false, antIcon:false,
coursedata:undefined, coursedata:undefined,
user_phone_binded:false,
isRenders:false,
showTrial:false,
} }
console.log("CoursesBanner");
console.log("48");
console.log(props);
} }
componentDidMount() { componentDidMount() {
this.onloadupdatabanner()
on('updatabanner', this.updatabanner)
}
componentWillUnmount() {
off('updatabanner', this.updatabanner)
}
onloadupdatabanner=()=>{
this.updatabanner() this.updatabanner()
this.setState({
user_phone_binded :this.props.user_phone_binded,
})
} }
updatabanner=()=>{ updatabanner=()=>{
let courseId = this.props.match.params.coursesId; let courseId = this.props.match.params.coursesId;
@ -64,19 +64,12 @@ class CoursesBanner extends Component {
axios.get(url).then((result) => { axios.get(url).then((result) => {
if( result!=undefined){ if( result!=undefined){
let data = result.data; let data = result.data;
if(result.data.status === 407){
this.setState({
isRenders:true,
coursedata: data,
showTrial:false,
})
}else{
this.setState({ this.setState({
coursedata: data, coursedata: data,
showTrial:true,
}) })
} }else{
this.onloadupdatabanner()
} }
}) })
} }
@ -332,11 +325,10 @@ class CoursesBanner extends Component {
} }
render() { render() {
let { Addcoursestypes, coursedata, modalsType, modalsTopval, loadtype,modalsBottomval,antIcon,user_phone_binded} = this.state; let { Addcoursestypes, coursedata, modalsType, modalsTopval, loadtype,modalsBottomval,antIcon} = this.state;
return ( return (
<div> <div>
<Trialapplication {...this.state} user_phone_binded={user_phone_binded} ></Trialapplication>
{ {
coursedata === undefined || coursedata.status===401? <div id="course_info_1309" className="courseHead" style={{height: '206px'}}></div>:<div id="course_info_1309" className="courseHead" style={{height: '206px'}}> coursedata === undefined || coursedata.status===401? <div id="course_info_1309" className="courseHead" style={{height: '206px'}}></div>:<div id="course_info_1309" className="courseHead" style={{height: '206px'}}>
@ -370,7 +362,7 @@ class CoursesBanner extends Component {
{ {
coursedata===undefined || coursedata.status===401 || coursedata.status===407?"": coursedata===undefined || coursedata.status===401 || coursedata.status===407?"":
<Tooltip placement="bottom" title={coursedata&&coursedata.name.length<38?"":coursedata.name}> <Tooltip placement="bottom" title={coursedata&&coursedata.name && coursedata.name.length<38?"":coursedata.name}>
<span className="font-24 fl bannername">{coursedata.name}</span> <span className="font-24 fl bannername">{coursedata.name}</span>
</Tooltip> </Tooltip>
@ -411,7 +403,9 @@ class CoursesBanner extends Component {
<div> <div>
{coursedata.switch_to_student === true ? {coursedata.switch_to_student === true ?
<Tooltip placement="bottom" title={"切换至学生可进行提交作品、答题等操作"}> <Tooltip placement="bottom" title={
<pre>由教师/助教身份切换至学生<br/>可进行提交作品答题等操作</pre>
}>
<a className="fr user_default_btn user_blue_btn mr20 font-18" <a className="fr user_default_btn user_blue_btn mr20 font-18"
onClick={()=>this.switchidentity(1)} onClick={()=>this.switchidentity(1)}
> 切换为学生 </a> > 切换为学生 </a>
@ -419,7 +413,9 @@ class CoursesBanner extends Component {
:""} :""}
{coursedata.switch_to_teacher === true ? {coursedata.switch_to_teacher === true ?
<Tooltip placement="bottom" title={"由学生身份切换至教师"}> <Tooltip placement="bottom" title={
<pre>由学生身份切换至教师<br/>拥有添加成员发布作业等管理权限</pre>
}>
<a className="fr user_default_btn user_blue_btn mr20 font-18" <a className="fr user_default_btn user_blue_btn mr20 font-18"
onClick={()=>this.switchidentity(2)} onClick={()=>this.switchidentity(2)}
> 切换为老师 </a> > 切换为老师 </a>
@ -427,7 +423,9 @@ class CoursesBanner extends Component {
{coursedata.switch_to_assistant === true ? {coursedata.switch_to_assistant === true ?
<Tooltip placement="bottom" title={"由学生身份切换至助教"}> <Tooltip placement="bottom" title={
<pre>由学生身份切换至助教<br/>拥有添加成员发布作业等管理权限</pre>
}>
<a className="fr user_default_btn user_blue_btn mr20 font-18" <a className="fr user_default_btn user_blue_btn mr20 font-18"
onClick={()=>this.switchidentity(3)} onClick={()=>this.switchidentity(3)}
> 切换为助教 </a> > 切换为助教 </a>
@ -466,7 +464,9 @@ class CoursesBanner extends Component {
<Link to={"/courses/"+this.props.match.params.coursesId+"/students"}> <Link to={"/courses/"+this.props.match.params.coursesId+"/students"}>
<span className="color-grey-c fl font-16">学生</span> <span className="color-grey-c fl font-16">学生</span>
<span <span
className={coursedata.credit===null?"color-white fl font-16":"color-white fl font-16 bannerurli"}>{coursedata.student_count}</span> className={coursedata.credit===null?"color-white fl font-16 bannerurlis":"color-white fl font-16 bannerurli"}>
{coursedata.student_count}
</span>
</Link> </Link>
</li> </li>
@ -530,7 +530,10 @@ class CoursesBanner extends Component {
{coursedata.code_halt === true? "已停用" : coursedata.invite_code} {coursedata.code_halt === true? "已停用" : coursedata.invite_code}
{coursedata.code_halt === true ? "" : {coursedata.code_halt === true ? "" :
<Tooltip placement="bottom" title={ <Tooltip placement="bottom" title={
<pre> coursedata.code_halt === true? <pre>
邀请码已停用<br/>
成员不能主动加入课堂
</pre>:<pre>
成员可以通过邀请码主动加入课堂<br/> 成员可以通过邀请码主动加入课堂<br/>
点击立刻复制邀请码 点击立刻复制邀请码
</pre> </pre>

@ -119,7 +119,17 @@ class Addcourses extends Component{
} }
submitasyn=(course_id)=>{ submitasyn=(course_id)=>{
let{professor}=this.state;
if(professor===1){
this.setState({
loadtype:true,
modalsType:true,
modalsTopval:"申请已提交,请等待审核",
modalSave:(course_id)=>this.submitasyns(course_id),
Addcoursestype:false
})
this.props.hideAddcoursestype();
}else{
// let{course_id}=this.state; // let{course_id}=this.state;
this.setState({ this.setState({
Addcoursestype:false Addcoursestype:false
@ -128,6 +138,11 @@ class Addcourses extends Component{
window.location.href ="/courses/"+course_id+"/students"; window.location.href ="/courses/"+course_id+"/students";
} }
}
submitasyns=(course_id)=>{
window.location.href ="/courses/"+course_id+"/students";
}
submittojoinclass=()=>{ submittojoinclass=()=>{
let {invite_code,professor,assistant_professor,student}=this.state; let {invite_code,professor,assistant_professor,student}=this.state;
if(invite_code===undefined||invite_code===""){ if(invite_code===undefined||invite_code===""){

@ -173,11 +173,11 @@ class PathModal extends Component{
</span> </span>
<div className="fr search-new"> <div className="fr search-new">
<Search <Search
placeholder="输入实训名称的关键字搜索" placeholder="请输入创建者或者实训名称进行搜索"
value={Searchvalue} value={Searchvalue}
onInput={this.SenttotheValue} onInput={this.SenttotheValue}
onSearch={(value) => this.SenttotheSearch(value)} onSearch={(value) => this.SenttotheSearch(value)}
style={{width: '100%'}} style={{width: '115%'}}
/> />
</div> </div>
</div> </div>

@ -285,6 +285,11 @@ class Selectresource extends Component{
padding: 0 30px; padding: 0 30px;
padding-top:30px; padding-top:30px;
} }
.search-news{
width: 237px!important;
height: 30px;
margin-bottom: 30px;
}
`}</style> `}</style>
<div className="newupload_conbox newupload_conboxtop"> <div className="newupload_conbox newupload_conboxtop">
@ -292,7 +297,7 @@ class Selectresource extends Component{
<li className="fl mr5 mt5"> <a onClick={()=>this.changeTag("all")} className={ type==="all" ? "active edu-filter-cir-grey font-12":"edu-filter-cir-grey font-12"}>全部</a></li> <li className="fl mr5 mt5"> <a onClick={()=>this.changeTag("all")} className={ type==="all" ? "active edu-filter-cir-grey font-12":"edu-filter-cir-grey font-12"}>全部</a></li>
<li className="fl mr5 mt5 ml15"> <a onClick={()=>this.changeTag("my")} className={ type==="my" ? " active edu-filter-cir-grey font-12":"edu-filter-cir-grey font-12"}>我的资源</a></li> <li className="fl mr5 mt5 ml15"> <a onClick={()=>this.changeTag("my")} className={ type==="my" ? " active edu-filter-cir-grey font-12":"edu-filter-cir-grey font-12"}>我的资源</a></li>
<div className="fr search-new"> <div className="fr search-news" >
<Search <Search
placeholder="请输入发布人或名称进行搜索" placeholder="请输入发布人或名称进行搜索"
value={Searchvalue} value={Searchvalue}

@ -7,13 +7,7 @@ import moment from 'moment';
import Modals from '../../modals/Modals'; import Modals from '../../modals/Modals';
const Option = Select.Option; const Option = Select.Option;
function bytesToSize(bytes) {
if (bytes === 0) return '0 B';
let k = 1024,
sizes = ['B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'],
i = Math.floor(Math.log(bytes) / Math.log(k));
return (bytes / Math.pow(k, i)). toFixed(2) + ' ' + sizes[i];
}
const dateFormat ="YYYY-MM-DD HH:mm" const dateFormat ="YYYY-MM-DD HH:mm"
function range(start, end) { function range(start, end) {
const result = []; const result = [];
@ -619,7 +613,7 @@ class Selectsetting extends Component{
{item.name} {item.name}
</span> </span>
<span className="color656565 mt2 color-grey-6 font-12 mr8"> <span className="color656565 mt2 color-grey-6 font-12 mr8">
{item.response===undefined?"":isNaN(bytesToSize(item.response.filesize))?"":bytesToSize(item.response.filesize)} {item.response===undefined?"":isNaN(this.props.bytesToSize(item.response.filesize))?"":this.props.bytesToSize(item.response.filesize)}
</span> </span>
<i className="font-14 iconfont icon-guanbi " <i className="font-14 iconfont icon-guanbi "
id={item.response===undefined?"":item.response.id} id={item.response===undefined?"":item.response.id}

@ -230,11 +230,11 @@ class ShixunModal extends Component{
</span> </span>
<div className="fr search-new"> <div className="fr search-new">
<Search <Search
placeholder="输入实训名称的关键字搜索" placeholder="请输入创建者或者实训名称进行搜索"
value={Searchvalue} value={Searchvalue}
onInput={this.SenttotheValue} onInput={this.SenttotheValue}
onSearch={(value) => this.SenttotheSearch(value)} onSearch={(value) => this.SenttotheSearch(value)}
style={{width: '100%'}} style={{width: '115%'}}
/> />
</div> </div>
</div> </div>

@ -1,17 +1,17 @@
import React,{ Component } from "react"; import React,{ Component } from "react";
import { WordsBtn } from 'educoder'; import { WordsBtn } from 'educoder';
import {Tooltip,message,Modal} from 'antd'; import {Tooltip,message,Modal,Spin} from 'antd';
import {Link} from 'react-router-dom'; import {Link} from 'react-router-dom';
import axios from 'axios'; import axios from 'axios';
import Modals from '../../modals/Modals'; import Modals from '../../modals/Modals';
class Startshixuntask extends Component{ class Startshixuntask extends Component{
constructor(props){ constructor(props){
super(props); super(props);
this.state = { this.state = {
startbtn:false startbtn:false,
isSpin:false,
} }
} }
@ -60,11 +60,15 @@ class Startshixuntask extends Component{
} }
hidestartshixunsreplace=(url)=>{ hidestartshixunsreplace=(url)=>{
this.setState({
isSpin:true
})
axios.get(url).then((response) => { axios.get(url).then((response) => {
if(response.status===200){ if(response.status===200){
this.setState({ this.setState({
shixunsreplace:false shixunsreplace:false,
isSpin:false,
}) })
message.success('重置成功,正在进入实训!'); message.success('重置成功,正在进入实训!');
let path="/shixuns/"+response.data.shixun_identifier+"/challenges"; let path="/shixuns/"+response.data.shixun_identifier+"/challenges";
@ -74,7 +78,8 @@ class Startshixuntask extends Component{
).catch((error) => { ).catch((error) => {
this.setState({ this.setState({
startbtn:false, startbtn:false,
shixunsreplace:false shixunsreplace:false,
isSpin:false,
}) })
}); });
@ -98,7 +103,8 @@ class Startshixuntask extends Component{
hidestartshixunsreplacevalue, hidestartshixunsreplacevalue,
startshixunCombattype, startshixunCombattype,
shixunsmessage, shixunsmessage,
startbtn startbtn,
isSpin
} = this.state; } = this.state;
return( return(
@ -120,13 +126,15 @@ class Startshixuntask extends Component{
footer={null} footer={null}
keyboard={false} keyboard={false}
> >
<Spin size="large" spinning={isSpin}>
<div className="task-popup-content"> <div className="task-popup-content">
<p className="task-popup-text-center font-16 pb20">实训已经更新了正在为您重置!</p> <p className="task-popup-text-center font-16 pb20">实训已经更新了正在为您重置!</p>
</div> </div>
<div className="task-popup-submit clearfix"> <div className="task-popup-submit clearfix">
<a className="task-btn task-btn-orange fr mr51" <a className="task-btn task-btn-orange fr mr51"
onClick={() => this.hidestartshixunsreplace(hidestartshixunsreplacevalue)}>知道了</a> onClick={() => this.hidestartshixunsreplace(hidestartshixunsreplacevalue)}>知道了</a>
</div> </div>
</Spin>
</Modal> </Modal>
<Modal <Modal
title="提示" title="提示"

@ -230,11 +230,11 @@ class ShixunModal extends Component{
</span> </span>
<div className="fr search-new"> <div className="fr search-new">
<Search <Search
placeholder="输入实训名称的关键字搜索" placeholder="请输入创建者或者实训名称进行搜索"
value={Searchvalue} value={Searchvalue}
onInput={this.SenttotheValue} onInput={this.SenttotheValue}
onSearch={(value) => this.SenttotheSearch(value)} onSearch={(value) => this.SenttotheSearch(value)}
style={{width: '100%'}} style={{width: '115%'}}
/> />
</div> </div>
</div> </div>

@ -22,13 +22,6 @@ function disabledDateTime() {
}; };
} }
function bytesToSize(bytes) {
if (bytes === 0) return '0 B';
let k = 1024,
sizes = ['B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'],
i = Math.floor(Math.log(bytes) / Math.log(k));
return (bytes / Math.pow(k, i)). toFixed(2) + ' ' + sizes[i];
}
const dateFormat="YYYY-MM-DD HH:mm"; const dateFormat="YYYY-MM-DD HH:mm";
class Sendresource extends Component{ class Sendresource extends Component{
constructor(props){ constructor(props){
@ -456,7 +449,7 @@ class Sendresource extends Component{
{item.name} {item.name}
</span> </span>
<span className="color656565 mt2 color-grey-6 font-12 mr8"> <span className="color656565 mt2 color-grey-6 font-12 mr8">
{item.response===undefined?"":isNaN(bytesToSize(item.response.filesize))?"":bytesToSize(item.response.filesize)} {item.response===undefined?"":isNaN(this.props.bytesToSize(item.response.filesize))?"":this.props.bytesToSize(item.response.filesize)}
</span> </span>
<i className="font-14 iconfont icon-guanbi " <i className="font-14 iconfont icon-guanbi "
id={item.response===undefined?"":item.response.id} id={item.response===undefined?"":item.response.id}

@ -460,6 +460,10 @@ a.white-btn.use_scope-btn:hover{
width: 70px; width: 70px;
margin-left: -10px; margin-left: -10px;
} }
.bannerurlis{
width: 70px;
margin-left: -10px;
}
.pathInfobox li{ .pathInfobox li{
margin-right: 20px; margin-right: 20px;
height: 15px; height: 15px;
@ -1206,6 +1210,7 @@ a.white-btn.use_scope-btn:hover{
width:237px!important; width:237px!important;
height: 30px; height: 30px;
margin-bottom: 30px; margin-bottom: 30px;
margin-right: 35px;
} }
.search-new-input { .search-new-input {
padding-left: 16px; padding-left: 16px;

@ -1,5 +1,5 @@
import React,{Component} from "React"; import React,{Component} from "React";
import { Form, Select, Input, Button,Checkbox,Upload,Icon,message,Modal,Spin} from "antd"; import { Form, Select, Input, Button,Checkbox,Upload,Icon,message,Modal,Spin,Tooltip} from "antd";
import {Link} from 'react-router-dom'; import {Link} from 'react-router-dom';
import TPMMDEditor from '../../../tpm/challengesnew/TPMMDEditor'; import TPMMDEditor from '../../../tpm/challengesnew/TPMMDEditor';
import { WordsBtn,getUrl } from 'educoder'; import { WordsBtn,getUrl } from 'educoder';
@ -212,7 +212,7 @@ class GraduationTasksSubmitedit extends Component{
this.setState({ fileList }); this.setState({ fileList });
} }
onAttachmentRemove = (file) => { //onAttachmentRemove = (file) => {
// confirm({ // confirm({
// title: '确定要删除这个附件吗?', // title: '确定要删除这个附件吗?',
@ -228,14 +228,14 @@ class GraduationTasksSubmitedit extends Component{
// }); // });
// return false; // return false;
this.setState({ // this.setState({
Modalstype:true, // Modalstype:true,
Modalstopval:'确定要删除这个附件吗?', // Modalstopval:'确定要删除这个附件吗?',
ModalSave: ()=>this.deleteAttachment(file), // ModalSave: ()=>this.deleteAttachment(file),
ModalCancel:this.cancelAttachment // ModalCancel:this.cancelAttachment
}) // })
return false; // return false;
} //}
cancelAttachment=()=>{ cancelAttachment=()=>{
this.setState({ this.setState({
@ -246,8 +246,8 @@ class GraduationTasksSubmitedit extends Component{
}) })
} }
deleteAttachment = (file) => { onAttachmentRemove = (file) => {
let {attachments}=this.state; let {attachments,fileList}=this.state;
const url = `/attachments/${file.uid===undefined?file.id:file.uid}.json` const url = `/attachments/${file.uid===undefined?file.id:file.uid}.json`
axios.delete(url, { axios.delete(url, {
}) })
@ -426,7 +426,7 @@ class GraduationTasksSubmitedit extends Component{
multiple: true, multiple: true,
// https://github.com/ant-design/ant-design/issues/15505 // https://github.com/ant-design/ant-design/issues/15505
// showUploadList={false},然后外部拿到 fileList 数组自行渲染列表。 // showUploadList={false},然后外部拿到 fileList 数组自行渲染列表。
// showUploadList: false, showUploadList: false,
action: `${getUrl()}/api/attachments.json`, action: `${getUrl()}/api/attachments.json`,
onChange: this.handleChange, onChange: this.handleChange,
onRemove: this.onAttachmentRemove, onRemove: this.onAttachmentRemove,
@ -553,7 +553,37 @@ class GraduationTasksSubmitedit extends Component{
) )
})} })}
<style>
{
`
.maxwidth500{
max-width:500px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
color: #05101a;
}
`
}
</style>
{this.state.fileList.length===0?"":this.state.fileList.map((item,key)=>{
return(
<p className="color-grey mt10" key={key} >
<a className="color-grey fl">
<i className="font-14 color-green iconfont icon-fujian mr8" aria-hidden="true"></i>
</a>
<span className="mr12 color9B9B maxwidth500 fl" length="58">
{item.name}
</span>
<span className="color656565 mt2 color-grey-6 font-12 mr8">
{item.response===undefined?"":isNaN(this.props.bytesToSize(item.response.filesize))?"":this.props.bytesToSize(item.response.filesize)}
</span>
<i className="font-14 iconfont icon-guanbi "
id={item.response===undefined?"":item.response.id}
aria-hidden="true" onClick={()=>this.onAttachmentRemove(item.response===undefined?"":item.response.id&&item.response.id)}></i>
</p>
)
})}
@ -571,7 +601,7 @@ class GraduationTasksSubmitedit extends Component{
<div className={"fl ml20"}>成员要求25</div> <div className={"fl ml20"}>成员要求25</div>
<Search <Search
className={"fl mt5 ml20"} className={"fl mt5 ml20"}
style={{width:"20%"}} style={{width:"270px"}}
placeholder="请输入姓名或学号搜索" placeholder="请输入姓名或学号搜索"
id="subject_search_input" id="subject_search_input"
value={search} value={search}
@ -581,26 +611,54 @@ class GraduationTasksSubmitedit extends Component{
></Search> ></Search>
</div> </div>
<style>{`
.fonthidden{
overflow:hidden;
text-overflow:ellipsis;
white-space:nowrap
}
.width87{
width: 87px;
height: 24px;
}
img.edu-nodata-img {
width: 200px;
margin: 50px 90px 20px;
display: block;
}
`}</style>
</Form.Item> </Form.Item>
<div className={"ml20"} style={{width:"100%"}}> <div className={"ml20 mt10"} style={{width:"100%"}}>
<div className={"members fl"} <div className={"members fl"}
onScroll={this.contentViewScroll}> onScroll={this.contentViewScroll}>
<CheckboxGroup value={task_status} onChange={this.funtaskstatus} style={{ paddingTop: '4px'}}> <CheckboxGroup value={task_status} onChange={this.funtaskstatus} style={{ paddingTop: '4px'}}>
{memberslist&&memberslist.members.map((item,key)=>{ {memberslist===undefined?"":memberslist.members.length===0? <div className="square-list clearfix">
<div className="edu-tab-con-box clearfix edu-txt-center">
<img className="edu-nodata-img mb20" src={getImageUrl("images/educoder/nodata.png")}/>
<p className="edu-nodata-p mb20">未找到包含{search}的学生</p>
</div>
</div>:memberslist&&memberslist.members.map((item,key)=>{
return( return(
<div key={key} style={{ <div key={key} style={{
width: '375px', width: '375px',
height: '30px' height: '30px'
}}> }}>
<Checkbox value={item.user_id} checked={parseInt(task_status[key])===item.user_id?true:false} disabled={item.commit_status===true?true:false} className="fl "></Checkbox> <Checkbox value={item.user_id}
<div className={"fl ml5"} style={{width: '70px'}}>{item.user_name}</div> checked={
<div className={"fl ml40 color-grey-9"}>{item.group_name}</div> task_status.map((item,key)=>{
<div className={"fl ml40 color-grey-9"}>{item.student_id}</div> return parseInt(task_status[key])===item.user_id?true:false
<div className={"fl ml40"}>{item.commit_status===true?<span className={"color-orange"}>已提交</span> :""}</div> })
}
disabled={item.commit_status===true?true:false} className="fl "></Checkbox>
<Tooltip placement="bottom" title={item.user_name}>
<div className={"fl ml5 fonthidden width87"} style={{width: '70px'}}>{item.user_name}</div>
</Tooltip>
<div className={"fl ml5 fonthidden width87 color-grey-9"} style={{width: '70px'}}>{item.group_name}</div>
<div className={"fl ml5 color-grey-9 fonthidden width87"} style={{width: '70px'}}>{item.student_id}</div>
<div className={"fl ml20"}>{item.commit_status===false?<span className={"color-orange"}>已提交</span> :""}</div>
</div> </div>
) )
})} })}
@ -622,10 +680,12 @@ class GraduationTasksSubmitedit extends Component{
height: '30px', height: '30px',
display:item.user_name===undefined?"none":"" display:item.user_name===undefined?"none":""
}}> }}>
<div className={"fl ml5"} style={{width: '50px'}}>{item.user_name}</div> <Tooltip placement="bottom" title={item.user_name}>
<div className={"fl ml40 color-grey-9"}>{item.group_name}</div> <div className={"fl ml5 fonthidden width87"} style={{width: '50px'}}>{item.user_name}</div>
<div className={"fl ml40 color-grey-9"}>{item.student_id}</div> </Tooltip>
{key>0?<div className={"fr"}><i className={"iconfont icon-shanchudiao fl "} style={{marginTop:'-4px'}} onClick={()=>this.delecttask_status(item.user_id)}></i></div>:""} <div className={"fl ml5 fonthidden width87 color-grey-9"}>{item.group_name}</div>
<div className={"fl ml5 color-grey-9 fonthidden width87"}>{item.student_id}</div>
{key>0?<div className={"fl ml20"}><i className={"iconfont icon-shanchudiao fl "} style={{marginTop:'-4px'}} onClick={()=>this.delecttask_status(item.user_id)}></i></div>:""}
</div> </div>
) )
})} })}

@ -2,7 +2,7 @@ import React,{Component} from "React";
import { Form, Select, Input, Button,Checkbox,Upload,Icon,message,Modal,Tooltip,Spin} from "antd"; import { Form, Select, Input, Button,Checkbox,Upload,Icon,message,Modal,Tooltip,Spin} from "antd";
import {Link} from 'react-router-dom'; import {Link} from 'react-router-dom';
import TPMMDEditor from '../../../tpm/challengesnew/TPMMDEditor'; import TPMMDEditor from '../../../tpm/challengesnew/TPMMDEditor';
import { WordsBtn,getUrl } from 'educoder'; import { WordsBtn,getUrl,getImageUrl} from 'educoder';
import axios from 'axios'; import axios from 'axios';
import Modals from '../../../modals/Modals'; import Modals from '../../../modals/Modals';
const Search = Input.Search; const Search = Input.Search;
@ -83,7 +83,7 @@ class GraduationTasksSubmitnew extends Component{
} }
handleSubmit=(e) => { handleSubmit=(e) => {
console.log("86");
let {fileList,selectmemberslist,workslist}=this.state; let {fileList,selectmemberslist,workslist}=this.state;
if(fileList.length === 0){ if(fileList.length === 0){
@ -91,7 +91,7 @@ class GraduationTasksSubmitnew extends Component{
Modalstype:true, Modalstype:true,
Modalstopval:'请上传附件!', Modalstopval:'请上传附件!',
Loadtype:true, Loadtype:true,
ModalCancel:this.cancelAttachment ModalSave:this.cancelAttachment,
}) })
@ -119,7 +119,7 @@ class GraduationTasksSubmitnew extends Component{
listid.push(list.response.id) listid.push(list.response.id)
} }
e.preventDefault(); // e.preventDefault();
if( GraduationTasksnewtype===true){ if( GraduationTasksnewtype===true){
this.props.form.validateFields((err, values) => { this.props.form.validateFields((err, values) => {
if (!err) { if (!err) {
@ -367,7 +367,6 @@ class GraduationTasksSubmitnew extends Component{
let newlist =memberslist.members; let newlist =memberslist.members;
let newcheckedValues=checkedValues; let newcheckedValues=checkedValues;
let selects=[]; let selects=[];
selects.push(selectobjct) selects.push(selectobjct)
for(var i=0; i<newlist.length; i++){ for(var i=0; i<newlist.length; i++){
for(var z=0; z<newcheckedValues.length; z++){ for(var z=0; z<newcheckedValues.length; z++){
@ -392,6 +391,7 @@ class GraduationTasksSubmitnew extends Component{
let selects=selectmemberslist; let selects=selectmemberslist;
for(var i=0; i<newlist.length; i++){ for(var i=0; i<newlist.length; i++){
if(newlist[i]===id){ if(newlist[i]===id){
newlist.splice(i,1) newlist.splice(i,1)
} }
@ -402,12 +402,33 @@ class GraduationTasksSubmitnew extends Component{
selects.splice(z,1) selects.splice(z,1)
} }
} }
this.setState({ this.setState({
task_status:newlist, task_status:newlist,
selectmemberslist:selects selectmemberslist:selects
}) })
} }
onSearchKeywordKeyUp = (e) => {
if (e.keyCode === 13) {
}
}
onSearckeyd=(e)=>{
if(e.keyCode){
let {search} = this.state;
this.searchList(search,1,10)
}
}
onSearchKeywordKeyUps= (e)=>{
if(e.keyCode=== 13){
}
}
onKeywordSearchKeyDown = (e) => {
if(e.keyCode == 13) {
return false;
}
}
gocannel=()=>{ gocannel=()=>{
window.history.go(-1) window.history.go(-1)
} }
@ -482,7 +503,8 @@ render(){
<a className="color-grey-6 fr font-16 ml30 mt10 mr20" onClick={this.goback}>返回</a> <a className="color-grey-6 fr font-16 ml30 mt10 mr20" onClick={this.goback}>返回</a>
</div> </div>
<Form labelCol={{ span: 5 }} wrapperCol={{ span: 12 }} onSubmit={GraduationTasksnewtype===true?this.handleSubmit:""} > {/*<Form labelCol={{ span: 5 }} wrapperCol={{ span: 12 }} onSubmit={GraduationTasksnewtype===true?this.handleSubmit:"return false"}*/}
{/*>*/}
<div className="stud-class-set pd20 coursenavbox edu-back-white"> <div className="stud-class-set pd20 coursenavbox edu-back-white">
<style>{` <style>{`
.uploadBtn.ant-btn { .uploadBtn.ant-btn {
@ -535,16 +557,29 @@ render(){
> >
<div> <div>
<div className={"fl ml20"}>成员要求25</div> <div className={"fl ml20"}>成员要求25</div>
<input type="text" style={{width:"0px",height:"0px",display:"none"}} onKeyUp={(e) => this.onSearchKeywordKeyUp(e)}
onkeydown={(e)=>this.onSearchKeywordKeyUps(e)}/>
<Search
style={{width:"0px",height:"0px",display:"none"}}
onKeyUp={(e) => this.onSearchKeywordKeyUp(e)}
onkeydown={(e)=>this.onSearchKeywordKeyUps(e)}
onPressEnter={this.onKeywordSearchKeyDown}
autoComplete="off"
></Search>
<Search <Search
className={"fl mt5 ml20"} className={"fl mt5 ml20"}
style={{width:"20%"}} style={{width:"270px"}}
placeholder="请输入姓名或学号搜索" placeholder="请输入姓名或学号搜索"
id="subject_search_input" id="subject_search_input"
value={search} value={search}
onInput={this.inputSearchValue} onInput={this.inputSearchValue}
onSearch={this.searchValue} onSearch={this.searchValue}
onPressEnter={this.onKeywordSearchKeyDown}
onKeyUp={(e) => this.onSearckeyd(e)}
autoComplete="off" autoComplete="off"
></Search> ></Search>
<input type="text" style={{display: "none",height:0, width: 0, border: "none"}}/>
</div> </div>
@ -556,6 +591,15 @@ render(){
text-overflow:ellipsis; text-overflow:ellipsis;
white-space:nowrap white-space:nowrap
} }
.width87{
width: 87px;
height: 24px;
}
img.edu-nodata-img {
width: 200px;
margin: 50px 90px 20px;
display: block;
}
`}</style> `}</style>
<div className={"ml20"} style={{width:"100%"}}> <div className={"ml20"} style={{width:"100%"}}>
@ -563,17 +607,31 @@ render(){
<div className={"members fl"} <div className={"members fl"}
onScroll={this.contentViewScroll}> onScroll={this.contentViewScroll}>
<CheckboxGroup value={task_status} onChange={this.funtaskstatus} style={{ paddingTop: '4px'}}> <CheckboxGroup value={task_status} onChange={this.funtaskstatus} style={{ paddingTop: '4px'}}>
{memberslist&&memberslist.members.map((item,key)=>{ {memberslist===undefined?"":memberslist.members.length===0?
<div className="square-list clearfix">
<div className="edu-tab-con-box clearfix edu-txt-center">
<img className="edu-nodata-img mb20" src={getImageUrl("images/educoder/nodata.png")}/>
<p className="edu-nodata-p mb20">未找到包含{search}的学生</p>
</div>
</div>:memberslist&&memberslist.members.map((item,key)=>{
return( return(
<div key={key} style={{ <div key={key} style={{
width: '375px', width: '375px',
height: '30px' height: '30px'
}}> }}>
<Checkbox value={item.user_id} checked={parseInt(task_status[key])===item.user_id?true:false} disabled={item.commit_status===true?true:false} className="fl "></Checkbox> <Checkbox value={item.user_id} checked={
<Tooltip placement="bottom" title={item.user_nam}><div className={"fl ml5 fonthidden"} style={{width: '70px'}}>{item.user_name}</div></Tooltip> task_status.map((item,key)=>{
<div className={"fl ml40 color-grey-9"}>{item.group_name}</div> return parseInt(task_status[key])===item.user_id?true:false
<div className={"fl ml40 color-grey-9"}>{item.student_id}</div> })
<div className={"fl ml40"}>{item.commit_status===true?<span className={"color-orange"}>已提交</span> :""}</div> }
disabled={item.commit_status===true?true:false} className="fl "></Checkbox>
<Tooltip placement="bottom" title={item.user_name}>
<div className={"fl ml5 fonthidden width87"}>{item.user_name}</div>
</Tooltip>
<div className={"fl ml5 fonthidden width87 color-grey-9"} title={item.group_name}>{item.group_name}</div>
<div className={"fl ml5 color-grey-9 fonthidden width87"} title={item.student_id}>{item.student_id}</div>
<div className={"fl ml20"}>{item.commit_status===true?<span className={"color-orange"}>已提交</span> :""}</div>
</div> </div>
) )
})} })}
@ -599,12 +657,13 @@ render(){
height: '30px', height: '30px',
display:item.user_name===undefined?"none":"" display:item.user_name===undefined?"none":""
}}> }}>
<Tooltip placement="bottom" title={item.user_nam}> <Tooltip placement="bottom" title={item.user_name}>
<div className={"fl ml5 fonthidden"} style={{width: '50px'}}>{item.user_name}</div> <div className={"fl ml5 fonthidden width87"}>{item.user_name}</div>
</Tooltip> </Tooltip>
<div className={"fl ml40 color-grey-9"}>{item.group_name}</div> <div className={"fl ml5 fonthidden width87 color-grey-9"}>{item.group_name}</div>
<div className={"fl ml40 color-grey-9"}>{item.student_id}</div> <div className={"fl ml5 color-grey-9 fonthidden width87"}>{item.student_id}</div>
{key>0?<div className={"fr"}><i className={"iconfont icon-shanchudiao fl "} style={{marginTop:'-4px'}} onClick={()=>this.delecttask_status(item.user_id)}></i></div>:""} {key>0?<div className={"fl ml20"}><i className={"iconfont icon-shanchudiao fl "} style={{marginTop:'-4px'}} onClick={()=>this.delecttask_status(item.user_id)}></i></div>:""}
</div> </div>
) )
})} })}
@ -627,11 +686,11 @@ render(){
<Form.Item> <Form.Item>
<div className="clearfix mt30 mb30"> <div className="clearfix mt30 mb30">
<Button type="primary" htmlType="submit" className="defalutSubmitbtn fl mr20">提交</Button> <Button type="primary" htmlType="submit" onClick={this.handleSubmit} className="defalutSubmitbtn fl mr20">提交</Button>
<a onClick={this.gocannel} className="defalutCancelbtn fl">取消</a> <a onClick={this.gocannel} className="defalutCancelbtn fl">取消</a>
</div> </div>
</Form.Item> </Form.Item>
</Form> {/*</Form>*/}
</div> </div>
</div> </div>

@ -256,9 +256,13 @@ class GraduationTasksappraise extends Component{
<div className={"ml20"}> <div className={"ml20"}>
补交原因{firelistdata&&firelistdata.revise_reason} 补交原因{firelistdata&&firelistdata.revise_reason}
</div> </div>
<div className="color-grey" key={key}>
{firelistdata===undefined?"":firelistdata.length===0?"":firelistdata.revise_attachments.map((item,key)=>{ {firelistdata===undefined?"":firelistdata.length===0?"":firelistdata.revise_attachments.map((item,key)=>{
return( return(
<div className="color-grey" key={key}> <span>
<a className="color-grey ml20"> <a className="color-grey ml20">
<i className="font-14 color-green iconfont icon-fujian mr8" aria-hidden="true"></i> <i className="font-14 color-green iconfont icon-fujian mr8" aria-hidden="true"></i>
</a> </a>
@ -268,17 +272,23 @@ class GraduationTasksappraise extends Component{
</a> </a>
<span className="color656565 mt2 color-grey-6 font-12 mr8">{item.filesize}</span> <span className="color656565 mt2 color-grey-6 font-12 mr8">{item.filesize}</span>
{item.delete===true?<i className="font-14 iconfont icon-guanbi " id={item.id} aria-hidden="true" onClick={()=>this.onAttachmentRemove(item.id)}></i>:""} {item.delete===true?<i className="font-14 iconfont icon-guanbi " id={item.id} aria-hidden="true" onClick={()=>this.onAttachmentRemove(item.id)}></i>:""}
</span>
</div>
) )
})} })}
</div>
<div className={"color-grey-6 h20 ml20"}> <div className={"color-grey-6 h20 ml20"}>
<span className={"color9B9B fr mr10"}>更新</span> <span className={"color9B9B fr mr10"}>更新</span>
<span className={"fr font-13 mr10 ml10"}>{firelistdata&&firelistdata.atta_update_user}</span> <span className={"fr font-13 mr10 ml10"}>{firelistdata&&firelistdata.atta_update_user}</span>
<span className={"color9B9B fr"}> <span className={"color9B9B fr"}>
{moment(firelistdata&&firelistdata.atta_update_time).format('YYYY-MM-DD HH:mm:ss')==="Invalid date"?"":moment(firelistdata&&firelistdata.atta_update_time).format('YYYY-MM-DD HH:mm:ss')} {moment(firelistdata&&firelistdata.atta_update_time).format('YYYY-MM-DD HH:mm:ss')==="Invalid date"?"":moment(firelistdata&&firelistdata.atta_update_time).format('YYYY-MM-DD HH:mm:ss')}
</span> </span>
</div> </div>
</div>} </div>}
{datalist&&datalist.project_info===undefined?"": {datalist&&datalist.project_info===undefined?"":
<div className={"stud-class-set edu-back-white padding20-30 bor-top-greyE"}> <div className={"stud-class-set edu-back-white padding20-30 bor-top-greyE"}>

@ -197,7 +197,6 @@ class GraduationTasksappraiseMainEditor extends Component{
.mainEditor { .mainEditor {
padding: 0 10px; padding: 0 10px;
padding-bottom: 8px; padding-bottom: 8px;
height: 288px;
} }
.mainEditorTitle { .mainEditorTitle {
margin-bottom: 6px; margin-bottom: 6px;
@ -218,7 +217,7 @@ class GraduationTasksappraiseMainEditor extends Component{
</Upload> </Upload>
<div> <div style={{height: '36px'}}>
<div style={{ float: 'left' }}> <div style={{ float: 'left' }}>
<InputNumber placeholder="请填写分数" value={score} onChange={this.onScoreChange} className={numberErrorMessage ? 'numberInputError' : ''} <InputNumber placeholder="请填写分数" value={score} onChange={this.onScoreChange} className={numberErrorMessage ? 'numberInputError' : ''}
style={{width:"120px", marginRight: '6px'}} style={{width:"120px", marginRight: '6px'}}

@ -94,7 +94,7 @@ class GraduationTaskssettinglist extends Component{
for (var i = 0; i < worklists.length; i++) { for (var i = 0; i < worklists.length; i++) {
datalist.push({ datalist.push({
name: worklists[i].name, name: worklists[i].name,
number: (parseInt(page)-1)*parseInt(limit)+(i+1), number: (parseInt(pages)-1)*parseInt(limit)+(i+1),
stduynumber: worklists[i].student_id, stduynumber: worklists[i].student_id,
classroom: worklists[i].class_grouping_name, classroom: worklists[i].class_grouping_name,
grouping: result.data.have_grouping === true ? worklists[i].grouping_name : null, grouping: result.data.have_grouping === true ? worklists[i].grouping_name : null,
@ -1279,9 +1279,6 @@ class GraduationTaskssettinglist extends Component{
text-overflow: ellipsis; text-overflow: ellipsis;
white-space: nowrap; white-space: nowrap;
} }
.ant-table-tbody > tr:last-child > td{
border:none!important;
}
` `
} }
</style> </style>
@ -1548,23 +1545,42 @@ class GraduationTaskssettinglist extends Component{
<div id="graduation_work_list" style={{padding:'0px 40px 10px 40px'}}> <div id="graduation_work_list" style={{padding:'0px 40px 10px 40px'}}>
<div className="clearfix"> <div className="clearfix">
{this.props.isAdmin()?<span className="fl color-grey-9 font-12"><span className="color-orange-tip">{taskslistdata&&taskslistdata.work_count}</span>{taskslistdata&&taskslistdata.work_count} </span>:""} {this.props.isAdmin()===true?<span className="fl color-grey-6 font-12">
{ <span className="color-orange-tip">{taskslistdata&&taskslistdata.work_count}</span>
this.props.isAdmin() ? 个检索结果{taskslistdata&&taskslistdata.work_count} 学生 </span>:""}
<div className="fr"> {this.props.isAdmin()===true?<div className="fr color-grey-6 edu-menu-panel">
<li className="drop_down edu-txt-center"> <p>
<span className="color-grey-6">{order==="updated_at"?"更新时间":order==="work_score"?"最终成绩":order==="student_id"?"学生学号":""}排序</span> <a data-remote="true">
<i className="iconfont icon-xiajiantou ml5 font-12 color-grey-9"></i> {order==="updated_at"?"更新时间":order==="work_score"?"最终成绩":order==="student_id"?"学生学号":""}排序</a>
<ul className="drop_down_normal with100"> <i className="iconfont icon-xiajiantou ml5 font-12 color-grey-6"></i></p>
<li onClick={(e)=>this.funorder("updated_at")}><a data-remote="true">更新时间</a></li> <ul className="edu-menu-list">
<li onClick={(e)=>this.funorder("work_score" )}><a data-remote="true">最终成绩</a></li> <li onClick={(e)=>this.funorder("updated_at")}><a data-remote="true">更新时间</a>
<li onClick={(e)=>this.funorder("student_id" )}><a data-remote="true">学生学号</a></li>
</ul>
</li> </li>
<li onClick={(e)=>this.funorder("work_score" )}><a data-remote="true">最终成绩</a>
</li>
<li onClick={(e)=>this.funorder("student_id" )}><a data-remote="true">学生学号</a>
</li>
</ul>
</div>:""}
</div> </div>
:""
} {this.props.isStudent()===true?
<div className="clearfix">
<span className="mr15 color-grey9">
<span className={"color-orange"}>{taskslistdata&&taskslistdata.commit_count}
</span> </span>
<span className="mr15 color-grey9">
<span className={"color-orange"}>{taskslistdata&&taskslistdata.uncommit_count}
</span> </span>
<Tooltip title={taskslistdata&&taskslistdata.left_time.status} placement="bottom">
<span className="mr15 color-grey9">
{taskslistdata&&taskslistdata.left_time.status} :
<span className={"ml10 color-orange"}>
{taskslistdata&&taskslistdata.left_time.time}</span>
</span>
</Tooltip>
</div> </div>
:""}
</div> </div>
@ -1785,9 +1801,13 @@ class GraduationTaskssettinglist extends Component{
<div id="graduation_work_list" style={{ padding: '18px 40px 10px',height: '56px'}}> <div id="graduation_work_list" style={{ padding: '18px 40px 10px',height: '56px'}}>
<div className="clearfix">
<span className="fl color-grey-6 font-12"><span className="color-orange-tip">{taskslistdata&&taskslistdata.work_count}</span>{taskslistdata&&taskslistdata.work_count} </span>
{this.props.isAdmin()===true?
<div className="clearfix">
<span className="fl color-grey-6 font-12">
<span className="color-orange-tip">{taskslistdata&&taskslistdata.work_count}</span>
个检索结果{taskslistdata&&taskslistdata.work_count} 学生
</span>
<div className="fr color-grey-6 edu-menu-panel"> <div className="fr color-grey-6 edu-menu-panel">
<p><a data-remote="true"> <p><a data-remote="true">
{order==="updated_at"?"时间":order==="work_score"?"成绩":order==="student_id"?"学号":""}排序</a><i {order==="updated_at"?"时间":order==="work_score"?"成绩":order==="student_id"?"学号":""}排序</a><i
@ -1801,8 +1821,29 @@ class GraduationTaskssettinglist extends Component{
</li> </li>
</ul> </ul>
</div> </div>
</div>
:""}
{this.props.isStudent()===true?
<div className="clearfix">
<span className="mr15 color-grey9">
<span className={"color-orange"}>{taskslistdata&&taskslistdata.commit_count}
</span> </span>
<span className="mr15 color-grey9">
<span className={"color-orange"}>{taskslistdata&&taskslistdata.uncommit_count}
</span> </span>
<Tooltip title={taskslistdata&&taskslistdata.left_time.status} placement="bottom">
<span className="mr15 color-grey9">
{taskslistdata&&taskslistdata.left_time.status} :
<span className={"ml10 color-orange"}>
{taskslistdata&&taskslistdata.left_time.time}</span>
</span>
</Tooltip>
</div> </div>
:""}
</div> </div>

@ -1,5 +1,5 @@
import React,{ Component } from "react"; import React,{ Component } from "react";
import { Input,Checkbox,Table, Pagination, Modal,Menu ,Spin} from "antd"; import { Input,Checkbox,Table, Pagination, Modal,Menu ,Spin, Tooltip} from "antd";
import ClipboardJS from 'clipboard' import ClipboardJS from 'clipboard'
import '../css/Courses.css' import '../css/Courses.css'
import '../css/members.css' import '../css/members.css'
@ -31,14 +31,6 @@ const dataSource = [{
const buildColumns = (that) => { const buildColumns = (that) => {
const columns=[{ const columns=[{
title: '',
dataIndex: 'check',
key: 'check',
render: (text, item) => {
return <Checkbox value={item.course_member_id}></Checkbox>
},
width:"5%"
},{
title: '序号', title: '序号',
dataIndex: 'id', dataIndex: 'id',
key: 'id', key: 'id',
@ -71,10 +63,23 @@ const buildColumns = (that) => {
width:"50%", width:"50%",
className:"color-grey-6" className:"color-grey-6"
}]; }];
const isAdmin = that.props.isAdmin()
if (isAdmin) {
columns.unshift({
title: '',
dataIndex: 'check',
key: 'check',
render: (text, item) => {
return <Checkbox value={item.course_member_id}></Checkbox>
},
width:"5%"
})
}
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;
@ -312,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);
@ -357,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);
@ -423,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
@ -445,7 +453,14 @@ class studentsList extends Component{
<span className="color-orange font-16"> <span className="color-orange font-16">
{invite_code} {invite_code}
</span> </span>
<Tooltip title={<div>
<div>成员可以通过邀请码主动加入课堂</div>
<div>点击立刻复制邀请码</div>
</div>}>
<span>
<i class="iconfont icon-fuzhi font-14 ml10 copybtn" style={{color: '#FF6800', cursor: 'pointer', verticalAlign: 'baseline'}} data-clipboard-text={invite_code} ></i> <i class="iconfont icon-fuzhi font-14 ml10 copybtn" style={{color: '#FF6800', cursor: 'pointer', verticalAlign: 'baseline'}} data-clipboard-text={invite_code} ></i>
</span>
</Tooltip>
</React.Fragment> </React.Fragment>
} }
@ -528,7 +543,7 @@ class studentsList extends Component{
total_count > 0 ? total_count > 0 ?
<div className="mt20 edu-back-white padding20"> <div className="mt20 edu-back-white padding20">
<div className="clearfix stu_head" style={{paddingLeft: '15px'}}> <div className="clearfix stu_head" style={{paddingLeft: '15px'}}>
<Checkbox className="fl" onChange={this.onCheckAll} checked={checkAllValue} >已选 {checkBoxValues.length} </Checkbox> {isAdmin && <Checkbox className="fl" onChange={this.onCheckAll} checked={checkAllValue} >已选 {checkBoxValues.length} </Checkbox>}
<div className="studentList_operation_ul"> <div className="studentList_operation_ul">
{isAdmin && <li className="li_line"><a href="javascript:void(0)" className="color-grey-9" onClick={this.onDelete}>删除</a></li>} {isAdmin && <li className="li_line"><a href="javascript:void(0)" className="color-grey-9" onClick={this.onDelete}>删除</a></li>}
{isAdmin && <li className="li_line drop_down"> {isAdmin && <li className="li_line drop_down">
@ -562,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>

@ -32,13 +32,6 @@ function buildColumns(that) {
const isAdminOrTeacher = that.props.isAdminOrTeacher() const isAdminOrTeacher = that.props.isAdminOrTeacher()
const { course_groups } = that.state const { course_groups } = that.state
const columns = [{ const columns = [{
title: '',
dataIndex: 'course_member_id',
key: 'course_member_id',
render: (content, item, index) => {
return <Checkbox value={content}></Checkbox>
}
},{
title: '序号', title: '序号',
// dataIndex: 'name', // dataIndex: 'name',
key: 'index', key: 'index',
@ -62,7 +55,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',
@ -116,7 +109,8 @@ function buildColumns(that) {
} }
, ,
}); });
if (that.hasGraduationModule()) { const hasGraduationModule = that.hasGraduationModule()
if (hasGraduationModule) {
columns.push({ columns.push({
title: '答辩组', title: '答辩组',
key: 'graduation_group', key: 'graduation_group',
@ -156,6 +150,16 @@ function buildColumns(that) {
}, },
}) })
} }
if(isAdmin && hasGraduationModule) {
columns.unshift({
title: '',
dataIndex: 'course_member_id',
key: 'course_member_id',
render: (content, item, index) => {
return <Checkbox value={content}></Checkbox>
}
})
}
return columns return columns
} }
@ -185,7 +189,7 @@ class studentsList extends Component{
searchValue:e.target.value searchValue:e.target.value
}) })
} }
// approval 2 - 拒绝
onAgree = (record, approval = 1) => { onAgree = (record, approval = 1) => {
const courseId = this.props.match.params.coursesId const courseId = this.props.match.params.coursesId
@ -198,7 +202,7 @@ class studentsList extends Component{
}) })
.then((response) => { .then((response) => {
if (response.data.status == 0) { if (response.data.status == 0) {
this.props.showNotification(`${approval ? '同意' : '拒绝'}`) this.props.showNotification(`${approval == 1? '同意' : '拒绝'}`)
this.fetchAll(1) this.fetchAll(1)
} }
}) })
@ -216,14 +220,22 @@ class studentsList extends Component{
}) })
this.fetchAll(1); this.fetchAll(1);
const isAdminOrTeacher = this.props.isAdminOrTeacher() const isAdminOrTeacher = this.props.isAdminOrTeacher()
const isAdmin = this.props.isAdmin()
isAdminOrTeacher && this.getGroupList(); isAdminOrTeacher && this.getGroupList();
this.getCourseGroups(); this.getCourseGroups();
on('addTeacherSuccess', this.addTeacherSuccessListener) on('addTeacherSuccess', this.addTeacherSuccessListener)
isAdmin && on('updateNavSuccess', this.updateNavSuccess)
} }
componentWillUnmount() { componentWillUnmount() {
off('addTeacherSuccess', this.addTeacherSuccessListener) off('addTeacherSuccess', this.addTeacherSuccessListener)
const isAdmin = this.props.isAdmin()
isAdmin && off('updateNavSuccess', this.updateNavSuccess)
}
updateNavSuccess = () => {
this.getCourseGroups()
} }
addTeacherSuccessListener = (e, data) => { addTeacherSuccessListener = (e, data) => {
// const params = JSON.parse(data) // const params = JSON.parse(data)
@ -454,6 +466,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()
} }
}) })
@ -499,6 +512,7 @@ class studentsList extends Component{
}) })
} }
const isAdminOrTeacher = this.props.isAdminOrTeacher() const isAdminOrTeacher = this.props.isAdminOrTeacher()
const hasGraduationModule = this.hasGraduationModule()
return( return(
<React.Fragment> <React.Fragment>
@ -544,9 +558,9 @@ class studentsList extends Component{
`}</style> `}</style>
<div className="mt20 edu-back-white padding20 teacherList"> <div className="mt20 edu-back-white padding20 teacherList">
<div className="clearfix stu_head" style={{paddingLeft: '15px'}}> <div className="clearfix stu_head" style={{paddingLeft: '15px'}}>
<Checkbox className="fl" onChange={this.onCheckAll} checked={checkAllValue} >已选 {checkBoxValues.length} </Checkbox> { isAdmin && hasGraduationModule && <Checkbox className="fl" onChange={this.onCheckAll} checked={checkAllValue} >已选 {checkBoxValues.length} </Checkbox> }
{ <div className="studentList_operation_ul"> { <div className="studentList_operation_ul">
{ this.hasGraduationModule() && isAdminOrTeacher && <li className="li_line drop_down"> { hasGraduationModule && isAdminOrTeacher && <li className="li_line drop_down">
加入答辩组<i className="iconfont icon-xiajiantou font-12 ml2"></i> 加入答辩组<i className="iconfont icon-xiajiantou font-12 ml2"></i>
<ul className="drop_down_menu" style={{"right":"0px","left":"unset", minWidth: '222px'}}> <ul className="drop_down_menu" style={{"right":"0px","left":"unset", minWidth: '222px'}}>

@ -340,8 +340,8 @@ class PollDetailTabForthRules extends Component{
<div className="bor-top-greyE pt20"> <div className="bor-top-greyE pt20">
<p className="clearfix mb10"> <p className="clearfix mb10">
<span className="fl with40 pr20">&nbsp;</span> <span className="fl with40 pr20">&nbsp;</span>
<span className="fl pr20 color-grey-c with25">(学生收到{this.props.type==="Exercise"?"试卷":"问卷"}的时间)</span> <span className="fl pr20 color-grey-c with25">(学生收到{this.props.moduleName || (this.props.type==="Exercise"?"试卷":"问卷")}的时间)</span>
<span className="fl color-grey-c">(学生可以答题的时间截点)</span> <span className="fl color-grey-c">({this.props.moduleName == '作业' ? '学生“按时”提交作品的时间截点' : '学生可以答题的时间截点'})</span>
</p> </p>
{ {

@ -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: "",
} }

@ -210,7 +210,7 @@ class ShixunhomeWorkItem extends Component{
</div> </div>
<div className="task-popup-submit clearfix"> <div className="task-popup-submit clearfix">
<a className="task-btn task-btn-orange fr mr51" <a className="task-btn task-btn-orange fr mr51"
onClick={() => this.hidestartshixunsreplace(hidestartshixunsreplacevalue)}>知道了</a> onClick={() => this.hidestartshixunsreplace(hidestartshixunsreplacevalue)}>知道了</a>
</div> </div>
</Modal> </Modal>
<Modal <Modal

@ -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,12 +57,11 @@ 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 >
@ -71,7 +73,55 @@ class TraineetraininginformationModal extends Component {
title: '完成时间', title: '完成时间',
dataIndex: 'name', dataIndex: 'name',
key: 'name', key: 'name',
width: 150, 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>
),
}
];
const columnss = [
{
title: '关卡',
dataIndex: 'number',
key: 'number',
width: 92,
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", align: "center",
render: (text, record) => ( render: (text, record) => (
<span > <span >
@ -83,11 +133,12 @@ class TraineetraininginformationModal extends Component {
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>
), ),
}, },
@ -95,7 +146,7 @@ class TraineetraininginformationModal extends Component {
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>
@ -106,7 +157,7 @@ class TraineetraininginformationModal extends Component {
{ {
title: '经验值', title: '经验值',
key: 'classroom', key: 'classroom',
width: 150, width: 92,
dataIndex: 'classroom', dataIndex: 'classroom',
align: "center", align: "center",
render: (text, record) => ( render: (text, record) => (
@ -128,18 +179,22 @@ 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}`}
@ -154,9 +209,11 @@ class TraineetraininginformationModal extends Component {
<li className="mt20"> <span style={{"color":"#989898"}}>课堂最高完成效率</span> <span style={{"color":"#4C4C4C"}}>{this.props.viewtrainingdata === undefined ? "" :this.props.viewtrainingdata.max_efficiency} </span> </li> <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> <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?
<div>
<style> <style>
{ {
` .ant-table-body{ ` .ant-table-body{
@ -165,9 +222,18 @@ class TraineetraininginformationModal extends Component {
} }
</style> </style>
:"" <div className={"both"}></div>
} {this.props.game_list === undefined ? "" : <Table
className="mt20"
dataSource={this.props.game_list}
columns={columns}
loading={false}
pagination={false}
onChange={this.TablePagination}
/>}
</div>
:
<div>
<div className={"both"}></div> <div className={"both"}></div>
{this.props.game_list === undefined ? "" : <Table {this.props.game_list === undefined ? "" : <Table
className="mt20" className="mt20"
@ -183,6 +249,10 @@ class TraineetraininginformationModal extends Component {
onChange={this.TablePagination} onChange={this.TablePagination}
scroll={{ y: 300 }} scroll={{ y: 300 }}
/>} />}
</div>
}
</Modal> </Modal>

@ -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,11 +637,12 @@ class Trainingjobsetting extends Component {
//允许补交 //允许补交
onChanges = (e) => { onChanges = (e) => {
// debugger // console.log("640");
// 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'),
@ -955,26 +956,60 @@ class Trainingjobsetting extends Component {
disabledEndDate = (end_time) => { // disabledEndDate = (end_time) => {
const publish_time = this.state.publish_time; // const publish_time = this.state.publish_time;
if (!end_time || !publish_time) { // if (!end_time || !publish_time) {
// return false;
// }
// return end_time.valueOf() <= publish_time.valueOf();
//
// }
// disabledEndDates = (end_time) => {
// const publish_time = this.state.end_time
// if (!end_time || !publish_time) {
// return false;
// }
// console.log("end_time.valueOf()")
// // console.log(end_time.valueOf());
// // console.log(publish_time.valueOf());
// return end_time.valueOf() <= publish_time.valueOf();
//
//
// }
disabledStartDatestart= (startValue) => {
const endValue = this.state.end_time
if (!startValue || !endValue) {
return false; return false;
} }
return end_time.valueOf() <= publish_time.valueOf(); var endValues= moment(endValue).subtract(1, 'days');
return startValue.valueOf() > endValues.valueOf();
};
} disabledEndDateend = (endValue) => {
disabledEndDates = (end_time) => { const startValue = this.state.publish_time;
const publish_time = this.state.end_time if (!endValue || !startValue) {
if (!end_time || !publish_time) {
return false; return false;
} }
console.log("end_time.valueOf()") var endValuesys= moment(startValue).subtract(1, 'days');
// console.log(end_time.valueOf());
// console.log(publish_time.valueOf()); return endValue.valueOf() <= endValuesys.valueOf();
return end_time.valueOf() <= publish_time.valueOf(); };
disabledEndDateendd = (endsValue) => {
const endValues = this.state.end_time
if (!endsValue|| !endValues) {
return false;
} }
var endValuesyss= moment(endValues).subtract(1, 'days');
return endsValue.valueOf() <= endValuesyss.valueOf();
};
onChangedata = (field, value, dateString) => { onChangedata = (field, value, dateString) => {
this.setState({ this.setState({
[field]: handleDateString(dateString), [field]: handleDateString(dateString),
@ -1085,7 +1120,10 @@ class Trainingjobsetting extends Component {
// console.log(value); // console.log(value);
console.log(dateString); console.log(dateString);
// console.log(handleDateString(dateString)); // console.log(handleDateString(dateString));
this.onChangedata('publish_time', value, dateString); // this.onChangedata('publish_time', value, dateString);
this.setState({
publish_time:moment(handleDateString(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)).add(1, 'months'),
@ -1123,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
@ -1144,11 +1184,13 @@ class Trainingjobsetting extends Component {
} catch (e) { } catch (e) {
} }
this.onChangedata('end_time', value, dateString); // this.onChangedata('end_time', value, dateString);
if(this.state.allowreplenishment === "允许补交"){ if(this.state.allowreplenishment === "允许补交"){
this.setState({ this.setState({
late_time:moment(handleDateString(dateString)).add(1, 'months'), end_time:moment(handleDateString(dateString)),
late_times: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_times:moment(handleDateString(dateString)).add(2, 'months').format('YYYY-MM-DD HH:mm'),
}) })
} }
@ -1164,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)) {
@ -1172,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) {
} }
@ -1206,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);
} }
} }
@ -1587,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>
@ -1611,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
@ -1647,7 +1712,7 @@ class Trainingjobsetting extends Component {
<DatePicker <DatePicker
showToday={false} showToday={false}
id={"publishtimeid"} id={"publishtimeid"}
disabledDate={this.disabledDateTime} disabledDate={this.disabledStartDatestart}
disabledTime={disabledDateTime} disabledTime={disabledDateTime}
className={borreds} className={borreds}
showTime={{ format: 'HH:mm' }} showTime={{ format: 'HH:mm' }}
@ -1679,7 +1744,6 @@ class Trainingjobsetting extends Component {
<DatePicker <DatePicker
showToday={false} showToday={false}
id={"end_timeid"} id={"end_timeid"}
disabledDate={this.disabledDateTime}
disabledTime={disabledDateTime} disabledTime={disabledDateTime}
showTime={{ format: 'HH:mm' }} showTime={{ format: 'HH:mm' }}
className={borredss} className={borredss}
@ -1712,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)}
@ -1760,7 +1825,6 @@ class Trainingjobsetting extends Component {
<DatePicker <DatePicker
showToday={false} showToday={false}
id={"late_timeid"} id={"late_timeid"}
disabledDate={this.disabledEndDates}
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)}
@ -1806,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>
@ -1820,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"}}
@ -1867,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>
@ -1879,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,7 +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?"无":
<div dangerouslySetInnerHTML={{__html:markdownToHTML(jobsettingsdata.data.explanation).replace(/▁/g,"▁▁▁")}}></div> <div dangerouslySetInnerHTML={{__html:markdownToHTML(jobsettingsdata.data.explanation).replace(/▁/g,"▁▁▁")}}></div>
} }
</div> </div>

@ -7,6 +7,7 @@
width:237px!important; width:237px!important;
height: 30px; height: 30px;
margin-bottom: 30px; margin-bottom: 30px;
margin-right: 35px;
} }
.search-new-input { .search-new-input {
padding-left: 16px; padding-left: 16px;

@ -149,7 +149,7 @@ class EducoderLogin extends Component {
"align-items": "center", "align-items": "center",
"width": "100%", "width": "100%",
}}> }}>
<div style={{"margin-top": "40px","height":"500px"}}> <div style={{"margin-top": "40px","height":"530px"}}>
<LoginRegisterComponent {...this.props} {...this.state} <LoginRegisterComponent {...this.props} {...this.state}
Setshowbool={this.Setshowbool} ></LoginRegisterComponent> Setshowbool={this.Setshowbool} ></LoginRegisterComponent>
@ -163,7 +163,7 @@ class EducoderLogin extends Component {
"align-items": "center", "align-items": "center",
"width": "100%", "width": "100%",
}}> }}>
<div style={{"margin-top": "40px","height":"500px"}}> <div style={{"margin-top": "40px","height":"530px"}}>
<FindPasswordComponent {...this.props} {...this.state} <FindPasswordComponent {...this.props} {...this.state}
Setshowbool={this.Setshowbool}></FindPasswordComponent> Setshowbool={this.Setshowbool}></FindPasswordComponent>
@ -171,15 +171,13 @@ class EducoderLogin extends Component {
</div> </div>
} }
<div style={{"height":"250px", <div style={{"height":"180px",
"display": "flex", "display": "flex",
"justify-content": "center", "justify-content": "center",
"align-items": "center", "align-items": "center",
"width": "100%", "width": "100%",
}}> }}>
<div className="font-14 color-grey-9 " style={{marginTop:"15px"}}>© 2019 EduCoder 湘ICP备17009477号 Trustie & IntelliDE inside</div> <div className="font-14 color-grey-9 " style={{marginTop:"15px"}}><span className="font-18">©</span>&nbsp;2019&nbsp;EduCoder<span className="ml15 mr15">ICP17009477</span><a href="https://team.trustie.net" style={{"color":"#888"}} target="_blank">Trustie</a>&nbsp;&nbsp;&nbsp;&amp;&nbsp;&nbsp;&nbsp;IntelliDE inside.</div>
</div> </div>
</div> </div>
</div> </div>

@ -12,7 +12,7 @@ import {broadcastChannelPostMessage} from 'educoder'
import {Tabs, Input, Checkbox, Button, notification, Menu} from 'antd'; import {Tabs, Input, Checkbox, Button, notification, Menu} from 'antd';
//试用申请页面 //试用申请
class Trialapplication extends Component { class Trialapplication extends Component {
// isRender控制弹出窗口显示 // isRender控制弹出窗口显示
constructor(props) { constructor(props) {
@ -34,8 +34,8 @@ class Trialapplication extends Component {
showTrial: false, showTrial: false,
} }
//user_phone_binded 判断是否手机号验证 //user_phone_binded 判断是否手机号验证
console.log("Trialapplication"); // console.log("Trialapplication");
console.log(props); // console.log(props);
} }
Cancel = () => { Cancel = () => {
@ -77,9 +77,9 @@ class Trialapplication extends Component {
//TODO 这里如果样式变了会出现css不加载的情况 //TODO 这里如果样式变了会出现css不加载的情况
}); });
console.log(this.props.isRenders); // console.log(this.props.isRenders);
console.log("89"); // console.log("89");
console.log(this.state.props.user_phone_binded ); // console.log(this.state.props.user_phone_binded );
try { try {
if (this.state.props.user_phone_binded !== undefined) { if (this.state.props.user_phone_binded !== undefined) {
console.log(this.state.props.user_phone_binded); console.log(this.state.props.user_phone_binded);

@ -212,6 +212,7 @@ button.buttonHoverColor:hover a {
margin: 0 auto; margin: 0 auto;
} }
/* Dialog */ /* Dialog */
#alert-dialog-title>h2 { #alert-dialog-title>h2 {
text-align: center; text-align: center;

@ -461,9 +461,10 @@ class DetailCardsEditAndAdd extends Component{
</span> </span>
<div className="fr search-new"> <div className="fr search-new">
<Search <Search
placeholder="输入实训名称的关键字搜索" placeholder="请输入创建者或者实训名称进行搜索"
onInput={this.searchNameInput} onInput={this.searchNameInput}
onSearch={()=>this.changeTag(`${type}`,`${search}`)} onSearch={()=>this.changeTag(`${type}`,`${search}`)}
style={{width: '115%'}}
></Search> ></Search>
</div> </div>
</div> </div>

@ -503,9 +503,10 @@ class DetailCardsEditAndEdit extends Component{
</span> </span>
<div className="fr search-new"> <div className="fr search-new">
<Search <Search
placeholder="输入实训名称的关键字搜索" placeholder="请输入创建者或者实训名称进行搜索"
onInput={this.searchNameInput} onInput={this.searchNameInput}
onSearch={()=>this.changeTag(`${type}`,`${search}`)} onSearch={()=>this.changeTag(`${type}`,`${search}`)}
style={{width: '115%'}}
></Search> ></Search>
</div> </div>
</div> </div>

@ -170,10 +170,11 @@ class NewHeader extends Component {
submitapplications:false, submitapplications:false,
isRender:false, isRender:false,
isRenders:false, isRenders:false,
user_phone_binded:false,
showTrial:false, showTrial:false,
} }
console.log("176") // console.log("176")
console.log(props); // console.log(props);
} }
componentDidMount() { componentDidMount() {
@ -207,7 +208,20 @@ class NewHeader extends Component {
} }
componentDidUpdate = (prevProps) => {
if(prevProps.user!=this.props.user){
// console.log("216")
// console.log(prevProps.user);
// console.log(this.props.user);
if(this.props.user !== undefined){
this.setState({
user_phone_binded :this.props.user.user_phone_binded,
})
}
}
}
componentWillReceiveProps(newProps, oldProps) { componentWillReceiveProps(newProps, oldProps) {
this.setState({ this.setState({
user:newProps.user user:newProps.user
@ -330,6 +344,24 @@ class NewHeader extends Component {
}) })
} }
educoderlogin=()=>{ educoderlogin=()=>{
//退出账号
this.setState({
isRender:true
})
// var url = `/accounts/logout.json`;
//
// axios.get((url)).then((result) => {
// if(result!==undefined){
// // this.setState({
// // isRender:true
// // })
// window.location.href = "/";
// }
// }).catch((error) => {
// console.log(error);
// })
}
educoderloginysl=()=>{
//退出账号 //退出账号
// this.setState({ // this.setState({
// isRender:true // isRender:true
@ -347,7 +379,6 @@ class NewHeader extends Component {
console.log(error); console.log(error);
}) })
} }
onKeywordSearch = () => { onKeywordSearch = () => {
header_search(this) header_search(this)
} }
@ -550,6 +581,7 @@ submittojoinclass=(value)=>{
user, user,
isRender, isRender,
isRenders, isRenders,
user_phone_binded,
}=this.state; }=this.state;
/* /*
用户名称 用户头像url 用户名称 用户头像url
@ -571,11 +603,11 @@ submittojoinclass=(value)=>{
}else { }else {
activeIndex = true; activeIndex = true;
} }
// join_course_url: "https://www.educoder.net/courses/join_course_multi_role" // join_course_url: "https://www.educoder.net/courses/join_course_multi_role"
// join_project_url: "https://www.educoder.net/applied_project/applied_project_info" // join_project_url: "https://www.educoder.net/applied_project/applied_project_info"
// rolearr:["",""], // rolearr:["",""],
// console.log() // console.log("618");
// console.log(user_phone_binded);
return ( return (
<div className="newHeader" id="nHeader"> <div className="newHeader" id="nHeader">
@ -595,7 +627,7 @@ submittojoinclass=(value)=>{
{/* />*/} {/* />*/}
{/* :""*/} {/* :""*/}
{/*}*/} {/*}*/}
<Trialapplication {...this.state} user_phone_binded={user_phone_binded} ></Trialapplication>
<div className="educontent clearfix"> <div className="educontent clearfix">
{/*<%= link_to image_tag("/images/educoder/logo.png", alt:"高校智能化教学与实训平台", className:"logoimg"), home_path %>*/} {/*<%= link_to image_tag("/images/educoder/logo.png", alt:"高校智能化教学与实训平台", className:"logoimg"), home_path %>*/}
<a href="/"> <a href="/">
@ -729,7 +761,7 @@ submittojoinclass=(value)=>{
<li className="bor-top-greyE"> <li className="bor-top-greyE">
{/*<a href={this.props.Headertop===undefined?"":this.props.Headertop.logout_url}>退出</a>*/} {/*<a href={this.props.Headertop===undefined?"":this.props.Headertop.logout_url}>退出</a>*/}
{/*<a onClick={()=>this.educoderlogin()}>退出</a>*/} {/*<a onClick={()=>this.educoderlogin()}>退出</a>*/}
<a onClick={()=>this.educoderlogin()}>退出</a> <a onClick={()=>this.educoderloginysl()}>退出</a>
</li> </li>
</ul> </ul>

@ -59,6 +59,7 @@ class TPMBanner extends Component {
hidestartshixunsreplacevalue:"", hidestartshixunsreplacevalue:"",
isIE:false, isIE:false,
Forkvisibletype: false, Forkvisibletype: false,
isSpin:false,
} }
} }
@ -322,28 +323,38 @@ class TPMBanner extends Component {
// } // }
hidestartshixunsreplace=(url)=>{ hidestartshixunsreplace=(url)=>{
this.setState({
isSpin:true,
})
axios.get(url).then((response) => { axios.get(url).then((response) => {
if(response.status===200){ if(response.status===200){
let path="/shixuns/"+response.data.shixun_identifier+"/challenges"; // let path="/shixuns/"+response.data.shixun_identifier+"/challenges";
this.props.history.push(path); // this.props.history.push(path);
message.success('重置成功,正在进入实训!');
this.startshixunCombat(response.data.shixun_identifier);
this.setState({ this.setState({
shixunsreplace:false shixunsreplace:false,
isSpin:false,
}) })
message.success('重置成功,正在进入实训!');
this.startshixunCombat(); // message.success('重置成功,正在进入实训!');
// this.startshixunCombat();
}} }}
).catch((error) => { ).catch((error) => {
this.setState({ this.setState({
startbtn:false, startbtn:false,
shixunsreplace:false shixunsreplace:false,
isSpin:false
}) })
}); });
} }
//开始实战按钮 //开始实战按钮
startshixunCombat=()=>{ startshixunCombat=(id)=>{
let {shixunsDetails} = this.props let {shixunsDetails} = this.props
if( shixunsDetails.status>1){ if( shixunsDetails.shixun_status>1){
this.setState({ this.setState({
startbtn:true, startbtn:true,
hidestartshixunsreplacevalue:"" hidestartshixunsreplacevalue:""
@ -355,7 +366,6 @@ class TPMBanner extends Component {
} }
let id = this.props.match.params.shixunId;
let url="/shixuns/"+id+"/shixun_exec.json"; let url="/shixuns/"+id+"/shixun_exec.json";
axios.get(url).then((response) => { axios.get(url).then((response) => {
if(response.status===200){ if(response.status===200){
@ -366,6 +376,7 @@ class TPMBanner extends Component {
shixunsreplace:true, shixunsreplace:true,
hidestartshixunsreplacevalue:response.data.message+".json" hidestartshixunsreplacevalue:response.data.message+".json"
}) })
// this.shixunexec(response.data.message+".json")
}else if(response.data.status===-1){ }else if(response.data.status===-1){
console.log(response) console.log(response)
}else if(response.data.status===-3){ }else if(response.data.status===-3){
@ -452,11 +463,11 @@ class TPMBanner extends Component {
// //
// } // }
if(shixunsDetails!=undefined){ if(shixunsDetails!=undefined){
if (shixunsDetails.status === 0 ) { if (shixunsDetails.shixun_status === 0 ) {
challengeBtnText = '继续实战' challengeBtnText = '继续实战'
} else if (shixunsDetails.status === 1) { } else if (shixunsDetails.shixun_status === 1) {
challengeBtnText = '查看实战' challengeBtnText = '查看实战'
} else if (shixunsDetails.status === 3) { } else if (shixunsDetails.shixun_status === 3) {
challengeBtnText = '继续实战' challengeBtnText = '继续实战'
}else{ }else{
challengeBtnText = "开始实战" challengeBtnText = "开始实战"
@ -505,7 +516,7 @@ class TPMBanner extends Component {
lineHeight: '30px', lineHeight: '30px',
}; };
const antIcon = <Icon type="loading" style={{ fontSize: 24 }} spin />;
return ( return (
shixunsDetails===undefined?"": shixunsDetails===undefined?"":
@ -625,11 +636,11 @@ class TPMBanner extends Component {
shixunsDetails.task_operation[0] === "查看实战" ? "查看我的实战光辉历史" : shixunsDetails.task_operation[0] === "查看实战" ? "查看我的实战光辉历史" :
shixunsDetails.task_operation[0] === "模拟实战" ? "模拟完成实战任务" : shixunsDetails.task_operation[0] === "开启挑战" ? "开始学习并完成实战任务" : "" shixunsDetails.task_operation[0] === "模拟实战" ? "模拟完成实战任务" : shixunsDetails.task_operation[0] === "开启挑战" ? "开始学习并完成实战任务" : ""
}> }>
<a onClick={this.startshixunCombat} <a onClick={()=>this.startshixunCombat(this.props.match.params.shixunId)}
className="fr user_default_btn task-btn-orange font-18" className="fr user_default_btn task-btn-orange font-18"
id="shixun_operation" data-remote="true" id="shixun_operation" data-remote="true"
> >
{shixunsDetails.task_operation === undefined ? "" : shixunsDetails.status > 1 ? shixunsDetails.task_operation[0] : "模拟实战"} {shixunsDetails.task_operation === undefined ? "" : shixunsDetails.shixun_status > 1 ? shixunsDetails.task_operation[0] : "模拟实战"}
</a> </a>
</Tooltip> </Tooltip>
: "" : ""
@ -662,13 +673,15 @@ class TPMBanner extends Component {
closable={false} closable={false}
footer={null} footer={null}
> >
<Spin indicator={antIcon} spinning={this.state.isSpin}>
<div className="task-popup-content"> <div className="task-popup-content">
<p className="task-popup-text-center font-16 pb20">实训已经更新了正在为您重置!</p> <p className="task-popup-text-center font-16 pb20">实训已经更新了正在为您重置!</p>
</div> </div>
<div className="task-popup-submit clearfix"> <div className="task-popup-submit clearfix">
<a className="task-btn task-btn-orange fr mr51" <a className="task-btn task-btn-orange fr mr51"
onClick={() => this.hidestartshixunsreplace(hidestartshixunsreplacevalue)}>知道了</a> onClick={() => this.hidestartshixunsreplace(hidestartshixunsreplacevalue)}>知道了</a>
</div> </div>
</Spin>
</Modal> </Modal>
<Modal <Modal
@ -694,7 +707,7 @@ class TPMBanner extends Component {
{/*>{shixunsDetails.task_operation===undefined?"":shixunsDetails.task_operation[0]}</a>:""*/} {/*>{shixunsDetails.task_operation===undefined?"":shixunsDetails.task_operation[0]}</a>:""*/}
{/*}*/} {/*}*/}
{shixunsDetails.status === 0 && this.props.identity < 4 ? {shixunsDetails.shixun_status === 0 && this.props.identity < 4 ?
<a onClick={this.applyrelease} className="fr user_default_btn user_blue_btn mr20 font-18 height39" <a onClick={this.applyrelease} className="fr user_default_btn user_blue_btn mr20 font-18 height39"
id="challenge_begin">申请发布</a> : "" id="challenge_begin">申请发布</a> : ""
} }
@ -759,7 +772,7 @@ class TPMBanner extends Component {
</Modal> </Modal>
{shixunsDetails.status === 1 && this.props.identity < 4 ? {shixunsDetails.shixun_status === 1 && this.props.identity < 4 ?
<a onClick={this.cancel_publish} className="fr user_default_btn user_blue_btn mr20 font-18 height39" <a onClick={this.cancel_publish} className="fr user_default_btn user_blue_btn mr20 font-18 height39"
id="challenge_begin">撤销发布</a> : "" id="challenge_begin">撤销发布</a> : ""
} }
@ -768,7 +781,7 @@ class TPMBanner extends Component {
<a onClick={this.Senttothe} <a onClick={this.Senttothe}
className="fr user_default_btn user_blue_btn mr20 font-18" className="fr user_default_btn user_blue_btn mr20 font-18"
data-tip-down="" data-tip-down=""
style={{display: shixunsDetails.status === 0 || shixunsDetails.status === 3 ||shixunsDetails.status === 1 ? "none" : "block"}} style={{display: shixunsDetails.shixun_status === 0 || shixunsDetails.shixun_status === 3 ||shixunsDetails.shixun_status === 1 ? "none" : "block"}}
data-remote="true"> data-remote="true">
<Tooltip placement="bottom" title={"以实训作业的形式发送到我的课堂"}> <Tooltip placement="bottom" title={"以实训作业的形式发送到我的课堂"}>
发送至 发送至
@ -834,7 +847,7 @@ class TPMBanner extends Component {
</div> </div>
</Modal> </Modal>
{shixunsDetails.status === 3 && {shixunsDetails.shixun_status === 3 &&
<a className="fr user_default_btn edu-greyback-btn mr15 font-18">已关闭</a> <a className="fr user_default_btn edu-greyback-btn mr15 font-18">已关闭</a>
} }
@ -905,7 +918,7 @@ class TPMBanner extends Component {
</div> </div>
<div className="alert alert-orange mb15 mt15 clearfix" <div className="alert alert-orange mb15 mt15 clearfix"
style={{display:shixunsDetails.status === 1?"block":"none"}} style={{display:shixunsDetails.shixun_status === 1?"block":"none"}}
>正在等待管理员的审核在审核通过前可以随时撤销发布</div> >正在等待管理员的审核在审核通过前可以随时撤销发布</div>
</div> </div>

@ -183,10 +183,12 @@ export function TPMIndexHOC(WrappedComponent) {
// return false // return false
return this.state.coursedata&&this.state.coursedata.course_identity === 0 return this.state.coursedata&&this.state.coursedata.course_identity === 0
} }
// 管理员等
isAdminOrCreator = () => { isAdminOrCreator = () => {
// return this.state.coursedata&&this.state.coursedata.course_identity >= 0 && // return this.state.coursedata&&this.state.coursedata.course_identity >= 0 &&
return this.state.coursedata&&this.state.coursedata.course_identity < 3 return this.state.coursedata&&this.state.coursedata.course_identity < 3
} }
// 助教等
isAdminOrTeacher = () => { isAdminOrTeacher = () => {
// return this.state.coursedata&&this.state.coursedata.course_identity >= 0 && // return this.state.coursedata&&this.state.coursedata.course_identity >= 0 &&
return this.state.coursedata&&this.state.coursedata.course_identity < 4 return this.state.coursedata&&this.state.coursedata.course_identity < 4
@ -256,7 +258,6 @@ export function TPMIndexHOC(WrappedComponent) {
if (response.data) { if (response.data) {
this.initCommonState(response.data) this.initCommonState(response.data)
this.setState({ this.setState({
user_phone_binded:response.data.user_phone_binded,
tpmLoading: false, tpmLoading: false,
coursedata: { coursedata: {
course_identity: response.data.course_identity >= 0 ? response.data.course_identity : undefined, course_identity: response.data.course_identity >= 0 ? response.data.course_identity : undefined,
@ -274,7 +275,7 @@ export function TPMIndexHOC(WrappedComponent) {
}) })
} }
render() { render() {
let{Headertop,Footerdown,user_phone_binded}=this.state; let{Headertop,Footerdown}=this.state;
const common = { const common = {
isSuperAdmin:this.isSuperAdmin, isSuperAdmin:this.isSuperAdmin,
isAdminOrCreator:this.isAdminOrCreator, isAdminOrCreator:this.isAdminOrCreator,
@ -288,13 +289,7 @@ export function TPMIndexHOC(WrappedComponent) {
} }
return ( return (
<div> <div>
{/*{*/}
{/* user_phone_binded === undefined?*/}
{/* ""*/}
{/* :*/}
{/* <Trialapplication {...this.state} user_phone_binded={user_phone_binded} setTrialapplication = {this.setTrialapplication} ></Trialapplication>*/}
{/*}*/}
<SiderBar <SiderBar
Headertop={Headertop} Headertop={Headertop}

@ -1,5 +1,8 @@
import React, { Component } from 'react'; import React, { Component } from 'react';
import MonacoEditor from 'react-monaco-editor';
//MonacoDiffEditor 对比模式
import {Input, Select, Radio, Checkbox, Popconfirm, message, Modal,Icon,DatePicker} from 'antd'; import {Input, Select, Radio, Checkbox, Popconfirm, message, Modal,Icon,DatePicker} from 'antd';
// import "antd/dist/antd.css"; // import "antd/dist/antd.css";
@ -222,7 +225,8 @@ export default class TPMsettings extends Component {
pod_exist_time: undefined, pod_exist_time: undefined,
pod_exist_timetype: false, pod_exist_timetype: false,
shixunmemoMDvalue:"" shixunmemoMDvalue:"",
language:""
} }
} }
descriptionMD=(initValue, id)=> { descriptionMD=(initValue, id)=> {
@ -355,6 +359,8 @@ export default class TPMsettings extends Component {
// this.evaluate_scriptMD(response.data.shixun.evaluate_script, "shixunmemoMD"); // this.evaluate_scriptMD(response.data.shixun.evaluate_script, "shixunmemoMD");
this.descriptionMD(response.data.shixun.description, "shixundescription"); this.descriptionMD(response.data.shixun.description, "shixundescription");
// this.bigClass()
// if (response.data.shixun.status === 2) { // if (response.data.shixun.status === 2) {
// //
// } else if (response.data.shixun.status === 1) { // } else if (response.data.shixun.status === 1) {
@ -506,6 +512,7 @@ export default class TPMsettings extends Component {
} }
bigClass = (value) => { bigClass = (value) => {
let url = `/shixuns/get_mirror_script.json?mirror_id=`+value; let url = `/shixuns/get_mirror_script.json?mirror_id=`+value;
axios.get(url).then((response) => { axios.get(url).then((response) => {
if (response.status === 200) { if (response.status === 200) {
@ -891,6 +898,7 @@ export default class TPMsettings extends Component {
SelectScput = (value, e) => { SelectScput = (value, e) => {
this.setState({ this.setState({
choice_standard_scriptssum: value, choice_standard_scriptssum: value,
language:e.props.name,
choice_standard_scripts: {id:e.props.value,value:""}, choice_standard_scripts: {id:e.props.value,value:""},
standard_scriptsModal:true standard_scriptsModal:true
}) })
@ -1000,11 +1008,15 @@ export default class TPMsettings extends Component {
}) })
} }
getshixunmemoMDvalue=(e)=>{ getshixunmemoMDvalue=(value, e)=>{
this.setState({ this.setState({
shixunmemoMDvalue:e.target.value shixunmemoMDvalue:value
}) })
} }
render() { render() {
let { let {
postapplyvisible, postapplyvisible,
@ -1072,7 +1084,7 @@ export default class TPMsettings extends Component {
} }
const dateFormat = 'YYYY-MM-DD HH:mm:ss'; const dateFormat = 'YYYY-MM-DD HH:mm:ss';
let operateauthority=this.props.identity<4&&this.props.status==0||this.props.identity===1&&this.props.status==2||this.props.identity===1&&this.props.status==1; let operateauthority=this.props.identity===1?true:this.props.identity<4&&this.props.status==0;
return ( return (
<div className="educontent mt30 mb50" id="shixun_settings_show" onClick={this.bigopens} onMouseEnter={this.bigopens}> <div className="educontent mt30 mb50" id="shixun_settings_show" onClick={this.bigopens} onMouseEnter={this.bigopens}>
@ -1277,12 +1289,12 @@ export default class TPMsettings extends Component {
onMouseEnter={operateauthority?this.sbigopen:""} onMouseEnter={operateauthority?this.sbigopen:""}
onSelect={operateauthority?this.bigopens:""} onSelect={operateauthority?this.bigopens:""}
open={operss} open={operss}
value={choice_standard_scripts === undefined||choice_standard_scripts === null ? undefined : choice_standard_scripts.id} value={choice_standard_scripts === undefined||choice_standard_scripts === null ? undefined :choice_standard_scripts.id===undefined?choice_standard_scripts:choice_standard_scripts.id}
onChange={operateauthority?this.SelectScput:""}> onChange={operateauthority?this.SelectScput:""}>
{ {
standard_scripts === undefined ? "" : standard_scripts.map((item, key) => { standard_scripts === undefined ? "" : standard_scripts.map((item, key) => {
return ( return (
<Option value={item.id} name={item.scptname} key={key}>{item.scptname}</Option> <Option value={parseInt(item.id)} name={item.scptname} key={key}>{item.scptname}</Option>
) )
}) })
@ -1373,9 +1385,20 @@ export default class TPMsettings extends Component {
<div className="flex1"> <div className="flex1">
<div className="fl " id="shixunmemoMD" > <div className="fl " >
<textarea className={"shixunmemoMDdiv"} value={shixunmemoMDvalue} onInput={this.getshixunmemoMDvalue} name="content"> {/*<textarea className={"shixunmemoMDdiv"} value={shixunmemoMDvalue} onInput={this.getshixunmemoMDvalue} name="content">*/}
</textarea> {/*</textarea>*/}
<MonacoEditor
height="450"
width="1100"
language={this.state.language}
value={shixunmemoMDvalue}
options={ {
selectOnLineNumbers: true
}}
onChange={operateauthority===true?this.getshixunmemoMDvalue:""}
/>
</div> </div>

@ -75,13 +75,22 @@ a.newuse_scope-btn {
width:98% !important; width:98% !important;
height: 620px !important; height: 620px !important;
} }
#shixunmemoMDs{
width: 98% !important;
height: 420px !important;
}
#shixunmemoMDs .CodeMirror {
/* width: 548px !important; */
margin-top: 31px !important;
height: 402px !important;
}
.pdr20{ .pdr20{
padding-right:20px; padding-right:20px;
} }
.nonemodel{ .nonemodel{
width: 30%; width: 59%;
height: 624px; height: 468px;
/*background: rgba(0, 0, 0, 0.65);*/ /*background: rgba(0, 0, 0, 0.65);*/
background: #f5f5f5; background: #f5f5f5;
position: absolute; position: absolute;

@ -239,7 +239,7 @@ class Challenges extends Component {
<p className="clearfix mb30"> <p className="clearfix mb30">
<span className="font-16 fl">简介</span> <span className="font-16 fl">简介</span>
<a style={{ display: this.props.identity < 4 && this.props.status < 3 ? "block" : 'none' }} <a style={{ display: this.props.identity < 4 && ChallengesDataList&&ChallengesDataList.shixun_status < 3 ? "block" : 'none' }}
href={"/shixuns/" + id + "/settings?edit=1"} className="ring-green fr" href={"/shixuns/" + id + "/settings?edit=1"} className="ring-green fr"
data-tip-down="编辑"> data-tip-down="编辑">
<img src={getImageUrl("images/educoder/icon/edit.svg")} className="fl mt3 ml2" /> <img src={getImageUrl("images/educoder/icon/edit.svg")} className="fl mt3 ml2" />
@ -249,7 +249,7 @@ class Challenges extends Component {
<div className="justify break_full_word new_li markdown-body" <div className="justify break_full_word new_li markdown-body"
id="challenge_editorMd_description"> id="challenge_editorMd_description">
<p id="ReactMarkdown" style={{overflow:'hidden'}}> <p id="ReactMarkdown" style={{overflow:'hidden'}}>
{ChallengesDataList === undefined ? "" :ChallengesDataList.description===null?"": {ChallengesDataList === undefined ? "" :ChallengesDataList&&ChallengesDataList.description===null?"":
<div dangerouslySetInnerHTML={{__html: markdownToHTML(ChallengesDataList.description).replace(/▁/g,"▁▁▁")}}></div> <div dangerouslySetInnerHTML={{__html: markdownToHTML(ChallengesDataList.description).replace(/▁/g,"▁▁▁")}}></div>
} }
</p> </p>
@ -262,7 +262,7 @@ class Challenges extends Component {
<p className="clearfix mb10"> <p className="clearfix mb10">
<span className="font-16 fl">全部任务</span> <span className="font-16 fl">全部任务</span>
{this.props.identity < 4 && this.props.status === 0 ? {this.props.identity < 4 && ChallengesDataList&&ChallengesDataList.shixun_status=== 0 ?
<Link to={"/shixuns/" + id + "/challenges/new"} <Link to={"/shixuns/" + id + "/challenges/new"}
className="white-btn edu-greenline-btn fr" className="white-btn edu-greenline-btn fr"
// data-tip-down="新增代码编辑类型任务" // data-tip-down="新增代码编辑类型任务"
@ -275,7 +275,7 @@ class Challenges extends Component {
</Link> : "" </Link> : ""
} }
{this.props.identity < 4 && this.props.status === 0 ? {this.props.identity < 4 && ChallengesDataList&&ChallengesDataList.shixun_status=== 0 ?
<Link to={"/shixuns/" + id + "/challenges/newquestion"} <Link to={"/shixuns/" + id + "/challenges/newquestion"}
className="white-btn edu-greenline-btn fr mr20" className="white-btn edu-greenline-btn fr mr20"
// data-tip-down="新增选择题类型任务" // data-tip-down="新增选择题类型任务"
@ -359,7 +359,7 @@ class Challenges extends Component {
{item.delete_url != undefined && {item.delete_url != undefined &&
<Tooltip placement="bottom" title={"删除"}> <Tooltip placement="bottom" title={"删除"}>
<a onClick={() => this.delOperations(item.challenge_id)} <a onClick={() => this.delOperations(item.challenge_id)}
style={{ display: this.props.identity < 4 && this.props.status === 0 ? "block" : 'none' }} style={{ display:this.props.user.admin===true?"block":this.props.identity < 4 && ChallengesDataList.shixun_status === 0 ? "block" : 'none' }}
className="fl ring-op-green mr25"> className="fl ring-op-green mr25">
<img src={getImageUrl("images/educoder/icon/close.svg")} <img src={getImageUrl("images/educoder/icon/close.svg")}
className="fl mt5 ml5" /> className="fl mt5 ml5" />
@ -371,7 +371,7 @@ class Challenges extends Component {
{item.up_url != undefined && {item.up_url != undefined &&
<Tooltip placement="bottom" title={"向上移动"}> <Tooltip placement="bottom" title={"向上移动"}>
<a onClick={operationstrue===true?"":() => this.operations(item.challenge_id, "up")} <a onClick={operationstrue===true?"":() => this.operations(item.challenge_id, "up")}
style={{ display: this.props.identity < 4 && this.props.status === 0 ? "block" : 'none' }} style={{ display:this.props.user.admin===true?"block":this.props.identity < 4 && ChallengesDataList.shixun_status === 0 ? "block" : 'none' }}
className="fl ring-op-green mr25"> className="fl ring-op-green mr25">
<img src={getImageUrl("images/educoder/icon/moveup.svg")} <img src={getImageUrl("images/educoder/icon/moveup.svg")}
className="fl mt2 ml4" /> className="fl mt2 ml4" />
@ -381,7 +381,7 @@ class Challenges extends Component {
{item.down_url != undefined && {item.down_url != undefined &&
<Tooltip placement="bottom" title={"向下移动"}> <Tooltip placement="bottom" title={"向下移动"}>
<a onClick={operationstrue===true?"":() => this.operations(item.challenge_id, "down")} <a onClick={operationstrue===true?"":() => this.operations(item.challenge_id, "down")}
style={{ display: this.props.identity < 4 && this.props.status === 0 ? "block" : 'none' }} style={{ display: this.props.user.admin===true?"block":this.props.identity < 4 && ChallengesDataList.shixun_status=== 0 ? "block" : 'none' }}
className="fl ring-op-green mr25"> className="fl ring-op-green mr25">
<img src={getImageUrl("images/educoder/icon/movedown.svg")} className="fl mt2 ml4" /> <img src={getImageUrl("images/educoder/icon/movedown.svg")} className="fl mt2 ml4" />
</a> </a>
@ -393,7 +393,7 @@ class Challenges extends Component {
item.st === 1 ? item.st === 1 ?
<Tooltip placement="bottom" title={"编辑"}> <Tooltip placement="bottom" title={"编辑"}>
<a <a
style={{ display: this.props.identity < 4 && this.props.status < 3 ? "block" : 'none' }} style={{ display:this.props.user.admin===true?"block":this.props.identity < 4 && ChallengesDataList.shixun_status< 3 ? "block" : 'none' }}
href={"/shixuns/" + ChallengesDataList.shixun_identifier + "/challenges/" + item.challenge_id + "/editquestion"} href={"/shixuns/" + ChallengesDataList.shixun_identifier + "/challenges/" + item.challenge_id + "/editquestion"}
className="fl ring-green"> className="fl ring-green">
<img src={getImageUrl("images/educoder/icon/edit.svg")} <img src={getImageUrl("images/educoder/icon/edit.svg")}
@ -403,7 +403,7 @@ class Challenges extends Component {
: :
<Tooltip placement="bottom" title={"编辑"}> <Tooltip placement="bottom" title={"编辑"}>
<a <a
style={{ display: this.props.identity < 4 && this.props.status < 3 ? "block" : 'none' }} style={{ display:this.props.user.admin===true?"block":this.props.identity < 4 && ChallengesDataList.shixun_status < 3 ? "block" : 'none' }}
href={"/shixuns/" + ChallengesDataList.shixun_identifier + "/challenges/" + item.challenge_id + "/editcheckpoint"} href={"/shixuns/" + ChallengesDataList.shixun_identifier + "/challenges/" + item.challenge_id + "/editcheckpoint"}
className="fl ring-green"> className="fl ring-green">
<img src={getImageUrl("images/educoder/icon/edit.svg")} <img src={getImageUrl("images/educoder/icon/edit.svg")}
@ -529,7 +529,7 @@ class Challenges extends Component {
<p className="task-popup-text-center font-16 pb20">实训已经更新了正在为您重置!</p> <p className="task-popup-text-center font-16 pb20">实训已经更新了正在为您重置!</p>
</div> </div>
<div className="task-popup-submit clearfix"> <div className="task-popup-submit clearfix">
<a className="task-btn task-btn-orange fr mr51" onClick={()=>this.hidestartshixunsreplace(hidestartshixunsreplacevalue)}>知道了</a> <a className="task-btn task-btn-orange fr mr51" onClick={()=>this.hidestartshixunsreplace(hidestartshixunsreplacevalue)}>知道了</a>
</div> </div>
</Modal> </Modal>
</div> </div>

@ -57,8 +57,8 @@ class LoginRegisterComponent extends Component {
} }
//倒计时 //倒计时
getverificationcode = () => { getverificationcode = () => {
if (this.state.Phonenumberisnotcobool === false ||this.state.Phonenumberisnotcobool === undefined) { if (this.state.Phonenumberisnotcobool === false || this.state.Phonenumberisnotcobool === undefined) {
if (this.state.login&&this.state.login.length === 0) { if (this.state.login && this.state.login.length === 0) {
this.openNotification("请输入手机号或邮箱"); this.openNotification("请输入手机号或邮箱");
return return
} else { } else {
@ -280,7 +280,7 @@ class LoginRegisterComponent extends Component {
}).then((result) => { }).then((result) => {
//验证有问题{"status":1,"message":"success"} //验证有问题{"status":1,"message":"success"}
// console.log(result); // console.log(result);
this.openNotification("验证码已发送,请注意查收!",2); this.openNotification("验证码已发送,请注意查收!", 2);
}).catch((error) => { }).catch((error) => {
@ -312,7 +312,7 @@ class LoginRegisterComponent extends Component {
// height: 346px; // height: 346px;
return ( return (
<div className="login_register_content" style={{height: "482px"}}> <div className="login_register_content" style={{height: "520px"}}>
<Input type="text" name="username" value={"namename"} <Input type="text" name="username" value={"namename"}
style={{height: '0', width: '0', border: 'none', display: "none"}}/> style={{height: '0', width: '0', border: 'none', display: "none"}}/>
<Input type="password" name="password" id="password" value={"123123123"} <Input type="password" name="password" id="password" value={"123123123"}
@ -329,10 +329,18 @@ class LoginRegisterComponent extends Component {
color: #05101A; color: #05101A;
line-height: 69px; line-height: 69px;
} }
.loginInputzhuche{
width: 100%;
background-color: #fff!important;
height: 45px !important;
padding: 5px;
}
`}</style> `}</style>
<div className="login_section"> <div className="login_section">
<div className="section_header"> <div className="section_header font-18" style={{color:"#05101A"}}>
找回密码 找回密码
</div> </div>
<div style={{width: '340px'}}> <div style={{width: '340px'}}>
@ -361,36 +369,40 @@ class LoginRegisterComponent extends Component {
-webkit-transition: all .3s; -webkit-transition: all .3s;
-o-transition: all .3s; -o-transition: all .3s;
transition: all .3s; transition: all .3s;
} }
` `
} }
</style> </style>
<Input style={loginInputsyl} type="text" autoComplete="off" onClick={this.changeTypey} <Input style={loginInputsyl} type="text" autoComplete="off" onClick={this.changeTypey}
className={"loginInputzhuche"}
placeholder="输入注册手机号或邮箱" value={this.state.login} onBlur={(e) => this.inputOnBlur(e)} placeholder="输入注册手机号或邮箱" value={this.state.login} onBlur={(e) => this.inputOnBlur(e)}
onChange={this.loginInputonChange} style={{marginTop: '10px',height: "38px"}}></Input> onChange={this.loginInputonChange} style={{marginTop: '10px', height: "38px"}}></Input>
{ {
Phonenumberisnotco && Phonenumberisnotco != "" ? Phonenumberisnotco && Phonenumberisnotco != "" ?
<p className="color-red mt5 mb5" style={{width: " 100%", height: "20px"}}> <p className="color-red mt5 mb5" style={{width: " 100%", height: "20px"}}>
<span className="fl" style={{textAlign:"center",width: " 100%"}}>{Phonenumberisnotco}</span> <span className="fl" style={{textAlign: "center", width: " 100%"}}>{Phonenumberisnotco}</span>
</p> </p>
: <div style={{height: "25px"}}></div> : <div style={{height: "25px"}}></div>
} }
<DragValidator <DragValidator
height={38} successGreenColor="#45E15F" height={38} successGreenColor="#45E15F"
style={{height:"38px",width:"100%"}} style={{height: "38px", width: "100%"}}
dragOkCallback={this.dragOkCallback} dragOkCallback={this.dragOkCallback}
></DragValidator> ></DragValidator>
<Input type={classpass} <Input type={classpass}
className={"loginInputzhuche"}
onClick={this.changeType} autoComplete="new-password" onChange={this.loginInputonChanges} onClick={this.changeType} autoComplete="new-password" onChange={this.loginInputonChanges}
value={this.state.password} style={{width:"100%",height:"38px",marginTop:'25px'}} placeholder="输入8~16位密码区分大小写"></Input> value={this.state.password} style={{width: "100%", height: "38px", marginTop: '25px'}}
placeholder="输入8~16位密码区分大小写"></Input>
<Input type={classpass} <Input type={classpass}
className={"loginInputzhuche"}
onClick={this.changeType} autoComplete="new-password" onClick={this.changeType} autoComplete="new-password"
onChange={this.loginInputonChangess} value={this.state.passwords} onChange={this.loginInputonChangess} value={this.state.passwords}
style={{height:"38px",marginTop:'25px',width:"100%"}} style={{height: "38px", marginTop: '25px', width: "100%"}}
placeholder="再次输入新密码"></Input> placeholder="再次输入新密码"></Input>
<div className={"mt25"}> <div className={"mt25"}>
<Input className="fl mr5" type="text" autoComplete="off" style={{ <Input className="fl mr5 loginInputzhuche" type="text" autoComplete="off" style={{
width: "210px", width: "210px",
height: "38px", height: "38px",
}} placeholder="请输入验证码" }} placeholder="请输入验证码"
@ -401,16 +413,16 @@ class LoginRegisterComponent extends Component {
{ {
getverificationcodes === undefined ? getverificationcodes === undefined ?
<Button className="fl ml5 " disabled <Button className="fl ml5 " disabled
style={{"width": "120px", "text-align": "center", "height": "38px",}} style={{"width": "120px", "text-align": "center", "height": "45px",}}
size={"large"}>重新发送{seconds}s</Button> size={"large"}>重新发送{seconds}s</Button>
: getverificationcodes === true ? : getverificationcodes === true ?
<Button className="fl ml5 " <Button className="fl ml5 "
style={{"width": "120px", "text-align": "center", "height": "38px"}} style={{"width": "120px", "text-align": "center", "height": "45px"}}
type="primary" type="primary"
onClick={() => this.getverificationcode()} size={"large"}>获取验证码</Button> onClick={() => this.getverificationcode()} size={"large"}>获取验证码</Button>
: :
<Button className="fl ml5 " <Button className="fl ml5 "
style={{"width": "120px", "text-align": "center", "height": "38px"}} style={{"width": "120px", "text-align": "center", "height": "45px"}}
type="primary" type="primary"
onClick={() => this.getverificationcode()} size={"large"}>重新发送</Button> onClick={() => this.getverificationcode()} size={"large"}>重新发送</Button>
} }
@ -419,7 +431,7 @@ class LoginRegisterComponent extends Component {
</div> </div>
<Button className="login_btn" size={"large"} type="primary" <Button className="login_btn" size={"large"} type="primary"
style={{height:"46px"}} style={{height: "46px"}}
onClick={this.Retrievepassword}>完成</Button> onClick={this.Retrievepassword}>完成</Button>
</div> </div>
</div> </div>

@ -212,8 +212,8 @@ class LoginRegisterComponent extends Component {
Phonenumberisnotcos: undefined, Phonenumberisnotcos: undefined,
Phonenumberisnotcobool: true, Phonenumberisnotcobool: true,
}) })
}
this.Emailphonenumberverification(value, id) this.Emailphonenumberverification(value, id)
}
return return
} }
@ -222,7 +222,10 @@ class LoginRegisterComponent extends Component {
stringdata = "邮箱格式不正确"; stringdata = "邮箱格式不正确";
} else { } else {
stringdata = "手机号格式不正确"; stringdata = "手机号格式不正确";
// if (!regph.test(value)) {
// // 这里先判断是不是手机号然后在判断是不是邮箱然后又判断是不是手机号,如果不是手机号就是账号
// stringdata=undefined;
// }
} }
if (id === 1) { if (id === 1) {
this.setState({ this.setState({
@ -234,8 +237,8 @@ class LoginRegisterComponent extends Component {
Phonenumberisnotcos: stringdata, Phonenumberisnotcos: stringdata,
Phonenumberisnotcobool: false, Phonenumberisnotcobool: false,
}) })
}
this.Emailphonenumberverification(value, id) this.Emailphonenumberverification(value, id)
}
return return
} else { } else {
if (id === 1) { if (id === 1) {
@ -248,8 +251,8 @@ class LoginRegisterComponent extends Component {
Phonenumberisnotcos: undefined, Phonenumberisnotcos: undefined,
Phonenumberisnotcobool: true, Phonenumberisnotcobool: true,
}) })
}
this.Emailphonenumberverification(value, id) this.Emailphonenumberverification(value, id)
}
return return
} }
} }
@ -548,13 +551,13 @@ class LoginRegisterComponent extends Component {
// console.log(activeKey); // console.log(activeKey);
return ( return (
<div className="login_register_content" style={ parseInt(tab[0])==0?{height: "346px"} :{height: "462px"}}> <div className="login_register_content" style={ parseInt(tab[0])==0?{height: "346px"} :{height: "490px"}}>
<div> <div>
<Menu mode="horizontal" selectedKeys={tab} onClick={this.changeTab}> <Menu mode="horizontal" selectedKeys={tab} onClick={this.changeTab}>
<Menu.Item key="0">登录</Menu.Item> <Menu.Item key="0" className="font-18" style={{color:"#05101A"}}> 登录</Menu.Item>
<Menu.Item key="1">注册</Menu.Item> <Menu.Item key="1" className="font-18" style={{color:"#05101A"}}>注册</Menu.Item>
</Menu> </Menu>
{ {
@ -585,14 +588,23 @@ class LoginRegisterComponent extends Component {
-webkit-transition: all .3s; -webkit-transition: all .3s;
-o-transition: all .3s; -o-transition: all .3s;
transition: all .3s; transition: all .3s;
} }
.loginInputzhuche{
width: 100%;
background-color: #fff!important;
height: 45px !important;
padding: 5px;
}
` `
} }
</style> </style>
<Input placeholder="请输入登录手机号码或邮箱" value={this.state.login} <Input placeholder="请输入登录手机号码或邮箱" value={this.state.login}
onChange={this.loginInputonChange} onChange={this.loginInputonChange}
name="username" name="username"
className="font-14 color-grey-9" className="font-14 color-grey-9 loginInputzhuche"
onBlur={(e) => this.inputOnBlur(e, 1)} onBlur={(e) => this.inputOnBlur(e, 1)}
style={{marginTop: '30px', height: '38px'}}></Input> style={{marginTop: '30px', height: '38px'}}></Input>
@ -606,7 +618,7 @@ class LoginRegisterComponent extends Component {
<Input type="password" name="password" id="password" value={this.state.password} <Input type="password" name="password" id="password" value={this.state.password}
onChange={this.passwordonChange} onChange={this.passwordonChange}
className="font-14 color-grey-9 loginInput" className="font-14 color-grey-9 loginInputzhuche"
placeholder="密码"></Input> placeholder="密码"></Input>
@ -621,10 +633,33 @@ class LoginRegisterComponent extends Component {
size={"large"}>登录</Button> size={"large"}>登录</Button>
</div> </div>
} }
<style>
{
`
.loginInputzhuche{
width: 100%;
background-color: #fff!important;
height: 45px !important;
padding: 5px;
}
.loginInputzhuche .ant-input{
width: 100%;
background-color: #fff!important;
height: 45px !important;
padding: 5px;
position: relative;
right: 5px;
width: 103%;
}
`
}
</style>
{ {
parseInt(tab[0])==1 && parseInt(tab[0])==1 &&
<div style={{width: '340px'}}> <div style={{width: '340px'}}>
<Input className="loginInputsyl color-grey-9" placeholder="请使用手机号/邮箱账号进行注册" <Input className="loginInputsyl color-grey-9 loginInputzhuche" placeholder="请使用手机号/邮箱账号进行注册"
value={this.state.logins} value={this.state.logins}
type="text" autoComplete="off" type="text" autoComplete="off"
onChange={this.loginInputonChanges} onChange={this.loginInputonChanges}
@ -646,7 +681,7 @@ class LoginRegisterComponent extends Component {
></DragValidator> ></DragValidator>
<div className="mt25"> <div className="mt25">
<Input className="fl mr5 font-14 color-grey-9" name="codes" type="text" autoComplete="off" readonly <Input className="fl mr5 font-14 color-grey-9 loginInputzhuche" name="codes" type="text" autoComplete="off" readonly
onfocus="this.removeAttribute('readonly')" style={{ onfocus="this.removeAttribute('readonly')" style={{
width:'210px', width:'210px',
height:'38px', height:'38px',
@ -657,13 +692,13 @@ class LoginRegisterComponent extends Component {
</Input> </Input>
{ {
getverificationcodes === undefined ? getverificationcodes === undefined ?
<Button className="fl ml5 font-14" disabled style={{"width": "120px","text-align":"center", "height": "38px",}} <Button className="fl ml5 font-14" disabled style={{"width": "120px","text-align":"center", "height": "45px",}}
size={"large"}>重新发送{seconds}s</Button> size={"large"}>重新发送{seconds}s</Button>
: getverificationcodes === true ? : getverificationcodes === true ?
<Button className="fl ml5 font-14" type="primary" style={{"width": "120px","text-align":"center", "height": "38px",}} <Button className="fl ml5 font-14" type="primary" style={{"width": "120px","text-align":"center", "height": "45px",}}
onClick={() => this.getverificationcode()} size={"large"}>获取验证码</Button> onClick={() => this.getverificationcode()} size={"large"}>获取验证码</Button>
: :
<Button className="fl ml5 font-14 " type="primary" style={{"width": "120px","text-align":"center", "height": "38px",}} <Button className="fl ml5 font-14 " type="primary" style={{"width": "120px","text-align":"center", "height": "45px",}}
onClick={() => this.getverificationcode()} size={"large"}>重新发送</Button> onClick={() => this.getverificationcode()} size={"large"}>重新发送</Button>
} }
@ -673,13 +708,13 @@ class LoginRegisterComponent extends Component {
{/* style={{height: '0', width: '0', border: 'none', display: "none"}}/>*/} {/* style={{height: '0', width: '0', border: 'none', display: "none"}}/>*/}
{/*<Input type="password" name="password" id="password" autoComplete="new-password"*/} {/*<Input type="password" name="password" id="password" autoComplete="new-password"*/}
{/* style={{height: '0', width: '0', border: 'none', display: "none"}}/>*/} {/* style={{height: '0', width: '0', border: 'none', display: "none"}}/>*/}
<Input className="loginInput font-14 mt25 color-grey-9" placeholder="输入8~16位密码区分大小写" <Input className="loginInput font-14 mt25 color-grey-9 loginInputzhuche" placeholder="输入8~16位密码区分大小写"
type={classpass} type={classpass}
autoComplete="new-password" autoComplete="new-password"
onClick={this.changeType} onClick={this.changeType}
value={this.state.passwords} onChange={this.passwordonChanges} suffix={ value={this.state.passwords} onChange={this.passwordonChanges} suffix={
<img src={passopens} onClick={(key) => this.Showandhide(key)}> <img className={"mt5"} src={passopens} onClick={(key) => this.Showandhide(key)}>
</img> </img>
}></Input> }></Input>
<Checkbox onChange={this.onChange} <Checkbox onChange={this.onChange}

@ -29,9 +29,11 @@
.loginInput { .loginInput {
width: 100%; width: 100%;
margin-bottom: 16px; margin-bottom: 16px;
height: 38px; height: 45px;
} }
.left_right { .left_right {
width: 100%; width: 100%;
display: flex; display: flex;

@ -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;}

@ -296,7 +296,7 @@ label.infolabel{display: block;float: left;width: 56px;text-align: right;margin-
.subshaicontent a{float: left;margin-right: 20px;color: #999;cursor: pointer} .subshaicontent a{float: left;margin-right: 20px;color: #999;cursor: pointer}
.search-new{width: 248px;height:32px;position: relative} .search-new{width: 248px;height:32px;position: relative;margin-right: 35px;}
.search-span{display: block;position: absolute;width: 100%;height: 100%;left:0px;top:0px;background-color: #F4F4F4;border: 1px solid #EAEAEA; border-radius: 4px;z-index: 1} .search-span{display: block;position: absolute;width: 100%;height: 100%;left:0px;top:0px;background-color: #F4F4F4;border: 1px solid #EAEAEA; border-radius: 4px;z-index: 1}
.search-new-input{height: 32px;padding-left: 5px;width: 225px;border: none;box-sizing: border-box;background: none;outline: none;position: absolute;left:0px;top:1px;z-index: 2} .search-new-input{height: 32px;padding-left: 5px;width: 225px;border: none;box-sizing: border-box;background: none;outline: none;position: absolute;left:0px;top:1px;z-index: 2}
.search-new img,.search-new a,.search-new .searchicon{cursor: pointer;position: absolute;right:2px;top:2px;z-index: 2} .search-new img,.search-new a,.search-new .searchicon{cursor: pointer;position: absolute;right:2px;top:2px;z-index: 2}

Loading…
Cancel
Save