Merge branch 'dev_aliyun' of https://bdgit.educoder.net/Hjqreturn/educoder into dev_aliyun

dev_hss
hjm 5 years ago
commit 83f4bbf179

@ -4,6 +4,7 @@ import { Form, Select, Input, Button,Checkbox,Upload,Icon,message,Modal, Table,
import {Link,Switch,Route,Redirect} from 'react-router-dom';
import axios from 'axios';
import moment from 'moment';
import Modals from "../../modals/Modals";
import ConclusionEvaluation from './shixunreport/ConclusionEvaluation';
import OfficialAcademicTranscript from './shixunreport/OfficialAcademicTranscript';
import Coursesshixundetails from './shixunreport/Coursesshixundetails';
@ -21,6 +22,7 @@ import '../css/Courses.css';
import './style.css';
import 'moment/locale/zh-cn';
class ShixunWorkReport extends Component {
constructor(props) {
@ -190,18 +192,39 @@ class ShixunWorkReport extends Component {
})
}
isdeleteModal=()=>{
let url =`/student_works/${this.props.match.params.homeworkid}/destroy_work_comment.json`
this.setState({
modalsType: true,
modalsTopval:"是否确认删除?",
modalSave: ()=>this.isdeleteModals(),
modalCancel:()=>this.hideisdeleteModal(),
})
}
hideisdeleteModal=()=>{
this.setState({
modalsType: false,
modalsTopval:"是否确认删除?",
modalSave: ()=>this.isdeleteModals(),
modalCancel:()=>this.hideisdeleteModal(),
})
}
isdeleteModals=()=>{
let url =`/student_works/${this.props.match.params.homeworkid}/destroy_work_comment.json`
axios.delete(url).then((response) => {
// const { status } = response.data;
if(response.data.status===0){
this.props.showNotification(response.data.message)
this.setState({
showAppraiseModalsshow:false,
work_comment_hidden:false
})
}else{
this.props.showNotification(response.data.message)
}
// const { status } = response.data;
if(response.data.status===0){
this.props.showNotification(response.data.message)
this.setState({
showAppraiseModalsshow:false,
work_comment_hidden:false,
work_comment:undefined,
work_type:0,
})
this.hideisdeleteModal()
}else{
this.props.showNotification(response.data.message)
}
})
.catch(function (error) {
console.log(error);
@ -221,7 +244,13 @@ class ShixunWorkReport extends Component {
return (
data===undefined?"":<Spin indicator={antIcon} spinning={this.state.spinning}>
<Modals
modalsType={this.state.modalsType}
modalsTopval={this.state.modalsTopval}
loadtype={this.state.loadtype}
modalSave={this.state.modalSave}
modalCancel={this.state.modalCancel}
></Modals>
{showAppraiseModaltype===true?<AppraiseModal
{...this.props}
{...this.state}
@ -271,6 +300,7 @@ class ShixunWorkReport extends Component {
onClick={()=>this.showAppraiseModal(1)}
>评阅</a>:""}
</div>
{/*{work_comment===null||work_comment===undefined?"评阅":"编辑评阅"}*/}
<style>{
`
.shixunreporttitleboxtop {
@ -353,7 +383,7 @@ class ShixunWorkReport extends Component {
<p className={"mb16"}>
<span className={"passbox"}>
<div className={"passfont"}><span className={"color999"}>通过</span> <span className={"colorCF3B3B"}>{data&&data.complete_count}/{data&&data.challenges_count}</span></div>
<div className={"passfont"}><span className={"color999"}>通过关卡</span> <span className={"colorCF3B3B"}>{data&&data.complete_count}/{data&&data.challenges_count}</span></div>
<div className={"passfontbom"}><span className={"color999"}>经验值</span> <span className={"color333"}>{data&&data.myself_experience}/{data&&data.total_experience}</span></div>
</span>

Loading…
Cancel
Save