|
|
@ -45,6 +45,12 @@ class Selectsetting extends Component{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
componentDidMount() {
|
|
|
|
componentDidMount() {
|
|
|
|
|
|
|
|
this.getalldata();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
getalldata=()=>{
|
|
|
|
let {discussMessageid} =this.props;
|
|
|
|
let {discussMessageid} =this.props;
|
|
|
|
let course_id=this.props.course_id;
|
|
|
|
let course_id=this.props.course_id;
|
|
|
|
let url="/files/"+discussMessageid+".json";
|
|
|
|
let url="/files/"+discussMessageid+".json";
|
|
|
@ -70,19 +76,10 @@ class Selectsetting extends Component{
|
|
|
|
console.log(error);
|
|
|
|
console.log(error);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
getalldata=()=>{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
componentDidUpdate = (prevProps) => {
|
|
|
|
componentDidUpdate = (prevProps) => {
|
|
|
|
|
|
|
|
|
|
|
|
if ( prevProps.visible != this.props.visible ) {
|
|
|
|
if ( prevProps.visible != this.props.visible ) {
|
|
|
|
console.log(prevProps)
|
|
|
|
|
|
|
|
console.log(this.props)
|
|
|
|
|
|
|
|
this.setState({
|
|
|
|
this.setState({
|
|
|
|
visible:this.props.visible
|
|
|
|
visible:this.props.visible
|
|
|
|
})
|
|
|
|
})
|
|
|
@ -105,7 +102,6 @@ class Selectsetting extends Component{
|
|
|
|
ModalSave:this.hidecouseShixunModal,
|
|
|
|
ModalSave:this.hidecouseShixunModal,
|
|
|
|
loadtype:false
|
|
|
|
loadtype:false
|
|
|
|
})
|
|
|
|
})
|
|
|
|
this.props.Cancel()
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
savecouseShixunModal=()=>{
|
|
|
|
savecouseShixunModal=()=>{
|
|
|
@ -152,9 +148,10 @@ class Selectsetting extends Component{
|
|
|
|
delay_publish:Radiovalue
|
|
|
|
delay_publish:Radiovalue
|
|
|
|
}).then((result)=>{
|
|
|
|
}).then((result)=>{
|
|
|
|
if(result.data.status===0){
|
|
|
|
if(result.data.status===0){
|
|
|
|
|
|
|
|
this.hidecouseShixunModal()
|
|
|
|
this.props.setupdate(attachmentId)
|
|
|
|
this.props.setupdate(attachmentId)
|
|
|
|
this.props.showNotification("设置资源成功");
|
|
|
|
this.props.showNotification("设置资源成功");
|
|
|
|
this.hidecouseShixunModal()
|
|
|
|
this.props.Cancel()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
@ -233,6 +230,35 @@ class Selectsetting extends Component{
|
|
|
|
Radiovalue: e.target.value,
|
|
|
|
Radiovalue: e.target.value,
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
delectfils=(id)=>{
|
|
|
|
|
|
|
|
this.setState({
|
|
|
|
|
|
|
|
Modalstype:true,
|
|
|
|
|
|
|
|
Modalstopval:"是否确定删除该历史资源?",
|
|
|
|
|
|
|
|
ModalSave:()=>this.delectcousedelectfils(id),
|
|
|
|
|
|
|
|
ModalCancel:this.hidecouseShixunModal,
|
|
|
|
|
|
|
|
loadtype:false
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
delectcousedelectfils=(id)=>{
|
|
|
|
|
|
|
|
const url = `/attachments/${id}.json`;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
axios.delete(url)
|
|
|
|
|
|
|
|
.then((response) => {
|
|
|
|
|
|
|
|
if (response.data.status == 0) {
|
|
|
|
|
|
|
|
// {"status":1,"message":"删除成功"}
|
|
|
|
|
|
|
|
this.props.showNotification(response.data.message);
|
|
|
|
|
|
|
|
this.getalldata
|
|
|
|
|
|
|
|
this.hidecouseShixunModal
|
|
|
|
|
|
|
|
}else{
|
|
|
|
|
|
|
|
this.props.showNotification(response.data.message);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
.catch(function (error) {
|
|
|
|
|
|
|
|
console.log(error);
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
}
|
|
|
|
render(){
|
|
|
|
render(){
|
|
|
|
let {datatime,description,datalist}=this.state;
|
|
|
|
let {datatime,description,datalist}=this.state;
|
|
|
|
|
|
|
|
|
|
|
@ -256,7 +282,7 @@ class Selectsetting extends Component{
|
|
|
|
lineHeight: '30px',
|
|
|
|
lineHeight: '30px',
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
console.log(this.state.Radiovalue)
|
|
|
|
|
|
|
|
return(
|
|
|
|
return(
|
|
|
|
<div>
|
|
|
|
<div>
|
|
|
|
<style>
|
|
|
|
<style>
|
|
|
@ -329,7 +355,7 @@ class Selectsetting extends Component{
|
|
|
|
height: 37px;
|
|
|
|
height: 37px;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
.isabox{
|
|
|
|
.isabox{
|
|
|
|
max-width: 173px;
|
|
|
|
max-width:280px;
|
|
|
|
overflow: hidden;
|
|
|
|
overflow: hidden;
|
|
|
|
text-overflow: ellipsis;
|
|
|
|
text-overflow: ellipsis;
|
|
|
|
white-space: nowrap;
|
|
|
|
white-space: nowrap;
|
|
|
@ -343,7 +369,7 @@ class Selectsetting extends Component{
|
|
|
|
`}</style>
|
|
|
|
`}</style>
|
|
|
|
<div className="pl20 pr20 settingbox">
|
|
|
|
<div className="pl20 pr20 settingbox">
|
|
|
|
<div className="clearfix edu-txt-center lineh-40 bor-bottom-greyE">
|
|
|
|
<div className="clearfix edu-txt-center lineh-40 bor-bottom-greyE">
|
|
|
|
<li className="fl" style={{width: '350px'}}>
|
|
|
|
<li className="fl" style={{width: '343px'}}>
|
|
|
|
<span className={"isabox"} title={datalist&&datalist.title}> {datalist&&datalist.title} </span>
|
|
|
|
<span className={"isabox"} title={datalist&&datalist.title}> {datalist&&datalist.title} </span>
|
|
|
|
{datalist&&datalist.attachment_histories.length===0?"":<span className={"newcolor-orange fl"}>当前版本</span>}
|
|
|
|
{datalist&&datalist.attachment_histories.length===0?"":<span className={"newcolor-orange fl"}>当前版本</span>}
|
|
|
|
</li>
|
|
|
|
</li>
|
|
|
@ -358,7 +384,7 @@ class Selectsetting extends Component{
|
|
|
|
{datalist&&datalist.attachment_histories.map((item,key)=>{
|
|
|
|
{datalist&&datalist.attachment_histories.map((item,key)=>{
|
|
|
|
return(
|
|
|
|
return(
|
|
|
|
<div className="clearfix edu-txt-center lineh-40 bor-bottom-greyE" key={key}>
|
|
|
|
<div className="clearfix edu-txt-center lineh-40 bor-bottom-greyE" key={key}>
|
|
|
|
<li className="fl" style={{width: '350px'}}>
|
|
|
|
<li className="fl" style={{width: '343px'}}>
|
|
|
|
<span className={"isabox"} title={item.title}> {item.title} </span>
|
|
|
|
<span className={"isabox"} title={item.title}> {item.title} </span>
|
|
|
|
{/*<span className={"newcolor-orange fl"}>当前版本</span>*/}
|
|
|
|
{/*<span className={"newcolor-orange fl"}>当前版本</span>*/}
|
|
|
|
</li>
|
|
|
|
</li>
|
|
|
@ -368,6 +394,7 @@ class Selectsetting extends Component{
|
|
|
|
<li className="fl paddingl10 datastyle">
|
|
|
|
<li className="fl paddingl10 datastyle">
|
|
|
|
{moment(item.created_on).format('YYYY-MM-DD HH:mm')==="Invalid date"?"":moment(item.created_on).format('YYYY-MM-DD HH:mm')}
|
|
|
|
{moment(item.created_on).format('YYYY-MM-DD HH:mm')==="Invalid date"?"":moment(item.created_on).format('YYYY-MM-DD HH:mm')}
|
|
|
|
</li>
|
|
|
|
</li>
|
|
|
|
|
|
|
|
<a className="fr" onClick={()=>this.delectfils(item.id)}><i className="iconfont icon-shanchu color-grey-c font-14 font-n"></i></a>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
)
|
|
|
|
)
|
|
|
|
})}
|
|
|
|
})}
|
|
|
@ -537,7 +564,7 @@ class Selectsetting extends Component{
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
<div className="mt20 marginauto clearfix edu-txt-center">
|
|
|
|
<div className="mt20 marginauto clearfix edu-txt-center">
|
|
|
|
<a className="pop_close task-btn mr30 margin-tp26" onClick={this.hidecouseShixunModal}>取消</a>
|
|
|
|
<a className="pop_close task-btn mr30 margin-tp26" onClick={()=>this.props.Cancel()}>取消</a>
|
|
|
|
<a className="task-btn task-btn-orange margin-tp26" id="submit_send_shixun" onClick={this.savecouseShixunModal}>确定</a>
|
|
|
|
<a className="task-btn task-btn-orange margin-tp26" id="submit_send_shixun" onClick={this.savecouseShixunModal}>确定</a>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|