Merge remote-tracking branch 'origin/master'

dev_forum
杨树明 5 years ago
commit f89bbaba9c

@ -17,7 +17,8 @@ class AccessoryModal extends Component{
ModalSave:"",
loadtype:false,
updatas:false,
shixunsreplace:false
shixunsreplace:false,
Errormessage:false,
}
}
@ -41,7 +42,10 @@ class AccessoryModal extends Component{
// for(var list of fileList ){
// console.log(fileList)
// }
this.setState({ fileList });
this.setState({
fileList:fileList,
Errormessage:false,
});
}
onAttachmentRemove = (file) => {
@ -121,10 +125,23 @@ class AccessoryModal extends Component{
if (newfileList.length == 0) {
// this.props.showNotification('请先上传附件')
if(this.props.modalname === "补交附件"){
this.setState({
Errormessage:true,
shixunsreplace:false,
})
}else{
this.setState({
shixunsreplace:true,
Errormessage:false,
})
}
return;
}else{
this.setState({
shixunsreplace:false,
Errormessage:false,
})
}
let url= this.props.reviseAttachmentUrl || "/graduation_works/"+id+"/revise_attachment.json"
@ -326,6 +343,14 @@ class AccessoryModal extends Component{
border:'1px solid rgba(234,234,234,1)',
padding: '10px'
}}></textarea>
{
this.state.Errormessage && this.state.Errormessage === true ?
<p className="color-red mt5 mb5 " style={{width: " 100%", height: "20px"}}>
<span className="fl" style={{textAlign:"left",width: " 100%"}}>还未上传附件</span>
</p>
: <div style={{height:"25px"}}></div>
}
{this.state.updatas===true?<span className={"color-red"}>请上传附件</span>:""}
<div className="clearfix mt30 edu-txt-center mb10">
<a className="task-btn color-white mr70" onClick={this.props.Cancel}>{this.props.Cancelname || '取消'}</a>

@ -159,7 +159,7 @@ class Testpapersettinghomepage extends Component{
return(
<div className="newMain clearfix ">
<div className={"educontent mb20"} style={{width:"1250px"}}>
<div className={"educontent mb20"} style={{width:"1200px"}}>
{/* 公用的提示弹框 */}
{this.state.Modalstype===true?<Modals
modalsType={this.state.Modalstype}
@ -177,7 +177,7 @@ class Testpapersettinghomepage extends Component{
callback={this.callback}
/>:""}
<div className="educontent mb20" style={{width:"1250px"}}>
<div className="educontent mb20" style={{width:"1200px"}}>
<p className="clearfix mb20 mt10">
<ActionBtn className=" btn colorgrey fl hovercolorblue " to={`/courses/${this.props.match.params.coursesId}/students}`}>{this.props.coursedata.name}</ActionBtn>
<span className="color-grey-9 fl ml3 mr3">&gt;</span>
@ -195,7 +195,7 @@ class Testpapersettinghomepage extends Component{
`}
</style>
<div className="educontent" style={{width:"1250px"}}>
<div className="educontent" style={{width:"1200px"}}>
<p className=" fl color-black summaryname ">
{Commonheadofthetestpaper === undefined?"":Commonheadofthetestpaper.exercise_name}
</p>
@ -252,19 +252,18 @@ class Testpapersettinghomepage extends Component{
padding-top: 10px;
padding-bottom: 8px;
}
a:hover {
color:#1A0B00 !important;
}
`}
</style>
<div className={"studentList_operation_ul mt23"}>
{isAdmin === true? <li className="li_line drop_down fr color-blue font-15" 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.experiment(`/api/exercises/${this.props.match.params.Id}/exercise_lists.xlsx`)}
className="color-dark">学生成绩</a></li>
<li><a href={`/api/exercises/${this.props.match.params.Id}/export_exercise`} className="color-dark">空白试卷</a></li>
<li><a className="color-dark"
onClick={()=>this.experiment(`/api/zip/export_exercises?exercise_id=${this.props.match.params.Id}${this.state.groupyslsval}`)}
>学生答题试卷</a></li>
<li><a onClick={()=>this.experiment(`/api/exercises/${this.props.match.params.Id}/exercise_lists.xlsx`)}>学生成绩</a></li>
<li><a href={`/api/exercises/${this.props.match.params.Id}/export_exercise`} >空白试卷</a></li>
<li><a onClick={()=>this.experiment(`/api/zip/export_exercises?exercise_id=${this.props.match.params.Id}${this.state.groupyslsval}`)}>学生答题试卷</a></li>
</ul>
</li>:""}
</div>

@ -200,7 +200,7 @@ class shixunAnswer extends Component{
className:"edu-txt-center",
render:(testCount,item,index)=>{
return(
<span>{ item.testCount ? item.testCount : "--" }</span>
<span>{ item.testCount ? item.testCount : <span className="color-grey-9">--</span> }</span>
)
}
}, {
@ -210,7 +210,7 @@ class shixunAnswer extends Component{
className:"edu-txt-center",
render:(endTime,item,index)=>{
return(
<span>{ item.endTime ? item.endTime : "--" }</span>
<span>{ item.endTime ? item.endTime : <span className="color-grey-9">--</span> }</span>
)
}
}, {
@ -220,7 +220,7 @@ class shixunAnswer extends Component{
className:"edu-txt-center",
render:(needTime,item,index)=>{
return(
<span>{ item.needTime ? item.needTime : "--" }</span>
<span>{ item.needTime ? item.needTime : <span className="color-grey-9">--</span> }</span>
)
}
}, {
@ -259,7 +259,7 @@ class shixunAnswer extends Component{
step={0.1}
precision={1}
value={item.input_score}
style={{width:"60px",marginRight:"5px"}}
style={{width:"60px",marginLeft:"5px"}}
placeholder="请输入分数"
onChange={(value)=>{this.changeThis(value,index)}}
onBlur={(value)=>this.changeThisScore(value,item.id,index)}
@ -269,9 +269,9 @@ class shixunAnswer extends Component{
}
{
item.operation ?
<a className={isAdmin ? "color-blue ml20":"color-blue"} target="_blank" href='javascript:void(0)' onClick={()=>this.scrollToAnchor(`${questionType.question_id}${index+1}`)}>查看</a>
<a className={isAdmin ? "color-blue mt5 fr":"color-blue"} target="_blank" href='javascript:void(0)' onClick={()=>this.scrollToAnchor(`${questionType.question_id}${index+1}`)}>查看</a>
:
<a className={isAdmin ? "color-grey-9 ml20":"color-grey-9"} target="_blank" href='javascript:void(0)'>--</a>
<span className={isAdmin ? "color-grey-9 mt5 fr":"color-grey-9"} >--</span>
}
</span>
)
@ -279,28 +279,38 @@ class shixunAnswer extends Component{
}];
return(
<div>
<style>
{`
.resetTableStyle .ant-table-tbody > tr > td{
padding:10px 5px!important;
}
.resetCodeMirrorStyle .CodeMirror{
height:auto!important;
}
`}
</style>
{ exercise && ((exercise.student_commit_status && exercise.student_commit_status != 0) || (exercise.user_exercise_status && exercise.user_exercise_status !=0) ) ?
<div>
<p className="padding20-30 font-16 color-grey-6 pl30">阶段成绩</p>
<div className="stageTable">
<div className={challenge && challenge.length > 0 ? "pl30 pr30 resetTableStyle":"pl30 pr30 resetTableStyle stageTable"}>
{ data && data.length>0 ? <Table columns={columns} dataSource={data} pagination={false}></Table> : "" }
</div>
{
challenge && challenge.length > 0 &&
<div>
<p className="padding20-30 font-16 color-grey-6 pl30">实训详情</p>
<p className="mt20 pr30 font-16 color-grey-6 pl30">实训详情</p>
{
challenge.map((item,key)=>{
return(
<div className="pl30 pr30" id={`challenge_${questionType.question_id}${key+1}`}>
<div className="pl30 pr30 mt20" id={`challenge_${questionType.question_id}${key+1}`}>
<p className="clearfix mb20">
<span className="panel-inner-icon mr15 fl mt3 backgroud4CACFF">
<i className="fa fa-code font-16 color_white"></i>
</span>
<span className="fl mt3 font-14">
<span className="fl mt3 font-16">
<span className="font-bd mr15">{item[0].position}</span>
<Link to={"/shixuns/"+item[0].game_identifier+"/challenges"}>
<span className={"font-14"}>{item[0].name}</span>
<span className={"font-16"}>{item[0].name}</span>
</Link>
</span>
</p>
@ -308,7 +318,7 @@ class shixunAnswer extends Component{
{...this.props} {...this.state} challenge={item[0].outputs}
></ShixunAnswerDetail>
{ item[0].st===0 ? <div className="font-16 color-dark-21 mb10">
{ item[0].st===0 ? <div className="font-16 color-dark-21">
<div className="bor-grey-e mt15">
<p className="clearfix pt5 pb5 pl15 pr15 back-f6-grey codebox">
<span className="fl">最近通过的代码</span>
@ -316,7 +326,7 @@ class shixunAnswer extends Component{
</p>
<div className="test-code bor-top-greyE">
<li className="clearfix">
<li className="clearfix resetCodeMirrorStyle">
<CodeMirror
value={item[0].passed_code}
options={{

@ -103,7 +103,7 @@ class GraduateTopicDetail extends Component{
return(
<div className="newMain">
<div className="educontent mt10 mb50">
<p className="clearfix mb10">
<p className="clearfix mb15 lineh-20">
<WordsBtn style="grey" className="fl" to={`/courses/${tableData.course_id}`}>{tableData && tableData.course_name}</WordsBtn>
<span className="color-grey-9 fl ml3 mr3">&gt;</span>
<WordsBtn style="grey" className="fl" to={`/courses/${tableData.course_id}/graduation_topics/${tableData.graduation_id}`}>{tableData.graduation_name}</WordsBtn>
@ -111,9 +111,9 @@ class GraduateTopicDetail extends Component{
<span>选题详情</span>
</p>
<p className="clearfix mb20 lineh-25">
<span className="color-grey-3 font-24 fl task-hide" style={{lineHeight:"30px",maxWidth:"900px"}}>{tableData && tableData.graduation_topic_name}</span>
<span className="fl mt4" style={{height:"25px"}}><CoursesListType typelist={[`${tableData && tableData.status_name}`]} typesylename={""} /></span>
<WordsBtn className="fr font-16 mt2" style="grey" onClick={()=>this.props.history.goBack()}>返回</WordsBtn>
<span className="color-grey-3 font-24 fl task-hide" style={{lineHeight:"25px",maxWidth:"900px"}}>{tableData && tableData.graduation_topic_name}</span>
<span className="fl mt1" style={{height:"25px"}}><CoursesListType typelist={[`${tableData && tableData.status_name}`]} typesylename={""} /></span>
<WordsBtn className="fr font-16 mt1" style="grey" onClick={()=>this.props.history.goBack()}>返回</WordsBtn>
</p>
<div>
<div className="clearfix edu-back-white bor-bottom-greyE" >

@ -169,6 +169,7 @@ class GraduateTopicDetailTable extends Component{
} = this.state
const isAdmin =this.props.isAdmin();
const isStudent =this.props.isStudent();
const isNotMember=this.props.isNotMember();
console.log(un_addClass_notice)
return(
<div className="minH-560 edu-back-white">
@ -176,7 +177,7 @@ class GraduateTopicDetailTable extends Component{
<div className="topHead edu-txt-center">
<span style={{"width":"5%"}}>序号</span>
<span style={{"width":"12%"}}>姓名</span>
<span style={{"width":"13%"}}>学号</span>
{isNotMember ?"" :<span style={{"width":"13%"}}>学号</span>}
<span style={{"width":"15%"}}>分班</span>
<span style={{"width":"15%"}}>选题时间</span>
<span style={{"width":"12%"}} className="fr">操作</span>
@ -260,7 +261,7 @@ class GraduateTopicDetailTable extends Component{
<li className="color-grey-9 clearfix" key={key}>
<span style={{"width":"5%"}} className="color-grey-6">{parseInt(key+1)+(parseInt(page-1)*15)}</span>
<span style={{"width":"12%"}} className="color-grey-3">{item.student_name}</span>
<span style={{"width":"13%"}}>{item.student_id}</span>
{isNotMember ?"" :<span style={{"width":"13%"}}>{item.student_id}</span>}
<span style={{"width":"15%"}}>{item.class_group_name || "--"}</span>
<span style={{"width":"15%"}}>{item.selected_time}</span>
{
@ -288,6 +289,9 @@ class GraduateTopicDetailTable extends Component{
isAdmin &&
<span style={{"width":"12%"}} className={item.result === "已拒绝"?"fr color-orange-tip":"fr"}>{item.result=== "待确认"?"--":item.result}</span>
}
{
isNotMember && <span style={{"width":"12%"}} className="fr color-grey-9">--</span>
}
</li>
)

@ -70,9 +70,9 @@ class GraduateTopicItem extends Component{
`}</style>
<h6>
{
isNotMember?discussMessage.private_icon===true?
<a className="fl mt3 font-16 font-bd color-dark maxwidth580">{discussMessage.name}</a>:<a onClick={() => this.toDetailPage(`${discussMessage.id}`)}
className="fl mt3 font-16 font-bd color-dark maxwidth580">{discussMessage.name}</a>:""
isNotMember && discussMessage.private_icon===true ?
<a className="fl mt3 font-16 font-bd color-dark maxwidth580">{discussMessage.name}</a>:
<a onClick={() => this.toDetailPage(`${discussMessage.id}`)} className="fl mt3 font-16 font-bd color-dark maxwidth580">{discussMessage.name}</a>
}
{

@ -192,7 +192,12 @@ class PollDetailTabFirst extends Component{
key: 'classes',
dataIndex: 'classes',
width:160,
className:poll_types && poll_types.groups_count > 0 ? "edu-txt-center":"edu-txt-center none"
className:poll_types && poll_types.groups_count > 0 ? "edu-txt-center":"edu-txt-center none",
render:(classes,item,index)=>{
return(
item.classes ? <span>{item.classes}</span> : <span className="color-grey-9">--</span>
)
}
}, {
title: '提交状态',
dataIndex: 'status',
@ -212,22 +217,42 @@ class PollDetailTabFirst extends Component{
width:160,
render:(time,item,index)=>{
return(
item.time == null ? "--" : moment(item.time).format('YYYY-MM-DD HH:mm')
item.time == null ? <span className="color-grey-9">--</span> : moment(item.time).format('YYYY-MM-DD HH:mm')
)
}
},{
title: '操作',
dataIndex: 'operation',
key: 'operation',
className:poll_types && poll_types.un_anonymous ? "edu-txt-center":"edu-txt-center none",
className:"edu-txt-center",
width:120,
render:(operation,item,index)=>{
return(
item.status == 1 ? <WordsBtn style="blue" to={`/courses/${this.props.match.params.coursesId}/polls/${this.props.match.params.pollId}/users/${item.login}`}>查看</WordsBtn>:<span>--</span>
item.status == 1 ? <WordsBtn style="blue" to={`/courses/${this.props.match.params.coursesId}/polls/${this.props.match.params.pollId}/users/${item.login}`}>查看</WordsBtn>:<span className="color-grey-9">--</span>
)
}
}];
// 非课堂成员不显示学号列
let isNotMember =this.props.isNotMember();
if(isNotMember){
columns.some((item,key)=> {
if (item.title === "学号") {
columns.splice(key, 1)
return true
}
}
)
}
// un_anonymous true为实名问卷显示操作列否则隐藏
if(poll_types && (isNotMember || poll_types.un_anonymous == false)){
columns.some((item,key)=> {
if (item.title === "操作") {
columns.splice(key, 1)
return true
}
}
)
}
return(
<div>
{

@ -796,6 +796,11 @@ class Listofworks extends Component {
if(item.title==="效率分"){
columns.splice(key,1)
}
if(this.props.isNotMember()===true) {
if(item.title==="学号"){
this.state.columnss.splice(key,1)
}
}
})
}else{
if(course_group_info.length < 2){
@ -810,6 +815,11 @@ class Listofworks extends Component {
if(item.title==="效率分"){
columns.splice(key,1)
}
if(this.props.isNotMember()===true) {
if(item.title==="学号"){
this.state.columnss.splice(key,1)
}
}
})
}else {
@ -820,6 +830,11 @@ class Listofworks extends Component {
if(item.title==="效率分"){
columns.splice(key,1)
}
if(this.props.isNotMember()===true) {
if(item.title==="学号"){
this.state.columnss.splice(key,1)
}
}
})
}
}
@ -830,6 +845,11 @@ class Listofworks extends Component {
if(item.title==="分班"){
columns.splice(key,1)
}
if(this.props.isNotMember()===true) {
if(item.title==="学号"){
this.state.columnss.splice(key,1)
}
}
})
}else {
if(course_group_info.length < 2) {
@ -838,6 +858,11 @@ class Listofworks extends Component {
if(item.title==="分班"){
columns.splice(key,1)
}
if(this.props.isNotMember()===true) {
if(item.title==="学号"){
this.state.columnss.splice(key,1)
}
}
})
}
columns=this.state.columnss;
@ -1192,8 +1217,9 @@ class Listofworks extends Component {
course_groupyslstwo: [],
unlimited: 0,
loadingstate: true,
page:1,
})
this.Startsorting(this.state.order, [], this.state.checkedValuesineinfo, this.state.searchtext, this.state.page, this.state.limit);
this.Startsorting(this.state.order, [], this.state.checkedValuesineinfo, this.state.searchtext, 1, this.state.limit);
}
notlimitedst = () => {
@ -1204,7 +1230,7 @@ class Listofworks extends Component {
course_groupysls: undefined,
loadingstate: true,
})
this.Startsorting(this.state.order, this.state.course_groupyslstwo, [], this.state.searchtext, this.state.page, this.state.limit);
this.Startsorting(this.state.order, this.state.course_groupyslstwo, [], this.state.searchtext, 1, this.state.limit);
}
//立即截止确定按钮
coursetaskend = () => {
@ -1417,22 +1443,25 @@ class Listofworks extends Component {
font-size: 14px;
}
.drop_down_menu {
width: 121px;
width: 93px;
}
.drop_down_menu li {
overflow: visible;
width: 121px;
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":"-34px","left":"unset","height":"auto"}}>
<li><a href={`/api/student_works/${jobsettingsdata === undefined ? "" :jobsettingsdata.data.category.category_id}/export_shixun_work_report.pdf`} calssName="color-dark">实训报告</a></li>
<li><a href={`/api/homework_commons/${jobsettingsdata === undefined ? "" :jobsettingsdata.data.category.category_id}/works_list.xlsx`} calssName="color-dark">学生成绩</a></li>
<ul className="drop_down_menu" style={{"right":"-0px","left":"unset","height":"auto"}}>
<li><a href={`/api/student_works/${jobsettingsdata === undefined ? "" :jobsettingsdata.data.category.category_id}/export_shixun_work_report.pdf`} >实训报告</a></li>
<li><a href={`/api/homework_commons/${jobsettingsdata === undefined ? "" :jobsettingsdata.data.category.category_id}/works_list.xlsx`} >学生成绩</a></li>
</ul>
</li>:""}
{this.props.isAdmin() ?
@ -1529,16 +1558,16 @@ 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>
<div className="fr color-grey-6 edu-menu-panel">
<div className="fr edu-menu-panel">
<ul>
<li className="edu-position edu-position-hidebox">
<a className="font-12 color-grey-6">
<a className="font-12">
{order === "update_time" ? "时间" : order === "work_score" ? "成绩" : order === "student_id" ? "学号" : ""}排序</a>
<i className="iconfont icon-xiajiantou ml5 font-12 color-grey-6"></i>
<i className="iconfont icon-xiajiantou ml5 font-12 "></i>
<ul className="edu-position-hide undis mt10">
<li> <a onClick={(e) => this.funorder("update_time")} data-remote="true" className="color-grey-6 font-12" style={{"text-align": "center "}}>更新时间</a></li>
<li> <a onClick={(e) => this.funorder("work_score")} data-remote="true" className="color-grey-6 font-12" style={{"text-align": "center "}}>最终成绩</a></li>
<li> <a onClick={(e) => this.funorder("student_id")} data-remote="true" className="color-grey-6 font-12" style={{"text-align": "center "}}>学生学号</a></li>
<li> <a onClick={(e) => this.funorder("update_time")} data-remote="true" className=" font-12" style={{"text-align": "center "}}>更新时间</a></li>
<li> <a onClick={(e) => this.funorder("work_score")} data-remote="true" className=" font-12" style={{"text-align": "center "}}>最终成绩</a></li>
<li> <a onClick={(e) => this.funorder("student_id")} data-remote="true" className=" font-12" style={{"text-align": "center "}}>学生学号</a></li>
</ul>
</li>
</ul>
@ -1581,7 +1610,6 @@ class Listofworks extends Component {
columns={columns}
pagination={false}
loading={loadingstate}
onChange={this.TablePagination}
/>}
</div>
</div>

@ -60,7 +60,202 @@ class Listofworksstudentone extends Component {
"display": "none"
},
student_works: [],
startbtn: false
startbtn: false,
columns: [
{
title: '序号',
dataIndex: 'number',
key: 'number',
align: "center",
className:'font-14',
render: (text, record) => (
<span>
{record.number === undefined ?
<span style={{
"color": '#9A9A9A',
"text-align": "center"
}}> --</span>
: record.number === "" ?
<span style={{
"color": '#9A9A9A',
"text-align": "center"
}}>--</span>
: record.number === "--" ?
<span style={{
"color": '#9A9A9A',
"text-align": "center"
}}>--</span>
:
<span style={{
"color": '#07111B',
"text-align": "center"
}}> {record.number}</span>
}
</span>
),
},
{
title: '姓名',
dataIndex: 'name',
key: 'name',
align: "center",
className:'font-14',
render: (text, record) => (
<span>
{record.name === undefined ?
<span style={{
"color": '#9A9A9A',
"text-align": "center"
}}>--</span>
:
record.name === "" ?
<span style={{
"color": '#9A9A9A',
"text-align": "center"
}}>--</span>
:
record.name === null ?
<span style={{
"color": '#9A9A9A',
"text-align": "center"
}}>--</span>
:
record.name === "--" ?
<span style={{
"color": '#9A9A9A',
"text-align": "center"
}}>--</span>
:
<span style={{
"color": '#07111B',
"text-align": "center"
}}>{record.name}</span>
}
</span>
),
},
{
title: '学号',
dataIndex: 'stduynumber',
key: 'stduynumber',
align: "center",
className:'font-14',
render: (text, record) => (
<span>
<span style={{
"color": '#9A9A9A',
"text-align": "center"
}}>{record.stduynumber === undefined ? "--" : record.stduynumber === null ? "--" : record.stduynumber === "" ? "--" : record.stduynumber}</span>
</span>
),
},
{
title: '分班',
key: 'classroom',
dataIndex: 'classroom',
align: "center",
className:'font-14',
width:'288px',
render: (text, record) => (
<span>
<span style={{
"color": '#9A9A9A',
"text-align": "center"
}}>{record.classroom === undefined ? "--" : record.classroom === "" ? "--" : record.classroom === null ? "--" : record.classroom}</span>
</span>
),
},
{
title: '提交状态',
dataIndex: 'submitstate',
key: 'submitstate',
align: "center",
className:'font-14',
render: (text, record) => (
<span>
<span style={record.submitstate === "延时提交" ? {
"color": '#DD1717',
"text-align": "center"
} : record.submitstate === "按时提交" ? {"color": '#29BD8B', "text-align": "center"} : {
"color": '#747A7F',
"text-align": "center"
}}>{record.submitstate === undefined ? "--" : record.submitstate === "" ? "--" : record.submitstate === null ? "--" : record.submitstate}</span>
</span>
),
},
{
title: '更新时间',
dataIndex: 'updatetime',
key: 'updatetime',
align: "center",
className:'font-14',
render: (text, record) => (
<span>
<span style={{
"color": '#9A9A9A',
"text-align": "center"
}}>{record.updatetime === undefined ? "--" : record.updatetime === "" ? "--" : record.updatetime}</span>
</span>
),
},
{
title: '完成情况',
dataIndex: 'completion',
key: 'completion',
align: "center",
className:'font-14',
render: (text, record) => (
<span>
<span style={{"color": '#07111B', "text-align": "center"}}>{record.completion+"/"+this.state.challenges_count}</span>
</span>
),
},
{
title: '最终成绩',
dataIndex: 'levelscore',
key: 'levelscore',
align: "center",
className:'font-14',
render: (text, record) => (
<span>
{
record.levelscore && record.levelscore === "--"?
<span style={{"color": '#9A9A9A', "text-align": "center"}}>{record.levelscore}</span>
:
<span style={parseInt(record.levelscore) >=90 ? {
"color": '#DD1717',
"text-align": "center"
} : parseInt(record.levelscore) <= 60?{
"color": '#FF6800',
"text-align": "center",
}: {"color": '#747A7F', "text-align": "center"}}>{record.levelscore}</span>
}
</span>
),
},
{
title: '操作',
dataIndex: 'operating',
key: 'operating',
align: "center",
className:'font-14',
render: (text, record) => (
<span>
{
record.submitstate === "未提交" ?<span style={{ color: '#9A9A9A'}}>--</span>
:
<span style={{"text-align": "center"}}
className="color-blue"
onClick={() => this.Viewstudenttraininginformation(record)}>{record.operating}</span>
}
</span>
),
},
],
}
//
}
@ -112,9 +307,9 @@ class Listofworksstudentone extends Component {
challenges_count:result.data.challenges_count,
})
if (result.data.student_works === undefined || result.data.student_works === null || JSON.stringify(result.data.student_works) === "[]") {
this.seacthdata();
this.seacthdata(result.data);
} else {
this.seacthdatas();
this.seacthdatas(result.data,result.data.student_works);
}
}
@ -166,9 +361,9 @@ class Listofworksstudentone extends Component {
challenges_count:result.data.challenges_count,
})
if (result.data.student_works === undefined || result.data.student_works === null || JSON.stringify(result.data.student_works) === "[]") {
this.seacthdata();
this.seacthdata(result.data);
} else {
this.seacthdatas();
this.seacthdatas(result.data,result.data.student_works);
}
}
@ -187,20 +382,27 @@ class Listofworksstudentone extends Component {
}
seacthdatas = () => {
seacthdatas = (teacherdata,student_works) => {
let {page, limit} = this.state;
let datalist = [];
let datalists = [];
var styletable = {"display": "none"}
// console.log("seacthdata设置数据3")
this.state.columns.map((item,key)=>{
if(this.props.isNotMember()===true) {
if(item.title==="学号"){
this.state.columns.splice(key,1)
}
}
})
let columns2=this.state.columns;
var teacherlist = undefined;
var teacherlists = undefined;
if (this.state.teacherdata !== undefined) {
if (teacherdata !== undefined) {
// console.log("seacthdata设置数据")
// console.log(this.state.teacherdata.id )
if (this.state.teacherdata.id === undefined) {
if (teacherdata.id === undefined) {
this.setState({
data: [],
teacherlist: undefined,
@ -209,36 +411,36 @@ class Listofworksstudentone extends Component {
})
} else {
console.log(this.state.teacherdata)
if (this.state.teacherdata.id !== undefined || this.state.teacherdata.id !== null || this.state.teacherdata.id !== "") {
console.log(teacherdata)
if (teacherdata.id !== undefined || teacherdata.id !== null || teacherdata.id !== "") {
// console.log("seacthdata设置数据1")
// console.log(this.state.teacherdata )
var timedata = moment(this.state.teacherdata.update_time).format('YYYY-MM-DD HH:mm');
var timedata = moment(teacherdata.update_time).format('YYYY-MM-DD HH:mm');
datalist.push({
myid: this.state.teacherdata.id,
myid: teacherdata.id,
number: 1,
name: this.state.teacherdata.user_name,
stduynumber: this.state.teacherdata.student_id,
classroom: this.state.teacherdata.group_name,
submitstate: this.state.teacherdata.work_status === 0 ? "未提交" : this.state.teacherdata.work_status === 1 ? "按时提交" : this.state.teacherdata.work_status === 2 ? "延时提交" : "未提交",
name: teacherdata.user_name,
stduynumber: teacherdata.student_id,
classroom: teacherdata.group_name,
submitstate: teacherdata.work_status === 0 ? "未提交" : teacherdata.work_status === 1 ? "按时提交" : teacherdata.work_status === 2 ? "延时提交" : "未提交",
// updatetime:this.state.teacherdata.student_works[i].update_time,
// updatetime:"",
updatetime: timedata === "Invalid date" ? "--" : timedata,
completion: this.state.teacherdata.complete_count === null ? "0" :this.state.teacherdata.complete_count === undefined ? "0": this.state.teacherdata.complete_count,
levelscore: this.state.teacherdata.final_score,
efficiencyscore: this.state.teacherdata.eff_score,
finalscore: this.state.teacherdata.work_score,
completion: teacherdata.complete_count === null ? "0" :teacherdata.complete_count === undefined ? "0": teacherdata.complete_count,
levelscore: teacherdata.final_score,
efficiencyscore: teacherdata.eff_score,
finalscore: teacherdata.work_score,
operating: "查看",
late_penalty: this.state.teacherdata.late_penalty=== null?"0":this.state.teacherdata.late_penalty === undefined?"0":this.state.teacherdata.late_penalty,
ultimate_score:this.state.teacherdata.ultimate_score,
user_name: this.state.teacherdata.user_name,
user_login: this.state.teacherdata.user_login,
late_penalty: teacherdata.late_penalty=== null?"0":teacherdata.late_penalty === undefined?"0":teacherdata.late_penalty,
ultimate_score:teacherdata.ultimate_score,
user_name: teacherdata.user_name,
user_login: teacherdata.user_login,
})
// }
var teacherlist = { //分页
total: this.state.teacherdata.student_works.length, //数据总数量
pageSize: this.state.teacherdata.student_works.length, //一页显示几条
total: teacherdata.student_works.length, //数据总数量
pageSize: teacherdata.student_works.length, //一页显示几条
current: this.state.page,
}
styletable = {"display": "block",}
@ -252,30 +454,30 @@ class Listofworksstudentone extends Component {
}
if (this.state.student_works !== undefined) {
if (student_works !== undefined) {
for (var i = 0; i < this.state.student_works.length; i++) {
for (var i = 0; i <student_works.length; i++) {
var timedata = moment(this.state.student_works[i].update_time).format('YYYY-MM-DD HH:mm');
var timedata = moment(student_works[i].update_time).format('YYYY-MM-DD HH:mm');
datalists.push({
myid: this.state.student_works[i].id,
myid: student_works[i].id,
number: (parseInt(page) - 1) * parseInt(limit) + (i + 1),
name: this.state.student_works[i].user_name,
stduynumber: this.state.student_works[i].student_id,
classroom: this.state.student_works[i].group_name,
submitstate: this.state.student_works[i].work_status === 0 ? "未提交" : this.state.student_works[i].work_status === 1 ? "按时提交" : this.state.student_works[i].work_status === 2 ? "延时提交" : "未提交",
name: student_works[i].user_name,
stduynumber: student_works[i].student_id,
classroom: student_works[i].group_name,
submitstate: student_works[i].work_status === 0 ? "未提交" : student_works[i].work_status === 1 ? "按时提交" : student_works[i].work_status === 2 ? "延时提交" : "未提交",
// updatetime:this.state.teacherdata.student_works[i].update_time,
// updatetime:"",
updatetime: timedata === "Invalid date" ? "--" : timedata,
completion: this.state.teacherdata.student_works[i].complete_count === null ? "0" :this.state.teacherdata.student_works[i].complete_count === undefined ? "0": this.state.teacherdata.student_works[i].complete_count,
levelscore: this.state.student_works[i].final_score,
efficiencyscore: this.state.student_works[i].eff_score,
finalscore: this.state.student_works[i].work_score,
completion: student_works[i].complete_count === null ? "0" :student_works[i].complete_count === undefined ? "0":student_works[i].complete_count,
levelscore: student_works[i].final_score,
efficiencyscore: student_works[i].eff_score,
finalscore:student_works[i].work_score,
operating: "查看",
late_penalty: this.state.teacherdata.student_works[i].late_penalty=== null?"0":this.state.teacherdata.student_works[i].late_penalty === undefined?"0":this.state.teacherdata.student_works[i].late_penalty,
ultimate_score:this.state.teacherdata.student_works[i].ultimate_score,
user_name: this.state.teacherdata.student_works[i].user_name,
user_login: this.state.teacherdata.student_works[i].user_login,
late_penalty: student_works[i].late_penalty=== null?"0":student_works[i].late_penalty === undefined?"0":student_works[i].late_penalty,
ultimate_score:student_works[i].ultimate_score,
user_name: student_works[i].user_name,
user_login: student_works[i].user_login,
})
}
@ -297,15 +499,25 @@ class Listofworksstudentone extends Component {
teacherlists: teacherlists,
loadingstate: false,
styletable: styletable,
columns:columns2,
})
}
// 设置数据
seacthdata = () => {
seacthdata = (teacherdata) => {
let datalist = [];
if (this.state.teacherdata !== undefined) {
this.state.columns.map((item,key)=>{
if(this.props.isNotMember()===true) {
if(item.title==="学号"){
this.state.columns.splice(key,1)
}
}
})
let columns2=this.state.columns;
if (teacherdata !== undefined) {
// console.log("seacthdata设置数据")
// console.log(this.state.teacherdata.id )
if (this.state.teacherdata.id === undefined) {
if (teacherdata.id === undefined) {
this.setState({
data: [],
teacherlist: undefined,
@ -314,35 +526,35 @@ class Listofworksstudentone extends Component {
return
}
// console.log(this.state.teacherdata )
if (this.state.teacherdata.id !== undefined || this.state.teacherdata.id !== null || this.state.teacherdata.id !== "") {
if (teacherdata.id !== undefined || teacherdata.id !== null ||teacherdata.id !== "") {
// console.log("seacthdata设置数据1")
// console.log(this.state.teacherdata )
var timedata = moment(this.state.teacherdata.update_time).format('YYYY-MM-DD HH:mm');
var timedata = moment(teacherdata.update_time).format('YYYY-MM-DD HH:mm');
datalist.push({
myid: this.state.teacherdata.id,
myid: teacherdata.id,
number: 1,
name: this.state.teacherdata.user_name,
stduynumber: this.state.teacherdata.student_id,
classroom: this.state.teacherdata.group_name,
submitstate: this.state.teacherdata.work_status === 0 ? "未提交" : this.state.teacherdata.work_status === 1 ? "按时提交" : this.state.teacherdata.work_status === 2 ? "延时提交" : "未提交",
name: teacherdata.user_name,
stduynumber: teacherdata.student_id,
classroom: teacherdata.group_name,
submitstate: teacherdata.work_status === 0 ? "未提交" : teacherdata.work_status === 1 ? "按时提交" : teacherdata.work_status === 2 ? "延时提交" : "未提交",
// updatetime:this.state.teacherdata.student_works[i].update_time,
// updatetime:"",
updatetime: timedata === "Invalid date" ? "--" : timedata,
completion: this.state.teacherdata.complete_count === null ? "0" :this.state.teacherdata.complete_count === undefined ? "0": this.state.teacherdata.complete_count,
levelscore: this.state.teacherdata.final_score,
efficiencyscore: this.state.teacherdata.eff_score,
finalscore: this.state.teacherdata.work_score,
completion: teacherdata.complete_count === null ? "0" :teacherdata.complete_count === undefined ? "0": teacherdata.complete_count,
levelscore: teacherdata.final_score,
efficiencyscore: teacherdata.eff_score,
finalscore: teacherdata.work_score,
operating: "查看",
late_penalty: this.state.teacherdata.late_penalty=== null?"0":this.state.teacherdata.late_penalty === undefined?"0":this.state.teacherdata.late_penalty,
ultimate_score:this.state.teacherdata.ultimate_score,
user_name: this.state.teacherdata.user_name,
user_login: this.state.teacherdata.user_login,
late_penalty: teacherdata.late_penalty=== null?"0":teacherdata.late_penalty === undefined?"0":teacherdata.late_penalty,
ultimate_score:teacherdata.ultimate_score,
user_name: teacherdata.user_name,
user_login: teacherdata.user_login,
})
// }
var teacherlist = { //分页
total: this.state.teacherdata.student_works.length, //数据总数量
pageSize: this.state.teacherdata.student_works.length, //一页显示几条
total: teacherdata.student_works.length, //数据总数量
pageSize: teacherdata.student_works.length, //一页显示几条
current: this.state.page,
}
} else {
@ -361,6 +573,7 @@ class Listofworksstudentone extends Component {
data: datalist,
teacherlist: teacherlist,
loadingstate: false,
columns:columns2,
})
}
// 查看学员实训信息
@ -495,7 +708,7 @@ class Listofworksstudentone extends Component {
code_review: result.data.code_review,
challenges_count:result.data.challenges_count,
})
this.seacthdata();
this.seacthdata(result.data);
}
}).catch((error) => {
console.log(error)
@ -530,205 +743,8 @@ class Listofworksstudentone extends Component {
}
render() {
let {visibles, game_list, limit,experience, boolgalist,viewtrainingdata, teacherdata, page, data, jobsettingsdata, styletable, datas, order, loadingstate} = this.state;
let columns = [
{
title: '序号',
dataIndex: 'number',
key: 'number',
align: "center",
width: '96px',
render: (text, record) => (
<span>
{record.number === undefined ?
<a style={{
"color": '#9A9A9A',
"text-align": "center"
}}> --</a>
: record.number === "" ?
<a style={{
"color": '#9A9A9A',
"text-align": "center"
}}>--</a>
: record.number === "--" ?
<a style={{
"color": '#9A9A9A',
"text-align": "center"
}}>--</a>
:
<a style={{
"color": '#07111B',
"text-align": "center"
}}> {record.number}</a>
}
</span>
),
},
{
title: '姓名',
dataIndex: 'name',
key: 'name',
align: "center",
width: '147px',
render: (text, record) => (
<span>
{record.name === undefined ?
<a style={{
"color": '#9A9A9A',
"text-align": "center"
}}>--</a>
:
record.name === "" ?
<a style={{
"color": '#9A9A9A',
"text-align": "center"
}}>--</a>
:
record.name === null ?
<a style={{
"color": '#9A9A9A',
"text-align": "center"
}}>--</a>
:
record.name === "--" ?
<a style={{
"color": '#9A9A9A',
"text-align": "center"
}}>--</a>
:
<a style={{
"color": '#07111B',
"text-align": "center"
}}>{record.name}</a>
}
</span>
),
},
{
title: '学号',
dataIndex: 'stduynumber',
key: 'stduynumber',
align: "center",
width: '200px',
render: (text, record) => (
<span>
<a style={{
"color": '#9A9A9A',
"text-align": "center"
}}>{record.stduynumber === undefined ? "--" : record.stduynumber === null ? "--" : record.stduynumber === "" ? "--" : record.stduynumber}</a>
</span>
),
},
{
title: '分班',
key: 'classroom',
dataIndex: 'classroom',
align: "center",
render: (text, record) => (
<span>
<a style={{
"color": '#9A9A9A',
"text-align": "center"
}}>{record.classroom === undefined ? "--" : record.classroom === "" ? "--" : record.classroom === null ? "--" : record.classroom}</a>
</span>
),
},
{
title: '提交状态',
dataIndex: 'submitstate',
key: 'submitstate',
align: "center",
render: (text, record) => (
<span>
<a style={record.submitstate === "延时提交" ? {
"color": '#DD1717',
"text-align": "center"
} : record.submitstate === "按时提交" ? {"color": '#29BD8B', "text-align": "center"} : {
"color": '#747A7F',
"text-align": "center"
}}>{record.submitstate === undefined ? "--" : record.submitstate === "" ? "--" : record.submitstate === null ? "--" : record.submitstate}</a>
</span>
),
},
{
title: '更新时间',
dataIndex: 'updatetime',
key: 'updatetime',
align: "center",
render: (text, record) => (
<span>
<a style={{
"color": '#9A9A9A',
"text-align": "center"
}}>{record.updatetime === undefined ? "--" : record.updatetime === "" ? "--" : record.updatetime}</a>
</span>
),
},
{
title: '完成情况',
dataIndex: 'completion',
key: 'completion',
align: "center",
render: (text, record) => (
<span>
<a style={{"color": '#07111B', "text-align": "center"}}>{record.completion+"/"+this.state.challenges_count}</a>
</span>
),
},
{
title: '最终成绩',
dataIndex: 'levelscore',
key: 'levelscore',
align: "center",
render: (text, record) => (
<span>
{
record.levelscore && record.levelscore === "--"?
<a style={{"color": '#9A9A9A', "text-align": "center"}}>{record.levelscore}</a>
:
<a style={parseInt(record.levelscore) > 90 ? {
"color": '#DD1717',
"text-align": "center"
} : parseInt(record.levelscore) <= 90 ? {
"color": '#FF6800',
"text-align": "center",
"margin-left": "20px"
} : parseInt(record.levelscore) <= 60 ? {
"color": '#747A7F',
"text-align": "center"
} : {"color": '#747A7F', "text-align": "center"}}>{record.levelscore}</a>
}
let {visibles, game_list,columns, limit,experience, boolgalist,viewtrainingdata, teacherdata, page, data, jobsettingsdata, styletable, datas, order, loadingstate} = this.state;
</span>
),
},
{
title: '操作',
dataIndex: 'operating',
key: 'operating',
align: "center",
width: '96px',
render: (text, record) => (
<span>
{
record.submitstate === "未提交" ?<span style={{ color: '#9A9A9A'}}>--</span>
:
<a style={{"text-align": "center"}}
className="color-blue"
onClick={() => this.Viewstudenttraininginformation(record)}>{record.operating}</a>
}
</span>
),
},
];
// console.log("teacherdatateacherdatateacherdata");
// console.log(teacherdata);
// console.log("teacherdata.work_count");
// console.log(teacherdata&&teacherdata.work_count);
return (
teacherdata === undefined || teacherdata.student_works === undefined || teacherdata.student_works === null || JSON.stringify(teacherdata.student_works) === "[]" ?
// 学生不能查看别人的
@ -981,12 +997,12 @@ class Listofworksstudentone extends Component {
style={{"color": '#FF6800'}}>{teacherdata.left_time.time}</span>}
</span>
<div className="fr color-grey-6 edu-menu-panel">
<div className="fr edu-menu-panel">
<ul>
<li className="edu-position edu-position-hidebox">
<a className="font-12 color-grey-6">
<a className="font-12 ">
{order === "updated_at" ? "时间" : order === "work_score" ? "成绩" : order === "student_id" ? "学号" : ""}排序</a>
<i className="iconfont icon-xiajiantou ml5 font-12 color-grey-6"></i>
<i className="iconfont icon-xiajiantou ml5 font-12 "></i>
<ul className="edu-position-hide undis mt10">
<li><a onClick={(e) => this.funorder("updated_at")} data-remote="true"
className="color-grey-6 font-12" style={{"text-align": "center "}}>更新时间</a></li>
@ -1016,7 +1032,6 @@ class Listofworksstudentone extends Component {
columns={columns}
pagination={false}
loading={loadingstate}
onChange={this.TablePagination}
/>}
</div>
{

Loading…
Cancel
Save