调整导航栏切换编辑

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

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

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

Loading…
Cancel
Save