caishi 6 years ago
commit 439d63ab46

@ -9,7 +9,7 @@ import '../css/Courses.css';
import Modals from "../../modals/Modals"; import Modals from "../../modals/Modals";
import AddStudentModal from '../members/modal/AddStudentModal' import AddStudentModal from '../members/modal/AddStudentModal'
import AddTeacherModal from '../members/modal/AddTeacherModal' import AddTeacherModal from '../members/modal/AddTeacherModal'
import Trialapplication from "../../login/Trialapplication";
// 点击按钮复制功能 // 点击按钮复制功能
// function jsCopy(){ // function jsCopy(){
@ -43,13 +43,20 @@ class CoursesBanner extends Component {
metype: 0, metype: 0,
modalsBottomval: "", modalsBottomval: "",
antIcon:false, antIcon:false,
coursedata:undefined coursedata:undefined,
user_phone_binded:false,
isRenders:false,
showTrial:false,
} }
console.log("CoursesBanner");
console.log("48");
console.log(props);
} }
componentDidMount() { componentDidMount() {
this.updatabanner() this.updatabanner()
this.setState({
user_phone_binded :this.props.user_phone_binded,
})
} }
updatabanner=()=>{ updatabanner=()=>{
let courseId = this.props.match.params.coursesId; let courseId = this.props.match.params.coursesId;
@ -57,9 +64,19 @@ class CoursesBanner extends Component {
axios.get(url).then((result) => { axios.get(url).then((result) => {
if( result!=undefined){ if( result!=undefined){
let data = result.data; let data = result.data;
this.setState({ if(result.data.status === 407){
coursedata: data this.setState({
}) isRenders:true,
coursedata: data,
showTrial:false,
})
}else{
this.setState({
coursedata: data,
showTrial:true,
})
}
} }
}) })
} }
@ -315,265 +332,271 @@ class CoursesBanner extends Component {
} }
render() { render() {
let { Addcoursestypes, coursedata, modalsType, modalsTopval, loadtype,modalsBottomval,antIcon} = this.state; let { Addcoursestypes, coursedata, modalsType, modalsTopval, loadtype,modalsBottomval,antIcon,user_phone_binded} = this.state;
return ( 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'}}> {
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'}}>
{Addcoursestypes === true ? <Addcourses {Addcoursestypes === true ? <Addcourses
Addcoursestype={Addcoursestypes} Addcoursestype={Addcoursestypes}
hideAddcoursestype={() => this.tojoinclass(2)} hideAddcoursestype={() => this.tojoinclass(2)}
/> : ""} /> : ""}
<Modals <Modals
modalsType={modalsType} modalsType={modalsType}
modalsTopval={modalsTopval} modalsTopval={modalsTopval}
loadtype={loadtype} loadtype={loadtype}
modalsBottomval={modalsBottomval} modalsBottomval={modalsBottomval}
modalCancel={this.modalCancel} modalCancel={this.modalCancel}
modalSave={this.ModalAction} modalSave={this.ModalAction}
antIcon={antIcon} antIcon={antIcon}
></Modals> ></Modals>
<AddTeacherModal ref="addTeacherModal" <AddTeacherModal ref="addTeacherModal"
{...this.props} {...this.props}
isTeacher={this.state.isTeacher} isTeacher={this.state.isTeacher}
moduleName={this.state.isTeacher ? "教师" : "助教"} moduleName={this.state.isTeacher ? "教师" : "助教"}
addTeacherSuccess={this.addTeacherSuccess} addTeacherSuccess={this.addTeacherSuccess}
></AddTeacherModal> ></AddTeacherModal>
<AddStudentModal ref="addStudentModal" <AddStudentModal ref="addStudentModal"
{...this.props} {...this.props}
moduleName="学生" moduleName="学生"
addStudentSuccess={this.addStudentSuccess} addStudentSuccess={this.addStudentSuccess}
></AddStudentModal> ></AddStudentModal>
<div className="educontent clearfix educontentTop"> <div className="educontent clearfix educontentTop">
<div className="color-white clearfix mb10"> <div className="color-white clearfix mb10">
{ {
coursedata===undefined || coursedata.status===401 || coursedata.status===407?"": coursedata===undefined || coursedata.status===401 || coursedata.status===407?"":
<Tooltip placement="bottom" title={coursedata&&coursedata.name.length<38?"":coursedata.name}> <Tooltip placement="bottom" title={coursedata&&coursedata.name.length<38?"":coursedata.name}>
<span className="font-24 fl bannername">{coursedata.name}</span> <span className="font-24 fl bannername">{coursedata.name}</span>
</Tooltip> </Tooltip>
} }
{/*访 {/*访
公开公开课堂非课堂成员可以访问*/} 公开公开课堂非课堂成员可以访问*/}
<span className={"TabsWarp"}> <span className={"TabsWarp"}>
<CoursesListType <CoursesListType
typelist={coursedata.course_end === true ? ["已结束"] : coursedata.is_public === true ? ["公开"] : ["私有"]} typelist={coursedata.course_end === true ? ["已结束"] : coursedata.is_public === true ? ["公开"] : ["私有"]}
typesylename={"mt10"} tipval={coursedata.is_public === true?"":"私有课堂,非课堂成员不能访问"}/> typesylename={"mt10"} tipval={coursedata.is_public === true?"":"私有课堂,非课堂成员不能访问"}/>
</span> </span>
</div>
<div className="clearfix ">
<div className="fl fl mr40 mb20">
<a href={"/users/" + coursedata.teacher_login} className="fl">
<img alt="头像" className="radius fl mt3 bannerimgname"
src={getImageUrl(`images/` + coursedata.teacher_img)}/>
</a>
<div className="fl mt13">
<p className="color-white">
<a href={"/users/" + coursedata.teacher_login}
className="color-white bannnerusername">{coursedata.teacher_name}</a>
</p>
</div>
<div className="fl mt13">
<p className="color-white bannnerusernames">{coursedata.teacher_school}</p>
</div>
</div> </div>
<div className="clearfix ">
<div className="fl fl mr40 mb20">
<a href={"/users/" + coursedata.teacher_login} className="fl">
<img alt="头像" className="radius fl mt3 bannerimgname"
src={getImageUrl(`images/` + coursedata.teacher_img)}/>
</a>
<div className="fl mt13">
<p className="color-white">
<a href={"/users/" + coursedata.teacher_login}
className="color-white bannnerusername">{coursedata.teacher_name}</a>
</p>
</div>
<div className="fl mt13">
<p className="color-white bannnerusernames">{coursedata.teacher_school}</p>
</div>
</div>
<div>
{coursedata.switch_to_student === true ?
<Tooltip placement="bottom" title={"切换至学生可进行提交作品、答题等操作"}>
<a className="fr user_default_btn user_blue_btn mr20 font-18"
onClick={()=>this.switchidentity(1)}
> 切换为学生 </a>
</Tooltip>
:""}
{coursedata.switch_to_teacher === true ?
<Tooltip placement="bottom" title={"由学生身份切换至教师"}>
<a className="fr user_default_btn user_blue_btn mr20 font-18"
onClick={()=>this.switchidentity(2)}
> 切换为老师 </a>
</Tooltip>:""}
{coursedata.switch_to_assistant === true ?
<Tooltip placement="bottom" title={"由学生身份切换至助教"}>
<a className="fr user_default_btn user_blue_btn mr20 font-18"
onClick={()=>this.switchidentity(3)}
> 切换为助教 </a>
</Tooltip>:""}
{coursedata.course_identity === 6&&coursedata.educoder_teacher===false?
<a className="fr user_default_btn task-btn-orange font-18 mr20" id="shixun_operation"
onClick={() => this.tojoinclass(1)}>加入课堂</a>: ""}
{coursedata.course_identity === 6&&coursedata.educoder_teacher===true?
<a className="fr user_default_btn task-btn-orange font-18 mr20" id="shixun_operation"
onClick={() => this.tojoinclass(1)}>加入课堂</a>: ""}
{coursedata.course_identity === 6&&coursedata.educoder_teacher===true?
<a className="fr user_default_btn user_blue_btn mr20 font-18" onClick={() => this.ActionPoll(5)}> 复制课堂 </a>: ""}
{this.props.isStudent()?<a className="fr user_default_btn user_blue_btn mr20 font-18"
onClick={() => this.exitclass()}
> 退出课堂 </a>:""}
</div>
<div className="clearfix clearfixborder">
<ul className="fl color-grey-eb pathInfo pathInfobox mt10">
<li className={"mt7"}>
<Link to={"/courses/"+this.props.match.params.coursesId+"/teachers"}>
<span className="color-grey-c fl font-16">教师</span>
<span
className="color-white fl font-16 bannerurli">{coursedata.teacher_count}</span>
</Link>
</li>
<li className={"mt7"}>
<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>
</Link>
</li>
{/*<li className={"mt7"}>*/}
{/*<a>*/}
{/*<span className="color-grey-c fl font-16">分班</span>*/}
{/*<span className="color-white fl font-16 bannerurli">{coursedata.course_group_count}</span>*/}
{/*</a>*/}
{/*</li>*/}
{coursedata.credit===null?"":<li className={"mt7"}>
<a>
<span className="color-grey-c fl font-16 mr10">学分</span>
<span className="color-white fl font-16 "
>{coursedata.credit}</span>
</a>
</li>}
{/*{coursedata.course_end===true? <li className={"mt7"}>*/}
{/*<span className="color-grey-c fl font-16">已结束</span>*/}
{/*</li>:<li className={"mt7"}>*/}
{/*<span className="color-grey-c fl font-16"> 结束</span>*/}
{/*<span className="color-white fl font-16"*/}
{/*style={{*/}
{/*marginLeft:coursedata.deadline===null?"":'8px'*/}
{/*}}*/}
{/*>{coursedata.deadline===null?"--":coursedata.deadline}</span>*/}
{/*</li>}*/}
</ul>
<div>
{coursedata.switch_to_student === true ?
<Tooltip placement="bottom" title={"切换至学生可进行提交作品、答题等操作"}>
<a className="fr user_default_btn user_blue_btn mr20 font-18"
onClick={()=>this.switchidentity(1)}
> 切换为学生 </a>
</Tooltip>
:""}
{coursedata.switch_to_teacher === true ?
<Tooltip placement="bottom" title={"由学生身份切换至教师"}>
<a className="fr user_default_btn user_blue_btn mr20 font-18"
onClick={()=>this.switchidentity(2)}
> 切换为老师 </a>
</Tooltip>:""}
{coursedata.switch_to_assistant === true ?
<Tooltip placement="bottom" title={"由学生身份切换至助教"}>
<a className="fr user_default_btn user_blue_btn mr20 font-18"
onClick={()=>this.switchidentity(3)}
> 切换为助教 </a>
</Tooltip>:""}
{this.props.isAdmin()? <ul className="fr color-grey-eb pathInfo pathInfobox mt10"
style={{ {coursedata.course_identity === 6&&coursedata.educoder_teacher===false?
position: "relative" <a className="fr user_default_btn task-btn-orange font-18 mr20" id="shixun_operation"
}} onClick={() => this.tojoinclass(1)}>加入课堂</a>: ""}
>
<li className={"mt7 mr10im"}> {coursedata.course_identity === 6&&coursedata.educoder_teacher===true?
<a onClick={()=>this.addTeacher(true)}> <a className="fr user_default_btn task-btn-orange font-18 mr20" id="shixun_operation"
<span className="color-white fl font-16 bannerurli width100f">添加老师</span> onClick={() => this.tojoinclass(1)}>加入课堂</a>: ""}
</a>
</li> {coursedata.course_identity === 6&&coursedata.educoder_teacher===true?
<a className="fr user_default_btn user_blue_btn mr20 font-18" onClick={() => this.ActionPoll(5)}> 复制课堂 </a>: ""}
<li className={"mt7 mr10im"}>
<a onClick={()=>this.addTeacher(false)}> {this.props.isStudent()?<a className="fr user_default_btn user_blue_btn mr20 font-18"
<span className="color-white fl font-16 bannerurli width100f">添加助教</span> onClick={() => this.exitclass()}
</a> > 退出课堂 </a>:""}
</li> </div>
<li className={"mt7 mr10im"}>
<a onClick={()=>this.addStudent()}> <div className="clearfix clearfixborder">
<span className="color-white fl font-16 bannerurli width100f">添加学生</span> <ul className="fl color-grey-eb pathInfo pathInfobox mt10">
</a> <li className={"mt7"}>
</li> <Link to={"/courses/"+this.props.match.params.coursesId+"/teachers"}>
<span className="color-grey-c fl font-16">教师</span>
<li className={"mt7 mr10im ml10"} style={{overflow:"hidden"}}> <span
<a> className="color-white fl font-16 bannerurli">{coursedata.teacher_count}</span>
<span className="color-grey-c fl font-16">邀请码</span> </Link>
<span </li>
className={coursedata.code_halt === true? "color-white fl font-16 bannerurli width75f" : "color-white fl font-16 bannerurli width107f marleftf10 color-orange-tip"}>
<li className={"mt7"}>
<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>
</Link>
</li>
{/*<li className={"mt7"}>*/}
{/*<a>*/}
{/*<span className="color-grey-c fl font-16">分班</span>*/}
{/*<span className="color-white fl font-16 bannerurli">{coursedata.course_group_count}</span>*/}
{/*</a>*/}
{/*</li>*/}
{coursedata.credit===null?"":<li className={"mt7"}>
<a>
<span className="color-grey-c fl font-16 mr10">学分</span>
<span className="color-white fl font-16 "
>{coursedata.credit}</span>
</a>
</li>}
{/*{coursedata.course_end===true? <li className={"mt7"}>*/}
{/*<span className="color-grey-c fl font-16">已结束</span>*/}
{/*</li>:<li className={"mt7"}>*/}
{/*<span className="color-grey-c fl font-16"> 结束</span>*/}
{/*<span className="color-white fl font-16"*/}
{/*style={{*/}
{/*marginLeft:coursedata.deadline===null?"":'8px'*/}
{/*}}*/}
{/*>{coursedata.deadline===null?"--":coursedata.deadline}</span>*/}
{/*</li>}*/}
</ul>
{this.props.isAdmin()? <ul className="fr color-grey-eb pathInfo pathInfobox mt10"
style={{
position: "relative"
}}
>
<li className={"mt7 mr10im"}>
<a onClick={()=>this.addTeacher(true)}>
<span className="color-white fl font-16 bannerurli width100f">添加老师</span>
</a>
</li>
<li className={"mt7 mr10im"}>
<a onClick={()=>this.addTeacher(false)}>
<span className="color-white fl font-16 bannerurli width100f">添加助教</span>
</a>
</li>
<li className={"mt7 mr10im"}>
<a onClick={()=>this.addStudent()}>
<span className="color-white fl font-16 bannerurli width100f">添加学生</span>
</a>
</li>
<li className={"mt7 mr10im ml10"} style={{overflow:"hidden"}}>
<a>
<span className="color-grey-c fl font-16">邀请码</span>
<span
className={coursedata.code_halt === true? "color-white fl font-16 bannerurli width75f" : "color-white fl font-16 bannerurli width107f marleftf10 color-orange-tip"}>
{coursedata.code_halt === true? "已停用" : coursedata.invite_code} {coursedata.code_halt === true? "已停用" : coursedata.invite_code}
{coursedata.code_halt === true ? "" : {coursedata.code_halt === true ? "" :
<Tooltip placement="bottom" title={ <Tooltip placement="bottom" title={
<pre> <pre>
成员可以通过邀请码主动加入课堂<br/> 成员可以通过邀请码主动加入课堂<br/>
点击立刻复制邀请码 点击立刻复制邀请码
</pre> </pre>
}> }>
<i className="iconfont icon-fuzhi color-white font-14 ml10" <i className="iconfont icon-fuzhi color-white font-14 ml10"
onClick={() => { onClick={() => {
jsCopy() jsCopy()
}}></i> }}></i>
</Tooltip> </Tooltip>
} }
<input id="copy_invite_code" value={coursedata.invite_code}/> <input id="copy_invite_code" value={coursedata.invite_code}/>
</span> </span>
</a> </a>
</li> </li>
<li className={"mt7 ml10 mr0 "}> <li className={"mt7 ml10 mr0 "}>
<style> <style>
{ {
` `
.defaults{cursor:default} .defaults{cursor:default}
` `
} }
</style> </style>
<Popover placement="bottom" content={ <Popover placement="bottom" content={
<ul className="sandianbox" style={{ <ul className="sandianbox" style={{
display: 'block', display: 'block',
right: "-113px", right: "-113px",
top: "20px" top: "20px"
}}> }}>
{coursedata.is_public === true?coursedata.course_identity <3? {coursedata.is_public === true?coursedata.course_identity <3?
<div className={"defaults"} onClick={() => this.ActionPoll(2)}>设为私有</div>: "" : ""} <div className={"defaults"} onClick={() => this.ActionPoll(2)}>设为私有</div>: "" : ""}
{coursedata.is_public === false?coursedata.course_identity <3? {coursedata.is_public === false?coursedata.course_identity <3?
<div className={"defaults"} onClick={() => this.ActionPoll(3)}>设为公开</div> : "": ""} <div className={"defaults"} onClick={() => this.ActionPoll(3)}>设为公开</div> : "": ""}
{coursedata.course_identity <3? <div className={"defaults"} onClick={() => this.ActionPoll(4)}> {coursedata.course_identity <3? <div className={"defaults"} onClick={() => this.ActionPoll(4)}>
{coursedata.code_halt === true ?"启用邀请码":"停用邀请码"} {coursedata.code_halt === true ?"启用邀请码":"停用邀请码"}
</div>:""} </div>:""}
<div className={"defaults"} onClick={this.postsettings}>设置</div> <div className={"defaults"} onClick={this.postsettings}>设置</div>
<div className={"defaults"} onClick={() => this.ActionPoll(5)}>复制 <div className={"defaults"} onClick={() => this.ActionPoll(5)}>复制
</div> </div>
{coursedata.is_admin===true?coursedata.course_identity <3?<div className={"defaults"} onClick={() => this.ActionPoll(1)}>删除</div> {coursedata.is_admin===true?coursedata.course_identity <3?<div className={"defaults"} onClick={() => this.ActionPoll(1)}>删除</div>
:"":""} :"":""}
</ul> </ul>
} trigger="hover"> } trigger="hover">
<i className="iconfont icon-weibiaoti12 color-white font-14 relative"></i> <i className="iconfont icon-weibiaoti12 color-white font-14 relative"></i>
</Popover> </Popover>
</li> </li>
</ul>:""} </ul>:""}
</div> </div>
</div> </div>
</div> </div>
</div> </div>
}
</div>
) )
} }
} }

@ -2030,7 +2030,7 @@ class Studentshavecompletedthelist extends Component {
//===0 不包括主观题 //===0 不包括主观题
if (indexi === exercise_users.length) { if (indexi === exercise_users.length) {
//都没评论 不显示评论 //都没评论 不显示评论
if (response.data.course_groups.length > 0) { if (response.data.poll_types.groups_count > 0) {
// console.log("77771111111"); // console.log("77771111111");
//分班大于0显示分班 //分班大于0显示分班
//7ge //7ge
@ -2272,7 +2272,8 @@ class Studentshavecompletedthelist extends Component {
} else { } else {
//已经评论 //已经评论
if (response.data.course_groups.length > 0) { // response.data.course_groups.length
if (response.data.poll_types.groups_count > 0) {
//显示分班 //显示分班
//8ge //8ge
this.setState({ this.setState({
@ -2545,7 +2546,7 @@ class Studentshavecompletedthelist extends Component {
//包括主观题 //包括主观题
if (indexi === exercise_users.length) { if (indexi === exercise_users.length) {
console.log("2548包含主观题不包含分班"); console.log("2548包含主观题不包含分班");
if (response.data.course_groups.length > 0){ if (response.data.poll_types.groups_count> 0){
this.setState({ this.setState({
data: datalist, data: datalist,
teacherlist: teacherlist, teacherlist: teacherlist,
@ -2836,7 +2837,7 @@ class Studentshavecompletedthelist extends Component {
} }
} else { } else {
console.log("2699包含主观题包含分班"); console.log("2699包含主观题包含分班");
if (response.data.course_groups.length > 0) { if (response.data.poll_types.groups_count> 0) {
this.setState({ this.setState({
data: datalist, data: datalist,
teacherlist: teacherlist, teacherlist: teacherlist,

@ -85,7 +85,7 @@ class GraduationTasksSubmitnew extends Component{
handleSubmit=(e) => { handleSubmit=(e) => {
let {fileList,selectmemberslist,workslist}=this.state; let {fileList,selectmemberslist,workslist}=this.state;
if(fileList.length === 0){ if(fileList.length === 0){
this.setState({ this.setState({
Modalstype:true, Modalstype:true,

@ -5,6 +5,7 @@ import CourseLayoutcomponent from '../common/CourseLayoutComponent'
import Titlesearchsection from '../common/titleSearch/TitleSearchSection' import Titlesearchsection from '../common/titleSearch/TitleSearchSection'
import ColorCountText from '../common/titleSearch/ColorCountText' import ColorCountText from '../common/titleSearch/ColorCountText'
import update from 'immutability-helper'
import { WordsBtn, ConditionToolTip, on, off } from 'educoder' import { WordsBtn, ConditionToolTip, on, off } from 'educoder'
import axios from 'axios' import axios from 'axios'
@ -28,6 +29,7 @@ const pageSize = 20;
function buildColumns(that) { function buildColumns(that) {
const isAdmin = that.props.isAdmin() const isAdmin = that.props.isAdmin()
const isAdminOrCreator = that.props.isAdminOrCreator(); const isAdminOrCreator = that.props.isAdminOrCreator();
const isAdminOrTeacher = that.props.isAdminOrTeacher()
const { course_groups } = that.state const { course_groups } = that.state
const columns = [{ const columns = [{
title: '', title: '',
@ -55,7 +57,8 @@ function buildColumns(that) {
title: '角色', title: '角色',
dataIndex: 'role', dataIndex: 'role',
key: 'role', key: 'role',
}, { }]
that.course_groups && that.course_groups.length && columns.push({
title: <Tooltip title="仅能批阅指定分班的作品">管理权限</Tooltip>, title: <Tooltip title="仅能批阅指定分班的作品">管理权限</Tooltip>,
width: 230, width: 230,
key: 'course_groups', key: 'course_groups',
@ -70,7 +73,7 @@ function buildColumns(that) {
const noGroups = (!course_groups || course_groups.length == 0); const noGroups = (!course_groups || course_groups.length == 0);
return ( return (
<ConditionToolTip title={`暂未有分班信息,不能操作`} condition={noGroups}> <ConditionToolTip title={`暂未有分班信息,不能操作`} condition={noGroups}>
<span className="drop_down" style={{color: '#29BD8B'}}> <span className="drop_down" style={{color: '#29BD8B', display: 'inline-block'}}>
{ arg_course_groups.length == 0 ? '不限' : arg_course_groups.map(item => item.name).join(', ') } { arg_course_groups.length == 0 ? '不限' : arg_course_groups.map(item => item.name).join(', ') }
{ isAdmin && { isAdmin &&
<React.Fragment> <React.Fragment>
@ -83,7 +86,7 @@ function buildColumns(that) {
</p>): </p>):
'' ''
} }
<Checkbox.Group onChange={(checkedValues) => that.joinCourseGroup(checkedValues, item)} <Checkbox.Group onChange={(checkedValues) => that.joinCourseGroup(checkedValues, item, index)}
value={arg_course_groups.map(item => item.id)} value={arg_course_groups.map(item => item.id)}
disabled={!isAdminOrCreator} disabled={!isAdminOrCreator}
> >
@ -108,7 +111,7 @@ function buildColumns(that) {
</ConditionToolTip>) </ConditionToolTip>)
} }
, ,
}]; });
if (that.hasGraduationModule()) { if (that.hasGraduationModule()) {
columns.push({ columns.push({
title: '答辩组', title: '答辩组',
@ -121,7 +124,7 @@ function buildColumns(that) {
), ),
}) })
} }
if (isAdminOrCreator) { if (isAdminOrTeacher) {
columns.push({ columns.push({
title: '操作', title: '操作',
key: 'action', key: 'action',
@ -136,11 +139,12 @@ function buildColumns(that) {
} else { } else {
return ( return (
<span> <span>
<WordsBtn onClick={() => that.onDelete(record)} style={'grey'}>删除</WordsBtn> {record.role != ROLE_ADMIN && <WordsBtn onClick={() => that.onDelete(record)} style={'grey'}>删除</WordsBtn>}
<Divider type="vertical" /> {(record.role == ROLE_TEACHER || record.role == ROLE_TEACHER_ASSISTANT || isAdminOrCreator) && record.role != ROLE_ADMIN
&& <Divider type="vertical" />}
{ record.role == ROLE_TEACHER ? <a style={{color: '#4CACFF'}} onClick={() => that.changeToAssistant(record)}>变更为助教</a> : '' } { record.role == ROLE_TEACHER ? <a style={{color: '#4CACFF'}} onClick={() => that.changeToAssistant(record)}>变更为助教</a> : '' }
{ record.role == ROLE_TEACHER_ASSISTANT ? <a style={{color: '#4CACFF'}} onClick={() => that.changeToTeacher(record)}>变更为教师</a> : '' } { record.role == ROLE_TEACHER_ASSISTANT ? <a style={{color: '#4CACFF'}} onClick={() => that.changeToTeacher(record)}>变更为教师</a> : '' }
{ record.role == ROLE_ADMIN ? <a style={{color: '#4CACFF'}} onClick={() => that.showChangeAdminModal(record)}>更换管理员</a> : '' } { record.role == ROLE_ADMIN && isAdminOrCreator ? <a style={{color: '#4CACFF', marginLeft: '44px'}} onClick={() => that.showChangeAdminModal(record)}>更换管理员</a> : '' }
</span> ) </span> )
} }
@ -237,8 +241,13 @@ class studentsList extends Component{
}) })
.then((response) => { .then((response) => {
if (response.data.course_groups && response.data.course_groups.length) { if (response.data.course_groups && response.data.course_groups.length) {
let course_groups_map = {}
response.data.course_groups.forEach(item => {
course_groups_map[item.id] = item.name
})
this.setState({ this.setState({
course_groups: response.data.course_groups, course_groups: response.data.course_groups,
course_groups_map
}) })
} else { } else {
} }
@ -247,7 +256,7 @@ class studentsList extends Component{
console.log(error); console.log(error);
}); });
} }
joinCourseGroup = (ids, item) => { joinCourseGroup = (ids, item, index) => {
console.log('join ', ids, item) console.log('join ', ids, item)
const courseId = this.props.match.params.coursesId const courseId = this.props.match.params.coursesId
@ -262,7 +271,12 @@ class studentsList extends Component{
.then((response) => { .then((response) => {
if (response.data.status == 0) { if (response.data.status == 0) {
this.props.showNotification('修改成功') this.props.showNotification('修改成功')
this.fetchAll() const newArray = ids.map((item) => {return {id: item, name: this.state.course_groups_map[item]}});
this.setState(
(prevState) => ({
teachers : update(prevState.teachers, {[ this.state.page == 1 ? index - this.state.application_list.length : index]: { course_groups: {$set: newArray }}})
}))
// this.fetchAll()
} else { } else {
} }
}) })
@ -560,7 +574,7 @@ class studentsList extends Component{
<ul className="drop_down_normal"> <ul className="drop_down_normal">
<li onClick={() => this.onSortTypeChange(ORDER_BY_NAME)} >姓名排序</li> <li onClick={() => this.onSortTypeChange(ORDER_BY_NAME)} >姓名排序</li>
<li onClick={() => this.onSortTypeChange(ORDER_BY_DATE)} style={{width: '125px'}}>加入时间排序</li> <li onClick={() => this.onSortTypeChange(ORDER_BY_DATE)} style={{width: '125px'}}>加入时间排序</li>
<li onClick={() => this.onSortTypeChange(ORDER_BY_GRADUATION_GROUP)} >答辩组排序</li> {this.hasGraduationModule() && <li onClick={() => this.onSortTypeChange(ORDER_BY_GRADUATION_GROUP)} >答辩组排序</li>}
</ul> </ul>
</li> </li>
</div> } </div> }

@ -71,7 +71,6 @@ class Trialapplication extends Component {
this.setState({ this.setState({
isRenders: true isRenders: true
}) })
this.props.setTrialapplication();
} }
return response; return response;
}, (error) => { }, (error) => {

@ -213,12 +213,12 @@ export function TPMIndexHOC(WrappedComponent) {
return this.state.coursedata&&this.state.coursedata.course_identity === 6 return this.state.coursedata&&this.state.coursedata.course_identity === 6
} }
setTrialapplication = ()=>{ // setTrialapplication = ()=>{
this.setState({ // this.setState({
isRenders:true // isRenders:true
}) // })
//
} // }
/** /**
@ -288,13 +288,13 @@ export function TPMIndexHOC(WrappedComponent) {
} }
return ( return (
<div> <div>
{ {/*{*/}
user_phone_binded === undefined? {/* user_phone_binded === undefined?*/}
"" {/* ""*/}
: {/* :*/}
<Trialapplication {...this.state} user_phone_binded={user_phone_binded} setTrialapplication = {this.setTrialapplication} ></Trialapplication> {/* <Trialapplication {...this.state} user_phone_binded={user_phone_binded} setTrialapplication = {this.setTrialapplication} ></Trialapplication>*/}
} {/*}*/}
<SiderBar <SiderBar
Headertop={Headertop} Headertop={Headertop}

@ -279,7 +279,8 @@ class LoginRegisterComponent extends Component {
} }
}).then((result) => { }).then((result) => {
//验证有问题{"status":1,"message":"success"} //验证有问题{"status":1,"message":"success"}
console.log(result); // console.log(result);
this.openNotification("验证码已发送,请注意查收!",2);
}).catch((error) => { }).catch((error) => {
@ -370,7 +371,7 @@ class LoginRegisterComponent extends Component {
{ {
Phonenumberisnotco && Phonenumberisnotco != "" ? Phonenumberisnotco && Phonenumberisnotco != "" ?
<p className="color-red mt5 mb5" style={{width: " 100%", height: "20px"}}> <p className="color-red mt5 mb5" style={{width: " 100%", height: "20px"}}>
<span>{Phonenumberisnotco}</span> <span className="fl" style={{textAlign:"center",width: " 100%"}}>{Phonenumberisnotco}</span>
</p> </p>
: <div style={{height: "25px"}}></div> : <div style={{height: "25px"}}></div>
} }

@ -361,11 +361,11 @@ class LoginRegisterComponent extends Component {
} }
}).then((result) => { }).then((result) => {
//验证有问题{"status":1,"message":"success"} //验证有问题{"status":1,"message":"success"}
console.log(result); // console.log(result);
}).catch((error) => { }).catch((error) => {
console.log(error); // console.log(error);
// this.setState({ // this.setState({
// login:"", // login:"",
// logins:"", // logins:"",
@ -374,7 +374,6 @@ class LoginRegisterComponent extends Component {
} }
//短信验证 //短信验证
SMSverification = () => { SMSverification = () => {
var url = `/accounts/get_verification_code.json`; var url = `/accounts/get_verification_code.json`;
axios.get((url), { axios.get((url), {
params: { params: {
@ -383,7 +382,8 @@ class LoginRegisterComponent extends Component {
} }
}).then((result) => { }).then((result) => {
//验证有问题{"status":1,"message":"success"} //验证有问题{"status":1,"message":"success"}
console.log(result); // console.log(result);
this.openNotification("验证码已发送,请注意查收!",2);
}).catch((error) => { }).catch((error) => {
@ -412,7 +412,6 @@ class LoginRegisterComponent extends Component {
//倒计时 //倒计时
getverificationcode = () => { getverificationcode = () => {
debugger
if (this.state.Phonenumberisnotcobool === false ||this.state.Phonenumberisnotcobool === undefined) { if (this.state.Phonenumberisnotcobool === false ||this.state.Phonenumberisnotcobool === undefined) {
if (this.state.logins&&this.state.logins.length === 0) { if (this.state.logins&&this.state.logins.length === 0) {
this.openNotification("请输入手机号或邮箱",2); this.openNotification("请输入手机号或邮箱",2);
@ -509,13 +508,17 @@ class LoginRegisterComponent extends Component {
this.setState({ this.setState({
tab:e.key tab:e.key
}) })
// console.log(e.key); console.log(e.key);
// if(e.key === 0){ if(e.key === 0){
// this.props.Setlogins(1); this.setState({
// }else{ Phonenumberisnotcos:undefined
// this.props.Setlogins(2); })
// }else{
// } this.setState({
Phonenumberisnotco:undefined
})
}
// this.props.history.push(`/courses/${this.props.match.params.coursesId}/exercises/${this.props.match.params.Id}/student_exercise_list?tab=`+e.key) // this.props.history.push(`/courses/${this.props.match.params.coursesId}/exercises/${this.props.match.params.Id}/student_exercise_list?tab=`+e.key)
@ -590,12 +593,13 @@ class LoginRegisterComponent extends Component {
onChange={this.loginInputonChange} onChange={this.loginInputonChange}
name="username" name="username"
className="font-14 color-grey-9" className="font-14 color-grey-9"
onBlur={(e) => this.inputOnBlur(e, 1)}
style={{marginTop: '30px', height: '38px'}}></Input> style={{marginTop: '30px', height: '38px'}}></Input>
{ {
Phonenumberisnotco && Phonenumberisnotco != "" ? Phonenumberisnotco && Phonenumberisnotco != "" ?
<p className="color-red mt5 mb5" style={{width: " 100%", height: "20px"}}> <p className="color-red mt5 mb5" style={{width: " 100%", height: "20px"}}>
<span>{Phonenumberisnotco}</span> <span className="fl" style={{textAlign:"center",width: " 100%"}}>{Phonenumberisnotco}</span>
</p> </p>
: <div style={{height:"25px"}}></div> : <div style={{height:"25px"}}></div>
} }
@ -629,9 +633,7 @@ class LoginRegisterComponent extends Component {
{ {
Phonenumberisnotcos && Phonenumberisnotcos != "" ? Phonenumberisnotcos && Phonenumberisnotcos != "" ?
<p className="color-red mt5 mb5 " style={{width: " 100%", height: "20px"}}> <p className="color-red mt5 mb5 " style={{width: " 100%", height: "20px"}}>
{/*<span className="fl">{Phonenumberisnotcos}</span>*/} <span className="fl" style={{textAlign:"center",width: " 100%"}}>{Phonenumberisnotcos}</span>
<span className="fl" style={{textAlign:"center",width: " 100%"}}>请输入手机号码</span>
</p> </p>
: <div style={{height:"25px"}}></div> : <div style={{height:"25px"}}></div>

Loading…
Cancel
Save