Merge branch 'dev_aliyun' of http://bdgit.educoder.net/Hjqreturn/educoder into dev_aliyun

dev_cs
cxt 5 years ago
commit f3ff3841de

@ -527,14 +527,14 @@ class CoursesIndex extends Component{
></Route> ></Route>
{/* 新建作品 */} {/* 新建作品 */}
<Route path="/courses/:coursesId/graduation_tasks/:category_id/:task_Id/works/new" <Route path="/courses/:coursesId/graduation_tasks/:category_id/works/:task_Id/new"
render={ render={
(props) => (<GraduationTasksSubmitnewApp {...this.props} {...props} {...this.state} {...common}/>) (props) => (<GraduationTasksSubmitnewApp {...this.props} {...props} {...this.state} {...common}/>)
} }
></Route> ></Route>
{/* 修改作品 */} {/* 修改作品 */}
<Route path="/courses/:coursesId/graduation_tasks/:category_id/:work_Id/works/edit" <Route path="/courses/:coursesId/graduation_tasks/:category_id/works/:work_Id/edit"
render={ render={
(props) => (<GraduationTasksSubmiteditApp {...this.props} {...props} {...this.state} {...common}/>) (props) => (<GraduationTasksSubmiteditApp {...this.props} {...props} {...this.state} {...common}/>)
} }

@ -131,7 +131,6 @@ class CommonWorkPost extends Component{
let coursesId=this.props.match.params.coursesId; let coursesId=this.props.match.params.coursesId;
window.location.href="courses/"+coursesId+"/graduation_tasks/"+workId+"/appraise"; window.location.href="courses/"+coursesId+"/graduation_tasks/"+workId+"/appraise";
// window.location.href="/courses/"+coursesId+"/graduation/graduation_tasks/"+workId+"/"+workId+"/works/edit";
} }
handleSubmit=(e) => { handleSubmit=(e) => {

@ -302,7 +302,7 @@ class GraduateTaskItem extends Component{
{item==="提交作品"? {item==="提交作品"?
<WordsBtn style="blue" className="colorblue font-16 ml20 fr mt12"> <WordsBtn style="blue" className="colorblue font-16 ml20 fr mt12">
<a className="btn colorblue" href={"/courses/"+this.props.coursesId+"/graduation_tasks/"+this.props.categoryid+"/"+this.props.taskid+"/works/new"}>提交作品</a> <a className="btn colorblue" href={"/courses/"+this.props.coursesId+"/graduation_tasks/"+this.props.categoryid+"/works"+"/"+this.props.taskid+"/new"}>提交作品</a>
</WordsBtn> </WordsBtn>
:""} :""}
@ -310,7 +310,7 @@ class GraduateTaskItem extends Component{
{item==="补交作品"? {item==="补交作品"?
<WordsBtn style="blue" className="colorblue font-16 ml20 fr mt12"> <WordsBtn style="blue" className="colorblue font-16 ml20 fr mt12">
<a className="btn colorblue" href={"/courses/"+this.props.coursesId+"/graduation_tasks/"+this.props.categoryid+"/"+this.props.taskid+"/works/new"}>补交作品</a> <a className="btn colorblue" href={"/courses/"+this.props.coursesId+"/graduation_tasks/"+this.props.categoryid+"/works"+"/"+this.props.taskid+"/new"}>补交作品</a>
</WordsBtn> </WordsBtn>
:""} :""}
@ -318,7 +318,7 @@ class GraduateTaskItem extends Component{
{item==="修改作品"? {item==="修改作品"?
<WordsBtn style="blue" className="font-16 colorblue ml20 fr mt12"> <WordsBtn style="blue" className="font-16 colorblue ml20 fr mt12">
<a className="btn colorblue" href={"/courses/"+this.props.coursesId+"/graduation_tasks/"+this.props.categoryid+"/"+this.props.workid+"/works/edit"}>修改作品</a> <a className="btn colorblue" href={"/courses/"+this.props.coursesId+"/graduation_tasks/"+this.props.categoryid+"/works"+"/"+this.props.workid+"/edit"}>修改作品</a>
</WordsBtn> </WordsBtn>
:""} :""}

@ -168,8 +168,29 @@ class GraduationTaskDetail extends Component{
typs:"end", typs:"end",
}) })
} }
coursetaskend=()=>{
const coursesId = this.props.match.params.coursesId;
const task_Id = this.props.match.params.task_Id;
let url = `/courses/${coursesId}/graduation_tasks/end_task.json`;
axios.post(url,{
task_ids:[task_Id],
group_ids: this.state.course_groupslist,
}).then((response)=>{
if (response.data.status == 0) {
this.props.showNotification(response.data.message);
this.cancelmodel();
this.getdatas();
this.child && this.child.reInit();
}
}).catch((error)=>{
})
}
// 取消 // 取消
cancelmodel=()=>{ cancelmodel=()=>{
debugger
this.setState({ this.setState({
Modalstype:false, Modalstype:false,
Loadtype:false, Loadtype:false,
@ -256,6 +277,7 @@ class GraduationTaskDetail extends Component{
}) })
} }
bindRef = ref => { this.child = ref } ; bindRef = ref => { this.child = ref } ;
render(){ render(){
@ -391,21 +413,21 @@ class GraduationTaskDetail extends Component{
{this.props.isAdmin()? <li className="li_line drop_down fr color-blue font-16 mt20" style={{"paddingLeft":"0px"}}> {this.props.isAdmin()? <li className="li_line drop_down fr color-blue font-16 mt20" style={{"paddingLeft":"0px"}}>
导出<i className="iconfont icon-xiajiantou font-12 ml2"></i> 导出<i className="iconfont icon-xiajiantou font-12 ml2"></i>
<ul className="drop_down_menu" style={{"right":"-34px","left":"unset","height":"auto"}}> <ul className="drop_down_menu" style={{"right":"-34px","left":"unset","height":"auto"}}>
<li><a onClick={()=>this.confirmysl("/graduation_tasks/"+task_Id+"/tasks_list.xlsx")} className="color-dark">导出成绩</a></li> <li><a onClick={()=>this.child.confirmysl("/graduation_tasks/"+task_Id+"/tasks_list.xlsx")} className="color-dark">导出成绩</a></li>
<li><a onClick={()=>this.confirmysl("/graduation_tasks/"+task_Id+"/tasks_list.zip")} className="color-dark">导出作品附件</a></li> <li><a onClick={()=>this.child.confirmysl("/graduation_tasks/"+task_Id+"/tasks_list.zip")} className="color-dark">导出作品附件</a></li>
</ul> </ul>
</li>:""} </li>:""}
{questionslist.work_status===undefined||questionslist.work_status===null||questionslist.work_status.length===0?"":questionslist.work_status.map((item,key)=>{ {questionslist.work_status===undefined||questionslist.work_status===null||questionslist.work_status.length===0?"":questionslist.work_status.map((item,key)=>{
return( return(
<span key={key}> <span key={key} className="fr mt20">
{item==="提交作品"?<a className={"fr color-blue font-16"} href={"/courses/"+courseId+"/graduation_tasks/"+category_id+"/"+task_Id+"/works/new"}>提交作品</a>:""} {item==="提交作品"?<a className={"fr color-blue font-16 ml20"} href={"/courses/"+courseId+"/graduation_tasks/"+category_id+"/"+task_Id+"/works/new"}>提交作品</a>:""}
{item==="补交作品"?<a className={"fr color-blue font-16"} href={"/courses/"+courseId+"/graduation_tasks/"+category_id+"/"+task_Id+"/works/new"}>补交作品</a>:""} {item==="补交作品"?<a className={"fr color-blue font-16 ml20"} href={"/courses/"+courseId+"/graduation_tasks/"+category_id+"/"+task_Id+"/works/new"}>补交作品</a>:""}
{item==="修改作品"?<a className={"fr color-blue font-16"} href={"/courses/"+courseId+"/graduation_tasks/"+category_id+"/"+questionslist.work_id+"/works/edit"}>修改作品</a>:""} {item==="修改作品"?<a className={"fr color-blue font-16 ml20"} href={"/courses/"+courseId+"/graduation_tasks/"+category_id+"/works"+"/"+ questionslist.work_id + "/edit"}>修改作品</a>:""}
{item==="查看作品"?<a className={"fr color-blue font-16"} href={"/courses/"+courseId+"/graduation_tasks/"+category_id+"/"+questionslist.work_id+"/works/edit"}>查看作品</a> :""} {item==="查看作品"?<a className={"fr color-blue font-16 ml20"} href={"/courses/"+courseId+"/graduation_tasks/"+category_id+"/works"+"/"+ questionslist.work_id + "/edit"}>查看作品</a> :""}
{item==="创建项目"?<a className={"fr color-blue font-16"} href={'/projects/new'} target="_blank">创建项目</a>:""} {item==="创建项目"?<a className={"fr color-blue font-16 ml20"} href={'/projects/new'} target="_blank">创建项目</a>:""}
{item==="关联项目"?<a className={"fr color-blue font-16"} onClick={this.AssociationItems}>关联项目</a>:""} {item==="关联项目"?<a className={"fr color-blue font-16 ml20"} onClick={this.AssociationItems}>关联项目</a>:""}
{item==="取消关联"?<a className={"fr color-blue font-16"} onClick={this.cannelAssociation}>取消关联</a>:""} {item==="取消关联"?<a className={"fr color-blue font-16 ml20"} onClick={this.cannelAssociation}>取消关联</a>:""}
{item==="补交附件"?<a className={"fr color-blue font-16"} onClick={this.handaccessory}>补交附件</a>:""} {item==="补交附件"?<a className={"fr color-blue font-16 ml20"} onClick={this.handaccessory}>补交附件</a>:""}
</span> </span>
) )
@ -428,13 +450,13 @@ class GraduationTaskDetail extends Component{
<Route exact path="/courses/:coursesId/graduation_tasks/:category_id/detail/:task_Id/setting" <Route exact path="/courses/:coursesId/graduation_tasks/:category_id/detail/:task_Id/setting"
render={ render={
(props) => (<GraduationTaskssetting {...this.props} {...props} {...this.state} {...commom} tab={`setting`}/>) (props) => (<GraduationTaskssetting {...this.props} {...props} {...this.state} {...commom} triggerRef={this.bindRef} tab={`setting`}/>)
} }
></Route> ></Route>
<Route exact path="/courses/:coursesId/graduation_tasks/:category_id/detail/:task_Id/questions" <Route exact path="/courses/:coursesId/graduation_tasks/:category_id/detail/:task_Id/questions"
render={ render={
(props) => (<GraduationTasksquestions {...this.props} {...props} {...this.state} {...commom} tab={`questions`}/>) (props) => (<GraduationTasksquestions {...this.props} {...props} {...this.state} {...commom} triggerRef={this.bindRef} tab={`questions`}/>)
}></Route> }></Route>
</Switch> </Switch>

@ -496,7 +496,8 @@ class GraduationTasksSubmitedit extends Component{
Modalstype,Modalstopval,ModalCancel,ModalSave,memberslist,task_status,selectmemberslist,shixunsreplace} =this.state; Modalstype,Modalstopval,ModalCancel,ModalSave,memberslist,task_status,selectmemberslist,shixunsreplace} =this.state;
let courseId=this.props.match.params.coursesId; let courseId=this.props.match.params.coursesId;
let category_id=this.props.match.params.category_id; let task_Id=this.props.match.params.coursesId;
// let category_id=this.props.match.params.category_id;
let work_Id=this.props.match.params.work_Id let work_Id=this.props.match.params.work_Id
const uploadProps = { const uploadProps = {
width: 600, width: 600,
@ -570,7 +571,7 @@ class GraduationTasksSubmitedit extends Component{
{/*<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"> <a onClick={this.goback} className="color-grey-6">毕设任务</a></WordsBtn> <WordsBtn style="grey" className="fl"> <a onClick={this.goback} className="color-grey-6">毕设任务</a></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/"+category_id+"/detail/"+work_Id+"/list"} className="color-grey-6">任务详情</Link></WordsBtn> <WordsBtn style="grey" className="fl"> <Link to={`/courses/${courseId}/graduation_tasks/${workslist && workslist.graduation_id}/detail/${workslist && workslist.task_id}/list`} className="color-grey-6">任务详情</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">*/} {/*<WordsBtn style="grey" className="fl">*/}
{/*<Link to={"/courses/"+courseId+"/graduation/graduation_tasks/"+category_id} className="color-grey-6">{workslist&&workslist.task_name}</Link>*/} {/*<Link to={"/courses/"+courseId+"/graduation/graduation_tasks/"+category_id} className="color-grey-6">{workslist&&workslist.task_name}</Link>*/}
@ -768,7 +769,7 @@ class GraduationTasksSubmitedit extends Component{
<div className={"fl ml5 fonthidden width100"} style={{width: '70px'}} title={item.user_name}>{item.user_name}</div> <div className={"fl ml5 fonthidden width100"} style={{width: '70px'}} title={item.user_name}>{item.user_name}</div>
<div className={"fl ml5 fonthidden width100 color-grey-9"}>{item.group_name}</div> <div className={"fl ml5 fonthidden width100 color-grey-9"}>{item.group_name}</div>
<div className={"fl ml5 color-grey-9 fonthidden width100"}>{item.student_id}</div> <div className={"fl ml5 color-grey-9 fonthidden width100"}>{item.student_id}</div>
<div className={"fl ml20"}>{item.commit_status===false?<span className={"color-orange"}>已提交</span> :""}</div> <div className={"fl ml20"}>{item.commit_status===true?<span className={"color-orange"}>已提交</span> :""}</div>
</div> </div>
) )
})} })}

@ -81,7 +81,6 @@ class GraduationTasksSubmitnew extends Component{
let coursesId=this.props.match.params.coursesId; let coursesId=this.props.match.params.coursesId;
window.location.href="/courses/"+coursesId+"/graduation_tasks/"+workId+"/appraise"; window.location.href="/courses/"+coursesId+"/graduation_tasks/"+workId+"/appraise";
// window.location.href="/courses/"+coursesId+"/graduation/graduation_tasks/"+task_Id+"/"+workId+"/works/edit";
} }
handleSubmit=(e) => { handleSubmit=(e) => {

@ -83,6 +83,10 @@ class GraduationTaskssettingapp extends Component{
} }
} }
reInit=()=>{
this.getsettings();
}
getsettings=()=>{ getsettings=()=>{
let task_Id=this.props.match.params.task_Id; let task_Id=this.props.match.params.task_Id;
@ -155,8 +159,12 @@ class GraduationTaskssettingapp extends Component{
let tab = this.props.tab; let tab = this.props.tab;
this.props.setTab && this.props.setTab(tab); this.props.setTab && this.props.setTab(tab);
try{
this.props.triggerRef(this)
}catch(e){
} }
}
baseprojectfun=(e)=>{ baseprojectfun=(e)=>{
@ -846,6 +854,8 @@ class GraduationTaskssettingapp extends Component{
} }
/// 确认是否下载 /// 确认是否下载
confirmysl(url){ confirmysl(url){
debugger;
console.log(3);
axios.get(url + '?export=true' ).then((response) => { axios.get(url + '?export=true' ).then((response) => {
if(response === undefined){ if(response === undefined){
return return

@ -81,6 +81,15 @@ class GraduationTaskssettinglist extends Component{
this.props.history.replace(`/courses/${this.state.taskslistdata.course_id}/graduation_tasks/${this.state.taskslistdata.graduation_id}`); this.props.history.replace(`/courses/${this.state.taskslistdata.course_id}/graduation_tasks/${this.state.taskslistdata.graduation_id}`);
} }
reInit=()=>{
this.setState({
course_groupslist:[],
checkAllValue:false
})
let {teacher_comment, task_status, course_group, cross_comment, order, b_order, search} = this.state;
this.seacthdata(teacher_comment, task_status, course_group, cross_comment, order, b_order, search,this.state.page);
}
seacthdata=(teacher_comment,task_status,course_group,cross_comment,order,b_order,search,pages)=>{ seacthdata=(teacher_comment,task_status,course_group,cross_comment,order,b_order,search,pages)=>{
let{page,limit}=this.state; let{page,limit}=this.state;
// console.log(teacher_comment,task_status,course_group,cross_comment,order,b_order,search) // console.log(teacher_comment,task_status,course_group,cross_comment,order,b_order,search)
@ -97,7 +106,7 @@ class GraduationTaskssettinglist extends Component{
order:order===null?undefined:order, order:order===null?undefined:order,
b_order:b_order===null?undefined:b_order, b_order:b_order===null?undefined:b_order,
search:search===null?undefined:search, search:search===null?undefined:search,
page:pages===null?undefined:pages, page:pages===null?undefined:page,
limit:20, limit:20,
}, },
paramsSerializer: function(params) { paramsSerializer: function(params) {
@ -646,6 +655,8 @@ class GraduationTaskssettinglist extends Component{
/// 确认是否下载 /// 确认是否下载
confirmysl(url){ confirmysl(url){
debugger;
console.log(1);
let {teacher_comment, task_status, course_group, cross_comment, order, b_order, search,page} =this.state; let {teacher_comment, task_status, course_group, cross_comment, order, b_order, search,page} =this.state;
let params ={ let params ={

@ -35,8 +35,18 @@ class GraduationTasksquestions extends Component{
let tab = this.props.tab; let tab = this.props.tab;
this.props.setTab && this.props.setTab(tab); this.props.setTab && this.props.setTab(tab);
this.getdatas() this.getdatas();
try{
this.props.triggerRef(this)
}catch(e){
}
}
reInit=()=>{
this.getdatas();
} }
getdatas=()=>{ getdatas=()=>{
const task_Id = this.props.match.params.task_Id; const task_Id = this.props.match.params.task_Id;
let url="/graduation_tasks/"+task_Id+".json"; let url="/graduation_tasks/"+task_Id+".json";
@ -46,7 +56,6 @@ class GraduationTasksquestions extends Component{
this.setState({ this.setState({
questionslist:result.data questionslist:result.data
}) })
} }
}).catch((error)=>{ }).catch((error)=>{
console.log(error) console.log(error)
@ -204,6 +213,8 @@ class GraduationTasksquestions extends Component{
/// 确认是否下载 /// 确认是否下载
confirmysl(url){ confirmysl(url){
debugger;
console.log(2);
axios.get(url + '?export=true').then((response) => { axios.get(url + '?export=true').then((response) => {
if(response === undefined){ if(response === undefined){
return return
@ -299,82 +310,6 @@ class GraduationTasksquestions extends Component{
/> />
{questionslist&&questionslist?<div className="newMain clearfix"> {questionslist&&questionslist?<div className="newMain clearfix">
<div className={"educontent mb20"}> <div className={"educontent mb20"}>
{/* <p className="clearfix mt10">
<a onClick={this.goback} className="color-grey-9 fl">{questionslist.course_name}</a>
<span className="color-grey-9 fl ml3 mr3">&gt;</span>
<Link to={"/courses/"+courseId+"/graduation_tasks/"+questionslist.graduation_id} className="color-grey-9 fl">{questionslist.graduation_name}</Link>
<span className="color-grey-9 fl ml3 mr3">&gt;</span>
<span className="color-grey-6">任务详情</span>
</p>
<div className="clearfix mt20 mb20 lineh-25 linbox">
<p className=" fl color-black summaryname">
<Link to={"/courses/"+courseId+"/graduation_tasks/"+category_id} className="color-grey-3">{questionslist.task_name}</Link>
</p>
<CoursesListType
typelist={questionslist.task_status}
/>
<a className="color-grey-3 fr font-16 ml30 mr20" onClick={this.goback}>返回</a>
</div> */}
{/* <div className="stud-class-set bor-bottom-greyE">
<div className="mt10 clearfix edu-back-white poll_list pl20"> */}
{/* <Link to={"/courses/"+courseId+"/graduation_tasks/"+category_id+"/"+task_Id+"/list"}></Link>
<Link className="active" to={"/courses/"+courseId+"/graduation_tasks/"+category_id+"/"+task_Id+"/questions"}>毕设描述</Link>
<Link style={{paddingLeft:'38px'}}
to={"/courses/"+courseId+"/graduation_tasks/"+category_id+"/"+task_Id+"/setting?tab=3"}>设置</Link> */}
{/*<a className={"fr color-blue font-16"}>导出成绩</a>*/}
{/*{this.props.isAdmin()?<a href={"/api/graduation_tasks/"+task_Id+"/tasks_list.xls"} className={"fr color-blue font-16"}>导出成绩</a>:""}*/}
{/*{this.props.isAdmin()?<a href={"/api/graduation_tasks/"+task_Id+"/tasks_list.zip"} className={"fr color-blue font-16"}>导出作品附件</a>:""}*/}
{/* <style>
{ `
.drop_down_menu{
height: 118px;
left:0px;
width: 121px;
}
.drop_down_menu li {
overflow: visible;
width: 121px;
}
.drop_down_menu li a{
padding: 0px;
font-size: 14px;
}
.mt19{
margin-top:19px;
}
.drop_down_menu, .drop_down_normal{
padding-top: 10px;
padding-bottom: 8px;
}
.drop_down_menu li .color-dark{
color: #666 !important;
}
`}
</style>
{this.props.isAdmin()? <li className="li_line drop_down fr color-blue font-16 mr20 mt20" style={{"paddingLeft":"0px"}}>
导出<i className="iconfont icon-xiajiantou font-12 ml2"></i>
<ul className="drop_down_menu" style={{"right":"-34px","left":"unset","height":"auto"}}>
<li><a onClick={()=>this.confirmysl("/graduation_tasks/"+task_Id+"/tasks_list.xlsx")} className="color-dark">导出成绩</a></li>
<li><a onClick={()=>this.confirmysl("/graduation_tasks/"+task_Id+"/tasks_list.zip")} className="color-dark">导出作品附件</a></li>
</ul>
</li>:""} */}
{/*<a className={"fr color-blue font-16"}>项目在线质量检测</a>*/}
{/* {this.props.isAdmin()?questionslist.status===1? <a className={"fr color-blue font-16 mr20"} onClick={() => { this.end()} }></a>:"":""}
{this.props.isAdmin()?questionslist.status===0? <a className={"fr color-blue font-16 mr20"} onClick={() => { this.publish()} }>立即发布</a>:"":""}
{this.props.isAdmin()?<a className={"fr color-blue font-16"} href={"/courses/"+courseId+"/graduation_tasks/"+task_Id+"/edit"}>编辑任务</a>:""}
</div>
</div> */}
<div className="justify break_full_word new_li markdown-body edu-back-white" <div className="justify break_full_word new_li markdown-body edu-back-white"
id="challenge_editorMd_description"> id="challenge_editorMd_description">
<p id="ReactMarkdown"> <p id="ReactMarkdown">
@ -390,22 +325,6 @@ class GraduationTasksquestions extends Component{
} }
<div> <div>
{/*{questionslist&&questionslist.attachments.map((item,key)=>{*/}
{/*return(*/}
{/*<div className="color-grey mt5">*/}
{/*<a className="color-grey">*/}
{/*<i className="font-14 color-green iconfont icon-fujian mr8" aria-hidden="true"></i>*/}
{/*</a>*/}
{/*<a href={item.url}*/}
{/*className="mr12" length="58">*/}
{/*{item.title}*/}
{/*</a>*/}
{/*<span className="color-grey mt2 color-grey-6 font-12">{item.filesize}</span>*/}
{/*</div>*/}
{/*)*/}
{/*})}*/}
<AttachmentList {...this.props} {...this.state} attachments={questionslist&&questionslist.attachments}></AttachmentList> <AttachmentList {...this.props} {...this.state} attachments={questionslist&&questionslist.attachments}></AttachmentList>
</div> </div>

@ -109,6 +109,11 @@ class AddTeacherModal extends Component{
checkBoxValues: [] checkBoxValues: []
}) })
} }
this.setState({
name:undefined,
graduationGroup:undefined,
courseGroup:undefined
})
} }
onSendOk = () => { onSendOk = () => {
@ -281,7 +286,7 @@ class AddTeacherModal extends Component{
{ candidates && candidates.map( candidate => { { candidates && candidates.map( candidate => {
return ( return (
<p className="clearfix mb7" key={candidate.id}> <p className="clearfix mb7" key={candidate.id}>
<Checkbox className="fl" value={candidate.id} key={candidate.id}></Checkbox> <Checkbox className="fl" value={candidate.id} key={candidate.id} disabled={candidate.added}></Checkbox>
<span className="fl with25"> <span className="fl with25">
{/* "color":"#4c4c4c" */} {/* "color":"#4c4c4c" */}
<ConditionToolTip title={candidate.name} condition={candidate.name && candidate.name.length > 12 }> <ConditionToolTip title={candidate.name} condition={candidate.name && candidate.name.length > 12 }>
@ -299,7 +304,7 @@ class AddTeacherModal extends Component{
</ConditionToolTip> </ConditionToolTip>
</span> </span>
<span className="fl with35"><label className="task-hide fl" style={{"maxWidth":"208px;"}}>{candidate.school_name}</label></span> <span className="fl with35"><label className="task-hide fl" style={{"maxWidth":"208px;"}}>{candidate.school_name}</label></span>
<span className="fl with10"><label className="task-hide fl" style={{"maxWidth":"48px;"}}>{candidate.added ? '已加入' : ''}</label></span> <span className="fl with10"><label className="task-hide fl color-blue" style={{"maxWidth":"48px;"}}>{candidate.added ? '已加入' : ''}</label></span>
</p> </p>
) )

@ -7,7 +7,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 { WordsBtn, trigger, on, off, getUrl, downloadFile } from 'educoder' import { WordsBtn, trigger, on, off, getUrl, downloadFile , sortDirections } from 'educoder'
import Modals from "../../modals/Modals"; import Modals from "../../modals/Modals";
import axios from 'axios' import axios from 'axios'
import _ from 'lodash' import _ from 'lodash'
@ -17,8 +17,9 @@ import CreateGroupByImportModal from './modal/CreateGroupByImportModal'
const Search =Input.Search; const Search =Input.Search;
const buildColumns = (that) => { const buildColumns = (that,isParent) => {
const { course_groups } = that.state const { course_groups , sortedInfo } = that.state
let showSorter = isParent==true
const columns=[{ const columns=[{
title: '序号', title: '序号',
dataIndex: 'id', dataIndex: 'id',
@ -59,6 +60,9 @@ const buildColumns = (that) => {
align:'center', align:'center',
width:"10%", width:"10%",
className:"color-grey-6", className:"color-grey-6",
sorter: true,
sortDirections: sortDirections,
sortOrder: sortedInfo.columnKey === 'student_id' && sortedInfo.order,
render: (student_id, record) => { render: (student_id, record) => {
return <span className="color-dark overflowHidden1 " title={student_id && student_id.length > 10 ? student_id : ''} return <span className="color-dark overflowHidden1 " title={student_id && student_id.length > 10 ? student_id : ''}
style={{maxWidth: '160px'}} >{student_id}</span> style={{maxWidth: '160px'}} >{student_id}</span>
@ -71,7 +75,10 @@ const buildColumns = (that) => {
key: 'course_group_name', key: 'course_group_name',
align:'center', align:'center',
width:"40%", width:"40%",
className:"color-grey-6" className:"color-grey-6",
sorter:showSorter,
sortDirections: sortDirections,
sortOrder: sortedInfo.columnKey === 'course_group_name' && sortedInfo.order,
}) })
} }
const isAdminOrStudent = that.props.isAdminOrStudent() const isAdminOrStudent = that.props.isAdminOrStudent()
@ -124,6 +131,7 @@ class studentsList extends Component{
isSpin:false, isSpin:false,
DownloadType:false, DownloadType:false,
DownloadMessageval:undefined, DownloadMessageval:undefined,
sortedInfo: {order:'ascend',columnKey: 'student_id'}
} }
} }
/// 确认是否下载 /// 确认是否下载
@ -319,8 +327,19 @@ class studentsList extends Component{
this.setState({ page: argPage }) this.setState({ page: argPage })
} }
let page = argPage || this.state.page let page = argPage || this.state.page
let { order, searchValue }=this.state let { searchValue , sortedInfo }=this.state
let url=`/courses/${id}/students.json?order=${order}&page=${page}&limit=20&course_group_id=${course_group_id}`; let order = 1;
if (sortedInfo.columnKey == 'student_id') {
order = 1;
} else if (sortedInfo.columnKey == 'course_group_name') {
order = 2;
}
let sort = 'desc';
if (sortedInfo.order == 'ascend') {
sort = 'asc'
}
let url=`/courses/${id}/students.json?order=${order}&sort=${sort}&page=${page}&limit=20&course_group_id=${course_group_id}`;
if(!!searchValue){ if(!!searchValue){
url+='&search='+searchValue; url+='&search='+searchValue;
} }
@ -494,6 +513,15 @@ class studentsList extends Component{
this.props.showNotification('复制成功') this.props.showNotification('复制成功')
} }
onTableChange = (pagination, filters, sorter) =>{
this.setState({
sortedInfo: sorter,
}, () => {
this.fetchAll();
});
}
render(){ render(){
const isAdmin = this.props.isAdmin() const isAdmin = this.props.isAdmin()
const isSuperAdmin = this.props.isSuperAdmin() const isSuperAdmin = this.props.isSuperAdmin()
@ -653,7 +681,7 @@ class studentsList extends Component{
{isAdmin && <Checkbox className="fl" onChange={this.onCheckAll} checked={checkAllValue} >已选 {checkBoxValues.length} </Checkbox>} {isAdmin && <Checkbox className="fl" onChange={this.onCheckAll} checked={checkAllValue} >已选 {checkBoxValues.length} </Checkbox>}
<div className="studentList_operation_ul"> <div className="studentList_operation_ul">
{isAdmin && <li className="li_line"><a href="javascript:void(0)" className="color-grey-9" onClick={this.onDelete}>删除</a></li>} {isAdmin && <li className="li_line"><a href="javascript:void(0)" className="color-grey-9" onClick={this.onDelete}>删除</a></li>}
{isAdmin && <li className="li_line drop_down"> {isAdmin && <li className="drop_down">
移动到...<i className="iconfont icon-xiajiantou font-12 ml2"></i> 移动到...<i className="iconfont icon-xiajiantou font-12 ml2"></i>
<ul className="drop_down_menu" style={{"right":"0px","left":"unset", minWidth: '160px', maxHeight: '324px', overflowY: 'auto'}}> <ul className="drop_down_menu" style={{"right":"0px","left":"unset", minWidth: '160px', maxHeight: '324px', overflowY: 'auto'}}>
{ {
@ -687,7 +715,7 @@ class studentsList extends Component{
</ul> </ul>
</li>} </li>}
<li className="drop_down"> {/* <li className="drop_down">
{currentOrderName} {currentOrderName}
{ course_groups && !!course_groups.length && { course_groups && !!course_groups.length &&
<React.Fragment> <React.Fragment>
@ -698,13 +726,13 @@ class studentsList extends Component{
</ul> </ul>
</React.Fragment> </React.Fragment>
} }
</li> </li> */}
</div> </div>
</div> </div>
<Spin size="large" spinning={this.state.isSpin}> <Spin size="large" spinning={this.state.isSpin}>
<div className="clearfix stu_table"> <div className="clearfix stu_table">
{!this.state.isSpin && <Checkbox.Group style={{ width: '100%' }} onChange={this.onCheckBoxChange} value={checkBoxValues}> {!this.state.isSpin && <Checkbox.Group style={{ width: '100%' }} onChange={this.onCheckBoxChange} value={checkBoxValues}>
<Table columns={buildColumns(this)} dataSource={students} pagination={false}></Table> <Table columns={buildColumns(this,isParent)} dataSource={students} onChange={this.onTableChange} pagination={false}></Table>
</Checkbox.Group> } </Checkbox.Group> }
</div> </div>
</Spin> </Spin>

@ -423,6 +423,10 @@ class AccountBasic extends Component {
const { getFieldDecorator } = this.props.form; const { getFieldDecorator } = this.props.form;
let{ basicInfo }=this.props let{ basicInfo }=this.props
// 已职业认证的账户不能修改职业,学校/单位,院系/部门产品还未确定先默认为false--可以更改
// basicInfo && basicInfo.professional_certification == "certified"
const professionalFlag = false;
// form合并了 // form合并了
const propsWithoutForm = Object.assign({}, this.props) const propsWithoutForm = Object.assign({}, this.props)
delete propsWithoutForm.form delete propsWithoutForm.form
@ -607,7 +611,7 @@ class AccountBasic extends Component {
message: '请先选择职业', message: '请先选择职业',
}], }],
})( })(
<Select style={{width:"190px",marginRight:"20px"}} onChange={this.changeJob}> <Select style={{width:"190px",marginRight:"20px"}} onChange={this.changeJob} disabled={professionalFlag}>
<Option value="teacher">教师</Option> <Option value="teacher">教师</Option>
<Option value="student">学生</Option> <Option value="student">学生</Option>
<Option value="professional">专业人士</Option> <Option value="professional">专业人士</Option>
@ -628,7 +632,7 @@ class AccountBasic extends Component {
message: '请先输入学号', message: '请先输入学号',
}], }],
})( })(
<Input type="text" placeholder="请输入学号" style={{width:"190px"}}></Input> <Input type="text" placeholder="请输入学号" style={{width:"190px"}} disabled={professionalFlag}></Input>
)} )}
</Form.Item> </Form.Item>
} }
@ -646,7 +650,7 @@ class AccountBasic extends Component {
message: '请先选择职称', message: '请先选择职称',
}], }],
})( })(
<Select style={{width:"190px"}}> <Select style={{width:"190px"}} disabled={professionalFlag}>
<Option value="教授">教授</Option> <Option value="教授">教授</Option>
<Option value="副教授">副教授</Option> <Option value="副教授">副教授</Option>
<Option value="讲师">讲师</Option> <Option value="讲师">讲师</Option>
@ -669,7 +673,7 @@ class AccountBasic extends Component {
message: '请先选择职称', message: '请先选择职称',
}], }],
})( })(
<Select style={{width:"190px"}}> <Select style={{width:"190px"}} disabled={professionalFlag}>
<Option value="企业管理者">企业管理者</Option> <Option value="企业管理者">企业管理者</Option>
<Option value="部门管理者">部门管理者</Option> <Option value="部门管理者">部门管理者</Option>
<Option value="高级工程师">高级工程师</Option> <Option value="高级工程师">高级工程师</Option>
@ -703,7 +707,7 @@ class AccountBasic extends Component {
}], }],
})( })(
<AutoComplete width={400} showSearch onSearch={this.filterList} onChange={this.changeList}> <AutoComplete width={400} showSearch onSearch={this.filterList} onChange={this.changeList} disabled={professionalFlag}>
{ {
filterSchoolList && filterSchoolList.map((item,key)=>{ filterSchoolList && filterSchoolList.map((item,key)=>{
return(<Option value={item.name} key={item.id}>{item.name}</Option>) return(<Option value={item.name} key={item.id}>{item.name}</Option>)
@ -741,7 +745,7 @@ class AccountBasic extends Component {
// } // }
}], }],
})( })(
<AutoComplete width={400} showSearch onSearch={this.searchDepartment} onChange={this.changeDepartment}> <AutoComplete width={400} showSearch onSearch={this.searchDepartment} onChange={this.changeDepartment} disabled={professionalFlag}>
{ {
filterDepartments && filterDepartments.map((item,key)=>{ filterDepartments && filterDepartments.map((item,key)=>{
return( return(

Loading…
Cancel
Save