diff --git a/public/react/src/modules/courses/shixunHomework/ShixunWorkReport.js b/public/react/src/modules/courses/shixunHomework/ShixunWorkReport.js index 1efce7a66..6c6ae43ce 100644 --- a/public/react/src/modules/courses/shixunHomework/ShixunWorkReport.js +++ b/public/react/src/modules/courses/shixunHomework/ShixunWorkReport.js @@ -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,36 @@ 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 + }) + }else{ + this.props.showNotification(response.data.message) + } }) .catch(function (error) { console.log(error); @@ -221,7 +241,13 @@ class ShixunWorkReport extends Component { return ( data===undefined?"": - + {showAppraiseModaltype===true?this.showAppraiseModal(1)} - >评阅:""} + >{work_comment===null||work_comment===undefined?"评阅":"编辑评阅"}:""}