PCqiandao
杨树林 5 years ago
parent dca59351cf
commit 4c1de925ad

@ -75,7 +75,9 @@ class ExerciseListItem extends Component{
let{item,checkBox,index}=this.props; let{item,checkBox,index}=this.props;
let {coursesId,Id}=this.props.match.params let {coursesId,Id}=this.props.match.params
const IsAdmin =this.props.isAdmin(); const IsAdmin =this.props.isAdmin();
const IsStudent =this.props.isStudent(); const isAssistant=this.props.isAssistant();
const IsStudent =this.props.isStudent();
return( return(
<div className="workList_Item" style={{cursor : IsAdmin ? "pointer" : "default",padding:"30px" }} onClick={() => window.$(`.exerciseitem${index} input`).click() }> <div className="workList_Item" style={{cursor : IsAdmin ? "pointer" : "default",padding:"30px" }} onClick={() => window.$(`.exerciseitem${index} input`).click() }>
@ -188,24 +190,31 @@ class ExerciseListItem extends Component{
{ IsAdmin &&<div className="homepagePostSetting" style={{"right":"-17px","top":"46px","display":"block","width":"200px"}}> { IsAdmin &&<div className="homepagePostSetting" style={{"right":"-17px","top":"46px","display":"block","width":"200px"}}>
{ {
item&&item.assistant_auth===true? isAssistant===true?
<a className="btn colorblue font-16 ml20" onClick={()=>this.toDetailPage(`/classrooms/${coursesId}/exercises/${item.id}/student_exercise_list?tab=0`)}>查看详情</a> (
item&&item.assistant_auth===true?
<a className="btn colorblue font-16 ml20" onClick={()=>this.toDetailPage(`/classrooms/${coursesId}/exercises/${item.id}/student_exercise_list?tab=0`)}>查看详情</a>
:
<a className="btn colorblue font-16 " style={{
marginLeft: "73px"
}} onClick={()=>this.toDetailPage(`/classrooms/${coursesId}/exercises/${item.id}/student_exercise_list?tab=0`)}>查看详情</a>
)
: :
<a className="btn colorblue font-16 " style={{ <a className="btn colorblue font-16 ml20" onClick={()=>this.toDetailPage(`/classrooms/${coursesId}/exercises/${item.id}/student_exercise_list?tab=0`)}>查看详情</a>
marginLeft: "73px"
}} onClick={()=>this.toDetailPage(`/classrooms/${coursesId}/exercises/${item.id}/student_exercise_list?tab=0`)}>查看详情</a>
} }
{ {
item&&item.assistant_auth===true? isAssistant===true?
<Link className="btn colorblue font-16 ml20" to={`/classrooms/${coursesId}/exercises/${item.id}/edit`}>编辑</Link> (
item&&item.assistant_auth===true?
<Link className="btn colorblue font-16 ml20" to={`/classrooms/${coursesId}/exercises/${item.id}/edit`}>编辑</Link>
:
""
)
: :
"" <Link className="btn colorblue font-16 ml20" to={`/classrooms/${coursesId}/exercises/${item.id}/edit`}>编辑</Link>
} }
<Link className="btn colorblue ml20 font-16" to={`/classrooms/${coursesId}/exercises/${item.id}/student_exercise_list?tab=3`}>设置</Link> <Link className="btn colorblue ml20 font-16" to={`/classrooms/${coursesId}/exercises/${item.id}/student_exercise_list?tab=3`}>设置</Link>
</div> } </div> }

@ -97,6 +97,8 @@ class Exercisesetting extends Component{
assistant_auth:this.props.assistant_auth, assistant_auth:this.props.assistant_auth,
}) })
this.getSettingInfo(); this.getSettingInfo();
// window.addEventListener('click', this.handleClick); // window.addEventListener('click', this.handleClick);
@ -113,6 +115,24 @@ class Exercisesetting extends Component{
if(this.props.isAdmin() === false){ if(this.props.isAdmin() === false){
this.cancelEdit() this.cancelEdit()
} }
try {
//是否为助教
if(this.props.isAssistant()===true){
//如果是助教是否有权限
if(this.props.assistant_auth===true){
this.setState({
flagPageEdit:true
})
}else{
this.setState({
flagPageEdit:false
})
}
}
}catch (e) {
}
} }
componentDidUpdate = (prevProps) => { componentDidUpdate = (prevProps) => {
if(prevProps.Commonheadofthetestpaper!= this.props.Commonheadofthetestpaper){ if(prevProps.Commonheadofthetestpaper!= this.props.Commonheadofthetestpaper){

@ -1158,12 +1158,17 @@ class Studentshavecompletedthelist extends Component {
<span> <span>
{ {
record.submitstate === "未提交"||record.commit_method===5? record.submitstate === "未提交"||record.commit_method===5?
( (//是否助教
this.props.assistant_auth&&this.props.assistant_auth===true? this.props.isAssistant()&&this.props.isAssistant()===true?
( (//助教是否有权限
this.props.Commonheadofthetestpaper && this.props.Commonheadofthetestpaper.exercise_status===3? this.props.assistant_auth&&this.props.assistant_auth===true?
<a style={{textAlign: "center"}} className="color-blue" (//是否截止
target="_blank" onClick={() => this.Adjustment(record.user_id)}>评阅</a> this.props.Commonheadofthetestpaper && this.props.Commonheadofthetestpaper.exercise_status===3?
<a style={{textAlign: "center"}} className="color-blue"
target="_blank" onClick={() => this.Adjustment(record.user_id)}>评阅</a>
:
<span style={{textAlign: "center", color: '#999999'}}>--</span>
)
: :
<span style={{textAlign: "center", color: '#999999'}}>--</span> <span style={{textAlign: "center", color: '#999999'}}>--</span>
) )
@ -1178,7 +1183,7 @@ class Studentshavecompletedthelist extends Component {
: :
<span style={{textAlign: "center", color: '#999999'}}>--</span> <span style={{textAlign: "center", color: '#999999'}}>--</span>
} }
</span> </span>
) )
}, },
], ],
@ -1387,12 +1392,17 @@ class Studentshavecompletedthelist extends Component {
<span> <span>
{ {
record.submitstate === "未提交"||record.commit_method===5? record.submitstate === "未提交"||record.commit_method===5?
( (//是否助教
this.props.assistant_auth&&this.props.assistant_auth===true? this.props.isAssistant()&&this.props.isAssistant()===true?
( (//助教是否有权限
this.props.Commonheadofthetestpaper && this.props.Commonheadofthetestpaper.exercise_status===3? this.props.assistant_auth&&this.props.assistant_auth===true?
<a style={{textAlign: "center"}} className="color-blue" (//是否截止
target="_blank" onClick={() => this.Adjustment(record.user_id)}>评阅</a> this.props.Commonheadofthetestpaper && this.props.Commonheadofthetestpaper.exercise_status===3?
<a style={{textAlign: "center"}} className="color-blue"
target="_blank" onClick={() => this.Adjustment(record.user_id)}>评阅</a>
:
<span style={{textAlign: "center", color: '#999999'}}>--</span>
)
: :
<span style={{textAlign: "center", color: '#999999'}}>--</span> <span style={{textAlign: "center", color: '#999999'}}>--</span>
) )
@ -1407,7 +1417,7 @@ class Studentshavecompletedthelist extends Component {
: :
<span style={{textAlign: "center", color: '#999999'}}>--</span> <span style={{textAlign: "center", color: '#999999'}}>--</span>
} }
</span> </span>
) )
}, },
],//columnsystwo 也会被columnsys当作参数接收 ],//columnsystwo 也会被columnsys当作参数接收

@ -297,7 +297,9 @@ class Testpapersettinghomepage extends Component{
render(){ render(){
let {tab,visible,Commonheadofthetestpaper,exercise_status,assistant_auth}=this.state; let {tab,visible,Commonheadofthetestpaper,exercise_status,assistant_auth}=this.state;
const isAdmin =this.props.isAdmin(); const isAdmin =this.props.isAdmin();
const isStudent = this.props.isStudent(); const isAssistant=this.props.isAssistant();
const isStudent = this.props.isStudent();
// TODO // TODO
//console.log(Commonheadofthetestpaper.exercise_status); //console.log(Commonheadofthetestpaper.exercise_status);
@ -361,7 +363,26 @@ class Testpapersettinghomepage extends Component{
<div className="stud-class-set bor-bottom-greyE "> <div className="stud-class-set bor-bottom-greyE ">
<div className=" clearfix edu-back-white pl30 pr30"> <div className=" clearfix edu-back-white pl30 pr30">
<div className="fl task_menu_ul"> <div className="fl task_menu_ul">
{this.props.isAdmin()===true? {isAssistant===true?
(
assistant_auth===true?
<Menu mode="horizontal" selectedKeys={tab} onClick={this.changeTab}>
<Menu.Item key="0" className={"exercisesafonts"}>答题列表</Menu.Item>
<Menu.Item key="1" className={"exercisesafonts"}>统计结果</Menu.Item>
<Menu.Item key="2" className={"exercisesafonts"}>试卷预览</Menu.Item>
<Menu.Item key="3" className={"exercisesafonts"}>设置</Menu.Item>
</Menu>
:
<Menu mode="horizontal" selectedKeys={tab} onClick={this.changeTab}>
<Menu.Item key="0" className={"exercisesafonts"}>答题列表</Menu.Item>
{Commonheadofthetestpaper&&Commonheadofthetestpaper.show_statistic===true?
Commonheadofthetestpaper && Commonheadofthetestpaper.exercise_status===3?
<Menu.Item key="1" className={"exercisesafonts"}>统计结果</Menu.Item>:"":""}
<Menu.Item key="3" className={"exercisesafonts"}>设置</Menu.Item>
</Menu>
)
:
this.props.isAdmin()===true?
<Menu mode="horizontal" selectedKeys={tab} onClick={this.changeTab}> <Menu mode="horizontal" selectedKeys={tab} onClick={this.changeTab}>
<Menu.Item key="0" className={"exercisesafonts"}>答题列表</Menu.Item> <Menu.Item key="0" className={"exercisesafonts"}>答题列表</Menu.Item>
<Menu.Item key="1" className={"exercisesafonts"}>统计结果</Menu.Item> <Menu.Item key="1" className={"exercisesafonts"}>统计结果</Menu.Item>
@ -445,7 +466,23 @@ class Testpapersettinghomepage extends Component{
getsetdata={this.getsetdata} getsetdata={this.getsetdata}
></ImmediatelyPublish> ></ImmediatelyPublish>
:"":""} :"":""}
{isAdmin === true? <Link className="fr color-blue font-16 mt20 mr20" to={`/classrooms/${this.props.match.params.coursesId}/exercises/${this.props.match.params.Id}/edit`}>编辑试卷</Link>:""} {/*const isAdminOrTeacher*/}
{/*assistant_auth===true*/}
{/**/}
{isAdmin === true?
(
isAssistant===true?
(
assistant_auth===true?
<Link className="fr color-blue font-16 mt20 mr20" to={`/classrooms/${this.props.match.params.coursesId}/exercises/${this.props.match.params.Id}/edit`}>编辑试卷</Link>
:
""
)
:
<Link className="fr color-blue font-16 mt20 mr20" to={`/classrooms/${this.props.match.params.coursesId}/exercises/${this.props.match.params.Id}/edit`}>编辑试卷</Link>
)
:""}
{isAdmin === false && this.props.current_user !== undefined? {isAdmin === false && this.props.current_user !== undefined?
Commonheadofthetestpaper&&Commonheadofthetestpaper.user_permission.current_status===2? Commonheadofthetestpaper&&Commonheadofthetestpaper.user_permission.current_status===2?

@ -276,6 +276,10 @@ export function TPMIndexHOC(WrappedComponent) {
isAdminOrTeacher = () => { isAdminOrTeacher = () => {
return this.state.coursedata&&this.state.coursedata.course_identity < 4 return this.state.coursedata&&this.state.coursedata.course_identity < 4
} }
// 助教===4
isAssistant=()=>{
return this.state.coursedata&&this.state.coursedata.course_identity ===4
}
// 超管、运维、课堂管理、老师、助教0-4 // 超管、运维、课堂管理、老师、助教0-4
isAdmin = () => { isAdmin = () => {
return this.state.coursedata&&this.state.coursedata.course_identity < 5 return this.state.coursedata&&this.state.coursedata.course_identity < 5
@ -711,6 +715,7 @@ export function TPMIndexHOC(WrappedComponent) {
isAdmin: this.isAdmin, isAdmin: this.isAdmin,
isAdminOrTeacher: this.isAdminOrTeacher, isAdminOrTeacher: this.isAdminOrTeacher,
isAssistant:this.isAssistant,
isStudent: this.isStudent, isStudent: this.isStudent,
isAdminOrStudent: this.isAdminOrStudent, isAdminOrStudent: this.isAdminOrStudent,
isNotMember: this.isNotMember, isNotMember: this.isNotMember,

Loading…
Cancel
Save