From 2434161fbd268d91170fde6c4ca5749a2e52d0c4 Mon Sep 17 00:00:00 2001 From: p31729568 Date: Thu, 26 Sep 2019 17:10:26 +0800 Subject: [PATCH 1/6] ecs: fix --- .../ecs/subitem_support_standards_controller.rb | 8 ++++---- .../ecs/subitem_support_standards/show.json.jbuilder | 7 ++++++- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/app/controllers/ecs/subitem_support_standards_controller.rb b/app/controllers/ecs/subitem_support_standards_controller.rb index f718fb5f7..cb5870892 100644 --- a/app/controllers/ecs/subitem_support_standards_controller.rb +++ b/app/controllers/ecs/subitem_support_standards_controller.rb @@ -4,7 +4,7 @@ class Ecs::SubitemSupportStandardsController < Ecs::BaseController def show @graduation_standards = EcGraduationStandard.all - @graduation_subitems = current_year.ec_graduation_subitems + @graduation_subitems = current_year.ec_graduation_subitems.includes(:ec_graduation_requirement) ids = @graduation_subitems.map(&:id) @subitem_support_standards = EcRequireSubVsStandard.where(ec_graduation_subitem_id: ids, status: true) @@ -36,18 +36,18 @@ class Ecs::SubitemSupportStandardsController < Ecs::BaseController private def check_record_exists! - unless current_year.ec_graduation_subitems.exists?(id: params[:graduation_subitem_id]) + unless current_year.ec_graduation_subitems.exists?(id: params[:ec_graduation_subitem_id]) render_not_found return end - unless EcGraduationStandard.exists?(id: params[:graduation_standard_id]) + unless EcGraduationStandard.exists?(id: params[:ec_graduation_standard_id]) render_not_found return end end def permit_params - params.require(%i[graduation_subitem_id graduation_standard_id]) + params.permit(%i[ec_graduation_subitem_id ec_graduation_standard_id]) end end \ No newline at end of file diff --git a/app/views/ecs/subitem_support_standards/show.json.jbuilder b/app/views/ecs/subitem_support_standards/show.json.jbuilder index a92fe7000..ca4bd59f2 100644 --- a/app/views/ecs/subitem_support_standards/show.json.jbuilder +++ b/app/views/ecs/subitem_support_standards/show.json.jbuilder @@ -1,4 +1,9 @@ json.graduation_standards @graduation_standards, partial: 'ecs/shared/ec_graduation_standard', as: :ec_graduation_standard -json.graduation_subitems @graduation_subitems, partial: 'ecs/shared/ec_graduation_subitem', as: :ec_graduation_subitem +json.graduation_subitems do + json.array! @graduation_subitems do |graduation_subitem| + json.partial! 'ecs/shared/ec_graduation_subitem', ec_graduation_subitem: graduation_subitem + json.graduation_requirement_position graduation_subitem.ec_graduation_requirement.position + end +end json.subitem_support_standards @subitem_support_standards, partial: 'ecs/subitem_support_standards/shared/subitem_support_standard', as: :subitem_support_standard From ca03e891b146a03d22a974db0f5b8387cf2c485a Mon Sep 17 00:00:00 2001 From: p31729568 Date: Thu, 26 Sep 2019 17:18:24 +0800 Subject: [PATCH 2/6] admin: fix user edit --- app/services/admins/update_user_service.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/services/admins/update_user_service.rb b/app/services/admins/update_user_service.rb index c4755a1ae..41b5065d0 100644 --- a/app/services/admins/update_user_service.rb +++ b/app/services/admins/update_user_service.rb @@ -10,6 +10,8 @@ class Admins::UpdateUserService < ApplicationService def call user.assign_attributes(user_attributes) + user.mail = params[:mail].to_s.presence + user.phone = params[:phone].to_s.presence user.firstname = '' user.password = params[:password] if params[:password].present? From deeb7703ed576ea8630653e3bdb5a8893592dcbd Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Thu, 26 Sep 2019 17:24:52 +0800 Subject: [PATCH 3/6] =?UTF-8?q?=E6=AF=95=E8=AE=BE=E4=BB=BB=E5=8A=A1?= =?UTF-8?q?=E7=AB=8B=E5=8D=B3=E5=8F=91=E5=B8=83=E5=90=8E=E5=8F=98=E6=88=90?= =?UTF-8?q?=E4=BA=86=E4=BA=A4=E5=8F=89=E8=AF=84=E9=98=85=E7=9A=84=E7=8A=B6?= =?UTF-8?q?=E6=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/graduation_tasks_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/graduation_tasks_controller.rb b/app/controllers/graduation_tasks_controller.rb index de48f9fdb..ecde1eef5 100644 --- a/app/controllers/graduation_tasks_controller.rb +++ b/app/controllers/graduation_tasks_controller.rb @@ -360,7 +360,7 @@ class GraduationTasksController < ApplicationController tasks.each do |task| task.end_time = Time.now - task.status = task.allow_late ? 2 : 3 + task.status = 2 task.save! end normal_status(0, "更新成功") From 3131ff9b531c12cc6de0e44cfc602b7e7ee5cf6b Mon Sep 17 00:00:00 2001 From: p31729568 Date: Thu, 26 Sep 2019 17:25:32 +0800 Subject: [PATCH 4/6] admin: fix edit user autocomplete --- app/views/admins/users/edit.html.erb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/views/admins/users/edit.html.erb b/app/views/admins/users/edit.html.erb index 22ac1f18e..abb003cbc 100644 --- a/app/views/admins/users/edit.html.erb +++ b/app/views/admins/users/edit.html.erb @@ -74,7 +74,7 @@
<%= f.input :mail, as: :email, label: '邮箱地址', wrapper_html: { class: 'col-md-3' }, input_html: { class: 'col-sm-11' } %> - <%= f.input :phone, as: :tel, label: '手机号', wrapper_html: { class: 'col-md-3' }, input_html: { class: 'col-sm-11' } %> + <%= f.input :phone, as: :tel, label: '手机号', wrapper_html: { class: 'col-md-3' }, input_html: { class: 'col-sm-11', autocomplete: 'off' } %>
@@ -124,8 +124,8 @@
- <%= f.input :password, as: :password, label: '修改密码', wrapper_html: { class: 'col-md-3' }, input_html: { class: 'col-sm-11' } %> - <%= f.input :password_confirmation, as: :password, label: '确认密码', wrapper_html: { class: 'col-md-3' }, input_html: { class: 'col-sm-11' } %> + <%= f.input :password, as: :password, label: '修改密码', wrapper_html: { class: 'col-md-3' }, input_html: { class: 'col-sm-11', autocomplete: 'new-password' } %> + <%= f.input :password_confirmation, as: :password, label: '确认密码', wrapper_html: { class: 'col-md-3' }, input_html: { class: 'col-sm-11', autocomplete: 'new-password' } %>
From 05b4bf893afc6793f820117e395314ef7347b72f 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, 26 Sep 2019 17:26:15 +0800 Subject: [PATCH 5/6] =?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/graduation/tasks/index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/public/react/src/modules/courses/graduation/tasks/index.js b/public/react/src/modules/courses/graduation/tasks/index.js index 4a7ee9710..49307c6fd 100644 --- a/public/react/src/modules/courses/graduation/tasks/index.js +++ b/public/react/src/modules/courses/graduation/tasks/index.js @@ -612,7 +612,7 @@ class GraduationTasks extends Component{ const category_id=this.props.match.params.Id; const graduationId=this.props.match.params.graduationId; // console.log(this.props.isCourseidentity()===isNotMember) - // console.log(category_id) + console.log(checkBoxValues) return( {/*提示*/} @@ -710,7 +710,7 @@ class GraduationTasks extends Component{ {this.props.isAdmin()?all_count===undefined?'' :all_count===0?"":
- 已选 {checkBoxValues.length} 个 (不支持跨页勾选) + 已选 {checkBoxValues===undefined?0:checkBoxValues.length} 个 (不支持跨页勾选)
  • 删除
  • From 97fe089a725f5c691bb01230f7bd9b923ac6600a 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, 26 Sep 2019 17:28:31 +0800 Subject: [PATCH 6/6] =?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/graduation/tasks/index.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/public/react/src/modules/courses/graduation/tasks/index.js b/public/react/src/modules/courses/graduation/tasks/index.js index 49307c6fd..f33614e76 100644 --- a/public/react/src/modules/courses/graduation/tasks/index.js +++ b/public/react/src/modules/courses/graduation/tasks/index.js @@ -129,7 +129,7 @@ class GraduationTasks extends Component{ let {checkBoxValues,checkAllValue}=this.state; if(checkAllValue===false){ - if(checkBoxValues.length===0){ + if(checkBoxValues.length===0||checkAllValue===undefined){ return true } } @@ -612,7 +612,6 @@ class GraduationTasks extends Component{ const category_id=this.props.match.params.Id; const graduationId=this.props.match.params.graduationId; // console.log(this.props.isCourseidentity()===isNotMember) - console.log(checkBoxValues) return( {/*提示*/} @@ -737,7 +736,7 @@ class GraduationTasks extends Component{ border-radius: 2px; } `} - + { tasks&&tasks.map((item, index) => { // console.log(item) return (