diff --git a/app/assets/javascripts/bootstrap.viewer.js b/app/assets/javascripts/bootstrap.viewer.js index 4c6aa549a..611cab704 100755 --- a/app/assets/javascripts/bootstrap.viewer.js +++ b/app/assets/javascripts/bootstrap.viewer.js @@ -22,9 +22,9 @@ $.fn.bootstrapViewer = function (options) { ' diff --git a/app/views/courses/online_learning.json.jbuilder b/app/views/courses/online_learning.json.jbuilder index b48cd9e23..d6b3db136 100644 --- a/app/views/courses/online_learning.json.jbuilder +++ b/app/views/courses/online_learning.json.jbuilder @@ -1,5 +1,5 @@ json.stages @stages do |stage| - json.partial! 'stages/stage', locals: {stage: stage, user:@user, subject:@subject} + json.partial! 'stages/stage', locals: {stage: stage, user: @user, subject: @subject, myshixuns: @myshixuns} end # json.description @subject&.description @@ -7,6 +7,6 @@ end json.start_learning @start_learning json.subject_id @subject.id -json.learned @start_learning ? @course.my_subject_progress : 0 +json.learned @start_learning ? @course.my_subject_progress(@myshixuns) : 0 -json.last_shixun @start_learning ? last_subject_shixun(@user.id, @course) : "" \ No newline at end of file +json.last_shixun @start_learning ? last_subject_shixun(@course, @myshixuns) : "" \ No newline at end of file diff --git a/app/views/ecs/course_targets/with_achievement_methods.json.jbuilder b/app/views/ecs/course_targets/with_achievement_methods.json.jbuilder new file mode 100644 index 000000000..689504ec3 --- /dev/null +++ b/app/views/ecs/course_targets/with_achievement_methods.json.jbuilder @@ -0,0 +1,2 @@ + +json.course_targets @course_targets, partial: 'ecs/course_targets/shared/ec_course_target_with_achievement_methods', as: :ec_course_target diff --git a/app/views/ecs/requirement_support_objectives/show.json.jbuilder b/app/views/ecs/requirement_support_objectives/show.json.jbuilder index 642a5f10c..da33ec741 100644 --- a/app/views/ecs/requirement_support_objectives/show.json.jbuilder +++ b/app/views/ecs/requirement_support_objectives/show.json.jbuilder @@ -1,4 +1,4 @@ json.graduation_requirements @graduation_requirements, partial: 'ecs/ec_graduation_requirements/shared/ec_graduation_requirement', as: :ec_graduation_requirement -json.training_subitems @training_subitems, partial: 'ecs/ec_training_subitems/shared/ec_training_subitem', as: :ec_training_subitem +json.training_subitems @training_subitems, partial: 'ecs/ec_training_objectives/shared/ec_training_subitem', as: :ec_training_subitem json.requirement_support_objectives @requirement_support_objectives, partial: 'ecs/requirement_support_objectives/shared/requirement_support_objective', as: :requirement_support_objective 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 diff --git a/app/views/graduation_tasks/index.json.jbuilder b/app/views/graduation_tasks/index.json.jbuilder index a6540555d..ce9ea0259 100644 --- a/app/views/graduation_tasks/index.json.jbuilder +++ b/app/views/graduation_tasks/index.json.jbuilder @@ -11,6 +11,7 @@ json.tasks @tasks.each do |task| task_curr_status = task_curr_status(task, @course) json.status task_curr_status[:status] json.status_time task_curr_status[:time] + json.author task.user.real_name unless task_curr_status[:status].include?("未发布") json.commit_count grduationwork_count task, 1 diff --git a/app/views/stages/_stage.json.jbuilder b/app/views/stages/_stage.json.jbuilder index db00ad844..e5d2be82d 100644 --- a/app/views/stages/_stage.json.jbuilder +++ b/app/views/stages/_stage.json.jbuilder @@ -15,7 +15,7 @@ json.shixuns_list do json.shixun_name shixun.name json.shixun_hidden shixun.hidden json.identifier shixun.identifier - json.complete_status stage_myshixun_status(shixun, user) + json.complete_status stage_myshixun_status(myshixuns.select{|ms| ms.shixun_id == shixun.id}.first) json.shixun_status stage_shixun_status(subject.status, shixun.status, shixun.hidden) end end \ No newline at end of file diff --git a/app/views/stages/index.json.jbuilder b/app/views/stages/index.json.jbuilder index d186088c4..b7c61d9cf 100644 --- a/app/views/stages/index.json.jbuilder +++ b/app/views/stages/index.json.jbuilder @@ -1,3 +1,3 @@ json.stages @stages do |stage| - json.partial! 'stage', locals: {stage: stage, user:@user, subject:@subject} + json.partial! 'stage', locals: {stage: stage, user: @user, subject: @subject, myshixuns: @myshixuns} end \ No newline at end of file diff --git a/app/views/subject_lists/index.json.jbuilder b/app/views/subject_lists/index.json.jbuilder new file mode 100644 index 000000000..6992deb1f --- /dev/null +++ b/app/views/subject_lists/index.json.jbuilder @@ -0,0 +1,22 @@ +json.subjects_count @results.total_count + +json.subject_list do + json.array! @results.with_highlights(multiple: true) do |obj, highlights| + json.merge! obj.to_searchable_json + + # 去除开头标点符号 + reg = /^[,。?:;‘’!“”—……、]/ + # 附件的替换 + atta_reg = /!\[.*]\(\/api\/attachments\/\d+\)/ + + highlights[:description]&.first&.sub!(reg, '') + highlights[:description]&.map{|des| des.gsub!(atta_reg, '')} + highlights[:content]&.first&.sub!(reg, '') + highlights[:content]&.map{|des| des.gsub!(atta_reg, '')} + + json.title highlights.delete(:name)&.join('...') || obj.searchable_title + json.description highlights[:description]&.join('...') || Util.extract_content(obj.description)[0..300]&.sub!(atta_reg, '') + + json.content highlights + end +end \ No newline at end of file diff --git a/app/views/users/_user.json.jbuilder b/app/views/users/_user.json.jbuilder index 4fb05b7ba..581072072 100644 --- a/app/views/users/_user.json.jbuilder +++ b/app/views/users/_user.json.jbuilder @@ -4,5 +4,5 @@ json.name user.full_name json.grade user.grade json.identity user&.user_extension&.identity # json.email user.mail # 邮箱原则上不暴露的,如果实在需要的话只能对某些具体的接口公开 -json.image_url image_tag(url_to_avatar(user)) +json.image_url url_to_avatar(user) json.school user.school_name \ No newline at end of file diff --git a/app/views/users/courses/shared/_course.json.jbuilder b/app/views/users/courses/shared/_course.json.jbuilder index e917033da..8da80f372 100644 --- a/app/views/users/courses/shared/_course.json.jbuilder +++ b/app/views/users/courses/shared/_course.json.jbuilder @@ -5,6 +5,7 @@ json.members_count course.course_members_count # json.homework_commons_count course.homework_commons_count json.homework_commons_count get_tasks_count course json.attachments_count course.attachments.count +json.visits course.visits json.first_category_url module_url(course.course_modules.where(hidden: 0).order(position: :desc).first, course) diff --git a/app/views/users/homepage_info.json.jbuilder b/app/views/users/homepage_info.json.jbuilder index 78e0e1d7b..112bd215c 100644 --- a/app/views/users/homepage_info.json.jbuilder +++ b/app/views/users/homepage_info.json.jbuilder @@ -1,6 +1,6 @@ json.id @user.id json.name @user.full_name -json.avatar_url image_tag("/" + url_to_avatar(@user)) +json.avatar_url url_to_avatar(@user) json.is_logged_user @user.logged_user? json.experience @user.experience json.grade @user.grade diff --git a/config/locales/tidings/zh-CN.yml b/config/locales/tidings/zh-CN.yml index 557f3f79b..f484efdc1 100644 --- a/config/locales/tidings/zh-CN.yml +++ b/config/locales/tidings/zh-CN.yml @@ -58,8 +58,8 @@ "2_end": "你提交的试用授权申请,审核未通过
原因:%{reason}" Apply_end: "提交了试用授权申请" Course_end: "你创建了课堂:%s" - Course: - Delete_end: "你删除了课堂:%s" + DeleteCourse_end: "你删除了课堂:%s" + DeleteCourseMember_end: "%s 将你从课堂中删除了:%s" Shixun_end: "你创建了实训:%s" Subject_end: "你创建了实践课程:%s" ArchiveCourse_end: "你的课堂已经归档:%s" @@ -185,13 +185,13 @@ NearlyEnd_end: "作业的提交截止时间快到啦:%{name}" AppealNearlyEnd_end: "作品的匿评申诉时间快到啦:%{name}" EvaluationNearlyEnd_end: "作业的匿评截止时间快到啦:%{name}" - StudentWork: - true_end: "提交了作品:%s" - false_end: "重新提交了作品,建议您重新评阅:%s" + StudentWork_end: "提交了作品:%s" + ResubmitStudentWork_end: "重新提交了作品,建议您重新评阅作品:%s" StudentWorksScore: 1_end: "评阅了你的作品:%s" 2_end: "评阅了你的作品:%s" 3_end: "有人匿评了你的作品:%s" + AdjustScore_end: "调整了你的作品得分:%s" ChallengeWorkScore_end: "调整了你的作品分数:%s" StudentWorksScoresAppeal: UserAppealResult: diff --git a/config/routes.rb b/config/routes.rb index af7e0ee3b..538db6618 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -174,6 +174,7 @@ Rails.application.routes.draw do end end + resources :subject_lists resources :shixun_lists resources :shixuns, param: :identifier do @@ -539,6 +540,7 @@ Rails.application.routes.draw do post 'relate_project' get 'cancel_relate_project' post 'revise_attachment' + delete 'delete_work' end member do @@ -791,6 +793,7 @@ Rails.application.routes.draw do end resources :libraries, only: [:index, :show, :create, :update, :destroy] + resources :library_tags, only: [:index] scope module: :projects do resources :project_applies, only: [:create] diff --git a/db/migrate/20190926024819_add_library_tag_data.rb b/db/migrate/20190926024819_add_library_tag_data.rb new file mode 100644 index 000000000..b2b40bbf5 --- /dev/null +++ b/db/migrate/20190926024819_add_library_tag_data.rb @@ -0,0 +1,9 @@ +class AddLibraryTagData < ActiveRecord::Migration[5.2] + def up + execute 'INSERT INTO library_tags(id, name) VALUES(4, "高校案例")' + end + + def down + execute 'DELETE FROM library_tags WHERE id = 4 and name = "高校案例"' + end +end diff --git a/public/assets/.sprockets-manifest-4627fa5586ef7fed55ca286af7c028e9.json b/public/assets/.sprockets-manifest-4627fa5586ef7fed55ca286af7c028e9.json index a61e9dd26..5b232b2d3 100644 --- a/public/assets/.sprockets-manifest-4627fa5586ef7fed55ca286af7c028e9.json +++ b/public/assets/.sprockets-manifest-4627fa5586ef7fed55ca286af7c028e9.json @@ -1 +1 @@ -{"files":{"admin-cd9ca8bacc973ce2dbace30c97f6c40bc08e2c2ee44972f668e738e1902c0121.js":{"logical_path":"admin.js","mtime":"2019-09-11T16:20:07+08:00","size":4350881,"digest":"cd9ca8bacc973ce2dbace30c97f6c40bc08e2c2ee44972f668e738e1902c0121","integrity":"sha256-zZyousyXPOLbrOMMl/bEC8COLC7kSXL2aOc44ZAsASE="},"admin-a1b3356efe50ff4717cf22475639b5333c5354ba03fd107c9b7a8d4ae76f47aa.css":{"logical_path":"admin.css","mtime":"2019-09-11T16:20:07+08:00","size":773445,"digest":"a1b3356efe50ff4717cf22475639b5333c5354ba03fd107c9b7a8d4ae76f47aa","integrity":"sha256-obM1bv5Q/0cXzyJHVjm1MzxTVLoD/RB8m3qNSudvR6o="},"font-awesome/fontawesome-webfont-7bfcab6db99d5cfbf1705ca0536ddc78585432cc5fa41bbd7ad0f009033b2979.eot":{"logical_path":"font-awesome/fontawesome-webfont.eot","mtime":"2019-08-14T17:22:43+08:00","size":165742,"digest":"7bfcab6db99d5cfbf1705ca0536ddc78585432cc5fa41bbd7ad0f009033b2979","integrity":"sha256-e/yrbbmdXPvxcFygU23ceFhUMsxfpBu9etDwCQM7KXk="},"font-awesome/fontawesome-webfont-2adefcbc041e7d18fcf2d417879dc5a09997aa64d675b7a3c4b6ce33da13f3fe.woff2":{"logical_path":"font-awesome/fontawesome-webfont.woff2","mtime":"2019-08-14T17:22:43+08:00","size":77160,"digest":"2adefcbc041e7d18fcf2d417879dc5a09997aa64d675b7a3c4b6ce33da13f3fe","integrity":"sha256-Kt78vAQefRj88tQXh53FoJmXqmTWdbejxLbOM9oT8/4="},"font-awesome/fontawesome-webfont-ba0c59deb5450f5cb41b3f93609ee2d0d995415877ddfa223e8a8a7533474f07.woff":{"logical_path":"font-awesome/fontawesome-webfont.woff","mtime":"2019-08-14T17:22:43+08:00","size":98024,"digest":"ba0c59deb5450f5cb41b3f93609ee2d0d995415877ddfa223e8a8a7533474f07","integrity":"sha256-ugxZ3rVFD1y0Gz+TYJ7i0NmVQVh33foiPoqKdTNHTwc="},"font-awesome/fontawesome-webfont-aa58f33f239a0fb02f5c7a6c45c043d7a9ac9a093335806694ecd6d4edc0d6a8.ttf":{"logical_path":"font-awesome/fontawesome-webfont.ttf","mtime":"2019-08-14T17:22:43+08:00","size":165548,"digest":"aa58f33f239a0fb02f5c7a6c45c043d7a9ac9a093335806694ecd6d4edc0d6a8","integrity":"sha256-qljzPyOaD7AvXHpsRcBD16msmgkzNYBmlOzW1O3A1qg="},"font-awesome/fontawesome-webfont-ad6157926c1622ba4e1d03d478f1541368524bfc46f51e42fe0d945f7ef323e4.svg":{"logical_path":"font-awesome/fontawesome-webfont.svg","mtime":"2019-08-14T17:22:43+08:00","size":444379,"digest":"ad6157926c1622ba4e1d03d478f1541368524bfc46f51e42fe0d945f7ef323e4","integrity":"sha256-rWFXkmwWIrpOHQPUePFUE2hSS/xG9R5C/g2UX37zI+Q="},"college-18f5e8400331634e898a35acc2187815c096c25e0ab74aba341ae916166cd287.js":{"logical_path":"college.js","mtime":"2019-09-21T15:26:10+08:00","size":3352744,"digest":"18f5e8400331634e898a35acc2187815c096c25e0ab74aba341ae916166cd287","integrity":"sha256-GPXoQAMxY06JijWswhh4FcCWwl4Kt0q6NBrpFhZs0oc="},"college-944d4273f62c7538368b9017fdd3387b5e3bea31a87873770eb231324546d4d9.css":{"logical_path":"college.css","mtime":"2019-09-11T16:20:07+08:00","size":546841,"digest":"944d4273f62c7538368b9017fdd3387b5e3bea31a87873770eb231324546d4d9","integrity":"sha256-lE1Cc/YsdTg2i5AX/dM4e1476jGoeHN3DrIxMkVG1Nk="},"logo-7ff112568709bf97f9898fe87249b7a8f200ff1f48d537d85af87215f1870423.png":{"logical_path":"logo.png","mtime":"2019-09-03T08:55:53+08:00","size":2816,"digest":"7ff112568709bf97f9898fe87249b7a8f200ff1f48d537d85af87215f1870423","integrity":"sha256-f/ESVocJv5f5iY/ockm3qPIA/x9I1TfYWvhyFfGHBCM="},"application-9cfbc3d792599a1d0de5c7b84209e1c2b2e60336f0f01e19f0581663918708fb.js":{"logical_path":"application.js","mtime":"2019-09-21T15:26:10+08:00","size":600706,"digest":"9cfbc3d792599a1d0de5c7b84209e1c2b2e60336f0f01e19f0581663918708fb","integrity":"sha256-nPvD15JZmh0N5ce4QgnhwrLmAzbw8B4Z8FgWY5GHCPs="},"application-5eb87c6e13676d0183317debce17fade27e68c4acee28c419438da15d53c94f2.css":{"logical_path":"application.css","mtime":"2019-09-11T16:20:07+08:00","size":1844002,"digest":"5eb87c6e13676d0183317debce17fade27e68c4acee28c419438da15d53c94f2","integrity":"sha256-Xrh8bhNnbQGDMX3rzhf63ifmjErO4oxBlDjaFdU8lPI="},"admin-c9e5ebe6191548550e27514196ea125cfbb402820ec125a0c9acf99d2d378fe4.js":{"logical_path":"admin.js","mtime":"2019-09-21T15:28:08+08:00","size":4382031,"digest":"c9e5ebe6191548550e27514196ea125cfbb402820ec125a0c9acf99d2d378fe4","integrity":"sha256-yeXr5hkVSFUOJ1FBluoSXPu0AoIOwSWgyaz5nS03j+Q="},"admin-59c59f8cae8bef4a8359286c985458110c9d03ea121516595c988943f4717c38.css":{"logical_path":"admin.css","mtime":"2019-09-21T14:49:04+08:00","size":840093,"digest":"59c59f8cae8bef4a8359286c985458110c9d03ea121516595c988943f4717c38","integrity":"sha256-WcWfjK6L70qDWShsmFRYEQydA+oSFRZZXJiJQ/RxfDg="},"college-38f953d6ba5b85d3fab63cb3c2bbf0d057ccc6454d07cfaafac3b06da37b8437.css":{"logical_path":"college.css","mtime":"2019-09-16T13:56:09+08:00","size":579109,"digest":"38f953d6ba5b85d3fab63cb3c2bbf0d057ccc6454d07cfaafac3b06da37b8437","integrity":"sha256-OPlT1rpbhdP6tjyzwrvw0FfMxkVNB8+q+sOwbaN7hDc="},"application-646b1158a4e8c1f13e684d6fe9025abc75f8d3ba5256e440802c0398223374f3.css":{"logical_path":"application.css","mtime":"2019-09-21T14:49:04+08:00","size":1988767,"digest":"646b1158a4e8c1f13e684d6fe9025abc75f8d3ba5256e440802c0398223374f3","integrity":"sha256-ZGsRWKTowfE+aE1v6QJavHX407pSVuRAgCwDmCIzdPM="}},"assets":{"admin.js":"admin-c9e5ebe6191548550e27514196ea125cfbb402820ec125a0c9acf99d2d378fe4.js","admin.css":"admin-59c59f8cae8bef4a8359286c985458110c9d03ea121516595c988943f4717c38.css","font-awesome/fontawesome-webfont.eot":"font-awesome/fontawesome-webfont-7bfcab6db99d5cfbf1705ca0536ddc78585432cc5fa41bbd7ad0f009033b2979.eot","font-awesome/fontawesome-webfont.woff2":"font-awesome/fontawesome-webfont-2adefcbc041e7d18fcf2d417879dc5a09997aa64d675b7a3c4b6ce33da13f3fe.woff2","font-awesome/fontawesome-webfont.woff":"font-awesome/fontawesome-webfont-ba0c59deb5450f5cb41b3f93609ee2d0d995415877ddfa223e8a8a7533474f07.woff","font-awesome/fontawesome-webfont.ttf":"font-awesome/fontawesome-webfont-aa58f33f239a0fb02f5c7a6c45c043d7a9ac9a093335806694ecd6d4edc0d6a8.ttf","font-awesome/fontawesome-webfont.svg":"font-awesome/fontawesome-webfont-ad6157926c1622ba4e1d03d478f1541368524bfc46f51e42fe0d945f7ef323e4.svg","college.js":"college-18f5e8400331634e898a35acc2187815c096c25e0ab74aba341ae916166cd287.js","college.css":"college-38f953d6ba5b85d3fab63cb3c2bbf0d057ccc6454d07cfaafac3b06da37b8437.css","logo.png":"logo-7ff112568709bf97f9898fe87249b7a8f200ff1f48d537d85af87215f1870423.png","application.js":"application-9cfbc3d792599a1d0de5c7b84209e1c2b2e60336f0f01e19f0581663918708fb.js","application.css":"application-646b1158a4e8c1f13e684d6fe9025abc75f8d3ba5256e440802c0398223374f3.css"}} \ No newline at end of file +{"files":{"admin-cd9ca8bacc973ce2dbace30c97f6c40bc08e2c2ee44972f668e738e1902c0121.js":{"logical_path":"admin.js","mtime":"2019-09-11T16:20:07+08:00","size":4350881,"digest":"cd9ca8bacc973ce2dbace30c97f6c40bc08e2c2ee44972f668e738e1902c0121","integrity":"sha256-zZyousyXPOLbrOMMl/bEC8COLC7kSXL2aOc44ZAsASE="},"admin-a1b3356efe50ff4717cf22475639b5333c5354ba03fd107c9b7a8d4ae76f47aa.css":{"logical_path":"admin.css","mtime":"2019-09-11T16:20:07+08:00","size":773445,"digest":"a1b3356efe50ff4717cf22475639b5333c5354ba03fd107c9b7a8d4ae76f47aa","integrity":"sha256-obM1bv5Q/0cXzyJHVjm1MzxTVLoD/RB8m3qNSudvR6o="},"font-awesome/fontawesome-webfont-7bfcab6db99d5cfbf1705ca0536ddc78585432cc5fa41bbd7ad0f009033b2979.eot":{"logical_path":"font-awesome/fontawesome-webfont.eot","mtime":"2019-08-14T17:22:43+08:00","size":165742,"digest":"7bfcab6db99d5cfbf1705ca0536ddc78585432cc5fa41bbd7ad0f009033b2979","integrity":"sha256-e/yrbbmdXPvxcFygU23ceFhUMsxfpBu9etDwCQM7KXk="},"font-awesome/fontawesome-webfont-2adefcbc041e7d18fcf2d417879dc5a09997aa64d675b7a3c4b6ce33da13f3fe.woff2":{"logical_path":"font-awesome/fontawesome-webfont.woff2","mtime":"2019-08-14T17:22:43+08:00","size":77160,"digest":"2adefcbc041e7d18fcf2d417879dc5a09997aa64d675b7a3c4b6ce33da13f3fe","integrity":"sha256-Kt78vAQefRj88tQXh53FoJmXqmTWdbejxLbOM9oT8/4="},"font-awesome/fontawesome-webfont-ba0c59deb5450f5cb41b3f93609ee2d0d995415877ddfa223e8a8a7533474f07.woff":{"logical_path":"font-awesome/fontawesome-webfont.woff","mtime":"2019-08-14T17:22:43+08:00","size":98024,"digest":"ba0c59deb5450f5cb41b3f93609ee2d0d995415877ddfa223e8a8a7533474f07","integrity":"sha256-ugxZ3rVFD1y0Gz+TYJ7i0NmVQVh33foiPoqKdTNHTwc="},"font-awesome/fontawesome-webfont-aa58f33f239a0fb02f5c7a6c45c043d7a9ac9a093335806694ecd6d4edc0d6a8.ttf":{"logical_path":"font-awesome/fontawesome-webfont.ttf","mtime":"2019-08-14T17:22:43+08:00","size":165548,"digest":"aa58f33f239a0fb02f5c7a6c45c043d7a9ac9a093335806694ecd6d4edc0d6a8","integrity":"sha256-qljzPyOaD7AvXHpsRcBD16msmgkzNYBmlOzW1O3A1qg="},"font-awesome/fontawesome-webfont-ad6157926c1622ba4e1d03d478f1541368524bfc46f51e42fe0d945f7ef323e4.svg":{"logical_path":"font-awesome/fontawesome-webfont.svg","mtime":"2019-08-14T17:22:43+08:00","size":444379,"digest":"ad6157926c1622ba4e1d03d478f1541368524bfc46f51e42fe0d945f7ef323e4","integrity":"sha256-rWFXkmwWIrpOHQPUePFUE2hSS/xG9R5C/g2UX37zI+Q="},"college-18f5e8400331634e898a35acc2187815c096c25e0ab74aba341ae916166cd287.js":{"logical_path":"college.js","mtime":"2019-09-21T15:26:10+08:00","size":3352744,"digest":"18f5e8400331634e898a35acc2187815c096c25e0ab74aba341ae916166cd287","integrity":"sha256-GPXoQAMxY06JijWswhh4FcCWwl4Kt0q6NBrpFhZs0oc="},"college-944d4273f62c7538368b9017fdd3387b5e3bea31a87873770eb231324546d4d9.css":{"logical_path":"college.css","mtime":"2019-09-11T16:20:07+08:00","size":546841,"digest":"944d4273f62c7538368b9017fdd3387b5e3bea31a87873770eb231324546d4d9","integrity":"sha256-lE1Cc/YsdTg2i5AX/dM4e1476jGoeHN3DrIxMkVG1Nk="},"logo-7ff112568709bf97f9898fe87249b7a8f200ff1f48d537d85af87215f1870423.png":{"logical_path":"logo.png","mtime":"2019-09-03T08:55:53+08:00","size":2816,"digest":"7ff112568709bf97f9898fe87249b7a8f200ff1f48d537d85af87215f1870423","integrity":"sha256-f/ESVocJv5f5iY/ockm3qPIA/x9I1TfYWvhyFfGHBCM="},"application-9cfbc3d792599a1d0de5c7b84209e1c2b2e60336f0f01e19f0581663918708fb.js":{"logical_path":"application.js","mtime":"2019-09-21T15:26:10+08:00","size":600706,"digest":"9cfbc3d792599a1d0de5c7b84209e1c2b2e60336f0f01e19f0581663918708fb","integrity":"sha256-nPvD15JZmh0N5ce4QgnhwrLmAzbw8B4Z8FgWY5GHCPs="},"application-5eb87c6e13676d0183317debce17fade27e68c4acee28c419438da15d53c94f2.css":{"logical_path":"application.css","mtime":"2019-09-11T16:20:07+08:00","size":1844002,"digest":"5eb87c6e13676d0183317debce17fade27e68c4acee28c419438da15d53c94f2","integrity":"sha256-Xrh8bhNnbQGDMX3rzhf63ifmjErO4oxBlDjaFdU8lPI="},"admin-c9e5ebe6191548550e27514196ea125cfbb402820ec125a0c9acf99d2d378fe4.js":{"logical_path":"admin.js","mtime":"2019-09-21T15:28:08+08:00","size":4382031,"digest":"c9e5ebe6191548550e27514196ea125cfbb402820ec125a0c9acf99d2d378fe4","integrity":"sha256-yeXr5hkVSFUOJ1FBluoSXPu0AoIOwSWgyaz5nS03j+Q="},"admin-59c59f8cae8bef4a8359286c985458110c9d03ea121516595c988943f4717c38.css":{"logical_path":"admin.css","mtime":"2019-09-21T14:49:04+08:00","size":840093,"digest":"59c59f8cae8bef4a8359286c985458110c9d03ea121516595c988943f4717c38","integrity":"sha256-WcWfjK6L70qDWShsmFRYEQydA+oSFRZZXJiJQ/RxfDg="},"college-38f953d6ba5b85d3fab63cb3c2bbf0d057ccc6454d07cfaafac3b06da37b8437.css":{"logical_path":"college.css","mtime":"2019-09-16T13:56:09+08:00","size":579109,"digest":"38f953d6ba5b85d3fab63cb3c2bbf0d057ccc6454d07cfaafac3b06da37b8437","integrity":"sha256-OPlT1rpbhdP6tjyzwrvw0FfMxkVNB8+q+sOwbaN7hDc="},"application-646b1158a4e8c1f13e684d6fe9025abc75f8d3ba5256e440802c0398223374f3.css":{"logical_path":"application.css","mtime":"2019-09-21T14:49:04+08:00","size":1988767,"digest":"646b1158a4e8c1f13e684d6fe9025abc75f8d3ba5256e440802c0398223374f3","integrity":"sha256-ZGsRWKTowfE+aE1v6QJavHX407pSVuRAgCwDmCIzdPM="},"admin-a47e37c0ec7cf5f22380249776d1e82d65b6b6aa272ed7389185aa200fa40751.js":{"logical_path":"admin.js","mtime":"2019-09-25T15:33:05+08:00","size":4383107,"digest":"a47e37c0ec7cf5f22380249776d1e82d65b6b6aa272ed7389185aa200fa40751","integrity":"sha256-pH43wOx89fIjgCSXdtHoLWW2tqonLtc4kYWqIA+kB1E="},"admin-432c4eac09b036c57ff1e88d902b8aa7df81164e4b419bac557cf1366c1d3ad9.js":{"logical_path":"admin.js","mtime":"2019-09-25T15:35:20+08:00","size":4383103,"digest":"432c4eac09b036c57ff1e88d902b8aa7df81164e4b419bac557cf1366c1d3ad9","integrity":"sha256-QyxOrAmwNsV/8eiNkCuKp9+BFk5LQZusVXzxNmwdOtk="}},"assets":{"admin.js":"admin-432c4eac09b036c57ff1e88d902b8aa7df81164e4b419bac557cf1366c1d3ad9.js","admin.css":"admin-59c59f8cae8bef4a8359286c985458110c9d03ea121516595c988943f4717c38.css","font-awesome/fontawesome-webfont.eot":"font-awesome/fontawesome-webfont-7bfcab6db99d5cfbf1705ca0536ddc78585432cc5fa41bbd7ad0f009033b2979.eot","font-awesome/fontawesome-webfont.woff2":"font-awesome/fontawesome-webfont-2adefcbc041e7d18fcf2d417879dc5a09997aa64d675b7a3c4b6ce33da13f3fe.woff2","font-awesome/fontawesome-webfont.woff":"font-awesome/fontawesome-webfont-ba0c59deb5450f5cb41b3f93609ee2d0d995415877ddfa223e8a8a7533474f07.woff","font-awesome/fontawesome-webfont.ttf":"font-awesome/fontawesome-webfont-aa58f33f239a0fb02f5c7a6c45c043d7a9ac9a093335806694ecd6d4edc0d6a8.ttf","font-awesome/fontawesome-webfont.svg":"font-awesome/fontawesome-webfont-ad6157926c1622ba4e1d03d478f1541368524bfc46f51e42fe0d945f7ef323e4.svg","college.js":"college-18f5e8400331634e898a35acc2187815c096c25e0ab74aba341ae916166cd287.js","college.css":"college-38f953d6ba5b85d3fab63cb3c2bbf0d057ccc6454d07cfaafac3b06da37b8437.css","logo.png":"logo-7ff112568709bf97f9898fe87249b7a8f200ff1f48d537d85af87215f1870423.png","application.js":"application-9cfbc3d792599a1d0de5c7b84209e1c2b2e60336f0f01e19f0581663918708fb.js","application.css":"application-646b1158a4e8c1f13e684d6fe9025abc75f8d3ba5256e440802c0398223374f3.css"}} \ No newline at end of file diff --git a/public/assets/admin-c9e5ebe6191548550e27514196ea125cfbb402820ec125a0c9acf99d2d378fe4.js b/public/assets/admin-432c4eac09b036c57ff1e88d902b8aa7df81164e4b419bac557cf1366c1d3ad9.js similarity index 99% rename from public/assets/admin-c9e5ebe6191548550e27514196ea125cfbb402820ec125a0c9acf99d2d378fe4.js rename to public/assets/admin-432c4eac09b036c57ff1e88d902b8aa7df81164e4b419bac557cf1366c1d3ad9.js index ce87b3e0e..0e5b00aea 100644 --- a/public/assets/admin-c9e5ebe6191548550e27514196ea125cfbb402820ec125a0c9acf99d2d378fe4.js +++ b/public/assets/admin-432c4eac09b036c57ff1e88d902b8aa7df81164e4b419bac557cf1366c1d3ad9.js @@ -27586,9 +27586,9 @@ $.fn.bootstrapViewer = function (options) { ' -
diff --git a/public/react/src/modules/courses/Index.js b/public/react/src/modules/courses/Index.js index f9f80a9da..c414df55a 100644 --- a/public/react/src/modules/courses/Index.js +++ b/public/react/src/modules/courses/Index.js @@ -299,7 +299,6 @@ class CoursesIndex extends Component{ this.historyArray = [window.location.pathname]; this.props.history.listen( location => { - console.log(location); this.historyArray.unshift(window.location.pathname); this.historyArray.length = 2; //Do your stuff here diff --git a/public/react/src/modules/courses/Resource/Fileslistitem.js b/public/react/src/modules/courses/Resource/Fileslistitem.js index 4e8e89567..4713431ca 100644 --- a/public/react/src/modules/courses/Resource/Fileslistitem.js +++ b/public/react/src/modules/courses/Resource/Fileslistitem.js @@ -28,6 +28,21 @@ class Fileslistitem extends Component{ } showfiles=(list)=>{ + if(this.props.checkIfLogin()===false){ + this.props.showLoginDialog() + return + } + // if(this.props.checkIfProfileCompleted()===false){ + // this.setState({ + // AccountProfiletype:true + // }) + // return + // } + // if(this.props.checkIfProfessionalCertification()===false){ + // this.props.showProfileCompleteDialog() + // return + // } + if(list.is_history_file===false){ // this.props.DownloadFileA(list.title,list.url) //window.location.href=list.url; @@ -217,7 +232,7 @@ class Fileslistitem extends Component{ { this.props.isNotMember===true? discussMessage.is_lock === true ? - {discussMessage.title} + {discussMessage.title} :this.showfiles(discussMessage)} title={discussMessage.title} diff --git a/public/react/src/modules/courses/Resource/index.js b/public/react/src/modules/courses/Resource/index.js index c52f3753a..02b1d5be1 100644 --- a/public/react/src/modules/courses/Resource/index.js +++ b/public/react/src/modules/courses/Resource/index.js @@ -113,31 +113,36 @@ class Fileslists extends Component{ updadatalist=(id)=>{ // this.seactall(id) - let coursesId=this.props.match.params.coursesId; - let url="/courses/"+coursesId+"/attahcment_category_list.json"; - axios.get(url, { - }).then((response) => { - if(response!=undefined){ - - if(response.data&&response.data) { - if (response.data.status != 401) { - let list = response.data.course_modules; - let course_second_categoriess; - list.map((item, key) => { - course_second_categoriess = item.course_second_categories - }) - - this.setState({ - course_modules: response.data, - has_course_groups: response.data.has_course_groups, - course_second_categories: course_second_categoriess - }) + if(this.props.user&&this.props.user.login=== ""||this.props.user&&this.props.user.login=== null||this.props.user&&this.props.user.login=== undefined){ + + }else{ + let coursesId=this.props.match.params.coursesId; + let url="/courses/"+coursesId+"/attahcment_category_list.json"; + axios.get(url, { + }).then((response) => { + if(response!=undefined){ + + if(response.data&&response.data) { + if (response.data.status != 401) { + let list = response.data.course_modules; + let course_second_categoriess; + list.map((item, key) => { + course_second_categoriess = item.course_second_categories + }) + + this.setState({ + course_modules: response.data, + has_course_groups: response.data.has_course_groups, + course_second_categories: course_second_categoriess + }) + } } + } - } + }) + } - }) } updatafiled=()=>{ if(this.props.match.params.main_id){ diff --git a/public/react/src/modules/courses/boards/BoardsListItem.js b/public/react/src/modules/courses/boards/BoardsListItem.js index 5abb25adb..021a41b7a 100644 --- a/public/react/src/modules/courses/boards/BoardsListItem.js +++ b/public/react/src/modules/courses/boards/BoardsListItem.js @@ -1,115 +1,130 @@ -import React,{ Component } from "react"; -import {Tooltip} from 'antd' -import moment from 'moment' -import { getUrl, WordsBtn } from 'educoder' -class BoardsListItem extends Component{ - constructor(props){ - super(props); - this.state = { - - } - } - onTitleClick = (discussMessage) => { - const isAdminOrStudent = this.props.isAdminOrStudent(); - if (!isAdminOrStudent && discussMessage.is_public == false) { - // 没有权限访问 - return; - } - const cid = this.props.match.params.coursesId - const board_id = this.props.match.params.boardId - this.props.toDetailPage(cid, board_id, discussMessage.id) - } - render(){ - let { addGroup } = this.state; - const isAdmin = this.props.isAdmin() - const isAdminOrStudent = this.props.isAdminOrStudent() - const { checkBox, discussMessage, onSticky, onItemClick, current_user } = this.props; - if (!discussMessage || !discussMessage.author) { - return ''; - } - let canNotLink = !isAdminOrStudent && discussMessage.is_public == false - - return( -
- - { checkBox } - - {/* /images/avatars/User/1?1529221779 */} - 1?1529221779 - -
onItemClick(discussMessage)}> -
- {} : () => this.onTitleClick(discussMessage)} - title={`${discussMessage.subject.length > 40 ? discussMessage.subject : ''}`} - >{discussMessage.subject} - { !!discussMessage.sticky && 置顶 } - { - - discussMessage.is_public == false ? ( - - ) : "" - } -
- -
-

- - {discussMessage.author.name} - - { discussMessage.total_replies_count != 0 && {discussMessage.total_replies_count} 回复 } - { discussMessage.praises_count != 0 && {discussMessage.praises_count} 点赞 } - { discussMessage.visits != 0 && {discussMessage.visits} 浏览 } - - {moment(discussMessage.created_on).fromNow()} - -

-
- {(isAdmin || discussMessage.author.login == current_user.login) && - { this.props.toEditPage(this.props.match.params.coursesId, this.props.match.params.boardId, discussMessage.id )} }>编辑 } - - { isAdmin && { debugger; onSticky(discussMessage); e.cancelBubble = true; e.stopPropagation();}}> - { discussMessage.sticky ? '取消置顶' : '置顶' } } -
- - - - - - {/* { (isAdmin || discussMessage.author.login == current_user.login) && -
- -
- } */} - - -
-
- ) - } -} +import React,{ Component } from "react"; +import {Tooltip} from 'antd' +import moment from 'moment' +import { getUrl, WordsBtn } from 'educoder' +class BoardsListItem extends Component{ + constructor(props){ + super(props); + this.state = { + + } + } + onTitleClick = (discussMessage) => { + if(this.props.checkIfLogin()===false){ + this.props.showLoginDialog() + return + } + // if(this.props.checkIfProfileCompleted()===false){ + // this.setState({ + // AccountProfiletype:true + // }) + // return + // } + // if(this.props.checkIfProfessionalCertification()===false){ + // this.props.showProfileCompleteDialog() + // return + // } + + const isAdminOrStudent = this.props.isAdminOrStudent(); + if (!isAdminOrStudent && discussMessage.is_public == false) { + // 没有权限访问 + return; + } + const cid = this.props.match.params.coursesId + const board_id = this.props.match.params.boardId + this.props.toDetailPage(cid, board_id, discussMessage.id) + } + render(){ + let { addGroup } = this.state; + const isAdmin = this.props.isAdmin() + const isAdminOrStudent = this.props.isAdminOrStudent() + const { checkBox, discussMessage, onSticky, onItemClick, current_user } = this.props; + if (!discussMessage || !discussMessage.author) { + return ''; + } + let canNotLink = !isAdminOrStudent && discussMessage.is_public == false + + return( +
+ + { checkBox } + + {/* /images/avatars/User/1?1529221779 */} + 1?1529221779 + +
onItemClick(discussMessage)}> +
+ {canNotLink?{discussMessage.subject}: {} : () => this.onTitleClick(discussMessage)} + >{discussMessage.subject}} + { !!discussMessage.sticky && 置顶 } + { + + discussMessage.is_public == false ? ( + + ) : "" + } +
+ +
+

+ + {discussMessage.author.name} + + { discussMessage.total_replies_count != 0 && {discussMessage.total_replies_count} 回复 } + { discussMessage.praises_count != 0 && {discussMessage.praises_count} 点赞 } + { discussMessage.visits != 0 && {discussMessage.visits} 浏览 } + + {moment(discussMessage.created_on).fromNow()} + +

+
+ {(isAdmin || discussMessage.author.login == current_user.login) && + { this.props.toEditPage(this.props.match.params.coursesId, this.props.match.params.boardId, discussMessage.id )} }>编辑 } + + { isAdmin && { debugger; onSticky(discussMessage); e.cancelBubble = true; e.stopPropagation();}}> + { discussMessage.sticky ? '取消置顶' : '置顶' } } +
+ + + + + + {/* { (isAdmin || discussMessage.author.login == current_user.login) && +
+ +
+ } */} + + +
+
+ ) + } +} export default BoardsListItem; \ No newline at end of file diff --git a/public/react/src/modules/courses/boards/index.js b/public/react/src/modules/courses/boards/index.js index 6d1c402ce..b1ada5bb5 100644 --- a/public/react/src/modules/courses/boards/index.js +++ b/public/react/src/modules/courses/boards/index.js @@ -116,6 +116,7 @@ class Boards extends Component{ this.setState({ isSpin:true }) + this.clearAllCheck() this.fetchAll(null, 1) } } diff --git a/public/react/src/modules/courses/busyWork/CommonWorkItem.js b/public/react/src/modules/courses/busyWork/CommonWorkItem.js index 122ed12d2..c92d91c48 100644 --- a/public/react/src/modules/courses/busyWork/CommonWorkItem.js +++ b/public/react/src/modules/courses/busyWork/CommonWorkItem.js @@ -16,7 +16,23 @@ class CommonWorkItem extends Component{ } } onItemClick = (item) => { - const isStudent = this.props.isStudent() + + if(this.props.checkIfLogin()===false){ + this.props.showLoginDialog() + return + } + // if(this.props.checkIfProfileCompleted()===false){ + // this.setState({ + // AccountProfiletype:true + // }) + // return + // } + // if(this.props.checkIfProfessionalCertification()===false){ + // this.props.showProfileCompleteDialog() + // return + // } + + const isStudent = this.props.isStudent() if (isStudent) { this.props.toWorkQuestionPage(this.props.match.params, item.homework_id) } else { @@ -128,6 +144,9 @@ class CommonWorkItem extends Component{ text-overflow: ellipsis; white-space: nowrap; } + a:hover{ + color: #4cacff; + } ` } @@ -142,17 +161,21 @@ class CommonWorkItem extends Component{ mainList && isAdmin && } +
this.props.onItemClick(Object.assign({}, item, {id: item.homework_id})) }>

- {} : () => this.onItemClick(item)} - >{item.name} - + {canNotLink? + {item.name} + : {} : () => this.onItemClick(item)} + title={item.name} + >{item.name}} {/* 只有非课堂成员且作业是私有的情况下才会为true */} { item.private_icon===true ? - ( + ( ) : "" } @@ -182,7 +205,7 @@ class CommonWorkItem extends Component{ {item.uncommit_count===undefined?"":{item.uncommit_count} 未交} { item.status_time!="" && - { - setTimeout(() => { - this.contentMdRef.current.setValue(data.description || '') - this.answerMdRef.current.setValue(data.reference_answer || '') - }, 2000) + // setTimeout(() => { + // this._scrollToTop() + // 阻止setValue的滚动 + // $(window).scroll( function() { + // $("html").scrollTop(0) + // $(window).unbind("scroll"); + // }); + /** + setValue会调用到 codemirror的 o.scrollIntoView(i), 会导致滚动条跳动 + */ + // $('.editormd').parent().css('position', 'fixed').css('left', '-1000px') + // this.contentMdRef.current.setValue(data.description || '') + // this.answerMdRef.current.setValue(data.reference_answer || '') + // setTimeout(() => { + // $('.editormd').parent().css('position', '').css('left', 'auto') + // }, 100); + // }, 500) this.props.form.setFieldsValue({ title: data.name, @@ -85,12 +98,13 @@ class NewWorkForm extends Component{ } else { // new } - this._scrollToTop() + // this._scrollToTop() } _scrollToTop = () => { - setTimeout(() => { - $("html").animate({ scrollTop: 0 }) - }, 1500) + // setTimeout(() => { + $("html").scrollTop(0) + // $("html").animate({ scrollTop: 0 }) + // }, 1000) } // 输入title @@ -303,15 +317,13 @@ class NewWorkForm extends Component{ let{ title_value, contentFileList, answerFileList, max_num, min_num, base_on_project, init_max_num, init_min_num, - title_num, course_name, category, has_commit, has_project, - - isEdit + 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 ; - - if ((isEdit) && !this.state.workLoaded) { + this.isEdit = this.isEdit || this.props.match.url.indexOf('/edit') != -1 + if ((this.isEdit) && !this.state.description && this.state.description != '') { return '' } const uploadProps = { @@ -439,7 +451,8 @@ class NewWorkForm extends Component{ }], })( + initValue={this.state.description} noSetValueOnInit={!!this.isEdit} + className="courseMessageMD" > )} } @@ -507,7 +520,8 @@ class NewWorkForm extends Component{ }], })( + initValue={this.state.reference_answer || ''} noSetValueOnInit={!!this.isEdit} + className="courseMessageMD" refreshTimeout={1500} > )} diff --git a/public/react/src/modules/courses/common/CBreadcrumb.js b/public/react/src/modules/courses/common/CBreadcrumb.js index 6e3343edf..bf98a3a36 100644 --- a/public/react/src/modules/courses/common/CBreadcrumb.js +++ b/public/react/src/modules/courses/common/CBreadcrumb.js @@ -16,7 +16,7 @@ class CBreadcrumb extends Component{ return '' } if (item.to) { - return + return {item.name} {separator ? {separator} : @@ -24,7 +24,7 @@ class CBreadcrumb extends Component{ } } else { - return {item.name} + return {item.name} } })}

diff --git a/public/react/src/modules/courses/common/ModalWrapper.js b/public/react/src/modules/courses/common/ModalWrapper.js index e92a508d6..8b7e87692 100644 --- a/public/react/src/modules/courses/common/ModalWrapper.js +++ b/public/react/src/modules/courses/common/ModalWrapper.js @@ -1,5 +1,5 @@ import React,{ Component } from "react"; -import { Modal,Input, Checkbox} from "antd"; +import { Modal,Input, Checkbox, Spin} from "antd"; import '../css/members.css' class ModalWrapper extends Component{ @@ -23,7 +23,7 @@ class ModalWrapper extends Component{ } render(){ let {flag, visible}=this.state - let { onOk, cancelText, okText, title, width, className, bottomRender}=this.props; + let { onOk, cancelText, okText, title, width, className, bottomRender, loading}=this.props; return( :"" } +
{this.props.children} {this.props.checkBoxValuestype===true?
@@ -59,6 +60,7 @@ class ModalWrapper extends Component{
{ bottomRender }
+
) } diff --git a/public/react/src/modules/courses/coursesDetail/CoursesLeftNav.js b/public/react/src/modules/courses/coursesDetail/CoursesLeftNav.js index 35b06f305..70794be19 100644 --- a/public/react/src/modules/courses/coursesDetail/CoursesLeftNav.js +++ b/public/react/src/modules/courses/coursesDetail/CoursesLeftNav.js @@ -181,7 +181,7 @@ class Coursesleftnav extends Component{ on('editshixunname',this.editshixunchild) on('editshixunmainname',this.editshixunmainname) - this.props.updataleftNavfun(); + // this.props.updataleftNavfun(); // this.props.getleftNavid && this.props.getleftNavid("shixun_homework"); // const position =parseInt(this.props.match.params.position); @@ -239,50 +239,52 @@ class Coursesleftnav extends Component{ setnavid=(e,key,id,type,url)=>{ // this.props.getleftNavid && this.props.getleftNavid(key,type); - let {selectnavid,navid}=this.state; - - if(navidtype===true&&selectnavid===false){ - - if(navid===key){ - this.setState({ - navid:"", - selectnavid:false, - newselectnavid:id - }) - }else{ - this.setState({ - navid:key, - positiontype:type, - selectnavid:false, - newselectnavid:id - }) - } - }else{ - // console.log(navidtype) - // console.log(selectnavid) - this.setState({ - navid:"", - selectnavid:false, - newselectnavid:id - }) - } - this.props.updataleftNavfun(); - this.props.history.replace( url ); - e.stopPropagation();//阻止冒泡 + // let {selectnavid,navid}=this.state; + // + // if(navidtype===true&&selectnavid===false){ + // + // if(navid===key){ + // this.setState({ + // navid:"", + // selectnavid:false, + // newselectnavid:id + // }) + // }else{ + // this.setState({ + // navid:key, + // positiontype:type, + // selectnavid:false, + // newselectnavid:id + // }) + // } + // }else{ + // // console.log(navidtype) + // // console.log(selectnavid) + // this.setState({ + // navid:"", + // selectnavid:false, + // newselectnavid:id + // }) + // } + // + // this.props.updataleftNavfun(); + // this.props.history.replace( url ); + // e.stopPropagation();//阻止冒泡 + this.selectnavid(e,key,id,type,url) } selectnavid=(e,key,id,type,urls,index)=>{ let {url}=this.state; if(urls!=url){ - + this.props.updataleftNavfun(); this.props.history.replace(urls); - this.props.updataleftNavfun(); }else{ if (key === this.props.indexs) { this.props.unlocationNavfun(undefined) } else { + this.props.updataleftNavfun(); this.props.unlocationNavfun(key) this.props.history.replace(urls); } @@ -304,8 +306,9 @@ class Coursesleftnav extends Component{ url:urls, indexs:index }) + this.props.updataleftNavfun(); this.props.history.replace(urls); - this.props.updataleftNavfun(); + } @@ -721,24 +724,27 @@ class Coursesleftnav extends Component{ e.stopPropagation();//阻止冒泡 } - showsandians=(e,key,urls,num)=> { + showsandians=(e,key,urls,num,id,type,index)=> { let {url}=this.state; if (key === this.props.indexs) { this.props.unlocationNavfun(undefined) this.props.history.replace(urls); } else { + this.props.updataleftNavfun(); this.props.unlocationNavfun(key) this.props.history.replace(urls); } if(urls!=url){ + this.props.updataleftNavfun(); this.props.history.replace(urls); } - // if(this.props.indexs===undefined){ - // - // }else{ - // - // } + this.setState({ + selectnavid:true, + newselectnavid:id, + url:urls, + indexs:index + }) } maincontent=(item,key)=>{ @@ -930,8 +936,8 @@ class Coursesleftnav extends Component{ return(
-
  • this.showsandians(e,key,item.category_url,1)} className={this.props.mainurl===item.category_url&&key===this.props.indexs?"liactive":"clearfix active"} onMouseLeave={(e)=>this.hidesandian(e,key)} onMouseEnter={(e)=>this.showsandian(e,key)}> - this.showsandians(e,key,item.category_url,1)} className={ item.second_category===undefined?"fl ml20 pd0":item.second_category.length===0?"fl ml20 pd0":this.state.sandiantypes===key?"fl ml20 pd0 ebebeb":"fl ml20 pd0"}> +
  • this.showsandians(e,key,item.category_url,1,item.id,item.type)} className={this.props.mainurl===item.category_url?"liactive":"clearfix active"} onMouseLeave={(e)=>this.hidesandian(e,key)} onMouseEnter={(e)=>this.showsandian(e,key)}> + this.showsandians(e,key,item.category_url,1,item.id,item.type)} className={ item.second_category===undefined?"fl ml20 pd0":item.second_category.length===0?"fl ml20 pd0":this.state.sandiantypes===key?"fl ml20 pd0 ebebeb":"fl ml20 pd0"}> { item.type==="announcement"?: item.type==="online_learning"?: @@ -976,7 +982,7 @@ class Coursesleftnav extends Component{ ref={provided.innerRef} {...provided.droppableProps} className={"droppableul"} - style={{display: this.props.mainurl===item.category_url&&key===this.props.indexs?"":"none"}} + style={{display: key===this.props.indexs?"":"none"}} > {item.second_category===undefined?"":item.second_category.map((iem,index)=>{ if(item.type==="course_group"){ @@ -1044,7 +1050,7 @@ class Coursesleftnav extends Component{
  • this.setnavid(e,key,item.id,item.type,item.category_url)} onMouseEnter={(e)=>this.showsandian(e,key)} title={item.name.length<7?"":item.name} > @@ -1069,11 +1075,8 @@ class Coursesleftnav extends Component{
  • - {/**/} - {/*下拉列表*/} - {/* className={this.props.location.pathname===item.category_url||this.props.location.pathname===this.state.url&&key===this.state.indexs?"":""}*/} -
      +
        { item.second_category===undefined?"":item.second_category.map((iem,index)=>{ @@ -1115,72 +1118,3 @@ class Coursesleftnav extends Component{ export default Coursesleftnav; -// -// sandianshow=(e,key)=>{ -// this.setState({ -// sandiantype:key -// }) -// e.stopPropagation();//阻止冒泡 -// } -// hidesandian=(e,key)=>{ -// this.setState({ -// sandiantypes:undefined -// }) -// e.stopPropagation();//阻止冒泡 -// } -// sandianshow=(e,key)=>{ -// this.setState({ -// sandiantype:key -// }) -// e.stopPropagation();//阻止冒泡 -// } - - -// sandianhide=(e)=>{ -// this.setState({ -// sandiantype:undefined, -// -// }) -// e.stopPropagation();//阻止冒泡 -// } -// twosandianshows=(e,key,type)=>{ -// -// this.setState({ -// twosandiantypenum:key, -// toopvisible:false, -// toopvisibleindex:undefined, -// twosandiantypes:type -// }) -// e.stopPropagation();//阻止冒泡 -// } -// twoMouseLeave=(e)=>{ -// this.setState({ -// toopvisible:false, -// }) -// e.stopPropagation();//阻止冒泡 -// } - - -{/*{ is_teacher===true?*/} -{/*
        */} -{/*
      • */} -{/* */} -{/* */} -{/*
        确定
        */} -{/*
        */} -{/*
      • */} -{/*
        :""}*/} - - -{/*{ is_teacher===true?
        */} -{/* */} -{/* {hidden_modules.length===0?"":hidden_modules.map((list,key)=>{*/} -{/* return(*/} -{/*
      • */} -{/* */} -{/* {list.name}*/} -{/*
      • */} -{/* )*/} -{/* })}*/} -{/*
        */} -{/*
        :""}*/} \ No newline at end of file diff --git a/public/react/src/modules/courses/coursesPublic/CoursesListType.js b/public/react/src/modules/courses/coursesPublic/CoursesListType.js index d5805c0d5..039f96914 100644 --- a/public/react/src/modules/courses/coursesPublic/CoursesListType.js +++ b/public/react/src/modules/courses/coursesPublic/CoursesListType.js @@ -30,7 +30,7 @@ class CoursesListType extends Component { return( { - typelist===undefined?"":typelist.map((item,key)=>{ + typelist===undefined || typelist=== 403 || typelist === 401 || typelist=== 407 || typelist=== 408|| typelist=== 409 || typelist === 500?"":typelist.map((item,key)=>{ return( document.querySelector('.TabsWarp')} key={key}> diff --git a/public/react/src/modules/courses/coursesPublic/NewShixunModel.js b/public/react/src/modules/courses/coursesPublic/NewShixunModel.js index bae89a7ba..062390f1e 100644 --- a/public/react/src/modules/courses/coursesPublic/NewShixunModel.js +++ b/public/react/src/modules/courses/coursesPublic/NewShixunModel.js @@ -19,19 +19,30 @@ class NewShixunModel extends Component{ order:'desc', diff:0, limit:15, + sort:"myshixuns_count" } } componentDidMount() { - let{page,type,keyword,order,diff,limit,status}=this.state; - this.getdatalist(page,type,status,keyword,order,diff,limit) + let{page,type,keyword,order,diff,limit,status,sort}=this.state; + if(this.props.type==='shixuns'){ + this.getdatalist(page,type,status,keyword,order,diff,limit) + }else{ + this.getdatalist(page,type,undefined,keyword,order,undefined,limit,undefined,sort); + } + } - getdatalist=(page,type,newstatus,keyword,order,diff,limit,pagetype)=>{ + getdatalist=(page,type,newstatus,keyword,order,diff,limit,pagetype,sort)=>{ this.setState({ isspinning:true }) let status=this.props.statustype===undefined?newstatus:'published'; - let url="/shixun_lists.json" + let url; + if(this.props.type==='shixuns'){ + url="/shixun_lists.json"; + }else{ + url="/subject_lists.json"; + } axios.get(url,{params:{ page, type, @@ -39,20 +50,21 @@ class NewShixunModel extends Component{ keyword, order, diff, - limit + limit, + sort }}).then((response) => { if(response.data){ if(pagetype===undefined){ this.setState({ - shixun_list:response.data.shixun_list, - shixuns_count:response.data.shixuns_count, + shixun_list:response.data.shixun_list===undefined?response.data.subject_list:response.data.shixun_list, + shixuns_count:response.data.shixuns_count===undefined?response.data.subjects_count:response.data.shixuns_count, Grouplist:[], isspinning:false }) }else if(pagetype==="pagetype"){ this.setState({ - shixun_list:response.data.shixun_list, - shixuns_count:response.data.shixuns_count, + shixun_list:response.data.shixun_list===undefined?response.data.subject_list:response.data.shixun_list, + shixuns_count:response.data.shixuns_count===undefined?response.data.subjects_count:response.data.shixuns_count, isspinning:false }) } @@ -127,8 +139,13 @@ class NewShixunModel extends Component{ newallGrouplist.push({page:pageNumber,list:[]}) } - let{type,status,keyword,order,diff,limit}=this.state; - this.getdatalist(pageNumber,type,status,keyword,order,diff,limit,"pagetype") + let{type,status,keyword,order,diff,limit,sort}=this.state; + if(this.props.type==='shixuns'){ + this.getdatalist(pageNumber,type,status,keyword,order,diff,limit,"pagetype") + }else{ + this.getdatalist(pageNumber,type,undefined,keyword,order,undefined,limit,"pagetype",sort); + } + this.setState({ page:pageNumber, allGrouplist:newallGrouplist @@ -142,8 +159,14 @@ class NewShixunModel extends Component{ keyword:undefined, page:1 }) - let{status,order,diff,limit}=this.state; - this.getdatalist(1,value,status,undefined,order,diff,limit) + let{status,order,diff,limit,sort}=this.state; + if(this.props.type==='shixuns'){ + this.getdatalist(1,value,status,undefined,order,diff,limit) + }else{ + this.getdatalist(1,value,undefined,undefined,order,undefined,limit,undefined,sort) + } + + } updatedlist=(order)=>{ @@ -205,7 +228,7 @@ class NewShixunModel extends Component{ this.setState({ hometypepvisible:false }) - this.showNotification("请先选择实训") + this.showNotification(this.props.type==='shixuns'?"请先选择实训":"请先选择课程") return } @@ -231,33 +254,64 @@ class NewShixunModel extends Component{ this.props.pathShixun(Grouplist) return; } - let url="/courses/"+coursesId+"/homework_commons/create_shixun_homework.json"; - axios.post(url, { - category_id:this.props.category_id===null||this.props.category_id===undefined?undefined:parseInt(this.props.category_id), - shixun_ids:Grouplist, - } - ).then((response) => { - if(response.data.status===-1){ - // this.props.showNotification(response.data.message) - - }else{ - // this.props.courseshomeworkstart(response.data.category_id,response.data.homework_ids) - this.showNotification("操作成功") - this.props.homeworkupdatalists(this.props.Coursename,this.props.page,this.props.order); - this.props.hideNewShixunModelType() - - } - this.setState({ - hometypepvisible:false + if(this.props.type==='shixuns'){ + let url="/courses/"+coursesId+"/homework_commons/create_shixun_homework.json"; + axios.post(url, { + category_id:this.props.category_id===null||this.props.category_id===undefined?undefined:parseInt(this.props.category_id), + shixun_ids:Grouplist, + } + ).then((response) => { + if(response.data.status===-1){ + // this.props.showNotification(response.data.message) + + }else{ + // this.props.courseshomeworkstart(response.data.category_id,response.data.homework_ids) + this.showNotification("操作成功") + this.props.homeworkupdatalists(this.props.Coursename,this.props.page,this.props.order); + this.props.hideNewShixunModelType() + this.props.updataleftNavfun() + } + this.setState({ + hometypepvisible:false + }) + // category_id: 3 + // homework_ids: (5) [9171, 9172, 9173, 9174, 9175] + }).catch((error) => { + console.log(error) + this.setState({ + hometypepvisible:false + }) }) - // category_id: 3 - // homework_ids: (5) [9171, 9172, 9173, 9174, 9175] - }).catch((error) => { - console.log(error) - this.setState({ - hometypepvisible:false + }else{ + let url="/courses/"+coursesId+"/homework_commons/create_subject_homework.json"; + axios.post(url, { + category_id:this.props.category_id===null||this.props.category_id===undefined?undefined:parseInt(this.props.category_id), + subject_ids:Grouplist, + } + ).then((response) => { + if(response.data.status===-1){ + // this.props.showNotification(response.data.message) + + }else{ + // this.props.courseshomeworkstart(response.data.category_id,response.data.homework_ids) + this.showNotification("操作成功") + this.props.homeworkupdatalists(this.props.Coursename,this.props.page,this.props.order); + this.props.hideNewShixunModelType() + this.props.updataleftNavfun() + } + this.setState({ + hometypepvisible:false + }) + // category_id: 3 + // homework_ids: (5) [9171, 9172, 9173, 9174, 9175] + }).catch((error) => { + console.log(error) + this.setState({ + hometypepvisible:false + }) }) - }) + } + } poststatus=(status)=>{ @@ -268,9 +322,37 @@ class NewShixunModel extends Component{ this.getdatalist(page,type,status,keyword,order,diff,limit) } + updatepathlist=(sorts,orders)=>{ + let{page,type,keyword,order,diff,limit,status,sort}=this.state; + let seartorders; + if(sort===sorts){ + if(orders==="desc"){ + this.setState({ + sort:sorts, + order:"asc" + }) + seartorders="asc" + }else{ + this.setState({ + sort:sorts, + order:"desc" + }) + seartorders="desc" + } + }else{ + this.setState({ + sort:sorts, + order:"desc" + }) + seartorders=orders + } + + this.getdatalist(page,type,undefined,keyword,seartorders,undefined,limit,undefined,sorts) + + } render() { - let {diff,Grouplist,status,shixun_list,shixuns_count,page,type,order}=this.state; + let {diff,Grouplist,status,shixun_list,shixuns_count,page,type,order,sort}=this.state; // let {visible,patheditarry}=this.props; // console.log(Grouplist) // console.log(allGrouplist) @@ -331,7 +413,7 @@ class NewShixunModel extends Component{ ); - + console.log(shixun_list) return(
        @@ -355,7 +437,7 @@ class NewShixunModel extends Component{ closable={true} destroyOnClose={true} onClose={()=>this.props.hideNewShixunModelType()} - visible={this.props.NewShixunModelType} + visible={this.props.type==='shixuns'?this.props.NewShixunModelType:this.props.shixunpath} height={'100%'} > @@ -380,7 +462,7 @@ class NewShixunModel extends Component{ 搜索} onInput={(e)=>this.setdatafunsval(e)} @@ -391,34 +473,50 @@ class NewShixunModel extends Component{
        - 已选 {Grouplist.length} 个实训 - {shixuns_count===undefined?"":shixuns_count} 个实训 + 已选 {Grouplist.length} 个{this.props.type==='shixuns'?'实训':'课程'} + {shixuns_count===undefined?"":shixuns_count} 个{this.props.type==='shixuns'?'实训':'课程'} - + {this.props.type==='shixuns'?"": + this.updatepathlist("shixuns_count",order)}>实训数 + + + + + } + + {this.props.type==='shixuns'?"": + this.updatepathlist("myshixuns_count",order)}>使用人数 + + + + + } + + {this.props.type==='shixuns'? this.updatedlist(order)}>学习人数 - + :""} - {this.props.statustype===undefined? + {this.props.type==='shixuns'?this.props.statustype===undefined? {status==='all'?"发布状态":status==='published'?"已发布":status==="unpublished"?"未发布":""} - :""} + :"":""} - + {this.props.type==='shixuns'? {diff===0?"难度":diff===1?"初级":diff===2?"中级":diff===3?"高级":diff===4?"顶级":""} - + :""}
        {/*this.props.hideNewShixunModelType()}>返回*/} - this.belongto("mine")}>我的实训 - this.belongto("all")}>全部实训 + this.belongto("mine")}>我的{this.props.type==='shixuns'?'实训':"课程"} + this.belongto("all")}>全部{this.props.type==='shixuns'?'实训':"课程"}
        @@ -461,7 +559,7 @@ class NewShixunModel extends Component{ {JSON.stringify(item.description) == "{}"?"":
        } - {item.challenge_names.length===0?"":
        + {item.challenge_names===undefined?"":item.challenge_names.length===0?"":
        {item.challenge_names.map((item,key)=>{ return( 第{key+1}关:{item} @@ -498,7 +596,7 @@ class NewShixunModel extends Component{
        - {item.subjects.length===0?"":this.ItsCourse(item.subjects)}> + {item.subjects===undefined?"":item.subjects.length===0?"":this.ItsCourse(item.subjects)}> 所属课程 diff --git a/public/react/src/modules/courses/exercise/ExerciseListItem.js b/public/react/src/modules/courses/exercise/ExerciseListItem.js index f61a7852b..07606bd58 100644 --- a/public/react/src/modules/courses/exercise/ExerciseListItem.js +++ b/public/react/src/modules/courses/exercise/ExerciseListItem.js @@ -51,6 +51,26 @@ class ExerciseListItem extends Component{ Loadtype:false }) } + + toDetailPage=(url)=>{ + + if(this.props.checkIfLogin()===false){ + this.props.showLoginDialog() + return + } + // if(this.props.checkIfProfileCompleted()===false){ + // this.setState({ + // AccountProfiletype:true + // }) + // return + // } + // if(this.props.checkIfProfessionalCertification()===false){ + // this.props.showProfileCompleteDialog() + // return + // } + + this.props.history.push(url); + } render(){ let{item,checkBox,index}=this.props; let {coursesId,Id}=this.props.match.params @@ -96,20 +116,20 @@ class ExerciseListItem extends Component{ {/*{item.exercise_name}*/} { - this.props.isAdmin()? {item.exercise_name}:"" + onClick={()=>this.toDetailPage(`/courses/${coursesId}/exercises/${item.id}/student_exercise_list?tab=0`)}>{item.exercise_name}:"" } { this.props.isStudent()? - {item.exercise_name}:"" + this.toDetailPage(`/courses/${coursesId}/exercises/${item.id}/student_exercise_list?tab=0`)}>{item.exercise_name}:"" } { this.props.isNotMember()? item.lock_status === 0 ? - {item.exercise_name} - : {item.exercise_name}:"" + {item.exercise_name} + : this.toDetailPage(`/courses/${coursesId}/exercises/${item.id}/student_exercise_list?tab=0`)}>{item.exercise_name}:"" } { @@ -150,13 +170,13 @@ class ExerciseListItem extends Component{ { item.exercise_status ===2? - {item.exercise_left_time} + {"提交剩余时间:"+item.exercise_left_time} :"" } - { - item.exercise_status ===3? + { + item.exercise_left_time===null?"":item.exercise_status ===3? - {item.exercise_left_time} + {"截止剩余时间:"+item.exercise_left_time} :"" } {/*{*/} diff --git a/public/react/src/modules/courses/exercise/Studentshavecompletedthelist.js b/public/react/src/modules/courses/exercise/Studentshavecompletedthelist.js index 6fdde6aeb..57f574ac4 100644 --- a/public/react/src/modules/courses/exercise/Studentshavecompletedthelist.js +++ b/public/react/src/modules/courses/exercise/Studentshavecompletedthelist.js @@ -1278,20 +1278,6 @@ class Studentshavecompletedthelist extends Component { }catch (e) { } - try { - if(this.props.Commonheadofthetestpaper.exercise_status !== undefined){ - this.setState({ - exercise_status:this.props.Commonheadofthetestpaper.exercise_status, - }) - }else{ - this.setState({ - exercise_status:0, - }) - } - }catch (e) { - - } - } componentWillReceiveProps = (nextProps) => { @@ -1330,7 +1316,7 @@ class Studentshavecompletedthelist extends Component { }) if (response.data.current_answer_user === undefined || response.data.current_answer_user === null) { // 学生未截止 - + // console.log("试卷学生未截止"); this.Generatenewdatas(response.data.exercise_users); if (response.data.exercise_types.subjective === 0) { if (this.state.noclassroom === undefined || this.state.noclassroom === "" || this.state.noclassroom === null) { @@ -1377,6 +1363,7 @@ class Studentshavecompletedthelist extends Component { } } else { //学生已截止 + // console.log("试卷学生已截止"); if (response.data.exercise_types.subjective === 0) { if (this.state.loadingstate === false) { var arr =[]; @@ -1458,7 +1445,7 @@ class Studentshavecompletedthelist extends Component { else if (response.data.exercise_types.user_permission === 0) { // console.log(response.data.exercise_users) // console.log(response) - + // console.log("试卷老师加载中"); if (thiss.state.loadingstate === false) { thiss.setState({ loadingstate: true, @@ -1469,7 +1456,9 @@ class Studentshavecompletedthelist extends Component { thiss.Generatenewdatasy(response.data.exercise_users, response); } }).catch((error) => { - console.log(error) + console.log(error); + console.log("其实数据加载失败了"); + console.log("1111"); }); @@ -2490,16 +2479,22 @@ class Studentshavecompletedthelist extends Component { let {data, datas, page, columns, course_groupyslsthree, columnstwo, styletable,exercise_status, course_groupyslstwodatas, limit, course_groupysls, course_groupyslstwodata, course_groupyslstwo, teacherlists, Teacherliststudentlist, order, columnss, course_groupsdatas, course_groups, Evaluationarray, unlimited, unlimiteds, unlimitedtwo, teacherlist, searchtext, loadingstate, review, nocomment, commented, unsubmitted, submitted, columnsys, exercise_users,mylistansum} = this.state; // console.log("Studentshavecompletedthelist"); // console.log(this.props.current_status); + // console.log("获取到的数据"); + // console.log(datas); + // console.log(data); + // console.log("this.props.Commonheadofthetestpaper.exercise_status"); + // console.log(this.props.Commonheadofthetestpaper&&this.props.Commonheadofthetestpaper.exercise_status); + // console.log(exercise_status); return ( isAdmin === true ? (
        {/*老师*/} { - exercise_status===0 || exercise_status===1 ? + this.props.Commonheadofthetestpaper&&this.props.Commonheadofthetestpaper.exercise_status===0 || this.props.Commonheadofthetestpaper&&this.props.Commonheadofthetestpaper.exercise_status===1 ?
        @@ -2598,9 +2593,9 @@ class Studentshavecompletedthelist extends Component { {course_groups === undefined ? "" : course_groups === null ? "" : course_groups.length < 2 ? "" : JSON.stringify(course_groups) === "[]" ? "" :
      • - 分班情况: - this.funtaskstatustwos()}>不限 @@ -2714,9 +2709,9 @@ class Studentshavecompletedthelist extends Component { Teacherliststudentlist === undefined || Teacherliststudentlist.current_answer_user === undefined || Teacherliststudentlist.current_answer_user === null ?
        + style={{"margin": "0 auto", "padding-bottom": "100px", minWidth: " 1200px"}}> { - exercise_status === 0 || exercise_status === 1 ? + this.props.Commonheadofthetestpaper&&this.props.Commonheadofthetestpaper.exercise_status === 0 || this.props.Commonheadofthetestpaper&&this.props.Commonheadofthetestpaper.exercise_status === 1 ?
        @@ -2794,10 +2789,10 @@ class Studentshavecompletedthelist extends Component {
        { - exercise_status === 0 || exercise_status === 1 ? + this.props.Commonheadofthetestpaper&&this.props.Commonheadofthetestpaper.exercise_status === 0 || this.props.Commonheadofthetestpaper&&this.props.Commonheadofthetestpaper.exercise_status === 1 ?
        diff --git a/public/react/src/modules/courses/exercise/Testpapersettinghomepage.js b/public/react/src/modules/courses/exercise/Testpapersettinghomepage.js index ba3cee3d3..d878eb872 100644 --- a/public/react/src/modules/courses/exercise/Testpapersettinghomepage.js +++ b/public/react/src/modules/courses/exercise/Testpapersettinghomepage.js @@ -436,22 +436,22 @@ class Testpapersettinghomepage extends Component{ /> { // 教师列表 - parseInt(tab[0])==0 && this.setcourse_groupysls(value)} current_status = {this.state.current_status} Commonheadofthetestpaper={this.state.Commonheadofthetestpaper}> + parseInt(tab[0])==0 ? this.setcourse_groupysls(value)} current_status = {this.state.current_status} Commonheadofthetestpaper={this.state.Commonheadofthetestpaper}>:"" } {/*统计结果*/} { - parseInt(tab[0])==1 && + parseInt(tab[0])==1 ? :"" } { - parseInt(tab[0])==2 && + parseInt(tab[0])==2 ? :"" } { - parseInt(tab[0])==3 && + parseInt(tab[0])==3 ? :"" }
        diff --git a/public/react/src/modules/courses/graduation/tasks/GraduateTaskItem.js b/public/react/src/modules/courses/graduation/tasks/GraduateTaskItem.js index d45b7d60f..2b27571e2 100644 --- a/public/react/src/modules/courses/graduation/tasks/GraduateTaskItem.js +++ b/public/react/src/modules/courses/graduation/tasks/GraduateTaskItem.js @@ -133,6 +133,26 @@ class GraduateTaskItem extends Component{ setupdate=()=>{ this.props.funlist } + + toDetailPage=(url)=>{ + + if(this.props.checkIfLogin()===false){ + this.props.showLoginDialog() + return + } + // if(this.props.checkIfProfileCompleted()===false){ + // this.setState({ + // AccountProfiletype:true + // }) + // return + // } + // if(this.props.checkIfProfessionalCertification()===false){ + // this.props.showProfileCompleteDialog() + // return + // } + + this.props.history.push(url); + } render(){ let { Modalstype, @@ -215,20 +235,20 @@ class GraduateTaskItem extends Component{
        { - this.props.isAdmin?this.toDetailPage("/courses/"+coursesId+"/graduation_tasks/"+categoryid+"/detail/"+taskid+"/list")} title={discussMessage.name} - className="fl mt3 font-16 font-bd color-dark maxwidth580">{discussMessage.name}:"" + className="fl mt3 font-16 font-bd color-dark maxwidth580">{discussMessage.name}:"" } { - this.props.isStudent? this.toDetailPage("/courses/"+coursesId+"/graduation_tasks/"+categoryid+"/detail/"+taskid+"/list")} title={discussMessage.name} - className="fl mt3 font-16 font-bd color-dark maxwidth580">{discussMessage.name}:"" + className="fl mt3 font-16 font-bd color-dark maxwidth580">{discussMessage.name}:"" } { this.props.isNotMember===true?this.props.discussMessage.private_icon===true? - {discussMessage.name} - :{discussMessage.name} + :this.toDetailPage("/courses/"+coursesId+"/graduation_tasks/"+categoryid+"/"+taskid+"/list")} title={discussMessage.name} className="fl mt3 font-16 font-bd color-dark maxwidth580">{discussMessage.name}:"" } @@ -249,15 +269,15 @@ class GraduateTaskItem extends Component{
        -

        +

        {/* {discussMessage.author.name} */} - + { discussMessage.author && {discussMessage.author} } {discussMessage.commit_count===undefined?"":{discussMessage.commit_count} 已交} {discussMessage.uncommit_count===undefined?"":{discussMessage.uncommit_count} 未交} {/*{discussMessage.replies_count} 3 未评*/} - - {discussMessage.status_time} + + {discussMessage.task_status===1&&discussMessage.status_time!=""&&discussMessage.status_time!=null?"提交剩余时间:"+discussMessage.status_time:discussMessage.task_status===2&&discussMessage.status_time!=""&&discussMessage.status_time!=null?"补交剩余时间:"+discussMessage.status_time:discussMessage.task_status===3&&discussMessage.status_time!=""&&discussMessage.status_time!=null?"交叉评阅剩余时间:"+discussMessage.status_time:discussMessage.status_time} {/* { discussMessage.replies_count != 0 && {discussMessage.replies_count} 回复 } diff --git a/public/react/src/modules/courses/graduation/tasks/GraduationTasksappraise.js b/public/react/src/modules/courses/graduation/tasks/GraduationTasksappraise.js index 55dfd9855..f0bead58f 100644 --- a/public/react/src/modules/courses/graduation/tasks/GraduationTasksappraise.js +++ b/public/react/src/modules/courses/graduation/tasks/GraduationTasksappraise.js @@ -32,8 +32,10 @@ class GraduationTasksappraise extends Component{ axios.get(zrl).then((result)=>{ if(result.status===200){ + let status=result.data.status; + if(status===undefined || status=== 403 || status === 401 || status=== 407 || status=== 408|| status=== 409 || status === 500||status===-1){ - if(result.data.status!=-1){ + }else{ this.setState({ firelistdata:result.data, }) diff --git a/public/react/src/modules/courses/graduation/tasks/GraduationTasksappraiseMainEditor.js b/public/react/src/modules/courses/graduation/tasks/GraduationTasksappraiseMainEditor.js index 9222d3af2..5494ba05f 100644 --- a/public/react/src/modules/courses/graduation/tasks/GraduationTasksappraiseMainEditor.js +++ b/public/react/src/modules/courses/graduation/tasks/GraduationTasksappraiseMainEditor.js @@ -209,7 +209,7 @@ class GraduationTasksappraiseMainEditor extends Component{ `} {this.props.title && {this.props.title}} + watch={false} height={160} className={errorMessage ? 'editorInputError' : ''} imageExpand={true}> { showSameScore == true &&

        整组同评 (选中,则本次评阅对象指小组全部成员,否则仅评阅此成员1人 ) diff --git a/public/react/src/modules/courses/graduation/tasks/GraduationTaskssetting.js b/public/react/src/modules/courses/graduation/tasks/GraduationTaskssetting.js index 3adf9c06e..5ca6ee537 100644 --- a/public/react/src/modules/courses/graduation/tasks/GraduationTaskssetting.js +++ b/public/react/src/modules/courses/graduation/tasks/GraduationTaskssetting.js @@ -80,6 +80,8 @@ class GraduationTaskssettingapp extends Component{ starttime:undefined, DownloadType:false, DownloadMessageval:undefined, + commentstatustype:undefined, + commenttimeone:undefined } } @@ -102,10 +104,10 @@ class GraduationTaskssettingapp extends Component{ } let starttype=false; let endtype=false; - if(moment(result.data.publish_time){ - let {latetime,end_time,allowlate}=this.state; + let {latetime,end_time,allowlate,commenttime,commenttimeone}=this.state; + let commenttimetype=commenttime===null||commenttime===""; + let newlatetimea=moment(new Date()).add(7, 'days').format("YYYY-MM-DD HH:mm"); let newcommenttimea=moment(new Date()).format("YYYY-MM-DD HH:mm"); @@ -377,26 +385,33 @@ class GraduationTaskssettingapp extends Component{ let newend_timed=moment(end_time).add(7, 'days').format("YYYY-MM-DD HH:mm"); let newcommenttimed=moment(end_time).add(8, 'days').format("YYYY-MM-DD HH:mm"); - let newtime; if(e.target.checked===true){ - - if(allowlate===1||allowlate===true){ - if(latetime===null||latetime===""){ - this.updatesfuncrosscomment(1,newlatetimea,newcommenttimea) - }else{ - this.updatesfuncrosscomment(1,newlatetimes,newcommenttimes) - } - }else{ - if(end_time===null||end_time===""){ - this.updatesfuncrosscomment(2,newend_timeb,newcommenttimeb) + if(commenttimetype===true){ + + if(allowlate===1||allowlate===true){ + if(latetime===null||latetime===""){ + this.updatesfuncrosscomment(1,newlatetimea,newcommenttimea) + }else{ + this.updatesfuncrosscomment(1,newlatetimes,newcommenttimes) + } + }else{ + if(end_time===null||end_time===""){ + this.updatesfuncrosscomment(2,newend_timeb,newcommenttimeb) + }else{ + this.updatesfuncrosscomment(2,newend_timed,newcommenttimed) + } + } }else{ - this.updatesfuncrosscomment(2,newend_timed,newcommenttimed) - } - } + this.setState({ + crosscomment:e.target.checked, + commenttime:commenttimeone, + }) + } + }else{ this.setState({ crosscomment:e.target.checked, - commenttime:undefined + commenttime:undefined }) } } @@ -519,10 +534,10 @@ class GraduationTaskssettingapp extends Component{ } - if(moment(end_time)
        评分设置
        最终成绩组成 (取各教师最终评分的平均分)
        - 启用交叉评阅 (给老师分配其他指导老师的学生作品) - + + 启用交叉评阅 (给老师分配其他指导老师的学生作品) + + {crosscomment===true?
        开始时间: diff --git a/public/react/src/modules/courses/graduation/tasks/GraduationTaskssettinglist.js b/public/react/src/modules/courses/graduation/tasks/GraduationTaskssettinglist.js index 20a34ab89..0720d7240 100644 --- a/public/react/src/modules/courses/graduation/tasks/GraduationTaskssettinglist.js +++ b/public/react/src/modules/courses/graduation/tasks/GraduationTaskssettinglist.js @@ -40,7 +40,7 @@ class GraduationTaskssettinglist extends Component{ task_status:undefined, cross_comment:null, search:null, - order:"updated_at", + order:"update_time", b_order:"desc", course_group:undefined, loadingstate:true, @@ -92,6 +92,7 @@ class GraduationTaskssettinglist extends Component{ seacthdata=(teacher_comment,task_status,course_group,cross_comment,order,b_order,search,pages)=>{ let{page,limit}=this.state; + // console.log(teacher_comment,task_status,course_group,cross_comment,order,b_order,search) let task_Id=this.props.match.params.task_Id; let url="/graduation_tasks/"+task_Id+"/tasks_list.json"; @@ -106,7 +107,7 @@ class GraduationTaskssettinglist extends Component{ order:order===null?undefined:order, b_order:b_order===null?undefined:b_order, search:search===null?undefined:search, - page:pages===null?undefined:page, + page:pages, limit:20, }, paramsSerializer: function(params) { @@ -281,8 +282,6 @@ class GraduationTaskssettinglist extends Component{ funtaskstatus=(checkedValues,key)=>{ // console.log(checkedValues) - console.log(checkedValues); - let {teacher_comment, course_group, cross_comment, order, b_order, search} = this.state; @@ -599,7 +598,7 @@ class GraduationTaskssettinglist extends Component{ this.cannerassocition(); let {taskslistdata}=this.state; let url = "/graduation_tasks/"+taskslistdata.task_id+"/graduation_works/cancel_relate_project.json"; - console.log(url) + axios.get(url).then((result)=>{ if(result.data.status===0){ @@ -655,8 +654,7 @@ class GraduationTaskssettinglist extends Component{ /// 确认是否下载 confirmysl(url){ - debugger; - console.log(1); + let {teacher_comment, task_status, course_group, cross_comment, order, b_order, search,page} =this.state; let params ={ @@ -850,47 +848,47 @@ class GraduationTaskssettinglist extends Component{ ), }, { - title: '操作', - key: 'operation', - width:'100px', - dataIndex: 'operation', - className:'edu-txt-center', - render: operation => ( -
        - {this.props.isAdmin()?operation.map((tag,key) => { - return( - - { - tag.name && - 调整学生最终成绩
        其它历史评分将全部失效:""}> - {tag.name==="评阅"? - {tag.name} - - : - this.showModulationtype(tag.id):tag.name==="分配"?()=>this.showAllocationModal(tag.id):""}> - {tag.name} - - } -
        - } -
        - ) - }):""} - { - this.props.isStudent()? - operation.map((tag,key) => { - return( -
        - {tag.view_work===false?"--":查看} -
        - )} - ):"" - } -
        + title: '操作', + key: 'operation', + width:'100px', + dataIndex: 'operation', + className:'edu-txt-center', + render: operation => ( +
        + {this.props.isAdmin()?operation.map((tag,key) => { + return( + + { + tag.name && + 调整学生最终成绩
        其它历史评分将全部失效:""}> + {tag.name==="评阅"? + {tag.name} + + : + this.showModulationtype(tag.id):tag.name==="分配"?()=>this.showAllocationModal(tag.id):""}> + {tag.name} + + } +
        + } +
        + ) + }):""} + { + this.props.isStudent()? + operation.map((tag,key) => { + return( +
        + {tag.view_work===false?"--":查看} +
        + )} + ):"" + } +
        - ), - }]; + ), + }]; let courseId=this.props.match.params.coursesId; let position=this.props.match.params.position; @@ -958,7 +956,7 @@ class GraduationTaskssettinglist extends Component{ } - console.log(this.props.questionslist.status) + return( @@ -972,7 +970,7 @@ class GraduationTaskssettinglist extends Component{ text-overflow: ellipsis; white-space: nowrap; } - .ant-table-tbody>tr>td, .ant-table-thead>tr>th{ + .ant-table-tbody>tr>td, .ant-table-thead>tr>th{ padding: 16px 10px } @@ -1217,14 +1215,14 @@ class GraduationTaskssettinglist extends Component{
        {this.props.isAdmin()===true? {taskslistdata&&taskslistdata.work_count} - 个检索结果({taskslistdata&&taskslistdata.work_count} 学生):""} + 个检索结果({taskslistdata&&taskslistdata.all_work_count} 学生):""} {this.props.isAdmin()===true?

        - {order==="updated_at"?"更新时间":order==="work_score"?"最终成绩":order==="student_id"?"学生学号":""}排序 + {order==="update_time"?"更新时间":order==="work_score"?"最终成绩":order==="student_id"?"学生学号":""}排序

          -
        • this.funorder("updated_at")}>更新时间 +
        • this.funorder("update_time")}>更新时间
        • this.funorder("work_score" )}>最终成绩
        • @@ -1415,10 +1413,10 @@ class GraduationTaskssettinglist extends Component{

          - {order==="updated_at"?"时间":order==="work_score"?"成绩":order==="student_id"?"学号":""}排序

            -
          • this.funorder("updated_at")} className={order==="updated_at"?"none":""}>时间 +
          • this.funorder("update_time")} className={order==="update_time"?"none":""}>时间
          • this.funorder("work_score" )} className={order==="work_score"?"none":""}>成绩
          • diff --git a/public/react/src/modules/courses/graduation/tasks/index.js b/public/react/src/modules/courses/graduation/tasks/index.js index ed52d5cbc..f33614e76 100644 --- a/public/react/src/modules/courses/graduation/tasks/index.js +++ b/public/react/src/modules/courses/graduation/tasks/index.js @@ -88,7 +88,7 @@ class GraduationTasks extends Component{ savedelete=()=>{ this.setState({ - Modalstype:false, + Modalstype:false, }) let {checkAllValue,checkBoxValues,search,page,order} = this.state; // let all_check; @@ -107,9 +107,10 @@ class GraduationTasks extends Component{ if (response.data.status == 0) { // {"status":1,"message":"删除成功"} this.fetchAll(search,page,order) + this.props.showNotification(response.data.message); this.setState({ - Modalstype:true, - Modalstopval:response.data.message, + // Modalstype:true, + // Modalstopval:response.data.message, ModalsBottomval:"", ModalSave:this.cancelmodel, Loadtype:true, @@ -128,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 } } @@ -611,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(category_id) return( {/*提示*/} @@ -709,7 +709,7 @@ class GraduationTasks extends Component{ {this.props.isAdmin()?all_count===undefined?'' :all_count===0?"":
            - 已选 {checkBoxValues.length} 个 (不支持跨页勾选) + 已选 {checkBoxValues===undefined?0:checkBoxValues.length} 个 (不支持跨页勾选)
          • 删除
          • @@ -736,13 +736,15 @@ class GraduationTasks extends Component{ border-radius: 2px; } `} - + { tasks&&tasks.map((item, index) => { // console.log(item) return (
            { + + if(this.props.checkIfLogin()===false){ + this.props.showLoginDialog() + return + } + // if(this.props.checkIfProfileCompleted()===false){ + // this.setState({ + // AccountProfiletype:true + // }) + // return + // } + // if(this.props.checkIfProfessionalCertification()===false){ + // this.props.showProfileCompleteDialog() + // return + // } + let courseId=this.props.match.params.coursesId; this.props.history.push(`/courses/${courseId}/graduation_topics/${topicId}/detail`); } @@ -67,19 +83,23 @@ class GraduateTopicItem extends Component{ text-overflow:ellipsis; white-space:nowrap } + a:hover{ + color: #4cacff; + } `}
            { isNotMember? - {discussMessage.name}:"" - + discussMessage.private_icon===true?{discussMessage.name}: + {discussMessage.name} + :"" } { isStudent? this.toDetailPage(`${discussMessage.id}`)} - className="fl mt3 font-16 font-bd color-dark maxwidth580">{discussMessage.name}:"" + className="fl mt3 font-16 font-bd color-dark maxwidth580" title={discussMessage.name}>{discussMessage.name}:"" } { - isAdmin? this.toDetailPage(`${discussMessage.id}`)} className="fl mt3 font-16 font-bd color-dark maxwidth580">{discussMessage.name}:"" + isAdmin? this.toDetailPage(`${discussMessage.id}`)} className="fl mt3 font-16 font-bd color-dark maxwidth580" title={discussMessage.name}>{discussMessage.name}:"" } { discussMessage.private_icon===true? diff --git a/public/react/src/modules/courses/members/modal/AddStudentModal.js b/public/react/src/modules/courses/members/modal/AddStudentModal.js index ddd1164ea..efa801182 100644 --- a/public/react/src/modules/courses/members/modal/AddStudentModal.js +++ b/public/react/src/modules/courses/members/modal/AddStudentModal.js @@ -68,7 +68,7 @@ class AddStudentModal extends Component{ if (response.data.course_groups && response.data.course_groups.length) { this.setState({ course_groups: response.data.course_groups, - courseGroup: response.data.course_groups[0].id + courseGroup: '0' // response.data.course_groups[0].id }) } else { // showNotification('') @@ -268,6 +268,7 @@ class AddStudentModal extends Component{ {course_groups && course_groups.length &&
            所选学生分班至(选填): 问卷须知