diff --git a/public/react/src/modules/courses/new/CoursesNew.js b/public/react/src/modules/courses/new/CoursesNew.js index 4c020d7d4..b2b42dad3 100644 --- a/public/react/src/modules/courses/new/CoursesNew.js +++ b/public/react/src/modules/courses/new/CoursesNew.js @@ -48,7 +48,8 @@ class CoursesNew extends Component { addonAfteronelenone:0, addonAfteronelentwo:0, bordebool:false, - smallspinning:false + smallspinning:false, + bottonloading:false } } componentDidMount() { @@ -217,7 +218,9 @@ class CoursesNew extends Component { if (!err) { - + this.setState({ + bottonloading:true + }) // console.log('Received values of form: ', values); @@ -240,7 +243,7 @@ class CoursesNew extends Component { if (response.data.status === 0) { // this.goback() - window.location.href=first_category_url; + window.location.href=first_category_url; if(this.state.boolxinjian===true) { var yslGuideone = window.localStorage.getItem('yslGuideone'); try { @@ -257,11 +260,19 @@ class CoursesNew extends Component { } } - } + }else{ + this.setState({ + bottonloading:false + }) + } }).catch((error) => { console.log(error) }) - } + }else{ + this.setState({ + bottonloading:false + }) + } }); } else { this.props.form.validateFields((err, values) => { @@ -283,6 +294,9 @@ class CoursesNew extends Component { // debugger //新建 // console.log('Received values of form: ', values); + this.setState({ + bottonloading:true + }) let url = "/courses.json"; axios.post(url, { @@ -300,6 +314,7 @@ class CoursesNew extends Component { ).then((response) => { if (response.status === 200) { // this.goback + window.location.href=response.data.first_category_url; if(this.state.boolxinjian===true){ var yslGuideone = window.localStorage.getItem('yslGuideone'); @@ -318,11 +333,19 @@ class CoursesNew extends Component { } - } + }else{ + this.setState({ + bottonloading:false + }) + } }).catch((error) => { console.log(error) }) - } + }else{ + this.setState({ + bottonloading:false + }) + } }); } @@ -934,7 +957,7 @@ class CoursesNew extends Component {
- {/*提交*/} diff --git a/public/react/src/modules/courses/new/Goldsubject.js b/public/react/src/modules/courses/new/Goldsubject.js index 0924a6563..35a83ed94 100644 --- a/public/react/src/modules/courses/new/Goldsubject.js +++ b/public/react/src/modules/courses/new/Goldsubject.js @@ -55,7 +55,8 @@ class Goldsubject extends Component { addonAfteronelentwo:"", Whethertocreateanewclassroom:true, bordebool:false, - smallspinning:false + smallspinning:false, + bottonloading:false } } // disabledEndDate= endValue => { @@ -351,7 +352,9 @@ class Goldsubject extends Component { }catch (e) { } - + this.setState({ + bottonloading:true + }) let url = "/courses/" + coursesId + ".json"; axios.put(url, datasysl @@ -372,12 +375,21 @@ class Goldsubject extends Component { return } }catch (e) { - + this.setState({ + bottonloading:false + }) } + }else{ + this.setState({ + bottonloading:false + }) } }).catch((error) => { console.log(error) + this.setState({ + bottonloading:false + }) }) } @@ -424,20 +436,15 @@ class Goldsubject extends Component { course_module_types: values.checkboxgroup, school:values.school }; - try { - // console.log("提交的ysldatas数据"); - // console.log(ysldatas); - // console.log(JSON.stringify(ysldatas)); - // console.log(moment(values.starttime).format("YYYY-MM-DD")); - // console.log(moment(values.endtime).format("YYYY-MM-DD")); - }catch (e) { - - } + this.setState({ + bottonloading:true + }) axios.post(url, ysldatas ).then((response) => { if (response.status === 200) { + // this.goback window.location.href=response.data.first_category_url; var yslGuideone = window.localStorage.getItem('yslGuideone'); @@ -451,11 +458,16 @@ class Goldsubject extends Component { return } }catch (e) { - + this.setState({ + bottonloading:false + }) } } }).catch((error) => { console.log(error) + this.setState({ + bottonloading:false + }) }) } }); @@ -1074,9 +1086,11 @@ class Goldsubject extends Component {
- + {/*提交*/} 取消
diff --git a/public/react/src/modules/paths/PathNew.js b/public/react/src/modules/paths/PathNew.js index 95e343b13..11b54d0d0 100644 --- a/public/react/src/modules/paths/PathNew.js +++ b/public/react/src/modules/paths/PathNew.js @@ -86,7 +86,8 @@ class PathNew extends Component{ pathName:"", description:"", point:"", - flag_name:true + flag_name:true, + bottonloading:false } } @@ -124,6 +125,9 @@ class PathNew extends Component{ return; } if (this.isEditPage == true) { + this.setState({ + bottonloading:true + }) let pathId = this.props.match.params.pathId; const editUrl = `/paths/${pathId}.json` @@ -135,11 +139,21 @@ class PathNew extends Component{ // console.log(response.data.subject_id); if (response.data.subject_id) { this.props.history.push(`/paths/${response.data.subject_id}`) - } + }else{ + this.setState({ + bottonloading:false + }) + } }).catch((error)=>{ console.log(error); + this.setState({ + bottonloading:false + }) }) } else { + this.setState({ + bottonloading:true + }) let url="/paths.json" axios.post(url,{ name:pathName, @@ -149,9 +163,16 @@ class PathNew extends Component{ // console.log(response.data.subject_id); if (response.data.subject_id) { this.props.history.push(`/paths/${response.data.subject_id}`) - } + }else{ + this.setState({ + bottonloading:false + }) + } }).catch((error)=>{ console.log(error); + this.setState({ + bottonloading:false + }) }) } @@ -267,7 +288,7 @@ class PathNew extends Component{
- 提交 + {this.isEditPage ? 取消 diff --git a/public/react/src/modules/tpm/newshixuns/Newshixuns.js b/public/react/src/modules/tpm/newshixuns/Newshixuns.js index d2e26d58b..c2c464618 100644 --- a/public/react/src/modules/tpm/newshixuns/Newshixuns.js +++ b/public/react/src/modules/tpm/newshixuns/Newshixuns.js @@ -233,7 +233,8 @@ class Newshixuns extends Component { systemenvironmenttype:false, testcoderunmodetype:false, attachmentidstype:false, - datalisttype:false + datalisttype:false, + bottonloading:false } } @@ -494,6 +495,9 @@ class Newshixuns extends Component { } else { newmulti_webssh = "" } + this.setState({ + bottonloading:true + }) axios.post(Url, { name: name, can_copy: can_copy, @@ -513,9 +517,16 @@ class Newshixuns extends Component { if (response.status === 200) { window.location.href = "/shixuns/" + response.data.shixun_identifier + "/challenges"; // window.open("/shixuns/"+response.data.shixun_identifier+"/challenges"); - } + }else{ + this.setState({ + bottonloading:false + }) + } }).catch((error) => { console.log(error) + this.setState({ + bottonloading:false + }) }) } @@ -1321,7 +1332,9 @@ class Newshixuns extends Component {
- 提交 + 取消
diff --git a/public/react/src/modules/tpm/newshixuns/css/Newshixuns.css b/public/react/src/modules/tpm/newshixuns/css/Newshixuns.css index da0924b94..faeb8e987 100644 --- a/public/react/src/modules/tpm/newshixuns/css/Newshixuns.css +++ b/public/react/src/modules/tpm/newshixuns/css/Newshixuns.css @@ -384,4 +384,10 @@ a.white-btn.use_scope-btn:hover{ .ml82{ margin-left: 82px; +} + +.ant-btn-primary.active, .ant-btn-primary:active { + color: #fff; + background-color: #096dd9; + border-color: #096dd9; } \ No newline at end of file