|
|
|
@ -41,7 +41,8 @@ class CaseNew extends Component{
|
|
|
|
|
loading: false,
|
|
|
|
|
checkTag:false,
|
|
|
|
|
checkFile:false,
|
|
|
|
|
coverID:undefined
|
|
|
|
|
coverID:undefined,
|
|
|
|
|
library_tags:undefined
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -132,6 +133,17 @@ class CaseNew extends Component{
|
|
|
|
|
if(this.props.match.params.caseID){
|
|
|
|
|
this.InitEditData();
|
|
|
|
|
}
|
|
|
|
|
let url=`/library_tags.json`;
|
|
|
|
|
axios.get(url).then((result) => {
|
|
|
|
|
console.log(result)
|
|
|
|
|
if(result.data.status===0){
|
|
|
|
|
this.setState({
|
|
|
|
|
library_tags:result.data.library_tags
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
}).catch((error) => {
|
|
|
|
|
console.log(error);
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
componentDidUpdate=(prevState)=>{
|
|
|
|
@ -263,7 +275,7 @@ class CaseNew extends Component{
|
|
|
|
|
render(){
|
|
|
|
|
let { caseID } = this.props.match.params;
|
|
|
|
|
let { CaseDetail } = this.props;
|
|
|
|
|
let { casesTags , contentFileList , imageUrl , checkTag , checkFile } = this.state;
|
|
|
|
|
let { casesTags , contentFileList , imageUrl , checkTag , checkFile,library_tags } = this.state;
|
|
|
|
|
const {getFieldDecorator} = this.props.form;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -301,8 +313,8 @@ class CaseNew extends Component{
|
|
|
|
|
action:`${getUploadActionUrl()}`,
|
|
|
|
|
onChange:this.handleChange,
|
|
|
|
|
}
|
|
|
|
|
console.log('111');
|
|
|
|
|
console.log(!caseID || (CaseDetail && CaseDetail.status == "pending"));
|
|
|
|
|
// console.log('111');
|
|
|
|
|
// console.log(!caseID || (CaseDetail && CaseDetail.status == "pending"));
|
|
|
|
|
return(
|
|
|
|
|
<div className="educontent mt10 mb50">
|
|
|
|
|
<style>
|
|
|
|
@ -380,9 +392,11 @@ class CaseNew extends Component{
|
|
|
|
|
<div className={checkTag==true ? "clearfix mb20 pr has-error" : "clearfix mb20"} id="tagFormItem">
|
|
|
|
|
<span className="upload_Title must">标签</span>
|
|
|
|
|
<ul className="fl libraries_tab">
|
|
|
|
|
<li className={ casesTags.indexOf(1) > -1 ? "active" :"" } onClick={()=>this.changeType(1)}>获奖案例</li>
|
|
|
|
|
<li className={ casesTags.indexOf(2) > -1 ? "active" :"" } onClick={()=>this.changeType(2)}>入库案例</li>
|
|
|
|
|
<li className={ casesTags.indexOf(3) > -1 ? "active" :"" } onClick={()=>this.changeType(3)}>企业案例</li>
|
|
|
|
|
{library_tags&&library_tags.map((item,key)=>{
|
|
|
|
|
return(
|
|
|
|
|
<li key={key} className={ casesTags.indexOf(item.id) > -1 ? "active" :"" } onClick={()=>this.changeType(item.id)}>{item.name}</li>
|
|
|
|
|
)
|
|
|
|
|
})}
|
|
|
|
|
</ul>
|
|
|
|
|
{
|
|
|
|
|
checkTag && <div class="ant-form-explain">请选择标签</div>
|
|
|
|
|