From fc965a3030b9929959a2d4c90ad16cb10bfb946f Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Thu, 25 Jul 2019 11:34:14 +0800 Subject: [PATCH 01/58] =?UTF-8?q?=E5=8A=A0=E5=85=A5=E8=AF=BE=E5=A0=82?= =?UTF-8?q?=E7=9A=84=E6=8F=90=E7=A4=BA=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/courses_controller.rb | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/app/controllers/courses_controller.rb b/app/controllers/courses_controller.rb index f5830adff..230e7f387 100644 --- a/app/controllers/courses_controller.rb +++ b/app/controllers/courses_controller.rb @@ -906,7 +906,6 @@ class CoursesController < ApplicationController CourseAddStudentCreateWorksJob.perform_later(course.id, [current_user.id]) StudentJoinCourseNotifyJob.perform_later(current_user.id, course.id) - logger.info("#####################{course.id}") end end @@ -927,14 +926,18 @@ class CoursesController < ApplicationController role = course_message.content == 2 ? '7' : '9' # 7:老师 9:助教 ApplyTeacherRoleJoinCourseNotifyJob.perform_later(current_user.id, course.id, role) + teacher_role = 1 + message = "#{course_message.content == 2 ? '教师' : '助教'}申请已提交,请等待审核" end end end - if current_user.student_of_course?(course) || current_user.teacher_of_course?(course) - render json: { status: 0, message: "成功", course_id: course.id} + if teacher_role && current_user.student_of_course?(course) + render json: { status: 0, message: message, course_id: course.id} + elsif current_user.student_of_course?(course) + render json: { status: 0, message: "加入成功", course_id: course.id} else - normal_status("申请已提交,请等待审核") + normal_status(message) end rescue => e uid_logger(e.message) From 4992ea6d61bc120d8f25872e4654dd7ad2df0158 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Thu, 25 Jul 2019 13:08:27 +0800 Subject: [PATCH 02/58] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/modules/user/FindPasswordComponent.js | 54 ++++++++- .../modules/user/LoginRegisterComponent.js | 113 +++++++++++++++++- 2 files changed, 158 insertions(+), 9 deletions(-) diff --git a/public/react/src/modules/user/FindPasswordComponent.js b/public/react/src/modules/user/FindPasswordComponent.js index 19b5a7388..22fcd97de 100644 --- a/public/react/src/modules/user/FindPasswordComponent.js +++ b/public/react/src/modules/user/FindPasswordComponent.js @@ -424,10 +424,56 @@ class LoginRegisterComponent extends Component { }) return } - this.setState({ - Phonenumberisnotcosytdhk:undefined, - }) - this.Emailphonenumberverification(e.target.value) + console.log(e.target.value.length); + if (e.target.value.length === 0) { + this.setState({ + Phonenumberisnotco: undefined, + Phonenumberisnotcobool: false, + }) + return; + } + // var telephone = $("#telephoneAdd.tianjia_phone").val(); + var regph = /^[1][3,4,5,6,7,8][0-9]{9}$/; + // var email = $("#add_email.tianjia_email").val(); + var regemail = /^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/; + + // [1]手机号开头必须是1 [3,4,5,6,7,8] 第二位是3-8中的一个 [0-9]{9} 后边9位可以是0-9的任意数字。 + var stringdata = undefined; + if (!regph.test(e.target.value)) { + stringdata = "手机号格式不正确"; + this.setState({ + Phonenumberisnotco: stringdata, + Phonenumberisnotcobool: false, + }) + } else { + this.setState({ + Phonenumberisnotco: undefined, + Phonenumberisnotcobool: true, + }) + return + } + + if (!regemail.test(e.target.value)) { + if ((e.target.value.indexOf("@") != -1) === true) { + stringdata = "邮箱格式不正确"; + } else { + stringdata = "手机号格式不正确"; + + } + this.setState({ + Phonenumberisnotco: stringdata, + Phonenumberisnotcobool: false, + }) + return + } else { + this.setState({ + Phonenumberisnotco: undefined, + Phonenumberisnotcobool: true, + }) + this.Emailphonenumberverification(e.target.value) + return + } + this.Emailphonenumberverification(e.target.value) } } diff --git a/public/react/src/modules/user/LoginRegisterComponent.js b/public/react/src/modules/user/LoginRegisterComponent.js index b27fe8cec..dcbaf4730 100644 --- a/public/react/src/modules/user/LoginRegisterComponent.js +++ b/public/react/src/modules/user/LoginRegisterComponent.js @@ -402,6 +402,7 @@ class LoginRegisterComponent extends Component { type: 1, } }).then((result) => { + debugger //验证有问题{"status":1,"message":"success"} // console.log(result); // this.setState({dragOk: true}) @@ -409,12 +410,12 @@ class LoginRegisterComponent extends Component { if(result){ if(result.data.status===-2){ if (id === 1) { - console.log(value.length); if(result.data.message==="该手机号码或邮箱已被注册"){ this.setState({ Phonenumberisnotco: undefined, Phonenumberisnotcobool: false, dragOk:true, + }) }else { this.setState({ @@ -436,7 +437,6 @@ class LoginRegisterComponent extends Component { } }else { if (id === 1) { - console.log(value.length); this.setState({ Phonenumberisnotco: undefined, Phonenumberisnotcobool: false, @@ -585,13 +585,116 @@ class LoginRegisterComponent extends Component { } //失去焦点判断 inputOnBlur = (e, id) => { - this.isCorrectname(e.target.value, id); + // this.isCorrectname(e.target.value, id); // this.Emailphonenumberverification(e.target.value, id); + if (e.target.value.length === 0) { + this.setState({ + Phonenumberisnotco: undefined, + Phonenumberisnotcobool: false, + }) + return; + } + // var telephone = $("#telephoneAdd.tianjia_phone").val(); + var regph = /^[1][3,4,5,6,7,8][0-9]{9}$/; + // var email = $("#add_email.tianjia_email").val(); + var regemail = /^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/; + + // [1]手机号开头必须是1 [3,4,5,6,7,8] 第二位是3-8中的一个 [0-9]{9} 后边9位可以是0-9的任意数字。 + var stringdata = undefined; + if (!regph.test(e.target.value)) { + stringdata = "手机号格式不正确"; + this.setState({ + Phonenumberisnotco: stringdata, + Phonenumberisnotcobool: true, + dragOk:false, + Whethertoverify:this.state.Whethertoverify===true?false:true, + }) + } else { + this.setState({ + Phonenumberisnotco: undefined, + Phonenumberisnotcobool: false, + }) + return + } + + if (!regemail.test(e.target.value)) { + if ((e.target.value.indexOf("@") != -1) === true) { + stringdata = "邮箱格式不正确"; + } else { + stringdata = "手机号格式不正确"; + + } + this.setState({ + Phonenumberisnotco: stringdata, + Phonenumberisnotcobool: true, + dragOk:false, + Whethertoverify:this.state.Whethertoverify===true?false:true, + }) + return + } else { + this.setState({ + Phonenumberisnotco: undefined, + Phonenumberisnotcobool: false, + }) + this.Emailphonenumberverification(e.target.value, 1); + return + } + this.Emailphonenumberverification(e.target.value, 1); } inputOnBlurzhuche = (e, id) => { - if(this.state.pciphone===false) { + if (e.target.value.length === 0) { + this.setState({ + Phonenumberisnotcos: undefined, + Phonenumberisnotcobool: false, + }) + return; + } + // var telephone = $("#telephoneAdd.tianjia_phone").val(); + var regph = /^[1][3,4,5,6,7,8][0-9]{9}$/; + // var email = $("#add_email.tianjia_email").val(); + var regemail = /^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/; + + // [1]手机号开头必须是1 [3,4,5,6,7,8] 第二位是3-8中的一个 [0-9]{9} 后边9位可以是0-9的任意数字。 + var stringdata = undefined; + if (!regph.test(e.target.value)) { + stringdata = "手机号格式不正确"; + this.setState({ + Phonenumberisnotcos: stringdata, + Phonenumberisnotcobool: true, + dragOk:false, + Whethertoverify:this.state.Whethertoverify===true?false:true, + }) + } else { + this.setState({ + Phonenumberisnotcos: undefined, + Phonenumberisnotcobool: false, + }) + return + } + + if (!regemail.test(e.target.value)) { + if ((e.target.value.indexOf("@") != -1) === true) { + stringdata = "邮箱格式不正确"; + } else { + stringdata = "手机号格式不正确"; + + } + this.setState({ + Phonenumberisnotcos: stringdata, + Phonenumberisnotcobool: true, + dragOk:false, + Whethertoverify:this.state.Whethertoverify===true?false:true, + }) + return + } else { + this.setState({ + Phonenumberisnotcos: undefined, + Phonenumberisnotcobool: false, + }) + this.Emailphonenumberverification(e.target.value, id); + return + } this.Emailphonenumberverification(e.target.value, id); - } } //获取登入密码 passwordonChange = (e) => { From a4910c2f8f61a051c06ae220f4034fc89a56d4d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Thu, 25 Jul 2019 13:40:12 +0800 Subject: [PATCH 03/58] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/react/src/modules/login/EducoderLogin.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/react/src/modules/login/EducoderLogin.js b/public/react/src/modules/login/EducoderLogin.js index 713593100..eed3a9add 100644 --- a/public/react/src/modules/login/EducoderLogin.js +++ b/public/react/src/modules/login/EducoderLogin.js @@ -148,7 +148,7 @@ class EducoderLogin extends Component { "align-items": "center", "width": "100%" }}> -
+
this.gohome()} src={educodernet}/>
From a107be221c2a8f3135e60060ebff32ee693f1d1e Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Thu, 25 Jul 2019 14:02:02 +0800 Subject: [PATCH 04/58] delay 1 --- public/react/src/common/components/Cropper.js | 2 +- .../src/modules/courses/busyWork/UseBank.js | 2 +- .../user/account/ChangeHeaderPicModal.js | 21 ++++++++++++++----- 3 files changed, 18 insertions(+), 7 deletions(-) diff --git a/public/react/src/common/components/Cropper.js b/public/react/src/common/components/Cropper.js index 632950434..3ce30a8b5 100644 --- a/public/react/src/common/components/Cropper.js +++ b/public/react/src/common/components/Cropper.js @@ -102,7 +102,7 @@ class Cropper extends Component { setTimeout(() => { const image = document.getElementById(this.props.imageId || '__image'); this.cropper = new window.Cropper(image, this.options); - }, 1000) + }, 1200) } renew = (image) => { diff --git a/public/react/src/modules/courses/busyWork/UseBank.js b/public/react/src/modules/courses/busyWork/UseBank.js index 671a09fff..ca65e74be 100644 --- a/public/react/src/modules/courses/busyWork/UseBank.js +++ b/public/react/src/modules/courses/busyWork/UseBank.js @@ -194,7 +194,7 @@ class UseBank extends Component{ display: -webkit-flex; } .setImgW .edu-nodata-img{ - width:218px !important; + width: 170px !important; } .bankwidth{ width:24% !important; diff --git a/public/react/src/modules/user/account/ChangeHeaderPicModal.js b/public/react/src/modules/user/account/ChangeHeaderPicModal.js index abb3d0e12..cef643094 100644 --- a/public/react/src/modules/user/account/ChangeHeaderPicModal.js +++ b/public/react/src/modules/user/account/ChangeHeaderPicModal.js @@ -105,11 +105,16 @@ class ChangeHeaderPicModal extends Component{ .then((response) => { // {"status":0,"message":"success","avatar_url":"avatars/User/15739"} if (response.data.status == 0) { - // this.props.getBasicInfo() - this.props.fetchUser() - // 头像更新后会触发AccountPage的DidUpdate,然后会调用getBasicInfo - this.props.showNotification && this.props.showNotification("修改头像成功") - this.setVisible(false) + // this.props.getBasicInfo() + // https://www.trustie.net/issues/22461 + if ( this.props.current_user.image_url.indexOf('avatars/User/b') != -1 + || this.props.current_user.image_url.indexOf('avatars/User/g') != -1 ) { + this.setTimeout(() => { + this.doAfterUpdated() + }, 1000) + } else { + this.doAfterUpdated(); + } } }) .catch(function (error) { @@ -117,6 +122,12 @@ class ChangeHeaderPicModal extends Component{ }); }); } + doAfterUpdated = () => { + this.props.fetchUser() + // 头像更新后会触发AccountPage的DidUpdate,然后会调用getBasicInfo + this.props.showNotification && this.props.showNotification("修改头像成功") + this.setVisible(false) + } render(){ const { course_lists } = this.state From 4f8585be428fb18f867413fef6b0fa804bcb5ee6 Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Thu, 25 Jul 2019 14:18:17 +0800 Subject: [PATCH 05/58] =?UTF-8?q?=E5=AE=9E=E8=B7=B5=E8=AF=BE=E7=A8=8B?= =?UTF-8?q?=E7=9A=84=E9=98=B6=E6=AE=B5=E5=90=8D=E7=A7=B0=E9=99=90=E5=88=B6?= =?UTF-8?q?60=E4=B8=AA=E5=AD=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../course_second_categories_controller.rb | 2 +- app/controllers/stages_controller.rb | 11 +++++++---- app/controllers/subjects_controller.rb | 2 +- app/models/stage.rb | 2 +- 4 files changed, 10 insertions(+), 7 deletions(-) diff --git a/app/controllers/course_second_categories_controller.rb b/app/controllers/course_second_categories_controller.rb index af368a8dc..e5c3366cd 100644 --- a/app/controllers/course_second_categories_controller.rb +++ b/app/controllers/course_second_categories_controller.rb @@ -8,7 +8,7 @@ class CourseSecondCategoriesController < ApplicationController tip_exception("毕设子目录不能重命名") if @category.category_type == "graduation" tip_exception("名称不能为空") if params[:name].blank? tip_exception("已存在同名子目录") if @course_module.course_second_categories.exists?(name: params[:name].strip) - @category.update_attributes(name: params[:name].strip) + @category.update_attributes!(name: params[:name].strip) normal_status(0, "更新成功") end diff --git a/app/controllers/stages_controller.rb b/app/controllers/stages_controller.rb index c62832365..d456c17e7 100644 --- a/app/controllers/stages_controller.rb +++ b/app/controllers/stages_controller.rb @@ -39,10 +39,13 @@ class StagesController < ApplicationController def update ActiveRecord::Base.transaction do begin - @stage.update_attributes(stage_params) - @stage.stage_shixuns.destroy_all + @stage.update_attributes!(stage_params) unless params[:shixun_id].blank? - params[:shixun_id].each do |shixun_id| + new_shixun_ids = params[:shixun_id] - @stage.stage_shixuns.pluck(:shixun_id) + delete_shixun_ids = @stage.stage_shixuns.pluck(:shixun_id) - params[:shixun_id] + @stage.stage_shixuns.where(shixun_id: delete_shixun_ids).destroy_all + + new_shixun_ids.each do |shixun_id| shixun = Shixun.where(id: shixun_id).first @stage.stage_shixuns.create!(subject_id: @subject.id, shixun_id: shixun.id, position: @stage.stage_shixuns.count + 1) if shixun.present? end @@ -50,7 +53,7 @@ class StagesController < ApplicationController @subject.update_attributes(updated_at: Time.now) rescue Exception => e uid_logger_error(e.message) - tip_exception("章节更新失败") + tip_exception(e.message) raise ActiveRecord::Rollback end end diff --git a/app/controllers/subjects_controller.rb b/app/controllers/subjects_controller.rb index cc0e06a38..5cbb2a462 100644 --- a/app/controllers/subjects_controller.rb +++ b/app/controllers/subjects_controller.rb @@ -207,7 +207,7 @@ class SubjectsController < ApplicationController end rescue Exception => e uid_logger(e.message) - tip_exception("发送失败") + tip_exception(e.message) raise ActiveRecord::Rollback end end diff --git a/app/models/stage.rb b/app/models/stage.rb index d255cddeb..db7b5c0b3 100644 --- a/app/models/stage.rb +++ b/app/models/stage.rb @@ -6,6 +6,6 @@ class Stage < ApplicationRecord has_many :stage_shixuns, -> { order("stage_shixuns.position ASC") }, dependent: :destroy has_many :shixuns, :through => :stage_shixuns - validates :name, length: { maximum: 30 } + validates :name, length: { maximum: 60 } validates :description, length: { maximum: 300 } end From b0b056ebc35f2fed4015945baadac228f79fa941 Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Thu, 25 Jul 2019 14:23:02 +0800 Subject: [PATCH 06/58] stage update --- app/controllers/stages_controller.rb | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/app/controllers/stages_controller.rb b/app/controllers/stages_controller.rb index d456c17e7..3967554aa 100644 --- a/app/controllers/stages_controller.rb +++ b/app/controllers/stages_controller.rb @@ -40,12 +40,9 @@ class StagesController < ApplicationController ActiveRecord::Base.transaction do begin @stage.update_attributes!(stage_params) + @stage.stage_shixuns.destroy_all unless params[:shixun_id].blank? - new_shixun_ids = params[:shixun_id] - @stage.stage_shixuns.pluck(:shixun_id) - delete_shixun_ids = @stage.stage_shixuns.pluck(:shixun_id) - params[:shixun_id] - @stage.stage_shixuns.where(shixun_id: delete_shixun_ids).destroy_all - - new_shixun_ids.each do |shixun_id| + params[:shixun_id].each do |shixun_id| shixun = Shixun.where(id: shixun_id).first @stage.stage_shixuns.create!(subject_id: @subject.id, shixun_id: shixun.id, position: @stage.stage_shixuns.count + 1) if shixun.present? end From 5bfb41ad37c3ca0dcb7a652eb6496d9b8c69cfd8 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, 25 Jul 2019 14:34:46 +0800 Subject: [PATCH 07/58] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../courses/coursesDetail/CoursesLeftNav.js | 4 +- .../courses/coursesPublic/AddcoursesNav.js | 148 +++++++++--------- .../courses/coursesPublic/ModalsRename.js | 124 +++++++-------- public/react/src/modules/paths/Index.js | 108 +++++++------ .../modules/paths/PathDetail/DetailCards.js | 20 ++- .../paths/PathDetail/DetailCardsEditAndAdd.js | 2 +- .../PathDetail/DetailCardsEditAndEdit.js | 2 +- .../paths/PathDetail/PathDetailIndex.js | 6 + 8 files changed, 220 insertions(+), 194 deletions(-) diff --git a/public/react/src/modules/courses/coursesDetail/CoursesLeftNav.js b/public/react/src/modules/courses/coursesDetail/CoursesLeftNav.js index 2a395200c..707c4ba9b 100644 --- a/public/react/src/modules/courses/coursesDetail/CoursesLeftNav.js +++ b/public/react/src/modules/courses/coursesDetail/CoursesLeftNav.js @@ -408,7 +408,7 @@ class Coursesleftnav extends Component{ this.setState({ Navmodalname:id===2?"新建分班":"添加目录", Navtitles:id===2?"分班名称":"目录名称", - Navplaceholder:id===2?"示例:分班(最佳4个字符)":"示例:第一阶段(最佳4个字符)", + Navplaceholder:"请输入名称,最大限制60个字符", Navmodalnametype:true, Navmodaltypename:id, setnavid:setnavid, @@ -419,7 +419,7 @@ class Coursesleftnav extends Component{ this.setState({ Navmodalname:id===5?"分班重命名":"目录重命名", Navtitles:id===5?"分班名称":"目录名称", - Navplaceholder:id===5?"示例:分班(最佳4个字符)":"示例:第一阶段(最佳4个字符)", + Navplaceholder:"请输入名称,最大限制60个字符", Navmodalnametype:true, Navmodaltypename:id, setnavid:setnavid, diff --git a/public/react/src/modules/courses/coursesPublic/AddcoursesNav.js b/public/react/src/modules/courses/coursesPublic/AddcoursesNav.js index 74c03808a..756ae62a6 100644 --- a/public/react/src/modules/courses/coursesPublic/AddcoursesNav.js +++ b/public/react/src/modules/courses/coursesPublic/AddcoursesNav.js @@ -1,74 +1,74 @@ -import React,{ Component } from "react"; -import { Modal,Checkbox,Input,Select} from "antd"; -const Option = Select.Option; - -class AddcoursesNav extends Component{ - constructor(props){ - super(props); - this.state={ - StudentList_value:"" - } - } - - - - render(){ - // let {StudentList_value}=this.state; - // let {child}=this.props; - // - return( -
- - - - {this.props.addnametab===2? -
-
目录名称:
- -
- 取消 - 确定 -
-
- : this.props.addnametab===4? -
-
选择目录名称:
- - - -
- 取消 - 确定 -
-
- :""} -
- -
- ) - } -} -export default AddcoursesNav; - - +import React,{ Component } from "react"; +import { Modal,Checkbox,Input,Select} from "antd"; +const Option = Select.Option; + +class AddcoursesNav extends Component{ + constructor(props){ + super(props); + this.state={ + StudentList_value:"" + } + } + + + + render(){ + // let {StudentList_value}=this.state; + // let {child}=this.props; + // + return( +
+ + + + {this.props.addnametab===2? +
+
目录名称:
+ +
+ 取消 + 确定 +
+
+ : this.props.addnametab===4? +
+
选择目录名称:
+ + + +
+ 取消 + 确定 +
+
+ :""} +
+ +
+ ) + } +} +export default AddcoursesNav; + + diff --git a/public/react/src/modules/courses/coursesPublic/ModalsRename.js b/public/react/src/modules/courses/coursesPublic/ModalsRename.js index 61d0c1cd7..1398c50ff 100644 --- a/public/react/src/modules/courses/coursesPublic/ModalsRename.js +++ b/public/react/src/modules/courses/coursesPublic/ModalsRename.js @@ -1,63 +1,63 @@ -import React,{ Component } from "react"; -import { Modal,Checkbox,Upload,Button,Icon,message,Input} from "antd"; -import axios from 'axios'; - -class ModalsRename extends Component{ - constructor(props){ - super(props); - this.state={ - name:this.props.NavmodalValue - } - } - - saveNavmoda=()=>{ - let{url}=this.props; - let{name}=this.state; - - axios.post(url, {name:name}).then((result) => { - if(result.data.status===0){ - this.props.showNotification(result.data.message); - this.props.cannerNavmoda(); - this.props.coursupdata(); - }} - ) - } - - setNavmodalValue=(e)=>{ - console.log(e.target.value) - this.setState({ - name:e.target.value - }) - } - - render(){ - return( -
- -
{this.props.Navname}名称:
- -
- this.props.cannerNavmoda()}>取消 - this.saveNavmoda()}>确定 -
-
-
- ) - } -} +import React,{ Component } from "react"; +import { Modal,Checkbox,Upload,Button,Icon,message,Input} from "antd"; +import axios from 'axios'; + +class ModalsRename extends Component{ + constructor(props){ + super(props); + this.state={ + name:this.props.NavmodalValue + } + } + + saveNavmoda=()=>{ + let{url}=this.props; + let{name}=this.state; + + axios.post(url, {name:name}).then((result) => { + if(result.data.status===0){ + this.props.showNotification(result.data.message); + this.props.cannerNavmoda(); + this.props.coursupdata(); + }} + ) + } + + setNavmodalValue=(e)=>{ + console.log(e.target.value) + this.setState({ + name:e.target.value + }) + } + + render(){ + return( +
+ +
{this.props.Navname}名称:
+ +
+ this.props.cannerNavmoda()}>取消 + this.saveNavmoda()}>确定 +
+
+
+ ) + } +} export default ModalsRename; \ No newline at end of file diff --git a/public/react/src/modules/paths/Index.js b/public/react/src/modules/paths/Index.js index a26228ed5..a7efc43bc 100644 --- a/public/react/src/modules/paths/Index.js +++ b/public/react/src/modules/paths/Index.js @@ -1,52 +1,58 @@ -import React, { Component } from 'react'; - -import { SnackbarHOC } from 'educoder'; - - -import {BrowserRouter as Router,Route,Switch} from 'react-router-dom'; -import Loadable from 'react-loadable'; -import Loading from '../../Loading'; -import { TPMIndexHOC } from '../tpm/TPMIndexHOC'; - -const PathsDetail = Loadable({ - loader: () => import('./PathDetail/PathDetailIndex'), - loading:Loading, -}) -const PathsNew = Loadable({ - loader: () => import('./PathNew'), - loading:Loading, -}) -const Statistics = Loadable({ - loader: () => import('./SchoolStatistics/Statistics'), - loading:Loading -}) - -const ShixunPaths = Loadable({ - loader: () => import('./ShixunPaths'), - loading:Loading, -}) - - -class Index extends Component{ - constructor(props) { - super(props) - } - render() { - return ( -
- - - ()} - > - ()} - > - - - -
- ) - } -} +import React, { Component } from 'react'; + +import { SnackbarHOC } from 'educoder'; + + +import {BrowserRouter as Router,Route,Switch} from 'react-router-dom'; +import Loadable from 'react-loadable'; +import Loading from '../../Loading'; +import { TPMIndexHOC } from '../tpm/TPMIndexHOC'; + +const PathsDetail = Loadable({ + loader: () => import('./PathDetail/PathDetailIndex'), + loading:Loading, +}) +const PathsNew = Loadable({ + loader: () => import('./PathNew'), + loading:Loading, +}) +const Statistics = Loadable({ + loader: () => import('./SchoolStatistics/Statistics'), + loading:Loading +}) + +const ShixunPaths = Loadable({ + loader: () => import('./ShixunPaths'), + loading:Loading, +}) + + +class Index extends Component{ + constructor(props) { + super(props) + } + render() { + return ( +
+ + + + ()} + > + ()} + > + + ()} + > + + {/**/} + + +
+ ) + } +} export default SnackbarHOC() ( TPMIndexHOC(Index) ); \ No newline at end of file diff --git a/public/react/src/modules/paths/PathDetail/DetailCards.js b/public/react/src/modules/paths/PathDetail/DetailCards.js index 115f7066c..0e95f1a48 100644 --- a/public/react/src/modules/paths/PathDetail/DetailCards.js +++ b/public/react/src/modules/paths/PathDetail/DetailCards.js @@ -314,6 +314,7 @@ class DetailCards extends Component{ showparagraphindex }=this.state; const antIcon = ; + return(
+
{ pathCardsList && pathCardsList.map((item,key)=>{ @@ -374,7 +388,7 @@ class DetailCards extends Component{ - {item.stage_name} + {item.stage_name} { idsum===key&&pathCardsedittype===true?'': @@ -442,13 +456,13 @@ class DetailCards extends Component{ : } - + {key+1}-{index+1}  {line.shixun_name} { - line.shixun_status==="暂未公开"? + this.props.current_user&&this.props.current_user.admin===false&&line.shixun_status==="暂未公开"?
  • 暂未公开
  • :
  • diff --git a/public/react/src/modules/paths/PathDetail/DetailCardsEditAndAdd.js b/public/react/src/modules/paths/PathDetail/DetailCardsEditAndAdd.js index 340505655..912302cb8 100644 --- a/public/react/src/modules/paths/PathDetail/DetailCardsEditAndAdd.js +++ b/public/react/src/modules/paths/PathDetail/DetailCardsEditAndAdd.js @@ -402,7 +402,7 @@ class DetailCardsEditAndAdd extends Component{
    *
    - +
    名称不能为空
    必填项
    diff --git a/public/react/src/modules/paths/PathDetail/DetailCardsEditAndEdit.js b/public/react/src/modules/paths/PathDetail/DetailCardsEditAndEdit.js index 1bf137016..f91cf0e96 100644 --- a/public/react/src/modules/paths/PathDetail/DetailCardsEditAndEdit.js +++ b/public/react/src/modules/paths/PathDetail/DetailCardsEditAndEdit.js @@ -435,7 +435,7 @@ class DetailCardsEditAndEdit extends Component{
    *
    - +
    名称不能为空
    必填项
    diff --git a/public/react/src/modules/paths/PathDetail/PathDetailIndex.js b/public/react/src/modules/paths/PathDetail/PathDetailIndex.js index 1731064c0..61933b765 100644 --- a/public/react/src/modules/paths/PathDetail/PathDetailIndex.js +++ b/public/react/src/modules/paths/PathDetail/PathDetailIndex.js @@ -140,10 +140,13 @@ class PathDetailIndex extends Component{ let url="/paths/"+pathid+".json"; axios.get(url).then((result)=>{ if (result.data.status === 407 || result.data.status === 401) { + debugger return; } if (result.data.status === 403) { + debugger + window.location.href = "/403"; return; } @@ -165,9 +168,12 @@ class PathDetailIndex extends Component{ axios.get(url).then((result)=>{ // TODO 403 让后台返回status 403 比较好 if (result.data.status == 407 || result.data.status == 401) { + debugger return; } if (result.data.status === 403 ) { + debugger + window.location.href = "/403"; return; } From 1bfe9b6b59a6fd254b84f6cab1f0b36e244b4825 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Thu, 25 Jul 2019 15:05:48 +0800 Subject: [PATCH 08/58] =?UTF-8?q?=E9=87=8D=E5=86=99=E5=BC=80=E5=90=AF?= =?UTF-8?q?=E5=AE=9E=E8=AE=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/shixuns_controller.rb | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/app/controllers/shixuns_controller.rb b/app/controllers/shixuns_controller.rb index 587ef2cb9..fbc5c18fb 100644 --- a/app/controllers/shixuns_controller.rb +++ b/app/controllers/shixuns_controller.rb @@ -676,13 +676,13 @@ class ShixunsController < ApplicationController myshixun_params = {user_id: current_user.id, identifier: myshixun_identifier, modify_time: @shixun.modify_time, reset_time: @shixun.reset_time, onclick_time: Time.now, commit_id: commit_id} - myshixun = @shixun.myshixuns.create!(myshixun_params) + @myshixun = @shixun.myshixuns.create!(myshixun_params) # 其它创建关卡等操作 challenges = @shixun.challenges # 之所以增加user_id是为了方便统计查询性能 game_attrs = %i[challenge_id myshixun_id status user_id open_time identifier modify_time created_at updated_at] Game.bulk_insert(*game_attrs) do |worker| - base_attr = {myshixun_id: myshixun.id, user_id: myshixun.user_id} + base_attr = {myshixun_id: @myshixun.id, user_id: @myshixun.user_id} challenges.each_with_index do |challenge, index| status = (index == 0 ? 0 : 3) game_identifier = generate_identifier(Game, 12) @@ -690,7 +690,7 @@ class ShixunsController < ApplicationController identifier: game_identifier, modify_time: challenge.modify_time)) end end - @current_task = myshixun.current_task(myshixun.games) + @current_task = @myshixun.current_task(@myshixun.games) rescue Exception => e logger.error("------ActiveRecord::RecordInvalid: #{e.message}") raise("ActiveRecord::RecordInvalid") @@ -701,12 +701,12 @@ class ShixunsController < ApplicationController unless is_choice_type # fork仓库 cloud_bridge = edu_setting('cloud_bridge') - project_fork(myshixun, @repo_path, current_user.login) + project_fork(@myshixun, @repo_path, current_user.login) rep_url = Base64.urlsafe_encode64(repo_ip_url @repo_path) uid_logger("start openGameInstance") uri = "#{cloud_bridge}/bridge/game/openGameInstance" logger.info("end openGameInstance") - params = {tpiID: "#{myshixun.id}", tpmGitURL: rep_url, tpiRepoName: myshixun.repo_name.split("/").last} + params = {tpiID: "#{@myshixun.id}", tpmGitURL: rep_url, tpiRepoName: @myshixun.repo_name.split("/").last} uid_logger("openGameInstance params is #{params}") interface_post uri, params, 83, "实训云平台繁忙(繁忙等级:83)" end From 5bebbbcd2f77191784a2f9a15024ac27d32ff0b0 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Thu, 25 Jul 2019 15:06:56 +0800 Subject: [PATCH 09/58] =?UTF-8?q?=E8=B7=91=E5=87=BA=E5=BC=82=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/shixuns_controller.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/app/controllers/shixuns_controller.rb b/app/controllers/shixuns_controller.rb index fbc5c18fb..7a2db0666 100644 --- a/app/controllers/shixuns_controller.rb +++ b/app/controllers/shixuns_controller.rb @@ -716,6 +716,7 @@ class ShixunsController < ApplicationController logger.error("##########project_fork error #{e.message}") @current_task.destroy! end + raise ActiveRecord::Rollback end end end From 64ae7a2cb6c0b05f18cdffed8f798be9a052996f 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, 25 Jul 2019 15:14:05 +0800 Subject: [PATCH 10/58] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/modules/courses/new/CoursesNew.js | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/public/react/src/modules/courses/new/CoursesNew.js b/public/react/src/modules/courses/new/CoursesNew.js index c8b090b8b..73c1dded9 100644 --- a/public/react/src/modules/courses/new/CoursesNew.js +++ b/public/react/src/modules/courses/new/CoursesNew.js @@ -301,7 +301,7 @@ class CoursesNew extends Component { if(value!=""){ this.props.form.setFieldsValue({ classroom:value, - course:value + // course:value }); this.Searchvalue(value) } @@ -311,7 +311,7 @@ class CoursesNew extends Component { handleChange=(value)=>{ this.props.form.setFieldsValue({ - course:value, + // course:value, classroom:value }) }; @@ -320,7 +320,7 @@ class CoursesNew extends Component { if(value!="") { this.props.form.setFieldsValue({ - school: value, + // school: value, fetching: true, }); @@ -331,7 +331,7 @@ class CoursesNew extends Component { handleChangeschools=(value)=>{ this.props.form.setFieldsValue({ - school: value, + // school: value, fetching: true, }); } @@ -347,9 +347,9 @@ class CoursesNew extends Component { }; getschool=(value)=>{ - this.props.form.setFieldsValue({ - school: value - }) + // this.props.form.setFieldsValue({ + // school: value + // }) let url="/schools/school_list.json"; axios.get(url,{ params: { @@ -359,7 +359,7 @@ class CoursesNew extends Component { if (result.data.status===0) { this.setState({ searchlistscholl: result.data.school_names, - school: value + // school: value }) } @@ -367,9 +367,9 @@ class CoursesNew extends Component { console.log(error) }) } - showApplyForAddOrgModal = () => { - this.applyForAddOrgForm.setVisible(true) - } + showApplyForAddOrgModal = () => { + this.applyForAddOrgForm.setVisible(true) + } render() { let {datatime,school,searchlistscholl} = this.state; const {getFieldDecorator} = this.props.form; From f28a2e3580eb5f640d391cbb41232122bf49271e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Thu, 25 Jul 2019 15:17:28 +0800 Subject: [PATCH 11/58] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/common/components/DragValidator.js | 227 +++++++++--------- .../src/common/components/DragValidatortwo.js | 114 --------- .../react/src/modules/user/CheckInputysl.js | 104 ++++++++ .../src/modules/user/FindPasswordComponent.js | 26 +- .../modules/user/LoginRegisterComponent.js | 28 +-- public/react/src/modules/user/secureCode.css | 42 ++++ 6 files changed, 284 insertions(+), 257 deletions(-) delete mode 100644 public/react/src/common/components/DragValidatortwo.js create mode 100644 public/react/src/modules/user/CheckInputysl.js create mode 100644 public/react/src/modules/user/secureCode.css diff --git a/public/react/src/common/components/DragValidator.js b/public/react/src/common/components/DragValidator.js index 7d707def0..69e91f604 100644 --- a/public/react/src/common/components/DragValidator.js +++ b/public/react/src/common/components/DragValidator.js @@ -1,114 +1,115 @@ -import React, { Component } from 'react'; - -const $ = window.jQuery -const jQuery = $; -if (!$.drag) { - (function($){ - $.fn.dragValidator = function(options){ - var x, drag = this, isMove = false, defaults = { - }; - var options = $.extend(defaults, options); - //添加背景,文字,滑块 - var html = '
    '+ - '
    拖动滑块验证
    '+ - '
    '; - this.append(html); - - var handler = drag.find('.handler'); - var drag_bg = drag.find('.drag_bg'); - var text = drag.find('.drag_text'); - var maxWidth = text.width() - handler.width(); //能滑动的最大间距 - //鼠标按下时候的x轴的位置 - handler.mousedown(function(e){ - isMove = true; - x = e.pageX - parseInt(handler.css('left'), 10); - }); - - //鼠标指针在上下文移动时,移动距离大于0小于最大间距,滑块x轴位置等于鼠标移动距离 - $(document).mousemove(function(e){ - var _x = e.pageX - x; - var handler_offset = handler.offset(); - var lastX = e.clientX -x; - lastX = Math.max(0,Math.min(maxWidth,lastX)); - if(isMove){ - if(_x > 0 && _x <= maxWidth){ - handler.css({'left': lastX}); - drag_bg.css({'width': lastX}); - } - else if(lastX > maxWidth - 5 && lastX < maxWidth + 5 ){ //鼠标指针移动距离达到最大时清空事件 - dragOk(); - } - } - }); - handler.mouseup(function(e){ - isMove = false; - var _x = e.pageX - x; - if(text.text() != '验证通过' && _x < maxWidth){ //鼠标松开时,如果没有达到最大距离位置,滑块就返回初始位置 - handler.animate({'left': 0}); - drag_bg.animate({'width': 0}); - } - }); - - //清空事件 - function dragOk(){ - options.dragOkCallback && options.dragOkCallback() - var kuaiwidth=drag.width() - handler.width() - 2; - handler.removeClass('handler_bg').addClass('handler_ok_bg'); - handler.css({'left':kuaiwidth+'px'}) - text.css({'width':kuaiwidth+'px'}); - text.text('验证通过'); - drag.css({'color': '#fff'}); - drag_bg.css({'width':kuaiwidth+'px'}) - handler.unbind('mousedown'); - $(document).unbind('mousemove'); - $(document).unbind('mouseup'); - $("#user_verification_notice").html(""); - $('#user_verification_notice').parent().hide(); - } - }; - })(jQuery); -} - -class DragValidator extends Component { - componentDidMount () { - // if($("#reg-drag").length>0 && IsPC()){ - $("#reg-drag").dragValidator({ - height: this.props.height, - dragOkCallback: () => { - this.props.dragOkCallback && this.props.dragOkCallback() - } - }); - // }else{ - // $("#reg-drag").empty(); - // } - } - empty() { - $("#reg-drag").empty(); - } - render() { - const height = this.props.height || 45; - const className = this.props.className - const successGreenColor = this.props.successGreenColor || '#29bd8b' - // newMain clearfix - return ( -
    - - -
    - ); - } -} - +import React, { Component } from 'react'; + +const $ = window.jQuery +const jQuery = $; +if (!$.drag) { + (function($){ + $.fn.dragValidator = function(options){ + var x, drag = this, isMove = false, defaults = { + }; + var options = $.extend(defaults, options); + //添加背景,文字,滑块 + var html = '
    '+ + '
    拖动滑块验证
    '+ + '
    '; + this.append(html); + + var handler = drag.find('.handler'); + var drag_bg = drag.find('.drag_bg'); + var text = drag.find('.drag_text'); + var maxWidth = text.width() - handler.width(); //能滑动的最大间距 + //鼠标按下时候的x轴的位置 + handler.mousedown(function(e){ + isMove = true; + x = e.pageX - parseInt(handler.css('left'), 10); + }); + + //鼠标指针在上下文移动时,移动距离大于0小于最大间距,滑块x轴位置等于鼠标移动距离 + $(document).mousemove(function(e){ + var _x = e.pageX - x; + var handler_offset = handler.offset(); + var lastX = e.clientX -x; + lastX = Math.max(0,Math.min(maxWidth,lastX)); + if(isMove){ + if(_x > 0 && _x <= maxWidth){ + handler.css({'left': lastX}); + drag_bg.css({'width': lastX}); + } + else if(lastX > maxWidth - 5 && lastX < maxWidth + 5 ){ //鼠标指针移动距离达到最大时清空事件 + dragOk(); + + } + } + }); + handler.mouseup(function(e){ + isMove = false; + var _x = e.pageX - x; + if(text.text() != '验证通过' && _x < maxWidth){ //鼠标松开时,如果没有达到最大距离位置,滑块就返回初始位置 + handler.animate({'left': 0}); + drag_bg.animate({'width': 0}); + } + }); + + //清空事件 + function dragOk(){ + options.dragOkCallback && options.dragOkCallback() + var kuaiwidth=drag.width() - handler.width() - 2; + handler.removeClass('handler_bg').addClass('handler_ok_bg'); + handler.css({'left':kuaiwidth+'px'}) + text.css({'width':kuaiwidth+'px'}); + text.text('验证通过'); + drag.css({'color': '#fff'}); + drag_bg.css({'width':kuaiwidth+'px'}) + handler.unbind('mousedown'); + $(document).unbind('mousemove'); + $(document).unbind('mouseup'); + $("#user_verification_notice").html(""); + $('#user_verification_notice').parent().hide(); + } + }; + })(jQuery); +} + +class DragValidator extends Component { + componentDidMount () { + // if($("#reg-drag").length>0 && IsPC()){ + $("#reg-drag").dragValidator({ + height: this.props.height, + dragOkCallback: () => { + this.props.dragOkCallback && this.props.dragOkCallback() + } + }); + // }else{ + // $("#reg-drag").empty(); + // } + } + empty() { + $("#reg-drag").empty(); + } + render() { + const height = this.props.height || 45; + const className = this.props.className + const successGreenColor = this.props.successGreenColor || '#29bd8b' + // newMain clearfix + return ( +
    + + +
    + ); + } +} + export default ( DragValidator ); \ No newline at end of file diff --git a/public/react/src/common/components/DragValidatortwo.js b/public/react/src/common/components/DragValidatortwo.js deleted file mode 100644 index 2b789063e..000000000 --- a/public/react/src/common/components/DragValidatortwo.js +++ /dev/null @@ -1,114 +0,0 @@ -import React, { Component } from 'react'; - -const $ = window.jQuery -const jQuery = $; -if (!$.drag) { - (function($){ - $.fn.dragValidator = function(options){ - var x, drag = this, isMove = false, defaults = { - }; - var options = $.extend(defaults, options); - //添加背景,文字,滑块 - var html = '
    '+ - '
    拖动滑块验证
    '+ - '
    '; - this.append(html); - - var handler = drag.find('.handler'); - var drag_bg = drag.find('.drag_bg'); - var text = drag.find('.drag_text'); - var maxWidth = text.width() - handler.width(); //能滑动的最大间距 - //鼠标按下时候的x轴的位置 - handler.mousedown(function(e){ - isMove = true; - x = e.pageX - parseInt(handler.css('left'), 10); - }); - - //鼠标指针在上下文移动时,移动距离大于0小于最大间距,滑块x轴位置等于鼠标移动距离 - $(document).mousemove(function(e){ - var _x = e.pageX - x; - var handler_offset = handler.offset(); - var lastX = e.clientX -x; - lastX = Math.max(0,Math.min(maxWidth,lastX)); - if(isMove){ - if(_x > 0 && _x <= maxWidth){ - handler.css({'left': lastX}); - drag_bg.css({'width': lastX}); - } - else if(lastX > maxWidth - 5 && lastX < maxWidth + 5 ){ //鼠标指针移动距离达到最大时清空事件 - dragOk(); - } - } - }); - handler.mouseup(function(e){ - isMove = false; - var _x = e.pageX - x; - if(text.text() != '验证通过' && _x < maxWidth){ //鼠标松开时,如果没有达到最大距离位置,滑块就返回初始位置 - handler.animate({'left': 0}); - drag_bg.animate({'width': 0}); - } - }); - - //清空事件 - function dragOk(){ - options.dragOkCallback && options.dragOkCallback() - var kuaiwidth=drag.width() - handler.width() - 2; - handler.removeClass('handler_bg').addClass('handler_ok_bg'); - handler.css({'left':kuaiwidth+'px'}) - text.css({'width':kuaiwidth+'px'}); - text.text('验证通过'); - drag.css({'color': '#fff'}); - drag_bg.css({'width':kuaiwidth+'px'}) - handler.unbind('mousedown'); - $(document).unbind('mousemove'); - $(document).unbind('mouseup'); - $("#user_verification_notice").html(""); - $('#user_verification_notice').parent().hide(); - } - }; - })(jQuery); -} - -class DragValidator extends Component { - componentDidMount () { - // if($("#reg-drag").length>0 && IsPC()){ - $("#reg-drag").dragValidator({ - height: this.props.height, - dragOkCallback: () => { - this.props.dragOkCallback && this.props.dragOkCallback() - } - }); - // }else{ - // $("#reg-drag").empty(); - // } - } - empty() { - $("#reg-drag").empty(); - } - render() { - const height = this.props.height || 45; - const className = this.props.className - const successGreenColor = this.props.successGreenColor || '#29bd8b' - // newMain clearfix - return ( -
    - - -
    - ); - } -} - -export default ( DragValidator ); \ No newline at end of file diff --git a/public/react/src/modules/user/CheckInputysl.js b/public/react/src/modules/user/CheckInputysl.js new file mode 100644 index 000000000..a057f12d4 --- /dev/null +++ b/public/react/src/modules/user/CheckInputysl.js @@ -0,0 +1,104 @@ +import React, { Component } from 'react'; +import "./secureCode.css"; + +/** + * An TextInput with Icon and check + * 带图标检查的输入框 + */ +class CheckInputysl extends Component { + constructor(){ + super(); + this.state = { + isMove:false, + start:0, + moveLength:0, + clear:false, + move:0, + width:0 + }; + this.onMouseUp = this.onMouseUp.bind(this); + this.onMouseDown = this.onMouseDown.bind(this); + this.onMouseMove = this.onMouseMove.bind(this); + } + componentDidMount() { + let dragHandler = document.getElementById("dragHandler"); + dragHandler.addEventListener("mousedown", this.onMouseDown); + } + onMouseDown(e){ + console.log("28"); + document.addEventListener("mousemove", this.onMouseMove); + document.addEventListener("mouseup", this.onMouseUp); + let event=e||window.event; + this.setState({ + isMove:true, + start:event.pageX + }); + } + onMouseUp(e){ + console.log("38"); + let event=e||window.event; + this.setState({ + isMove:false, + }); + let drag = window.getComputedStyle(this.verifyDOM); + let handler = window.getComputedStyle(this.handlerDOM); + let moveLength = event.clientX-this.verifyDOM.offsetLeft - Number.parseInt(handler.width) / 2; + // console.log(drag.width); + let maxWidth = Number.parseInt(drag.width) - Number.parseInt(handler.width); + console.log("moveLength="+moveLength); + console.log("maxWidth="+maxWidth); + if(moveLength <= maxWidth){ //鼠标松开时,如果没有达到最大距离位置,滑块就返回初始位置 + this.setState({ + move:0, + width:0 + }); + document.removeEventListener("mousemove", this.onMouseMove); + document.removeEventListener("mouseup", this.onMouseUp); + } + if(this.props.onDrag){ + this.props.onDrag(this.state.clear); + } + } + onMouseMove(e){ + console.log("63"); + let event=e||window.event; + let drag = window.getComputedStyle(this.verifyDOM); + let handler = window.getComputedStyle(this.handlerDOM); + let moveLength = event.clientX-this.verifyDOM.offsetLeft - Number.parseInt(handler.width) / 2; + let maxWidth = Number.parseInt(drag.width) - Number.parseInt(handler.width); + if(this.state.isMove){ + if(moveLength<0){ + moveLength=0 + }else if(moveLength >= maxWidth){ + moveLength=maxWidth; + this.removeMouseMove(); + } + this.setState({ + move:moveLength, + width:moveLength + }); + } + } + //清空事件 + removeMouseMove(){ + this.setState({ + clear:true + }); + let dragHandler = document.getElementById("dragHandler"); + dragHandler.removeEventListener("mousedown", this.onMouseDown); + document.removeEventListener("mousemove", this.onMouseMove); + document.removeEventListener("mouseup", this.onMouseUp); + this.props.dragOkCallback(); + } + render(){ + return ( +
    {this.verifyDOM = dom}} style={{"color":this.state.clear ? "#fff" : "#252535"}}> +
    {this.bgDOM = dom}} style={{"width":this.state.width}}>
    +
    {this.state.clear ? "验证通过" : "拖动滑块验证"}
    +
    {this.handlerDOM = dom}}>
    +
    + ); + } +} + +export default ( CheckInputysl ); \ No newline at end of file diff --git a/public/react/src/modules/user/FindPasswordComponent.js b/public/react/src/modules/user/FindPasswordComponent.js index 22fcd97de..0c3678776 100644 --- a/public/react/src/modules/user/FindPasswordComponent.js +++ b/public/react/src/modules/user/FindPasswordComponent.js @@ -2,11 +2,11 @@ import React, {Component} from 'react'; import {BrowserRouter as Router, Route, Link, Switch} from "react-router-dom"; -import {getImageUrl, DragValidator} from 'educoder'; - +import {getImageUrl} from 'educoder'; +import CheckInputysl1 from './CheckInputysl'; +import CheckInputysl2 from './CheckInputysl'; import {Tabs, Input, Checkbox, Button, notification} from 'antd'; -import DragValidatortwo from '../../../src/common/components/DragValidatortwo' import ReadPassword from './ReadPassword'; @@ -643,24 +643,20 @@ class LoginRegisterComponent extends Component { { Whethertoverify===false&&pciphone===true? - this.dragOkCallback()} - className="ysllw100" - > + + : "" } { Whethertoverify===true&&pciphone===true? - this.dragOkCallback()} - className="ysllw100" - > + + : "" } diff --git a/public/react/src/modules/user/LoginRegisterComponent.js b/public/react/src/modules/user/LoginRegisterComponent.js index dcbaf4730..f6c32909d 100644 --- a/public/react/src/modules/user/LoginRegisterComponent.js +++ b/public/react/src/modules/user/LoginRegisterComponent.js @@ -2,12 +2,13 @@ import React, {Component} from 'react'; import {BrowserRouter as Router, Route, Link, Switch} from "react-router-dom"; -import {getImageUrl, DragValidator,broadcastChannelPostMessage} from 'educoder'; +import {getImageUrl,broadcastChannelPostMessage} from 'educoder'; import {Tabs, Input, Checkbox, Button, notification,Menu} from 'antd'; import passopen from '../../../src/images/login/passopen.png'; import passoff from '../../../src/images/login/passoff.png'; import axios from 'axios'; -import DragValidatortwo from '../../../src/common/components/DragValidatortwo' +import CheckInputysl1 from './CheckInputysl'; +import CheckInputysl2 from './CheckInputysl'; import './common.css' import './commontwo.css' const { TabPane } = Tabs; @@ -402,7 +403,7 @@ class LoginRegisterComponent extends Component { type: 1, } }).then((result) => { - debugger + //验证有问题{"status":1,"message":"success"} // console.log(result); // this.setState({dragOk: true}) @@ -941,27 +942,24 @@ class LoginRegisterComponent extends Component { } { Whethertoverify===false&&pciphone===true? - + + : "" } { Whethertoverify===true&&pciphone===true? - + + : "" } +
    { pciphone===true? diff --git a/public/react/src/modules/user/secureCode.css b/public/react/src/modules/user/secureCode.css new file mode 100644 index 000000000..e7f171711 --- /dev/null +++ b/public/react/src/modules/user/secureCode.css @@ -0,0 +1,42 @@ +#drag{ + position: relative; + background-color: #e8e8e8; + min-width: 300px; + height: 38px; + line-height: 38px; + text-align: center; +} +#drag .handler{ + position: absolute; + top: 0px; + left: 0px; + width: 40px; + height: 38px; + border: 1px solid #ccc; + cursor: move; +} +.handler_bg{ background: #fff url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAA3hpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNS1jMDIxIDc5LjE1NTc3MiwgMjAxNC8wMS8xMy0xOTo0NDowMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wTU09Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9tbS8iIHhtbG5zOnN0UmVmPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvc1R5cGUvUmVzb3VyY2VSZWYjIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtcE1NOk9yaWdpbmFsRG9jdW1lbnRJRD0ieG1wLmRpZDo0ZDhlNWY5My05NmI0LTRlNWQtOGFjYi03ZTY4OGYyMTU2ZTYiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6NTEyNTVEMURGMkVFMTFFNEI5NDBCMjQ2M0ExMDQ1OUYiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6NTEyNTVEMUNGMkVFMTFFNEI5NDBCMjQ2M0ExMDQ1OUYiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIDIwMTQgKE1hY2ludG9zaCkiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDo2MTc5NzNmZS02OTQxLTQyOTYtYTIwNi02NDI2YTNkOWU5YmUiIHN0UmVmOmRvY3VtZW50SUQ9InhtcC5kaWQ6NGQ4ZTVmOTMtOTZiNC00ZTVkLThhY2ItN2U2ODhmMjE1NmU2Ii8+IDwvcmRmOkRlc2NyaXB0aW9uPiA8L3JkZjpSREY+IDwveDp4bXBtZXRhPiA8P3hwYWNrZXQgZW5kPSJyIj8+YiRG4AAAALFJREFUeNpi/P//PwMlgImBQkA9A+bOnfsIiBOxKcInh+yCaCDuByoswaIOpxwjciACFegBqZ1AvBSIS5OTk/8TkmNEjwWgQiUgtQuIjwAxUF3yX3xyGIEIFLwHpKyAWB+I1xGSwxULIGf9A7mQkBwTlhBXAFLHgPgqEAcTkmNCU6AL9d8WII4HOvk3ITkWJAXWUMlOoGQHmsE45ViQ2KuBuASoYC4Wf+OUYxz6mQkgwAAN9mIrUReCXgAAAABJRU5ErkJggg==") no-repeat center;} + +.handler_ok_bg{ background: #fff url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAA3hpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNS1jMDIxIDc5LjE1NTc3MiwgMjAxNC8wMS8xMy0xOTo0NDowMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wTU09Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9tbS8iIHhtbG5zOnN0UmVmPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvc1R5cGUvUmVzb3VyY2VSZWYjIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtcE1NOk9yaWdpbmFsRG9jdW1lbnRJRD0ieG1wLmRpZDo0ZDhlNWY5My05NmI0LTRlNWQtOGFjYi03ZTY4OGYyMTU2ZTYiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6NDlBRDI3NjVGMkQ2MTFFNEI5NDBCMjQ2M0ExMDQ1OUYiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6NDlBRDI3NjRGMkQ2MTFFNEI5NDBCMjQ2M0ExMDQ1OUYiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIDIwMTQgKE1hY2ludG9zaCkiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDphNWEzMWNhMC1hYmViLTQxNWEtYTEwZS04Y2U5NzRlN2Q4YTEiIHN0UmVmOmRvY3VtZW50SUQ9InhtcC5kaWQ6NGQ4ZTVmOTMtOTZiNC00ZTVkLThhY2ItN2U2ODhmMjE1NmU2Ii8+IDwvcmRmOkRlc2NyaXB0aW9uPiA8L3JkZjpSREY+IDwveDp4bXBtZXRhPiA8P3hwYWNrZXQgZW5kPSJyIj8+k+sHwwAAASZJREFUeNpi/P//PwMyKD8uZw+kUoDYEYgloMIvgHg/EM/ptHx0EFk9I8wAoEZ+IDUPiIMY8IN1QJwENOgj3ACo5gNAbMBAHLgAxA4gQ5igAnNJ0MwAVTsX7IKyY7L2UNuJAf+AmAmJ78AEDTBiwGYg5gbifCSxFCZoaBMCy4A4GOjnH0D6DpK4IxNSVIHAfSDOAeLraJrjgJp/AwPbHMhejiQnwYRmUzNQ4VQgDQqXK0ia/0I17wJiPmQNTNBEAgMlQIWiQA2vgWw7QppBekGxsAjIiEUSBNnsBDWEAY9mEFgMMgBk00E0iZtA7AHEctDQ58MRuA6wlLgGFMoMpIG1QFeGwAIxGZo8GUhIysmwQGSAZgwHaEZhICIzOaBkJkqyM0CAAQDGx279Jf50AAAAAABJRU5ErkJggg==") no-repeat center;} + +#drag .drag_bg{ + background-color: #7ac23c; + height: 38px; + width: 0px; +} +#drag .drag_text{ + position: absolute; + top: 0px; + font-size: 14px; + width: 100%; + -moz-user-select: none; + -webkit-user-select: none; + color: #fff; + user-select: none; + -o-user-select:none; + -ms-user-select:none; +} + +/* }*/ +/*//.handler_bg{ background: #fff url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAA3hpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNS1jMDIxIDc5LjE1NTc3MiwgMjAxNC8wMS8xMy0xOTo0NDowMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wTU09Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9tbS8iIHhtbG5zOnN0UmVmPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvc1R5cGUvUmVzb3VyY2VSZWYjIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtcE1NOk9yaWdpbmFsRG9jdW1lbnRJRD0ieG1wLmRpZDo0ZDhlNWY5My05NmI0LTRlNWQtOGFjYi03ZTY4OGYyMTU2ZTYiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6NTEyNTVEMURGMkVFMTFFNEI5NDBCMjQ2M0ExMDQ1OUYiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6NTEyNTVEMUNGMkVFMTFFNEI5NDBCMjQ2M0ExMDQ1OUYiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIDIwMTQgKE1hY2ludG9zaCkiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDo2MTc5NzNmZS02OTQxLTQyOTYtYTIwNi02NDI2YTNkOWU5YmUiIHN0UmVmOmRvY3VtZW50SUQ9InhtcC5kaWQ6NGQ4ZTVmOTMtOTZiNC00ZTVkLThhY2ItN2U2ODhmMjE1NmU2Ii8+IDwvcmRmOkRlc2NyaXB0aW9uPiA8L3JkZjpSREY+IDwveDp4bXBtZXRhPiA8P3hwYWNrZXQgZW5kPSJyIj8+YiRG4AAAALFJREFUeNpi/P//PwMlgImBQkA9A+bOnfsIiBOxKcInh+yCaCDuByoswaIOpxwjciACFegBqZ1AvBSIS5OTk/8TkmNEjwWgQiUgtQuIjwAxUF3yX3xyGIEIFLwHpKyAWB+I1xGSwxULIGf9A7mQkBwTlhBXAFLHgPgqEAcTkmNCU6AL9d8WII4HOvk3ITkWJAXWUMlOoGQHmsE45ViQ2KuBuASoYC4Wf+OUYxz6mQkgwAAN9mIrUReCXgAAAABJRU5ErkJggg==") no-repeat center;}*/ +/*//.handler_ok_bg{ background: #fff url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAA3hpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNS1jMDIxIDc5LjE1NTc3MiwgMjAxNC8wMS8xMy0xOTo0NDowMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wTU09Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9tbS8iIHhtbG5zOnN0UmVmPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvc1R5cGUvUmVzb3VyY2VSZWYjIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtcE1NOk9yaWdpbmFsRG9jdW1lbnRJRD0ieG1wLmRpZDo0ZDhlNWY5My05NmI0LTRlNWQtOGFjYi03ZTY4OGYyMTU2ZTYiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6NDlBRDI3NjVGMkQ2MTFFNEI5NDBCMjQ2M0ExMDQ1OUYiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6NDlBRDI3NjRGMkQ2MTFFNEI5NDBCMjQ2M0ExMDQ1OUYiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIDIwMTQgKE1hY2ludG9zaCkiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDphNWEzMWNhMC1hYmViLTQxNWEtYTEwZS04Y2U5NzRlN2Q4YTEiIHN0UmVmOmRvY3VtZW50SUQ9InhtcC5kaWQ6NGQ4ZTVmOTMtOTZiNC00ZTVkLThhY2ItN2U2ODhmMjE1NmU2Ii8+IDwvcmRmOkRlc2NyaXB0aW9uPiA8L3JkZjpSREY+IDwveDp4bXBtZXRhPiA8P3hwYWNrZXQgZW5kPSJyIj8+k+sHwwAAASZJREFUeNpi/P//PwMyKD8uZw+kUoDYEYgloMIvgHg/EM/ptHx0EFk9I8wAoEZ+IDUPiIMY8IN1QJwENOgj3ACo5gNAbMBAHLgAxA4gQ5igAnNJ0MwAVTsX7IKyY7L2UNuJAf+AmAmJ78AEDTBiwGYg5gbifCSxFCZoaBMCy4A4GOjnH0D6DpK4IxNSVIHAfSDOAeLraJrjgJp/AwPbHMhejiQnwYRmUzNQ4VQgDQqXK0ia/0I17wJiPmQNTNBEAgMlQIWiQA2vgWw7QppBekGxsAjIiEUSBNnsBDWEAY9mEFgMMgBk00E0iZtA7AHEctDQ58MRuA6wlLgGFMoMpIG1QFeGwAIxGZo8GUhIysmwQGSAZgwHaEZhICIzOaBkJkqyM0CAAQDGx279Jf50AAAAAABJRU5ErkJggg==") no-repeat center;}*/ From 1f18b1399bbf64d415ae13c91d356044ee7b5d74 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Thu, 25 Jul 2019 15:20:16 +0800 Subject: [PATCH 12/58] =?UTF-8?q?=E9=87=8D=E7=BD=AE=E5=AE=9E=E8=AE=AD?= =?UTF-8?q?=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/myshixuns_controller.rb | 35 +++++++++++++------------ 1 file changed, 18 insertions(+), 17 deletions(-) diff --git a/app/controllers/myshixuns_controller.rb b/app/controllers/myshixuns_controller.rb index 649516a03..cdeca4871 100644 --- a/app/controllers/myshixuns_controller.rb +++ b/app/controllers/myshixuns_controller.rb @@ -20,28 +20,29 @@ class MyshixunsController < ApplicationController unless (current_user.admin? || current_user.id == @myshixun.user_id) tip_exception("403", "") end + begin + ActiveRecord::Base.transaction do + begin + @shixun = Shixun.select(:id, :identifier).find(@myshixun.shixun_id) + @myshixun.destroy - ActiveRecord::Base.transaction do - begin - @shixun = Shixun.select(:id, :identifier).find(@myshixun.shixun_id) - @myshixun.destroy + StudentWork.where(:myshixun_id => @myshixun.id).update_all(:myshixun_id => 0, :work_status => 0) - # 刪除版本庫 - begin - GitService.delete_repository(repo_path: @repo_path) + # 实训在申请发布前,是否玩过实训,如果玩过需要更改记录,防止二次重置 + shixun_mod = ShixunModify.where(:shixun_id => @shixun.id, :myshixun_id => @myshixun.id, :status => 1).take + shixun_mod.update_column(:status, 0) if shixun_mod rescue Exception => e - uid_logger_error("版本库删除异常,详情:#{e.message}") + logger.error("######reset_my_game_failed:#{e.message}") + raise("ActiveRecord::RecordInvalid") end - - StudentWork.where(:myshixun_id => @myshixun.id).update_all(:myshixun_id => 0, :work_status => 0) - - # 实训在申请发布前,是否玩过实训,如果玩过需要更改记录,防止二次重置 - shixun_mod = ShixunModify.where(:shixun_id => @shixun.id, :myshixun_id => @myshixun.id, :status => 1).take - shixun_mod.update_column(:status, 0) if shixun_mod - rescue Exception => e - uid_logger_error("myshixun reset failed #{e}") - raise ActiveRecord::Rollback end + # 删除版本库 + GitService.delete_repository(repo_path: @repo_path) + rescue Exception => e + if e.message != "ActiveRecord::RecordInvalid" + logger.error("######delete_repository_error:#{e.message}") + end + raise ActiveRecord::Rollback end end From b9d48c420a7ac491cc8512565e7b98455fac28c2 Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Thu, 25 Jul 2019 15:37:29 +0800 Subject: [PATCH 13/58] =?UTF-8?q?=E9=9D=A2=E5=8C=85=E5=B1=91-=E4=BD=9C?= =?UTF-8?q?=E4=B8=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/modules/courses/busyWork/CommonWorkDetailIndex.js | 7 ++++--- .../react/src/modules/courses/busyWork/CommonWorkPost.js | 4 ++-- public/react/src/modules/courses/busyWork/NewWork.js | 3 ++- .../courses/busyWork/common/WorkDetailPageHeader.js | 4 ++-- 4 files changed, 10 insertions(+), 8 deletions(-) diff --git a/public/react/src/modules/courses/busyWork/CommonWorkDetailIndex.js b/public/react/src/modules/courses/busyWork/CommonWorkDetailIndex.js index 5960406e3..ff8e3e3a2 100644 --- a/public/react/src/modules/courses/busyWork/CommonWorkDetailIndex.js +++ b/public/react/src/modules/courses/busyWork/CommonWorkDetailIndex.js @@ -145,6 +145,7 @@ class CommonWorkDetailIndex extends Component{ , end_immediately, publish_immediately, work_statuses, accessoryVisible } =this.state; + const { current_user } = this.props let courseId=this.props.match.params.coursesId; let category_id= category && category.category_id; @@ -197,15 +198,15 @@ class CommonWorkDetailIndex extends Component{ background: #fff; } `} - + ]}>}
    36 ? homework_name : ''}`} diff --git a/public/react/src/modules/courses/busyWork/CommonWorkPost.js b/public/react/src/modules/courses/busyWork/CommonWorkPost.js index 4c5578d2c..f2b92b47d 100644 --- a/public/react/src/modules/courses/busyWork/CommonWorkPost.js +++ b/public/react/src/modules/courses/busyWork/CommonWorkPost.js @@ -481,6 +481,7 @@ render(){ course_name, homework_name, memberNumMax, memberNumMin } =this.state; + const { current_user } = this.props let courseId=this.props.match.params.coursesId; let workId=this.props.match.params.workId; @@ -522,7 +523,6 @@ render(){ const moduleName = this.props.getModuleName() const moduleCHName = this.props.getModuleName(true) const isGroup = this.props.isGroup() - const { current_user } = this.props; return( @@ -540,7 +540,7 @@ render(){

    - {course_name} + {course_name} > {moduleCHName} > diff --git a/public/react/src/modules/courses/busyWork/NewWork.js b/public/react/src/modules/courses/busyWork/NewWork.js index 3bb77dfb5..2519f95e2 100644 --- a/public/react/src/modules/courses/busyWork/NewWork.js +++ b/public/react/src/modules/courses/busyWork/NewWork.js @@ -313,6 +313,7 @@ class NewWork extends Component{ init_max_num, init_min_num, title_num, course_name, category, has_commit, has_project }=this.state + const { current_user } = this.props const courseId = this.state.course_id || this.props.match.params.coursesId ; const isEdit = this.isEdit; @@ -369,7 +370,7 @@ class NewWork extends Component{ {pageType==="new"?"新建":"编辑"}

    */} Date: Thu, 25 Jul 2019 15:42:00 +0800 Subject: [PATCH 14/58] =?UTF-8?q?=E9=9D=A2=E5=8C=85=E5=B1=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/react/src/modules/courses/boards/BoardsNew.js | 3 ++- public/react/src/modules/courses/boards/TopicDetail.js | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/public/react/src/modules/courses/boards/BoardsNew.js b/public/react/src/modules/courses/boards/BoardsNew.js index 9833e9eb3..8d9db7c3f 100644 --- a/public/react/src/modules/courses/boards/BoardsNew.js +++ b/public/react/src/modules/courses/boards/BoardsNew.js @@ -239,6 +239,7 @@ class BoardsNew extends Component{ render() { let { addGroup, fileList, course_id, title_num } = this.state; const { getFieldDecorator } = this.props.form; + const { current_user } = this.props const formItemLayout = { labelCol: { @@ -299,7 +300,7 @@ class BoardsNew extends Component{ `}
    diff --git a/public/react/src/modules/courses/boards/TopicDetail.js b/public/react/src/modules/courses/boards/TopicDetail.js index 6309ac491..7aaecdd16 100644 --- a/public/react/src/modules/courses/boards/TopicDetail.js +++ b/public/react/src/modules/courses/boards/TopicDetail.js @@ -546,7 +546,7 @@ class TopicDetail extends Component { } `} From 4b130f2724780815352c10b13596e88d4ebdc4d9 Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Thu, 25 Jul 2019 15:48:46 +0800 Subject: [PATCH 15/58] =?UTF-8?q?=E9=9D=A2=E5=8C=85=E5=B1=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/modules/courses/poll/PollDetailIndex.js | 4 ++-- .../react/src/modules/courses/poll/PollInfo.js | 3 ++- .../react/src/modules/courses/poll/PollNew.js | 17 +++++++++++------ 3 files changed, 15 insertions(+), 9 deletions(-) diff --git a/public/react/src/modules/courses/poll/PollDetailIndex.js b/public/react/src/modules/courses/poll/PollDetailIndex.js index 8e3f78d5c..9119b7902 100644 --- a/public/react/src/modules/courses/poll/PollDetailIndex.js +++ b/public/react/src/modules/courses/poll/PollDetailIndex.js @@ -110,7 +110,7 @@ class PollDetailIndex extends Component{ } render(){ let {tab,pollDetail,user_permission}=this.state; - + const { current_user } = this.props; const isAdmin =this.props.isAdmin(); const isStudent = this.props.isStudent(); return( @@ -123,7 +123,7 @@ class PollDetailIndex extends Component{ />

    - {this.props.coursedata.name} + {this.props.coursedata.name} > 问卷 > diff --git a/public/react/src/modules/courses/poll/PollInfo.js b/public/react/src/modules/courses/poll/PollInfo.js index fc1d55385..f32d652c2 100644 --- a/public/react/src/modules/courses/poll/PollInfo.js +++ b/public/react/src/modules/courses/poll/PollInfo.js @@ -299,6 +299,7 @@ class PollInfo extends Component{ modalSave, questionPanelFixed }=this.state; + const { current_user } = this.props let isAdmin=this.props.isAdmin(); let isStudent=this.props.isStudent(); return( @@ -314,7 +315,7 @@ class PollInfo extends Component{ >

    - {courseName} + {courseName} > 问卷 > diff --git a/public/react/src/modules/courses/poll/PollNew.js b/public/react/src/modules/courses/poll/PollNew.js index 0c4109ceb..cd559b75f 100644 --- a/public/react/src/modules/courses/poll/PollNew.js +++ b/public/react/src/modules/courses/poll/PollNew.js @@ -2320,12 +2320,17 @@ class PollNew extends Component { } gotohome=()=>{ - let courseId=this.props.match.params.coursesId; - if(courseId===undefined){ - this.props.history.push("/courses"); - }else{ - this.props.history.push(this.props.current_user.first_category_url); - } + const { current_user} = this.props + + this.props.history.push(current_user.first_category_url); + + + // let courseId=this.props.match.params.coursesId; + // if(courseId===undefined){ + // this.props.history.push("/courses"); + // }else{ + // this.props.history.push(this.props.current_user.first_category_url); + // } } //试图 render() { From 901ed458c44ef96d9d6307abe57ebb207f1035f8 Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Thu, 25 Jul 2019 15:53:09 +0800 Subject: [PATCH 16/58] =?UTF-8?q?=E9=9D=A2=E5=8C=85=E5=B1=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modules/courses/graduation/topics/GraduateTopicDetail.js | 3 ++- .../src/modules/courses/graduation/topics/GraduateTopicNew.js | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/public/react/src/modules/courses/graduation/topics/GraduateTopicDetail.js b/public/react/src/modules/courses/graduation/topics/GraduateTopicDetail.js index be3ff7a30..c0e8fe185 100644 --- a/public/react/src/modules/courses/graduation/topics/GraduateTopicDetail.js +++ b/public/react/src/modules/courses/graduation/topics/GraduateTopicDetail.js @@ -96,6 +96,7 @@ class GraduateTopicDetail extends Component{ tablePageSize, tab, }=this.state + const { current_user } = this.props let {course_id,graduation_topic_id}=this.props.match.params; const isStudent =this.props.isStudent(); const isAdmin =this.props.isAdmin(); @@ -104,7 +105,7 @@ class GraduateTopicDetail extends Component{

    - {tableData && tableData.course_name} + {tableData && tableData.course_name} > {tableData.graduation_name} > diff --git a/public/react/src/modules/courses/graduation/topics/GraduateTopicNew.js b/public/react/src/modules/courses/graduation/topics/GraduateTopicNew.js index d71cec73b..569c76331 100644 --- a/public/react/src/modules/courses/graduation/topics/GraduateTopicNew.js +++ b/public/react/src/modules/courses/graduation/topics/GraduateTopicNew.js @@ -276,6 +276,7 @@ class GraduateTopicNew extends Component{ course_name, left_banner_name } = this.state; + const { current_user } = this.props const { getFieldDecorator } = this.props.form; let{ topicId,coursesId }=this.props.match.params console.log(this.props); @@ -322,7 +323,7 @@ class GraduateTopicNew extends Component{ `}

    - {course_name} + {course_name} > {left_banner_name} > From 8656c6037e6548d49bfb209ce1ddb5ad5f49cbb8 Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Thu, 25 Jul 2019 15:58:42 +0800 Subject: [PATCH 17/58] =?UTF-8?q?=E9=9D=A2=E5=8C=85=E5=B1=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/react/src/modules/courses/exercise/ExerciseNew.js | 3 ++- .../src/modules/courses/exercise/ExerciseReviewAndAnswer.js | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/public/react/src/modules/courses/exercise/ExerciseNew.js b/public/react/src/modules/courses/exercise/ExerciseNew.js index 0e1489c72..fe1b8f565 100644 --- a/public/react/src/modules/courses/exercise/ExerciseNew.js +++ b/public/react/src/modules/courses/exercise/ExerciseNew.js @@ -369,6 +369,7 @@ class ExerciceNew extends Component{ }, }; + const { current_user } = this.props const isAdmin = this.props.isAdmin() const courseId=this.props.match.params.coursesId; const exercise_id = this.props.match.params.Id @@ -407,7 +408,7 @@ class ExerciceNew extends Component{ `}

    diff --git a/public/react/src/modules/courses/exercise/ExerciseReviewAndAnswer.js b/public/react/src/modules/courses/exercise/ExerciseReviewAndAnswer.js index eb8143c03..cd3355082 100644 --- a/public/react/src/modules/courses/exercise/ExerciseReviewAndAnswer.js +++ b/public/react/src/modules/courses/exercise/ExerciseReviewAndAnswer.js @@ -509,7 +509,7 @@ class ExerciseReviewAndAnswer extends Component{ }=this.state let isAdmin = this.props.isAdmin(); let isStudent =this.props.isStudent(); - + const { current_user } = this.props console.log(data&&data.exercise.user_name) return(
    @@ -537,7 +537,7 @@ class ExerciseReviewAndAnswer extends Component{ />

    - {courseName} + {courseName} > {data && data.left_banner_name} > From 78678a68ba486920604d1bb23df5b550adae97f7 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, 25 Jul 2019 16:01:18 +0800 Subject: [PATCH 18/58] =?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/Listofworksstudentone.js | 6 ++++ .../shixunHomework/ShixunHomeworkPage.js | 6 ++-- .../modules/tpm/TPMsettings/TPMsettings.js | 26 ++++++++++++++- .../src/modules/tpm/newshixuns/Newshixuns.js | 33 +++++++++++++++++-- 4 files changed, 65 insertions(+), 6 deletions(-) diff --git a/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js b/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js index db58e95fd..81e388d6f 100644 --- a/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js +++ b/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js @@ -1482,6 +1482,7 @@ class Listofworksstudentone extends Component { } //计算成绩 setComputeTime=()=>{ + let matchurl = this.props.match.url; let {teacherdata}=this.state; this.setState({ computeTimetype:false @@ -1494,6 +1495,7 @@ class Listofworksstudentone extends Component { this.props.showNotification(`${response.data.message}`); // var homeworkid = this.props.match.params.homeworkid; this.Getalistofworks(homeworkid); + this.props.history.replace( matchurl ); // this.Getalistofworkstwo("", "", "", "", 1, 20); }).catch((error) => { console.log(error) @@ -2147,6 +2149,9 @@ class Listofworksstudentone extends Component { } setComputeTimet=()=>{ + + let matchurl = this.props.match.url; + this.setState({ computeTimetype:false }) @@ -2163,6 +2168,7 @@ class Listofworksstudentone extends Component { }) this.Startsortingt(this.state.orders, this.state.course_groupyslstwo, this.state.checkedValuesineinfo, this.state.searchtext, 1, this.state.limit); this.props.showNotification(`${response.data.message}`); + this.props.history.replace( matchurl ); } }).catch((error) => { console.log(error) diff --git a/public/react/src/modules/courses/shixunHomework/ShixunHomeworkPage.js b/public/react/src/modules/courses/shixunHomework/ShixunHomeworkPage.js index e2285a7a6..fec98e69b 100644 --- a/public/react/src/modules/courses/shixunHomework/ShixunHomeworkPage.js +++ b/public/react/src/modules/courses/shixunHomework/ShixunHomeworkPage.js @@ -123,9 +123,9 @@ class ShixunHomeworkPage extends Component { let {tab, teacherdatapage, jobsettingsdatapage} = this.state; const isAdmin = this.props.isAdmin(); - console.log(119) - console.log(jobsettingsdatapage); - console.log(teacherdatapage); + // console.log(119) + // console.log(jobsettingsdatapage); + // console.log(teacherdatapage); return (

    diff --git a/public/react/src/modules/tpm/TPMsettings/TPMsettings.js b/public/react/src/modules/tpm/TPMsettings/TPMsettings.js index ed1249f0d..f6af871dd 100644 --- a/public/react/src/modules/tpm/TPMsettings/TPMsettings.js +++ b/public/react/src/modules/tpm/TPMsettings/TPMsettings.js @@ -31,6 +31,30 @@ const Option = Select.Option; const RadioGroup = Radio.Group; +// 处理整点 半点 +// 取传入时间往后的第一个半点 +export function handleDateStrings(dateString) { + if (!dateString) return dateString; + const ar = dateString.split(':') + if (ar[1] == '00' || ar[1] == '30') { + return dateString + } + const miniute = parseInt(ar[1]); + if (miniute < 30 || miniute == 60) { + return [ar[0], '30'].join(':') + } + if (miniute < 60) { + // 加一个小时 + const tempStr = [ar[0], '00'].join(':'); + const format = "YYYY-MM-DD HH:mm"; + const _moment = moment(tempStr, format) + _moment.add(1, 'hours') + return _moment.format(format) + } + + return dateString +} + // 恢复数据 function md_rec_data(k,mdu,id, editor){ if(window.sessionStorage.getItem(k+mdu) !== null){ @@ -1120,7 +1144,7 @@ export default class TPMsettings extends Component { } onChangeTimePicker =(value, dateString)=> { this.setState({ - opening_time:dateString + opening_time:moment(handleDateStrings(dateString)) }) } diff --git a/public/react/src/modules/tpm/newshixuns/Newshixuns.js b/public/react/src/modules/tpm/newshixuns/Newshixuns.js index cb0f08c0f..8cb79e9d0 100644 --- a/public/react/src/modules/tpm/newshixuns/Newshixuns.js +++ b/public/react/src/modules/tpm/newshixuns/Newshixuns.js @@ -2,7 +2,7 @@ import React, {Component} from 'react'; import {TPMIndexHOC} from '../TPMIndexHOC'; -import {SnackbarHOC,handleDateString} from 'educoder'; +import {SnackbarHOC} from 'educoder'; import {Input, Select, Radio, Checkbox, Modal, Icon, DatePicker,Upload,Button,message,Form,notification} from 'antd'; @@ -16,6 +16,7 @@ import './css/Newshixuns.css'; import {getUrl} from 'educoder' + let path = getUrl("/editormd/lib/") const $ = window.$; @@ -28,6 +29,34 @@ const Option = Select.Option; const RadioGroup = Radio.Group; const confirm = Modal.confirm; + + +// 处理整点 半点 +// 取传入时间往后的第一个半点 +export function handleDateStrings(dateString) { + if (!dateString) return dateString; + const ar = dateString.split(':') + if (ar[1] == '00' || ar[1] == '30') { + return dateString + } + const miniute = parseInt(ar[1]); + if (miniute < 30 || miniute == 60) { + return [ar[0], '30'].join(':') + } + if (miniute < 60) { + // 加一个小时 + const tempStr = [ar[0], '00'].join(':'); + const format = "YYYY-MM-DD HH:mm"; + const _moment = moment(tempStr, format) + _moment.add(1, 'hours') + return _moment.format(format) + } + + return dateString +} + + + // 恢复数据 function md_rec_data(k, mdu, id, editor) { if (window.sessionStorage.getItem(k + mdu) !== null) { @@ -713,7 +742,7 @@ class Newshixuns extends Component { onChangeTimePicker = (value, dateString) => { this.setState({ - TimePickervalue: handleDateString(dateString) + TimePickervalue: handleDateStrings(dateString) }) } // 附件相关 START From 806e81e3a59c1d5bf578db3ce9358a87412ab1f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Thu, 25 Jul 2019 16:17:20 +0800 Subject: [PATCH 19/58] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/modules/user/FindPasswordComponent.js | 94 ++++++++++++++----- .../modules/user/LoginRegisterComponent.js | 74 +++++++++++++-- 2 files changed, 139 insertions(+), 29 deletions(-) diff --git a/public/react/src/modules/user/FindPasswordComponent.js b/public/react/src/modules/user/FindPasswordComponent.js index 0c3678776..6317c5134 100644 --- a/public/react/src/modules/user/FindPasswordComponent.js +++ b/public/react/src/modules/user/FindPasswordComponent.js @@ -94,14 +94,14 @@ class LoginRegisterComponent extends Component { } //倒计时 getverificationcode = () => { - + debugger if(this.state.login === undefined || this.state.login.length===0){ this.openNotification("请输入手机号或邮箱"); return; } //这是判断是否手机正确 - if(this.state.Phonenumberisnotcobool === true){ + if(this.state.Phonenumberisnotcobool === false){ this.openNotification(this.state.Phonenumberisnotco); this.setState({ Whethertoverify:this.state.Whethertoverify===true?false:true, @@ -109,7 +109,7 @@ class LoginRegisterComponent extends Component { return; } //拖动滑动验证 - if(this.state.dragOk===undefined||this.state.dragOk === false){ + if(this.state.dragOk === false){ this.openNotification("拖动滑块验证"); return; } @@ -180,12 +180,11 @@ class LoginRegisterComponent extends Component { //找回密码 Retrievepassword = () => { if (this.state.Phonenumberisnotcobool === false) { - if (this.state.login.length === 0) { - this.setState({ - Phonenumberisnotco:"请输入正确的邮箱或手机号", - }) - return - } + this.openNotification(this.state.Phonenumberisnotco); + this.setState({ + Whethertoverify:this.state.Whethertoverify===true?false:true, + }) + return; } if (this.state.login === undefined|| this.state.login.length ===0 || this.state.login === "") { this.setState({ @@ -365,7 +364,7 @@ class LoginRegisterComponent extends Component { if (value.length === 0) { this.setState({ Phonenumberisnotco: undefined, - Phonenumberisnotcobool: false, + Phonenumberisnotcobool: true, }) return; } @@ -418,20 +417,20 @@ class LoginRegisterComponent extends Component { if(this.state.login===""||this.state.login.length===0){ this.setState({ Phonenumberisnotco: "账号不能为空", - Phonenumberisnotcobool: true, + Phonenumberisnotcobool: false, dragOk:false, Whethertoverify:this.state.Whethertoverify===true?false:true, }) return } - console.log(e.target.value.length); - if (e.target.value.length === 0) { - this.setState({ - Phonenumberisnotco: undefined, - Phonenumberisnotcobool: false, - }) - return; - } + // console.log(e.target.value.length); + // if (e.target.value.length === 0) { + // this.setState({ + // Phonenumberisnotco: undefined, + // Phonenumberisnotcobool: false, + // }) + // return; + // } // var telephone = $("#telephoneAdd.tianjia_phone").val(); var regph = /^[1][3,4,5,6,7,8][0-9]{9}$/; // var email = $("#add_email.tianjia_email").val(); @@ -485,12 +484,63 @@ class LoginRegisterComponent extends Component { if (this.state.login === "" || this.state.login.length === 0) { this.setState({ Phonenumberisnotco: "账号不能为空", - Phonenumberisnotcobool: true, + Phonenumberisnotcobool: false, dragOk: false, Whethertoverify: this.state.Whethertoverify === true ? false : true, }) return } + // var telephone = $("#telephoneAdd.tianjia_phone").val(); + var regph = /^[1][3,4,5,6,7,8][0-9]{9}$/; + // var email = $("#add_email.tianjia_email").val(); + var regemail = /^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/; + + // [1]手机号开头必须是1 [3,4,5,6,7,8] 第二位是3-8中的一个 [0-9]{9} 后边9位可以是0-9的任意数字。 + var stringdata = undefined; + if (!regph.test(this.state.login)) { + stringdata = "手机号格式不正确"; + this.setState({ + Phonenumberisnotco: stringdata, + Phonenumberisnotcobool: false, + dragOk:false, + Whethertoverify: this.state.Whethertoverify === true ? false : true, + }) + } else { + this.setState({ + Phonenumberisnotco: undefined, + Phonenumberisnotcobool: true, + dragOk: true, + + }); + this.Emailphonenumberverification(this.state.login) + + return + } + + if (!regemail.test(this.state.login)) { + if ((this.state.login.indexOf("@") != -1) === true) { + stringdata = "邮箱格式不正确"; + } else { + stringdata = "手机号格式不正确"; + + } + this.setState({ + Phonenumberisnotco: stringdata, + Phonenumberisnotcobool: false, + dragOk:false, + Whethertoverify: this.state.Whethertoverify === true ? false : true, + }) + return + } else { + this.setState({ + Phonenumberisnotco: undefined, + Phonenumberisnotcobool: true, + dragOk: true, + }) + this.Emailphonenumberverification(this.state.login) + return + } + this.setState({ Phonenumberisnotcosytdhk: undefined, }) @@ -513,7 +563,7 @@ class LoginRegisterComponent extends Component { console.log(value.length); this.setState({ Phonenumberisnotco: result.data.message, - Phonenumberisnotcobool: true, + Phonenumberisnotcobool: false, dragOk:false, Whethertoverify:this.state.Whethertoverify===true?false:true, }) @@ -521,7 +571,7 @@ class LoginRegisterComponent extends Component { }else { this.setState({ Phonenumberisnotco: undefined, - Phonenumberisnotcobool: false, + Phonenumberisnotcobool: true, dragOk:true, }) return; diff --git a/public/react/src/modules/user/LoginRegisterComponent.js b/public/react/src/modules/user/LoginRegisterComponent.js index f6c32909d..241fc2c6f 100644 --- a/public/react/src/modules/user/LoginRegisterComponent.js +++ b/public/react/src/modules/user/LoginRegisterComponent.js @@ -206,7 +206,65 @@ class LoginRegisterComponent extends Component { } //是否验证通过 dragOkCallback = () => { - console.log(this.state.logins); + debugger + if (this.state.logins.length === 0) { + this.setState({ + Phonenumberisnotcos: undefined, + Phonenumberisnotcobool: false, + dragOk:true, + + }) + return; + } + // var telephone = $("#telephoneAdd.tianjia_phone").val(); + var regph = /^[1][3,4,5,6,7,8][0-9]{9}$/; + // var email = $("#add_email.tianjia_email").val(); + var regemail = /^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/; + + // [1]手机号开头必须是1 [3,4,5,6,7,8] 第二位是3-8中的一个 [0-9]{9} 后边9位可以是0-9的任意数字。 + var stringdata = undefined; + if (!regph.test(this.state.logins)) { + stringdata = "手机号格式不正确"; + this.setState({ + Phonenumberisnotcos: stringdata, + Phonenumberisnotcobool: true, + dragOk:false, + Whethertoverify:this.state.Whethertoverify===true?false:true, + }) + } else { + this.setState({ + Phonenumberisnotcos: undefined, + Phonenumberisnotcobool: false, + dragOk:true, + }); + this.Emailphonenumberverification(this.state.logins, 2); + return + } + + if (!regemail.test(this.state.logins)) { + if ((this.state.logins.indexOf("@") != -1) === true) { + stringdata = "邮箱格式不正确"; + } else { + stringdata = "手机号格式不正确"; + + } + this.setState({ + Phonenumberisnotcos: stringdata, + Phonenumberisnotcobool: true, + dragOk:false, + Whethertoverify:this.state.Whethertoverify===true?false:true, + }) + return + } else { + this.setState({ + Phonenumberisnotcos: undefined, + Phonenumberisnotcobool: false, + dragOk:true, + }) + this.Emailphonenumberverification(this.state.logins, 2); + return + } + this.setState({ Phonenumberisnotcosytdhk:undefined, }) @@ -416,7 +474,6 @@ class LoginRegisterComponent extends Component { Phonenumberisnotco: undefined, Phonenumberisnotcobool: false, dragOk:true, - }) }else { this.setState({ @@ -426,7 +483,7 @@ class LoginRegisterComponent extends Component { Whethertoverify:this.state.Whethertoverify===true?false:true, }) } - return; + return; } else if (id === 2) { this.setState({ Phonenumberisnotcos: result.data.message, @@ -499,8 +556,9 @@ class LoginRegisterComponent extends Component { //倒计时 getverificationcode = () => { - console.log(this.state.Phonenumberisnotcobool); - console.log(this.state.dragOk); + debugger + // console.log(this.state.Phonenumberisnotcobool); + // console.log(this.state.dragOk); if(this.state.logins === undefined || this.state.logins.length===0){ this.openNotification("请输入手机号或邮箱"); return; @@ -513,7 +571,7 @@ class LoginRegisterComponent extends Component { }) return; } - if(this.state.dragOk===undefined||this.state.dragOk === false){ + if(this.state.dragOk === false){ this.openNotification("拖动滑块验证"); return; } @@ -669,6 +727,7 @@ class LoginRegisterComponent extends Component { this.setState({ Phonenumberisnotcos: undefined, Phonenumberisnotcobool: false, + }) return } @@ -691,6 +750,7 @@ class LoginRegisterComponent extends Component { this.setState({ Phonenumberisnotcos: undefined, Phonenumberisnotcobool: false, + }) this.Emailphonenumberverification(e.target.value, id); return @@ -943,7 +1003,7 @@ class LoginRegisterComponent extends Component { { Whethertoverify===false&&pciphone===true? : From b350b0f1a61fdecb8eeb489c15f65b9aa5acd00e 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, 25 Jul 2019 16:18:31 +0800 Subject: [PATCH 20/58] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../paths/PathDetail/DetailCardsTemp.js | 25 +- .../src/modules/paths/PathDetail/DetailTop.js | 477 +++++++++--------- .../paths/PathDetail/PathDetailIndex.js | 10 +- .../tpm/shixunchild/Challenges/Challenges.js | 15 +- .../Propaedeutics/Propaedeu_tics.js | 8 +- 5 files changed, 280 insertions(+), 255 deletions(-) diff --git a/public/react/src/modules/paths/PathDetail/DetailCardsTemp.js b/public/react/src/modules/paths/PathDetail/DetailCardsTemp.js index 4acc28a48..5150d14da 100644 --- a/public/react/src/modules/paths/PathDetail/DetailCardsTemp.js +++ b/public/react/src/modules/paths/PathDetail/DetailCardsTemp.js @@ -1,5 +1,6 @@ import React, { Component } from 'react'; import {getImageUrl} from 'educoder'; +import { Tooltip } from 'antd'; import '../../paths/ShixunPaths.css'; import DetailCardsEditAndAdd from './DetailCardsEditAndAdd'; import axios from 'axios'; @@ -85,16 +86,26 @@ class DetailCards extends Component{ + {item.stage_name} - - - - - - + + + + + + + + - + + + + + + + +

    {item.stage_description}

    diff --git a/public/react/src/modules/paths/PathDetail/DetailTop.js b/public/react/src/modules/paths/PathDetail/DetailTop.js index 50c5c2680..09425df92 100644 --- a/public/react/src/modules/paths/PathDetail/DetailTop.js +++ b/public/react/src/modules/paths/PathDetail/DetailTop.js @@ -1,238 +1,241 @@ -import React,{ Component } from "react"; -import { Modal,Radio,Input,Tooltip } from "antd"; -import { BrowserRouter as Router, Route, Link } from "react-router-dom"; -import SendPanel from "./sendPanel.js"; -import { getImageUrl } from 'educoder'; -import axios from 'axios'; -import Modals from '../../modals/Modals'; -import './DetailTop.css'; - -const Search = Input.Search; -const RadioGroup = Radio.Group; -class DetailTop extends Component{ - constructor(props){ - super(props) - this.state={ - cardsModalcancel:this.cardsModalcancel, - cardsModalsave:this.cardsModalsave, - Modalstype:false, - Modalstopval:"", - Modalsbottomval:'', - loadtype:false, - deletepathtype:false, - cardsModalsavetype:false - } - } - - allow_deletepath=()=>{ - this.setState({ - Modalstype:true, - Modalstopval:"是否删除路径?", - deletepathtype:true - }) - } - - applyissuePath=()=>{ - this.setState({ - Modalstype:true, - Modalstopval:"发布申请已提交,请等待管理员的审核", - Modalsbottomval:"• 我们将在1-2个工作日内完成审核", - loadtype:true - }) - } - - cancelissuePath=()=>{ - let pathId=this.props.match.params.pathId; - let url ="/paths/"+pathId+"/cancel_publish.json"; - axios.get(url).then((result)=>{ - if(result.status===200){ - if(result.data.status===0){ - - }else if(result.data.status===1){ - window.location.href = "/paths/" + result.data.subject_id - } - } - }).catch((error)=>{ - console.log(error); - }) - } - - reovkissuePath=()=>{ - - this.setState({ - Modalstype:true, - Modalstopval:"是否确认撤销发布", - Modalsbottomval:"确认后,回退到编辑状态", - cardsModalsavetype:true, - }) - - } - reovkissuePaths=()=>{ - let pathId=this.props.match.params.pathId; - let url ="/paths/"+pathId+"/cancel_has_publish.json"; - axios.get(url).then((result)=>{ - if(result.status===200){ - if(result.data.status===0){ - - }else if(result.data.status===1){ - this.setState({ - cardsModalsavetype:false, - loadtype:false, - deletepathtype:false - }) - window.location.href = "/paths/" + result.data.subject_id - } - } - }).catch((error)=>{ - console.log(error); - }) - } - - cardsModalcancel=()=>{ - this.setState({ - Modalstype:false, - Modalsbottomval:'', - loadtype:false, - deletepathtype:false - }) - } - - cardsModalsave=()=>{ - let {loadtype,deletepathtype}=this.state; - - //删除路径 - if(deletepathtype===true){ - let pathid=this.props.match.params.pathId; - const deleteUrl = `/paths/`+pathid+`.json`; - axios.delete(deleteUrl).then((response) => { - const status = response.data.status - if (status === 1) { - window.location.href = "/paths"; - } - }).catch((error) => { - console.log(error) - }) - } - - //申请发布 - if(loadtype===true){ - - let pathid=this.props.match.params.pathId; - let url ="/paths/"+pathid+"/publish.json"; - axios.get(url).then((result)=>{ - if(result.status===200){ - if(result.data.status===0){ - this.setState({ - Modalstype:true, - Modalstopval: result.data.message, - }) - }else if(result.data.status===1){ - window.location.reload(); - } - } - }).catch((error)=>{ - console.log(error); - }) - - } - this.setState({ - Modalstype:false, - Modalsbottomval:'' - }) - } - - render(){ - let{detailInfoList}=this.props; - let{Modalstype,Modalstopval,cardsModalcancel,cardsModalsave,Modalsbottomval,cardsModalsavetype,loadtype}=this.state; - const radioStyle = { - display: 'block', - height: '30px', - lineHeight: '30px', - }; - - return( -
    - - - { - detailInfoList && -
    -
    - - {detailInfoList.name} - - - {detailInfoList===undefined?"":detailInfoList.allow_statistics===true? - - - :"" - } - - {detailInfoList===undefined?"":detailInfoList.allow_statistics===true? - - 学习统计 - :"" - } - - { detailInfoList.allow_send === true && - - } - -
    -
    - { - detailInfoList && -
      - { detailInfoList.stages_count!=0 ?
    • 章节{detailInfoList.stages_count}
    • : ""} - { detailInfoList.stage_shixuns_count!=0 ?
    • 实训{ detailInfoList.stage_shixuns_count}
    • : ""} - { detailInfoList.challenge_choose_count!=0 ?
    • 选择题任务{detailInfoList.challenge_choose_count}
    • : ""} - { detailInfoList.challenges_count!=0 ?
    • 实践任务{detailInfoList.challenges_count}
    • : ""} - { detailInfoList.subject_score!=0 ?
    • 经验值{detailInfoList.subject_score}
    • : ""} - { detailInfoList.member_count!=0 ?
    • 学习人数{detailInfoList.member_count}
    • : ""} -
    - } -
    - {detailInfoList===undefined?"":detailInfoList.allow_delete===true?删除路径:""} - - { - detailInfoList.publish_status===0&&detailInfoList.allow_statistics===true? - 申请发布:"" - } - - - { - detailInfoList.publish_status===1 && detailInfoList.allow_statistics===true? - 撤销申请:"" - } - - { - detailInfoList.publish_status===2 && detailInfoList.allow_statistics===true? - 撤销发布:"" - } -
    -
    -
    - } - -
    - ) - } -} +import React,{ Component } from "react"; +import { Modal,Radio,Input,Tooltip } from "antd"; +import { BrowserRouter as Router, Route, Link } from "react-router-dom"; +import SendPanel from "./sendPanel.js"; +import { getImageUrl } from 'educoder'; +import axios from 'axios'; +import Modals from '../../modals/Modals'; +import './DetailTop.css'; + +const Search = Input.Search; +const RadioGroup = Radio.Group; +class DetailTop extends Component{ + constructor(props){ + super(props) + this.state={ + cardsModalcancel:this.cardsModalcancel, + cardsModalsave:this.cardsModalsave, + Modalstype:false, + Modalstopval:"", + Modalsbottomval:'', + loadtype:false, + deletepathtype:false, + cardsModalsavetype:false + } + } + + allow_deletepath=()=>{ + this.setState({ + Modalstype:true, + Modalstopval:"是否删除路径?", + deletepathtype:true + }) + } + + applyissuePath=()=>{ + this.setState({ + Modalstype:true, + Modalstopval:"发布申请已提交,请等待管理员的审核", + Modalsbottomval:"• 我们将在1-2个工作日内完成审核", + loadtype:true + }) + } + + cancelissuePath=()=>{ + let pathId=this.props.match.params.pathId; + let url ="/paths/"+pathId+"/cancel_publish.json"; + axios.get(url).then((result)=>{ + if(result.status===200){ + if(result.data.status===0){ + + }else if(result.data.status===1){ + window.location.href = "/paths/" + result.data.subject_id + } + } + }).catch((error)=>{ + console.log(error); + }) + } + + reovkissuePath=()=>{ + + this.setState({ + Modalstype:true, + Modalstopval:"是否确认撤销发布", + Modalsbottomval:"确认后,回退到编辑状态", + cardsModalsavetype:true, + }) + + } + reovkissuePaths=()=>{ + let pathId=this.props.match.params.pathId; + let url ="/paths/"+pathId+"/cancel_has_publish.json"; + axios.get(url).then((result)=>{ + if(result.status===200){ + if(result.data.status===0){ + + }else if(result.data.status===1){ + this.setState({ + cardsModalsavetype:false, + loadtype:false, + deletepathtype:false + }) + window.location.href = "/paths/" + result.data.subject_id + } + } + }).catch((error)=>{ + console.log(error); + }) + } + + cardsModalcancel=()=>{ + this.setState({ + Modalstype:false, + Modalsbottomval:'', + loadtype:false, + deletepathtype:false + }) + } + + cardsModalsave=()=>{ + let {loadtype,deletepathtype}=this.state; + + //删除路径 + if(deletepathtype===true){ + let pathid=this.props.match.params.pathId; + const deleteUrl = `/paths/`+pathid+`.json`; + axios.delete(deleteUrl).then((response) => { + const status = response.data.status + if (status === 1) { + window.location.href = "/paths"; + } + }).catch((error) => { + console.log(error) + }) + } + + //申请发布 + if(loadtype===true){ + + let pathid=this.props.match.params.pathId; + let url ="/paths/"+pathid+"/publish.json"; + axios.get(url).then((result)=>{ + if(result.status===200){ + if(result.data.status===0){ + this.setState({ + Modalstype:true, + Modalstopval: result.data.message, + }) + }else if(result.data.status===1){ + window.location.reload(); + } + } + }).catch((error)=>{ + console.log(error); + }) + + } + this.setState({ + Modalstype:false, + Modalsbottomval:'' + }) + } + + render(){ + let{detailInfoList}=this.props; + let{Modalstype,Modalstopval,cardsModalcancel,cardsModalsave,Modalsbottomval,cardsModalsavetype,loadtype}=this.state; + const radioStyle = { + display: 'block', + height: '30px', + lineHeight: '30px', + }; + + return( +
    + + + { + detailInfoList && +
    +
    + + {detailInfoList.name} + + + {detailInfoList===undefined?"":detailInfoList.allow_statistics===true? + + + + + + :"" + } + + {detailInfoList===undefined?"":detailInfoList.allow_statistics===true? + + 学习统计 + :"" + } + + { detailInfoList.allow_send === true && + + } + +
    +
    + { + detailInfoList && +
      + { detailInfoList.stages_count!=0 ?
    • 章节{detailInfoList.stages_count}
    • : ""} + { detailInfoList.stage_shixuns_count!=0 ?
    • 实训{ detailInfoList.stage_shixuns_count}
    • : ""} + { detailInfoList.challenge_choose_count!=0 ?
    • 选择题任务{detailInfoList.challenge_choose_count}
    • : ""} + { detailInfoList.challenges_count!=0 ?
    • 实践任务{detailInfoList.challenges_count}
    • : ""} + { detailInfoList.subject_score!=0 ?
    • 经验值{detailInfoList.subject_score}
    • : ""} + { detailInfoList.member_count!=0 ?
    • 学习人数{detailInfoList.member_count}
    • : ""} +
    + } +
    + {detailInfoList===undefined?"":detailInfoList.allow_delete===true?删除路径:""} + + { + detailInfoList.publish_status===0&&detailInfoList.allow_statistics===true? + 申请发布:"" + } + + + { + detailInfoList.publish_status===1 && detailInfoList.allow_statistics===true? + 撤销申请:"" + } + + { + detailInfoList.publish_status===2 && detailInfoList.allow_statistics===true? + 撤销发布:"" + } +
    +
    +
    + } + +
    + ) + } +} export default DetailTop; \ No newline at end of file diff --git a/public/react/src/modules/paths/PathDetail/PathDetailIndex.js b/public/react/src/modules/paths/PathDetail/PathDetailIndex.js index 61933b765..a72771c39 100644 --- a/public/react/src/modules/paths/PathDetail/PathDetailIndex.js +++ b/public/react/src/modules/paths/PathDetail/PathDetailIndex.js @@ -369,9 +369,11 @@ class PathDetailIndex extends Component{

    课程须知 {detailInfoList===undefined?"":detailInfoList.allow_statistics===true? + - + + :"" }

    @@ -397,16 +399,18 @@ class PathDetailIndex extends Component{
    +
    15&&clickdetailInfoListtype===false?"newsubscript mb9 color-grey-9 fr":"newsubscript mb9 color-grey-9 none"} - data-tip-down="显示全部" onClick={()=>this.clickNewsubscript(0)} >...
    +
    +
    this.clickNewsubscript(1)}>
    +
    } diff --git a/public/react/src/modules/tpm/shixunchild/Challenges/Challenges.js b/public/react/src/modules/tpm/shixunchild/Challenges/Challenges.js index f5d57ae21..65e95319e 100644 --- a/public/react/src/modules/tpm/shixunchild/Challenges/Challenges.js +++ b/public/react/src/modules/tpm/shixunchild/Challenges/Challenges.js @@ -293,11 +293,12 @@ class Challenges extends Component {

    简介 + + href={"/shixuns/" + id + "/settings?edit=1"} className="ring-green fr"> +

    {item.st === 0 ? - + + + : - + + + } 第{key+1}关 diff --git a/public/react/src/modules/tpm/shixunchild/Propaedeutics/Propaedeu_tics.js b/public/react/src/modules/tpm/shixunchild/Propaedeutics/Propaedeu_tics.js index a2b20415d..f40e9fa63 100644 --- a/public/react/src/modules/tpm/shixunchild/Propaedeutics/Propaedeu_tics.js +++ b/public/react/src/modules/tpm/shixunchild/Propaedeutics/Propaedeu_tics.js @@ -10,6 +10,8 @@ import classNames from 'classnames'; import { getImageUrl, toPath } from 'educoder'; +import { Tooltip } from 'antd'; + import axios from 'axios'; import { CircularProgress } from 'material-ui/Progress'; @@ -76,8 +78,10 @@ class Propaedeutics extends Component { return (

    - + + + +

    { loadingContent ? From 943a628dc91ed81f5e1fd96d927a7508e34e2c2c Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Thu, 25 Jul 2019 16:26:25 +0800 Subject: [PATCH 21/58] clear --- public/react/src/modules/user/account/AccountBasicEdit.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/public/react/src/modules/user/account/AccountBasicEdit.js b/public/react/src/modules/user/account/AccountBasicEdit.js index 1458862a1..24674a3ce 100644 --- a/public/react/src/modules/user/account/AccountBasicEdit.js +++ b/public/react/src/modules/user/account/AccountBasicEdit.js @@ -274,6 +274,11 @@ class AccountBasic extends Component { return item.name == e; }); if (!arr[0]) { + if (!e) { + this.setState({ + filterSchoolList: [] + }) + } // 没找到学校,清空部门 this.setState({ departments: [], From 47ef7842e8c0eece2c210feee149a11a820525cc Mon Sep 17 00:00:00 2001 From: czd Date: Thu, 25 Jul 2019 16:26:25 +0800 Subject: [PATCH 22/58] 123 --- 2 | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 2 diff --git a/2 b/2 new file mode 100644 index 000000000..e69de29bb From c661aed21b4e0aface22f241502cb860a7cae8b4 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, 25 Jul 2019 16:38:11 +0800 Subject: [PATCH 23/58] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/react/public/css/edu-all.css | 2 +- public/stylesheets/educoder/edu-all.css | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/public/react/public/css/edu-all.css b/public/react/public/css/edu-all.css index ed44e1f90..ca04aa193 100644 --- a/public/react/public/css/edu-all.css +++ b/public/react/public/css/edu-all.css @@ -289,7 +289,7 @@ label.infolabel{display: block;float: left;width: 56px;text-align: right;margin- .shaiTitle{display: block;padding-right: 20px;} .shaiContent li.shaiItem.active{background-color: #4CACFF!important;color:#fff!important;} .shaiContent li.shaiItem{padding:3px 15px;float: left;border-radius: 4px;color: #4C4C4C;cursor: pointer;margin-right: 15px;display: block} -.shaiContent li.shaiItem:hover{background-color: #F5F5F5} +.shaiContent li.shaiItem:hover{background-color: #4CACFF!important;color:#fff!important;} .shaiAllItem{max-width: 1138px;} .subshaicontent{display: none;box-sizing: border-box;position: absolute;width: 100%;top: 33px;left: 0px;background-color: #fff;box-shadow:0px 1px 4px rgba(76,76,76,0.2);padding:0px 20px;z-index: 99999;border-radius: 4px;max-height: 800px;overflow-y: auto} .subshaicontent-part{border-bottom: 1px solid #eee;} diff --git a/public/stylesheets/educoder/edu-all.css b/public/stylesheets/educoder/edu-all.css index 4006fb615..45aea81be 100644 --- a/public/stylesheets/educoder/edu-all.css +++ b/public/stylesheets/educoder/edu-all.css @@ -291,7 +291,7 @@ label.infolabel{display: block;float: left;width: 56px;text-align: right;margin- .shaiTitle{display: block;padding-right: 20px;} .shaiContent li.shaiItem.active{background-color: #4CACFF!important;color:#fff!important;} .shaiContent li.shaiItem{padding:3px 15px;float: left;border-radius: 4px;color: #4C4C4C;cursor: pointer;margin-right: 15px;display: block} -.shaiContent li.shaiItem:hover{background-color: #F5F5F5} +.shaiContent li.shaiItem:hover{background-color: #4CACFF!important;color:#fff!important;} .shaiAllItem{max-width: 1138px;} .subshaicontent{display: none;box-sizing: border-box;position: absolute;width: 100%;top: 33px;left: 0px;background-color: #fff;box-shadow:0px 1px 4px rgba(76,76,76,0.2);padding:0px 20px;z-index: 99999;border-radius: 4px;max-height: 800px;overflow-y: auto} .subshaicontent-part{border-bottom: 1px solid #eee;} From 184db727438eca6105cf3594510de60682d1da8c 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, 25 Jul 2019 16:38:39 +0800 Subject: [PATCH 24/58] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modules/tpm/component/TPMRightSection.js | 61 +++++++++---------- 1 file changed, 30 insertions(+), 31 deletions(-) diff --git a/public/react/src/modules/tpm/component/TPMRightSection.js b/public/react/src/modules/tpm/component/TPMRightSection.js index 8479acd76..a3a7e9820 100644 --- a/public/react/src/modules/tpm/component/TPMRightSection.js +++ b/public/react/src/modules/tpm/component/TPMRightSection.js @@ -117,36 +117,6 @@ class TPMRightSection extends Component { } -
    -

    推荐实训

    -
    - { - TPMRightSectionData===undefined?"":TPMRightSectionData.recommands===undefined?"":TPMRightSectionData.recommands.map((item,key)=>{ - return( -
    - - 69?1526971094 - -
    - - {item.name} - -

    - {item.stu_num} 人学习 -

    -

    {item.level}

    -
    -
    - ) - }) - } -
    -
    - +
    +

    推荐实训

    +
    + { + TPMRightSectionData===undefined?"":TPMRightSectionData.recommands===undefined?"":TPMRightSectionData.recommands.map((item,key)=>{ + return( +
    + + 69?1526971094 + +
    + + {item.name} + +

    + {item.stu_num} 人学习 +

    +

    {item.level}

    +
    +
    + ) + }) + } +
    +
    } From 09d0bcd196097e28afe4afdd52c83c2b26d92897 Mon Sep 17 00:00:00 2001 From: czd Date: Thu, 25 Jul 2019 16:40:40 +0800 Subject: [PATCH 25/58] 123 --- 3 | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 3 diff --git a/3 b/3 new file mode 100644 index 000000000..e69de29bb From 6b1db7bea25ab9cc20af41fb70535f612bad7815 Mon Sep 17 00:00:00 2001 From: czd Date: Thu, 25 Jul 2019 16:41:33 +0800 Subject: [PATCH 26/58] 123 --- 4 | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 4 diff --git a/4 b/4 new file mode 100644 index 000000000..e69de29bb From 2c639426b7e4e3f83ee706a9f4eddf06fda45ca4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Thu, 25 Jul 2019 16:46:20 +0800 Subject: [PATCH 27/58] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 2 | 0 3 | 0 4 | 0 3 files changed, 0 insertions(+), 0 deletions(-) delete mode 100644 2 delete mode 100644 3 delete mode 100644 4 diff --git a/2 b/2 deleted file mode 100644 index e69de29bb..000000000 diff --git a/3 b/3 deleted file mode 100644 index e69de29bb..000000000 diff --git a/4 b/4 deleted file mode 100644 index e69de29bb..000000000 From 50dd27e744828c4b3226f879a0a32c9447564b8c 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, 25 Jul 2019 16:52:04 +0800 Subject: [PATCH 28/58] b --- public/react/src/modules/tpm/newshixuns/Newshixuns.js | 1 + 1 file changed, 1 insertion(+) diff --git a/public/react/src/modules/tpm/newshixuns/Newshixuns.js b/public/react/src/modules/tpm/newshixuns/Newshixuns.js index 8cb79e9d0..c15269c5a 100644 --- a/public/react/src/modules/tpm/newshixuns/Newshixuns.js +++ b/public/react/src/modules/tpm/newshixuns/Newshixuns.js @@ -16,6 +16,7 @@ import './css/Newshixuns.css'; import {getUrl} from 'educoder' +import moment from 'moment'; let path = getUrl("/editormd/lib/") From 016f6377eb8910f24b78bdb586c8cea6352944da Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Thu, 25 Jul 2019 17:06:56 +0800 Subject: [PATCH 29/58] current_user && --- public/react/src/modules/courses/exercise/ExerciseNew.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/public/react/src/modules/courses/exercise/ExerciseNew.js b/public/react/src/modules/courses/exercise/ExerciseNew.js index fe1b8f565..f5332d56e 100644 --- a/public/react/src/modules/courses/exercise/ExerciseNew.js +++ b/public/react/src/modules/courses/exercise/ExerciseNew.js @@ -407,11 +407,11 @@ class ExerciceNew extends Component{ } `}
    - + ]}> }

    {this.isEdit ? "编辑" : "新建"}试卷 From 8debe9d99ea56eaea61dbe08ff1685cc0a7ce50b Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Thu, 25 Jul 2019 17:07:02 +0800 Subject: [PATCH 30/58] key --- .../src/modules/courses/exercise/ExerciseDisplay.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/public/react/src/modules/courses/exercise/ExerciseDisplay.js b/public/react/src/modules/courses/exercise/ExerciseDisplay.js index 4da4768d2..bd70bece6 100644 --- a/public/react/src/modules/courses/exercise/ExerciseDisplay.js +++ b/public/react/src/modules/courses/exercise/ExerciseDisplay.js @@ -120,35 +120,35 @@ class ExerciseDisplay extends Component{ return } else if (item.question_type == 2) { return } else if (item.question_type == 3) { return } else if (item.question_type == 4) { return } else if (item.question_type == 5) { return } From aa32f311f61b43fffe5fd4b3c87bcee4546561c6 Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Thu, 25 Jul 2019 17:08:55 +0800 Subject: [PATCH 31/58] =?UTF-8?q?=E8=AE=A1=E7=AE=97=E6=88=90=E7=BB=A9?= =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../homework_commons_controller.rb | 8 +-- app/services/homeworks_service.rb | 49 ++++++++++-------- dump.rdb | Bin 0 -> 551 bytes 3 files changed, 31 insertions(+), 26 deletions(-) create mode 100644 dump.rdb diff --git a/app/controllers/homework_commons_controller.rb b/app/controllers/homework_commons_controller.rb index cfc1c4ba5..4c8d2a729 100644 --- a/app/controllers/homework_commons_controller.rb +++ b/app/controllers/homework_commons_controller.rb @@ -246,13 +246,15 @@ class HomeworkCommonsController < ApplicationController student_works = @homework.student_works.where(user_id: user_ids) end - myshixuns = Myshixun.where(shixun_id: @homework.homework_commons_shixun&.shixun_id, user_id: user_ids). - includes(:games).where(games: {challenge_id: @homework.homework_challenge_settings.pluck(:challenge_id)}) + student_works = student_works.includes(:challenge_work_scores) + challenge_settings = @homework.homework_challenge_settings + challenge_setting_ids = challenge_settings.pluck(:challenge_id) + myshixuns = Myshixun.where(shixun_id: @homework.homework_commons_shixun&.shixun_id, user_id: user_ids).includes(:games) myshixuns.find_each(batch_size: 100) do |myshixun| work = student_works.select{|work| work.user_id == myshixun.user_id}.first if work && myshixun - games = myshixun.games.where(challenge_id: challenge_settings.pluck(:challenge_id)) + games = myshixun.games.select{|game| challenge_setting_ids.include?(game.challenge_id)} HomeworksService.new.update_myshixun_work_score work, myshixun, games, @homework, challenge_settings end end diff --git a/app/services/homeworks_service.rb b/app/services/homeworks_service.rb index b835685a6..ab149403d 100644 --- a/app/services/homeworks_service.rb +++ b/app/services/homeworks_service.rb @@ -286,7 +286,7 @@ class HomeworksService challenge_setting = challenge_settings.select{|setting| setting.challenge_id == game.challenge_id}.first pass_consume_time += (game.cost_time / 60.0).to_f user_total_score += game.final_score.to_i < 0 ? 0 : game.challenge.score.to_i - adjust_score = work.challenge_work_scores.where(:challenge_id => game.challenge_id).last + adjust_score = work.challenge_work_scores.select{|work_score| work_score.challenge_id == game.challenge_id}.last final_score += if adjust_score.present? adjust_score.score elsif homework.homework_detail_manual.answer_open_evaluation @@ -300,19 +300,6 @@ class HomeworksService end myshixun_endtime = games.select{|game| game.status == 2}.size == games.size ? games.map(&:end_time).max : nil - if myshixun_endtime.present? - work.cost_time = myshixun_endtime.to_i - setting_time.publish_time.to_i - - efficiency = (pass_consume_time == 0 ? 0 : Math.log((user_total_score / pass_consume_time.to_f) + 1.0)) - work.efficiency = format("%.2f", efficiency) - - if myshixun_endtime <= homework_end_or_late_time - work.compelete_status = myshixun_endtime < setting_time.publish_time ? 2 : 1 - - # 如果作业的最大效率值有变更则更新所有作品的效率分 - homework.update_column("max_efficiency", work.efficiency) if homework.work_efficiency && homework.max_efficiency < work.efficiency - end - end if work.work_status == 0 is_complete = myshixun_endtime && (myshixun_endtime < setting_time.end_time) @@ -321,18 +308,34 @@ class HomeworksService elsif homework.allow_late && myshixun.created_at < homework.late_time work.work_status = 2 end + end + + if work.work_status != 0 + if myshixun_endtime.present? + work.cost_time = myshixun_endtime.to_i - setting_time.publish_time.to_i + + efficiency = (pass_consume_time == 0 ? 0 : Math.log((user_total_score / pass_consume_time.to_f) + 1.0)) + work.efficiency = format("%.2f", efficiency) + + if myshixun_endtime <= homework_end_or_late_time + work.compelete_status = myshixun_endtime < setting_time.publish_time ? 2 : 1 + + # 如果作业的最大效率值有变更则更新所有作品的效率分 + homework.update_column("max_efficiency", work.efficiency) if homework.work_efficiency && homework.max_efficiency < work.efficiency + end + end + work.late_penalty = work.work_status == 2 ? homework.late_penalty : 0 work.commit_time = myshixun.created_at > setting_time.publish_time ? setting_time.publish_time : myshixun.created_at work.myshixun_id = myshixun.id - end + work.update_time = myshixun.updated_at - work.update_time = myshixun.updated_at - - work.final_score = final_score - score = work.final_score + work.eff_score - work.late_penalty - work.work_score = format("%.2f",(score < 0 ? 0 : score).to_f) unless work.ultimate_score - #logger.info("#############work_score: #{score}") - work.calculation_time = Time.now - work.save! + work.final_score = final_score + score = work.final_score + work.eff_score - work.late_penalty + work.work_score = format("%.2f",(score < 0 ? 0 : score).to_f) unless work.ultimate_score + #logger.info("#############work_score: #{score}") + work.calculation_time = Time.now + work.save! + end end end \ No newline at end of file diff --git a/dump.rdb b/dump.rdb new file mode 100644 index 0000000000000000000000000000000000000000..a799840b19b627ba79861403e776c55d27442bac GIT binary patch literal 551 zcmYMxOKTHR90l;3jA;Fl{vUxEFJ_+ycVLbWWY`bin0FMo$ zMCX4l)Vc?sUea^;X;G{;Ty)tsKxzYLeVHkVhg)SUDlki=93r)<&n4oxx2;Rsu zet@TIFXm(z*;aP4yuM@JMxHsSx=mHrT~!e&Z8Sx>Px~U1HAS>l$5HfFLy$G9VM`eE z=n#L(aVyh>F!lY#Tfquhuq?eRj=2|cFPUX`@ZwS$K$w^xilmd;LvRwjFEpB@*4r)3 z36Ijm3lB1S#bQG%o&|Q~TO*kD)NH%dJ?_>B9D##rE(-Bhk=BSGIm|at3aX=AlC8^%Cc7$rbHlkXNx-#OLX3u@%Csr#RI0Zm mO;c1HqL59Om1;q!ntXhoU;85#=PLir&buGKFFu=F&wl}o%d#2( literal 0 HcmV?d00001 From 4e4915a3faf3a6470bd6d8e71678ca216a830a2e 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, 25 Jul 2019 17:09:04 +0800 Subject: [PATCH 32/58] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/react/src/AppConfig.js | 4 +--- public/react/src/modules/paths/PathDetail/PathDetailIndex.js | 4 ++-- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/public/react/src/AppConfig.js b/public/react/src/AppConfig.js index ddef777d6..12959fd9a 100644 --- a/public/react/src/AppConfig.js +++ b/public/react/src/AppConfig.js @@ -10,6 +10,7 @@ broadcastChannelOnmessage('refreshPage', () => { }) function locationurl(list){ + debugger if (window.location.port === "3007") { } else { @@ -142,9 +143,6 @@ export function initAxiosInterceptors(props) { // console.log("401401401") // } if (response.data.status === 403) { - // props.history.replace('/403') - // 这里会分2个情况,1、刚进入页面发请求返回的403;2、进入页面后,其他用户操作触发请求返回的403; - // TODO 这里做一个403弹框比较好? locationurl('/403'); } diff --git a/public/react/src/modules/paths/PathDetail/PathDetailIndex.js b/public/react/src/modules/paths/PathDetail/PathDetailIndex.js index a72771c39..8f5802c9e 100644 --- a/public/react/src/modules/paths/PathDetail/PathDetailIndex.js +++ b/public/react/src/modules/paths/PathDetail/PathDetailIndex.js @@ -146,7 +146,7 @@ class PathDetailIndex extends Component{ if (result.data.status === 403) { debugger - window.location.href = "/403"; + // window.location.href = "/403"; return; } @@ -173,7 +173,7 @@ class PathDetailIndex extends Component{ } if (result.data.status === 403 ) { debugger - window.location.href = "/403"; + // window.location.href = "/403"; return; } From d7ed523e9db7246320615cd2c2903dfac9b15d1c 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, 25 Jul 2019 17:12:30 +0800 Subject: [PATCH 33/58] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/react/src/AppConfig.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/react/src/AppConfig.js b/public/react/src/AppConfig.js index 12959fd9a..9c407c82c 100644 --- a/public/react/src/AppConfig.js +++ b/public/react/src/AppConfig.js @@ -142,7 +142,7 @@ export function initAxiosInterceptors(props) { // if(response.data.status === 401){ // console.log("401401401") // } - if (response.data.status === 403) { + if (response.data.status === 403||response.data.status === "403") { locationurl('/403'); } From d4c7053c4cecec6042aabf9a022015442428cda0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Thu, 25 Jul 2019 17:18:43 +0800 Subject: [PATCH 34/58] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/react/src/modules/user/LoginRegisterComponent.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/react/src/modules/user/LoginRegisterComponent.js b/public/react/src/modules/user/LoginRegisterComponent.js index 241fc2c6f..a54a5bb43 100644 --- a/public/react/src/modules/user/LoginRegisterComponent.js +++ b/public/react/src/modules/user/LoginRegisterComponent.js @@ -898,7 +898,7 @@ class LoginRegisterComponent extends Component {

    登录 - 注册 + 注册 { From 388bcbfde012c0e934ef2748fb2e736204f9f154 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, 25 Jul 2019 17:30:13 +0800 Subject: [PATCH 35/58] b --- public/react/src/modules/paths/PathDetail/PathDetailIndex.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/public/react/src/modules/paths/PathDetail/PathDetailIndex.js b/public/react/src/modules/paths/PathDetail/PathDetailIndex.js index 8f5802c9e..1ba1a3c13 100644 --- a/public/react/src/modules/paths/PathDetail/PathDetailIndex.js +++ b/public/react/src/modules/paths/PathDetail/PathDetailIndex.js @@ -343,9 +343,11 @@ class PathDetailIndex extends Component{

    简介 {detailInfoList===undefined?"":detailInfoList.allow_statistics===true? + + :"" }

    From 73fc0f3b52d1395f8ee4dd6585ed4c6faa61ccbb Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Thu, 25 Jul 2019 17:39:37 +0800 Subject: [PATCH 36/58] =?UTF-8?q?=E6=B3=A8=E9=87=8A=20=20=E6=95=88?= =?UTF-8?q?=E6=9E=9C=E6=98=AF=E4=B8=80=E6=A0=B7=E7=9A=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/react/public/js/editormd/editormd.min.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/public/react/public/js/editormd/editormd.min.js b/public/react/public/js/editormd/editormd.min.js index 048d95dc5..0b99c713a 100755 --- a/public/react/public/js/editormd/editormd.min.js +++ b/public/react/public/js/editormd/editormd.min.js @@ -4021,7 +4021,10 @@ { var katexHandle = function() { div.find("." + editormd.classNames.tex).each(function(){ - var tex = $(this); + var tex = $(this); + // 和线上的不一样? + // http://editor.md.ipandao.com/examples/html-preview-markdown-to-html-custom-toc-container.html#Editor.md + // katex.render(tex.html().replace(/</g, "<").replace(/>/g, ">"), tex[0]); katex.render(tex.text(), tex[0]); tex.find(".katex").css("font-size", "1.0em"); }); From 2ed0c3c61f73c870b039e71667be1efcfae60fe3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Thu, 25 Jul 2019 17:43:29 +0800 Subject: [PATCH 37/58] =?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/Listofworksstudentone.js | 39 +++++++++---------- 1 file changed, 19 insertions(+), 20 deletions(-) diff --git a/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js b/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js index 81e388d6f..462ec541f 100644 --- a/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js +++ b/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js @@ -997,10 +997,10 @@ class Listofworksstudentone extends Component { if(result === undefined){ return } - if(result.data.message!==undefined){ - - return; - } + // if(result.data.message!==undefined){ + // + // return; + // } this.setState({ teacherdata: result.data, @@ -1059,9 +1059,6 @@ class Listofworksstudentone extends Component { } axios.post(urll, data).then((result) => { if (result) { - if(result.data.message!==undefined){ - return; - } // console.log("学生未截至未公开的作品列表") // console.log(JSON.stringify(result)) this.setState({ @@ -1491,11 +1488,14 @@ class Listofworksstudentone extends Component { let url = "/homework_commons/"+homeworkid+"/update_student_score.json?shixun_id="+teacherdata.shixun_id; axios.get(url).then((response) => { - - this.props.showNotification(`${response.data.message}`); - // var homeworkid = this.props.match.params.homeworkid; - this.Getalistofworks(homeworkid); - this.props.history.replace( matchurl ); + if(response){ + if(response.data.status===0) { + this.props.showNotification(`${response.data.message}`); + // var homeworkid = this.props.match.params.homeworkid; + this.Getalistofworks(homeworkid); + // this.props.history.replace(matchurl); + } + } // this.Getalistofworkstwo("", "", "", "", 1, 20); }).catch((error) => { console.log(error) @@ -2160,15 +2160,17 @@ class Listofworksstudentone extends Component { axios.get(url).then((response) => { if(response){ - if(response.data.message!==undefined){ - return; - } + if(response.data.status===0){ + // if(response.data.message!==undefined){ + // return; + // } this.setState({ loadingstate: true }) - this.Startsortingt(this.state.orders, this.state.course_groupyslstwo, this.state.checkedValuesineinfo, this.state.searchtext, 1, this.state.limit); + this.Getalistofworks(homeworkid); this.props.showNotification(`${response.data.message}`); - this.props.history.replace( matchurl ); + } + // this.props.history.replace( matchurl ); } }).catch((error) => { console.log(error) @@ -2214,9 +2216,6 @@ class Listofworksstudentone extends Component { if(response === undefined){ return } - if(response.data.message!==undefined){ - return; - } if(response.data.status&&response.data.status===-1){ }else if(response.data.status&&response.data.status===-2){ From 535030d30f54af6c0de076f7fcbac117278551f6 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, 25 Jul 2019 17:57:21 +0800 Subject: [PATCH 38/58] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/react/src/modules/courses/new/CoursesNew.js | 7 +++++-- .../modules/courses/shixunHomework/Trainingjobsetting.js | 4 ++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/public/react/src/modules/courses/new/CoursesNew.js b/public/react/src/modules/courses/new/CoursesNew.js index 73c1dded9..d032737ea 100644 --- a/public/react/src/modules/courses/new/CoursesNew.js +++ b/public/react/src/modules/courses/new/CoursesNew.js @@ -309,11 +309,14 @@ class CoursesNew extends Component { }; handleChange=(value)=>{ - + debugger this.props.form.setFieldsValue({ - // course:value, + course:value, classroom:value }) + this.setState({ + course:value, + }) }; handleSearchschool=(value)=>{ diff --git a/public/react/src/modules/courses/shixunHomework/Trainingjobsetting.js b/public/react/src/modules/courses/shixunHomework/Trainingjobsetting.js index ec45b081c..3d1aecf5b 100644 --- a/public/react/src/modules/courses/shixunHomework/Trainingjobsetting.js +++ b/public/react/src/modules/courses/shixunHomework/Trainingjobsetting.js @@ -479,8 +479,8 @@ class Trainingjobsetting extends Component { return; } - if (this.state.latededuction <= 0) { - this.props.showNotification(`迟交扣分数不能小于等于零`); + if (this.state.latededuction <0) { + this.props.showNotification(`迟交扣分数不能小于零`); return; } From 734ae79d2cd491238f4b114778051b5f856da919 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, 25 Jul 2019 17:58:48 +0800 Subject: [PATCH 39/58] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/react/src/modules/courses/new/CoursesNew.js | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/public/react/src/modules/courses/new/CoursesNew.js b/public/react/src/modules/courses/new/CoursesNew.js index d032737ea..73c1dded9 100644 --- a/public/react/src/modules/courses/new/CoursesNew.js +++ b/public/react/src/modules/courses/new/CoursesNew.js @@ -309,14 +309,11 @@ class CoursesNew extends Component { }; handleChange=(value)=>{ - debugger + this.props.form.setFieldsValue({ - course:value, + // course:value, classroom:value }) - this.setState({ - course:value, - }) }; handleSearchschool=(value)=>{ From 463dd5841c48740a9e53dfbdf2158eca88339af2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Thu, 25 Jul 2019 17:58:59 +0800 Subject: [PATCH 40/58] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/modules/user/FindPasswordComponent.js | 12 +++++++- .../modules/user/LoginRegisterComponent.js | 30 ++++++++++++------- 2 files changed, 31 insertions(+), 11 deletions(-) diff --git a/public/react/src/modules/user/FindPasswordComponent.js b/public/react/src/modules/user/FindPasswordComponent.js index 6317c5134..814fed4d3 100644 --- a/public/react/src/modules/user/FindPasswordComponent.js +++ b/public/react/src/modules/user/FindPasswordComponent.js @@ -189,6 +189,9 @@ class LoginRegisterComponent extends Component { if (this.state.login === undefined|| this.state.login.length ===0 || this.state.login === "") { this.setState({ Phonenumberisnotco:"账号不能为空", + Phonenumberisnotcobool: false, + dragOk: false, + Whethertoverify: this.state.Whethertoverify === true ? false : true, }) return } @@ -197,6 +200,8 @@ class LoginRegisterComponent extends Component { // this.openNotification(`请拖动滑块完成验证`,2); this.setState({ Phonenumberisnotcosytdhk:"请拖动滑块完成验证", + dragOk: false, + Whethertoverify: this.state.Whethertoverify === true ? false : true, }) return } @@ -479,12 +484,15 @@ class LoginRegisterComponent extends Component { //是否验证通过 dragOkCallback = () => { console.log(this.state.login); - + this.setState({ + Phonenumberisnotcosytdhk:undefined, + }) if (this.state.login === "" || this.state.login.length === 0) { this.setState({ Phonenumberisnotco: "账号不能为空", Phonenumberisnotcobool: false, + Phonenumberisnotcosytdhk:undefined, dragOk: false, Whethertoverify: this.state.Whethertoverify === true ? false : true, }) @@ -502,6 +510,7 @@ class LoginRegisterComponent extends Component { this.setState({ Phonenumberisnotco: stringdata, Phonenumberisnotcobool: false, + Phonenumberisnotcosytdhk:undefined, dragOk:false, Whethertoverify: this.state.Whethertoverify === true ? false : true, }) @@ -509,6 +518,7 @@ class LoginRegisterComponent extends Component { this.setState({ Phonenumberisnotco: undefined, Phonenumberisnotcobool: true, + Phonenumberisnotcosytdhk:undefined, dragOk: true, }); diff --git a/public/react/src/modules/user/LoginRegisterComponent.js b/public/react/src/modules/user/LoginRegisterComponent.js index a54a5bb43..8da41e0e9 100644 --- a/public/react/src/modules/user/LoginRegisterComponent.js +++ b/public/react/src/modules/user/LoginRegisterComponent.js @@ -207,12 +207,15 @@ class LoginRegisterComponent extends Component { //是否验证通过 dragOkCallback = () => { debugger + this.setState({ + Phonenumberisnotcosytdhk:undefined, + }) if (this.state.logins.length === 0) { this.setState({ - Phonenumberisnotcos: undefined, - Phonenumberisnotcobool: false, - dragOk:true, - + Phonenumberisnotcos:"账号不能为空", + Phonenumberisnotcobool: true, + dragOk:false, + Whethertoverify:this.state.Whethertoverify===true?false:true, }) return; } @@ -373,21 +376,28 @@ class LoginRegisterComponent extends Component { // this.openNotification(`请同意服务协议条款`,2); // return; // } + if (this.state.logins === undefined || this.state.logins === ""||this.state.logins.length===0) { + this.setState({ + Phonenumberisnotcos:"账号不能为空", + Phonenumberisnotcobool: true, + dragOk:false, + Whethertoverify:this.state.Whethertoverify===true?false:true, + }) + return + } if(this.state.pciphone===true){ if (this.state.dragOk === false) { // this.openNotification(`请拖动滑块完成验证`,2); this.setState({ Phonenumberisnotcosytdhk:"请拖动滑块完成验证", + dragOk:false, + Whethertoverify:this.state.Whethertoverify===true?false:true, }) return } } - if (this.state.logins === undefined || this.state.logins === ""||this.state.logins.length===0) { - this.setState({ - Phonenumberisnotcos:"账号不能为空", - }) - return - } else if (this.state.codes === undefined || this.state.codes == ""||this.state.codes.length===0) { + + if (this.state.codes === undefined || this.state.codes == ""||this.state.codes.length===0) { // this.openNotification(`请输入验证码`,2); this.setState({ Phonenumberisnotcosyzm:"验证码不能为空", From 3ca4437ad657f83be16af30f65e6212845eb556e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Thu, 25 Jul 2019 18:01:44 +0800 Subject: [PATCH 41/58] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/react/src/modules/user/FindPasswordComponent.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/react/src/modules/user/FindPasswordComponent.js b/public/react/src/modules/user/FindPasswordComponent.js index 814fed4d3..6ee2a1de1 100644 --- a/public/react/src/modules/user/FindPasswordComponent.js +++ b/public/react/src/modules/user/FindPasswordComponent.js @@ -179,7 +179,7 @@ class LoginRegisterComponent extends Component { } //找回密码 Retrievepassword = () => { - if (this.state.Phonenumberisnotcobool === false) { + if (this.state.Phonenumberisnotcobool === false&&this.state.Phonenumberisnotco!==undefined) { this.openNotification(this.state.Phonenumberisnotco); this.setState({ Whethertoverify:this.state.Whethertoverify===true?false:true, From 7f5a50b7e017f563ffb29ba4e318ebf05295797c Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Thu, 25 Jul 2019 18:03:53 +0800 Subject: [PATCH 42/58] =?UTF-8?q?=E6=8F=90=E7=A4=BA=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/homework_commons_controller.rb | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/app/controllers/homework_commons_controller.rb b/app/controllers/homework_commons_controller.rb index 4c8d2a729..1641e98b9 100644 --- a/app/controllers/homework_commons_controller.rb +++ b/app/controllers/homework_commons_controller.rb @@ -540,7 +540,7 @@ class HomeworkCommonsController < ApplicationController tip_exception("补交结束时间必须晚于截止时间") if params[:late_time] <= strf_time(@homework.end_time) tip_exception("补交结束时间不能晚于课堂结束时间") if @course.end_date.present? && params[:late_time] > strf_time(@course.end_date.end_of_day) - tip_exception("迟交扣分应为正整数") if params[:late_penalty] && params[:late_penalty].to_i < 0 + tip_exception("迟交扣分不能小于0") if params[:late_penalty] && params[:late_penalty].to_i < 0 @homework.allow_late = true @homework.late_time = params[:late_time] @@ -560,7 +560,7 @@ class HomeworkCommonsController < ApplicationController tip_exception("缺少answer_open_evaluation参数") if params[:answer_open_evaluation].nil? tip_exception("缺少work_efficiency参数") if params[:work_efficiency].nil? tip_exception("缺少eff_score参数") if params[:work_efficiency] && params[:eff_score].blank? - tip_exception("效率分应为正整数") if params[:eff_score] && params[:eff_score].to_i < 0 + tip_exception("效率分不能小于等于0") if params[:eff_score] && params[:eff_score].to_i <= 0 tip_exception("缺少shixun_evaluation参数") if params[:shixun_evaluation].blank? tip_exception("缺少challenge_settings参数") if params[:challenge_settings].blank? # tip_exception("缺少challenge_id参数") if params[:challenge_settings][:challenge_id].blank? @@ -734,16 +734,16 @@ class HomeworkCommonsController < ApplicationController if !@homework_detail_manual.final_mode tip_exception("教师评分比例不能为空") if params[:te_proportion].blank? te_proportion = params[:te_proportion].to_f.round(2) - tip_exception("教师评分比例不能小于零") if te_proportion < 0 + tip_exception("教师评分比例不能小于0") if te_proportion < 0 tip_exception("助教评分比例不能为空") if params[:ta_proportion].blank? ta_proportion = params[:ta_proportion].to_f.round(2) - tip_exception("助教评分比例不能小于零") if ta_proportion < 0 + tip_exception("助教评分比例不能小于0") if ta_proportion < 0 if !@homework.anonymous_comment tip_exception("评分比例之和不能大于100") if (te_proportion + ta_proportion) > 1.0 else tip_exception("学生评分比例不能为空") if params[:st_proportion].blank? st_proportion = params[:st_proportion].to_f.round(2) - tip_exception("学生评分比例不能小于零") if st_proportion < 0 + tip_exception("学生评分比例不能小于0") if st_proportion < 0 tip_exception("评分比例之和不能大于100") if (te_proportion + ta_proportion + st_proportion) > 1.0 end From 1320b05bfbfee92b388156532291511a87e97138 Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Thu, 25 Jul 2019 18:04:00 +0800 Subject: [PATCH 43/58] 2.8; --- public/react/src/modules/user/account/AccountBasicEdit.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/react/src/modules/user/account/AccountBasicEdit.js b/public/react/src/modules/user/account/AccountBasicEdit.js index 24674a3ce..38c8fd98c 100644 --- a/public/react/src/modules/user/account/AccountBasicEdit.js +++ b/public/react/src/modules/user/account/AccountBasicEdit.js @@ -469,7 +469,7 @@ class AccountBasic extends Component { width:220px; } .basicForm .ant-input-suffix { - line-height: 2.2; + line-height: 2.8; background: transparent !important; } `} From b9347aa0ace774de38a4d77263016a64535d5123 Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Thu, 25 Jul 2019 18:08:08 +0800 Subject: [PATCH 44/58] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/courses_controller.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/courses_controller.rb b/app/controllers/courses_controller.rb index 230e7f387..b40321dd3 100644 --- a/app/controllers/courses_controller.rb +++ b/app/controllers/courses_controller.rb @@ -924,10 +924,10 @@ class CoursesController < ApplicationController course_message.save! - role = course_message.content == 2 ? '7' : '9' # 7:老师 9:助教 + role = course_message.content == 2 ? '7' : '9' # 7:助教 9:教师 ApplyTeacherRoleJoinCourseNotifyJob.perform_later(current_user.id, course.id, role) teacher_role = 1 - message = "#{course_message.content == 2 ? '教师' : '助教'}申请已提交,请等待审核" + message = "#{course_message.content == 2 ? '助教' : '教师'}申请已提交,请等待审核" end end end From 32637fba2c76b099794486858032f5effd94ef53 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, 25 Jul 2019 18:25:32 +0800 Subject: [PATCH 45/58] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/modules/courses/shixunHomework/Trainingjobsetting.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/public/react/src/modules/courses/shixunHomework/Trainingjobsetting.js b/public/react/src/modules/courses/shixunHomework/Trainingjobsetting.js index 3d1aecf5b..6511b6f0b 100644 --- a/public/react/src/modules/courses/shixunHomework/Trainingjobsetting.js +++ b/public/react/src/modules/courses/shixunHomework/Trainingjobsetting.js @@ -588,7 +588,7 @@ class Trainingjobsetting extends Component { late_time: moment(this.state.late_time).format('YYYY-MM-DD HH:mm'), //结束时间 answer_open_evaluation: this.state.level === "满分" ? true : false, //扣分项 work_efficiency: this.state.completionefficiencyscore, //完成效率评分占比 - eff_score: this.state.completionefficiencyscore === true ? this.state.latedeductiontwo : 0,//占比分 + eff_score: this.state.completionefficiencyscore === true ? this.state.latedeductiontwo : undefined,//占比分 shixun_evaluation: this.state.proportion === "均分比例" ? 0 : this.state.proportion === "经验值比例" ? 1 : this.state.proportion === "自定义分值" ? 2 : 0, challenge_settings: array, score_open: this.state.publicwork, @@ -604,7 +604,7 @@ class Trainingjobsetting extends Component { late_time: moment(this.state.late_time).format('YYYY-MM-DD HH:mm'), //结束时间 answer_open_evaluation: this.state.level === "满分" ? true : false, //扣分项 work_efficiency: this.state.completionefficiencyscore, //完成效率评分占比 - eff_score: this.state.completionefficiencyscore === true ? this.state.latedeductiontwo : 0,//占比分 + eff_score: this.state.completionefficiencyscore === true ? this.state.latedeductiontwo : undefined,//占比分 shixun_evaluation: this.state.proportion === "均分比例" ? 0 : this.state.proportion === "经验值比例" ? 1 : this.state.proportion === "自定义分值" ? 2 : 0, challenge_settings: array, score_open: this.state.publicwork, From 62b48f7713f1437a9dd06c9b13aaf667f7105fff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Thu, 25 Jul 2019 18:28:37 +0800 Subject: [PATCH 46/58] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/modules/user/FindPasswordComponent.js | 9 ++++---- .../modules/user/LoginRegisterComponent.js | 22 +++++++++++++------ 2 files changed, 19 insertions(+), 12 deletions(-) diff --git a/public/react/src/modules/user/FindPasswordComponent.js b/public/react/src/modules/user/FindPasswordComponent.js index 6ee2a1de1..3263f7327 100644 --- a/public/react/src/modules/user/FindPasswordComponent.js +++ b/public/react/src/modules/user/FindPasswordComponent.js @@ -31,7 +31,7 @@ class LoginRegisterComponent extends Component { seconds: 60, codes: "", getverificationcodes: true, - Phonenumberisnotcobool: false, + Phonenumberisnotcobool: true, Phonenumberisnotco: undefined, Phonenumberisnotcosytdhk:undefined, Phonenumberisnotcosmmm: undefined, @@ -508,11 +508,10 @@ class LoginRegisterComponent extends Component { if (!regph.test(this.state.login)) { stringdata = "手机号格式不正确"; this.setState({ - Phonenumberisnotco: stringdata, - Phonenumberisnotcobool: false, + Phonenumberisnotco: undefined, + Phonenumberisnotcobool: true, Phonenumberisnotcosytdhk:undefined, - dragOk:false, - Whethertoverify: this.state.Whethertoverify === true ? false : true, + dragOk: true, }) } else { this.setState({ diff --git a/public/react/src/modules/user/LoginRegisterComponent.js b/public/react/src/modules/user/LoginRegisterComponent.js index 8da41e0e9..ec9778fc8 100644 --- a/public/react/src/modules/user/LoginRegisterComponent.js +++ b/public/react/src/modules/user/LoginRegisterComponent.js @@ -206,7 +206,6 @@ class LoginRegisterComponent extends Component { } //是否验证通过 dragOkCallback = () => { - debugger this.setState({ Phonenumberisnotcosytdhk:undefined, }) @@ -217,6 +216,8 @@ class LoginRegisterComponent extends Component { dragOk:false, Whethertoverify:this.state.Whethertoverify===true?false:true, }) + console.log("s0"); + return; } // var telephone = $("#telephoneAdd.tianjia_phone").val(); @@ -229,11 +230,11 @@ class LoginRegisterComponent extends Component { if (!regph.test(this.state.logins)) { stringdata = "手机号格式不正确"; this.setState({ - Phonenumberisnotcos: stringdata, - Phonenumberisnotcobool: true, - dragOk:false, - Whethertoverify:this.state.Whethertoverify===true?false:true, + Phonenumberisnotcos: undefined, + Phonenumberisnotcobool: false, + dragOk:true, }) + console.log("s1"); } else { this.setState({ Phonenumberisnotcos: undefined, @@ -256,9 +257,12 @@ class LoginRegisterComponent extends Component { Phonenumberisnotcobool: true, dragOk:false, Whethertoverify:this.state.Whethertoverify===true?false:true, - }) + }); + console.log("s2"); + return } else { + console.log("s222222"); this.setState({ Phonenumberisnotcos: undefined, Phonenumberisnotcobool: false, @@ -492,6 +496,8 @@ class LoginRegisterComponent extends Component { dragOk:false, Whethertoverify:this.state.Whethertoverify===true?false:true, }) + console.log("s5"); + } return; } else if (id === 2) { @@ -501,7 +507,9 @@ class LoginRegisterComponent extends Component { dragOk:false, Whethertoverify:this.state.Whethertoverify===true?false:true, }) - return; + console.log("s6"); + + return; } }else { if (id === 1) { From 10a72d7ae957799cfe0136312bfe2b365514db8c Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Thu, 25 Jul 2019 18:33:17 +0800 Subject: [PATCH 47/58] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/courses_controller.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/controllers/courses_controller.rb b/app/controllers/courses_controller.rb index b40321dd3..778d40b81 100644 --- a/app/controllers/courses_controller.rb +++ b/app/controllers/courses_controller.rb @@ -928,6 +928,8 @@ class CoursesController < ApplicationController ApplyTeacherRoleJoinCourseNotifyJob.perform_later(current_user.id, course.id, role) teacher_role = 1 message = "#{course_message.content == 2 ? '助教' : '教师'}申请已提交,请等待审核" + else + message = "#{existing_course_message.extra.to_i == 7 ? '助教' : '教师'}申请已提交,请等待审核" end end end From a807df07ed8cbb80409bda1505964fbd7d3f8952 Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Thu, 25 Jul 2019 18:35:55 +0800 Subject: [PATCH 48/58] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/courses_controller.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/controllers/courses_controller.rb b/app/controllers/courses_controller.rb index 778d40b81..faad02173 100644 --- a/app/controllers/courses_controller.rb +++ b/app/controllers/courses_controller.rb @@ -914,7 +914,7 @@ class CoursesController < ApplicationController teacher_already_exist = current_user.teacher_of_course_non_active? course unless teacher_already_exist existing_course_message = CourseMessage.find_by(course_id: course.id, course_message_id: current_user.id, - course_message_type: "JoinCourseRequest", status: 0, viewed: false) + course_message_type: "JoinCourseRequest", status: 0) if existing_course_message.blank? course_message = CourseMessage.new(course_id: course.id, user_id: course.tea_id, status: 0, course_message_id: current_user.id, course_message_type: "JoinCourseRequest", @@ -929,7 +929,7 @@ class CoursesController < ApplicationController teacher_role = 1 message = "#{course_message.content == 2 ? '助教' : '教师'}申请已提交,请等待审核" else - message = "#{existing_course_message.extra.to_i == 7 ? '助教' : '教师'}申请已提交,请等待审核" + message = "#{existing_course_message.content == 2 ? '助教' : '教师'}申请已提交,请等待审核" end end end @@ -943,7 +943,7 @@ class CoursesController < ApplicationController end rescue => e uid_logger(e.message) - tip_exception("加入课堂失败") + tip_exception(e.message) raise ActiveRecord::Rollback end end From e6ba772da66eeb5af6ad74a630b702120c2e28d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Thu, 25 Jul 2019 18:50:13 +0800 Subject: [PATCH 49/58] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../courses/shixunHomework/Listofworksstudentone.js | 1 + .../modules/courses/shixunHomework/Trainingjobsetting.js | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js b/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js index 462ec541f..8bb2bbcfd 100644 --- a/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js +++ b/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js @@ -1017,6 +1017,7 @@ class Listofworksstudentone extends Component { view_report: result.data.view_report, allow_late:result.data.allow_late, loadingstate: false, + computeTimetype:true, }) this.seacthdatat(result.data,result.data.student_works,result.data.work_efficiency,result.data.course_group_info,1); diff --git a/public/react/src/modules/courses/shixunHomework/Trainingjobsetting.js b/public/react/src/modules/courses/shixunHomework/Trainingjobsetting.js index 6511b6f0b..61b043cea 100644 --- a/public/react/src/modules/courses/shixunHomework/Trainingjobsetting.js +++ b/public/react/src/modules/courses/shixunHomework/Trainingjobsetting.js @@ -1698,14 +1698,14 @@ class Trainingjobsetting extends Component { if(rules[i].course_group_id instanceof Array ){ datas.push({ group_id:rules[i].course_group_id, - publish_time: moment(rules[i].publish_time).format('YYYY-MM-DD HH:mm') , - end_time:moment(rules[i].end_time).format('YYYY-MM-DD HH:mm') , + publish_time:rules[i].publish_time===undefined||rules[i].publish_time===null||rules[i].publish_time===""?"": moment(rules[i].publish_time).format('YYYY-MM-DD HH:mm') , + end_time:rules[i].end_time===undefined||rules[i].end_time===null||rules[i].end_time===""?"": moment(rules[i].end_time).format('YYYY-MM-DD HH:mm') , }); }else { datas.push({ group_id:[rules[i].course_group_id], - publish_time: moment(rules[i].publish_time).format('YYYY-MM-DD HH:mm') , - end_time:moment(rules[i].end_time).format('YYYY-MM-DD HH:mm') , + publish_time: rules[i].publish_time===undefined||rules[i].publish_time===null||rules[i].publish_time===""?"": moment(rules[i].publish_time).format('YYYY-MM-DD HH:mm') , + end_time:rules[i].end_time===undefined||rules[i].end_time===null||rules[i].end_time===""?"": moment(rules[i].end_time).format('YYYY-MM-DD HH:mm') , }); } From 030e83ea10b3fd5e3cf76c8c87b4f6ed674d6a41 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Thu, 25 Jul 2019 18:52:16 +0800 Subject: [PATCH 50/58] =?UTF-8?q?=E7=94=B3=E8=AF=B7=E9=AB=98=E6=A0=A1?= =?UTF-8?q?=E5=85=81=E8=AE=B8=E5=AE=8C=E5=96=84=E8=B5=84=E6=96=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/add_school_applies_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/add_school_applies_controller.rb b/app/controllers/add_school_applies_controller.rb index 22b3d360a..e0a09665d 100644 --- a/app/controllers/add_school_applies_controller.rb +++ b/app/controllers/add_school_applies_controller.rb @@ -1,5 +1,5 @@ class AddSchoolAppliesController < ApplicationController - before_action :require_login, :check_auth + before_action :require_login def create school = CreateAddSchoolApplyService.call(current_user, create_params) From 0ed0caaa64b2538f7a9d6f2e5138a5606ad758f6 Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Thu, 25 Jul 2019 18:55:48 +0800 Subject: [PATCH 51/58] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/homework_commons_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/homework_commons_controller.rb b/app/controllers/homework_commons_controller.rb index 1641e98b9..f92ed8e2e 100644 --- a/app/controllers/homework_commons_controller.rb +++ b/app/controllers/homework_commons_controller.rb @@ -38,7 +38,7 @@ class HomeworkCommonsController < ApplicationController tip_exception("子目录id有误") if !@category.present? @homework_commons = @homework_commons.where(course_second_category_id: params[:category]) elsif @homework_type == 4 - @homework_commons = @homework_commons.where(course_second_category_id: 0) + @homework_commons = @homework_commons end @all_count = @homework_commons.size From 651399837f07ad7155c9cdae16e2fb670e3340c9 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, 25 Jul 2019 18:57:32 +0800 Subject: [PATCH 52/58] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../react/src/modules/courses/coursesDetail/CoursesLeftNav.js | 2 +- public/react/src/modules/paths/PathDetail/DetailCards.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/public/react/src/modules/courses/coursesDetail/CoursesLeftNav.js b/public/react/src/modules/courses/coursesDetail/CoursesLeftNav.js index 707c4ba9b..ad7172be5 100644 --- a/public/react/src/modules/courses/coursesDetail/CoursesLeftNav.js +++ b/public/react/src/modules/courses/coursesDetail/CoursesLeftNav.js @@ -505,7 +505,7 @@ class Coursesleftnav extends Component{ }else if(NavmodalValue.length>20){ this.setState({ NavmodalValuetype:true, - NavmodalValues:"名称不能超过20个字" + NavmodalValues:"名称不能超过60个字" }) return } diff --git a/public/react/src/modules/paths/PathDetail/DetailCards.js b/public/react/src/modules/paths/PathDetail/DetailCards.js index 0e95f1a48..fc75961ec 100644 --- a/public/react/src/modules/paths/PathDetail/DetailCards.js +++ b/public/react/src/modules/paths/PathDetail/DetailCards.js @@ -469,7 +469,7 @@ class DetailCards extends Component{ { showparagraphkey===key&&showparagraphindex===index?:"" } From d6be63011f7cb45b5e9b7c808f03d060fdfe88f5 Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Thu, 25 Jul 2019 18:59:18 +0800 Subject: [PATCH 53/58] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/helpers/courses_helper.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/helpers/courses_helper.rb b/app/helpers/courses_helper.rb index fa51de6b7..8c2aeb479 100644 --- a/app/helpers/courses_helper.rb +++ b/app/helpers/courses_helper.rb @@ -199,7 +199,8 @@ module CoursesHelper # 获取课堂的作业数 def get_homework_commons_count(course, type, category_id) - HomeworkCommon.where(course_id: course.id, homework_type: type, course_second_category_id: category_id).size + category_id == 0 ? HomeworkCommon.where(course_id: course.id, homework_type: type).size : + HomeworkCommon.where(course_id: course.id, homework_type: type, course_second_category_id: category_id).size end From d3de780bb4ec3f62f5ca9775546e5345f0d92f8a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Thu, 25 Jul 2019 19:39:08 +0800 Subject: [PATCH 54/58] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modules/courses/shixunHomework/Trainingjobsetting.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/public/react/src/modules/courses/shixunHomework/Trainingjobsetting.js b/public/react/src/modules/courses/shixunHomework/Trainingjobsetting.js index 61b043cea..6511b6f0b 100644 --- a/public/react/src/modules/courses/shixunHomework/Trainingjobsetting.js +++ b/public/react/src/modules/courses/shixunHomework/Trainingjobsetting.js @@ -1698,14 +1698,14 @@ class Trainingjobsetting extends Component { if(rules[i].course_group_id instanceof Array ){ datas.push({ group_id:rules[i].course_group_id, - publish_time:rules[i].publish_time===undefined||rules[i].publish_time===null||rules[i].publish_time===""?"": moment(rules[i].publish_time).format('YYYY-MM-DD HH:mm') , - end_time:rules[i].end_time===undefined||rules[i].end_time===null||rules[i].end_time===""?"": moment(rules[i].end_time).format('YYYY-MM-DD HH:mm') , + publish_time: moment(rules[i].publish_time).format('YYYY-MM-DD HH:mm') , + end_time:moment(rules[i].end_time).format('YYYY-MM-DD HH:mm') , }); }else { datas.push({ group_id:[rules[i].course_group_id], - publish_time: rules[i].publish_time===undefined||rules[i].publish_time===null||rules[i].publish_time===""?"": moment(rules[i].publish_time).format('YYYY-MM-DD HH:mm') , - end_time:rules[i].end_time===undefined||rules[i].end_time===null||rules[i].end_time===""?"": moment(rules[i].end_time).format('YYYY-MM-DD HH:mm') , + publish_time: moment(rules[i].publish_time).format('YYYY-MM-DD HH:mm') , + end_time:moment(rules[i].end_time).format('YYYY-MM-DD HH:mm') , }); } From a18caf2525866f26bf5d290610399a34945160b3 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, 25 Jul 2019 19:39:28 +0800 Subject: [PATCH 55/58] =?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/Trainingjobsetting.js | 24 ++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/public/react/src/modules/courses/shixunHomework/Trainingjobsetting.js b/public/react/src/modules/courses/shixunHomework/Trainingjobsetting.js index 61b043cea..77e743eb8 100644 --- a/public/react/src/modules/courses/shixunHomework/Trainingjobsetting.js +++ b/public/react/src/modules/courses/shixunHomework/Trainingjobsetting.js @@ -577,6 +577,8 @@ class Trainingjobsetting extends Component { this.props.showNotification(`没有关卡不能更新设置`); return; } + + if(this.state.unifiedsetting === true){ console.log("统一设置"); data = { @@ -594,11 +596,27 @@ class Trainingjobsetting extends Component { score_open: this.state.publicwork, } }else{ - //非统一配置 - console.log("非统一设置"); + // //非统一配置 + // console.log("非统一设置"); + // let rulesdata=this.state.rulesdata; + // + // rulesdata.map((item,key)=>{ + // + // if(item.publish_time==="Invalid date"){ + // item.publish_time="" + // } + // if(item.end_time==="Invalid date"){ + // item.end_time="" + // } + // if(item.publiend_timesh_time==="Invalid date"){ + // item.publiend_timesh_time="" + // } + // }) + // + let {rules}=this.state; data = { unified_setting: this.state.unifiedsetting, //非统一配置 - group_settings: this.state.rulesdata, + group_settings: rules, allow_late: this.state.allowreplenishment, //补交 late_penalty: parseInt(this.state.latededuction), //迟交扣分 late_time: moment(this.state.late_time).format('YYYY-MM-DD HH:mm'), //结束时间 From e1012754927063093f565d695ac669649d1931d1 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, 25 Jul 2019 19:52:53 +0800 Subject: [PATCH 56/58] b --- .../courses/shixunHomework/Trainingjobsetting.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/public/react/src/modules/courses/shixunHomework/Trainingjobsetting.js b/public/react/src/modules/courses/shixunHomework/Trainingjobsetting.js index f25644f95..b95adcaf2 100644 --- a/public/react/src/modules/courses/shixunHomework/Trainingjobsetting.js +++ b/public/react/src/modules/courses/shixunHomework/Trainingjobsetting.js @@ -196,8 +196,8 @@ class Trainingjobsetting extends Component { array.push({ course_group_id: result.data.group_settings[i].group_id, course_group_name: result.data.group_settings[i].group_name, - publish_time: result.data.group_settings[i].publish_time, - end_time: result.data.group_settings[i].end_time, + publish_time: moment(result.data.group_settings[i].publish_time).format('YYYY-MM-DD HH:mm'), + end_time: moment(result.data.group_settings[i].end_time).format('YYYY-MM-DD HH:mm'), publish_flag: "", end_flag: "", class_flag: "", @@ -215,8 +215,8 @@ class Trainingjobsetting extends Component { arrays.push({ course_group_id:result.data.group_settings[i].group_id, course_group_name:result.data.group_settings[i].group_name, - publish_time:result.data.group_settings[i].publish_time, - end_time:result.data.group_settings[i].end_time, + publish_time:moment( result.data.group_settings[i].publish_time).format('YYYY-MM-DD HH:mm') , + end_time:moment(result.data.group_settings[i].end_time ).format('YYYY-MM-DD HH:mm'), course_choosed:0, }) @@ -612,7 +612,7 @@ class Trainingjobsetting extends Component { // item.publiend_timesh_time="" // } // }) - // + let {rules}=this.state; data = { unified_setting: this.state.unifiedsetting, //非统一配置 From c1646797bdfe0d0b56b098cb4475c7abdde457b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Thu, 25 Jul 2019 19:55:34 +0800 Subject: [PATCH 57/58] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modules/courses/shixunHomework/Trainingjobsetting.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/public/react/src/modules/courses/shixunHomework/Trainingjobsetting.js b/public/react/src/modules/courses/shixunHomework/Trainingjobsetting.js index f25644f95..2d41bacc6 100644 --- a/public/react/src/modules/courses/shixunHomework/Trainingjobsetting.js +++ b/public/react/src/modules/courses/shixunHomework/Trainingjobsetting.js @@ -447,8 +447,8 @@ class Trainingjobsetting extends Component { } else { let rulesdata=this.state.rulesdata; - // console.log("pustdate123131312321321321"); - // console.log(rulesdata); + console.log("pustdate123131312321321321"); + console.log(rulesdata); if( rulesdata.length === 0){ this.props.showNotification(`分班发布设置不能为空`); @@ -614,6 +614,7 @@ class Trainingjobsetting extends Component { // }) // let {rules}=this.state; + var mydatas=[]; data = { unified_setting: this.state.unifiedsetting, //非统一配置 group_settings: rules, @@ -1728,8 +1729,8 @@ class Trainingjobsetting extends Component { } } - console.log(rules) - console.log(datas) + console.log(rules); + console.log(datas); this.setState({ rules, rulesdata:datas, From eaff51442161e0cee7c02b2f29aee9beede72c18 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Thu, 25 Jul 2019 20:26:38 +0800 Subject: [PATCH 58/58] =?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/Trainingjobsetting.js | 33 +++++++++---------- 1 file changed, 15 insertions(+), 18 deletions(-) diff --git a/public/react/src/modules/courses/shixunHomework/Trainingjobsetting.js b/public/react/src/modules/courses/shixunHomework/Trainingjobsetting.js index 8b0a6bf23..b07392153 100644 --- a/public/react/src/modules/courses/shixunHomework/Trainingjobsetting.js +++ b/public/react/src/modules/courses/shixunHomework/Trainingjobsetting.js @@ -598,26 +598,23 @@ class Trainingjobsetting extends Component { }else{ // //非统一配置 // console.log("非统一设置"); - // let rulesdata=this.state.rulesdata; - // - // rulesdata.map((item,key)=>{ - // - // if(item.publish_time==="Invalid date"){ - // item.publish_time="" - // } - // if(item.end_time==="Invalid date"){ - // item.end_time="" - // } - // if(item.publiend_timesh_time==="Invalid date"){ - // item.publiend_timesh_time="" - // } - // }) - - let {rules}=this.state; - var mydatas=[]; + let rulesdata=this.state.rulesdata; + + let newlist=[] + + rulesdata.map((item,key)=>{ + + if(item.publish_time==="Invalid date"||item.end_time==="Invalid date"||item.publiend_timesh_time==="Invalid date"){ + + }else{ + newlist.push(item) + } + + }) + data = { unified_setting: this.state.unifiedsetting, //非统一配置 - group_settings: rules, + group_settings: newlist, allow_late: this.state.allowreplenishment, //补交 late_penalty: parseInt(this.state.latededuction), //迟交扣分 late_time: moment(this.state.late_time).format('YYYY-MM-DD HH:mm'), //结束时间