调整试卷和问卷编辑权限

dev_hjm_a
杨树明 5 years ago
parent c1a57c1d85
commit 3f3484c815

@ -104,6 +104,10 @@ class Exercisesetting extends Component{
if(this.props.Commonheadofthetestpaper!=undefined){ if(this.props.Commonheadofthetestpaper!=undefined){
this.editSetting() this.editSetting()
} }
if(this.props.isAdmin() === false){
this.cancelEdit()
}
} }
componentDidUpdate = (prevProps) => { componentDidUpdate = (prevProps) => {
if(prevProps.Commonheadofthetestpaper!= this.props.Commonheadofthetestpaper){ if(prevProps.Commonheadofthetestpaper!= this.props.Commonheadofthetestpaper){

@ -86,6 +86,10 @@ class PollDetailTabForth extends Component{
if(this.props.pollDetail!=undefined){ if(this.props.pollDetail!=undefined){
this.editSetting(); this.editSetting();
} }
if(this.props.isAdmin() === false){
this.cancelEdit()
}
} }
componentDidUpdate = (prevProps) => { componentDidUpdate = (prevProps) => {
if(prevProps.pollDetail!= this.props.pollDetail){ if(prevProps.pollDetail!= this.props.pollDetail){
@ -640,7 +644,7 @@ class PollDetailTabForth extends Component{
</div> </div>
</div> </div>
{ {
flagPageEdit ? flagPageEdit&& this.props.isAdmin() === true ?
<div className="clearfix mt30 mb30"> <div className="clearfix mt30 mb30">
<Button type="primary" htmlType="submit" className="defalutSubmitbtn fl mr20">提交</Button> <Button type="primary" htmlType="submit" className="defalutSubmitbtn fl mr20">提交</Button>
<a className="defalutCancelbtn fl" onClick={this.cancelEdit}>取消</ a> <a className="defalutCancelbtn fl" onClick={this.cancelEdit}>取消</ a>

Loading…
Cancel
Save