From 5650ef7b156e5fa44530049bf856be3b3a05d5f2 Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Tue, 8 Oct 2019 14:30:23 +0800 Subject: [PATCH 01/13] checkAllValue --- public/react/src/modules/courses/members/studentsList.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/public/react/src/modules/courses/members/studentsList.js b/public/react/src/modules/courses/members/studentsList.js index 5496dda01..a30f63464 100644 --- a/public/react/src/modules/courses/members/studentsList.js +++ b/public/react/src/modules/courses/members/studentsList.js @@ -302,7 +302,8 @@ class studentsList extends Component{ } componentDidUpdate(prevProps) { if (prevProps.match.params.course_group_id != this.props.match.params.course_group_id) { - this.setState({checkBoxValues: []}) + this.setState({checkBoxValues: [], checkAllValue: false }) + this.fetchAll(1) } // 加载了2次 From b66f5a67ad77e21e7da2d80cb2745403db3b48d9 Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Tue, 8 Oct 2019 14:40:22 +0800 Subject: [PATCH 02/13] duration: 2, --- 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 bc7fa8070..5efab1ac2 100644 --- a/public/react/src/AppConfig.js +++ b/public/react/src/AppConfig.js @@ -212,7 +212,7 @@ function initOnlineOfflineListener() { $(window).bind("online", () => { notification.destroy() notification.success({ - duration: null, + duration: 2, message: '网络恢复正常', description: '网络恢复正常,感谢使用。', From e1c730d1e367f63a35ef3ac537e65dcbc67317dc Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Tue, 8 Oct 2019 16:10:53 +0800 Subject: [PATCH 03/13] tab --- public/react/src/modules/courses/busyWork/commonWork.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/public/react/src/modules/courses/busyWork/commonWork.js b/public/react/src/modules/courses/busyWork/commonWork.js index f8042d476..f6a989354 100644 --- a/public/react/src/modules/courses/busyWork/commonWork.js +++ b/public/react/src/modules/courses/busyWork/commonWork.js @@ -33,6 +33,7 @@ class commonWork extends Component{ modalsBottomval:"", modalCancel:"", mainList:undefined, + selectedKeys: 'all', order:"", page:1, search:"", @@ -77,7 +78,9 @@ class commonWork extends Component{ componentDidUpdate(prevProps, prevState) { if (prevProps.match.path != this.props.match.path) { this.clearSelection() - this._getList() + this.setState({ selectedKeys: 'all', order: '' }, () => { + this._getList() + }) } } @@ -143,6 +146,7 @@ class commonWork extends Component{ this.clearSelection() this.setState({ order:e.key==="all"?"":e.key, + selectedKeys: e.key, page:1, isSpin:true, checkBoxValues:[], @@ -403,7 +407,7 @@ class commonWork extends Component{ } secondRowBotton={
- + 全部 {isAdmin && 未发布} 提交中 From 2424509691c6a077496242b406bbe2c106ae00c5 Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Wed, 9 Oct 2019 09:31:59 +0800 Subject: [PATCH 04/13] =?UTF-8?q?=E5=AD=A6=E7=94=9F=E8=BA=AB=E4=BB=BD?= =?UTF-8?q?=E6=9F=A5=E7=9C=8B=E8=AF=95=E5=8D=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/models/exercise.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/exercise.rb b/app/models/exercise.rb index 825f7cd9f..8469d25b6 100644 --- a/app/models/exercise.rb +++ b/app/models/exercise.rb @@ -131,7 +131,7 @@ class Exercise < ApplicationRecord status = 4 else if user.present? && user.student_of_course?(course) #当为学生的时候,需根据分班来判断试卷状态 - ex_time = get_exercise_times(user_id,false) + ex_time = get_exercise_times(user.id,false) pb_time = ex_time[:publish_time] ed_time = ex_time[:end_time] if pb_time.present? && ed_time.present? && pb_time <= Time.now && ed_time > Time.now From 252a2258bf5da7ba93abcf0c0f061e441017df41 Mon Sep 17 00:00:00 2001 From: p31729568 Date: Wed, 9 Oct 2019 09:38:53 +0800 Subject: [PATCH 05/13] ec: modify api --- .../course_achievement_methods_controller.rb | 8 ++- .../wechats/js_sdk_signatures_controller.rb | 2 +- app/libs/util/wechat.rb | 56 ++------------- app/libs/util/wechat_store.rb | 72 +++++++++++++++++++ app/models/ec_course.rb | 2 +- app/models/ec_course_evaluation.rb | 19 +++++ ...reate_course_achievement_method_service.rb | 18 ++--- ...ec_course_achievement_method.json.jbuilder | 2 + .../course_evaluations/slimmer.json.jbuilder | 8 ++- 9 files changed, 121 insertions(+), 66 deletions(-) create mode 100644 app/libs/util/wechat_store.rb diff --git a/app/controllers/ecs/course_achievement_methods_controller.rb b/app/controllers/ecs/course_achievement_methods_controller.rb index 389169258..62d609ea7 100644 --- a/app/controllers/ecs/course_achievement_methods_controller.rb +++ b/app/controllers/ecs/course_achievement_methods_controller.rb @@ -5,13 +5,17 @@ class Ecs::CourseAchievementMethodsController < Ecs::CourseBaseController end def create - @course_target = Ecs::CreateCourseAchievementMethodsService.call(current_course_target, create_params) + Ecs::CreateCourseAchievementMethodsService.call(current_course_target, create_params) + render_ok end private def create_params - params.permit(course_achievement_methods: %i[id course_evaluation_id course_evaluation_subitem_ids score percentage]) + params.permit(course_achievement_methods: [ + :id, :course_evaluation_id, :score, :percentage, + course_evaluation_relates: %i[:subitem_id position] + ]) end def current_course_target diff --git a/app/controllers/wechats/js_sdk_signatures_controller.rb b/app/controllers/wechats/js_sdk_signatures_controller.rb index 0b66cc263..f6a01b0e2 100644 --- a/app/controllers/wechats/js_sdk_signatures_controller.rb +++ b/app/controllers/wechats/js_sdk_signatures_controller.rb @@ -5,7 +5,7 @@ class Wechats::JsSdkSignaturesController < ApplicationController signature = Util::Wechat.js_sdk_signature(params[:url], noncestr, timestamp) render_ok(appid: Util::Wechat.appid, timestamp: timestamp, noncestr: noncestr, signature: signature) - rescue Util::Wechat::Error => ex + rescue Util::WechatStore::Error => ex render_error(ex.message) end end \ No newline at end of file diff --git a/app/libs/util/wechat.rb b/app/libs/util/wechat.rb index 1b064ba94..cb7b9044d 100644 --- a/app/libs/util/wechat.rb +++ b/app/libs/util/wechat.rb @@ -13,63 +13,15 @@ module Util::Wechat end def access_token - # 7200s 有效时间 - Rails.cache.fetch(access_token_cache_key, expires_in: 100.minutes) do - result = request(:get, '/cgi-bin/token', appid: appid, secret: secret, grant_type: 'client_credential') - result['access_token'] - end - end - - def refresh_access_token - Rails.cache.delete(access_token_cache_key) - access_token + wechat_store.access_token end def jsapi_ticket - # 7200s 有效时间 - Rails.cache.fetch(jsapi_ticket_cache_key, expires_in: 100.minutes) do - result = request(:get, '/cgi-bin/ticket/getticket', access_token: access_token, type: 'jsapi') - result['ticket'] - end - end - - def refresh_jsapi_ticket - Rails.cache.delete(jsapi_ticket_cache_key) - jsapi_ticket - end - - def access_token_cache_key - "#{base_cache_key}/access_token" - end - - def jsapi_ticket_cache_key - "#{base_cache_key}/jsapi_ticket" + wechat_store.jsapi_ticket end - def base_cache_key - "wechat/#{appid}" - end - - private - - def request(method, url, **params) - Rails.logger.error("[wechat] request: #{method} #{url} #{params.inspect}") - - client = Faraday.new(url: BASE_SITE) - response = client.public_send(method, url, params) - result = JSON.parse(response.body) - - Rails.logger.error("[wechat] response:#{response.status} #{result.inspect}") - - if response.status != 200 - raise Error, result.inspect - end - - if result['errcode'].present? && result['errcode'].to_i.nonzero? - raise Error, result.inspect - end - - result + def wechat_store + @_wechat_store ||= ::Util::WechatStore.new(appid, secret) end end end \ No newline at end of file diff --git a/app/libs/util/wechat_store.rb b/app/libs/util/wechat_store.rb new file mode 100644 index 000000000..a6f3ac76a --- /dev/null +++ b/app/libs/util/wechat_store.rb @@ -0,0 +1,72 @@ +class Util::WechatStore + BASE_SITE = 'https://api.weixin.qq.com'.freeze + + Error = Class.new(StandardError) + + attr_reader :appid, :secret + + def initialize(appid, secret) + @appid = appid + @secret = secret + end + + def access_token + # 7200s 有效时间 + Rails.cache.fetch(access_token_cache_key, expires_in: 100.minutes) do + result = request(:get, '/cgi-bin/token', appid: appid, secret: secret, grant_type: 'client_credential') + result['access_token'] + end + end + + def refresh_access_token + Rails.cache.delete(access_token_cache_key) + access_token + end + + def jsapi_ticket + # 7200s 有效时间 + Rails.cache.fetch(jsapi_ticket_cache_key, expires_in: 100.minutes) do + result = request(:get, '/cgi-bin/ticket/getticket', access_token: access_token, type: 'jsapi') + result['ticket'] + end + end + + def refresh_jsapi_ticket + Rails.cache.delete(jsapi_ticket_cache_key) + jsapi_ticket + end + + def access_token_cache_key + "#{base_cache_key}/access_token" + end + + def jsapi_ticket_cache_key + "#{base_cache_key}/jsapi_ticket" + end + + def base_cache_key + "wechat/#{appid}" + end + + private + + def request(method, url, **params) + Rails.logger.error("[wechat] request: #{method} #{url} #{params.inspect}") + + client = Faraday.new(url: BASE_SITE) + response = client.public_send(method, url, params) + result = JSON.parse(response.body) + + Rails.logger.error("[wechat] response:#{response.status} #{result.inspect}") + + if response.status != 200 + raise Error, result.inspect + end + + if result['errcode'].present? && result['errcode'].to_i.nonzero? + raise Error, result.inspect + end + + result + end +end \ No newline at end of file diff --git a/app/models/ec_course.rb b/app/models/ec_course.rb index 6f5480ea8..4e7202f05 100644 --- a/app/models/ec_course.rb +++ b/app/models/ec_course.rb @@ -6,7 +6,7 @@ class EcCourse < ApplicationRecord has_many :ec_graduation_subitem_course_targets, through: :ec_course_targets # 课程负责教师 has_many :ec_course_users - has_many :course_managers, through: :ec_course_users, class_name: 'User' + has_many :course_managers, through: :ec_course_users, source: :user # 课程考核标准 has_many :ec_course_evaluations, dependent: :destroy # 课程等级 diff --git a/app/models/ec_course_evaluation.rb b/app/models/ec_course_evaluation.rb index e96f1c98b..40fd10dfa 100644 --- a/app/models/ec_course_evaluation.rb +++ b/app/models/ec_course_evaluation.rb @@ -16,4 +16,23 @@ class EcCourseEvaluation < ApplicationRecord def imported? import_status? end + + def evaluation_relates + # 总成绩支撑只有课程考核标准的名称, 分项成绩支撑是课程考核标准名称与考核分项的笛卡尔积 + if status == 1 + return evaluation_count.times.map { |index| { id: -1, name: "#{name}(#{index + 1})", position: index + 1 } } + end + + if is_course_type? + ec_course_evaluation_subitems.map.with_index { |item, index| { id: item.id, name: item.name, position: index + 1 } } + else + data = [] + ec_course_evaluation_subitems.each do |item| + evaluation_count.times do |i| + data << { id: item.id, name: "#{name}(#{i + 1})#{item.name}", position: i + 1 } + end + end + data + end + end end diff --git a/app/services/ecs/create_course_achievement_method_service.rb b/app/services/ecs/create_course_achievement_method_service.rb index 01f09ff2b..0c086631f 100644 --- a/app/services/ecs/create_course_achievement_method_service.rb +++ b/app/services/ecs/create_course_achievement_method_service.rb @@ -31,8 +31,8 @@ class Ecs::CreateCourseAchievementMethodsService < ApplicationService # 创建新的评价方法时,全部为新建 if item[:id].blank? || course_target.ec_course_achievement_methods.find_by(id: item[:id]).blank? item[:ec_achievement_evaluation_relates_attributes] = - Array(*item[:course_evaluation_subitem_ids]).uniq.map do |subitem_id| - { ec_course_evaluation_subitem_id: subitem_id.to_i } + item[:course_evaluation_relates].map do |relate| + { ec_course_evaluation_subitem_id: relate[:subitem_id].to_i, position: relate[:position] } end return end @@ -41,22 +41,22 @@ class Ecs::CreateCourseAchievementMethodsService < ApplicationService relates = achievement_method.ec_achievement_evaluation_relates # 获取传入的 subitem id数组和已存在的 subitem id数组 - old_subitem_ids = relates.map(&:ec_course_evaluation_subitem_id).uniq - new_subitem_ids = Array(*item[:course_evaluation_subitem_ids]).map(&:to_i).uniq + old_data = relates.map { |e| [e.ec_course_evaluation_subitem_id, e.position] } + new_data = item[:course_evaluation_relates].map { |e| [e[:subitem_id, e[:position]]] } # 分别得到需要移除的 subitem ID数组和需要创建的 subitem ID数组 - destroy_subitem_ids = old_subitem_ids - new_subitem_ids - create_subitem_ids = new_subitem_ids - old_subitem_ids + destroy_data = old_data - new_data + create_data = new_data - old_data # 生成需要创建关系的 subitem id 数据 - create_attributes = create_subitem_ids.map { |item_id| { ec_course_evaluation_subitem_id: item_id } } + create_attributes = create_data.map { |arr| { ec_course_evaluation_subitem_id: arr[0], position: arr[1] } } # 处理需要更新或者删除的记录 exists_attributes = relates.map do |relate| - if destroy_subitem_ids.include?(relate.ec_course_evaluation_subitem_id) + if destroy_data.include?([relate.ec_course_evaluation_subitem_id, relate.position]) { id: relate.id, _destroy: true } else - relate.as_json(only: %i[id ec_course_evaluation_subitem_id ec_course_achievement_method_id]) + relate.as_json(only: %i[id ec_course_evaluation_subitem_id ec_course_achievement_method_id position]) end end diff --git a/app/views/ecs/course_achievement_methods/shared/_ec_course_achievement_method.json.jbuilder b/app/views/ecs/course_achievement_methods/shared/_ec_course_achievement_method.json.jbuilder index 5cc3220a4..868e7822c 100644 --- a/app/views/ecs/course_achievement_methods/shared/_ec_course_achievement_method.json.jbuilder +++ b/app/views/ecs/course_achievement_methods/shared/_ec_course_achievement_method.json.jbuilder @@ -7,3 +7,5 @@ end json.course_evaluation_subitems ec_course_achievement_method.ec_course_evaluation_subitems, partial: 'ecs/shared/ec_course_evaluation_subitem', as: :ec_course_evaluation_subitem + +json.course_evaluation_relates ec_course_achievement_method.ec_course_evaluation.evaluation_relates diff --git a/app/views/ecs/course_evaluations/slimmer.json.jbuilder b/app/views/ecs/course_evaluations/slimmer.json.jbuilder index 6e0faef3e..1f4dc0cc0 100644 --- a/app/views/ecs/course_evaluations/slimmer.json.jbuilder +++ b/app/views/ecs/course_evaluations/slimmer.json.jbuilder @@ -1 +1,7 @@ -json.course_evaluations @course_evaluations, partial: 'ecs/course_evaluations/shared/ec_course_evaluation_slim', as: :ec_course_evaluation +json.course_evaluations do + json.array! @course_evaluations do |course_evaluation| + json.partial! 'ecs/course_evaluations/shared/ec_course_evaluation_slim', ec_course_evaluation: course_evaluation + + json.evaluation_relates course_evaluation.evaluation_relates + end +end \ No newline at end of file From 05a0e4f8326e8b9309c6dd24363f790edd67a9ef Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Wed, 9 Oct 2019 10:00:38 +0800 Subject: [PATCH 06/13] =?UTF-8?q?=E8=AF=95=E5=8D=B7=E5=88=97=E8=A1=A8?= =?UTF-8?q?=E7=9A=84=E6=98=BE=E7=A4=BA=EF=BC=88=E5=AD=A6=E7=94=9F=E8=BA=AB?= =?UTF-8?q?=E4=BB=BD=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/exercises_controller.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/exercises_controller.rb b/app/controllers/exercises_controller.rb index f2e8508f0..cfe72effc 100644 --- a/app/controllers/exercises_controller.rb +++ b/app/controllers/exercises_controller.rb @@ -46,8 +46,8 @@ class ExercisesController < ApplicationController @exercises = member_show_exercises.exists? ? member_show_exercises.unified_setting : [] else #已分班级的成员,可以查看统一设置和单独设置(试卷是发布在该班级)试卷 # 已发布 当前用户班级分组的 试卷id - not_exercise_ids = @course.exercise_group_settings.exercise_group_not_published.where("course_group_id = #{@member_group_id}").pluck(:exercise_id) - @exercises = member_show_exercises.where.not(id: not_exercise_ids) + publish_exercise_ids = @course.exercise_group_settings.exercise_group_published.where("course_group_id = #{@member_group_id}").pluck(:exercise_id) + @exercises = member_show_exercises.unified_setting.or(id: publish_exercise_ids) end else #用户未登陆或不是该课堂成员,仅显示统一设置的(已发布的/已截止的),如有公开,则不显示锁,不公开,则显示锁 @is_teacher_or = 0 From d1f3534542f54af4afe8f3dd70cfc52a0e5114ac Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Wed, 9 Oct 2019 10:03:14 +0800 Subject: [PATCH 07/13] tiaoz --- app/controllers/exercises_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/exercises_controller.rb b/app/controllers/exercises_controller.rb index cfe72effc..30fef596d 100644 --- a/app/controllers/exercises_controller.rb +++ b/app/controllers/exercises_controller.rb @@ -47,7 +47,7 @@ class ExercisesController < ApplicationController else #已分班级的成员,可以查看统一设置和单独设置(试卷是发布在该班级)试卷 # 已发布 当前用户班级分组的 试卷id publish_exercise_ids = @course.exercise_group_settings.exercise_group_published.where("course_group_id = #{@member_group_id}").pluck(:exercise_id) - @exercises = member_show_exercises.unified_setting.or(id: publish_exercise_ids) + @exercises = member_show_exercises.unified_setting.or(member_show_exercises.where(id: publish_exercise_ids)) end else #用户未登陆或不是该课堂成员,仅显示统一设置的(已发布的/已截止的),如有公开,则不显示锁,不公开,则显示锁 @is_teacher_or = 0 From a1f6dd67314859efc35bdd75944291fcaf656461 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Wed, 9 Oct 2019 10:09:53 +0800 Subject: [PATCH 08/13] =?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/coursesPublic/ShixunChooseModal.js | 1 + 1 file changed, 1 insertion(+) diff --git a/public/react/src/modules/courses/coursesPublic/ShixunChooseModal.js b/public/react/src/modules/courses/coursesPublic/ShixunChooseModal.js index f4f00e5e0..4c360c82a 100644 --- a/public/react/src/modules/courses/coursesPublic/ShixunChooseModal.js +++ b/public/react/src/modules/courses/coursesPublic/ShixunChooseModal.js @@ -101,6 +101,7 @@ class ShixunChooseModal extends Component{ return( shixunmodal===true? Date: Wed, 9 Oct 2019 10:43:54 +0800 Subject: [PATCH 09/13] =?UTF-8?q?=E8=B0=83=E6=95=B4=E7=BC=96=E8=BE=91?= =?UTF-8?q?=E7=8A=B6=E6=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../courses/busyWork/CommonWorkSetting.js | 5 +++-- .../modules/courses/exercise/Exercisesetting.js | 9 +++++---- .../graduation/tasks/GraduationTaskssetting.js | 7 +++++-- .../modules/courses/poll/PollDetailTabForth.js | 5 ++++- .../shixunHomework/Trainingjobsetting.js | 7 +++++-- public/stylesheets/educoder/edu-main.css | 17 +++++++++-------- 6 files changed, 31 insertions(+), 19 deletions(-) diff --git a/public/react/src/modules/courses/busyWork/CommonWorkSetting.js b/public/react/src/modules/courses/busyWork/CommonWorkSetting.js index 9f36996ef..3217b7318 100644 --- a/public/react/src/modules/courses/busyWork/CommonWorkSetting.js +++ b/public/react/src/modules/courses/busyWork/CommonWorkSetting.js @@ -1029,8 +1029,9 @@ class CommonWorkSetting extends Component{ 发布设置 { !startEditFlag && isAdmin ? - { this.setState({startEditFlag: true}) }}> - + { this.setState({startEditFlag: true}) }}> + 编辑设置 + {/**/} :"" } diff --git a/public/react/src/modules/courses/exercise/Exercisesetting.js b/public/react/src/modules/courses/exercise/Exercisesetting.js index 54a4306d8..ca1e6eddf 100644 --- a/public/react/src/modules/courses/exercise/Exercisesetting.js +++ b/public/react/src/modules/courses/exercise/Exercisesetting.js @@ -618,10 +618,11 @@ class Exercisesetting extends Component{ 发布设置 { !flagPageEdit&&this.props.isAdmin()===true ? - - - - + + 编辑设置 + {/**/} + {/**/} + {/**/} :"" } diff --git a/public/react/src/modules/courses/graduation/tasks/GraduationTaskssetting.js b/public/react/src/modules/courses/graduation/tasks/GraduationTaskssetting.js index ff7564b8f..19980cca5 100644 --- a/public/react/src/modules/courses/graduation/tasks/GraduationTaskssetting.js +++ b/public/react/src/modules/courses/graduation/tasks/GraduationTaskssetting.js @@ -1001,8 +1001,11 @@ debugger
{ !flagPageEdit && this.props.isAdmin() === true ? - + + 编辑设置 + {/**/} + : "" } {/*内容*/} diff --git a/public/react/src/modules/courses/poll/PollDetailTabForth.js b/public/react/src/modules/courses/poll/PollDetailTabForth.js index 57fd91cfd..a64f92b5b 100644 --- a/public/react/src/modules/courses/poll/PollDetailTabForth.js +++ b/public/react/src/modules/courses/poll/PollDetailTabForth.js @@ -518,7 +518,10 @@ class PollDetailTabForth extends Component{ { !flagPageEdit && isAdmin ? - + + 编辑设置 + {/**/} + :"" }

diff --git a/public/react/src/modules/courses/shixunHomework/Trainingjobsetting.js b/public/react/src/modules/courses/shixunHomework/Trainingjobsetting.js index 23776ab1f..c9f0b7b53 100644 --- a/public/react/src/modules/courses/shixunHomework/Trainingjobsetting.js +++ b/public/react/src/modules/courses/shixunHomework/Trainingjobsetting.js @@ -2150,8 +2150,11 @@ class Trainingjobsetting extends Component { 发布设置 { !flagPageEdit && this.props.isAdmin() === true ? - + + 编辑设置 + {/**/} + : "" }

diff --git a/public/stylesheets/educoder/edu-main.css b/public/stylesheets/educoder/edu-main.css index f283c1e95..64663634c 100644 --- a/public/stylesheets/educoder/edu-main.css +++ b/public/stylesheets/educoder/edu-main.css @@ -146,14 +146,15 @@ a.decoration{text-decoration: underline} .margin20{margin:20px;} /*行高*/ -.lineh-12{line-height: 12px} -.lineh-15{line-height: 15px} -.lineh-17{line-height: 17px} -.lineh-20{line-height: 20px} -.lineh-25{line-height: 25px} -.lineh-30{line-height: 30px} -.lineh-35{line-height: 35px} -.lineh-40{line-height: 40px} +.lineh-12{line-height: 12px !important;} +.lineh-15{line-height: 15px !important;} +.lineh-17{line-height: 17px !important;} +.lineh-20{line-height: 20px !important;} +.lineh-24{line-height: 24px !important;} +.lineh-25{line-height: 25px !important;} +.lineh-30{line-height: 30px !important;} +.lineh-35{line-height: 35px !important;} +.lineh-40{line-height: 40px !important;} /*pre标签换行*/ .break_word{word-break: break-all;word-wrap: break-word;} From 693f22ee8d06a34f0d41fb2697744512cacf3aa9 Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Wed, 9 Oct 2019 10:45:19 +0800 Subject: [PATCH 10/13] =?UTF-8?q?top=5Fbanner=E5=A2=9E=E5=8A=A0first=5Fcat?= =?UTF-8?q?egory=5Furl?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/courses/top_banner.json.jbuilder | 1 + 1 file changed, 1 insertion(+) diff --git a/app/views/courses/top_banner.json.jbuilder b/app/views/courses/top_banner.json.jbuilder index 916fccb05..73cad0b76 100644 --- a/app/views/courses/top_banner.json.jbuilder +++ b/app/views/courses/top_banner.json.jbuilder @@ -25,4 +25,5 @@ json.excellent @course.excellent if @course.is_end == 0 json.days_remaining (@course.end_date.to_date - Time.now.to_date).to_i end +json.first_category_url module_url(@course.none_hidden_course_modules.first, @course) From 1dd52f9acc7ed40773899369e15f1426e0a7f8c9 Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Wed, 9 Oct 2019 10:51:58 +0800 Subject: [PATCH 11/13] =?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/views/courses/top_banner.json.jbuilder | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/app/views/courses/top_banner.json.jbuilder b/app/views/courses/top_banner.json.jbuilder index 73cad0b76..877ffcdf1 100644 --- a/app/views/courses/top_banner.json.jbuilder +++ b/app/views/courses/top_banner.json.jbuilder @@ -24,6 +24,4 @@ json.course_identity @user_course_identity json.excellent @course.excellent if @course.is_end == 0 json.days_remaining (@course.end_date.to_date - Time.now.to_date).to_i -end -json.first_category_url module_url(@course.none_hidden_course_modules.first, @course) - +end \ No newline at end of file From 21462cd45e37ee2f42489cd43b46e24314756636 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Wed, 9 Oct 2019 10:57:38 +0800 Subject: [PATCH 12/13] =?UTF-8?q?=E8=B0=83=E6=95=B4=E8=B7=B3=E8=BD=AC?= =?UTF-8?q?=E4=BD=93=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../courses/coursesDetail/CoursesBanner.js | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/public/react/src/modules/courses/coursesDetail/CoursesBanner.js b/public/react/src/modules/courses/coursesDetail/CoursesBanner.js index 437471436..8bd1e980e 100644 --- a/public/react/src/modules/courses/coursesDetail/CoursesBanner.js +++ b/public/react/src/modules/courses/coursesDetail/CoursesBanner.js @@ -55,7 +55,11 @@ class CoursesBanner extends Component { } } componentDidMount() { - + if(this.props.match.path==="/courses/:coursesId"){ + if(this.props.user!=undefined){ + this.props.history.push(this.props.user.first_category_url) + } + } this.onloadupdatabanner() on('updatabanner', this.updatabanner) axios.interceptors.response.use((response) => { @@ -69,9 +73,17 @@ class CoursesBanner extends Component { } return response; }, (error) => { - }); } + componentDidUpdate(prevProps) { + if(prevProps.user!=this.props.user){ + if(this.props.match.path==="/courses/:coursesId"){ + if(this.props.user!=undefined){ + this.props.history.push(this.props.user.first_category_url) + } + } + } + } componentWillUnmount() { off('updatabanner', this.updatabanner) } From 28f9f03bebc7c44c5f0084476eaf4983550777ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Wed, 9 Oct 2019 10:58:22 +0800 Subject: [PATCH 13/13] =?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/CoursesBanner.js | 5 ----- 1 file changed, 5 deletions(-) diff --git a/public/react/src/modules/courses/coursesDetail/CoursesBanner.js b/public/react/src/modules/courses/coursesDetail/CoursesBanner.js index 8bd1e980e..0f38971fd 100644 --- a/public/react/src/modules/courses/coursesDetail/CoursesBanner.js +++ b/public/react/src/modules/courses/coursesDetail/CoursesBanner.js @@ -55,11 +55,6 @@ class CoursesBanner extends Component { } } componentDidMount() { - if(this.props.match.path==="/courses/:coursesId"){ - if(this.props.user!=undefined){ - this.props.history.push(this.props.user.first_category_url) - } - } this.onloadupdatabanner() on('updatabanner', this.updatabanner) axios.interceptors.response.use((response) => {