hjm 5 years ago
commit 4a63b7da23

@ -274,7 +274,7 @@ class App extends Component {
<Switch>
{/*<Route path="/login" component={LoginRegisterPage}/>*/}
{/*认证*/}
<Route path="/account" component={AccountPage}/>
<Route path="/profile" component={AccountPage}/>
{/*403*/}
<Route path="/403" component={Shixunauthority}/>

@ -159,8 +159,8 @@ class Startshixuntask extends Component{
{this.props.isStudent?
<span>
{this.props.data.task_operation&&this.props.data.task_operation?startbtn===false?<span onClick={()=>this.taskoperationId( this.props.data.task_operation[1])}>
{this.props.data.task_operation[0]}
{this.props.data&&this.props.data.task_operation&&this.props.data.task_operation?startbtn===false?<span onClick={()=>this.taskoperationId( this.props.data&&this.props.data.task_operation[1])}>
{this.props.data&&this.props.data.task_operation[0]}
</span>:"":""}
</span>:""
}

@ -891,37 +891,34 @@ class GraduationTaskssettingapp extends Component{
}
/// 确认是否下载
confirmysl(url){
axios.get(url).then((response) => {
if(response.data.status&&response.data.status===-1){
}else if(response.data.status&&response.data.status===-2){
if(response.data.messages === "100"){
// 已超出文件导出的上限数量100 ),建议:
this.setState({
DownloadType:true,
DownloadMessageval:100
})
}else {
//因附件资料超过500M
this.setState({
DownloadType:true,
DownloadMessageval:500
})
}
}else {
this.props.showNotification(`正在下载中`);
window.open("/api"+url, '_blank');
}
}).catch((error) => {
console.log(error)
});
}
Downloadcal=()=>{
this.setState({
DownloadType:false,
DownloadMessageval:undefined
})
this.refs.DownloadMessage.confirmysl(url);
// axios.get(url).then((response) => {
// if(response.data.status&&response.data.status===-1){
// }else if(response.data.status&&response.data.status===-2){
// if(response.data.messages === "100"){
// // 已超出文件导出的上限数量100 ),建议:
// this.setState({
// DownloadType:true,
// DownloadMessageval:100
// })
// }else {
// //因附件资料超过500M
// this.setState({
// DownloadType:true,
// DownloadMessageval:500
// })
// }
// }else {
// this.props.showNotification(`正在下载中`);
// window.open("/api"+url, '_blank');
// }
// }).catch((error) => {
// console.log(error)
// });
}
render(){
const { getFieldDecorator } = this.props.form;
@ -998,10 +995,8 @@ class GraduationTaskssettingapp extends Component{
{/*skipTop={this.skipTop}*/}
{/*/>*/}
<DownloadMessage
{...this.props}
value={this.state.DownloadMessageval}
modalCancel={this.Downloadcal}
modalsType={this.state.DownloadType}
{...this.props}
ref="DownloadMessage"
/>
<HomeworkModal
starttimes={this.state.starttimes}

@ -41,7 +41,7 @@ class GraduationTaskssettinglist extends Component{
cross_comment:null,
search:null,
order:"updated_at",
b_order:"asc",
b_order:"desc",
course_group:undefined,
loadingstate:true,
operationId:null,

@ -191,31 +191,32 @@ class GraduationTasksquestions extends Component{
/// 确认是否下载
confirmysl(url){
axios.get(url).then((response) => {
if(response.data.status&&response.data.status===-1){
}else if(response.data.status&&response.data.status===-2){
if(response.data.messages === "100"){
// 已超出文件导出的上限数量100 ),建议:
this.setState({
DownloadType:true,
DownloadMessageval:100
})
}else {
//因附件资料超过500M
this.setState({
DownloadType:true,
DownloadMessageval:500
})
}
}else {
this.props.showNotification(`正在下载中`);
window.open("/api"+url, '_blank');
}
}).catch((error) => {
console.log(error)
});
this.refs.DownloadMessage.confirmysl(url);
// axios.get(url).then((response) => {
// if(response.data.status&&response.data.status===-1){
// }else if(response.data.status&&response.data.status===-2){
// if(response.data.messages === "100"){
// // 已超出文件导出的上限数量100 ),建议:
// this.setState({
// DownloadType:true,
// DownloadMessageval:100
// })
// }else {
// //因附件资料超过500M
// this.setState({
// DownloadType:true,
// DownloadMessageval:500
// })
// }
// }else {
// this.props.showNotification(`正在下载中`);
// window.open("/api"+url, '_blank');
// }
// }).catch((error) => {
// console.log(error)
// });
}
Downloadcal=()=>{
this.setState({
@ -256,9 +257,7 @@ class GraduationTasksquestions extends Component{
{/*/>*/}
<DownloadMessage
{...this.props}
value={this.state.DownloadMessageval}
modalCancel={this.Downloadcal}
modalsType={this.state.DownloadType}
ref="DownloadMessage"
/>
<HomeworkModal
starttimes={this.state.starttimes}

@ -9,6 +9,8 @@ import PollTabSecond from './PollDetailTabSecond'
import PollTabThird from './PollDetailTabThird'
import PollTabForth from './PollDetailTabForth'
import DownloadMessage from '../../modals/DownloadMessage';
import ImmediatelyPublish from './pollPublicBtn/ImmediatelyPublish'
import ImmediatelyEnd from './pollPublicBtn/ImmediatelyEnd'
import CancelPublish from './pollPublicBtn/CancelPublish'
@ -69,6 +71,10 @@ class PollDetailIndex extends Component{
})
}
confirmysl(url){
this.refs.DownloadMessage.confirmysl(url);
}
render(){
let {tab,pollDetail,user_permission}=this.state;
@ -76,6 +82,7 @@ class PollDetailIndex extends Component{
const isStudent = this.props.isStudent();
return(
<div className="newMain">
<DownloadMessage {...this.props} ref="DownloadMessage" />
<div className="educontent mt10 mb50">
<p className="clearfix mb20">
<WordsBtn style="grey" className="fl" to={`/courses/${this.props.match.params.coursesId}/students`}>{this.props.coursedata.name}</WordsBtn>
@ -152,7 +159,7 @@ class PollDetailIndex extends Component{
</li>
:""
} */}
<a className="fl color-blue font-16" href={`/api/polls/${this.props.match.params.pollId}/commit_result.xlsx`}>导出统计</a>
<a className="fl color-blue font-16" onClick={()=>this.confirmysl("/polls/"+this.props.match.params.pollId+"/commit_result.xlsx")} href="javascript:void(0);">导出统计</a>
</span>
}
{

@ -38,11 +38,13 @@
.problemShow:last-child{
border-bottom: none;
}
.invite-tipysls{position: absolute;top: -8px;right: 140px;color: #fff; box-sizing: border-box;width: 170px;text-align: center;border-radius: 2px;background-color: rgba(5,16,26,0.6)}
.yslinvitetip{display: block;border-width: 8px;position: absolute;top: 10px;right: -16px;border-style: dashed solid dashed dashed;border-color: transparent transparent transparent rgba(5,16,26,0.6);font-size: 0;line-height: 0;}
.right-black-trangle{border-width: 8px;position: absolute;top: 10px;left: -16px;border-style: dashed solid dashed dashed;border-color: transparent transparent transparent rgba(5,16,26,0.6);font-size: 0;line-height: 0;}
.right-black-trangles{border-width: 8px;position: absolute;top: 10px;left: -16px;border-style: dashed solid dashed dashed;border-color: transparent rgba(5,16,26,0.6) transparent transparent;font-size: 0;line-height: 0;}
.top-black-trangle{border-width: 8px;position: absolute;top: -16px;right: 4px;border-style: dashed solid dashed dashed;border-color: transparent transparent rgba(5,16,26,0.6) transparent;font-size: 0;line-height: 0;}
.invite-tipysl{color: #999999; box-sizing: border-box;text-align: center;border-radius: 2px;font-size: 14px}
.edu-position-hideysl li a:hover{ background:#F1F1F1; color:#05101A;}
.to-back-left {
width: 0;
height: 0;

@ -155,7 +155,7 @@ class CommitSummary extends Component{
className="mdInForm">
{getFieldDecorator('description', {
rules: [{
required: true, message: '请输入帖子内容',
required: true, message: '请在此输入总结内容,最多5000个字符',
}, {
max: 5000, message: '最大限制为5000个字符',
}],

@ -89,7 +89,7 @@ class Homeworddescription extends Component {
{/*<TextArea placeholder="作业说明..." value={this.state.description} onInput={this.settextarea} style={{"height": "120px"}}/>*/}
{/*<TextArea style={{"height": "120px"}}*/}
{/* autoComplete="off" ></TextArea>*/}
<TPMMDEditor ref={this.mdRef} placeholder={'作业说明'}
<TPMMDEditor ref={this.mdRef} placeholder={'请输入作业说明'}
mdID={'courseMessageMD'} initValue={this.state.description} className="courseMessageMD" onChange={this.settextarea} style={{"height": "120px"}}></TPMMDEditor>
</Form.Item>
<div className="clearfix mt10">

@ -29,6 +29,7 @@ import Associationmodel from '../coursesPublic/Associationmodel';
import '../css/members.css'
import '../css/busyWork.css'
import '../poll/pollStyle.css'
import './style.css';
import moment from 'moment';
import 'moment/locale/zh-cn';
import {getImageUrl, toPath} from 'educoder';
@ -140,7 +141,6 @@ class Listofworks extends Component {
dataIndex: 'classroom',
align: 'center',
className:'font-14',
width:"260px",
render: (text, record) => (
<span style={{"color": '#07111B', "text-align": "center"}}>{record.classroom}</span>
)
@ -386,7 +386,6 @@ class Listofworks extends Component {
dataIndex: 'classroom',
align: 'center',
className:'font-14',
width:"260px",
render: (text, record) => (
<span style={{"color": '#07111B', "text-align": "center"}}>{record.classroom}</span>
)
@ -1333,31 +1332,32 @@ class Listofworks extends Component {
}
/// 确认是否下载
confirmysl(url){
axios.get(url).then((response) => {
if(response.data.status&&response.data.status===-1){
}else if(response.data.status&&response.data.status===-2){
if(response.data.messages === "100"){
// 已超出文件导出的上限数量100 ),建议:
this.setState({
DownloadType:true,
DownloadMessageval:100
})
}else {
//因附件资料超过500M
this.setState({
DownloadType:true,
DownloadMessageval:500
})
}
}else {
this.props.showNotification(`正在下载中`);
window.open("/api"+url, '_blank');
}
}).catch((error) => {
console.log(error)
});
this.refs.DownloadMessage.confirmysl(url);
// axios.get(url).then((response) => {
// if(response.data.status&&response.data.status===-1){
// }else if(response.data.status&&response.data.status===-2){
// if(response.data.messages === "100"){
// // 已超出文件导出的上限数量100 ),建议:
// this.setState({
// DownloadType:true,
// DownloadMessageval:100
// })
// }else {
// //因附件资料超过500M
// this.setState({
// DownloadType:true,
// DownloadMessageval:500
// })
// }
// }else {
// this.props.showNotification(`正在下载中`);
// window.open("/api"+url, '_blank');
// }
// }).catch((error) => {
// console.log(error)
// });
}
Downloadcal=()=>{
@ -1397,9 +1397,7 @@ class Listofworks extends Component {
<DownloadMessage
{...this.props}
value={this.state.DownloadMessageval}
modalCancel={this.Downloadcal}
modalsType={this.state.DownloadType}
ref="DownloadMessage"
/>
{visibles === true ?
@ -1452,70 +1450,11 @@ class Listofworks extends Component {
starttimes={this.state.starttimes}
typs={this.state.typs}
/>
<div className={"educontent mb20"}>
<div className={"educontent "}>
<div className="edu-back-white">
<div className="stud-class-set bor-bottom-greyE ">
<div className=" clearfix edu-back-white poll_list">
<a className="active" onClick={(e)=>this.ChangeTab(0)}>作品列表</a>
<a onClick={(e)=>this.ChangeTab(1)}>作业问答</a>
{this.props.isAdmin() ?
this.state.code_review === true ||jobsettingsdata === undefined ? [""] : jobsettingsdata.data.homework_status[0]==="未发布"? "" : <a
// to={`/courses/${this.state.props.match.params.coursesId}/${this.state.props.match.params.homeworkid}/student_work`}
onClick={(e)=>this.ChangeTab(2)}>
代码查重</a> : ""}
<a
onClick={(e)=>this.ChangeTab(3)}
>设置</a>
{/*{this.props.isAdmin() ? <a*/}
{/* className="fr color-blue font-16"*/}
{/* href={`/api/homework_commons/${this.props.match.params.coursesId}/works_list.xlsx`}*/}
{/*>导出</a> : ""}*/}
<style>{`
.drop_down_menu li a {
padding: 0px;
font-size: 14px;
}
.drop_down_menu {
width: 93px;
}
.drop_down_menu li {
overflow: visible;
width: 93px;
}
.drop_down_menu, .drop_down_normal {
padding-top: 10px;
padding-bottom: 8px;
}
a:hover {
color:#1A0B00 !important;
}
`}</style>
{this.props.isAdmin()? <li className="li_line drop_down fr color-blue font-16 mr8 mt20" style={{"padding":"0 20px"}}>
导出<i className="iconfont icon-xiajiantou font-12 ml2"></i>
<ul className="drop_down_menu" style={{"right":"-0px","left":"unset","height":"auto"}}>
<li><a onClick={()=>this.confirmysl(`/zip/shixun_report?homework_common_id=${this.props.match.params.homeworkid}&work_status=${this.state.course_groupyslstwo}&course_group=${this.state.checkedValuesineinfo}&search=${this.state.searchtext}`)}>实训报告</a></li>
<li><a onClick={()=>this.confirmysl(`/homework_commons/${this.props.match.params.homeworkid}/works_list.xlsx?group_id=${this.state.checkedValuesineinfo}&search=${this.state.searchtext}`)} >学生成绩</a></li>
</ul>
</li>:""}
{this.props.isAdmin() ?
teacherdata && teacherdata.end_immediately === true ?
<a className="fr color-blue font-16" onClick={this.homeworkends}>立即截止</a>
: ""
: ""}
{this.props.isAdmin() ?
teacherdata && teacherdata.publish_immediately === true ?
<a className="fr color-blue font-16" onClick={this.homeworkstart}>立即发布</a>
: ""
: ""}
{this.props.isAdmin() ?
teacherdata && teacherdata.code_review === true ?
<a className="fr color-blue font-16" onClick={this.workshowmodel}>代码查重</a>
: "": ""}
</div>
</div>
<style>
{`
@ -1657,6 +1596,15 @@ class Listofworks extends Component {
<div className="clearfix">
<span className="fl color-grey-6 font-12"><span
className="color-orange-tip">{teacherdata === undefined ? "" : teacherdata.student_works.length}</span>{teacherdata === undefined ? "" : teacherdata.all_member_count} </span>
<style>
{
`
.edu-position-hide li a:hover {
background: #F0F0F0;
}
`
}
</style>
<div className="fr edu-menu-panel">
<ul>
<li className="edu-position edu-position-hidebox">
@ -1762,3 +1710,63 @@ export default Listofworks;
{/*</div>*/}
// <div className="stud-class-set bor-bottom-greyE ">
// <div className=" clearfix edu-back-white poll_list">
// <a className="active" onClick={(e)=>this.ChangeTab(0)}>作品列表</a>
// <a onClick={(e)=>this.ChangeTab(1)}>作业问答</a>
// {this.props.isAdmin() ?
// this.state.code_review === true ||jobsettingsdata === undefined ? [""] : jobsettingsdata.data.homework_status[0]==="未发布"? "" : <a
// // to={`/courses/${this.state.props.match.params.coursesId}/${this.state.props.match.params.homeworkid}/student_work`}
// onClick={(e)=>this.ChangeTab(2)}>
// 代码查重</a> : ""}
// <a
// onClick={(e)=>this.ChangeTab(3)}
// >设置</a>
// {/*{this.props.isAdmin() ? <a*/}
// {/* className="fr color-blue font-16"*/}
// {/* href={`/api/homework_commons/${this.props.match.params.coursesId}/works_list.xlsx`}*/}
// {/*>导出</a> : ""}*/}
// <style>{`
// .drop_down_menu li a {
// padding: 0px;
// font-size: 14px;
// }
// .drop_down_menu {
// width: 93px;
// }
// .drop_down_menu li {
// overflow: visible;
// width: 93px;
// }
// .drop_down_menu, .drop_down_normal {
// padding-top: 10px;
// padding-bottom: 8px;
// }
// a:hover {
// color:#1A0B00 !important;
// }
// `}</style>
// {this.props.isAdmin()? <li className="li_line drop_down fr color-blue font-16 mr8 mt20" style={{"padding":"0 20px"}}>
// 导出<i className="iconfont icon-xiajiantou font-12 ml2"></i>
// <ul className="drop_down_menu" style={{"right":"-0px","left":"unset","height":"auto"}}>
// <li><a onClick={()=>this.confirmysl(`/zip/shixun_report?homework_common_id=${this.props.match.params.homeworkid}&work_status=${this.state.course_groupyslstwo}&course_group=${this.state.checkedValuesineinfo}&search=${this.state.searchtext}`)}>实训报告</a></li>
// <li><a onClick={()=>this.confirmysl(`/homework_commons/${this.props.match.params.homeworkid}/works_list.xlsx?group_id=${this.state.checkedValuesineinfo}&search=${this.state.searchtext}`)} >学生成绩</a></li>
//
// </ul>
// </li>:""}
// {this.props.isAdmin() ?
// teacherdata && teacherdata.end_immediately === true ?
// <a className="fr color-blue font-16" onClick={this.homeworkends}>立即截止</a>
// : ""
// : ""}
// {this.props.isAdmin() ?
// teacherdata && teacherdata.publish_immediately === true ?
// <a className="fr color-blue font-16" onClick={this.homeworkstart}>立即发布</a>
// : ""
// : ""}
// {this.props.isAdmin() ?
// teacherdata && teacherdata.code_review === true ?
// <a className="fr color-blue font-16" onClick={this.workshowmodel}>代码查重</a>
// : "": ""}
{/* </div>*/}
{/*</div>*/}

@ -159,7 +159,6 @@ class Listofworksstudentone extends Component {
dataIndex: 'classroom',
align: "center",
className:'font-14',
width:'260px',
render: (text, record) => (
<span>
<span style={{
@ -923,32 +922,9 @@ class Listofworksstudentone extends Component {
: ""
}
<div className={"educontent mb20"}>
<div className="edu-back-white" style={{width: "1250px"}}>
<div className="stud-class-set bor-bottom-greyE ">
<div className=" clearfix edu-back-white poll_list">
<a className="active" onClick={(e)=>this.ChangeTab(0)}>作品列表</a>
<a onClick={(e)=>this.ChangeTab(1)}>作业问答</a>
<a
onClick={(e)=>this.ChangeTab(3)}
>设置</a>
{this.state.view_report===true?<a className="fr color-blue font-16" target={"_blank"}
href={`/courses/${this.state.props.match.params.coursesId}/${this.state.shixuntypes}/${teacherdata === undefined ? "" : teacherdata.id}/shixun_work_report`}>
查看实训报告
</a>:""}
{/*<a className="fr color-blue font-16">查看实训报告</a>*/}
{
teacherdata === undefined ? ""
: teacherdata.commit_des === null || teacherdata.commit_des === undefined ? "" :
<a className="fr color-blue font-16"
href={`/courses/${this.state.props.match.params.coursesId}/${this.state.shixuntypes}/${teacherdata === undefined ? "" : teacherdata.id}/commitsummary/${this.state.props.match.params.homeworkid}`}>{teacherdata.commit_des}</a>
}
{teacherdata === undefined ? "" : <Startshixuntask
{...this.props}
data={teacherdata}
/>}
</div>
</div>
<div className={"educontent "}>
<div className="edu-back-white" style={{width: "1200"}}>
{computeTimetype===false?<li className="clearfix startbox mb20">
@ -963,8 +939,7 @@ class Listofworksstudentone extends Component {
<div>
<div id="graduation_work_list"
style={{
"padding": '0px 20px 10px 20px',
"margin-top": "20px",
"padding": '20px 20px 10px 20px',
"margin-bottom": "10px"
}}>
@ -1077,27 +1052,7 @@ class Listofworksstudentone extends Component {
</div>
<div className="edu-back-white">
<div className="stud-class-set bor-bottom-greyE ">
<div className=" clearfix edu-back-white poll_list">
<Link className="active" onClick={(e)=>this.ChangeTab(0)}>作品列表</Link>
<Link onClick={(e)=>this.ChangeTab(1)}>作业问答</Link>
<Link onClick={(e)=>this.ChangeTab(3)}>设置</Link>
{this.state.view_report===true?<Link className="fr color-blue font-16" target={"_blank"}
to={`/courses/${this.state.props.match.params.coursesId}/${this.state.shixuntypes}/${this.state.props.match.params.homeworkid}/shixun_work_report`}>
查看实训报告
</Link>:""}
{
teacherdata === undefined ? ""
: teacherdata.commit_des === null || teacherdata.commit_des === undefined ? "" :
<a className="fr color-blue font-16"
href={`/courses/${this.state.props.match.params.coursesId}/${this.state.shixuntypes}/${teacherdata === undefined ? "" : teacherdata.id}/commitsummary/${this.state.props.match.params.homeworkid}`}>{teacherdata.commit_des}</a>
}
{teacherdata === undefined ? "" : <Startshixuntask
{...this.props}
data={teacherdata}
/>}
</div>
</div>
{computeTimetype===false?<li className="clearfix startbox mb20">
<span className={"startfont"}>
@ -1120,8 +1075,7 @@ class Listofworksstudentone extends Component {
{JSON.stringify(datas) !== "[]" ?
<div>
<div id="graduation_work_list" style={{
"padding": '0px 20px 10px 20px',
"margin-top": "20px",
"padding": '20px 20px 10px 20px',
"margin-bottom": "10px"
}}>
<div className="clearfix">
@ -1268,4 +1222,49 @@ class Listofworksstudentone extends Component {
}
}
export default Listofworksstudentone;
export default Listofworksstudentone;
{/*<div className="stud-class-set bor-bottom-greyE ">*/}
{/* <div className=" clearfix edu-back-white poll_list">*/}
{/* <a className="active" onClick={(e)=>this.ChangeTab(0)}>作品列表</a>*/}
{/* <a onClick={(e)=>this.ChangeTab(1)}>作业问答</a>*/}
{/* <a*/}
{/* onClick={(e)=>this.ChangeTab(3)}*/}
{/* >设置</a>*/}
{/* {this.state.view_report===true?<a className="fr color-blue font-16" target={"_blank"}*/}
{/* href={`/courses/${this.state.props.match.params.coursesId}/${this.state.shixuntypes}/${teacherdata === undefined ? "" : teacherdata.id}/shixun_work_report`}>*/}
{/* 查看实训报告*/}
{/* </a>:""}*/}
{/* /!*<a className="fr color-blue font-16">查看实训报告</a>*!/*/}
{/* {*/}
{/* teacherdata === undefined ? ""*/}
{/* : teacherdata.commit_des === null || teacherdata.commit_des === undefined ? "" :*/}
{/* <a className="fr color-blue font-16"*/}
{/* href={`/courses/${this.state.props.match.params.coursesId}/${this.state.shixuntypes}/${teacherdata === undefined ? "" : teacherdata.id}/commitsummary/${this.state.props.match.params.homeworkid}`}>{teacherdata.commit_des}</a>*/}
{/* }*/}
{/* {teacherdata === undefined ? "" : <Startshixuntask*/}
{/* {...this.props}*/}
{/* data={teacherdata}*/}
{/* />}*/}
{/* </div>*/}
{/*</div>*/}
{/*<div className="stud-class-set bor-bottom-greyE ">*/}
{/* <div className=" clearfix edu-back-white poll_list">*/}
{/* <Link className="active" onClick={(e)=>this.ChangeTab(0)}>作品列表</Link>*/}
{/* <Link onClick={(e)=>this.ChangeTab(1)}>作业问答</Link>*/}
{/* <Link onClick={(e)=>this.ChangeTab(3)}>设置</Link>*/}
{/* {this.state.view_report===true?<Link className="fr color-blue font-16" target={"_blank"}*/}
{/* to={`/courses/${this.state.props.match.params.coursesId}/${this.state.shixuntypes}/${this.state.props.match.params.homeworkid}/shixun_work_report`}>*/}
{/* 查看实训报告*/}
{/* </Link>:""}*/}
{/* {*/}
{/* teacherdata === undefined ? ""*/}
{/* : teacherdata.commit_des === null || teacherdata.commit_des === undefined ? "" :*/}
{/* <a className="fr color-blue font-16"*/}
{/* href={`/courses/${this.state.props.match.params.coursesId}/${this.state.shixuntypes}/${teacherdata === undefined ? "" : teacherdata.id}/commitsummary/${this.state.props.match.params.homeworkid}`}>{teacherdata.commit_des}</a>*/}
{/* }*/}
{/* {teacherdata === undefined ? "" : <Startshixuntask*/}
{/* {...this.props}*/}
{/* data={teacherdata}*/}
{/* />}*/}
{/* </div>*/}
{/*</div>*/}

@ -1,6 +1,6 @@
import React,{ Component } from "react";
import {Link,NavLink} from 'react-router-dom';
import { WordsBtn ,ActionBtn} from 'educoder';
import React, {Component} from "react";
import {Link, NavLink} from 'react-router-dom';
import {WordsBtn, ActionBtn} from 'educoder';
import axios from 'axios';
import '../css/members.css';
import "../common/formCommon.css";
@ -14,53 +14,70 @@ import Trainingjobsetting from './Trainingjobsetting'
import Workquestionandanswer from './Workquestionandanswer'
import CoursesListType from '../coursesPublic/CoursesListType';
import ShixunStudentWork from "./ShixunStudentWork";
import Startshixuntask from "../coursesPublic/Startshixuntask";
class ShixunHomeworkPage extends Component {
constructor(props) {
super(props);
this.state={
tab:["0"],
jobsettingsdata:undefined,
teacherdata:undefined,
this.state = {
tab: ["0"],
jobsettingsdata: undefined,
teacherdata: undefined,
code_review: false,
view_report: false,
}
}
//切换tab
ChangeTab=(e)=>{
console.log(e);
ChangeTab = (e) => {
// console.log(e);
this.setState({
tab:e
tab: e
})
try {
var currenturl = window.location.href;
var newUrl = (currenturl.split("?"))[0];
window.history.pushState('','',newUrl+'?tab='+e);
}catch (e) {
console.log(e);
console.log("44");
}
}
Getdataback = (jobsettingsdata,teacherdata)=>{
this.setState({
jobsettingsdata:jobsettingsdata,
teacherdata:teacherdata,
})
Getdataback = (jobsettingsdata, teacherdata) => {
this.setState({
jobsettingsdata: jobsettingsdata,
teacherdata: teacherdata,
code_review: teacherdata.code_review,
view_report: teacherdata.view_report,
})
}
componentDidMount() {
const query =this.props.location.search;
const query = this.props.location.search;
const type = query.split('?tab=');
// let sum = []
// sum.push(type[1])
// console.log("componentDidMountcomponentDidMount");
// console.log(sum);
console.log(type);
this.setState({
tab:type,
tab: type[1],
})
let querys = this.props.location.pathname;
const types = querys.split('/');
console.log(types);
this.setState({
shixuntypes: types[3]
})
}
render() {
let {tab,jobsettingsdata,teacherdata}=this.state;
const isAdmin =this.props.isAdmin();
let {tab, jobsettingsdata, teacherdata} = this.state;
const isAdmin = this.props.isAdmin();
return (
<div className="newMain clearfix " >
<div className={"educontent mb20"} style={{width:"1200px"}}>
<div className="newMain clearfix ">
<div className={"educontent mb20"} style={{width: "1200px"}}>
<div className="educontent mb20">
<p className="clearfix mb20 mt10">
@ -69,20 +86,20 @@ class ShixunHomeworkPage extends Component {
<span className="color-grey-9 fl ml3 mr3">&gt;</span>
<ActionBtn
className=" btn colorgrey fl hovercolorblue "
to={`/courses/${this.props.match.params.coursesId}/${this.state.shixuntypes}/${jobsettingsdata === undefined ? "" : jobsettingsdata.data.category.category_id===undefined?"":jobsettingsdata.data.category.category_id}`}>{jobsettingsdata === undefined ? "" : jobsettingsdata.data.category.category_name}</ActionBtn>
to={`/courses/${this.props.match.params.coursesId}/${this.state.shixuntypes}/${jobsettingsdata === undefined ? "" : jobsettingsdata.data.category.category_id === undefined ? "" : jobsettingsdata.data.category.category_id}`}>{jobsettingsdata === undefined ? "" : jobsettingsdata.data.category.category_name}</ActionBtn>
<span className="color-grey-9 fl ml3 mr3">&gt;</span>
<WordsBtn className="fl">作业详情</WordsBtn>
</p>
</div>
<div className="educontent mb20">
<p className=" fl color-black summaryname" style={{heigth:"33px"}}>
<p className=" fl color-black summaryname" style={{heigth: "33px"}}>
{teacherdata === undefined ? "" : teacherdata.homework_name}
</p>
<CoursesListType
typelist={teacherdata === undefined ? [""] : teacherdata.homework_status}
/>
<a className="color-grey-9 fr font-16 summaryname ml20 mr20"
href={`/courses/${this.props.match.params.coursesId}/${this.state.shixuntypes}/${jobsettingsdata === undefined ? "" : jobsettingsdata.data.category.category_id===undefined?"": jobsettingsdata.data.category.category_id}`}>返回</a>
href={`/courses/${this.props.match.params.coursesId}/${this.state.shixuntypes}/${jobsettingsdata === undefined ? "" : jobsettingsdata.data.category.category_id === undefined ? "" : jobsettingsdata.data.category.category_id}`}>返回</a>
<a className="color-grey-9 fr font-16 mr20"
href={`/shixuns/${teacherdata === undefined ? "" : teacherdata.shixun_identifier}/challenges`}
target={"_blank"}>实训详情</a>
@ -90,21 +107,126 @@ class ShixunHomeworkPage extends Component {
</div>
<div className="edu-back-white ">
<div className="stud-class-set bor-bottom-greyE ">
<div className=" clearfix edu-back-white poll_list">
<a className={parseInt(tab) === 0 ? "active" : ""} onClick={(e) => this.ChangeTab(0)}>作品列表</a>
<a className={parseInt(tab) === 1 ? "active" : ""} onClick={(e) => this.ChangeTab(1)}>作业问答</a>
{this.props.isAdmin() ?
this.state.code_review === true || jobsettingsdata === undefined ? [""] : jobsettingsdata.data.homework_status[0] === "未发布" ? "" :
<a
className={parseInt(tab) === 2 ? "active" : ""}
onClick={(e) => this.ChangeTab(2)}>
代码查重</a> : ""}
{parseInt(tab) === 3?
<style>{
`
.poll_list a.active:after {
content: '';
width: 57px;
left: 10px;
bottom: 0px;
height: 2px;
background-color: #4CACFF;
position: absolute;
}
`
}</style>
:""}
<a className={parseInt(tab) === 3 ? "active" : ""}
onClick={(e) => this.ChangeTab(3)}
>设置</a>
{/*{this.props.isAdmin() ? <a*/}
{/* className="fr color-blue font-16"*/}
{/* href={`/api/homework_commons/${this.props.match.params.coursesId}/works_list.xlsx`}*/}
{/*>导出</a> : ""}*/}
<style>{`
.drop_down_menu li a {
padding: 0px;
font-size: 14px;
}
.drop_down_menu {
width: 93px;
}
.drop_down_menu li {
overflow: visible;
width: 93px;
}
.drop_down_menu, .drop_down_normal {
padding-top: 10px;
padding-bottom: 8px;
}
a:hover {
color:#1A0B00 !important;
}
`}</style>
{this.props.isAdmin() ?
<li className="li_line drop_down fr color-blue font-16 mr8 mt20" style={{"padding": "0 20px"}}>
导出<i className="iconfont icon-xiajiantou font-12 ml2"></i>
<ul className="drop_down_menu" style={{"right": "-0px", "left": "unset", "height": "auto"}}>
<li><a
onClick={() => this.confirmysl(`/zip/shixun_report?homework_common_id=${this.props.match.params.homeworkid}&work_status=${this.state.course_groupyslstwo}&course_group=${this.state.checkedValuesineinfo}&search=${this.state.searchtext}`)}>实训报告</a>
</li>
<li><a
onClick={() => this.confirmysl(`/homework_commons/${this.props.match.params.homeworkid}/works_list.xlsx?group_id=${this.state.checkedValuesineinfo}&search=${this.state.searchtext}`)}>学生成绩</a>
</li>
{
// 教师列表
parseInt(tab)===0 ? (isAdmin===true ?
<Listofworks {...this.props} {...this.state} ChangeTab={(e)=>this.ChangeTab(e)} Getdataback={(jobsettingsdata,teacherdata)=>this.Getdataback(jobsettingsdata,teacherdata)} ></Listofworks>
</ul>
</li> : ""}
{this.props.isAdmin() ?
teacherdata && teacherdata.end_immediately === true ?
<a className="fr color-blue font-16" onClick={this.homeworkends}>立即截止</a>
: ""
: ""}
{this.props.isAdmin() ?
teacherdata && teacherdata.publish_immediately === true ?
<a className="fr color-blue font-16" onClick={this.homeworkstart}>立即发布</a>
: ""
: ""}
{this.props.isAdmin() ?
teacherdata && teacherdata.code_review === true ?
<a className="fr color-blue font-16" onClick={this.workshowmodel}>代码查重</a>
: "" : ""}
{this.state.view_report === true ? <Link className="fr color-blue font-16" target={"_blank"}
to={`/courses/${this.state.props.match.params.coursesId}/${this.state.shixuntypes}/${this.state.props.match.params.homeworkid}/shixun_work_report`}>
查看实训报告
</Link> : ""}
{
teacherdata === undefined ? ""
: teacherdata.commit_des === null || teacherdata.commit_des === undefined ? "" :
<a className="fr color-blue font-16"
href={`/courses/${this.state.props.match.params.coursesId}/${this.state.shixuntypes}/${teacherdata === undefined ? "" : teacherdata.id}/commitsummary/${this.state.props.match.params.homeworkid}`}>{teacherdata.commit_des}</a>
}
{teacherdata === undefined ? "" : <Startshixuntask
{...this.props}
data={teacherdata}
/>}
</div>
</div>
</div>
{
// 教师列表
parseInt(tab) === 0 ? (isAdmin === true ?
<Listofworks {...this.props} {...this.state}
Getdataback={(jobsettingsdata, teacherdata) => this.Getdataback(jobsettingsdata, teacherdata)}></Listofworks>
:
<Listofworksstudentone {...this.props} {...this.state} ChangeTab={(e)=>this.ChangeTab(e)} Getdataback={(jobsettingsdata,teacherdata)=>this.Getdataback(jobsettingsdata,teacherdata)} ></Listofworksstudentone>)
<Listofworksstudentone {...this.props} {...this.state}
Getdataback={(jobsettingsdata, teacherdata) => this.Getdataback(jobsettingsdata, teacherdata)}></Listofworksstudentone>)
:
parseInt(tab)===1 ?<Workquestionandanswer {...this.props} {...this.state} ChangeTab={(e)=>this.ChangeTab(e)} Getdataback={(jobsettingsdata,teacherdata)=>this.Getdataback(jobsettingsdata,teacherdata)} ></Workquestionandanswer>
parseInt(tab) === 1 ?
<Workquestionandanswer {...this.props} {...this.state}
Getdataback={(jobsettingsdata, teacherdata) => this.Getdataback(jobsettingsdata, teacherdata)}></Workquestionandanswer>
:
parseInt(tab)===2? <ShixunStudentWork {...this.props} {...this.state} ChangeTab={(e)=>this.ChangeTab(e)} Getdataback={(jobsettingsdata,teacherdata)=>this.Getdataback(jobsettingsdata,teacherdata)} ></ShixunStudentWork>
parseInt(tab) === 2 ?
<ShixunStudentWork {...this.props} {...this.state}
Getdataback={(jobsettingsdata, teacherdata) => this.Getdataback(jobsettingsdata, teacherdata)}></ShixunStudentWork>
:
<Trainingjobsetting {...this.props} {...this.state} ChangeTab={(e)=>this.ChangeTab(e)} Getdataback={(jobsettingsdata,teacherdata)=>this.Getdataback(jobsettingsdata,teacherdata)} ></Trainingjobsetting>
}
</div>
<Trainingjobsetting {...this.props} {...this.state}
Getdataback={(jobsettingsdata, teacherdata) => this.Getdataback(jobsettingsdata, teacherdata)}></Trainingjobsetting>
}
</div>
</div>
)
}
@ -134,9 +256,9 @@ export default ShixunHomeworkPage;
//
// </div>
// </div>
{/* </div>*/}
{/* </div>*/
}
{/*</div>*/}
{/*</div>*/
}

@ -33,6 +33,7 @@ import '../css/Courses.css'
import './style.css'
import moment from 'moment';
import 'moment/locale/zh-cn';
import Startshixuntask from "../coursesPublic/Startshixuntask";
const Search = Input.Search;
const CheckboxGroup = Checkbox.Group;
@ -473,31 +474,32 @@ class ShixunStudentWork extends Component {
// 导出实习报告批量
/// 确认是否下载
confirmysl(url){
axios.get(url).then((response) => {
if(response.data.status&&response.data.status===-1){
}else if(response.data.status&&response.data.status===-2){
if(response.data.messages === "100"){
// 已超出文件导出的上限数量100 ),建议:
this.setState({
DownloadType:true,
DownloadMessageval:100
})
}else {
//因附件资料超过500M
this.setState({
DownloadType:true,
DownloadMessageval:500
})
}
}else {
this.props.showNotification(`正在下载中`);
window.open("/api"+url, '_blank');
}
}).catch((error) => {
console.log(error)
});
this.refs.DownloadMessage.confirmysl(url);
// axios.get(url).then((response) => {
// if(response.data.status&&response.data.status===-1){
// }else if(response.data.status&&response.data.status===-2){
// if(response.data.messages === "100"){
// // 已超出文件导出的上限数量100 ),建议:
// this.setState({
// DownloadType:true,
// DownloadMessageval:100
// })
// }else {
// //因附件资料超过500M
// this.setState({
// DownloadType:true,
// DownloadMessageval:500
// })
// }
// }else {
// this.props.showNotification(`正在下载中`);
// window.open("/api"+url, '_blank');
// }
// }).catch((error) => {
// console.log(error)
// });
}
Downloadcal=()=>{
@ -601,9 +603,7 @@ class ShixunStudentWork extends Component {
<DownloadMessage
{...this.props}
value={this.state.DownloadMessageval}
modalCancel={this.Downloadcal}
modalsType={this.state.DownloadType}
refs="DownloadMessage"
/>
{/*立即发布*/}
<HomeworkModal
@ -625,53 +625,10 @@ class ShixunStudentWork extends Component {
starttimes={this.state.starttimes}
typs={this.state.typs}
/>
<div className={"educontent mb20"}>
<div className={"educontent "}>
<div className="edu-back-white">
<div className="stud-class-set bor-bottom-greyE ">
<div className=" clearfix edu-back-white poll_list">
<a onClick={(e)=>this.ChangeTab(0)}>作品列表</a>:
<a onClick={(e)=>this.ChangeTab(1)}>作业问答</a>
{this.props.isAdmin()?<a className="active" onClick={(e)=>this.ChangeTab(2)}>代码查重</a>:""}
<a onClick={(e)=>this.ChangeTab(3)}>设置</a>
<style>{`
.drop_down_menu li a {
padding: 0px;
font-size: 14px;
}
.drop_down_menu {
width: 93px;
}
.drop_down_menu li {
overflow: visible;
width: 93px;
}
.drop_down_menu, .drop_down_normal {
padding-top: 10px;
padding-bottom: 8px;
}
a:hover {
color:#1A0B00 !important;
}
`}</style>
{this.props.isAdmin() ? <li className="li_line drop_down fr color-blue font-16 mr8 mt20" style={{"padding": "0 20px"}}>
导出<i className="iconfont icon-xiajiantou font-12 ml2"></i>
<ul className="drop_down_menu" style={{"right": "-0px", "left": "unset", "height": "auto"}}>
<li><a onClick={()=>this.confirmysl(`/zip/shixun_report?homework_common_id=${this.props.match.params.homeworkid}`)}>实训报告</a>
</li>
<li><a onClick={()=>this.confirmysl(`/homework_commons/${this.props.match.params.homeworkid}/works_list.xlsx`)}>学生成绩</a>
</li>
</ul>
</li> : ""}
{this.props.isAdmin()?
data&&data.end_immediately===true?
<a className="fr color-blue font-16" onClick={this.homeworkends}>立即截止</a>
:"": ""}
{this.props.isAdmin()?
data&&data.publish_immediately===true?
<a className="fr color-blue font-16" onClick={this.homeworkstart}>立即发布</a> : "": ""}
</div>
</div>
<style>
{`
.startbox{
@ -834,4 +791,58 @@ class ShixunStudentWork extends Component {
}
}
export default ShixunStudentWork;
export default ShixunStudentWork;
// <div className="stud-class-set bor-bottom-greyE ">
// <div className=" clearfix edu-back-white poll_list">
// <a onClick={(e)=>this.ChangeTab(0)}>作品列表</a>
// <a onClick={(e)=>this.ChangeTab(1)}>作业问答</a>
// {this.props.isAdmin()?<a className="active" onClick={(e)=>this.ChangeTab(2)}>代码查重</a>:""}
// <a onClick={(e)=>this.ChangeTab(3)}>设置</a>
// <style>{`
// .drop_down_menu li a {
// padding: 0px;
// font-size: 14px;
// }
// .drop_down_menu {
// width: 93px;
// }
// .drop_down_menu li {
// overflow: visible;
// width: 93px;
// }
// .drop_down_menu, .drop_down_normal {
// padding-top: 10px;
// padding-bottom: 8px;
// }
// a:hover {
// color:#1A0B00 !important;
// }
// `}</style>
// {this.props.isAdmin() ? <li className="li_line drop_down fr color-blue font-16 mr8 mt20" style={{"padding": "0 20px"}}>
// 导出<i className="iconfont icon-xiajiantou font-12 ml2"></i>
// <ul className="drop_down_menu" style={{"right": "-0px", "left": "unset", "height": "auto"}}>
// <li><a onClick={()=>this.confirmysl(`/zip/shixun_report?homework_common_id=${this.props.match.params.homeworkid}`)}>实训报告</a>
// </li>
// <li><a onClick={()=>this.confirmysl(`/homework_commons/${this.props.match.params.homeworkid}/works_list.xlsx`)}>学生成绩</a>
// </li>
// </ul>
// </li> : ""}
// {this.props.isAdmin()?
// data&&data.end_immediately===true?
// <a className="fr color-blue font-16" onClick={this.homeworkends}>立即截止</a>
// :"": ""}
// {this.props.isAdmin()?
// data&&data.publish_immediately===true?
// <a className="fr color-blue font-16" onClick={this.homeworkstart}>立即发布</a> : "": ""}
// {
// jobsettingsdata&& jobsettingsdata.data === undefined ? ""
// : jobsettingsdata&& jobsettingsdata.data.commit_des === null || jobsettingsdata&& jobsettingsdata.data.commit_des === undefined ? "" :
// <a className="fr color-blue font-16"
// href={`/courses/${this.state.props.match.params.coursesId}/${this.state.shixuntypes}/${ jobsettingsdata&& jobsettingsdata.data === undefined ? "" : jobsettingsdata&& jobsettingsdata.data.id}/commitsummary/${this.state.props.match.params.homeworkid}`}>{ jobsettingsdata&& jobsettingsdata.data.commit_des}</a>
// }
// { jobsettingsdata&&jobsettingsdata.data === undefined ? "" : <Startshixuntask
// {...this.props}
// data={ jobsettingsdata&& jobsettingsdata.data}
// />}
{/* </div>*/}
{/*</div>*/}

@ -30,31 +30,34 @@ class ShixunWorkReport extends Component {
}
/// 确认是否下载
confirmysl(url){
axios.get(url).then((response) => {
if(response.data.status&&response.data.status===-1){
}else if(response.data.status&&response.data.status===-2){
if(response.data.messages === "100"){
// 已超出文件导出的上限数量100 ),建议:
this.refs.DownloadMessage.confirmysl(url);
// axios.get(url).then((response) => {
// if(response.data.status&&response.data.status===-1){
this.setState({
DownloadType:true,
DownloadMessageval:100
})
}else {
//因附件资料超过500M
this.setState({
DownloadType:true,
DownloadMessageval:500
})
}
}else {
this.props.showNotification(`正在下载中`);
window.open("/api"+url, '_blank');
}
}).catch((error) => {
console.log(error)
});
// }else if(response.data.status&&response.data.status===-2){
// if(response.data.messages === "100"){
// // 已超出文件导出的上限数量100 ),建议:
// this.setState({
// DownloadType:true,
// DownloadMessageval:100
// })
// }else {
// //因附件资料超过500M
// this.setState({
// DownloadType:true,
// DownloadMessageval:500
// })
// }
// }else {
// this.props.showNotification(`正在下载中`);
// window.open("/api"+url, '_blank');
// }
// }).catch((error) => {
// console.log(error)
// });
}
@ -124,9 +127,7 @@ class ShixunWorkReport extends Component {
</div>
<DownloadMessage
{...this.props}
value={this.state.DownloadMessageval}
modalCancel={this.Downloadcal}
modalsType={this.state.DownloadType}
ref="DownloadMessage"
/>
<div style={{ width:'100%',height:'75px'}} >
<p className=" fl color-black mt25 summaryname">{data&&data.shixun_name}</p>

@ -27,6 +27,7 @@ import moment from 'moment';
import 'moment/locale/zh-cn';
import Modals from "../../modals/Modals";
import DownloadMessage from '../../modals/DownloadMessage';
import Startshixuntask from "../coursesPublic/Startshixuntask";
const RadioGroup = Radio.Group;
//GraduationTaskssetting.js
@ -1686,30 +1687,31 @@ class Trainingjobsetting extends Component {
/// 确认是否下载
confirmysl(url){
axios.get(url).then((response) => {
if(response.data.status&&response.data.status===-1){
}else if(response.data.status&&response.data.status===-2){
if(response.data.messages === "100"){
// 已超出文件导出的上限数量100 ),建议:
this.setState({
DownloadType:true,
DownloadMessageval:100
})
}else {
//因附件资料超过500M
this.setState({
DownloadType:true,
DownloadMessageval:500
})
}
}else {
this.props.showNotification(`正在下载中`);
window.open("/api"+url, '_blank');
}
}).catch((error) => {
console.log(error)
});
this.refs.DownloadMessage.confirmysl(url);
// axios.get(url).then((response) => {
// if(response.data.status&&response.data.status===-1){
// }else if(response.data.status&&response.data.status===-2){
// if(response.data.messages === "100"){
// // 已超出文件导出的上限数量100 ),建议:
// this.setState({
// DownloadType:true,
// DownloadMessageval:100
// })
// }else {
// //因附件资料超过500M
// this.setState({
// DownloadType:true,
// DownloadMessageval:500
// })
// }
// }else {
// this.props.showNotification(`正在下载中`);
// window.open("/api"+url, '_blank');
// }
// }).catch((error) => {
// console.log(error)
// });
}
Downloadcal=()=>{
@ -1776,9 +1778,7 @@ class Trainingjobsetting extends Component {
<DownloadMessage
{...this.props}
value={this.state.DownloadMessageval}
modalCancel={this.Downloadcal}
modalsType={this.state.DownloadType}
ref="DownloadMessage"
/>
{/*立即发布*/}
@ -1807,77 +1807,17 @@ class Trainingjobsetting extends Component {
loadtype={loadtype}
modalSave={modalSave}
></Modals>
<div className={"educontent mb20"}>
<div className="edu-back-white">
<div className="stud-class-set bor-bottom-greyE ">
<div className=" clearfix edu-back-white poll_list">
<a onClick={(e)=>this.ChangeTab(0)}>作品列表</a>
<a onClick={(e)=>this.ChangeTab(1)}>作业问答</a>
{this.props.isAdmin()?this.state.code_review===true||jobsettingsdata === undefined ? [""] : jobsettingsdata.data.homework_status[0]==="未发布"?"": <a onClick={(e)=>this.ChangeTab(2)}>代码查重</a> : ""}
<style>{
`
.poll_list a.active:after {
content: '';
width: 57px;
left: 10px;
bottom: 0px;
height: 2px;
background-color: #4CACFF;
position: absolute;
}
`
}</style>
<a className="active"
onClick={(e)=>this.ChangeTab(3)}
>设置</a>
<style>{`
.drop_down_menu li a {
padding: 0px;
font-size: 14px;
}
.drop_down_menu {
width: 93px;
}
.drop_down_menu li {
overflow: visible;
width: 93px;
}
.drop_down_menu, .drop_down_normal {
padding-top: 10px;
padding-bottom: 8px;
}
a:hover {
color:#1A0B00 !important;
}
`}</style>
{this.props.isAdmin() ? <li className="li_line drop_down fr color-blue font-16 mr8 mt20" style={{"padding": "0 20px"}}>
导出<i className="iconfont icon-xiajiantou font-12 ml2"></i>
<ul className="drop_down_menu" style={{"right": "-0px", "left": "unset", "height": "auto"}}>
<li><a onClick={()=>this.confirmysl(`/zip/shixun_report?homework_common_id=${this.props.match.params.homeworkid}`)}>实训报告</a>
</li>
<li><a onClick={()=>this.confirmysl(`/homework_commons/${this.props.match.params.homeworkid}/works_list.xlsx`)}>学生成绩</a>
</li>
</ul>
</li>: ""}
{this.props.isAdmin() ?jobsettingsdata&&jobsettingsdata.data.end_immediately===true?
<a className="fr color-blue font-16" onClick={this.homeworkends}>立即截止</a>
: "": ""}
{this.props.isAdmin() ?jobsettingsdata&&jobsettingsdata.data.publish_immediately===true?
<a className="fr color-blue font-16" onClick={this.homeworkstart}>立即发布</a>: "" : ""}
{this.props.isAdmin()?
jobsettingsdata&&jobsettingsdata.data.code_review===true?
<a className="fr color-blue font-16" onClick={this.workshowmodel}>代码查重</a>: "":""}
</div>
</div>
<div className={"educontent "}>
<div className="edu-back-white" style={{paddingTop: "20px"}}>
{/*发布设置*/}
<div className="stud-class-set bor-bottom-greyE edu-back-white">
<div className=" mt20 pl20">
<div className=" pl20">
<p className=" clearfix " style={{height:"41px"}}>
<span className="font-16 fl "style={{"color":"#05101A"}}>发布设置 <span className="ml15 color-grey-9" style={{"font-size":"14px","text-align":"left"}}></span></span>
{
!flagPageEdit && this.props.isAdmin() === true ?
<a className="fr" onClick={this.editSetting}><i
className="iconfont font-16 pr20 " style={{color:"#333333"}}>编辑</i></a>
<a className="fr" onClick={this.editSetting}><Tooltip title="编辑"><i
className="iconfont icon-bianjidaibeijing font-20 color-green pr20 "></i></Tooltip></a>
: ""
}
</p>
@ -1903,7 +1843,7 @@ class Trainingjobsetting extends Component {
unifiedsetting === undefined ? "" : unifiedsetting=== true ?
<div>
<div className="clearfix mb5 ml15">
<span className="font-16 fl mt6" style={{"color":"#999999"}}>发布时间</span>
<span className="font-16 fl mt3" style={{"color":"#999999"}}>发布时间</span>
<Tooltip placement="bottom" title={this.props.isSuperAdmin() ? "" : !flagPageEditstwo === true ? "发布时间已过,则不能修改" : ""}>
<div className="fl">
<DatePicker
@ -1927,7 +1867,7 @@ class Trainingjobsetting extends Component {
/>
</div>
</Tooltip>
<span className="ml20 fl mt10 color-grey-c" style={{"text-align":"left","font-size":"14px"}}>(学生收到作业的时间)</span>
<span className="ml20 fl mt5 color-grey-c" style={{"text-align":"left","font-size":"14px"}}>(学生收到作业的时间)</span>
</div>
<p className="color-red lineh-25 clearfix" style={{height:"25px"}}>
{
@ -1936,7 +1876,7 @@ class Trainingjobsetting extends Component {
}
</p>
<div className="clearfix ml15 mb5">
<span className=" fl mt10 font-16" style={{"color":"#999999"}}>截止时间</span>
<span className=" fl mt3 font-16" style={{"color":"#999999"}}>截止时间</span>
<Tooltip placement="bottom" title={this.props.isSuperAdmin() ? "" : !flagPageEditsthrees === true ? "截止时间已过,则不能修改" : ""}>
<div className="fl">
<DatePicker
@ -1961,7 +1901,7 @@ class Trainingjobsetting extends Component {
</div>
</Tooltip>
<span className=" ml20 fl mt10 color-grey-c" style={{"text-align":"left","font-size":"14px"}}>(学生按时提交作品的时间截点)</span>
<span className=" ml20 fl mt5 color-grey-c" style={{"text-align":"left","font-size":"14px"}}>(学生按时提交作品的时间截点)</span>
</div>
<p className="color-red lineh-25 clearfix" style={{height:"25px"}}>
{
@ -2124,9 +2064,8 @@ class Trainingjobsetting extends Component {
color:"#666666",
}} disabled={!flagPageEdit} className="c_grey mt20 ml30"
value={"自定义分值"} style={{"color":"#666666"}}>自定义分值
<a onClick={()=>this.testscripttip(0)}><img style={{marginBottom:"3px",marginLeft:"10px"}} src={getImageUrl("images/educoder/problem.png") }/></a>
{testscripttiptype===true?
<div className="invite-tip clearfix " id="test_script_tip" style={{left: '140px',width: '322px',zIndex: '10'}}>
<div className="invite-tipysls clearfix " id="test_script_tip" style={{left: '148px',width: '322px',zIndex: '10'}}>
<span className="right-black-trangles"></span>
<div className="padding20 invitecontent clearfix">
<p className="font-12 edu-txt-left">
@ -2147,7 +2086,9 @@ class Trainingjobsetting extends Component {
</div>
:""}
</Radio>
</RadioGroup></span>
</RadioGroup>
<a onClick={()=>this.testscripttip(0)}><img style={{marginBottom:"3px",marginLeft:"20px"}} src={getImageUrl("images/educoder/problem.png") }/></a>
</span>
</div>
<p className="ml20 mt15 c_grey font-13 " style={{"color":"#666666"}}> 关卡名称<span
className="color-grey-c font-10 ml10">(需要学生完成的任务请选中)</span></p>
@ -2223,4 +2164,74 @@ class Trainingjobsetting extends Component {
}
}
export default Trainingjobsetting;
export default Trainingjobsetting;
// <div className="stud-class-set bor-bottom-greyE ">
// <div className=" clearfix edu-back-white poll_list">
// <a onClick={(e)=>this.ChangeTab(0)}>作品列表</a>
// <a onClick={(e)=>this.ChangeTab(1)}>作业问答</a>
// {this.props.isAdmin()?this.state.code_review===true||jobsettingsdata === undefined ? [""] : jobsettingsdata.data.homework_status[0]==="未发布"?"": <a onClick={(e)=>this.ChangeTab(2)}>代码查重</a> : ""}
// <style>{
// `
// .poll_list a.active:after {
// content: '';
// width: 57px;
// left: 10px;
// bottom: 0px;
// height: 2px;
// background-color: #4CACFF;
// position: absolute;
// }
// `
// }</style>
// <a className="active"
// onClick={(e)=>this.ChangeTab(3)}
// >设置</a>
// <style>{`
// .drop_down_menu li a {
// padding: 0px;
// font-size: 14px;
// }
// .drop_down_menu {
// width: 93px;
// }
// .drop_down_menu li {
// overflow: visible;
// width: 93px;
// }
// .drop_down_menu, .drop_down_normal {
// padding-top: 10px;
// padding-bottom: 8px;
// }
// a:hover {
// color:#1A0B00 !important;
// }
// `}</style>
// {this.props.isAdmin() ? <li className="li_line drop_down fr color-blue font-16 mr8 mt20" style={{"padding": "0 20px"}}>
// 导出<i className="iconfont icon-xiajiantou font-12 ml2"></i>
// <ul className="drop_down_menu" style={{"right": "-0px", "left": "unset", "height": "auto"}}>
// <li><a onClick={()=>this.confirmysl(`/zip/shixun_report?homework_common_id=${this.props.match.params.homeworkid}`)}>实训报告</a>
// </li>
// <li><a onClick={()=>this.confirmysl(`/homework_commons/${this.props.match.params.homeworkid}/works_list.xlsx`)}>学生成绩</a>
// </li>
// </ul>
// </li>: ""}
// {this.props.isAdmin() ?jobsettingsdata&&jobsettingsdata.data.end_immediately===true?
// <a className="fr color-blue font-16" onClick={this.homeworkends}>立即截止</a>
// : "": ""}
// {this.props.isAdmin() ?jobsettingsdata&&jobsettingsdata.data.publish_immediately===true?
// <a className="fr color-blue font-16" onClick={this.homeworkstart}>立即发布</a>: "" : ""}
// {this.props.isAdmin()?
// jobsettingsdata&&jobsettingsdata.data.code_review===true?
// <a className="fr color-blue font-16" onClick={this.workshowmodel}>代码查重</a>: "":""}
// {
// jobsettingsdata&& jobsettingsdata&&jobsettingsdata.data === undefined ? ""
// : jobsettingsdata&& jobsettingsdata.data.commit_des === null || jobsettingsdata&& jobsettingsdata.data.commit_des === undefined ? "" :
// <a className="fr color-blue font-16"
// href={`/courses/${this.state.props.match.params.coursesId}/${this.state.shixuntypes}/${ jobsettingsdata&& jobsettingsdata.data === undefined ? "" : jobsettingsdata&& jobsettingsdata.data.id}/commitsummary/${this.state.props.match.params.homeworkid}`}>{ jobsettingsdata&& jobsettingsdata.data.commit_des}</a>
// }
// { jobsettingsdata&&jobsettingsdata.data === undefined ? "" : <Startshixuntask
// {...this.props}
// data={ jobsettingsdata&& jobsettingsdata.data}
// />}
{/* </div>*/}
{/*</div>*/}

@ -35,6 +35,7 @@ import Homeworddescription from "../shixunHomework/Homeworddescription";
import ShixunWorkModal from './Shixunworkdetails/ShixunWorkModal';
import HomeworkModal from "../coursesPublic/HomeworkModal";
import DownloadMessage from '../../modals/DownloadMessage';
import Startshixuntask from "../coursesPublic/Startshixuntask";
const TextArea = Input.TextArea
//作业问答页面
@ -317,30 +318,31 @@ class Workquestionandanswer extends Component {
/// 确认是否下载
confirmysl(url){
axios.get(url).then((response) => {
if(response.data.status&&response.data.status===-1){
}else if(response.data.status&&response.data.status===-2){
if(response.data.messages === "100"){
// 已超出文件导出的上限数量100 ),建议:
this.setState({
DownloadType:true,
DownloadMessageval:100
})
}else {
//因附件资料超过500M
this.setState({
DownloadType:true,
DownloadMessageval:500
})
}
}else {
this.props.showNotification(`正在下载中`);
window.open("/api"+url, '_blank');
}
}).catch((error) => {
console.log(error)
});
this.refs.DownloadMessage.confirmysl(url);
// axios.get(url).then((response) => {
// if(response.data.status&&response.data.status===-1){
// }else if(response.data.status&&response.data.status===-2){
// if(response.data.messages === "100"){
// // 已超出文件导出的上限数量100 ),建议:
// this.setState({
// DownloadType:true,
// DownloadMessageval:100
// })
// }else {
// //因附件资料超过500M
// this.setState({
// DownloadType:true,
// DownloadMessageval:500
// })
// }
// }else {
// this.props.showNotification(`正在下载中`);
// window.open("/api"+url, '_blank');
// }
// }).catch((error) => {
// console.log(error)
// });
}
Downloadcal=()=>{
this.setState({
@ -381,9 +383,7 @@ class Workquestionandanswer extends Component {
/> : ""}
<DownloadMessage
{...this.props}
value={this.state.DownloadMessageval}
modalCancel={this.Downloadcal}
modalsType={this.state.DownloadType}
ref="DownloadMessage"
/>
{/*立即发布*/}
<HomeworkModal
@ -405,73 +405,12 @@ class Workquestionandanswer extends Component {
starttimes={this.state.starttimes}
typs={this.state.typs}
/>
<div className={"educontent mb20"}>
<div className="edu-back-white">
<div className="stud-class-set bor-bottom-greyE ">
<div className=" clearfix edu-back-white poll_list">
<a onClick={(e)=>this.ChangeTab(0)}>作品列表</a>
<a className="active" onClick={(e)=>this.ChangeTab(1)}>作业问答</a>
{this.props.isAdmin() ?
this.state.code_review === true || jobsettingsdata === undefined ? [""] : jobsettingsdata.data.homework_status[0] === "未发布" ? "" :
<a
// to={`/courses/${this.state.props.match.params.coursesId}/${this.state.props.match.params.homeworkid}/student_work`}
onClick={(e)=>this.ChangeTab(2)}>
代码查重</a> : ""}
<a
onClick={(e)=>this.ChangeTab(3)}
>设置</a>
<style>{`
.drop_down_menu li a {
padding: 0px;
font-size: 14px;
}
.drop_down_menu {
width: 93px;
}
.drop_down_menu li {
overflow: visible;
width: 93px;
}
.drop_down_menu, .drop_down_normal {
padding-top: 10px;
padding-bottom: 8px;
}
a:hover {
color:#1A0B00 !important;
}
`}</style>
{this.props.isAdmin() ?
<li className="li_line drop_down fr color-blue font-16 mr8 mt20" style={{"padding": "0 20px"}}>
导出<i className="iconfont icon-xiajiantou font-12 ml2"></i>
<ul className="drop_down_menu" style={{"right": "-0px", "left": "unset", "height": "auto"}}>
<li><a onClick={()=>this.confirmysl(`/zip/shixun_report?homework_common_id=${this.props.match.params.homeworkid}`)}>实训报告</a>
</li>
<li><a onClick={()=>this.confirmysl(`/homework_commons/${this.props.match.params.homeworkid}/works_list.xlsx`)}>学生成绩</a>
</li>
</ul>
</li> : ""}
{this.props.isAdmin() ? jobsettingsdata && jobsettingsdata.data.end_immediately === true ?
<a className="fr color-blue font-16" onClick={this.homeworkends}>立即截止</a>
:""
: ""}
{this.props.isAdmin() ? jobsettingsdata && jobsettingsdata.data.publish_immediately === true ?
<a className="fr color-blue font-16" onClick={this.homeworkstart}>立即发布</a>
: ""
: ""}
{this.props.isAdmin() ?
jobsettingsdata && jobsettingsdata.data.code_review === true ?
<a className="fr color-blue font-16" onClick={this.workshowmodel}>代码查重</a>
: "" : ""}
</div>
</div>
<div className={"educontent "}>
<div className="edu-back-white" >
{jobsettingsdata === undefined || jobsettingsdata.data.description === null ? "无" :
<div className=" clearfix edu-back-white poll_list mt20 mr20 ">
{jobsettingsdata === undefined || jobsettingsdata.data.description === null ? <div className="ml20" style={{paddingTop: "20px"}}></div> :
<div className=" clearfix edu-back-white poll_list mr20 " style={{paddingTop: "20px"}}>
<span>
<style>
{
@ -482,7 +421,7 @@ class Workquestionandanswer extends Component {
`
}
</style>
<div className={"font-16 color-dark fl pl20 "}>
<div className={"font-16 color-dark fl pl20 "} >
<div className={"markdown-body"}
dangerouslySetInnerHTML={{__html: markdownToHTML(jobsettingsdata.data.description).replace(/▁/g, "▁▁▁")}}></div>
{/* /!*{}}></div>
@ -579,4 +518,76 @@ class Workquestionandanswer extends Component {
}
}
export default Workquestionandanswer;
export default Workquestionandanswer;
{/*<div className="stud-class-set bor-bottom-greyE ">*/}
{/* <div className=" clearfix edu-back-white poll_list">*/}
{/* <a onClick={(e)=>this.ChangeTab(0)}>作品列表</a>*/}
{/* <a className="active" onClick={(e)=>this.ChangeTab(1)}>作业问答</a>*/}
{/* {this.props.isAdmin() ?*/}
{/* this.state.code_review === true || jobsettingsdata === undefined ? [""] : jobsettingsdata.data.homework_status[0] === "未发布" ? "" :*/}
{/* <a*/}
{/* // to={`/courses/${this.state.props.match.params.coursesId}/${this.state.props.match.params.homeworkid}/student_work`}*/}
{/* onClick={(e)=>this.ChangeTab(2)}>*/}
{/* 代码查重</a> : ""}*/}
{/* <a*/}
{/* onClick={(e)=>this.ChangeTab(3)}*/}
{/* >设置</a>*/}
{/* <style>{`*/}
{/* .drop_down_menu li a {*/}
{/* padding: 0px;*/}
{/* font-size: 14px;*/}
{/* }*/}
{/* .drop_down_menu {*/}
{/* width: 93px;*/}
{/* }*/}
{/* .drop_down_menu li {*/}
{/* overflow: visible;*/}
{/* width: 93px;*/}
{/* }*/}
{/* .drop_down_menu, .drop_down_normal {*/}
{/* padding-top: 10px;*/}
{/* padding-bottom: 8px;*/}
{/* }*/}
{/* a:hover {*/}
{/* color:#1A0B00 !important;*/}
{/* }*/}
{/* `}</style>*/}
{/* {this.props.isAdmin() ?*/}
{/* <li className="li_line drop_down fr color-blue font-16 mr8 mt20" style={{"padding": "0 20px"}}>*/}
{/* 导出<i className="iconfont icon-xiajiantou font-12 ml2"></i>*/}
{/* <ul className="drop_down_menu" style={{"right": "-0px", "left": "unset", "height": "auto"}}>*/}
{/* <li><a onClick={()=>this.confirmysl(`/zip/shixun_report?homework_common_id=${this.props.match.params.homeworkid}`)}>实训报告</a>*/}
{/* </li>*/}
{/* <li><a onClick={()=>this.confirmysl(`/homework_commons/${this.props.match.params.homeworkid}/works_list.xlsx`)}>学生成绩</a>*/}
{/* </li>*/}
{/* </ul>*/}
{/* </li> : ""}*/}
{/* {this.props.isAdmin() ? jobsettingsdata && jobsettingsdata.data.end_immediately === true ?*/}
{/* <a className="fr color-blue font-16" onClick={this.homeworkends}>立即截止</a>*/}
{/* :""*/}
{/* : ""}*/}
{/* {this.props.isAdmin() ? jobsettingsdata && jobsettingsdata.data.publish_immediately === true ?*/}
{/* <a className="fr color-blue font-16" onClick={this.homeworkstart}>立即发布</a>*/}
{/* : ""*/}
{/* : ""}*/}
{/* {this.props.isAdmin() ?*/}
{/* jobsettingsdata && jobsettingsdata.data.code_review === true ?*/}
{/* <a className="fr color-blue font-16" onClick={this.workshowmodel}>代码查重</a>*/}
{/* : "" : ""}*/}
{/* {*/}
{/* jobsettingsdata&& jobsettingsdata.data === undefined ? ""*/}
{/* : jobsettingsdata&& jobsettingsdata.data.commit_des === null || jobsettingsdata&& jobsettingsdata.data.commit_des === undefined ? "" :*/}
{/* <a className="fr color-blue font-16"*/}
{/* href={`/courses/${this.state.props.match.params.coursesId}/${this.state.shixuntypes}/${ jobsettingsdata&& jobsettingsdata.data === undefined ? "" : jobsettingsdata&& jobsettingsdata.data.id}/commitsummary/${this.state.props.match.params.homeworkid}`}>{ jobsettingsdata&& jobsettingsdata.data.commit_des}</a>*/}
{/* }*/}
{/* { jobsettingsdata&&jobsettingsdata.data === undefined ? "" : <Startshixuntask*/}
{/* {...this.props}*/}
{/* data={ jobsettingsdata&& jobsettingsdata.data}*/}
{/* />}*/}
{/* </div>*/}
{/*</div>*/}

@ -754,7 +754,7 @@ submittojoinclass=(value)=>{
<li><Link to={`/users/${this.props.current_user===undefined?"":this.props.current_user.login}/shixuns`}>我的实训</Link></li>
<li><Link to={`/users/${this.props.current_user===undefined?"":this.props.current_user.login}/paths`}>我的实践课程</Link></li>
<li><Link to={`/users/${this.props.current_user===undefined?"":this.props.current_user.login}/projects`}>我的项目</Link></li>
<li><a href={`/account/basic`}>账号管理</a></li>
<li><a href={`/profile/basic`}>账号管理</a></li>
{/*<li><a onClick={()=>this.educoderlogin()} >登入测试接口</a></li>*/}
{/*<li><a onClick={()=>this.trialapplications()} >试用申请</a> </li>*/}
{/*<li><Link to={`/interest`}>兴趣页</Link></li>*/}

@ -1,118 +1,118 @@
import React, { Component } from 'react';
import { BrowserRouter as Router, Route, Link, Switch } from "react-router-dom";
import {CNotificationHOC} from '../courses/common/CNotificationHOC'
import Loading from '../../Loading';
import Loadable from 'react-loadable';
import { TPMIndexHOC } from '../tpm/TPMIndexHOC';
import { SnackbarHOC, getImageUrl } from 'educoder';
import AccountNav from './account/AccountNav'
import axios from 'axios'
const AccountBasic= Loadable({
loader: () => import('./account/AccountBasic'),
loading: Loading,
})
const AccountBasicEdit= Loadable({
loader: () => import('./account/AccountBasicEdit'),
loading: Loading,
})
const AccountCertification= Loadable({
loader: () => import('./account/AccountCertification'),
loading: Loading,
})
const AccountSecure= Loadable({
loader: () => import('./account/AccountSecure'),
loading: Loading,
})
class AccountPage extends Component {
constructor (props) {
super(props)
this.state = {
basicInfo:undefined
}
}
componentDidUpdate =(prevState)=>{
if(this.props.current_user && this.props.current_user != prevState.current_user){
this.getBasicInfo(this.props.current_user.login);
}
}
componentDidMount = () =>{
if(this.props.current_user){
this.getBasicInfo(this.props.current_user.login);
}
}
getBasicInfo=(login)=>{
let url=`/users/accounts/${login || this.props.current_user.login}.json`;
axios.get(url).then((result)=>{
if(result.data){
if(result.data && result.data.base_info_completed == false){
this.props.history.push(`/account/basic/edit`);
}
this.setState({
basicInfo: Object.assign({}, {...result.data}, { avatar_url: `${result.data.avatar_url}?t=${new Date().getTime()}`})
})
}
}).catch((error)=>{
console.log(error);
})
}
render() {
let { basicInfo }=this.state;
const common = { basicInfo, getBasicInfo : this.getBasicInfo }
return (
<div className="newMain clearfix">
<div className="educontent df pt20">
<style>{`
.accountPage {
display: flex;
}
`}</style>
<AccountNav {...this.props} {...common}></AccountNav>
<div className="basicFormWrap">
<Switch {...this.props}>
<Route exact path="/account/basic"
render={
(props) => (<AccountBasic {...this.props} {...props} {...this.state} {...common} />)
}
></Route>
<Route exact path="/account/basic/edit"
render={
(props) => (<AccountBasicEdit {...this.props} {...props} {...this.state} {...common} />)
}
></Route>
<Route exact path="/account/certification"
render={
(props) => (<AccountCertification {...this.props} {...props} {...this.state} {...common} />)
}
></Route>
<Route exact path="/account/secure"
render={
(props) => (<AccountSecure {...this.props} {...props} {...this.state} {...common} />)
}
></Route>
<Route exact path="/account"
render={
(props) => (<AccountBasic {...this.props} {...props} {...this.state} {...common} />)
}
></Route>
</Switch>
</div>
</div>
</div>
);
}
}
export default CNotificationHOC()(SnackbarHOC() ( TPMIndexHOC ( AccountPage )));
import React, { Component } from 'react';
import { BrowserRouter as Router, Route, Link, Switch } from "react-router-dom";
import {CNotificationHOC} from '../courses/common/CNotificationHOC'
import Loading from '../../Loading';
import Loadable from 'react-loadable';
import { TPMIndexHOC } from '../tpm/TPMIndexHOC';
import { SnackbarHOC, getImageUrl } from 'educoder';
import AccountNav from './account/AccountNav'
import axios from 'axios'
const AccountBasic= Loadable({
loader: () => import('./account/AccountBasic'),
loading: Loading,
})
const AccountBasicEdit= Loadable({
loader: () => import('./account/AccountBasicEdit'),
loading: Loading,
})
const AccountCertification= Loadable({
loader: () => import('./account/AccountCertification'),
loading: Loading,
})
const AccountSecure= Loadable({
loader: () => import('./account/AccountSecure'),
loading: Loading,
})
class AccountPage extends Component {
constructor (props) {
super(props)
this.state = {
basicInfo:undefined
}
}
componentDidUpdate =(prevState)=>{
if(this.props.current_user && this.props.current_user != prevState.current_user){
this.getBasicInfo(this.props.current_user.login);
}
}
componentDidMount = () =>{
if(this.props.current_user){
this.getBasicInfo(this.props.current_user.login);
}
}
getBasicInfo=(login)=>{
let url=`/users/accounts/${login || this.props.current_user.login}.json`;
axios.get(url).then((result)=>{
if(result.data){
if(result.data && result.data.base_info_completed == false){
this.props.history.push(`/profile/basic/edit`);
}
this.setState({
basicInfo: Object.assign({}, {...result.data}, { avatar_url: `${result.data.avatar_url}?t=${new Date().getTime()}`})
})
}
}).catch((error)=>{
console.log(error);
})
}
render() {
let { basicInfo }=this.state;
const common = { basicInfo, getBasicInfo : this.getBasicInfo }
return (
<div className="newMain clearfix">
<div className="educontent df pt20">
<style>{`
.accountPage {
display: flex;
}
`}</style>
<AccountNav {...this.props} {...common}></AccountNav>
<div className="basicFormWrap">
<Switch {...this.props}>
<Route exact path="/profile/basic"
render={
(props) => (<AccountBasic {...this.props} {...props} {...this.state} {...common} />)
}
></Route>
<Route exact path="/profile/basic/edit"
render={
(props) => (<AccountBasicEdit {...this.props} {...props} {...this.state} {...common} />)
}
></Route>
<Route exact path="/profile/certification"
render={
(props) => (<AccountCertification {...this.props} {...props} {...this.state} {...common} />)
}
></Route>
<Route exact path="/profile/secure"
render={
(props) => (<AccountSecure {...this.props} {...props} {...this.state} {...common} />)
}
></Route>
<Route exact path="/profile"
render={
(props) => (<AccountBasic {...this.props} {...props} {...this.state} {...common} />)
}
></Route>
</Switch>
</div>
</div>
</div>
);
}
}
export default CNotificationHOC()(SnackbarHOC() ( TPMIndexHOC ( AccountPage )));

@ -1,119 +1,119 @@
import React, { Component } from 'react';
import { SnackbarHOC, getImageUrl, City } from 'educoder';
import { Form, Button, Input, Radio, Select, Tooltip, Icon } from 'antd'
import './common.css'
const RadioGroup = Radio.Group;
const Option = Select.Option
const radioOptions = [
{ label: '男', value: 'boy' },
{ label: '女', value: 'girl' },
];
class AccountBasicEdit extends Component {
constructor(props){
super(props);
}
render() {
const { getFieldDecorator } = this.props.form;
const {basicInfo} =this.props
const showRealName = false;
return (
<div>
<div className="basicForm">
<style>{`
.formItemInline {
display: flex;
}
.formItemInline .ant-form-item-control-wrapper {
display: inline-block;
}
.basicForm .title {
font-size: 16px;
padding-left: 30px;
margin-bottom: 10px;
}
.basicForm .ant-form-item-label {
width: 100px;
padding-right: 10px;
}
.basicForm .ant-form-item-label label {
color: #979797
}
.basicForm .display {
margin: 0
}
.titleWrap {
display: flex;
justify-content: space-between;
}
`}</style>
<div className="titleWrap">
<div className="title">基本信息</div>
<Button type="primary" style={{ marginRight: '16px'}}
ghost onClick={() => this.props.history.push('/account/basic/edit')}>修改</Button>
</div>
<Form onSubmit={this.handleSubmit}>
<Form.Item
label="昵称"
className="display formItemInline"
>
{basicInfo && basicInfo.nickname}
</Form.Item>
<Form.Item
label="姓名"
className="display formItemInline"
>
{basicInfo && basicInfo.name}
</Form.Item>
<Form.Item
label="性别"
className="display formItemInline"
>
{basicInfo && basicInfo.gender == 0?"男":"女"}
</Form.Item>
<Form.Item
label="所在地"
className="display formItemInline"
>
{basicInfo && basicInfo.location} {basicInfo && basicInfo.location_city}
</Form.Item>
<Form.Item
label="职业"
className="display formItemInline"
>
{basicInfo && basicInfo.technical_title}
</Form.Item>
<Form.Item
label="学校/单位"
className="display formItemInline mb0"
>
{basicInfo && basicInfo.school_name}
</Form.Item>
<Form.Item
label="院系/部门"
className="display formItemInline mb0"
>
{basicInfo && basicInfo.department_name}
</Form.Item>
</Form>
</div>
<diV style={{color: '#989898', marginLeft: '20px'}}>* 我们确保你所提供的信息均处于严格保密状态不会泄露</diV>
</div>
);
}
}
const WrappedAccountBasicEdit = Form.create({ name: 'AccountBasicEdit' })(AccountBasicEdit);
export default WrappedAccountBasicEdit;
import React, { Component } from 'react';
import { SnackbarHOC, getImageUrl, City } from 'educoder';
import { Form, Button, Input, Radio, Select, Tooltip, Icon } from 'antd'
import './common.css'
const RadioGroup = Radio.Group;
const Option = Select.Option
const radioOptions = [
{ label: '男', value: 'boy' },
{ label: '女', value: 'girl' },
];
class AccountBasicEdit extends Component {
constructor(props){
super(props);
}
render() {
const { getFieldDecorator } = this.props.form;
const {basicInfo} =this.props
const showRealName = false;
return (
<div>
<div className="basicForm">
<style>{`
.formItemInline {
display: flex;
}
.formItemInline .ant-form-item-control-wrapper {
display: inline-block;
}
.basicForm .title {
font-size: 16px;
padding-left: 30px;
margin-bottom: 10px;
}
.basicForm .ant-form-item-label {
width: 100px;
padding-right: 10px;
}
.basicForm .ant-form-item-label label {
color: #979797
}
.basicForm .display {
margin: 0
}
.titleWrap {
display: flex;
justify-content: space-between;
}
`}</style>
<div className="titleWrap">
<div className="title">基本信息</div>
<Button type="primary" style={{ marginRight: '16px'}}
ghost onClick={() => this.props.history.push('/profile/basic/edit')}>修改</Button>
</div>
<Form onSubmit={this.handleSubmit}>
<Form.Item
label="昵称"
className="display formItemInline"
>
{basicInfo && basicInfo.nickname}
</Form.Item>
<Form.Item
label="姓名"
className="display formItemInline"
>
{basicInfo && basicInfo.name}
</Form.Item>
<Form.Item
label="性别"
className="display formItemInline"
>
{basicInfo && basicInfo.gender == 0?"男":"女"}
</Form.Item>
<Form.Item
label="所在地"
className="display formItemInline"
>
{basicInfo && basicInfo.location} {basicInfo && basicInfo.location_city}
</Form.Item>
<Form.Item
label="职业"
className="display formItemInline"
>
{basicInfo && basicInfo.technical_title}
</Form.Item>
<Form.Item
label="学校/单位"
className="display formItemInline mb0"
>
{basicInfo && basicInfo.school_name}
</Form.Item>
<Form.Item
label="院系/部门"
className="display formItemInline mb0"
>
{basicInfo && basicInfo.department_name}
</Form.Item>
</Form>
</div>
<diV style={{color: '#989898', marginLeft: '20px'}}>* 我们确保你所提供的信息均处于严格保密状态不会泄露</diV>
</div>
);
}
}
const WrappedAccountBasicEdit = Form.create({ name: 'AccountBasicEdit' })(AccountBasicEdit);
export default WrappedAccountBasicEdit;

@ -1,68 +1,68 @@
import React, { Component } from 'react';
import { SnackbarHOC, getImageUrl } from 'educoder';
import AccountImg from './AccountImg'
class AccountNav extends Component {
toBasic = () => {
this.props.history.push(`/account/basic`)
}
toCertification = () => {
this.props.history.push(`/account/certification`)
}
toSecure = () => {
this.props.history.push(`/account/secure`)
}
render() {
let { basicInfo } = this.props
console.log(this.props);
const path = window.location.pathname
const isBasic = path.indexOf('basic') != -1 || path == "/account"
const isCertification = path.indexOf('certification') != -1
const isSecure = path.indexOf('secure') != -1
return (
<div className="accountNav fl">
{
basicInfo &&
<React.Fragment>
<div className="accountInfo">
<AccountImg src={basicInfo.avatar_url} {...this.props}></AccountImg>
<span className="name">{basicInfo.name}</span>
<span className="role">{basicInfo.technical_title}</span>
</div>
<div className="accountManagement">
<div className="title">账号管理</div>
<ul>
<li className={`navItem ${isBasic ? 'active' : ''}`} onClick={this.toBasic}>
<i className="iconfont icon-jibenxinxi color-grey-9 font-16"></i>
基本信息
{
(basicInfo.authentication == 'uncertified' || basicInfo.authentication == 'applying') &&
<i className="status fr iconfont icon-tishi color-red font-16"></i>
}
{
basicInfo.authentication == 'certified' &&
<i className="status fr iconfont icon-wancheng color-green-light font-16"></i>
}
</li>
<li className={`navItem ${isCertification ? 'active' : ''}`} onClick={this.toCertification}>
<i className="iconfont icon-renzhengxinxi color-grey-9 font-16"></i>
{
basicInfo.professional_certification == 'certified' && basicInfo.authentication == 'certified' ?
<i className="status fr iconfont icon-wancheng color-green-light font-16"></i>:
<i className="status fr iconfont icon-tishi color-red font-16"></i>
}
</li>
<li className={`navItem ${isSecure ? 'active' : ''}`} onClick={this.toSecure}>
<i className="iconfont icon-anquanshezhi color-grey-9 font-16"></i>
</li>
</ul>
</div>
</React.Fragment>
}
</div>
);
}
}
export default AccountNav ;
import React, { Component } from 'react';
import { SnackbarHOC, getImageUrl } from 'educoder';
import AccountImg from './AccountImg'
class AccountNav extends Component {
toBasic = () => {
this.props.history.push(`/profile/basic`)
}
toCertification = () => {
this.props.history.push(`/profile/certification`)
}
toSecure = () => {
this.props.history.push(`/profile/secure`)
}
render() {
let { basicInfo } = this.props
console.log(this.props);
const path = window.location.pathname
const isBasic = path.indexOf('basic') != -1 || path == "/profile"
const isCertification = path.indexOf('certification') != -1
const isSecure = path.indexOf('secure') != -1
return (
<div className="accountNav fl">
{
basicInfo &&
<React.Fragment>
<div className="accountInfo">
<AccountImg src={basicInfo.avatar_url} {...this.props}></AccountImg>
<span className="name">{basicInfo.name}</span>
<span className="role">{basicInfo.technical_title}</span>
</div>
<div className="accountManagement">
<div className="title">账号管理</div>
<ul>
<li className={`navItem ${isBasic ? 'active' : ''}`} onClick={this.toBasic}>
<i className="iconfont icon-jibenxinxi color-grey-9 font-16"></i>
基本信息
{
(basicInfo.authentication == 'uncertified' || basicInfo.authentication == 'applying') &&
<i className="status fr iconfont icon-tishi color-red font-16"></i>
}
{
basicInfo.authentication == 'certified' &&
<i className="status fr iconfont icon-wancheng color-green-light font-16"></i>
}
</li>
<li className={`navItem ${isCertification ? 'active' : ''}`} onClick={this.toCertification}>
<i className="iconfont icon-renzhengxinxi color-grey-9 font-16"></i>
{
basicInfo.professional_certification == 'certified' && basicInfo.authentication == 'certified' ?
<i className="status fr iconfont icon-wancheng color-green-light font-16"></i>:
<i className="status fr iconfont icon-tishi color-red font-16"></i>
}
</li>
<li className={`navItem ${isSecure ? 'active' : ''}`} onClick={this.toSecure}>
<i className="iconfont icon-anquanshezhi color-grey-9 font-16"></i>
</li>
</ul>
</div>
</React.Fragment>
}
</div>
);
}
}
export default AccountNav ;

Loading…
Cancel
Save