个人主页:fix bug

dev_forum
caishi 6 years ago
parent 8300491b27
commit b6e36fd02e

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

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

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

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

Loading…
Cancel
Save