From d1094b94586fe34ae5c2460afcaa434833b81b5d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Thu, 5 Sep 2019 20:41:07 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../shixunHomework/ShixunWorkReport.js | 54 ++++++++++++++----- 1 file changed, 40 insertions(+), 14 deletions(-) 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?"评阅":"编辑评阅"}:""}