分组作业题库发送和删除题

dev_aliyun_beta
杨树林 5 years ago
parent 0610dfd442
commit d8a1818125

@ -13,6 +13,7 @@ import {
import GroupPackage from '../groupjobbank/GroupPackage'
import './questionbank.css';
import AttachmentsList from '../../../common/components/attachment/AttachmentList';
import NoneData from '../../courses/coursesPublic/NoneData'
class Generaljobanswer extends Component {
@ -62,26 +63,21 @@ class Generaljobanswer extends Component {
<div className="yslquestionbank1">
{
datas&&(datas.reference_answer===null?
<div className="alltask ">
<div className="edu-tab-con-box clearfix edu-txt-center"><img className="edu-nodata-img mb20"
src={getImageUrl("images/educoder/nodata.png")} />
<p className="edu-nodata-p mb20">暂时还没有相关数据哦</p></div>
</div>
<NoneData></NoneData>
:datas.reference_answer==="null"?
<div className="alltask ">
<div className="edu-tab-con-box clearfix edu-txt-center"><img className="edu-nodata-img mb20"
src={getImageUrl("images/educoder/nodata.png")} />
<p className="edu-nodata-p mb20">暂时还没有相关数据哦</p></div>
</div>
<NoneData></NoneData>
:
datas.reference_answer===""?
<NoneData></NoneData>
:
<div id="MakedownHTML"className="markdown-body yslquesHeigth yslquesmarkdowntext" dangerouslySetInnerHTML={{__html: markdownToHTML(datas.reference_answer).replace(/▁/g, "▁▁▁")}}/>
)
}
{/*<div id="MakedownHTML"className="markdown-body yslquesHeigth yslquesmarkdowntext" dangerouslySetInnerHTML={{__html: markdownToHTML(datas&&(datas.reference_answer===null?"无":datas.reference_answer==="null"?"无":datas.reference_answer)).replace(/▁/g, "▁▁▁")}}/>*/}
<div className="mt16px">
{datas.attachments === undefined ? "" :
<AttachmentsList {...this.state} {...this.props} attachments={datas.attachments} ></AttachmentsList>}
</div>
{/*{datas.attachments === undefined ? "" : datas.attachments.map((item, key) => {*/}
{/* return (*/}

@ -9,6 +9,8 @@ import {
import CoursesListType from '../coursesPublic/CoursesListType';
import Generaljobdetails from './Generaljobdetails';
import Generaljobanswer from './Generaljobanswer';
import SendTopics from '../../modals/SendTopics';
import Modals from '../../modals/Modals';
import '../css/members.css';
import "../common/formCommon.css";
import '../css/Courses.css';
@ -25,6 +27,7 @@ class Generaljobbankdetails extends Component {
workid:1,
isSpin:false,
datas:[],
visible:false
}
}
@ -128,21 +131,92 @@ class Generaljobbankdetails extends Component {
});
}
//发送至相关
sendTopics=()=>{
this.setState({
visible:true
})
}
bindRef = ref => { this.child = ref }
///////////////教师截止
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,
})
}
topicssavedelete=()=>{
const url = `/question_banks/multi_delete.json`;
axios.delete(url, { data: {
object_id: [this.props.match.params.workid],
object_type:"normal"
}})
.then((response) => {
if(response.data.status===0){
this.props.showNotification(response.data.message)
window.location.href=`/users/${this.props.current_user.login}/topics/personal`;
}else{
this.props.showNotification(response.data.message)
}
})
.catch(function (error) {
console.log(error);
});
this.topicscancelmodel()
}
render() {
let {tab,datas} = this.state;
let {tab,datas,visible} = this.state;
// 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;
return (
<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={"normal"}
checkBoxValues={[this.props.match.params.workid]}
topicscancelmodel={()=>this.topicscancelmodel()}
/>:""
}
<div className={"educontent mt10 mb20"} style={{width: "1200px"}}>
{/*<div className="educontent mb20">*/}
@ -168,9 +242,9 @@ class Generaljobbankdetails extends Component {
<div className=" clearfix edu-back-white poll_list">
<a className={parseInt(tab) === 0 ? "active ml12" : "ml12"} onClick={(e) => this.ChangeTab(0)}>内容详情</a>
<a className={parseInt(tab) === 1 ? "active ml12" : "ml12"} onClick={(e) => this.ChangeTab(1)}>参考答案</a>
<a className="fr color-blue font-16" >发送</a>
<a className="fr color-blue font-16" >编辑</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 pointer" to={`/banks/normal/${this.props.match.params.workid}/edit`} >编辑</Link>
<a className="fr color-blue font-16 pointer" onClick={()=>this.deletecheckBoxValues()}>删除</a>
</div>
</div>
</div>

@ -13,7 +13,7 @@ import {
import GroupPackage from '../groupjobbank/GroupPackage'
import './questionbank.css';
import AttachmentsList from "../../../common/components/attachment/AttachmentList";
import NoneData from '../../courses/coursesPublic/NoneData'
//内容详情
class Generaljobdetails extends Component {
@ -62,25 +62,18 @@ class Generaljobdetails extends Component {
<div className="yslquestionbank1">
{
datas&&(datas.description===null?
<div className="alltask ">
<div className="edu-tab-con-box clearfix edu-txt-center"><img className="edu-nodata-img mb20"
src={getImageUrl("images/educoder/nodata.png")} />
<p className="edu-nodata-p mb20">暂时还没有相关数据哦</p></div>
</div>
<NoneData></NoneData>
:datas.description==="null"?
<div className="alltask ">
<div className="edu-tab-con-box clearfix edu-txt-center"><img className="edu-nodata-img mb20"
src={getImageUrl("images/educoder/nodata.png")} />
<p className="edu-nodata-p mb20">暂时还没有相关数据哦</p></div>
</div>
:
<NoneData></NoneData>
:datas&&datas.description===""?
<NoneData></NoneData>:
<div id="MakedownHTML"className="markdown-body yslquesHeigth yslquesmarkdowntext" dangerouslySetInnerHTML={{__html: markdownToHTML(datas.description).replace(/▁/g, "▁▁▁")}}/>
)
}
{datas.attachments === undefined ? "" :
<AttachmentsList {...this.state} {...this.props} attachments={datas.attachments} ></AttachmentsList>}
<div className="mt16px">
{datas.attachments === undefined ? "" :
<AttachmentsList {...this.state} {...this.props} attachments={datas.attachments} ></AttachmentsList>}
</div>
</div>
</div>

@ -23,4 +23,7 @@
.ysltextcolor99999{
color: #999999;
font-size: 16px;
}
.mt16px{
margin-top: 16px;
}
Loading…
Cancel
Save