题库调整

dev_aliyun_beta
杨树明 6 years ago
parent acbbd58c11
commit add8af69ff

@ -5,6 +5,9 @@ import axios from 'axios';
import { import {
notification notification
} from "antd"; } from "antd";
import SendTopics from '../../modals/SendTopics';
import Modals from '../../modals/Modals';
import CoursesListType from '../coursesPublic/CoursesListType'; import CoursesListType from '../coursesPublic/CoursesListType';
import Completetaskdetails from './Completetaskdetails'; import Completetaskdetails from './Completetaskdetails';
import '../css/members.css'; import '../css/members.css';
@ -13,6 +16,7 @@ import '../css/Courses.css';
import '../css/busyWork.css'; import '../css/busyWork.css';
import '../poll/pollStyle.css'; import '../poll/pollStyle.css';
class Completetaskpage extends Component { class Completetaskpage extends Component {
//分组作业内容详情 //分组作业内容详情
constructor(props) { constructor(props) {
@ -22,6 +26,7 @@ class Completetaskpage extends Component {
workid:1, workid:1,
isSpin:false, isSpin:false,
datas:[], datas:[],
visible:false
} }
} }
@ -84,19 +89,93 @@ class Completetaskpage extends Component {
} }
//发送至相关
sendTopics=()=>{
this.setState({
visible:true
})
}
topicscancelmodel=()=>{
this.setState({
Modalstype:false,
Loadtype:false,
visible:false,
Modalstopval:"",
ModalCancel:"",
ModalSave:"",
checkBoxValues:[],
checkedtype:false
})
}
//删除相关
deletecheckBoxValues=()=>{
this.setState({
Modalstype:true,
Modalstopval:"是否确认删除?",
ModalCancel:this.topicscancelmodel,
ModalSave:this.topicssavedelete,
})
}
bindRef = ref => { this.child = ref } topicssavedelete=()=>{
///////////////教师截止
const url = `/question_banks/multi_delete.json`;
axios.delete(url, { data: {
object_id: [this.props.match.params.workid],
object_type:"gtask"
}})
.then((response) => {
if(response.data.status===0){
this.props.showNotification(response.data.message)
window.location.href=`/users/${this.props.current_user.user_id}/topics/personal`;
}else{
this.props.showNotification(response.data.message)
}
})
.catch(function (error) {
console.log(error);
});
this.topicscancelmodel()
}
render() { render() {
let{datas}=this.state; let{datas,visible}=this.state;
// console.log(119) // console.log(119)
let user_id=this.props.current_user&&this.props.current_user.user_id;
let user_type=this.props.current_user&&this.props.current_user.user_identity;
let targetuserid=this.props.data&&this.props.data.id;
debugger
return ( return (
<div className="newMain clearfix "> <div className="newMain clearfix ">
{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}
/>:""}
{/*发送至弹窗*/}
{
visible&&visible===true?
<SendTopics
{...this.state}
{...this.props}
visible={visible}
category={"gtask"}
checkBoxValues={[this.props.match.params.workid]}
topicscancelmodel={()=>this.topicscancelmodel()}
/>:""
}
<div className={"educontent mt10 mb20"} style={{width: "1200px"}}> <div className={"educontent mt10 mb20"} style={{width: "1200px"}}>
@ -122,9 +201,9 @@ class Completetaskpage extends Component {
<div className="stud-class-set bor-bottom-greyE "> <div className="stud-class-set bor-bottom-greyE ">
<div className=" clearfix edu-back-white poll_list"> <div className=" clearfix edu-back-white poll_list">
<a className={"active ml12"}>内容详情</a> <a className={"active ml12"}>内容详情</a>
<a className="fr color-blue font-16" >发送</a> <a className="fr color-blue font-16 pointer" onClick={()=>this.sendTopics()}>发送</a>
<Link className="fr color-blue font-16" to={`/banks/gtask/${this.props.match.params.workid}/edit`} >编辑</Link> <Link className="fr color-blue font-16 pointer" to={`/banks/gtask/${this.props.match.params.workid}/edit`} >编辑</Link>
<a className="fr color-blue font-16" >删除</a> <a className="fr color-blue font-16 pointer" onClick={()=>this.deletecheckBoxValues()}>删除</a>
</div> </div>
</div> </div>
</div> </div>

@ -70,9 +70,9 @@ class SendTopics extends Component{
} }
).then((result)=>{ ).then((result)=>{
if(result.data.status===0){ if(result.data.status===0){
this.props.updataslist()
this.props.topicscancelmodel()
this.props.showNotification(result.data.message) this.props.showNotification(result.data.message)
this.props.topicscancelmodel()
this.props.updataslist()
}else{ }else{
this.props.showNotification(result.data.message) this.props.showNotification(result.data.message)
} }

Loading…
Cancel
Save