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

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

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

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

Loading…
Cancel
Save