|
|
|
@ -45,6 +45,12 @@ class Selectsetting extends Component{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
componentDidMount() {
|
|
|
|
|
this.getalldata();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
getalldata=()=>{
|
|
|
|
|
let {discussMessageid} =this.props;
|
|
|
|
|
let course_id=this.props.course_id;
|
|
|
|
|
let url="/files/"+discussMessageid+".json";
|
|
|
|
@ -70,19 +76,10 @@ class Selectsetting extends Component{
|
|
|
|
|
console.log(error);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
getalldata=()=>{
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
componentDidUpdate = (prevProps) => {
|
|
|
|
|
|
|
|
|
|
if ( prevProps.visible != this.props.visible ) {
|
|
|
|
|
console.log(prevProps)
|
|
|
|
|
console.log(this.props)
|
|
|
|
|
this.setState({
|
|
|
|
|
visible:this.props.visible
|
|
|
|
|
})
|
|
|
|
@ -233,6 +230,38 @@ class Selectsetting extends Component{
|
|
|
|
|
Radiovalue: e.target.value,
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
delectfils=(id)=>{
|
|
|
|
|
this.setState({
|
|
|
|
|
Modalstype:true,
|
|
|
|
|
Modalstopval:"是否确定删除该历史资源?",
|
|
|
|
|
ModalSave:()=>this.delectcousedelectfils(id),
|
|
|
|
|
ModalCancel:this.hidecouseShixunModal,
|
|
|
|
|
loadtype:false
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
delectcousedelectfils=(id)=>{
|
|
|
|
|
let course_id=this.props.course_id;
|
|
|
|
|
const url = `/files/bulk_delete.json`;
|
|
|
|
|
|
|
|
|
|
console.log(id)
|
|
|
|
|
axios.delete(url, { data: {
|
|
|
|
|
course_id: course_id,
|
|
|
|
|
ids:[id]
|
|
|
|
|
}})
|
|
|
|
|
.then((response) => {
|
|
|
|
|
if (response.data.status == 0) {
|
|
|
|
|
// {"status":1,"message":"删除成功"}
|
|
|
|
|
this.props.showNotification(response.data.message);
|
|
|
|
|
this.getalldata
|
|
|
|
|
this.hidecouseShixunModal
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
.catch(function (error) {
|
|
|
|
|
console.log(error);
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
render(){
|
|
|
|
|
let {datatime,description,datalist}=this.state;
|
|
|
|
|
|
|
|
|
@ -256,7 +285,7 @@ class Selectsetting extends Component{
|
|
|
|
|
lineHeight: '30px',
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
console.log(this.state.Radiovalue)
|
|
|
|
|
|
|
|
|
|
return(
|
|
|
|
|
<div>
|
|
|
|
|
<style>
|
|
|
|
@ -329,7 +358,7 @@ class Selectsetting extends Component{
|
|
|
|
|
height: 37px;
|
|
|
|
|
}
|
|
|
|
|
.isabox{
|
|
|
|
|
max-width: 173px;
|
|
|
|
|
max-width: 339px;
|
|
|
|
|
overflow: hidden;
|
|
|
|
|
text-overflow: ellipsis;
|
|
|
|
|
white-space: nowrap;
|
|
|
|
@ -343,7 +372,7 @@ class Selectsetting extends Component{
|
|
|
|
|
`}</style>
|
|
|
|
|
<div className="pl20 pr20 settingbox">
|
|
|
|
|
<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>
|
|
|
|
|
{datalist&&datalist.attachment_histories.length===0?"":<span className={"newcolor-orange fl"}>当前版本</span>}
|
|
|
|
|
</li>
|
|
|
|
@ -358,7 +387,7 @@ class Selectsetting extends Component{
|
|
|
|
|
{datalist&&datalist.attachment_histories.map((item,key)=>{
|
|
|
|
|
return(
|
|
|
|
|
<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={"newcolor-orange fl"}>当前版本</span>*/}
|
|
|
|
|
</li>
|
|
|
|
@ -368,6 +397,7 @@ class Selectsetting extends Component{
|
|
|
|
|
<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')}
|
|
|
|
|
</li>
|
|
|
|
|
<a className="fr" onClick={()=>this.delectfils(item.id)}><i className="iconfont icon-shanchu color-grey-c font-14 font-n"></i></a>
|
|
|
|
|
</div>
|
|
|
|
|
)
|
|
|
|
|
})}
|
|
|
|
|