diff --git a/public/react/src/modules/courses/graduation/tasks/GraduationTaskDetail.js b/public/react/src/modules/courses/graduation/tasks/GraduationTaskDetail.js index c071024bb..18870a1be 100644 --- a/public/react/src/modules/courses/graduation/tasks/GraduationTaskDetail.js +++ b/public/react/src/modules/courses/graduation/tasks/GraduationTaskDetail.js @@ -7,14 +7,14 @@ import Loading from '../../../../Loading'; import {BrowserRouter as Router,Route,Switch} from 'react-router-dom'; import axios from 'axios'; import HomeworkModal from "../../coursesPublic/HomeworkModal"; - +import AccessoryModal from "../../coursesPublic/AccessoryModal"; +import Associationmodel from '../../coursesPublic/Associationmodel'; import CoursesListType from '../../coursesPublic/CoursesListType'; import moment from 'moment'; import "../../css/members.css" import "../../css/Courses.css" - -import Trialapplication from '../../../login/Trialapplication' +import Modals from '../../../modals/Modals'; //毕设描述 @@ -52,7 +52,13 @@ class GraduationTaskDetail extends Component{ Botvalleft:undefined, course_groupslist:undefined, course_groups:undefined, - questionslist:undefined + questionslist:undefined, + tab:"list", + visibles:undefined, + Modalstype:undefined, + Modalstopval:undefined, + ModalCancel:undefined, + ModalSave:undefined } } componentDidMount(){ @@ -126,8 +132,7 @@ class GraduationTaskDetail extends Component{ if (response.data.status == 0) { this.getdatas() this.props.showNotification(response.data.message); - this.searchValue(); - + this.setState({ // Modalstopval:response.data.message, // ModalSave:this.cancelmodel, @@ -140,6 +145,13 @@ class GraduationTaskDetail extends Component{ }) } + + // 刷新 + resetList=()=>{ + this.getdatas(); + this.child && this.child.searchValue(); + } + // 立即截止 end=()=>{ // this.homeworkstart() @@ -176,14 +188,93 @@ class GraduationTaskDetail extends Component{ }) } + setTab = (tab) =>{ + this.setState({ + tab + }) + } + // 关联项目 + AssociationItems=()=>{ + this.setState({ + visibles:true + }) + } + Cancel=()=>{ + this.setState({ + visibles:false + }) + } + // 取消关联 + cannelAssociation=()=>{ + this.setState({ + Modalstype:true, + Modalstopval:"确定要取消该项目关联?", + ModalCancel:this.cannerassocition, + ModalSave:this.savetassociton + }) + } + savetassociton=()=>{ + this.cannerassocition(); + let {questionslist}=this.state; + let url = "/graduation_tasks/"+questionslist.task_id+"/graduation_works/cancel_relate_project.json"; + console.log(url) + axios.get(url).then((result)=>{ + if(result.data.status===0){ + this.resetList(); + } + }).catch((error)=>{ + console.log(error) + }) + + } + cannerassocition=()=>{ + this.setState({ + Modalstype:false, + Modalstopval:"", + ModalCancel:"", + ModalSave:"", + loadtype:false, + visibles:false + }) + } + // 补交附件 + handaccessory=()=>{ + // let {taskslistdata}=this.state; + // let courseId=this.props.match.params.coursesId; + // + // let url="/courses/"+courseId+"/graduation_tasks/"+taskslistdata.work_id+"/appraise" + // + // window.location.href=url; + this.setState({ + avisible:true + }) + } + Cancelvisible=()=>{ + this.setState({ + avisible:false + }) + } + + bindRef = ref => { this.child = ref } ; render(){ let courseId=this.props.match.params.coursesId; let category_id=this.props.match.params.category_id; let task_Id=this.props.match.params.task_Id; - let { tab } = this.props; - let { questionslist } = this.state + let { + questionslist , + tab , + visibles , + Modalstype, + Modalstopval, + ModalCancel, + ModalSave + } = this.state + + const commom = { + setTab:this.setTab + } return(
{questionslist.course_name} > @@ -226,7 +348,7 @@ class GraduationTaskDetail extends Component{ 返回
- {coursename}
- >
- 毕设任务
- > */}
-
- {/*{taskname===""?"":*/}
- {/*
@@ -1252,23 +1244,17 @@ class GraduationTaskssettinglist extends Component{
{
JSON.stringify(data)==="[]" ?
-
- 暂时还没有相关数据哦!
-
-
: ""
}
- :
+
+ :
// 学生列表
this.props.isStudent()||this.props.isNotMember()?
-
+ {this.props.isNotMember()?