diff --git a/public/react/src/modules/courses/coursesDetail/CoursesLeftNav.js b/public/react/src/modules/courses/coursesDetail/CoursesLeftNav.js
index e8442ee48..f22e6b9a7 100644
--- a/public/react/src/modules/courses/coursesDetail/CoursesLeftNav.js
+++ b/public/react/src/modules/courses/coursesDetail/CoursesLeftNav.js
@@ -61,7 +61,7 @@ class Coursesleftnav extends Component{
}
// updataleftNav=()=>{
- //
+ //
// let id=this.props.match.params.coursesId;
// let url ="/courses/"+id+"/left_banner.json"
// axios.get(url).then((response) => {
@@ -272,11 +272,11 @@ class Coursesleftnav extends Component{
let {url}=this.state;
if(urls!=url){
-
+
this.props.history.replace(urls);
this.props.updataleftNavfun();
}else{
-
+
if (key === this.props.indexs) {
this.props.unlocationNavfun(undefined)
} else {
@@ -681,7 +681,7 @@ class Coursesleftnav extends Component{
}
showsandians=(e,key,urls,num)=> {
-
+
let {url}=this.state;
if (key === this.props.indexs) {
this.props.unlocationNavfun(undefined)
diff --git a/public/react/src/modules/courses/graduation/tasks/GraduationTasksSubmitedit.js b/public/react/src/modules/courses/graduation/tasks/GraduationTasksSubmitedit.js
index b5c120879..76ff783d3 100644
--- a/public/react/src/modules/courses/graduation/tasks/GraduationTasksSubmitedit.js
+++ b/public/react/src/modules/courses/graduation/tasks/GraduationTasksSubmitedit.js
@@ -33,7 +33,8 @@ class GraduationTasksSubmitedit extends Component{
Loadtype:false,
description:undefined,
attachments:undefined,
- spinnings:false
+ spinnings:false,
+ shixunsreplace:false,
}
}
@@ -84,99 +85,8 @@ class GraduationTasksSubmitedit extends Component{
window.location.href="/courses/"+coursesId+"/graduation_tasks/"+workId+"/appraise";
}
- handleSubmit=(e) => {
-
- let {fileList,selectmemberslist,workslist}=this.state;
-
- let userids=[];
-
- for(var list of selectmemberslist){
-
- if(list.user_id!=undefined&&list.user_id!=null){
- userids.push(list.user_id)
- }
-
- }
-
- let listid=[];
-
- for(var list of fileList){
- listid.push(list.response.id)
- }
-
- e.preventDefault();
- if( GraduationTasksnewtype===true){
- this.props.form.validateFields((err, values) => {
- if (!err) {
- console.log(values.description);
- // console.log(fileList);
- if(values.description===undefined||values.description===""){
-
- return
- }
- if(workslist.task_type===2){
- if(userids.length<2){
- this.setState({
- minvalue:2,
- setvalue:"小于",
- minmaxtype:true
- })
-
- return
- }else if(userids.length>5){
- this.setState({
- minvalue:5,
- setvalue:"大于",
- minmaxtype:true
- })
- return
- }
-
- }
- this.setState({
- spinnings:true
- })
- let workId=this.props.match.params.work_Id;
-
- let url="/graduation_works/"+workId+".json";
- axios.put(url, {
- description:values.description,
- attachment_ids:listid,
- user_ids:userids
- }
- ).then((response) => {
- this.setState({
- spinnings:false
- })
- if(response.status===200) {
- GraduationTasksnewtype=false;
- if(response.data.status===0){
- // this.setState({
- // Modalstype:true,
- // Modalstopval:response.data.message,
- // ModalSave:this.setedit,
- // Loadtype:true
- // })
- this.setedit()
- }else{
- GraduationTasksnewtype=true;
- }
- }
- }).catch((error) => {
- console.log(error)
- })
-
- }
- });
- }
- // setTimeout(function () {
- // GraduationTasksnewtype=true
- // },10000)
-
- }
-
handleSelectChange = (value) => {
console.log(value);
this.props.form.setFieldsValue({
@@ -414,10 +324,126 @@ class GraduationTasksSubmitedit extends Component{
window.history.go(-1)
}
+ handleSubmit=(e) => {
+
+ let {fileList,selectmemberslist,workslist}=this.state;
+ if(fileList.length===0){
+ this.setState({
+ shixunsreplace:true,
+ })
+ return
+ }
+
+ this.Commoninterface(fileList,selectmemberslist,workslist);
+ // setTimeout(function () {
+ // GraduationTasksnewtype=true
+ // },10000)
+
+ }
+ Commoninterface =(fileList,selectmemberslist,workslist)=>{
+ let userids=[];
+
+ for(var list of selectmemberslist){
+
+ if(list.user_id!=undefined&&list.user_id!=null){
+ userids.push(list.user_id)
+ }
+
+ }
+
+ let listid=[];
+
+ for(var list of fileList){
+ listid.push(list.response.id)
+ }
+
+ this.props.form.validateFields((err, values) => {
+ if (!err) {
+ console.log(values.description);
+ // console.log(fileList);
+ if(values.description===undefined||values.description===""){
+
+ return
+ }
+ if(workslist.task_type===2){
+ if(userids.length<2){
+ this.setState({
+ minvalue:2,
+ setvalue:"小于",
+ minmaxtype:true
+ })
+
+ return
+ }else if(userids.length>5){
+ this.setState({
+ minvalue:5,
+ setvalue:"大于",
+ minmaxtype:true
+ })
+ return
+ }
+
+ }
+ this.setState({
+ spinnings:true
+ })
+ let workId=this.props.match.params.work_Id;
+
+ let url="/graduation_works/"+workId+".json";
+ axios.put(url, {
+ description:values.description,
+ attachment_ids:listid,
+ user_ids:userids
+ }
+ ).then((response) => {
+ this.setState({
+ spinnings:false
+ })
+ if(response!== undefined){
+ this.setedit()
+
+ }
+ // if(response.status===200) {
+ // GraduationTasksnewtype=false;
+ // if(response.data.status===0){
+ // // this.setState({
+ // // Modalstype:true,
+ // // Modalstopval:response.data.message,
+ // // ModalSave:this.setedit,
+ // // Loadtype:true
+ // // })
+ // }else{
+ // GraduationTasksnewtype=true;
+ // }
+ // }
+ }).catch((error) => {
+ console.log(error)
+ })
+
+ }
+ });
+
+ }
+
+ hidestartshixunsreplace = ()=>{
+
+ let {fileList,selectmemberslist,workslist}=this.state;
+
+ this.Commoninterface(fileList,selectmemberslist,workslist);
+
+ }
+
+ hidestartshixunsreplacetwo= ()=>{
+ this.setState({
+ shixunsreplace:false,
+ })
+ }
+
+
render(){
const { getFieldDecorator } = this.props.form;
let {search,fileList, workslist,setvalue,minvalue,minmaxtype,Loadtype,description,attachments,
- Modalstype,Modalstopval,ModalCancel,ModalSave,memberslist,task_status,selectmemberslist} =this.state;
+ Modalstype,Modalstopval,ModalCancel,ModalSave,memberslist,task_status,selectmemberslist,shixunsreplace} =this.state;
let courseId=this.props.match.params.coursesId;
let category_id=this.props.match.params.category_id;
@@ -460,6 +486,24 @@ class GraduationTasksSubmitedit extends Component{
modalSave={ModalSave}
loadtype={Loadtype}
/>
+ 还未上传附件 是否确认提交作品?