|
|
|
@ -8,6 +8,7 @@ import {getUrl} from 'educoder';
|
|
|
|
|
import moment from 'moment';
|
|
|
|
|
import CoursesListType from '../coursesPublic/CoursesListType';
|
|
|
|
|
import Showoldfiles from "../coursesPublic/Showoldfiles";
|
|
|
|
|
import Modals from '../../modals/Modals';
|
|
|
|
|
|
|
|
|
|
class Fileslistitem extends Component{
|
|
|
|
|
constructor(props){
|
|
|
|
@ -74,6 +75,67 @@ class Fileslistitem extends Component{
|
|
|
|
|
Showoldfiles:false,
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
onDelete = (id) => {
|
|
|
|
|
|
|
|
|
|
this.setState({
|
|
|
|
|
Modalstype:true,
|
|
|
|
|
Modalstopval:"是否确认删除?",
|
|
|
|
|
ModalCancel:this.cancelmodel,
|
|
|
|
|
ModalSave:()=>this.savedelete(id),
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
cancelmodel=()=>{
|
|
|
|
|
|
|
|
|
|
this.setState({
|
|
|
|
|
Modalstype:false,
|
|
|
|
|
Loadtype:false,
|
|
|
|
|
Modalstopval:"",
|
|
|
|
|
ModalCancel:"",
|
|
|
|
|
ModalSave:"",
|
|
|
|
|
checkBoxValues:[],
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
savedelete=(id)=>{
|
|
|
|
|
|
|
|
|
|
this.setState({
|
|
|
|
|
Modalstype:false,
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const cid = this.props.match.params.coursesId
|
|
|
|
|
const url = `/files/bulk_delete.json`;
|
|
|
|
|
axios.delete(url, { data: {
|
|
|
|
|
course_id:cid,
|
|
|
|
|
ids: [id],
|
|
|
|
|
}})
|
|
|
|
|
.then((response) => {
|
|
|
|
|
if (response.data.status == 0) {
|
|
|
|
|
//Modalstopval:response.data.message,
|
|
|
|
|
|
|
|
|
|
this.props.updatafiledfun()
|
|
|
|
|
this.setState({
|
|
|
|
|
// Modalstype:true,
|
|
|
|
|
// Modalstopval:"删除成功",
|
|
|
|
|
ModalsBottomval:"",
|
|
|
|
|
// ModalSave:this.cancelmodel,
|
|
|
|
|
// Loadtype:true,
|
|
|
|
|
checkBoxValues:[],
|
|
|
|
|
checkAllValue:false
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
this.props.showNotification("删除成功");
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
.catch(function (error) {
|
|
|
|
|
console.log(error);
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
render(){
|
|
|
|
|
|
|
|
|
|
const { checkBox,
|
|
|
|
@ -84,6 +146,16 @@ class Fileslistitem extends Component{
|
|
|
|
|
|
|
|
|
|
return(
|
|
|
|
|
<div className="graduateTopicList boardsList">
|
|
|
|
|
|
|
|
|
|
{/*提示*/}
|
|
|
|
|
{this.state.Modalstype&&this.state.Modalstype===true?<Modals
|
|
|
|
|
modalsType={this.state.Modalstype}
|
|
|
|
|
modalsTopval={this.state.Modalstopval}
|
|
|
|
|
modalCancel={this.state.ModalCancel}
|
|
|
|
|
modalSave={this.state.ModalSave}
|
|
|
|
|
modalsBottomval={this.state.ModalsBottomval}
|
|
|
|
|
loadtype={this.state.Loadtype}
|
|
|
|
|
/>:""}
|
|
|
|
|
<Showoldfiles
|
|
|
|
|
visible={this.state.Showoldfiles}
|
|
|
|
|
allfiles={this.state.allfiles}
|
|
|
|
@ -178,12 +250,19 @@ class Fileslistitem extends Component{
|
|
|
|
|
|
|
|
|
|
{this.props.isAdmin ||this.props.current_user.username===discussMessage.author.name?
|
|
|
|
|
<span className={"sttingbox"}>
|
|
|
|
|
|
|
|
|
|
<WordsBtn style="blue" className="colorblue font-16 mr20 fr">
|
|
|
|
|
<a className="btn colorblue"
|
|
|
|
|
onClick={()=>this.settingList()}>设置</a>
|
|
|
|
|
</WordsBtn>
|
|
|
|
|
|
|
|
|
|
<WordsBtn style="blue" className="colorblue font-16 mr20 fr">
|
|
|
|
|
<a className="btn colorblue"
|
|
|
|
|
onClick={()=>this.onDelete(discussMessage.id)}>删除</a>
|
|
|
|
|
</WordsBtn>
|
|
|
|
|
|
|
|
|
|
</span>:""}
|
|
|
|
|
<div className="cl"></div>
|
|
|
|
|
|
|
|
|
|
<style>
|
|
|
|
|
{
|
|
|
|
|
`
|
|
|
|
|