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",
"private": true,
"dependencies": {
"@novnc/novnc": "^1.1.0",
"@flatten/array": "^1.1.7",
"@icedesign/base": "^0.2.5",
"@novnc/novnc": "^1.1.0",
"antd": "^3.6.5",
"array-flatten": "^2.1.2",
"autoprefixer": "7.1.6",
@ -41,6 +40,7 @@
"fs-extra": "3.0.1",
"html-webpack-plugin": "2.29.0",
"immutability-helper": "^2.6.6",
"install": "^0.12.2",
"jest": "20.0.4",
"js-file-download": "^0.4.7",
"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}
.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-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}

@ -4,6 +4,7 @@ import axios from 'axios';
import { requestProxy } from "./indexEduplus2RequestProxy";
import { broadcastChannelOnmessage } from 'educoder'
import { notification } from 'antd';
import './index.css'
broadcastChannelOnmessage('refreshPage', () => {
window.location.reload()
})
@ -30,8 +31,7 @@ export function initAxiosInterceptors(props) {
// proxy = "http://testbdweb.trustie.net"
// proxy = "http://testbdweb.educoder.net"
proxy = "https://testeduplus2.educoder.net"
proxy = "http://47.96.87.25:48080"
//proxy="http://47.96.87.25:48080"
// 在这里使用requestMap控制避免用户通过双击等操作发出重复的请求
// 如果需要支持重复的请求考虑config里面自定义一个allowRepeat参考来控制
@ -115,7 +115,9 @@ export function initAxiosInterceptors(props) {
notification.open({
message:"提示",
description: response.data.message || '服务器异常,请联系管理员。',
style: {
zIndex: 99999999
},
});
// notification['error']({
// 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_SHIXUN_MANAGER = 2 // 实训管理员
export const EDU_SHIXUN_MEMBER = 3 // 实训成员
export const EDU_CERTIFICATION_TEACHER = 4 // 平台认证的老师
export const EDU_GAME_MANAGER = 5 // TPI的创建者
export const EDU_TEACHER = 6 // 平台老师,但是未认证
export const EDU_NORMAL = 7 // 普通用户
export const EDU_BUSINESS = 2 // # 运营人员
export const EDU_SHIXUN_MANAGER = 3 // 实训管理员
export const EDU_SHIXUN_MEMBER = 4 // 实训成员
export const EDU_CERTIFICATION_TEACHER = 5 // 平台认证的老师
export const EDU_GAME_MANAGER = 6 // TPI的创建者
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 { 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'
export { ModalHOC } from './components/ModalHOC'

@ -32,7 +32,7 @@ import _ from 'lodash'
import TPIContext from './TPIContext'
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 MUIDialogStyleUtil from '../modules/page/component/MUIDialogStyleUtil'
@ -447,6 +447,18 @@ pop_box_new(htmlvalue, 480, 182);
// const EDU_TEACHER = 6 // 平台老师,但是未认证
// 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
resData.power = 0
resData.myshixun_manager = false
@ -455,6 +467,9 @@ pop_box_new(htmlvalue, 480, 182);
if (resData.user.identity === EDU_ADMIN) {
resData.power = 1
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) {
resData.power = 1
resData.myshixun_manager = true
@ -820,7 +835,7 @@ pop_box_new(htmlvalue, 480, 182);
{this.state.gDialogContentText}
</DialogContentText>
</DialogContent>
<DialogActions id="dialog-actions">
<DialogActions className={"mb20"} id="dialog-actions">
{ this.isSingleButton ? <div className="task-popup-submit clearfix"
style={{ textAlign: 'center' }}>
<a className="task-btn task-btn-orange"

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

@ -180,6 +180,12 @@ class CommonWorkAppraise extends Component{
</div> */}
<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'}}>
<div className={"color-grey-6 h20 mb20 font-16"}>
内容
@ -209,7 +215,7 @@ class CommonWorkAppraise extends Component{
{ update_time &&
<React.Fragment>
<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"}>
{moment(update_time).format('YYYY-MM-DD HH:mm')==="Invalid date"?"":moment(update_time).format('YYYY-MM-DD HH:mm')}
</span>
@ -218,7 +224,7 @@ class CommonWorkAppraise extends Component{
{ commit_time &&
<React.Fragment>
<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"}>
{moment(commit_time).format('YYYY-MM-DD HH:mm')==="Invalid date"?"":moment(commit_time).format('YYYY-MM-DD HH:mm')}
</span>
@ -286,6 +292,7 @@ class CommonWorkAppraise extends Component{
</div>
</div>
}
</div>
{/* task_type={datalist&&datalist.task_type} */}

@ -8,7 +8,6 @@ import { WordsBtn } from 'educoder'
import AccessoryModal2 from '../coursesPublic/AccessoryModal2'
import AccessoryModal from '../coursesPublic/AccessoryModal'
import axios from 'axios'
import ConnectProject from './ConnectProject'
class CommonWorkItem extends Component{
constructor(props){
super(props);
@ -98,6 +97,13 @@ class CommonWorkItem extends Component{
setupdate = () => {
}
toCreateProject = () => {
if (window.location.port == 3007) {
window.location.href = '/testbdweb.educoder.net/projects/new'
} else {
window.location.href = '/projects/new'
}
}
render(){
let { mainList,workType }=this.props;
const { aModalVisible, fileList, revise_reason } = this.state
@ -128,7 +134,7 @@ class CommonWorkItem extends Component{
}
</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
return(
<div className="mt20 edu-back-white padding02010" key={index} >
@ -196,12 +202,22 @@ class CommonWorkItem extends Component{
<li className="fr">
{ //
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 &&
<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 &&

@ -31,7 +31,9 @@ function renderScore(score, content) {
} else if (score >= 60) {
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) {
return score == '--' ? '未评分' : score == '**' ? '未公开' : dom
@ -47,9 +49,14 @@ function buildColumns(that, student_works) {
}
let courseId= that.props.match.params.coursesId;
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 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 = [{
width: 60,
title: '序号',
@ -76,21 +83,24 @@ function buildColumns(that, student_works) {
{text}
</div>
),
}, {
width: 180,
title: '学号',
dataIndex: 'student_id',
key: 'student_id',
render: (text, record) => (
<span>
<a href="javascript:;" style={{color:'#9A9A9A'}}>{record.student_id}</a>
</span>
),
}]
if (!niPingAndIsStudent) {
columns.push({
width: 88,
title: '学号',
dataIndex: 'student_id',
key: 'student_id',
render: (text, record) => (
<span>
<a href="javascript:;" style={{color:'#9A9A9A'}}>{record.student_id}</a>
</span>
),
})
}
// TODO 只有有分班时才显示分班列
if (course_group_count != 0) {
if (course_group_count != 0 && !niPingAndIsStudent) {
columns.push( {
title: '分班',
key: 'group_name',
@ -103,7 +113,7 @@ function buildColumns(that, student_works) {
),
} )
}
if (gotWorkGroup) {
if (gotWorkGroup && !niPingAndIsStudent) {
columns.push({
width: 72,
title: '分组',
@ -144,7 +154,7 @@ function buildColumns(that, student_works) {
</span>
)},
}, {
width: 133,
width: 150,
title: '更新时间',
dataIndex: 'update_time',
key: 'update_time',
@ -154,45 +164,52 @@ function buildColumns(that, student_works) {
<a href="javascript:;" style={{color:'#989898'}}>{update_time ? moment(update_time).format('YYYY-MM-DD hh:mm') : '--'}</a>
</span>
),
}, {
width: 72,
title: '教师评分',
key: 'teacher_score',
dataIndex: 'teacher_score',
}])
if (!niPingAndIsStudent) {
columns.push({
width: 72,
title: '教师评分',
key: 'teacher_score',
dataIndex: 'teacher_score',
render: (teacher_score, record) => (
render: (teacher_score, record) => (
<Tooltip title={ getScoreTip(teacher_score, teacher_score) }>
<span>
{ renderScore(teacher_score) }
</span>
</Tooltip>
),
})
<Tooltip title={ getScoreTip(teacher_score, teacher_score) }>
columns.push({
width: 72,
title: '助教评分',
key: 'teaching_asistant_score',
dataIndex: 'teaching_asistant_score',
/**
* 2名助教进行了评分
平均分85.0
*
*/
render: (teaching_asistant_score, record) => (
<span>
{ renderScore(teacher_score) }
</span>
</Tooltip>
),
}, {
width: 72,
title: '助教评分',
key: 'teaching_asistant_score',
dataIndex: 'teaching_asistant_score',
/**
* 2名助教进行了评分
平均分85.0
*
*/
render: (teaching_asistant_score, record) => (
<span>
{ <Tooltip placement="bottom" title={
getScoreTip(teaching_asistant_score,
<div>
<div>{record.ta_comment_count}名助教进行了评分</div>
<div>{that.state.ta_mode == 1 ? '平均分': '复审分'}{teaching_asistant_score}</div>
</div>) }
>
{renderScore(teaching_asistant_score) }
</Tooltip> }
</span>
),
}])
{ <Tooltip placement="bottom" title={
getScoreTip(teaching_asistant_score,
<div>
<div>{record.ta_comment_count}名助教进行了评分</div>
<div>{that.state.ta_mode == 1 ? '平均分': '复审分'}{teaching_asistant_score}</div>
</div>) }
>
{renderScore(teaching_asistant_score) }
</Tooltip> }
</span>
),
})
}
if (that.state.anonymous_comment) {
/**
@ -211,7 +228,7 @@ function buildColumns(that, student_works) {
<Tooltip title={
getScoreTip(student_score,
<div>
<div>{`${record.student_comment_count}名学生进行了匿评`}</div>
{record.student_comment_count && <div>{`${record.student_comment_count}名学生进行了匿评`}</div>}
<div>有效平均分{record.student_score}</div>
</div>
)
@ -235,43 +252,45 @@ function buildColumns(that, student_works) {
{ !!appeal_all_count &&
<Tooltip placement="bottom" title={`共有${appeal_all_count}条匿评申诉,${record.appeal_deal_count}条待处理`}>
<span style={{ minWidth: '30px', display: 'inline-block', textAlign: 'center' }}>
{`${appeal_all_count}/${record.appeal_deal_count}`}
{`${record.appeal_deal_count}/${appeal_all_count}`}
</span>
</Tooltip> }
{ !appeal_all_count && '-/-'}
</span>
),
})
}
columns.push({
width: 72,
title: '最终成绩',
key: 'work_score',
dataIndex: 'work_score',
render: (work_score, record) => {
return (
<span>
<Tooltip title={
getScoreTip(work_score,
<div>
<div>{`${record.user_name}${record.user_login}`}</div>
{ record.ultimate_score ?
<div>最终调整成绩{record.work_score}</div> :
if (!niPingAndIsStudent) {
columns.push({
width: 72,
title: '最终成绩',
key: 'work_score',
dataIndex: 'work_score',
render: (work_score, record) => {
return (
<span>
<Tooltip title={
getScoreTip(work_score,
<div>
{ record.final_score && <div>作业评分{record.final_score}</div> }
{ record.late_penalty >= 0 && <div>迟交扣分{record.late_penalty}</div>}
{ record.absence_penalty >= 0 && <div>缺评扣分{record.absence_penalty}</div>}
{ record.appeal_penalty >= 0 && <div>违规匿评扣分{record.appeal_penalty}</div>}
<div>最终成绩{record.work_score}</div>
</div> }
</div>)
}>
{ renderScore(work_score) }
</Tooltip>
</span>
)
},
})
<div>{`${record.user_name}${record.user_login}`}</div>
{ record.ultimate_score ?
<div>最终调整成绩{record.work_score}</div> :
<div>
{ record.final_score && <div>作业评分{record.final_score}</div> }
{ record.late_penalty >= 0 && <div>迟交扣分{record.late_penalty}</div>}
{ record.absence_penalty >= 0 && <div>缺评扣分{record.absence_penalty}</div>}
{ record.appeal_penalty >= 0 && <div>违规匿评扣分{record.appeal_penalty}</div>}
<div>最终成绩{record.work_score}</div>
</div> }
</div>)
}>
{ renderScore(work_score) }
</Tooltip>
</span>
)
},
})
}
if (isAdminOrStudent || that.props.work_public == true) {
columns.push({
width: 92,

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

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

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

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

@ -75,12 +75,6 @@ class CoursesWorkIndex extends Component{
(props) => (<CommonWorkDetailIndex {...this.props} {...props} {...this.state} />)
}
></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"
render={
@ -120,7 +114,7 @@ class CoursesWorkIndex extends Component{
(props) => (<NewWork {...this.props} {...props} {...this.state} />)
}
></Route>
<Route exact path="/courses/:coursesId/common_homeworks/new"
<Route exact path="/courses/:coursesId/common_homeworks/:categroy_id/new"
render={
(props) => (<NewWork {...this.props} {...props} {...this.state} />)
}

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

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

@ -9,6 +9,7 @@ import '../css/busyWork.css'
import CoursesListType from '../coursesPublic/CoursesListType'
import CommonWorkItem from './CommonWorkItem'
import PublishRightnow from './PublishRightnow'
import ConnectProject from './ConnectProject'
import { WordsBtn } from 'educoder'
import Modals from '../../modals/Modals'
@ -53,7 +54,9 @@ class commonWork extends Component{
let {page,search,order}=this.state;
this.getList(page,search,order);
}
openConnectionProject = (work) => {
this.refs['connectProject'].openConnectionProject(work)
}
// 新建
createCommonWork=(type)=>{
@ -72,7 +75,6 @@ class commonWork extends Component{
}
componentDidUpdate(prevProps, prevState) {
debugger;
if (prevProps.match.path != this.props.match.path) {
this.componentDidMount()
}
@ -195,6 +197,7 @@ class commonWork extends Component{
this.clearSelection()
let {search,order}=this.state;
this.getList(1,search,order);
this.props.updataleftNavfun()
}
console.log(response)
}).catch((error) => {
@ -276,6 +279,26 @@ class commonWork extends Component{
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(){
@ -338,6 +361,8 @@ class commonWork extends Component{
</div>
</div>
</div> */}
<ConnectProject ref="connectProject" {...this.props} connectSuccess={this.connectSuccess}></ConnectProject>
<Titlesearchsection
title={main_category_name}
@ -390,11 +415,11 @@ class commonWork extends Component{
</li>
<li className="li_line">
<PublishRightnow showActionButton={true} {...this.props} checkBoxValues={checkBoxValues}
isPublish={true} doWhenSuccess={this.doWhenSuccess}></PublishRightnow>
isPublish={true} doWhenSuccess={this.doWhenSuccess} fromListPage={true}></PublishRightnow>
</li>
<li className="li_line">
<PublishRightnow showActionButton={true} {...this.props} checkBoxValues={checkBoxValues}
isPublish={false} doWhenSuccess={this.doWhenSuccess}></PublishRightnow>
isPublish={false} doWhenSuccess={this.doWhenSuccess} fromListPage={true}></PublishRightnow>
</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}>
<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>
</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);
}
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) => {
placement && notification.config({
placement: placement,
@ -127,6 +135,7 @@ export function CNotificationHOC(options = {}) {
</Modals>
<WrappedComponent {...this.props}
showNotification= { this.showNotification }
bytesToSize={this.bytesToSize}
getNowFormatDates={(value,type)=>this.getNowFormatDates(value,type)}
configNotification={ this.configNotification }
confirm={ this.confirm }

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

@ -1,7 +1,7 @@
import React, {Component} from 'react';
import {Link} from "react-router-dom";
import axios from 'axios';
import {getImageUrl, trigger} from 'educoder';
import {getImageUrl, trigger, on, off} from 'educoder';
import { Tooltip, message,Popover} from 'antd';
import CoursesListType from '../coursesPublic/CoursesListType';
import Addcourses from '../coursesPublic/Addcourses';
@ -9,7 +9,6 @@ import '../css/Courses.css';
import Modals from "../../modals/Modals";
import AddStudentModal from '../members/modal/AddStudentModal'
import AddTeacherModal from '../members/modal/AddTeacherModal'
import Trialapplication from "../../login/Trialapplication";
// 点击按钮复制功能
// function jsCopy(){
@ -44,39 +43,33 @@ class CoursesBanner extends Component {
modalsBottomval: "",
antIcon:false,
coursedata:undefined,
user_phone_binded:false,
isRenders:false,
showTrial:false,
}
console.log("CoursesBanner");
console.log("48");
console.log(props);
}
componentDidMount() {
this.updatabanner()
this.setState({
user_phone_binded :this.props.user_phone_binded,
})
this.onloadupdatabanner()
on('updatabanner', this.updatabanner)
}
componentWillUnmount() {
off('updatabanner', this.updatabanner)
}
onloadupdatabanner=()=>{
this.updatabanner()
}
updatabanner=()=>{
let courseId = this.props.match.params.coursesId;
let url = "/courses/" + courseId + "/top_banner.json"
axios.get(url).then((result) => {
if( result!=undefined){
let data = result.data;
if(result.data.status === 407){
this.setState({
isRenders:true,
coursedata: data,
showTrial:false,
})
}else{
this.setState({
coursedata: data,
showTrial:true,
})
}
}else{
this.onloadupdatabanner()
}
})
}
@ -332,11 +325,10 @@ class CoursesBanner extends Component {
}
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 (
<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'}}>
@ -370,7 +362,7 @@ class CoursesBanner extends Component {
{
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>
</Tooltip>
@ -411,7 +403,9 @@ class CoursesBanner extends Component {
<div>
{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"
onClick={()=>this.switchidentity(1)}
> 切换为学生 </a>
@ -419,7 +413,9 @@ class CoursesBanner extends Component {
:""}
{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"
onClick={()=>this.switchidentity(2)}
> 切换为老师 </a>
@ -427,7 +423,9 @@ class CoursesBanner extends Component {
{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"
onClick={()=>this.switchidentity(3)}
> 切换为助教 </a>
@ -466,7 +464,9 @@ class CoursesBanner extends Component {
<Link to={"/courses/"+this.props.match.params.coursesId+"/students"}>
<span className="color-grey-c fl font-16">学生</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>
</li>
@ -530,10 +530,13 @@ class CoursesBanner extends Component {
{coursedata.code_halt === true? "已停用" : coursedata.invite_code}
{coursedata.code_halt === true ? "" :
<Tooltip placement="bottom" title={
<pre>
成员可以通过邀请码主动加入课堂<br/>
点击立刻复制邀请码
</pre>
coursedata.code_halt === true? <pre>
邀请码已停用<br/>
成员不能主动加入课堂
</pre>:<pre>
成员可以通过邀请码主动加入课堂<br/>
点击立刻复制邀请码
</pre>
}>
<i className="iconfont icon-fuzhi color-white font-14 ml10"
onClick={() => {

@ -119,14 +119,29 @@ class Addcourses extends Component{
}
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;
this.setState({
Addcoursestype:false
})
this.props.hideAddcoursestype();
window.location.href ="/courses/"+course_id+"/students";
}
// let{course_id}=this.state;
this.setState({
Addcoursestype:false
})
this.props.hideAddcoursestype();
window.location.href ="/courses/"+course_id+"/students";
}
submitasyns=(course_id)=>{
window.location.href ="/courses/"+course_id+"/students";
}
submittojoinclass=()=>{
let {invite_code,professor,assistant_professor,student}=this.state;

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

@ -285,6 +285,11 @@ class Selectresource extends Component{
padding: 0 30px;
padding-top:30px;
}
.search-news{
width: 237px!important;
height: 30px;
margin-bottom: 30px;
}
`}</style>
<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 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
placeholder="请输入发布人或名称进行搜索"
value={Searchvalue}

@ -7,13 +7,7 @@ import moment from 'moment';
import Modals from '../../modals/Modals';
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"
function range(start, end) {
const result = [];
@ -619,7 +613,7 @@ class Selectsetting extends Component{
{item.name}
</span>
<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>
<i className="font-14 iconfont icon-guanbi "
id={item.response===undefined?"":item.response.id}

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

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

@ -230,11 +230,11 @@ class ShixunModal extends Component{
</span>
<div className="fr search-new">
<Search
placeholder="输入实训名称的关键字搜索"
placeholder="请输入创建者或者实训名称进行搜索"
value={Searchvalue}
onInput={this.SenttotheValue}
onSearch={(value) => this.SenttotheSearch(value)}
style={{width: '100%'}}
style={{width: '115%'}}
/>
</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";
class Sendresource extends Component{
constructor(props){
@ -456,7 +449,7 @@ class Sendresource extends Component{
{item.name}
</span>
<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>
<i className="font-14 iconfont icon-guanbi "
id={item.response===undefined?"":item.response.id}

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

@ -1,5 +1,5 @@
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 TPMMDEditor from '../../../tpm/challengesnew/TPMMDEditor';
import { WordsBtn,getUrl } from 'educoder';
@ -212,7 +212,7 @@ class GraduationTasksSubmitedit extends Component{
this.setState({ fileList });
}
onAttachmentRemove = (file) => {
//onAttachmentRemove = (file) => {
// confirm({
// title: '确定要删除这个附件吗?',
@ -228,14 +228,14 @@ class GraduationTasksSubmitedit extends Component{
// });
// return false;
this.setState({
Modalstype:true,
Modalstopval:'确定要删除这个附件吗?',
ModalSave: ()=>this.deleteAttachment(file),
ModalCancel:this.cancelAttachment
})
return false;
}
// this.setState({
// Modalstype:true,
// Modalstopval:'确定要删除这个附件吗?',
// ModalSave: ()=>this.deleteAttachment(file),
// ModalCancel:this.cancelAttachment
// })
// return false;
//}
cancelAttachment=()=>{
this.setState({
@ -246,8 +246,8 @@ class GraduationTasksSubmitedit extends Component{
})
}
deleteAttachment = (file) => {
let {attachments}=this.state;
onAttachmentRemove = (file) => {
let {attachments,fileList}=this.state;
const url = `/attachments/${file.uid===undefined?file.id:file.uid}.json`
axios.delete(url, {
})
@ -426,7 +426,7 @@ class GraduationTasksSubmitedit extends Component{
multiple: true,
// https://github.com/ant-design/ant-design/issues/15505
// showUploadList={false},然后外部拿到 fileList 数组自行渲染列表。
// showUploadList: false,
showUploadList: false,
action: `${getUrl()}/api/attachments.json`,
onChange: this.handleChange,
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>
<Search
className={"fl mt5 ml20"}
style={{width:"20%"}}
style={{width:"270px"}}
placeholder="请输入姓名或学号搜索"
id="subject_search_input"
value={search}
@ -581,26 +611,54 @@ class GraduationTasksSubmitedit extends Component{
></Search>
</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>
<div className={"ml20"} style={{width:"100%"}}>
<div className={"ml20 mt10"} style={{width:"100%"}}>
<div className={"members fl"}
onScroll={this.contentViewScroll}>
<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(
<div key={key} style={{
width: '375px',
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>
<div className={"fl ml5"} style={{width: '70px'}}>{item.user_name}</div>
<div className={"fl ml40 color-grey-9"}>{item.group_name}</div>
<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>
<Checkbox value={item.user_id}
checked={
task_status.map((item,key)=>{
return parseInt(task_status[key])===item.user_id?true:false
})
}
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>
)
})}
@ -622,10 +680,12 @@ class GraduationTasksSubmitedit extends Component{
height: '30px',
display:item.user_name===undefined?"none":""
}}>
<div className={"fl ml5"} style={{width: '50px'}}>{item.user_name}</div>
<div className={"fl ml40 color-grey-9"}>{item.group_name}</div>
<div className={"fl ml40 color-grey-9"}>{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>:""}
<Tooltip placement="bottom" title={item.user_name}>
<div className={"fl ml5 fonthidden width87"} style={{width: '50px'}}>{item.user_name}</div>
</Tooltip>
<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>
)
})}

@ -2,7 +2,7 @@ import React,{Component} from "React";
import { Form, Select, Input, Button,Checkbox,Upload,Icon,message,Modal,Tooltip,Spin} from "antd";
import {Link} from 'react-router-dom';
import TPMMDEditor from '../../../tpm/challengesnew/TPMMDEditor';
import { WordsBtn,getUrl } from 'educoder';
import { WordsBtn,getUrl,getImageUrl} from 'educoder';
import axios from 'axios';
import Modals from '../../../modals/Modals';
const Search = Input.Search;
@ -83,7 +83,7 @@ class GraduationTasksSubmitnew extends Component{
}
handleSubmit=(e) => {
console.log("86");
let {fileList,selectmemberslist,workslist}=this.state;
if(fileList.length === 0){
@ -91,7 +91,7 @@ class GraduationTasksSubmitnew extends Component{
Modalstype:true,
Modalstopval:'请上传附件!',
Loadtype:true,
ModalCancel:this.cancelAttachment
ModalSave:this.cancelAttachment,
})
@ -119,7 +119,7 @@ class GraduationTasksSubmitnew extends Component{
listid.push(list.response.id)
}
e.preventDefault();
// e.preventDefault();
if( GraduationTasksnewtype===true){
this.props.form.validateFields((err, values) => {
if (!err) {
@ -367,7 +367,6 @@ class GraduationTasksSubmitnew extends Component{
let newlist =memberslist.members;
let newcheckedValues=checkedValues;
let selects=[];
selects.push(selectobjct)
for(var i=0; i<newlist.length; i++){
for(var z=0; z<newcheckedValues.length; z++){
@ -392,6 +391,7 @@ class GraduationTasksSubmitnew extends Component{
let selects=selectmemberslist;
for(var i=0; i<newlist.length; i++){
if(newlist[i]===id){
newlist.splice(i,1)
}
@ -402,12 +402,33 @@ class GraduationTasksSubmitnew extends Component{
selects.splice(z,1)
}
}
this.setState({
task_status:newlist,
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=()=>{
window.history.go(-1)
}
@ -482,7 +503,8 @@ render(){
<a className="color-grey-6 fr font-16 ml30 mt10 mr20" onClick={this.goback}>返回</a>
</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">
<style>{`
.uploadBtn.ant-btn {
@ -535,16 +557,29 @@ render(){
>
<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
className={"fl mt5 ml20"}
style={{width:"20%"}}
style={{width:"270px"}}
placeholder="请输入姓名或学号搜索"
id="subject_search_input"
value={search}
onInput={this.inputSearchValue}
onSearch={this.searchValue}
onPressEnter={this.onKeywordSearchKeyDown}
onKeyUp={(e) => this.onSearckeyd(e)}
autoComplete="off"
></Search>
<input type="text" style={{display: "none",height:0, width: 0, border: "none"}}/>
</div>
@ -556,6 +591,15 @@ render(){
text-overflow:ellipsis;
white-space:nowrap
}
.width87{
width: 87px;
height: 24px;
}
img.edu-nodata-img {
width: 200px;
margin: 50px 90px 20px;
display: block;
}
`}</style>
<div className={"ml20"} style={{width:"100%"}}>
@ -563,17 +607,31 @@ render(){
<div className={"members fl"}
onScroll={this.contentViewScroll}>
<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(
<div key={key} style={{
width: '375px',
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>
<Tooltip placement="bottom" title={item.user_nam}><div className={"fl ml5 fonthidden"} style={{width: '70px'}}>{item.user_name}</div></Tooltip>
<div className={"fl ml40 color-grey-9"}>{item.group_name}</div>
<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>
<Checkbox value={item.user_id} checked={
task_status.map((item,key)=>{
return parseInt(task_status[key])===item.user_id?true:false
})
}
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>
)
})}
@ -599,12 +657,13 @@ render(){
height: '30px',
display:item.user_name===undefined?"none":""
}}>
<Tooltip placement="bottom" title={item.user_nam}>
<div className={"fl ml5 fonthidden"} style={{width: '50px'}}>{item.user_name}</div>
<Tooltip placement="bottom" title={item.user_name}>
<div className={"fl ml5 fonthidden width87"}>{item.user_name}</div>
</Tooltip>
<div className={"fl ml40 color-grey-9"}>{item.group_name}</div>
<div className={"fl ml40 color-grey-9"}>{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>:""}
<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>
)
})}
@ -627,11 +686,11 @@ render(){
<Form.Item>
<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>
</div>
</Form.Item>
</Form>
{/*</Form>*/}
</div>
</div>

@ -256,29 +256,39 @@ class GraduationTasksappraise extends Component{
<div className={"ml20"}>
补交原因{firelistdata&&firelistdata.revise_reason}
</div>
{firelistdata===undefined?"":firelistdata.length===0?"":firelistdata.revise_attachments.map((item,key)=>{
return(
<div className="color-grey" key={key}>
<a className="color-grey ml20">
<i className="font-14 color-green iconfont icon-fujian mr8" aria-hidden="true"></i>
</a>
<a href={item.url}
className="mr12 color9B9B" length="58">
{item.title}
</a>
<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>:""}
</div>
)
})}
<div className={"color-grey-6 h20 ml20"}>
<span className={"color9B9B fr mr10"}>更新</span>
<span className={"fr font-13 mr10 ml10"}>{firelistdata&&firelistdata.atta_update_user}</span>
<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')}
</span>
</div>
<div className="color-grey" key={key}>
{firelistdata===undefined?"":firelistdata.length===0?"":firelistdata.revise_attachments.map((item,key)=>{
return(
<span>
<a className="color-grey ml20">
<i className="font-14 color-green iconfont icon-fujian mr8" aria-hidden="true"></i>
</a>
<a href={item.url}
className="mr12 color9B9B" length="58">
{item.title}
</a>
<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>:""}
</span>
)
})}
</div>
<div className={"color-grey-6 h20 ml20"}>
<span className={"color9B9B fr mr10"}>更新</span>
<span className={"fr font-13 mr10 ml10"}>{firelistdata&&firelistdata.atta_update_user}</span>
<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')}
</span>
</div>
</div>}
{datalist&&datalist.project_info===undefined?"":
<div className={"stud-class-set edu-back-white padding20-30 bor-top-greyE"}>

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

@ -94,7 +94,7 @@ class GraduationTaskssettinglist extends Component{
for (var i = 0; i < worklists.length; i++) {
datalist.push({
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,
classroom: worklists[i].class_grouping_name,
grouping: result.data.have_grouping === true ? worklists[i].grouping_name : null,
@ -1279,9 +1279,6 @@ class GraduationTaskssettinglist extends Component{
text-overflow: ellipsis;
white-space: nowrap;
}
.ant-table-tbody > tr:last-child > td{
border:none!important;
}
`
}
</style>
@ -1548,24 +1545,43 @@ class GraduationTaskssettinglist extends Component{
<div id="graduation_work_list" style={{padding:'0px 40px 10px 40px'}}>
<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() ?
<div className="fr">
<li className="drop_down edu-txt-center">
<span className="color-grey-6">{order==="updated_at"?"更新时间":order==="work_score"?"最终成绩":order==="student_id"?"学生学号":""}排序</span>
<i className="iconfont icon-xiajiantou ml5 font-12 color-grey-9"></i>
<ul className="drop_down_normal with100">
<li onClick={(e)=>this.funorder("updated_at")}><a data-remote="true">更新时间</a></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>
{this.props.isAdmin()===true?<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="fr color-grey-6 edu-menu-panel">
<p>
<a data-remote="true">
{order==="updated_at"?"更新时间":order==="work_score"?"最终成绩":order==="student_id"?"学生学号":""}排序</a>
<i className="iconfont icon-xiajiantou ml5 font-12 color-grey-6"></i></p>
<ul className="edu-menu-list">
<li onClick={(e)=>this.funorder("updated_at")}><a data-remote="true">更新时间</a>
</li>
</div>
:""
}
<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>
{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>
{
@ -1785,24 +1801,49 @@ class GraduationTaskssettinglist extends Component{
<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>
<div className="fr color-grey-6 edu-menu-panel">
<p><a data-remote="true">
{order==="updated_at"?"时间":order==="work_score"?"成绩":order==="student_id"?"学号":""}排序</a><i
className="iconfont icon-xiajiantou ml5 font-12 color-grey-6"></i></p>
<ul className="edu-menu-list">
<li onClick={(e)=>this.funorder("updated_at")} className={order==="updated_at"?"none":""}><a data-remote="true">时间</a>
</li>
<li onClick={(e)=>this.funorder("work_score" )} className={order==="work_score"?"none":""}><a data-remote="true">成绩</a>
</li>
<li onClick={(e)=>this.funorder("student_id" )} className={order==="student_id"?"none":""}><a data-remote="true">学号</a>
</li>
</ul>
</div>
</div>
{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">
<p><a data-remote="true">
{order==="updated_at"?"时间":order==="work_score"?"成绩":order==="student_id"?"学号":""}排序</a><i
className="iconfont icon-xiajiantou ml5 font-12 color-grey-6"></i></p>
<ul className="edu-menu-list">
<li onClick={(e)=>this.funorder("updated_at")} className={order==="updated_at"?"none":""}><a data-remote="true">时间</a>
</li>
<li onClick={(e)=>this.funorder("work_score" )} className={order==="work_score"?"none":""}><a data-remote="true">成绩</a>
</li>
<li onClick={(e)=>this.funorder("student_id" )} className={order==="student_id"?"none":""}><a data-remote="true">学号</a>
</li>
</ul>
</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>

@ -1,5 +1,5 @@
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 '../css/Courses.css'
import '../css/members.css'
@ -31,14 +31,6 @@ const dataSource = [{
const buildColumns = (that) => {
const columns=[{
title: '',
dataIndex: 'check',
key: 'check',
render: (text, item) => {
return <Checkbox value={item.course_member_id}></Checkbox>
},
width:"5%"
},{
title: '序号',
dataIndex: 'id',
key: 'id',
@ -71,10 +63,23 @@ const buildColumns = (that) => {
width:"50%",
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;
}
// 1-按照学号排序 2-按照分班排序,
// 1-按照学生学号 2-按照分班名称
const ORDER_BY_NUM = 1;
const ORDER_BY_GROUP = 2;
@ -312,6 +317,8 @@ class studentsList extends Component{
if (result.data.status == 0) {
this.props.showNotification('移动成功')
this.fetchAll()
this.props.updataleftNavfun()
}
}).catch((error)=>{
console.log(error);
@ -357,6 +364,7 @@ class studentsList extends Component{
this.props.showNotification('删除成功')
this.fetchAll()
this.setState({checkBoxValues: []})
trigger('updatabanner')
}
}).catch((error)=>{
console.log(error);
@ -423,9 +431,9 @@ class studentsList extends Component{
checkBoxValues,
checkAllValue
}=this.state;
let currentOrderName = '学排序'
let currentOrderName = '学生学号'
if (order == ORDER_BY_GROUP) {
currentOrderName = '分班排序'
currentOrderName = '分班名称'
}
const { coursesids } = this.props
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">
{invite_code}
</span>
<i class="iconfont icon-fuzhi font-14 ml10 copybtn" style={{color: '#FF6800', cursor: 'pointer', verticalAlign: 'baseline'}} data-clipboard-text={invite_code} ></i>
<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>
</span>
</Tooltip>
</React.Fragment>
}
@ -528,7 +543,7 @@ class studentsList extends Component{
total_count > 0 ?
<div className="mt20 edu-back-white padding20">
<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">
{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">
@ -562,8 +577,8 @@ class studentsList extends Component{
<li className="drop_down">
{currentOrderName}<i className="iconfont icon-xiajiantou font-12 ml2"></i>
<ul className="drop_down_normal">
<li onClick={() => this.onSortTypeChange(ORDER_BY_NUM)} >排序</li>
<li onClick={() => this.onSortTypeChange(ORDER_BY_GROUP)} >分班排序</li>
<li onClick={() => this.onSortTypeChange(ORDER_BY_NUM)} >生学</li>
<li onClick={() => this.onSortTypeChange(ORDER_BY_GROUP)} >分班名称</li>
</ul>
</li>
</div>

@ -32,13 +32,6 @@ function buildColumns(that) {
const isAdminOrTeacher = that.props.isAdminOrTeacher()
const { course_groups } = that.state
const columns = [{
title: '',
dataIndex: 'course_member_id',
key: 'course_member_id',
render: (content, item, index) => {
return <Checkbox value={content}></Checkbox>
}
},{
title: '序号',
// dataIndex: 'name',
key: 'index',
@ -62,7 +55,7 @@ function buildColumns(that) {
dataIndex: '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>,
width: 230,
key: 'course_groups',
@ -116,7 +109,8 @@ function buildColumns(that) {
}
,
});
if (that.hasGraduationModule()) {
const hasGraduationModule = that.hasGraduationModule()
if (hasGraduationModule) {
columns.push({
title: '答辩组',
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
}
@ -185,7 +189,7 @@ class studentsList extends Component{
searchValue:e.target.value
})
}
// approval 2 - 拒绝
onAgree = (record, approval = 1) => {
const courseId = this.props.match.params.coursesId
@ -198,7 +202,7 @@ class studentsList extends Component{
})
.then((response) => {
if (response.data.status == 0) {
this.props.showNotification(`${approval ? '同意' : '拒绝'}`)
this.props.showNotification(`${approval == 1? '同意' : '拒绝'}`)
this.fetchAll(1)
}
})
@ -216,14 +220,22 @@ class studentsList extends Component{
})
this.fetchAll(1);
const isAdminOrTeacher = this.props.isAdminOrTeacher()
const isAdmin = this.props.isAdmin()
isAdminOrTeacher && this.getGroupList();
this.getCourseGroups();
on('addTeacherSuccess', this.addTeacherSuccessListener)
isAdmin && on('updateNavSuccess', this.updateNavSuccess)
}
componentWillUnmount() {
off('addTeacherSuccess', this.addTeacherSuccessListener)
const isAdmin = this.props.isAdmin()
isAdmin && off('updateNavSuccess', this.updateNavSuccess)
}
updateNavSuccess = () => {
this.getCourseGroups()
}
addTeacherSuccessListener = (e, data) => {
// const params = JSON.parse(data)
@ -454,6 +466,7 @@ class studentsList extends Component{
if (response.data.status == 0) {
// {"status":1,"message":"删除成功"}
this.props.showNotification('删除成功')
trigger('updatabanner')
this.fetchAll()
}
})
@ -499,6 +512,7 @@ class studentsList extends Component{
})
}
const isAdminOrTeacher = this.props.isAdminOrTeacher()
const hasGraduationModule = this.hasGraduationModule()
return(
<React.Fragment>
@ -544,9 +558,9 @@ class studentsList extends Component{
`}</style>
<div className="mt20 edu-back-white padding20 teacherList">
<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">
{ 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>
<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">
<p className="clearfix mb10">
<span className="fl with40 pr20">&nbsp;</span>
<span className="fl pr20 color-grey-c with25">(学生收到{this.props.type==="Exercise"?"试卷":"问卷"}的时间)</span>
<span className="fl color-grey-c">(学生可以答题的时间截点)</span>
<span className="fl pr20 color-grey-c with25">(学生收到{this.props.moduleName || (this.props.type==="Exercise"?"试卷":"问卷")}的时间)</span>
<span className="fl color-grey-c">({this.props.moduleName == '作业' ? '学生“按时”提交作品的时间截点' : '学生可以答题的时间截点'})</span>
</p>
{

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

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

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

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

@ -141,7 +141,7 @@ class Trainingjobsetting extends Component {
// console.log(homeworkid)
let url = `/homework_commons/${homeworkid}/settings.json`;
axios.get(url).then((result) => {
if (result.status === 200) {
if (result!=undefined) {
// console.log(result.data.code_review)
// console.log("设置页")
// console.log(JSON.stringify(result))
@ -637,11 +637,12 @@ class Trainingjobsetting extends Component {
//允许补交
onChanges = (e) => {
// debugger
// console.log("640");
// console.log(this.state.end_time);
if(e.target.value ==="允许补交"){
if(this.state.end_time !== null && this.state.end_time!== undefined){
// 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({
late_time:moment(handleDateString(times)).add(1, 'months'),
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) => {
const publish_time = this.state.publish_time;
if (!end_time || !publish_time) {
// disabledEndDate = (end_time) => {
// const publish_time = this.state.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 end_time.valueOf() <= publish_time.valueOf();
var endValues= moment(endValue).subtract(1, 'days');
return startValue.valueOf() > endValues.valueOf();
};
}
disabledEndDates = (end_time) => {
const publish_time = this.state.end_time
if (!end_time || !publish_time) {
disabledEndDateend = (endValue) => {
const startValue = this.state.publish_time;
if (!endValue || !startValue) {
return false;
}
console.log("end_time.valueOf()")
// console.log(end_time.valueOf());
// console.log(publish_time.valueOf());
return end_time.valueOf() <= publish_time.valueOf();
var endValuesys= moment(startValue).subtract(1, 'days');
return endValue.valueOf() <= endValuesys.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) => {
this.setState({
[field]: handleDateString(dateString),
@ -1085,7 +1120,10 @@ class Trainingjobsetting extends Component {
// console.log(value);
console.log(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 === "允许补交") {
this.setState({
end_time:moment(handleDateString(dateString)).add(1, 'months'),
@ -1123,13 +1161,15 @@ class Trainingjobsetting extends Component {
deadline:undefined,
})
} 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")) {
this.setState({
unit_e_tip: "截止时间不能早于发布时间",
p_flag: true,
borredss:"bor-reds",
end_time:undefined,
deadline:undefined,
end_time:value.format('YYYY-MM-DD HH:mm'),
deadline:value.format('YYYY-MM-DD HH:mm'),
})
return
@ -1144,11 +1184,13 @@ class Trainingjobsetting extends Component {
} catch (e) {
}
this.onChangedata('end_time', value, dateString);
// this.onChangedata('end_time', value, dateString);
if(this.state.allowreplenishment === "允许补交"){
this.setState({
late_time:moment(handleDateString(dateString)).add(1, 'months'),
late_times:moment(handleDateString(dateString)).add(1, 'months').format('YYYY-MM-DD HH:mm'),
end_time:moment(handleDateString(dateString)),
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;
}
let{publish_time,unifiedsetting,rulesdata}=this.state;
let{publish_time,end_time,unifiedsetting,rulesdata}=this.state;
if(unifiedsetting===true){
if (moment(value, "YYYY-MM-DD HH:mm") <= moment(publish_time)) {
@ -1172,20 +1214,30 @@ class Trainingjobsetting extends Component {
hand__e_tip: "补交时间不能早于发布时间",
hand_flags: true,
handclass:"bor-reds",
late_times:undefined,
late_time:undefined,
late_times:value.format('YYYY-MM-DD HH:mm'),
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 {
this.setState({
late_times: value.format('YYYY-MM-DD HH:mm'),
late_time:value.format('YYYY-MM-DD HH:mm'),
hand__e_tip: "",
hand_flags: false,
handclass:"",
})
this.onChangedata('late_time', value, dateString);
}catch (e) {
}
@ -1206,11 +1258,11 @@ class Trainingjobsetting extends Component {
}else{
this.setState({
late_times: value.format('YYYY-MM-DD HH:mm'),
late_time:value.format('YYYY-MM-DD HH:mm'),
hand__e_tip: "",
hand_flags: false,
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
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"
to={`/courses/${this.state.props.match.params.coursesId}/${this.state.shixuntypes}/${this.state.props.match.params.homeworkid}/settings`}
>设置</Link>
@ -1611,7 +1676,7 @@ class Trainingjobsetting extends Component {
<div className="stud-class-set bor-bottom-greyE edu-back-white">
<div className=" mt20 pl20">
<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 ?
<a className="fr" onClick={this.editSetting}><Tooltip title="编辑"><i
@ -1647,7 +1712,7 @@ class Trainingjobsetting extends Component {
<DatePicker
showToday={false}
id={"publishtimeid"}
disabledDate={this.disabledDateTime}
disabledDate={this.disabledStartDatestart}
disabledTime={disabledDateTime}
className={borreds}
showTime={{ format: 'HH:mm' }}
@ -1679,7 +1744,6 @@ class Trainingjobsetting extends Component {
<DatePicker
showToday={false}
id={"end_timeid"}
disabledDate={this.disabledDateTime}
disabledTime={disabledDateTime}
showTime={{ format: 'HH:mm' }}
className={borredss}
@ -1712,6 +1776,7 @@ class Trainingjobsetting extends Component {
>
<PollDetailTabForthRules
rules={rules}
moduleName={"作业"}
course_group={rulest}
flagPageEdit={flagPageEdit}
rulesCheckInfo={(info)=>this.rulesCheckInfo(info)}
@ -1760,7 +1825,6 @@ class Trainingjobsetting extends Component {
<DatePicker
showToday={false}
id={"late_timeid"}
disabledDate={this.disabledEndDates}
disabledTime={disabledDateTime}
format="YYYY-MM-DD HH:mm"
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}>
<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"
value={"满分"}>不扣分 </Radio>
</RadioGroup>
@ -1820,7 +1884,7 @@ class Trainingjobsetting extends Component {
checked={this.state.completionefficiencyscore} style={{"color":"#666666"}}>效率分<span
className={"font-14 color-grey-9 font-14 ml15"} style={{"text-align":"left"}}>(选中则学生最终成绩包含效率分)</span></Checkbox>
</div>
<div className="ml80 mt20">
<div className="ml80 mt30">
<span className="c_grey mr10" style={{"color":"#999999"}}>分值</span>
<InputNumber min={0} disabled={!flagPageEdit} max={100} className="ml10 h40 mr10 color-grey-9"
style={{width: "100px","color":"#999999"}}
@ -1867,7 +1931,7 @@ class Trainingjobsetting extends Component {
</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={"font-16 color-dark fl pl20 "} style={{"color":"#05101A"}}>公开设置</div>
</div>
@ -1879,7 +1943,6 @@ class Trainingjobsetting extends Component {
</div>
</div>

@ -427,7 +427,7 @@ class Workquestionandanswer extends Component {
</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>
<div className={"font-16 color-dark fl pl20 "}>
<div dangerouslySetInnerHTML={{__html: markdownToHTML(jobsettingsdata.data.description).replace(/▁/g,"▁▁▁")}}></div>
@ -466,7 +466,8 @@ class Workquestionandanswer extends Component {
<span>
<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>

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

@ -149,7 +149,7 @@ class EducoderLogin extends Component {
"align-items": "center",
"width": "100%",
}}>
<div style={{"margin-top": "40px","height":"500px"}}>
<div style={{"margin-top": "40px","height":"530px"}}>
<LoginRegisterComponent {...this.props} {...this.state}
Setshowbool={this.Setshowbool} ></LoginRegisterComponent>
@ -163,7 +163,7 @@ class EducoderLogin extends Component {
"align-items": "center",
"width": "100%",
}}>
<div style={{"margin-top": "40px","height":"500px"}}>
<div style={{"margin-top": "40px","height":"530px"}}>
<FindPasswordComponent {...this.props} {...this.state}
Setshowbool={this.Setshowbool}></FindPasswordComponent>
@ -171,15 +171,13 @@ class EducoderLogin extends Component {
</div>
}
<div style={{"height":"250px",
<div style={{"height":"180px",
"display": "flex",
"justify-content": "center",
"align-items": "center",
"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>

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

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

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

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

@ -170,10 +170,11 @@ class NewHeader extends Component {
submitapplications:false,
isRender:false,
isRenders:false,
user_phone_binded:false,
showTrial:false,
}
console.log("176")
console.log(props);
// console.log("176")
// console.log(props);
}
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) {
this.setState({
user:newProps.user
@ -330,6 +344,24 @@ class NewHeader extends Component {
})
}
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({
// isRender:true
@ -337,17 +369,16 @@ class NewHeader extends Component {
var url = `/accounts/logout.json`;
axios.get((url)).then((result) => {
if(result!==undefined){
// this.setState({
// isRender:true
// })
window.location.href = "/";
}
if(result!==undefined){
// this.setState({
// isRender:true
// })
window.location.href = "/";
}
}).catch((error) => {
console.log(error);
console.log(error);
})
}
onKeywordSearch = () => {
header_search(this)
}
@ -550,6 +581,7 @@ submittojoinclass=(value)=>{
user,
isRender,
isRenders,
user_phone_binded,
}=this.state;
/*
用户名称 用户头像url
@ -571,11 +603,11 @@ submittojoinclass=(value)=>{
}else {
activeIndex = true;
}
// join_course_url: "https://www.educoder.net/courses/join_course_multi_role"
// join_project_url: "https://www.educoder.net/applied_project/applied_project_info"
// rolearr:["",""],
// console.log()
// console.log("618");
// console.log(user_phone_binded);
return (
<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">
{/*<%= link_to image_tag("/images/educoder/logo.png", alt:"高校智能化教学与实训平台", className:"logoimg"), home_path %>*/}
<a href="/">
@ -729,7 +761,7 @@ submittojoinclass=(value)=>{
<li className="bor-top-greyE">
{/*<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.educoderloginysl()}>退出</a>
</li>
</ul>

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

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

@ -1,5 +1,8 @@
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 "antd/dist/antd.css";
@ -222,7 +225,8 @@ export default class TPMsettings extends Component {
pod_exist_time: undefined,
pod_exist_timetype: false,
shixunmemoMDvalue:""
shixunmemoMDvalue:"",
language:""
}
}
descriptionMD=(initValue, id)=> {
@ -355,6 +359,8 @@ export default class TPMsettings extends Component {
// this.evaluate_scriptMD(response.data.shixun.evaluate_script, "shixunmemoMD");
this.descriptionMD(response.data.shixun.description, "shixundescription");
// this.bigClass()
// if (response.data.shixun.status === 2) {
//
// } else if (response.data.shixun.status === 1) {
@ -506,6 +512,7 @@ export default class TPMsettings extends Component {
}
bigClass = (value) => {
let url = `/shixuns/get_mirror_script.json?mirror_id=`+value;
axios.get(url).then((response) => {
if (response.status === 200) {
@ -891,6 +898,7 @@ export default class TPMsettings extends Component {
SelectScput = (value, e) => {
this.setState({
choice_standard_scriptssum: value,
language:e.props.name,
choice_standard_scripts: {id:e.props.value,value:""},
standard_scriptsModal:true
})
@ -1000,11 +1008,15 @@ export default class TPMsettings extends Component {
})
}
getshixunmemoMDvalue=(e)=>{
getshixunmemoMDvalue=(value, e)=>{
this.setState({
shixunmemoMDvalue:e.target.value
shixunmemoMDvalue:value
})
}
render() {
let {
postapplyvisible,
@ -1072,7 +1084,7 @@ export default class TPMsettings extends Component {
}
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 (
<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:""}
onSelect={operateauthority?this.bigopens:""}
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:""}>
{
standard_scripts === undefined ? "" : standard_scripts.map((item, key) => {
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="fl " id="shixunmemoMD" >
<textarea className={"shixunmemoMDdiv"} value={shixunmemoMDvalue} onInput={this.getshixunmemoMDvalue} name="content">
</textarea>
<div className="fl " >
{/*<textarea className={"shixunmemoMDdiv"} value={shixunmemoMDvalue} onInput={this.getshixunmemoMDvalue} name="content">*/}
{/*</textarea>*/}
<MonacoEditor
height="450"
width="1100"
language={this.state.language}
value={shixunmemoMDvalue}
options={ {
selectOnLineNumbers: true
}}
onChange={operateauthority===true?this.getshixunmemoMDvalue:""}
/>
</div>

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

@ -239,7 +239,7 @@ class Challenges extends Component {
<p className="clearfix mb30">
<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"
data-tip-down="编辑">
<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"
id="challenge_editorMd_description">
<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>
}
</p>
@ -262,7 +262,7 @@ class Challenges extends Component {
<p className="clearfix mb10">
<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"}
className="white-btn edu-greenline-btn fr"
// data-tip-down="新增代码编辑类型任务"
@ -275,7 +275,7 @@ class Challenges extends Component {
</Link> : ""
}
{this.props.identity < 4 && this.props.status === 0 ?
{this.props.identity < 4 && ChallengesDataList&&ChallengesDataList.shixun_status=== 0 ?
<Link to={"/shixuns/" + id + "/challenges/newquestion"}
className="white-btn edu-greenline-btn fr mr20"
// data-tip-down="新增选择题类型任务"
@ -359,7 +359,7 @@ class Challenges extends Component {
{item.delete_url != undefined &&
<Tooltip placement="bottom" title={"删除"}>
<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">
<img src={getImageUrl("images/educoder/icon/close.svg")}
className="fl mt5 ml5" />
@ -371,7 +371,7 @@ class Challenges extends Component {
{item.up_url != undefined &&
<Tooltip placement="bottom" title={"向上移动"}>
<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">
<img src={getImageUrl("images/educoder/icon/moveup.svg")}
className="fl mt2 ml4" />
@ -381,7 +381,7 @@ class Challenges extends Component {
{item.down_url != undefined &&
<Tooltip placement="bottom" title={"向下移动"}>
<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">
<img src={getImageUrl("images/educoder/icon/movedown.svg")} className="fl mt2 ml4" />
</a>
@ -393,7 +393,7 @@ class Challenges extends Component {
item.st === 1 ?
<Tooltip placement="bottom" title={"编辑"}>
<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"}
className="fl ring-green">
<img src={getImageUrl("images/educoder/icon/edit.svg")}
@ -403,7 +403,7 @@ class Challenges extends Component {
:
<Tooltip placement="bottom" title={"编辑"}>
<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"}
className="fl ring-green">
<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>
</div>
<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>
</Modal>
</div>

@ -9,315 +9,315 @@ import './common.css'
const TabPane = Tabs.TabPane
const loginInputsyl = {
"width": " 100%",
"height": "40px",
"width": " 100%",
"height": "40px",
}
//父组件 EducoderLogin.js
class LoginRegisterComponent extends Component {
constructor(props) {
super(props)
this.state = {
login: "",
password: "",
passwords: "",
seconds: 60,
codes: "",
getverificationcodes: true,
Phonenumberisnotco: undefined,
Phonenumberisnotcobool: false,
s: 'text',
classpass: "text",
readonlyInput: true,
}
}
openNotification = (messge) => {
notification.open({
message: "提示",
description:
messge,
onClick: () => {
console.log('Notification Clicked!');
},
});
};
StudyMakeMoney = () => { // 调用父组件方法
this.props.Setshowbool();
}
// 点击表单后改变type
changeType = () => {
this.setState({classpass: 'password'});
}
changeTypey = () => {
}
//倒计时
getverificationcode = () => {
if (this.state.Phonenumberisnotcobool === false ||this.state.Phonenumberisnotcobool === undefined) {
if (this.state.login&&this.state.login.length === 0) {
this.openNotification("请输入手机号或邮箱");
return
} else {
this.openNotification("请输入正确的手机号或邮箱");
}
return;
}
if (this.state.getverificationcodes === true) {
this.setState({
getverificationcodes: undefined,
})
let timer = setInterval(() => {
this.setState((preState) => ({
seconds: preState.seconds - 1,
}), () => {
if (this.state.seconds == 0) {
clearInterval(timer);
this.setState({
getverificationcodes: false,
seconds: 60,
})
}
});
}, 1000)
this.SMSverification();
} else {
this.setState({
getverificationcodes: undefined,
})
let timer = setInterval(() => {
this.setState((preState) => ({
seconds: preState.seconds - 1,
}), () => {
if (this.state.seconds == 0) {
clearInterval(timer);
this.setState({
getverificationcodes: false,
seconds: 60,
})
}
});
}, 1000)
this.SMSverification();
}
}
//短信验证
SMSverification = () => {
var url = `/accounts/get_verification_code.json`;
axios.get((url), {
params: {
login: this.state.login,
type: 2,
}
}).then((result) => {
//验证有问题{"status":1,"message":"success"}
console.log(result);
}).catch((error) => {
console.log(error);
})
}
cancelReadOnly = () => {
this.setState({
readonlyInput: false,
})
}
//找回密码
Retrievepassword = () => {
if (this.state.Phonenumberisnotcobool === false) {
if (this.state.login.length === 0) {
this.openNotification("请输入手机号或邮箱");
return
}
this.openNotification("请输入正确的手机号或邮箱");
return;
}
if (this.state.login === undefined || this.state.login == "") {
this.openNotification(`请输入登录手机号码或邮箱`);
return
} else if (this.state.password === undefined || this.state.password == "") {
this.openNotification(`请输入密码`);
return
} else if (this.state.passwords === undefined || this.state.passwords == "") {
this.openNotification(`请输入密码`);
return
} else if (this.state.password !== this.state.passwords) {
this.openNotification(`两次密码不相同`);
return
} else if (this.state.codes === undefined || this.state.codes == "") {
this.openNotification(`请输入验证码`);
return
}
var url = "/accounts/reset_password.json";
axios.post(url, {
login: this.state.login,
code: this.state.codes,
new_password: this.state.password,
new_password_confirmation: this.state.passwords,
}).then((result) => {
// console.log(result);
//登录成功会生成session
this.openNotification("找回密码成功,请重新登入。");
window.location.href = "/login"
}).catch((error) => {
})
}
openNotification = (messge) => {
notification.open({
message: "提示",
description:
messge,
onClick: () => {
console.log('Notification Clicked!');
},
});
};
loginInputonChange = (e) => {
// console.log(e.target.value);
this.setState({
login: e.target.value,
})
}
loginInputonChanges = (e) => {
// console.log(e.target.value);
this.setState({
password: e.target.value,
})
}
loginInputonChangess = (e) => {
// console.log(e.target.value);
this.setState({
passwords: e.target.value,
})
}
//获取code
codesonChange = (e) => {
this.setState({
codes: e.target.value
})
}
inputOnBlur = (e) => {
this.isCorrectname(e.target.value);
// this.Emailphonenumberverification(e.target.value, id);
}
isCorrectname = (value) => {
console.log(value.length);
if (value.length === 0) {
this.setState({
Phonenumberisnotco: undefined,
Phonenumberisnotcobool: false,
})
return;
}
// var telephone = $("#telephoneAdd.tianjia_phone").val();
var regph = /^[1][3,4,5,6,7,8][0-9]{9}$/;
// var email = $("#add_email.tianjia_email").val();
var regemail = /^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/;
// [1]手机号开头必须是1 [3,4,5,6,7,8] 第二位是3-8中的一个 [0-9]{9} 后边9位可以是0-9的任意数字。
var stringdata = undefined;
if (!regph.test(value)) {
stringdata = "手机号格式不正确";
this.setState({
Phonenumberisnotco: stringdata,
Phonenumberisnotcobool: false,
})
} else {
this.setState({
Phonenumberisnotco: undefined,
Phonenumberisnotcobool: true,
})
return
}
if (!regemail.test(value)) {
if ((value.indexOf("@") != -1) === true) {
stringdata = "邮箱格式不正确";
} else {
stringdata = "手机号格式不正确";
}
this.setState({
Phonenumberisnotco: stringdata,
Phonenumberisnotcobool: false,
})
this.Emailphonenumberverification(value)
return
} else {
this.setState({
Phonenumberisnotco: undefined,
Phonenumberisnotcobool: true,
})
return
}
}
//邮箱手机号验证
Emailphonenumberverification = (value) => {
var url = `/accounts/valid_email_and_phone.json`;
axios.get((url), {
params: {
login: value,
type: 2,
}
}).then((result) => {
//验证有问题{"status":1,"message":"success"}
// console.log(result);
this.openNotification("验证码已发送,请注意查收!",2);
}).catch((error) => {
console.log(error);
// this.setState({
// login:"",
// logins:"",
// })
})
}
render() {
const {
activeKey,
// 登录
autoLogin,
// 注册
readAgreement, dragOk,
login,
password,
passwords,
classpass,
seconds,
getverificationcodes,
Phonenumberisnotco,
readonlyInput,
codes,
} = this.state
// height: 346px;
return (
<div className="login_register_content" style={{height: "482px"}}>
<Input type="text" name="username" value={"namename"}
style={{height: '0', width: '0', border: 'none', display: "none"}}/>
<Input type="password" name="password" id="password" value={"123123123"}
style={{height: '0', width: '0', border: 'none', display: "none"}}/>
<style>{`
constructor(props) {
super(props)
this.state = {
login: "",
password: "",
passwords: "",
seconds: 60,
codes: "",
getverificationcodes: true,
Phonenumberisnotco: undefined,
Phonenumberisnotcobool: false,
s: 'text',
classpass: "text",
readonlyInput: true,
}
}
openNotification = (messge) => {
notification.open({
message: "提示",
description:
messge,
onClick: () => {
console.log('Notification Clicked!');
},
});
};
StudyMakeMoney = () => { // 调用父组件方法
this.props.Setshowbool();
}
// 点击表单后改变type
changeType = () => {
this.setState({classpass: 'password'});
}
changeTypey = () => {
}
//倒计时
getverificationcode = () => {
if (this.state.Phonenumberisnotcobool === false || this.state.Phonenumberisnotcobool === undefined) {
if (this.state.login && this.state.login.length === 0) {
this.openNotification("请输入手机号或邮箱");
return
} else {
this.openNotification("请输入正确的手机号或邮箱");
}
return;
}
if (this.state.getverificationcodes === true) {
this.setState({
getverificationcodes: undefined,
})
let timer = setInterval(() => {
this.setState((preState) => ({
seconds: preState.seconds - 1,
}), () => {
if (this.state.seconds == 0) {
clearInterval(timer);
this.setState({
getverificationcodes: false,
seconds: 60,
})
}
});
}, 1000)
this.SMSverification();
} else {
this.setState({
getverificationcodes: undefined,
})
let timer = setInterval(() => {
this.setState((preState) => ({
seconds: preState.seconds - 1,
}), () => {
if (this.state.seconds == 0) {
clearInterval(timer);
this.setState({
getverificationcodes: false,
seconds: 60,
})
}
});
}, 1000)
this.SMSverification();
}
}
//短信验证
SMSverification = () => {
var url = `/accounts/get_verification_code.json`;
axios.get((url), {
params: {
login: this.state.login,
type: 2,
}
}).then((result) => {
//验证有问题{"status":1,"message":"success"}
console.log(result);
}).catch((error) => {
console.log(error);
})
}
cancelReadOnly = () => {
this.setState({
readonlyInput: false,
})
}
//找回密码
Retrievepassword = () => {
if (this.state.Phonenumberisnotcobool === false) {
if (this.state.login.length === 0) {
this.openNotification("请输入手机号或邮箱");
return
}
this.openNotification("请输入正确的手机号或邮箱");
return;
}
if (this.state.login === undefined || this.state.login == "") {
this.openNotification(`请输入登录手机号码或邮箱`);
return
} else if (this.state.password === undefined || this.state.password == "") {
this.openNotification(`请输入密码`);
return
} else if (this.state.passwords === undefined || this.state.passwords == "") {
this.openNotification(`请输入密码`);
return
} else if (this.state.password !== this.state.passwords) {
this.openNotification(`两次密码不相同`);
return
} else if (this.state.codes === undefined || this.state.codes == "") {
this.openNotification(`请输入验证码`);
return
}
var url = "/accounts/reset_password.json";
axios.post(url, {
login: this.state.login,
code: this.state.codes,
new_password: this.state.password,
new_password_confirmation: this.state.passwords,
}).then((result) => {
// console.log(result);
//登录成功会生成session
this.openNotification("找回密码成功,请重新登入。");
window.location.href = "/login"
}).catch((error) => {
})
}
openNotification = (messge) => {
notification.open({
message: "提示",
description:
messge,
onClick: () => {
console.log('Notification Clicked!');
},
});
};
loginInputonChange = (e) => {
// console.log(e.target.value);
this.setState({
login: e.target.value,
})
}
loginInputonChanges = (e) => {
// console.log(e.target.value);
this.setState({
password: e.target.value,
})
}
loginInputonChangess = (e) => {
// console.log(e.target.value);
this.setState({
passwords: e.target.value,
})
}
//获取code
codesonChange = (e) => {
this.setState({
codes: e.target.value
})
}
inputOnBlur = (e) => {
this.isCorrectname(e.target.value);
// this.Emailphonenumberverification(e.target.value, id);
}
isCorrectname = (value) => {
console.log(value.length);
if (value.length === 0) {
this.setState({
Phonenumberisnotco: undefined,
Phonenumberisnotcobool: false,
})
return;
}
// var telephone = $("#telephoneAdd.tianjia_phone").val();
var regph = /^[1][3,4,5,6,7,8][0-9]{9}$/;
// var email = $("#add_email.tianjia_email").val();
var regemail = /^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/;
// [1]手机号开头必须是1 [3,4,5,6,7,8] 第二位是3-8中的一个 [0-9]{9} 后边9位可以是0-9的任意数字。
var stringdata = undefined;
if (!regph.test(value)) {
stringdata = "手机号格式不正确";
this.setState({
Phonenumberisnotco: stringdata,
Phonenumberisnotcobool: false,
})
} else {
this.setState({
Phonenumberisnotco: undefined,
Phonenumberisnotcobool: true,
})
return
}
if (!regemail.test(value)) {
if ((value.indexOf("@") != -1) === true) {
stringdata = "邮箱格式不正确";
} else {
stringdata = "手机号格式不正确";
}
this.setState({
Phonenumberisnotco: stringdata,
Phonenumberisnotcobool: false,
})
this.Emailphonenumberverification(value)
return
} else {
this.setState({
Phonenumberisnotco: undefined,
Phonenumberisnotcobool: true,
})
return
}
}
//邮箱手机号验证
Emailphonenumberverification = (value) => {
var url = `/accounts/valid_email_and_phone.json`;
axios.get((url), {
params: {
login: value,
type: 2,
}
}).then((result) => {
//验证有问题{"status":1,"message":"success"}
// console.log(result);
this.openNotification("验证码已发送,请注意查收!", 2);
}).catch((error) => {
console.log(error);
// this.setState({
// login:"",
// logins:"",
// })
})
}
render() {
const {
activeKey,
// 登录
autoLogin,
// 注册
readAgreement, dragOk,
login,
password,
passwords,
classpass,
seconds,
getverificationcodes,
Phonenumberisnotco,
readonlyInput,
codes,
} = this.state
// height: 346px;
return (
<div className="login_register_content" style={{height: "520px"}}>
<Input type="text" name="username" value={"namename"}
style={{height: '0', width: '0', border: 'none', display: "none"}}/>
<Input type="password" name="password" id="password" value={"123123123"}
style={{height: '0', width: '0', border: 'none', display: "none"}}/>
<style>{`
.login_section .section_header {
margin-bottom: 16px;
@ -329,104 +329,116 @@ class LoginRegisterComponent extends Component {
color: #05101A;
line-height: 69px;
}
.loginInputzhuche{
width: 100%;
background-color: #fff!important;
height: 45px !important;
padding: 5px;
}
`}</style>
<div className="login_section">
<div className="section_header">
找回密码
</div>
<div style={{width: '340px'}}>
<style>
{
`
<div className="login_section">
<div className="section_header font-18" style={{color:"#05101A"}}>
找回密码
</div>
<div style={{width: '340px'}}>
<style>
{
`
.ant-input {
font-family: "Monospaced Number", "Chinese Quote", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif;
-webkit-box-sizing: border-box;
box-sizing: border-box;
margin: 0;
padding: 0;
list-style: none;
position: relative;
display: inline-block;
padding: 4px 11px;
width: 100%;
height: 38px;
font-size: 14px;
line-height: 1.5;
color: rgba(0, 0, 0, 0.65);
background-color: #fff;
background-image: none;
border: 1px solid #d9d9d9;
border-radius: 4px;
-webkit-transition: all .3s;
-o-transition: all .3s;
transition: all .3s;
}
`
}
</style>
<Input style={loginInputsyl} type="text" autoComplete="off" onClick={this.changeTypey}
placeholder="输入注册手机号或邮箱" value={this.state.login} onBlur={(e) => this.inputOnBlur(e)}
onChange={this.loginInputonChange} style={{marginTop: '10px',height: "38px"}}></Input>
{
Phonenumberisnotco && Phonenumberisnotco != "" ?
<p className="color-red mt5 mb5" style={{width: " 100%", height: "20px"}}>
<span className="fl" style={{textAlign:"center",width: " 100%"}}>{Phonenumberisnotco}</span>
</p>
: <div style={{height: "25px"}}></div>
}
<DragValidator
height={38} successGreenColor="#45E15F"
style={{height:"38px",width:"100%"}}
dragOkCallback={this.dragOkCallback}
></DragValidator>
<Input type={classpass}
onClick={this.changeType} autoComplete="new-password" onChange={this.loginInputonChanges}
value={this.state.password} style={{width:"100%",height:"38px",marginTop:'25px'}} placeholder="输入8~16位密码区分大小写"></Input>
<Input type={classpass}
onClick={this.changeType} autoComplete="new-password"
onChange={this.loginInputonChangess} value={this.state.passwords}
style={{height:"38px",marginTop:'25px',width:"100%"}}
placeholder="再次输入新密码"></Input>
<div className={"mt25"}>
<Input className="fl mr5" type="text" autoComplete="off" style={{
width: "210px",
height: "38px",
}} placeholder="请输入验证码"
onChange={this.codesonChange}
value={codes}
>
</Input>
{
getverificationcodes === undefined ?
<Button className="fl ml5 " disabled
style={{"width": "120px", "text-align": "center", "height": "38px",}}
size={"large"}>重新发送{seconds}s</Button>
: getverificationcodes === true ?
<Button className="fl ml5 "
style={{"width": "120px", "text-align": "center", "height": "38px"}}
type="primary"
onClick={() => this.getverificationcode()} size={"large"}>获取验证码</Button>
:
<Button className="fl ml5 "
style={{"width": "120px", "text-align": "center", "height": "38px"}}
type="primary"
onClick={() => this.getverificationcode()} size={"large"}>重新发送</Button>
}
</div>
<Button className="login_btn" size={"large"} type="primary"
style={{height:"46px"}}
onClick={this.Retrievepassword}>完成</Button>
</div>
</div>
</div>
);
}
font-family: "Monospaced Number", "Chinese Quote", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif;
-webkit-box-sizing: border-box;
box-sizing: border-box;
margin: 0;
padding: 0;
list-style: none;
position: relative;
display: inline-block;
padding: 4px 11px;
width: 100%;
height: 38px;
font-size: 14px;
line-height: 1.5;
color: rgba(0, 0, 0, 0.65);
background-color: #fff;
background-image: none;
border: 1px solid #d9d9d9;
border-radius: 4px;
-webkit-transition: all .3s;
-o-transition: all .3s;
transition: all .3s;
}
`
}
</style>
<Input style={loginInputsyl} type="text" autoComplete="off" onClick={this.changeTypey}
className={"loginInputzhuche"}
placeholder="输入注册手机号或邮箱" value={this.state.login} onBlur={(e) => this.inputOnBlur(e)}
onChange={this.loginInputonChange} style={{marginTop: '10px', height: "38px"}}></Input>
{
Phonenumberisnotco && Phonenumberisnotco != "" ?
<p className="color-red mt5 mb5" style={{width: " 100%", height: "20px"}}>
<span className="fl" style={{textAlign: "center", width: " 100%"}}>{Phonenumberisnotco}</span>
</p>
: <div style={{height: "25px"}}></div>
}
<DragValidator
height={38} successGreenColor="#45E15F"
style={{height: "38px", width: "100%"}}
dragOkCallback={this.dragOkCallback}
></DragValidator>
<Input type={classpass}
className={"loginInputzhuche"}
onClick={this.changeType} autoComplete="new-password" onChange={this.loginInputonChanges}
value={this.state.password} style={{width: "100%", height: "38px", marginTop: '25px'}}
placeholder="输入8~16位密码区分大小写"></Input>
<Input type={classpass}
className={"loginInputzhuche"}
onClick={this.changeType} autoComplete="new-password"
onChange={this.loginInputonChangess} value={this.state.passwords}
style={{height: "38px", marginTop: '25px', width: "100%"}}
placeholder="再次输入新密码"></Input>
<div className={"mt25"}>
<Input className="fl mr5 loginInputzhuche" type="text" autoComplete="off" style={{
width: "210px",
height: "38px",
}} placeholder="请输入验证码"
onChange={this.codesonChange}
value={codes}
>
</Input>
{
getverificationcodes === undefined ?
<Button className="fl ml5 " disabled
style={{"width": "120px", "text-align": "center", "height": "45px",}}
size={"large"}>重新发送{seconds}s</Button>
: getverificationcodes === true ?
<Button className="fl ml5 "
style={{"width": "120px", "text-align": "center", "height": "45px"}}
type="primary"
onClick={() => this.getverificationcode()} size={"large"}>获取验证码</Button>
:
<Button className="fl ml5 "
style={{"width": "120px", "text-align": "center", "height": "45px"}}
type="primary"
onClick={() => this.getverificationcode()} size={"large"}>重新发送</Button>
}
</div>
<Button className="login_btn" size={"large"} type="primary"
style={{height: "46px"}}
onClick={this.Retrievepassword}>完成</Button>
</div>
</div>
</div>
);
}
}
export default (LoginRegisterComponent);

@ -212,8 +212,8 @@ class LoginRegisterComponent extends Component {
Phonenumberisnotcos: undefined,
Phonenumberisnotcobool: true,
})
this.Emailphonenumberverification(value, id)
}
this.Emailphonenumberverification(value, id)
return
}
@ -222,8 +222,11 @@ class LoginRegisterComponent extends Component {
stringdata = "邮箱格式不正确";
} else {
stringdata = "手机号格式不正确";
}
// if (!regph.test(value)) {
// // 这里先判断是不是手机号然后在判断是不是邮箱然后又判断是不是手机号,如果不是手机号就是账号
// stringdata=undefined;
// }
}
if (id === 1) {
this.setState({
Phonenumberisnotco: stringdata,
@ -234,8 +237,8 @@ class LoginRegisterComponent extends Component {
Phonenumberisnotcos: stringdata,
Phonenumberisnotcobool: false,
})
this.Emailphonenumberverification(value, id)
}
this.Emailphonenumberverification(value, id)
return
} else {
if (id === 1) {
@ -248,8 +251,8 @@ class LoginRegisterComponent extends Component {
Phonenumberisnotcos: undefined,
Phonenumberisnotcobool: true,
})
this.Emailphonenumberverification(value, id)
}
this.Emailphonenumberverification(value, id)
return
}
}
@ -548,13 +551,13 @@ class LoginRegisterComponent extends Component {
// console.log(activeKey);
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>
<Menu mode="horizontal" selectedKeys={tab} onClick={this.changeTab}>
<Menu.Item key="0">登录</Menu.Item>
<Menu.Item key="1">注册</Menu.Item>
<Menu.Item key="0" className="font-18" style={{color:"#05101A"}}> 登录</Menu.Item>
<Menu.Item key="1" className="font-18" style={{color:"#05101A"}}>注册</Menu.Item>
</Menu>
{
@ -563,36 +566,45 @@ class LoginRegisterComponent extends Component {
<style>
{
`
.ant-input {
font-family: "Monospaced Number", "Chinese Quote", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif;
-webkit-box-sizing: border-box;
box-sizing: border-box;
margin: 0;
padding: 0;
list-style: none;
position: relative;
display: inline-block;
padding: 4px 11px;
width: 100%;
height: 38px;
font-size: 14px;
line-height: 1.5;
color: rgba(0, 0, 0, 0.65);
background-color: #fff;
background-image: none;
border: 1px solid #d9d9d9;
border-radius: 4px;
-webkit-transition: all .3s;
-o-transition: all .3s;
transition: all .3s;
}
.ant-input {
font-family: "Monospaced Number", "Chinese Quote", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif;
-webkit-box-sizing: border-box;
box-sizing: border-box;
margin: 0;
padding: 0;
list-style: none;
position: relative;
display: inline-block;
padding: 4px 11px;
width: 100%;
height: 38px;
font-size: 14px;
line-height: 1.5;
color: rgba(0, 0, 0, 0.65);
background-color: #fff;
background-image: none;
border: 1px solid #d9d9d9;
border-radius: 4px;
-webkit-transition: all .3s;
-o-transition: all .3s;
transition: all .3s;
}
.loginInputzhuche{
width: 100%;
background-color: #fff!important;
height: 45px !important;
padding: 5px;
}
`
}
</style>
<Input placeholder="请输入登录手机号码或邮箱" value={this.state.login}
onChange={this.loginInputonChange}
name="username"
className="font-14 color-grey-9"
className="font-14 color-grey-9 loginInputzhuche"
onBlur={(e) => this.inputOnBlur(e, 1)}
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}
onChange={this.passwordonChange}
className="font-14 color-grey-9 loginInput"
className="font-14 color-grey-9 loginInputzhuche"
placeholder="密码"></Input>
@ -621,10 +633,33 @@ class LoginRegisterComponent extends Component {
size={"large"}>登录</Button>
</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 &&
<div style={{width: '340px'}}>
<Input className="loginInputsyl color-grey-9" placeholder="请使用手机号/邮箱账号进行注册"
<Input className="loginInputsyl color-grey-9 loginInputzhuche" placeholder="请使用手机号/邮箱账号进行注册"
value={this.state.logins}
type="text" autoComplete="off"
onChange={this.loginInputonChanges}
@ -646,7 +681,7 @@ class LoginRegisterComponent extends Component {
></DragValidator>
<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={{
width:'210px',
height:'38px',
@ -657,13 +692,13 @@ class LoginRegisterComponent extends Component {
</Input>
{
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>
: 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>
:
<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>
}
@ -673,13 +708,13 @@ class LoginRegisterComponent extends Component {
{/* style={{height: '0', width: '0', border: 'none', display: "none"}}/>*/}
{/*<Input type="password" name="password" id="password" autoComplete="new-password"*/}
{/* 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}
autoComplete="new-password"
onClick={this.changeType}
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>
}></Input>
<Checkbox onChange={this.onChange}

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

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

Loading…
Cancel
Save