Merge remote-tracking branch 'origin/master'

# Conflicts:
#	public/react/src/modules/courses/coursesDetail/CoursesBanner.js
#	public/react/src/modules/user/LoginRegisterComponent.js
dev_forum
杨树明 6 years ago
commit a3466058c7

@ -3,6 +3,8 @@
"version": "0.1.0", "version": "0.1.0",
"private": true, "private": true,
"dependencies": { "dependencies": {
"@novnc/novnc": "^1.1.0",
"@flatten/array": "^1.1.7", "@flatten/array": "^1.1.7",
"@icedesign/base": "^0.2.5", "@icedesign/base": "^0.2.5",
"antd": "^3.6.5", "antd": "^3.6.5",

@ -417,7 +417,7 @@ pop_box_new(htmlvalue, 480, 182);
*/ */
let user = resData.user; let user = resData.user;
user.username = resData.user.name; user.username = resData.user.name;
// user.user_url = resData.user_url; user.user_url = `/user/${resData.user.login}`;
// user.image_url = resData.image_url; // user.image_url = resData.image_url;
user.is_teacher = resData.is_teacher; user.is_teacher = resData.is_teacher;
resData.user = user; resData.user = user;

@ -442,16 +442,21 @@ class CoursesIndex extends Component{
<Switch {...this.props}> <Switch {...this.props}>
{/* 资源列表页 */} {/* 资源列表页 */}
<Route path="/courses/:coursesId/file/:Id" <Route path="/courses/:coursesId/file/:Id" exact
render={ render={
(props) => (<Resourcelist {...this.props} {...props} {...this.state} />) (props) => (<ListPageIndex {...this.props} {...props} {...this.state} />)
} }
></Route> ></Route>
<Route path="/courses/:coursesId/files/:main_id" <Route path="/courses/:coursesId/files/:main_id"
render={ render={
(props) => (<Resourcelist {...this.props} {...props} {...this.state} />) (props) => (<ListPageIndex {...this.props} {...props} {...this.state} />)
} }
></Route> ></Route>
<Route exact path="/courses/:coursesId/boards/:boardId"
render={
(props) => (<ListPageIndex {...this.props} {...props} {...this.state} />)
}
></Route>
{/*课堂讨论*/} {/*课堂讨论*/}
<Route path="/courses/:coursesId/boards/:boardId" <Route path="/courses/:coursesId/boards/:boardId"
render={ render={
@ -486,9 +491,9 @@ class CoursesIndex extends Component{
></Route> ></Route>
{/* 毕设选题列表 */} {/* 毕设选题列表 */}
<Route path="/courses/:coursesId/graduation_topics/:Id" <Route path="/courses/:coursesId/graduation_topics/:Id" exact
render={ render={
(props) => (<GraduationTopics {...this.props} {...props} {...this.state} />) (props) => (<ListPageIndex {...this.props} {...props} {...this.state} />)
}></Route> }></Route>
@ -554,9 +559,9 @@ class CoursesIndex extends Component{
{/* 毕设任务列表 https://www.trustie.net/issues/19981 */} {/* 毕设任务列表 https://www.trustie.net/issues/19981 */}
<Route path="/courses/:coursesId/graduation_tasks/:Id" <Route path="/courses/:coursesId/graduation_tasks/:Id" exact
render={ render={
(props) => (<GraduationTasks {...this.props} {...props} {...this.state} />) (props) => (<ListPageIndex {...this.props} {...props} {...this.state} />)
} }
></Route> ></Route>
@ -591,16 +596,29 @@ class CoursesIndex extends Component{
(props) => (<ListPageIndex {...this.props} {...props} {...this.state} />) (props) => (<ListPageIndex {...this.props} {...props} {...this.state} />)
} }
></Route> ></Route>
{/* 普通作业 */}
<Route path="/courses/:coursesId/common_homeworks/:category_id" exact
render={
(props) => (<ListPageIndex {...this.props} {...props} {...this.state} />)
}
></Route>
{/* 分组作业 */}
<Route path="/courses/:coursesId/group_homeworks/:category_id" exact
render={
(props) => (<ListPageIndex {...this.props} {...props} {...this.state} />)
}
></Route>
{/* 普通作业 */} {/* 普通作业 */}
<Route path="/courses/:coursesId/common_homeworks" <Route path="/courses/:coursesId/common_homeworks/" strict
render={ render={
(props) => (<CommonWork {...this.props} {...props} {...this.state} />) (props) => (<CommonWork {...this.props} {...props} {...this.state} />)
} }
></Route> ></Route>
{/* 分组作业 */} {/* 分组作业 */}
<Route path="/courses/:coursesId/group_homeworks" <Route path="/courses/:coursesId/group_homeworks/" strict
render={ render={
(props) => (<GroupWork {...this.props} {...props} {...this.state} />) (props) => (<GroupWork {...this.props} {...props} {...this.state} />)
} }

@ -56,6 +56,14 @@ const ShixunHomework= Loadable({
loading: Loading, loading: Loading,
}) })
const GraduationTopics= Loadable({
loader: () => import('./graduation/topics'),
loading: Loading,
})
const GraduationTasks= Loadable({
loader: () => import('./graduation/tasks'),
loading: Loading,
})
class ListPageIndex extends Component{ class ListPageIndex extends Component{
constructor(props) { constructor(props) {
super(props) super(props)
@ -169,12 +177,34 @@ class ListPageIndex extends Component{
} }
></Route> ></Route>
<Route path="/courses/:coursesId/files/:main_id"
render={
(props) => (<Resourcelist {...this.props} {...props} {...this.state} />)
}
></Route>
<Route path="/courses/:coursesId/file/:Id"
render={
(props) => (<Resourcelist {...this.props} {...props} {...this.state} />)
}
></Route>
<Route path="/courses/:coursesId/graduation_topics/:Id"
render={
(props) => (<GraduationTopics {...this.props} {...props} {...this.state} />)
}></Route>
<Route path="/courses/:coursesId/graduation_tasks/:Id"
render={
(props) => (<GraduationTasks {...this.props} {...props} {...this.state} />)
}
></Route>
{/* 默认 */}
<Route path="/courses/:coursesId" <Route path="/courses/:coursesId"
render={ render={
(props) => (<StudentsList {...this.props} {...props} {...this.state} />) (props) => (<StudentsList {...this.props} {...props} {...this.state} />)
} }
></Route> ></Route>
</Switch> </Switch>
</div> </div>
</div> </div>

@ -573,7 +573,7 @@ class Fileslists extends Component{
return( return(
<div> <React.Fragment >
{/*发送*/} {/*发送*/}
@ -647,7 +647,6 @@ class Fileslists extends Component{
has_course_groups={this.state.has_course_groups} has_course_groups={this.state.has_course_groups}
/>:""} />:""}
<CourseLayoutcomponent {...this.props}>
<Titlesearchsection <Titlesearchsection
title={name} title={name}
searchValue={ searchValue } searchValue={ searchValue }
@ -840,8 +839,7 @@ class Fileslists extends Component{
</div> </div>
</CourseLayoutcomponent> </React.Fragment>
</div>
) )
} }
} }

@ -14,7 +14,7 @@ import { WordsBtn } from 'educoder'
import Modals from '../../modals/Modals' import Modals from '../../modals/Modals'
import NoneData from "../coursesPublic/NoneData" import NoneData from "../coursesPublic/NoneData"
import Titlesearchsection from '../common/titleSearch/TitleSearchSection'; import Titlesearchsection from '../common/titleSearch/TitleSearchSection';
import { RouteHOC } from './common'
import axios from 'axios'; import axios from 'axios';
import _ from 'lodash' import _ from 'lodash'
@ -71,6 +71,13 @@ class commonWork extends Component{
sureDelClasses(){ sureDelClasses(){
} }
componentDidUpdate(prevProps, prevState) {
debugger;
if (prevProps.match.path != this.props.match.path) {
this.componentDidMount()
}
}
componentDidMount(){ componentDidMount(){
this.setState({ this.setState({
@ -429,4 +436,4 @@ class commonWork extends Component{
) )
} }
} }
export default commonWork; export default RouteHOC() (commonWork);

@ -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,34 +43,46 @@ 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,
} }
} }
componentDidMount() { componentDidMount() {
this.onloadupdatabanner()
}
onloadupdatabanner=()=>{ this.onloadupdatabanner()
this.updatabanner() this.setState({
} user_phone_binded :this.props.user_phone_binded,
})
updatabanner=()=>{ }
let courseId = this.props.match.params.coursesId; onloadupdatabanner=()=>{
let url = "/courses/" + courseId + "/top_banner.json" this.updatabanner()
axios.get(url).then((result) => { }
if( result!=undefined){ updatabanner=()=>{
let data = result.data; let courseId = this.props.match.params.coursesId;
this.setState({ let url = "/courses/" + courseId + "/top_banner.json"
coursedata: data axios.get(url).then((result) => {
}) if( result!=undefined){
}else{ let data = result.data;
this.onloadupdatabanner() if(result.data.status === 407){
} this.setState({
}) isRenders:true,
} coursedata: data,
showTrial:false,
})
}else{
this.setState({
coursedata: data,
showTrial:true,
})
}
}else{
this.onloadupdatabanner()
}
})
}
showeditmenu = () => { showeditmenu = () => {
this.setState({ this.setState({
show: true, show: true,
@ -323,265 +335,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>:""}
{this.props.isAdmin()? <ul className="fr color-grey-eb pathInfo pathInfobox mt10"
style={{ {coursedata.switch_to_assistant === true ?
position: "relative" <Tooltip placement="bottom" title={"由学生身份切换至助教"}>
}} <a className="fr user_default_btn user_blue_btn mr20 font-18"
> onClick={()=>this.switchidentity(3)}
<li className={"mt7 mr10im"}> > 切换为助教 </a>
<a onClick={()=>this.addTeacher(true)}> </Tooltip>:""}
<span className="color-white fl font-16 bannerurli width100f">添加老师</span>
</a>
</li> {coursedata.course_identity === 6&&coursedata.educoder_teacher===false?
<a className="fr user_default_btn task-btn-orange font-18 mr20" id="shixun_operation"
<li className={"mt7 mr10im"}> onClick={() => this.tojoinclass(1)}>加入课堂</a>: ""}
<a onClick={()=>this.addTeacher(false)}>
<span className="color-white fl font-16 bannerurli width100f">添加助教</span> {coursedata.course_identity === 6&&coursedata.educoder_teacher===true?
</a> <a className="fr user_default_btn task-btn-orange font-18 mr20" id="shixun_operation"
onClick={() => this.tojoinclass(1)}>加入课堂</a>: ""}
</li>
{coursedata.course_identity === 6&&coursedata.educoder_teacher===true?
<li className={"mt7 mr10im"}> <a className="fr user_default_btn user_blue_btn mr20 font-18" onClick={() => this.ActionPoll(5)}> 复制课堂 </a>: ""}
<a onClick={()=>this.addStudent()}>
<span className="color-white fl font-16 bannerurli width100f">添加学生</span> {this.props.isStudent()?<a className="fr user_default_btn user_blue_btn mr20 font-18"
</a> onClick={() => this.exitclass()}
</li> > 退出课堂 </a>:""}
<li className={"mt7 mr10im ml10"} style={{overflow:"hidden"}}> </div>
<a>
<span className="color-grey-c fl font-16">邀请码</span>
<span <div className="clearfix clearfixborder">
className={coursedata.code_halt === true? "color-white fl font-16 bannerurli width75f" : "color-white fl font-16 bannerurli width107f marleftf10 color-orange-tip"}> <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>
{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>
) )
} }
} }

@ -240,11 +240,15 @@ class ExerciseReviewAndAnswer extends Component{
) )
} }
// 调分 // 调分
showSetScore=(key,flag)=>{ showSetScore=(key,flag,setId)=>{
this.setState( this.setState(
(prevState) => ({ (prevState) => ({
exercise_questions : update(prevState.exercise_questions, {[key]: { setScore: {$set: flag == undefined || flag==false ? true : false}}}) exercise_questions : update(prevState.exercise_questions, {[key]: { setScore: {$set: flag == undefined || flag==false ? true : false}}})
}) }),()=>{
if (setId && (flag == undefined || flag==false)) {
$("html").animate({ scrollTop: $("#Anchor_"+setId).offset().top - 150 })
}
}
) )
this.setState({ this.setState({
score:undefined score:undefined
@ -502,6 +506,18 @@ class ExerciseReviewAndAnswer extends Component{
console.log(data&&data.exercise.user_name) console.log(data&&data.exercise.user_name)
return( return(
<div className="newMain" style={{paddingTop:"0px"}}> <div className="newMain" style={{paddingTop:"0px"}}>
<style>{`
.inputNumber30{
height:30px;
width:115px;
}
.inputNumber30 .ant-input-number-input-wrap{
line-height: 28px;
}
.inputNumber30 .ant-input-number-input-wrap .ant-input-number-input{
height: 28px;
}
`}</style>
<p style={{height:"60px"}}></p> <p style={{height:"60px"}}></p>
<Modals <Modals
modalsType={Modalstype} modalsType={Modalstype}
@ -665,7 +681,7 @@ class ExerciseReviewAndAnswer extends Component{
{ {
// 填空(一直都有调分),和简答题调分:老师身份 已经评分的才能出现调分按钮 // 填空(一直都有调分),和简答题调分:老师身份 已经评分的才能出现调分按钮
isAdmin && ((parseInt(item.answer_status) == 1 && item.question_type == 4) || item.question_type == 3) ? isAdmin && ((parseInt(item.answer_status) == 1 && item.question_type == 4) || item.question_type == 3) ?
<WordsBtn style="blue" className="mr20 font-16 fl" onClick={()=>this.showSetScore(key,item.setScore)}>调分</WordsBtn>:"" <WordsBtn style="blue" className="mr20 font-16 fl" onClick={()=>this.showSetScore(key,item.setScore,item.q_position+"_"+item.question_type)}>调分</WordsBtn>:""
} }
{ {
// 简答题,未评分的显示未批 // 简答题,未评分的显示未批
@ -767,11 +783,10 @@ class ExerciseReviewAndAnswer extends Component{
</div> </div>
</div> </div>
} }
{ {
// 调分输入部分 // 调分输入部分
isAdmin && ((item.setScore && item.question_type == 3) || ((item.setScore || parseInt(item.answer_status) == 0) && item.question_type == 4))? isAdmin && ((item.setScore && item.question_type == 3) || ((item.setScore || parseInt(item.answer_status) == 0) && item.question_type == 4))?
<div className="ml30 mr30 bor-top-greyE pt20 mt20"> <div className="ml30 mr30 bor-top-greyE pt20 mt20" id={`${"Anchor_"+item.q_position+"_"+item.question_type}`}>
<div className="edu-txt-right"> <div className="edu-txt-right">
<span><span className="color-red">*</span></span> <span><span className="color-red">*</span></span>
<li className="fr"> <li className="fr">
@ -783,8 +798,7 @@ class ExerciseReviewAndAnswer extends Component{
value={score} value={score}
step={0.1} step={0.1}
precision={1} precision={1}
className={ setTip !="" ? "edu-txt-center winput-115-40 fl mt3 noticeTip" : "edu-txt-center winput-115-40 fl mt3"} className={ setTip !="" ? "edu-txt-center winput-115-40 fl mt3 noticeTip inputNumber30" : "edu-txt-center winput-115-40 fl mt3 inputNumber30"}
style={{height:"30px",width:"115px"}}
onChange={this.inputScore} onChange={this.inputScore}
></InputNumber> ></InputNumber>
<span className="ml5"></span> <span className="ml5"></span>

@ -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,

@ -86,6 +86,19 @@ class GraduationTasksSubmitnew extends Component{
let {fileList,selectmemberslist,workslist}=this.state; let {fileList,selectmemberslist,workslist}=this.state;
if(fileList.length === 0){
this.setState({
Modalstype:true,
Modalstopval:'请上传附件!',
Loadtype:true,
ModalCancel:this.cancelAttachment
})
return
}
let userids=[]; let userids=[];
for(var list of selectmemberslist){ for(var list of selectmemberslist){
@ -433,6 +446,8 @@ render(){
let graduation_id=workslist===undefined?"":workslist.graduation_id; let graduation_id=workslist===undefined?"":workslist.graduation_id;
let task_id=workslist===undefined?"":workslist.task_id; let task_id=workslist===undefined?"":workslist.task_id;
return( return(
<React.Fragment> <React.Fragment>
@ -637,7 +652,7 @@ render(){
<Form.Item> <Form.Item>
<div className="clearfix mt30 mb30"> <div className="clearfix mt30 mb30">
<Button type="primary" htmlType="submit" className="defalutSubmitbtn fl mr20">提交</Button> <Button type="primary" htmlType="submit" className="defalutSubmitbtn fl mr20">提交</Button>
<a onClick={this.gocannel} className="defalutCancelbtn fl">取消</a> <a onClick={this.gocannel} className="defalutCancelbtn fl">取消</a>
</div> </div>
</Form.Item> </Form.Item>

@ -163,8 +163,8 @@ class GraduationTasksappraise extends Component{
<div className={"educontent mb20"}> <div className={"educontent mb20"}>
<p className="clearfix mt10"> <p className="clearfix mt10">
{/*<WordsBtn style="grey" className="fl"> <Link to={"/courses/"+courseId+"/graduation_tasks/"+graduation_id} className="color-grey-6">{datalist&&datalist.course_name}</Link></WordsBtn>*/} <WordsBtn style="grey" className="fl"> <Link to={"/courses/"+courseId} className="color-grey-6">{datalist&&datalist.course_name}</Link></WordsBtn>
{/*<span className="color-grey-9 fl ml3 mr3">&gt;</span>*/} <span className="color-grey-9 fl ml3 mr3">&gt;</span>
<WordsBtn style="grey" className="fl"> <Link to={"/courses/"+courseId+"/graduation_tasks/"+graduation_id} className="color-grey-6">{datalist&&datalist.graduation_name}</Link></WordsBtn> <WordsBtn style="grey" className="fl"> <Link to={"/courses/"+courseId+"/graduation_tasks/"+graduation_id} className="color-grey-6">{datalist&&datalist.graduation_name}</Link></WordsBtn>
<span className="color-grey-9 fl ml3 mr3">&gt;</span> <span className="color-grey-9 fl ml3 mr3">&gt;</span>
<WordsBtn style="grey" className="fl"> <Link to={"/courses/"+courseId+"/graduation_tasks/"+graduation_id+"/"+task_id+"/list"} className="color-grey-6">任务详情</Link></WordsBtn> <WordsBtn style="grey" className="fl"> <Link to={"/courses/"+courseId+"/graduation_tasks/"+graduation_id+"/"+task_id+"/list"} className="color-grey-6">任务详情</Link></WordsBtn>
@ -182,23 +182,22 @@ class GraduationTasksappraise extends Component{
` `
} }
</style> </style>
<div style={{ width:'100%',height:'75px'}} > <div className="mt20 mb20 clearfix lineh-25">
<p className=" fl color-black mt25 summaryname">{datalist&&datalist.task_name}</p> <p className="fl color-black summaryname lineh-25">{datalist&&datalist.task_name}</p>
<CoursesListType <CoursesListType
typelist={datalist&&datalist.status} typelist={datalist&&datalist.status}
typesylename={"mt23"}
/> />
<a className="color-grey-6 fr font-16 mt10 mr20" onClick={this.goback}>返回</a> <a className="color-grey-6 fr font-16 mr20" onClick={this.goback}>返回</a>
{this.props.isStudent()? {this.props.isStudent()?
datalist&&datalist.task_status===2? datalist&&datalist.task_status===2?
<a className={"fr color-blue font-16 mt10 mr20"} onClick={this.addAccessory}>补交附件</a>:"" <a className={"fr color-blue font-16 mr20"} onClick={this.addAccessory}>补交附件</a>:""
:""} :""}
</div> </div>
<div className=" edu-back-white " style={{"padding": "20px 15px 20px 15px","box-sizing": "border-box"}}> <div className=" edu-back-white " style={{"padding": "20px 15px 20px 15px","box-sizing": "border-box"}}>
<div className={"stud-class-set bor-bottom-greyE edu-back-white"} style={{ padding: '0px 10px 20px 10px'}}> <div className={"stud-class-set edu-back-white"} style={{ padding: '0px 10px 20px 10px'}}>
<div className={"color-grey-6 h20 mb20"}> <div className={"color-grey-6 h20 mb20"}>
内容 内容
@ -251,7 +250,7 @@ class GraduationTasksappraise extends Component{
{firelistdata===undefined?"":firelistdata.length===0?"":firelistdata.revise_attachments.length===0?"":<div className={"stud-class-set bor-bottom-greyE pd20 edu-back-white"}> {firelistdata===undefined?"":firelistdata.length===0?"":firelistdata.revise_attachments.length===0?"":<div className={"stud-class-set bor-bottom-greyE pd20 edu-back-white"}>
<div className={"color-grey-6 mb10"}> <div className={"color-grey-6 mb10 bor-top-greyE"}>
补交附件 补交附件
</div> </div>

@ -619,17 +619,17 @@ class GraduationTaskssettinglist extends Component{
title: '序号', title: '序号',
dataIndex: 'number', dataIndex: 'number',
key: 'number', key: 'number',
className:'edu-txt-center'
}, { }, {
title: '姓名', title: '姓名',
dataIndex: 'name', dataIndex: 'name',
key: 'name', key: 'name',
className:'edu-txt-center'
}, { }, {
title: '学号', title: '学号',
dataIndex: 'stduynumber', dataIndex: 'stduynumber',
key: 'stduynumber', key: 'stduynumber',
className:'edu-txt-center',
render: (text, record) => ( render: (text, record) => (
<span> <span>
<a style={{color:'#9A9A9A'}}>{record.stduynumber}</a> <a style={{color:'#9A9A9A'}}>{record.stduynumber}</a>
@ -639,7 +639,7 @@ class GraduationTaskssettinglist extends Component{
title: '分班', title: '分班',
key: 'classroom', key: 'classroom',
dataIndex: 'classroom', dataIndex: 'classroom',
className:'edu-txt-center',
render: (text, record) => ( render: (text, record) => (
<span> <span>
<a style={{color:'#9A9A9A'}}>{record.classroom==="未分班"?"--":record.classroom}</a> <a style={{color:'#9A9A9A'}}>{record.classroom==="未分班"?"--":record.classroom}</a>
@ -648,7 +648,8 @@ class GraduationTaskssettinglist extends Component{
}, { }, {
title: '分组', title: '分组',
key: 'grouping', key: 'grouping',
dataIndex: 'grouping', dataIndex: 'grouping',
className:'edu-txt-center',
render: (text, record) => ( render: (text, record) => (
<span> <span>
<a style={{color:'#676767'}}>{record.grouping}</a> <a style={{color:'#676767'}}>{record.grouping}</a>
@ -657,7 +658,7 @@ class GraduationTaskssettinglist extends Component{
title: '关联项目', title: '关联项目',
dataIndex: 'associationitems', dataIndex: 'associationitems',
key: 'associationitems', key: 'associationitems',
className:'edu-txt-center',
render: (text, record) => ( render: (text, record) => (
<div> <div>
<a style={{color:'#4CACFF'}} href={"/projects/"+record.associationitems.id} target={"_blank"}> <a style={{color:'#4CACFF'}} href={"/projects/"+record.associationitems.id} target={"_blank"}>
@ -669,7 +670,7 @@ class GraduationTaskssettinglist extends Component{
title: '提交状态', title: '提交状态',
dataIndex: 'submitstate', dataIndex: 'submitstate',
key: 'submitstate', key: 'submitstate',
className:'edu-txt-center',
render: (text, record) => ( render: (text, record) => (
<span> <span>
<a style={{color:record.submitstate==="按时提交"?'#29BD8B':record.submitstate==="未提交"?"#9A9A9A":"#DD1717"}}>{record.submitstate}</a> <a style={{color:record.submitstate==="按时提交"?'#29BD8B':record.submitstate==="未提交"?"#9A9A9A":"#DD1717"}}>{record.submitstate}</a>
@ -679,7 +680,7 @@ class GraduationTaskssettinglist extends Component{
title: '更新时间', title: '更新时间',
dataIndex: 'turnovertime', dataIndex: 'turnovertime',
key: 'turnovertime', key: 'turnovertime',
className:'edu-txt-center',
render: (text, record) => ( render: (text, record) => (
<span> <span>
<a style={{color:'#989898'}}> <a style={{color:'#989898'}}>
@ -691,11 +692,11 @@ class GraduationTaskssettinglist extends Component{
title: '教师评分', title: '教师评分',
key: 'teacherrating', key: 'teacherrating',
dataIndex: 'teacherrating', dataIndex: 'teacherrating',
className:'edu-txt-center',
render: (text, record) => ( render: (text, record) => (
<span> <span>
<Tooltip placement="bottom" title={record.teacherrating==="--"||record.teacherrating==="未批阅"?"未评阅":""}> <Tooltip placement="bottom" title={record.teacherrating==="--"||record.teacherrating==="未批阅"?"未评阅":""}>
<a style={{color:parseInt(record.teacherrating)>90?'#DD1717':parseInt(record.teacherrating)>60&&parseInt(record.teacherrating)<90?"#FF6800":'#747A7F'}}>{record.teacherrating==="--"||record.teacherrating==="未批阅"?"--":parseInt(record.teacherrating)}</a> <a style={{color:parseInt(record.teacherrating)>90?'#DD1717':parseInt(record.teacherrating)>60&&parseInt(record.teacherrating)<90?"#FF6800":'#747A7F'}}>{record.teacherrating==="--"||record.teacherrating==="未批阅"?"--":record.teacherrating}</a>
</Tooltip> </Tooltip>
</span> </span>
), ),
@ -703,11 +704,11 @@ class GraduationTaskssettinglist extends Component{
title: '交叉评分', title: '交叉评分',
key: 'crossrating', key: 'crossrating',
dataIndex: 'crossrating', dataIndex: 'crossrating',
className:'edu-txt-center',
render: (text, record) => ( render: (text, record) => (
<span> <span>
<Tooltip placement="bottom" title={record.crossrating==="--"||record.crossrating==="未批阅"?"未评阅":""}> <Tooltip placement="bottom" title={record.crossrating==="--"||record.crossrating==="未批阅"?"未评阅":""}>
<a style={{color:parseInt(record.crossrating)>90?'#DD1717':parseInt(record.crossrating)>60&&parseInt(record.crossrating)<90?"#FF6800":'#747A7F'}}>{record.crossrating==="--"||record.crossrating==="未批阅"?"--":parseInt(record.crossrating)}</a> <a style={{color:parseInt(record.crossrating)>90?'#DD1717':parseInt(record.crossrating)>60&&parseInt(record.crossrating)<90?"#FF6800":'#747A7F'}}>{record.crossrating==="--"||record.crossrating==="未批阅"?"--":record.crossrating}</a>
</Tooltip> </Tooltip>
</span> </span>
), ),
@ -715,18 +716,19 @@ class GraduationTaskssettinglist extends Component{
title: '最终成绩', title: '最终成绩',
key: 'finalscore', key: 'finalscore',
dataIndex: 'finalscore', dataIndex: 'finalscore',
className:'edu-txt-center',
render: (text, record) => ( render: (text, record) => (
<span> <span>
<Tooltip placement="bottom" title={record.finalscore==="--"?"未评阅":""}> <Tooltip placement="bottom" title={record.finalscore==="--"?"未评阅":""}>
<a style={{color:parseInt(record.finalscore)>90?'#DD1717':parseInt(record.finalscore)>60&&parseInt(record.finalscore)<90?"#FF6800":'#747A7F'}}>{record.finalscore==="--"?"--":parseInt(record.finalscore)}</a> <a style={{color:parseInt(record.finalscore)>90?'#DD1717':parseInt(record.finalscore)>60&&parseInt(record.finalscore)<90?"#FF6800":'#747A7F'}}>{record.finalscore==="--"?"--":record.finalscore}</a>
</Tooltip> </Tooltip>
</span> </span>
), ),
}, { }, {
title: '操作', title: '操作',
key: 'operation', key: 'operation',
dataIndex: 'operation', dataIndex: 'operation',
className:'edu-txt-center',
render: operation => ( render: operation => (
<div> <div>
{this.props.isAdmin()?operation.map((tag,key) => { {this.props.isAdmin()?operation.map((tag,key) => {
@ -770,17 +772,17 @@ class GraduationTaskssettinglist extends Component{
title: '序号', title: '序号',
dataIndex: 'number', dataIndex: 'number',
key: 'number', key: 'number',
className:'edu-txt-center',
}, { }, {
title: '姓名', title: '姓名',
dataIndex: 'name', dataIndex: 'name',
key: 'name', key: 'name',
className:'edu-txt-center',
}, { }, {
title: '学号', title: '学号',
dataIndex: 'stduynumber', dataIndex: 'stduynumber',
key: 'stduynumber', key: 'stduynumber',
className:'edu-txt-center',
render: (text, record) => ( render: (text, record) => (
<span> <span>
<a style={{color:'#9A9A9A'}}>{record.stduynumber}</a> <a style={{color:'#9A9A9A'}}>{record.stduynumber}</a>
@ -789,7 +791,8 @@ class GraduationTaskssettinglist extends Component{
},{ },{
title: '分组', title: '分组',
key: 'grouping', key: 'grouping',
dataIndex: 'grouping', dataIndex: 'grouping',
className:'edu-txt-center',
render: (text, record) => ( render: (text, record) => (
<span> <span>
<a style={{color:'#676767'}}>{record.grouping}</a> <a style={{color:'#676767'}}>{record.grouping}</a>
@ -798,7 +801,7 @@ class GraduationTaskssettinglist extends Component{
title: '关联项目', title: '关联项目',
dataIndex: 'associationitems', dataIndex: 'associationitems',
key: 'associationitems', key: 'associationitems',
className:'edu-txt-center',
render: (text, record) => ( render: (text, record) => (
<div> <div>
<a style={{color:'#4CACFF'}} href={"/projects/"+record.associationitems.id} target={"_blank"}> <a style={{color:'#4CACFF'}} href={"/projects/"+record.associationitems.id} target={"_blank"}>
@ -810,7 +813,7 @@ class GraduationTaskssettinglist extends Component{
title: '提交状态', title: '提交状态',
dataIndex: 'submitstate', dataIndex: 'submitstate',
key: 'submitstate', key: 'submitstate',
className:'edu-txt-center',
render: (text, record) => ( render: (text, record) => (
<span> <span>
<a style={{color:record.submitstate==="按时提交"?'#29BD8B':record.submitstate==="未提交"?"#9A9A9A":"#DD1717"}}>{record.submitstate}</a> <a style={{color:record.submitstate==="按时提交"?'#29BD8B':record.submitstate==="未提交"?"#9A9A9A":"#DD1717"}}>{record.submitstate}</a>
@ -820,7 +823,7 @@ class GraduationTaskssettinglist extends Component{
title: '更新时间', title: '更新时间',
dataIndex: 'turnovertime', dataIndex: 'turnovertime',
key: 'turnovertime', key: 'turnovertime',
className:'edu-txt-center',
render: (text, record) => ( render: (text, record) => (
<span> <span>
<a style={{color:'#989898'}}> <a style={{color:'#989898'}}>
@ -832,11 +835,11 @@ class GraduationTaskssettinglist extends Component{
title: '教师评分', title: '教师评分',
key: 'teacherrating', key: 'teacherrating',
dataIndex: 'teacherrating', dataIndex: 'teacherrating',
className:'edu-txt-center',
render: (text, record) => ( render: (text, record) => (
<span> <span>
<Tooltip placement="bottom" title={record.teacherrating==="--"||record.teacherrating==="未批阅"?"未评阅":""}> <Tooltip placement="bottom" title={record.teacherrating==="--"||record.teacherrating==="未批阅"?"未评阅":""}>
<a style={{color:parseInt(record.teacherrating)>90?'#DD1717':parseInt(record.teacherrating)>60&&parseInt(record.teacherrating)<90?"#FF6800":'#747A7F'}}>{record.teacherrating==="--"||record.teacherrating==="未批阅"?"--":parseInt(record.teacherrating)}</a> <a style={{color:parseInt(record.teacherrating)>90?'#DD1717':parseInt(record.teacherrating)>60&&parseInt(record.teacherrating)<90?"#FF6800":'#747A7F'}}>{record.teacherrating==="--"||record.teacherrating==="未批阅"?"--":record.teacherrating}</a>
</Tooltip> </Tooltip>
</span> </span>
), ),
@ -844,11 +847,11 @@ class GraduationTaskssettinglist extends Component{
title: '交叉评分', title: '交叉评分',
key: 'crossrating', key: 'crossrating',
dataIndex: 'crossrating', dataIndex: 'crossrating',
className:'none', className:'none edu-txt-center',
render: (text, record) => ( render: (text, record) => (
<span> <span>
<Tooltip placement="bottom" title={record.crossrating==="--"||record.crossrating==="未批阅"?"未评阅":""}> <Tooltip placement="bottom" title={record.crossrating==="--"||record.crossrating==="未批阅"?"未评阅":""}>
<a style={{color:parseInt(record.crossrating)>90?'#DD1717':parseInt(record.crossrating)>60&&parseInt(record.crossrating)<90?"#FF6800":'#747A7F'}}>{record.crossrating==="--"||record.crossrating==="未批阅"?"--":parseInt(record.crossrating)}</a> <a style={{color:parseInt(record.crossrating)>90?'#DD1717':parseInt(record.crossrating)>60&&parseInt(record.crossrating)<90?"#FF6800":'#747A7F'}}>{record.crossrating==="--"||record.crossrating==="未批阅"?"--":record.crossrating}</a>
</Tooltip> </Tooltip>
</span> </span>
), ),
@ -856,11 +859,11 @@ class GraduationTaskssettinglist extends Component{
title: '最终成绩', title: '最终成绩',
key: 'finalscore', key: 'finalscore',
dataIndex: 'finalscore', dataIndex: 'finalscore',
className:'edu-txt-center',
render: (text, record) => ( render: (text, record) => (
<span> <span>
<Tooltip placement="bottom" title={record.finalscore==="--"?"未评阅":""}> <Tooltip placement="bottom" title={record.finalscore==="--"?"未评阅":""}>
<a style={{color:parseInt(record.finalscore)>90?'#DD1717':parseInt(record.finalscore)>60&&parseInt(record.finalscore)<90?"#FF6800":'#747A7F'}}>{record.finalscore==="--"?"--":parseInt(record.finalscore)}</a> <a style={{color:parseInt(record.finalscore)>90?'#DD1717':parseInt(record.finalscore)>60&&parseInt(record.finalscore)<90?"#FF6800":'#747A7F'}}>{record.finalscore==="--"?"--":record.finalscore}</a>
</Tooltip> </Tooltip>
</span> </span>
), ),
@ -868,6 +871,7 @@ class GraduationTaskssettinglist extends Component{
title: '操作', title: '操作',
key: 'operation', key: 'operation',
dataIndex: 'operation', dataIndex: 'operation',
className:'edu-txt-center',
render: operation => ( render: operation => (
<div> <div>
{this.props.isAdmin()?operation.map((tag,key) => { {this.props.isAdmin()?operation.map((tag,key) => {
@ -916,17 +920,17 @@ class GraduationTaskssettinglist extends Component{
title: '序号', title: '序号',
dataIndex: 'number', dataIndex: 'number',
key: 'number', key: 'number',
className:'edu-txt-center',
}, { }, {
title: '姓名', title: '姓名',
dataIndex: 'name', dataIndex: 'name',
key: 'name', key: 'name',
className:'edu-txt-center',
}, { }, {
title: '学号', title: '学号',
dataIndex: 'stduynumber', dataIndex: 'stduynumber',
key: 'stduynumber', key: 'stduynumber',
className:'edu-txt-center',
render: (text, record) => ( render: (text, record) => (
<span> <span>
<a href="javascript:;" style={{color:'#9A9A9A'}}>{record.stduynumber}</a> <a href="javascript:;" style={{color:'#9A9A9A'}}>{record.stduynumber}</a>
@ -936,7 +940,7 @@ class GraduationTaskssettinglist extends Component{
title: '分班', title: '分班',
key: 'classroom', key: 'classroom',
dataIndex: 'classroom', dataIndex: 'classroom',
className:'edu-txt-center',
render: (text, record) => ( render: (text, record) => (
<span> <span>
<a href="javascript:;" style={{color:'#9A9A9A'}}>{record.classroom==="未分班"?"--":record.classroom}</a> <a href="javascript:;" style={{color:'#9A9A9A'}}>{record.classroom==="未分班"?"--":record.classroom}</a>
@ -946,6 +950,7 @@ class GraduationTaskssettinglist extends Component{
title: '分组', title: '分组',
key: 'grouping', key: 'grouping',
dataIndex: 'grouping', dataIndex: 'grouping',
className:'edu-txt-center',
render: (text, record) => ( render: (text, record) => (
<span> <span>
<a style={{color:'#676767'}}>{record.grouping}</a> <a style={{color:'#676767'}}>{record.grouping}</a>
@ -954,7 +959,7 @@ class GraduationTaskssettinglist extends Component{
title: '关联项目', title: '关联项目',
dataIndex: 'associationitems', dataIndex: 'associationitems',
key: 'associationitems', key: 'associationitems',
className:'edu-txt-center',
render: (text, record) => ( render: (text, record) => (
<div> <div>
<a style={{color:'#4CACFF'}} href={"/projects/"+record.associationitems.id} target={"_blank"}> <a style={{color:'#4CACFF'}} href={"/projects/"+record.associationitems.id} target={"_blank"}>
@ -967,7 +972,7 @@ class GraduationTaskssettinglist extends Component{
title: '提交状态', title: '提交状态',
dataIndex: 'submitstate', dataIndex: 'submitstate',
key: 'submitstate', key: 'submitstate',
className:'edu-txt-center',
render: (text, record) => ( render: (text, record) => (
<span> <span>
<a style={{color:record.submitstate==="按时提交"?'#29BD8B':record.submitstate==="未提交"?"#9A9A9A":"#DD1717"}}>{record.submitstate}</a> <a style={{color:record.submitstate==="按时提交"?'#29BD8B':record.submitstate==="未提交"?"#9A9A9A":"#DD1717"}}>{record.submitstate}</a>
@ -977,7 +982,7 @@ class GraduationTaskssettinglist extends Component{
title: '更新时间', title: '更新时间',
dataIndex: 'turnovertime', dataIndex: 'turnovertime',
key: 'turnovertime', key: 'turnovertime',
className:'edu-txt-center',
render: (text, record) => ( render: (text, record) => (
<span> <span>
<a href="javascript:;" style={{color:'#989898'}}> <a href="javascript:;" style={{color:'#989898'}}>
@ -989,11 +994,11 @@ class GraduationTaskssettinglist extends Component{
title: '教师评分', title: '教师评分',
key: 'teacherrating', key: 'teacherrating',
dataIndex: 'teacherrating', dataIndex: 'teacherrating',
className:'edu-txt-center',
render: (text, record) => ( render: (text, record) => (
<span> <span>
<Tooltip placement="bottom" title={record.teacherrating==="--"||record.teacherrating==="未批阅"?"未评阅":""}> <Tooltip placement="bottom" title={record.teacherrating==="--"||record.teacherrating==="未批阅"?"未评阅":""}>
<a style={{color:parseInt(record.teacherrating)>90?'#DD1717':parseInt(record.teacherrating)>60&&parseInt(record.teacherrating)<90?"#FF6800":'#747A7F'}}>{record.teacherrating==="--"||record.teacherrating==="未批阅"?"--":parseInt(record.teacherrating)}</a> <a style={{color:parseInt(record.teacherrating)>90?'#DD1717':parseInt(record.teacherrating)>60&&parseInt(record.teacherrating)<90?"#FF6800":'#747A7F'}}>{record.teacherrating==="--"||record.teacherrating==="未批阅"?"--":record.teacherrating}</a>
</Tooltip> </Tooltip>
</span> </span>
), ),
@ -1001,11 +1006,11 @@ class GraduationTaskssettinglist extends Component{
title: '交叉评分', title: '交叉评分',
key: 'crossrating', key: 'crossrating',
dataIndex: 'crossrating', dataIndex: 'crossrating',
className:'edu-txt-center',
render: (text, record) => ( render: (text, record) => (
<span> <span>
<Tooltip placement="bottom" title={record.crossrating==="--"||record.crossrating==="未批阅"?"未评阅":""}> <Tooltip placement="bottom" title={record.crossrating==="--"||record.crossrating==="未批阅"?"未评阅":""}>
<a style={{color:parseInt(record.crossrating)>90?'#DD1717':parseInt(record.crossrating)>60&&parseInt(record.crossrating)<90?"#FF6800":'#747A7F'}}>{record.crossrating==="--"||record.crossrating==="未批阅"?"--":parseInt(record.crossrating)}</a> <a style={{color:parseInt(record.crossrating)>90?'#DD1717':parseInt(record.crossrating)>60&&parseInt(record.crossrating)<90?"#FF6800":'#747A7F'}}>{record.crossrating==="--"||record.crossrating==="未批阅"?"--":record.crossrating}</a>
</Tooltip> </Tooltip>
</span> </span>
), ),
@ -1013,11 +1018,11 @@ class GraduationTaskssettinglist extends Component{
title: '最终成绩', title: '最终成绩',
key: 'finalscore', key: 'finalscore',
dataIndex: 'finalscore', dataIndex: 'finalscore',
className:'edu-txt-center',
render: (text, record) => ( render: (text, record) => (
<span> <span>
<Tooltip placement="bottom" title={record.finalscore==="--"?"未评阅":""}> <Tooltip placement="bottom" title={record.finalscore==="--"?"未评阅":""}>
<a style={{color:parseInt(record.finalscore)>90?'#DD1717':parseInt(record.finalscore)>60&&parseInt(record.finalscore)<90?"#FF6800":'#747A7F'}}>{record.finalscore==="--"?"--":parseInt(record.finalscore)}</a> <a style={{color:parseInt(record.finalscore)>90?'#DD1717':parseInt(record.finalscore)>60&&parseInt(record.finalscore)<90?"#FF6800":'#747A7F'}}>{record.finalscore==="--"?"--":record.finalscore}</a>
</Tooltip> </Tooltip>
</span> </span>
), ),
@ -1025,6 +1030,7 @@ class GraduationTaskssettinglist extends Component{
title: '操作', title: '操作',
key: 'operation', key: 'operation',
dataIndex: 'operation', dataIndex: 'operation',
className:'edu-txt-center',
render: operation => ( render: operation => (
<div> <div>
{this.props.isAdmin()?operation.map((tag,key) => { {this.props.isAdmin()?operation.map((tag,key) => {
@ -1068,17 +1074,17 @@ class GraduationTaskssettinglist extends Component{
title: '序号', title: '序号',
dataIndex: 'number', dataIndex: 'number',
key: 'number', key: 'number',
className:'edu-txt-center',
}, { }, {
title: '姓名', title: '姓名',
dataIndex: 'name', dataIndex: 'name',
key: 'name', key: 'name',
className:'edu-txt-center',
}, { }, {
title: '学号', title: '学号',
dataIndex: 'stduynumber', dataIndex: 'stduynumber',
key: 'stduynumber', key: 'stduynumber',
className:'edu-txt-center',
render: (text, record) => ( render: (text, record) => (
<span> <span>
<a href="javascript:;" style={{color:'#9A9A9A'}}>{record.stduynumber}</a> <a href="javascript:;" style={{color:'#9A9A9A'}}>{record.stduynumber}</a>
@ -1088,6 +1094,7 @@ class GraduationTaskssettinglist extends Component{
title: '分组', title: '分组',
key: 'grouping', key: 'grouping',
dataIndex: 'grouping', dataIndex: 'grouping',
className:'edu-txt-center',
render: (text, record) => ( render: (text, record) => (
<span> <span>
<a style={{color:'#676767'}}>{record.grouping}</a> <a style={{color:'#676767'}}>{record.grouping}</a>
@ -1096,7 +1103,7 @@ class GraduationTaskssettinglist extends Component{
title: '关联项目', title: '关联项目',
dataIndex: 'associationitems', dataIndex: 'associationitems',
key: 'associationitems', key: 'associationitems',
className:'edu-txt-center',
render: (text, record) => ( render: (text, record) => (
<div className={"projectsdiv"} > <div className={"projectsdiv"} >
<a style={{color:'#4CACFF'}} href={"/projects/"+record.associationitems.id} target={"_blank"}> <a style={{color:'#4CACFF'}} href={"/projects/"+record.associationitems.id} target={"_blank"}>
@ -1110,7 +1117,7 @@ class GraduationTaskssettinglist extends Component{
title: '提交状态', title: '提交状态',
dataIndex: 'submitstate', dataIndex: 'submitstate',
key: 'submitstate', key: 'submitstate',
className:'edu-txt-center',
render: (text, record) => ( render: (text, record) => (
<span> <span>
<a style={{color:record.submitstate==="按时提交"?'#29BD8B':record.submitstate==="未提交"?"#9A9A9A":"#DD1717"}}>{record.submitstate}</a> <a style={{color:record.submitstate==="按时提交"?'#29BD8B':record.submitstate==="未提交"?"#9A9A9A":"#DD1717"}}>{record.submitstate}</a>
@ -1120,7 +1127,7 @@ class GraduationTaskssettinglist extends Component{
title: '更新时间', title: '更新时间',
dataIndex: 'turnovertime', dataIndex: 'turnovertime',
key: 'turnovertime', key: 'turnovertime',
className:'edu-txt-center',
render: (text, record) => ( render: (text, record) => (
<span> <span>
<a href="javascript:;" style={{color:'#989898'}}> <a href="javascript:;" style={{color:'#989898'}}>
@ -1132,11 +1139,11 @@ class GraduationTaskssettinglist extends Component{
title: '教师评分', title: '教师评分',
key: 'teacherrating', key: 'teacherrating',
dataIndex: 'teacherrating', dataIndex: 'teacherrating',
className:'edu-txt-center',
render: (text, record) => ( render: (text, record) => (
<span> <span>
<Tooltip placement="bottom" title={record.teacherrating==="--"||record.teacherrating==="未批阅"?"未评阅":""}> <Tooltip placement="bottom" title={record.teacherrating==="--"||record.teacherrating==="未批阅"?"未评阅":""}>
<a style={{color:parseInt(record.teacherrating)>90?'#DD1717':parseInt(record.teacherrating)>60&&parseInt(record.teacherrating)<90?"#FF6800":'#747A7F'}}>{record.teacherrating==="--"||record.teacherrating==="未批阅"?"--":parseInt(record.teacherrating)}</a> <a style={{color:parseInt(record.teacherrating)>90?'#DD1717':parseInt(record.teacherrating)>60&&parseInt(record.teacherrating)<90?"#FF6800":'#747A7F'}}>{record.teacherrating==="--"||record.teacherrating==="未批阅"?"--":record.teacherrating}</a>
</Tooltip> </Tooltip>
</span> </span>
), ),
@ -1144,11 +1151,11 @@ class GraduationTaskssettinglist extends Component{
title: '交叉评分', title: '交叉评分',
key: 'crossrating', key: 'crossrating',
dataIndex: 'crossrating', dataIndex: 'crossrating',
className:'edu-txt-center',
render: (text, record) => ( render: (text, record) => (
<span> <span>
<Tooltip placement="bottom" title={record.crossrating==="--"||record.crossrating==="未批阅"?"未评阅":""}> <Tooltip placement="bottom" title={record.crossrating==="--"||record.crossrating==="未批阅"?"未评阅":""}>
<a style={{color:parseInt(record.crossrating)>90?'#DD1717':parseInt(record.crossrating)>60&&parseInt(record.crossrating)<90?"#FF6800":'#747A7F'}}>{record.crossrating==="--"||record.crossrating==="未批阅"?"--":parseInt(record.crossrating)}</a> <a style={{color:parseInt(record.crossrating)>90?'#DD1717':parseInt(record.crossrating)>60&&parseInt(record.crossrating)<90?"#FF6800":'#747A7F'}}>{record.crossrating==="--"||record.crossrating==="未批阅"?"--":record.crossrating}</a>
</Tooltip> </Tooltip>
</span> </span>
), ),
@ -1156,11 +1163,11 @@ class GraduationTaskssettinglist extends Component{
title: '最终成绩', title: '最终成绩',
key: 'finalscore', key: 'finalscore',
dataIndex: 'finalscore', dataIndex: 'finalscore',
className:'edu-txt-center',
render: (text, record) => ( render: (text, record) => (
<span> <span>
<Tooltip placement="bottom" title={record.finalscore==="--"?"未评阅":""}> <Tooltip placement="bottom" title={record.finalscore==="--"?"未评阅":""}>
<a style={{color:parseInt(record.finalscore)>90?'#DD1717':parseInt(record.finalscore)>60&&parseInt(record.finalscore)<90?"#FF6800":'#747A7F'}}>{record.finalscore==="--"?"--":parseInt(record.finalscore)}</a> <a style={{color:parseInt(record.finalscore)>90?'#DD1717':parseInt(record.finalscore)>60&&parseInt(record.finalscore)<90?"#FF6800":'#747A7F'}}>{record.finalscore==="--"?"--":record.finalscore}</a>
</Tooltip> </Tooltip>
</span> </span>
), ),
@ -1168,6 +1175,7 @@ class GraduationTaskssettinglist extends Component{
title: '操作', title: '操作',
key: 'operation', key: 'operation',
dataIndex: 'operation', dataIndex: 'operation',
className:'edu-txt-center',
render: operation => ( render: operation => (
<div> <div>
{this.props.isAdmin()?operation.map((tag,key) => { {this.props.isAdmin()?operation.map((tag,key) => {
@ -1357,13 +1365,12 @@ class GraduationTaskssettinglist extends Component{
<span>任务详情</span> <span>任务详情</span>
</p> </p>
<div style={{ width:'100%',height:'75px'}} > <div className="clearfix lineh-25 mt20 mb20">
<p className=" fl color-black mt25 summaryname"> <Link to={"/courses/"+courseId+"/graduation_tasks/"+category_id} className="color-grey-6">{taskslistdata.task_name}</Link></p> <p className=" fl color-black summaryname lineh-25"> <Link to={"/courses/"+courseId+"/graduation_tasks/"+category_id} className="color-grey-6">{taskslistdata.task_name}</Link></p>
<CoursesListType <CoursesListType
typelist={taskslistdata.task_status} typelist={taskslistdata.task_status}
typesylename={"mt22"}
/> />
<a className="color-grey-6 fr font-16 ml30 mt10 mr20" onClick={this.goback}>返回</a> <a className="color-grey-6 fr font-16 ml30 mr20" onClick={this.goback}>返回</a>
</div> </div>
@ -1446,7 +1453,7 @@ class GraduationTaskssettinglist extends Component{
{taskslistdata.search_assistants && taskslistdata.search_assistants.teacher_comment && taskslistdata.search_assistants.teacher_comment.map((item,key)=>{ {taskslistdata.search_assistants && taskslistdata.search_assistants.teacher_comment && taskslistdata.search_assistants.teacher_comment.map((item,key)=>{
return( return(
<span key={key}> <span key={key}>
<Checkbox value={item.id} onClick={this.funteachercomment} className="fl ">{item.name} <Checkbox value={item.id} key={item.id} onClick={this.funteachercomment} className="fl ">{item.name}
<span>({item.count})</span> <span>({item.count})</span>
</Checkbox> </Checkbox>
</span> </span>

@ -591,7 +591,7 @@ class GraduationTasks extends Component{
// console.log(this.props.isCourseidentity()===isNotMember) // console.log(this.props.isCourseidentity()===isNotMember)
// console.log(category_id) // console.log(category_id)
return( return(
<CourseLayoutcomponent {...this.props}> <React.Fragment>
{/*提示*/} {/*提示*/}
<Modals <Modals
modalsType={Modalstype} modalsType={Modalstype}
@ -775,7 +775,7 @@ class GraduationTasks extends Component{
</div> </div>
</CourseLayoutcomponent> </React.Fragment>
) )
} }
} }

@ -341,7 +341,7 @@ onBoardsNew=()=>{
// let {course_identity}=this.props.coursedata // let {course_identity}=this.props.coursedata
const isAdmin =this.props.isAdmin(); const isAdmin =this.props.isAdmin();
return( return(
<CourseLayoutcomponent {...this.props}> <React.Fragment >
<ChooseGraduateTopicModal ref="chooseGraduateTopicModal"></ChooseGraduateTopicModal> <ChooseGraduateTopicModal ref="chooseGraduateTopicModal"></ChooseGraduateTopicModal>
<Titlesearchsection <Titlesearchsection
title="毕设选题" title="毕设选题"
@ -446,7 +446,7 @@ onBoardsNew=()=>{
<div> <div>
</div> </div>
</CourseLayoutcomponent> </React.Fragment>
) )
} }
} }

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

@ -13,6 +13,7 @@ import '../css/members.css';
import '../css/busyWork.css'; import '../css/busyWork.css';
import Modals from '../../modals/Modals'; import Modals from '../../modals/Modals';
import axios from 'axios'; import axios from 'axios';
import moment from 'moment';
const Search = Input.Search; const Search = Input.Search;

@ -181,7 +181,12 @@ class PollDetailTabFirst extends Component{
title: '学号', title: '学号',
dataIndex: 'StudentNo', dataIndex: 'StudentNo',
key: 'StudentNo', key: 'StudentNo',
className:"edu-txt-center" className:"edu-txt-center",
render:(StudentNo,item,index)=>{
return(
item.StudentNo ? <span>{item.StudentNo}</span> : "--"
)
}
}, { }, {
title: '分班', title: '分班',
key: 'classes', key: 'classes',

@ -60,21 +60,27 @@ class EducoderLogin extends Component {
if( props.match.url === "/changepassword" ){ if( props.match.url === "/changepassword" ){
this.state = { this.state = {
showbool: false, showbool: false,
logini:3,
} }
}else { }else {
if(props.match.url === "/login"){ if(props.match.url === "/login"){
this.state = { this.state = {
showbool: true, showbool: true,
loginstatus:true loginstatus:true,
logini:1,
} }
}else if(props.match.url === "/register"){ }else if(props.match.url === "/register"){
this.state = { this.state = {
showbool: true, showbool: true,
loginstatus:false, loginstatus:false,
logini:2,
} }
}else{ }else{
this.state = { this.state = {
showbool: true, showbool: true,
logini:1,
} }
} }
@ -86,6 +92,14 @@ class EducoderLogin extends Component {
} }
Setlogins=(i)=>{
console.log("96ye");
console.log(i)
this.setState({
logini:i
})
}
Setshowbool = () => { Setshowbool = () => {
if (this.state.showbool === true) { if (this.state.showbool === true) {
@ -102,7 +116,7 @@ class EducoderLogin extends Component {
render() { render() {
let {showbool} = this.state; let {showbool,loginstatus,logini} = this.state;
return ( return (
<div style={newContainer} > <div style={newContainer} >
<style> <style>
@ -135,14 +149,12 @@ class EducoderLogin extends Component {
"align-items": "center", "align-items": "center",
"width": "100%", "width": "100%",
}}> }}>
<div style={{"margin-top": "40px"}}> <div style={{"margin-top": "40px","height":"500px"}}>
<LoginRegisterComponent {...this.props} {...this.state} <LoginRegisterComponent {...this.props} {...this.state}
Setshowbool={this.Setshowbool}></LoginRegisterComponent> Setshowbool={this.Setshowbool} ></LoginRegisterComponent>
<div style={{"width":"100%","height":"350px"}}>
</div>
</div> </div>
</div> </div>
: :
<div style={{ <div style={{
@ -151,17 +163,23 @@ class EducoderLogin extends Component {
"align-items": "center", "align-items": "center",
"width": "100%", "width": "100%",
}}> }}>
<div style={{"margin-top": "40px"}}> <div style={{"margin-top": "40px","height":"500px"}}>
<FindPasswordComponent {...this.props} {...this.state} <FindPasswordComponent {...this.props} {...this.state}
Setshowbool={this.Setshowbool}></FindPasswordComponent> Setshowbool={this.Setshowbool}></FindPasswordComponent>
<div style={{"width":"100%","height":"250px"}}>
</div>
</div> </div>
</div> </div>
} }
<div style={{"height":"250px",
"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>
</div> </div>
</div> </div>
) )

@ -77,7 +77,9 @@ class Trialapplication extends Component {
//TODO 这里如果样式变了会出现css不加载的情况 //TODO 这里如果样式变了会出现css不加载的情况
}); });
console.log(this.props.isRenders);
console.log("89"); console.log("89");
console.log(this.state.props.user_phone_binded );
try { try {
if (this.state.props.user_phone_binded !== undefined) { if (this.state.props.user_phone_binded !== undefined) {
console.log(this.state.props.user_phone_binded); console.log(this.state.props.user_phone_binded);

@ -223,6 +223,10 @@ class Index extends Component {
challenge={context.challenge} challenge={context.challenge}
myshixun={context.myshixun} myshixun={context.myshixun}
shixun={context.shixun} shixun={context.shixun}
vnc_url={context.vnc_url}
zip_path={context.zip_path}
loading={context.loading} loading={context.loading}
discusses_count={context.discusses_count} discusses_count={context.discusses_count}
hide_code={context.hide_code} hide_code={context.hide_code}

@ -13,6 +13,7 @@ import ChooseEvaluateView from './main/ChooseEvaluateView'
import { CircularProgress } from 'material-ui/Progress'; import { CircularProgress } from 'material-ui/Progress';
import Button from 'material-ui/Button'; import Button from 'material-ui/Button';
import VNCDisplay from './VNCDisplay'
import './tpiPage.css'; import './tpiPage.css';
import './tpiPageForMobile.css'; import './tpiPageForMobile.css';
@ -32,7 +33,7 @@ class MainContent extends Component {
} }
render() { render() {
const { challenge, output_sets, onRunCodeTest, latest_output, record, st, readRepoTimeout, const { challenge, output_sets, onRunCodeTest, latest_output, record, st, readRepoTimeout,
onTestSetHeaderClick, loading, codeLoading } = this.props onTestSetHeaderClick, loading, codeLoading, shixun} = this.props
// if (output_sets && output_sets.test_sets) { // if (output_sets && output_sets.test_sets) {
// const test_sets_array = JSON.parse("[" + output_sets.test_sets + "]"); // const test_sets_array = JSON.parse("[" + output_sets.test_sets + "]");
@ -47,6 +48,9 @@ class MainContent extends Component {
} }
const newProps = Object.assign({}, this.props); const newProps = Object.assign({}, this.props);
delete newProps.testSetsExpandedArray delete newProps.testSetsExpandedArray
const showIframeContent = shixun && shixun.vnc == true
return ( return (
<div className="page--body -margin-t-64 -flex tpi_content"> <div className="page--body -margin-t-64 -flex tpi_content">
<style>{` <style>{`
@ -57,7 +61,7 @@ class MainContent extends Component {
`}</style> `}</style>
<div className="-layout -stretch -fit labelN" id="game_show_content"> <div className="-layout -stretch -fit labelN" id="game_show_content">
<div className="split-panel--first -layout -vertical -flex -relative -flex-basic40" <div className="split-panel--first -layout -vertical -flex -relative -flex-basic40"
id="game_left_contents" style={{ width: '28%'}}> id="game_left_contents" style={{ width: '40%'}}>
{/* style={{width: '694px'}} */} {/* style={{width: '694px'}} */}
{/* 左侧任务说明等功能的区域 */} {/* 左侧任务说明等功能的区域 */}
@ -82,6 +86,10 @@ class MainContent extends Component {
<div className="fl pr tip-right-con" id="update_game_tip"></div> <div className="fl pr tip-right-con" id="update_game_tip"></div>
</div>*/} </div>*/}
{/* { showIframeContent && vnc_url ? <VNCDisplay
vnc_url={vnc_url}
></VNCDisplay> */}
<div className="-layout-v -flex"> <div className="-layout-v -flex">
<div className="-flex -relative"> <div className="-flex -relative">
<div className="split-panel -fit -vertical" id="games_repository_valuation"> <div className="split-panel -fit -vertical" id="games_repository_valuation">

@ -237,6 +237,10 @@ class MainContentContainer extends Component {
// arg_path 点击文件目录树时传入的点击节点对应的path // arg_path 点击文件目录树时传入的点击节点对应的path
fetchRepositoryCode( props, arg_path, type, isRetry) { fetchRepositoryCode( props, arg_path, type, isRetry) {
const { challenge, showSnackbar, game, shixun, myshixun, hide_code } = props ? props : this.props; const { challenge, showSnackbar, game, shixun, myshixun, hide_code } = props ? props : this.props;
if (shixun.vnc == true) {
// vnc模式下不需要加载代码
return true;
}
if ( if (
// true || // true ||
hide_code) { // 隐藏code的实训 hide_code) { // 隐藏code的实训

@ -0,0 +1,154 @@
// import React, { Component } from 'react';
// import RFB from '@novnc/novnc/lib/rfb.js';
// const $ = window.$;
// // const showIframeContent = window.location.search.indexOf('vnc=1') != -1;
// class VNCDisplay extends Component {
// componentDidMount() {
// console.log(RFB)
// let rfb;
// let desktopName;
// // When this function is called we have
// // successfully connected to a server
// function connectedToServer(e) {
// status("Connected to " + desktopName);
// }
// // This function is called when we are disconnected
// function disconnectedFromServer(e) {
// if (e.detail.clean) {
// status("Disconnected");
// } else {
// status("Something went wrong, connection is closed");
// }
// }
// // When this function is called, the server requires
// // credentials to authenticate
// function credentialsAreRequired(e) {
// const password = prompt("Password Required:");
// rfb.sendCredentials({ password: password });
// }
// // When this function is called we have received
// // a desktop name from the server
// function updateDesktopName(e) {
// desktopName = e.detail.name;
// }
// // Since most operating systems will catch Ctrl+Alt+Del
// // before they get a chance to be intercepted by the browser,
// // we provide a way to emulate this key sequence.
// function sendCtrlAltDel() {
// rfb.sendCtrlAltDel();
// return false;
// }
// // Show a status text in the top bar
// function status(text) {
// document.getElementById('status').textContent = text;
// }
// // This function extracts the value of one variable from the
// // query string. If the variable isn't defined in the URL
// // it returns the default value instead.
// function readQueryVariable(name, defaultValue) {
// // A URL with a query parameter can look like this:
// // https://www.example.com?myqueryparam=myvalue
// //
// // Note that we use location.href instead of location.search
// // because Firefox < 53 has a bug w.r.t location.search
// const re = new RegExp('.*[?&]' + name + '=([^&#]*)'),
// match = document.location.href.match(re);
// if (typeof defaultValue === 'undefined') { defaultValue = null; }
// if (match) {
// // We have to decode the URL since want the cleartext value
// return decodeURIComponent(match[1]);
// }
// return defaultValue;
// }
// document.getElementById('sendCtrlAltDelButton')
// .onclick = sendCtrlAltDel;
// // Read parameters specified in the URL query string
// // By default, use the host and port of server that served this file
// // const host = readQueryVariable('host', window.location.hostname);
// // let port = readQueryVariable('port', window.location.port);
// // const password = readQueryVariable('password', '');
// const { vnc_url } = this.props;
// // http://117.50.12.63:43149/vnc_lite.html?password=headless
// let _ar1 = vnc_url.split('/');
// let ipAndPort = _ar1[2].split(':')
// let passwordAr = _ar1[3].split('password=')
// const host = ipAndPort[0]
// let port = ipAndPort[1]
// const password = passwordAr[1].split('&')[0]
// const path = readQueryVariable('path', 'websockify');
// // | | | | | |
// // | | | Connect | | |
// // v v v v v v
// status("Connecting");
// // Build the websocket URL used to connect
// let url;
// if (vnc_url.indexOf("https:") != -1) {
// url = 'wss';
// } else {
// url = 'ws';
// }
// url += '://' + host;
// if(port) {
// url += ':' + port;
// }
// url += '/' + path;
// // Creating a new RFB object will start a new connection
// rfb = new RFB(document.getElementById('screen'), url,
// { credentials: { password: password } });
// // Add listeners to important events from the RFB module
// rfb.addEventListener("connect", connectedToServer);
// rfb.addEventListener("disconnect", disconnectedFromServer);
// rfb.addEventListener("credentialsrequired", credentialsAreRequired);
// rfb.addEventListener("desktopname", updateDesktopName);
// // Set parameters that can be changed on an active connection
// rfb.viewOnly = readQueryVariable('view_only', false);
// rfb.scaleViewport = readQueryVariable('scale', false);
// }
// render() {
// const { challenge, vnc_url } = this.props
// return (
// <div className="">
// <style>{`
// #top_bar {
// background-color: #6e84a3;
// color: white;
// font: bold 12px Helvetica;
// padding: 6px 5px 4px 5px;
// border-bottom: 1px outset;
// }
// #status {
// text-align: center;
// }
// #sendCtrlAltDelButton {
// position: fixed;
// top: 0px;
// right: 0px;
// border: 1px outset;
// padding: 5px 5px 4px 5px;
// cursor: pointer;
// }
// #screen {
// flex: 1; /* fill remaining space */
// overflow: hidden;
// }
// `}</style>
// <div id="top_bar">
// <div id="status">Loading</div>
// <div id="sendCtrlAltDelButton">Send CtrlAltDel</div>
// </div>
// <div id="screen"></div>
// </div>
// );
// }
// }
// export default VNCDisplay;

@ -330,14 +330,15 @@ class NewHeader extends Component {
}) })
} }
educoderlogin=()=>{ educoderlogin=()=>{
//出账号 //退出账号
var url = `/accounts/logout.json`; var url = `/accounts/logout.json`;
axios.get((url)).then((result) => { axios.get((url)).then((result) => {
if(result!==undefined){ if(result!==undefined){
this.setState({ // this.setState({
isRender:true // isRender:true
}) // })
window.location.href = "/";
} }
}).catch((error) => { }).catch((error) => {
console.log(error); console.log(error);

@ -213,6 +213,13 @@ 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 = ()=>{
// this.setState({
// isRenders:true
// })
//
// }
/** /**
课堂权限相关方法暂时写这里了 ----------------------------------------END 课堂权限相关方法暂时写这里了 ----------------------------------------END
@ -281,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}></Trialapplication> {/* <Trialapplication {...this.state} user_phone_binded={user_phone_binded} setTrialapplication = {this.setTrialapplication} ></Trialapplication>*/}
} {/*}*/}
<SiderBar <SiderBar
Headertop={Headertop} Headertop={Headertop}

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

@ -10,8 +10,12 @@ import axios from 'axios';
import './common.css' import './common.css'
const { TabPane } = Tabs; const { TabPane } = Tabs;
const loginInputsyl = { const loginInputsyl = {
"width": " 100%", "width":"434px",
"height": "40px", "height": "462px",
"-webkit-box-shadow": "3px 10px 21px 0px rgba(76,76,76,0.15)",
"box-shadow": "3px 10px 21px 0px rgba(76,76,76,0.15)",
"border-radius": "6px",
"background": "#fff"
} }
//父组件EducoderLogin.js //父组件EducoderLogin.js
@ -135,6 +139,7 @@ class LoginRegisterComponent extends Component {
; ;
StudyMakeMoney = () => { // 调用父组件方法 StudyMakeMoney = () => { // 调用父组件方法
this.props.Setshowbool(); this.props.Setshowbool();
// this.props.Setlogins(3);
this.setState({ this.setState({
login: "", login: "",
password: "", password: "",
@ -356,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:"",
@ -369,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: {
@ -378,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) => {
@ -407,8 +412,8 @@ class LoginRegisterComponent extends Component {
//倒计时 //倒计时
getverificationcode = () => { getverificationcode = () => {
if (this.state.Phonenumberisnotcobool === false) { if (this.state.Phonenumberisnotcobool === false ||this.state.Phonenumberisnotcobool === undefined) {
if (this.state.logins.length === 0) { if (this.state.logins&&this.state.logins.length === 0) {
this.openNotification("请输入手机号或邮箱",2); this.openNotification("请输入手机号或邮箱",2);
return return
}else { }else {
@ -503,6 +508,17 @@ class LoginRegisterComponent extends Component {
this.setState({ this.setState({
tab:e.key tab:e.key
}) })
console.log(e.key);
if(e.key === 0){
this.setState({
Phonenumberisnotcos:undefined
})
}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)
@ -532,7 +548,7 @@ class LoginRegisterComponent extends Component {
// console.log(activeKey); // console.log(activeKey);
return ( return (
<div className="login_register_content"> <div className="login_register_content" style={ parseInt(tab[0])==0?{height: "346px"} :{height: "462px"}}>
<div> <div>
@ -576,63 +592,64 @@ class LoginRegisterComponent extends Component {
<Input placeholder="请输入登录手机号码或邮箱" value={this.state.login} <Input placeholder="请输入登录手机号码或邮箱" value={this.state.login}
onChange={this.loginInputonChange} onChange={this.loginInputonChange}
name="username" name="username"
className="loginInput" className="font-14 color-grey-9 loginInput"
style={{marginTop: '30px'}}></Input> onBlur={(e) => this.inputOnBlur(e, 1)}
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 className="mt15 mb15"></div> : <div style={{height:"25px"}}></div>
} }
<Input type="password" name="password" id="password" className="loginInput" value={this.state.password} <Input type="password" name="password" id="password" value={this.state.password}
onChange={this.passwordonChange} onChange={this.passwordonChange}
className="font-14 color-grey-9 loginInput"
placeholder="密码"></Input> placeholder="密码"></Input>
<div className="left_right mt20"> <div className="left_right mt25 font-12 " style={{color: '#676767'}}>
<Checkbox onChange={this.onAutoLoginChange} checked={autoLogin}>下次自动登录</Checkbox> <Checkbox onChange={this.onAutoLoginChange} checked={autoLogin}>下次自动登录</Checkbox>
<a <a onClick={this.StudyMakeMoney}
onClick={this.StudyMakeMoney} className="mr3 color-grey-9 mt3 font-12">找回密码</a>
className="mr3 color-grey-9">找回密码</a>
</div> </div>
<Button className="login_btn" type="primary" onClick={() => this.postLogin()} <Button className="login_btn font-16" type="primary" style={{height:"46px"}} onClick={() => this.postLogin()}
size={"large"}>登录</Button> size={"large"}>登录</Button>
</div> </div>
} }
{ {
parseInt(tab[0])==1 && parseInt(tab[0])==1 &&
<div style={{width: '340px'}}> <div style={{width: '340px'}}>
<Input className={loginInputsyl+" loginInput"} placeholder="请使用手机号/邮箱账号进行注册" <Input className="loginInputsyl color-grey-9 loginInput" placeholder="请使用手机号/邮箱账号进行注册"
value={this.state.logins} value={this.state.logins}
type="text" autoComplete="off" type="text" autoComplete="off"
onChange={this.loginInputonChanges} onChange={this.loginInputonChanges}
onBlur={(e) => this.inputOnBlur(e, 2)} onBlur={(e) => this.inputOnBlur(e, 2)}
style={{marginTop: '30px'}}></Input> style={{marginTop: '30px' , height: '38px',color:'#999999',fontSize:"14px"}}></Input>
{ {
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" style={{textAlign:"center",width: " 100%"}}>{Phonenumberisnotcos}</span>
<span className="fl">{Phonenumberisnotcos}</span>
</p> </p>
: <div className=" mt15 mb15"></div> : <div style={{height:"25px"}}></div>
} }
<DragValidator <DragValidator
height={38} className="loginInput" successGreenColor="#45E15F" height={38} className="loginInput" successGreenColor="#45E15F"
style={{ height: '38px'}}
dragOkCallback={this.dragOkCallback} dragOkCallback={this.dragOkCallback}
></DragValidator> ></DragValidator>
<div> <div className="mt25">
<Input className="fl mr5" name="codes" type="text" autoComplete="off" readonly <Input className="fl mr5 font-14 color-grey-9" name="codes" type="text" autoComplete="off" readonly
onfocus="this.removeAttribute('readonly')" style={{ onfocus="this.removeAttribute('readonly')" style={{
"width": "210px", width:'210px',
"margin-bottom": "16px", height:'38px',
"height": "38px",
}} placeholder="请输入验证码" }} placeholder="请输入验证码"
onChange={this.codesonChange} onChange={this.codesonChange}
value={codes} value={codes}
@ -640,13 +657,13 @@ class LoginRegisterComponent extends Component {
</Input> </Input>
{ {
getverificationcodes === undefined ? getverificationcodes === undefined ?
<Button className="fl ml5 " disabled style={{"width": "120px","text-align":"center", "height": "38px",}} <Button className="fl ml5 font-14" disabled style={{"width": "120px","text-align":"center", "height": "38px",}}
size={"large"}>重新发送{seconds}s</Button> size={"large"}>重新发送{seconds}s</Button>
: getverificationcodes === true ? : getverificationcodes === true ?
<Button className="fl ml5 " 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": "38px",}}
onClick={() => this.getverificationcode()} size={"large"}>验证码</Button> onClick={() => this.getverificationcode()} size={"large"}>获取验证码</Button>
: :
<Button className="fl ml5 " 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": "38px",}}
onClick={() => this.getverificationcode()} size={"large"}>重新发送</Button> onClick={() => this.getverificationcode()} size={"large"}>重新发送</Button>
} }
@ -656,8 +673,9 @@ class LoginRegisterComponent extends Component {
{/* style={{height: '0', width: '0', border: 'none', display: "none"}}/>*/} {/* style={{height: '0', width: '0', border: 'none', display: "none"}}/>*/}
{/*<Input type="password" name="password" id="password" autoComplete="new-password"*/} {/*<Input type="password" name="password" id="password" autoComplete="new-password"*/}
{/* style={{height: '0', width: '0', border: 'none', display: "none"}}/>*/} {/* style={{height: '0', width: '0', border: 'none', display: "none"}}/>*/}
<Input className="loginInput" placeholder="输入8~16位密码区分大小写" <Input className="loginInput font-14 mt25 color-grey-9" placeholder="输入8~16位密码区分大小写"
type={classpass} type={classpass}
autoComplete="new-password" autoComplete="new-password"
onClick={this.changeType} onClick={this.changeType}
value={this.state.passwords} onChange={this.passwordonChanges} suffix={ value={this.state.passwords} onChange={this.passwordonChanges} suffix={
@ -666,9 +684,11 @@ class LoginRegisterComponent extends Component {
}></Input> }></Input>
<Checkbox onChange={this.onChange} <Checkbox onChange={this.onChange}
value={Agreetotheterms} value={Agreetotheterms}
>我已阅读并同意服务协议条款</Checkbox> ><span className="font-14 " style={{
<Button className="login_btn" type="primary" onClick={() => this.postregistered()} color: '#676767',
size={"large"}>完成</Button> }}>我已阅读并同意服务协议条款</span></Checkbox>
<Button className="login_btn font-16" type="primary" style={{height:"46px"}} onClick={() => this.postregistered()}
size={"large"}>注册</Button>
</div> </div>

@ -130,14 +130,15 @@ class Infos extends Component{
let url=`/users/attendance.json` let url=`/users/attendance.json`
axios.post(url).then((result)=>{ axios.post(url).then((result)=>{
if(result){ if(result){
this.setState( // this.setState(
(prevState) => ({ // (prevState) => ({
data : update(prevState.data, {attendance_signed: {$set: true} }) // data : update(prevState.data, {attendance_signed: {$set: true} })
}) // })
) // )
this.setState({ // this.setState({
next_gold:result.data.next_gold // next_gold:result.data.next_gold
}) // })
this.getInfo(this.props.match.params.username);
} }
}).catch((error)=>{ }).catch((error)=>{
console.log(error); console.log(error);
@ -245,6 +246,9 @@ class Infos extends Component{
</div> </div>
<div className="educontent mt10 clearfix edu-txt-center"> <div className="educontent mt10 clearfix edu-txt-center">
<div className="inline"> <div className="inline">
{
data && is_current == false && data.identity =="学生" ?"" : <span className="mypost fl mr10">{data && data.identity}</span>
}
<span className="mypost fl mr10">{data && data.identity}</span> <span className="mypost fl mr10">{data && data.identity}</span>
<a href={is_current ? `${this.props.Headertop && this.props.Headertop.old_url}/account/authentication` :"javascript:void(0)"} target="_blank" className={is_current ? "ringauto fl" :"ringauto fl cdefault"}> <a href={is_current ? `${this.props.Headertop && this.props.Headertop.old_url}/account/authentication` :"javascript:void(0)"} target="_blank" className={is_current ? "ringauto fl" :"ringauto fl cdefault"}>
<Tooltip placement='bottom' title={ data && data.authentication ?"已实名认证":"未实名认证"}> <Tooltip placement='bottom' title={ data && data.authentication ?"已实名认证":"未实名认证"}>
@ -314,7 +318,7 @@ class Infos extends Component{
</div> </div>
<div className="edu-txt-center navInfo"> <div className="edu-txt-center navInfo">
<div className="inline"> <div className="inline">
<li className={`${moduleName == 'courses' ? 'active' : '' }`}> <li className={`${moduleName == 'courses' ||moduleName == undefined ? 'active' : '' }`}>
<Link <Link
onClick={() => this.setState({moduleName: 'courses'})} onClick={() => this.setState({moduleName: 'courses'})}
to={`/users/${username}/courses`}>课堂</Link> to={`/users/${username}/courses`}>课堂</Link>
@ -348,7 +352,7 @@ class Infos extends Component{
{/* 课堂 */} {/* 课堂 */}
{/* http://localhost:3007/courses/1309/homework/9300/setting */} {/* http://localhost:3007/courses/1309/homework/9300/setting */}
<Route exact path="/users/:username/courses" <Route exact path="/users/:username/courses"
render={ render={
(props) => (<InfosCourse {...this.props} {...props} {...this.state} />) (props) => (<InfosCourse {...this.props} {...props} {...this.state} />)
} }
@ -374,6 +378,11 @@ class Infos extends Component{
(props) => (<InfosProject {...this.props} {...props} {...this.state} />) (props) => (<InfosProject {...this.props} {...props} {...this.state} />)
} }
></Route> ></Route>
<Route exact path="/users/:username"
render={
(props) => (<InfosCourse {...this.props} {...props} {...this.state} />)
}
></Route>
</Switch> </Switch>
</div> </div>

Loading…
Cancel
Save