调整导航栏切换编辑

dev_sync_trustie
杨树明 5 years ago
parent 57690077a2
commit ddf7bbfcbf

@ -119,10 +119,7 @@ class CompetitionCommon extends Component{
}
getrightdata=(id,typeid,module_url,has_url,listkey)=>{
this.setState({
module_id:id,
module_type:typeid
})
if(typeid==="enroll"){
this.props.history.replace(`/newcompetitions/${this.props.match.params.identifier}/enroll`);
return
@ -146,6 +143,10 @@ class CompetitionCommon extends Component{
return
}
this.setState({
module_id:id,
module_type:typeid
})
}
Competitionedit=()=>{

@ -14,8 +14,8 @@ class CompetitionContentsMd extends Component{
}
}
componentDidUpdate =(prevState)=>{
if(prevState.tabkey!=this.props.tabkey){
this.getchartdata()
if(prevState!=this.props){
this.getchartdata();
}
}
componentDidMount(){
@ -26,30 +26,37 @@ class CompetitionContentsMd extends Component{
getchartdata=()=>{
let {mdContentdata,chart_rules}=this.props;
// is_pdf: false
if(this.props.module_type==="chart"){
let type=true;
chart_rules.rule_contents.map((items,keys)=>{
if(parseInt(this.props.tabkey)===items.competition_stage_id){
console.log(items)
this.contentMdRef.current.setValue(items.content);
if(chart_rules===undefined){
}else{
chart_rules.rule_contents.map((items,keys)=>{
debugger
if(parseInt(this.props.tabkey)===items.competition_stage_id){
console.log(items)
this.contentMdRef.current.setValue(items.content);
this.setState({
contentFileList:undefined,
chartmodule_id:items.id
})
type=false;
}
})
if(type===true){
this.contentMdRef.current.setValue("");
this.setState({
contentFileList:undefined,
chartmodule_id:items.id
chartmodule_id:undefined
})
type=false;
}
})
if(type===true){
this.contentMdRef.current.setValue("");
this.setState({
contentFileList:undefined,
chartmodule_id:undefined
})
}
}
}else{
let contentFileList = mdContentdata===undefined?[]:mdContentdata.attachments===undefined?[]:mdContentdata.attachments.map((item) => {
return {

Loading…
Cancel
Save