Merge remote-tracking branch 'origin/dev_aliyun' into dev_aliyun

dev_hss
杨树明 5 years ago
commit 3cff58ffed

@ -24,7 +24,7 @@ module Searchable::Course
author_name: teacher&.real_name, author_name: teacher&.real_name,
author_school_name: teacher&.school_name, author_school_name: teacher&.school_name,
visits_count: visits, visits_count: visits,
members_count: members_count, members_count: course_members_count,
is_public: is_public == 1, is_public: is_public == 1,
first_category_url: ApplicationController.helpers.module_url(none_hidden_course_modules.first, self) first_category_url: ApplicationController.helpers.module_url(none_hidden_course_modules.first, self)
} }

@ -6,6 +6,7 @@ import axios from 'axios';
import TPMMDEditor from "../../tpm/challengesnew/TPMMDEditor"; import TPMMDEditor from "../../tpm/challengesnew/TPMMDEditor";
import moment from "../new/CoursesNew"; import moment from "../new/CoursesNew";
import Fileslistitem from "../Resource/Fileslistitem"; import Fileslistitem from "../Resource/Fileslistitem";
import Modals from "../../modals/Modals";
// 公告栏 // 公告栏
class Bullsubdirectory extends Component{ class Bullsubdirectory extends Component{
constructor(props){ constructor(props){
@ -19,6 +20,10 @@ class Bullsubdirectory extends Component{
addonAfter:0, addonAfter:0,
eduintits:"", eduintits:"",
informs:[], informs:[],
Modalstype:false,
Modalstopval:"是否确认删除?",
ModalCancel:"",
ModalSave:"",
} }
@ -47,6 +52,61 @@ class Bullsubdirectory extends Component{
} }
setModeltrue=()=>{
this.setState({
Modalstype:true,
Modalstopval:"是否确认删除?",
ModalCancel:this.cancelmodel,
ModalSave:this.saveonOpen,
})
}
cancelmodel=()=>{
//取消
this.setState({
Modalstype:false,
Modalstopval:"是否确认删除?",
ModalCancel:"",
ModalSave:"",
})
}
saveonOpen=()=>{
//确认
// /
// 删除公告
var id=this.props.match.params.coursesId
const url =`/courses/${id}/delete_informs.json`;
axios.delete(url, { data: {
inform_id: this.props.id
}})
.then((response) => {
if(response){
if(response.data){
if(response.data.status===0){
this.setState({
Modalstype:false,
Modalstopval:"是否确认删除?",
ModalCancel:"",
ModalSave:"",
})
this.props.showNotification(`删除成功`);
this.props.getinputdata();
}else{
this.props.showNotification(`删除失败`);
}
}else{
this.props.showNotification(`删除失败`);
}
}
})
.catch(function (error) {
console.log(error);
this.props.showNotification(`删除失败`);
});
}
bianji = (bians)=>{ bianji = (bians)=>{
this.setState({ this.setState({
@ -154,12 +214,18 @@ class Bullsubdirectory extends Component{
render(){ render(){
let{description,whethertoeditysl,addonAfter,eduintits,informs,isSpinysl} =this.state; let{description,whethertoeditysl,addonAfter,eduintits,informs,isSpinysl} =this.state;
let{myname,mydescription}=this.props; let{myname,mydescription,id}=this.props;
const {getFieldDecorator} = this.props.form; const {getFieldDecorator} = this.props.form;
return( return(
<React.Fragment > <React.Fragment >
<div > <div >
{this.state.Modalstype&&this.state.Modalstype===true?<Modals
modalsType={this.state.Modalstype}
modalsTopval={this.state.Modalstopval}
modalCancel={this.state.ModalCancel}
modalSave={this.state.ModalSave}
/>:""}
<Spin size="large" spinning={isSpinysl} > <Spin size="large" spinning={isSpinysl} >
<div className="edu-back-white "> <div className="edu-back-white ">
{ {
@ -171,16 +237,29 @@ class Bullsubdirectory extends Component{
<span className="ysltitbt">{myname}</span> <span className="ysltitbt">{myname}</span>
</div> </div>
<div> <div>
<span className="fr pr25 yslbianji"> <span className="fr yslbianji" style={{marginRight:"17px"}}>
{ {
this.props.isAdmin() === true ? this.props.isClassManagement() === true ?
(this.props.yslbool===false? (this.props.yslbool===false?
<i className="iconfont icon-bianji1 newbianji1" onClick={()=>this.bianji(true)}></i> <i className="iconfont icon-bianji1 newbianji1" onClick={()=>this.bianji(true)}></i>
: :
"" ""
) )
:"" :""
} }
</span>
<span className="fr yslbianji" style={{marginRight:"22px"}}>
{
this.props.isClassManagement() === true ?
(this.props.yslbool===false?
<i className="iconfont icon-shanchu newbianji1" style={{ color: "#4CACFF"}} onClick={()=>this.setModeltrue(true)}></i>
:
""
)
:""
}
</span> </span>
</div> </div>
<div className="yslclear"></div> <div className="yslclear"></div>

Loading…
Cancel
Save