From 7d94699bf88d4974d593bff83b0f5f1255ffb398 Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Fri, 6 Sep 2019 09:21:33 +0800 Subject: [PATCH 01/18] /projects/${project_info.id --- public/react/src/modules/courses/busyWork/CommonWorkAppraise.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/react/src/modules/courses/busyWork/CommonWorkAppraise.js b/public/react/src/modules/courses/busyWork/CommonWorkAppraise.js index 698fbd398..63d32aba1 100644 --- a/public/react/src/modules/courses/busyWork/CommonWorkAppraise.js +++ b/public/react/src/modules/courses/busyWork/CommonWorkAppraise.js @@ -254,7 +254,7 @@ class CommonWorkAppraise extends Component{ 关联项目
- {project_info.name} + {project_info.name}
} From 6a9c9b6b8f90ae85738151ce95a456cedd2c9d5c Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Fri, 6 Sep 2019 09:23:25 +0800 Subject: [PATCH 02/18] color --- public/react/src/modules/courses/busyWork/CommonWorkAppraise.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/react/src/modules/courses/busyWork/CommonWorkAppraise.js b/public/react/src/modules/courses/busyWork/CommonWorkAppraise.js index 63d32aba1..04ccb3ea1 100644 --- a/public/react/src/modules/courses/busyWork/CommonWorkAppraise.js +++ b/public/react/src/modules/courses/busyWork/CommonWorkAppraise.js @@ -254,7 +254,7 @@ class CommonWorkAppraise extends Component{ 关联项目
- {project_info.name} + {project_info.name}
} From 04335a0678abecd314463faaaaca321e3d62715b Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Fri, 6 Sep 2019 09:40:58 +0800 Subject: [PATCH 03/18] ("`$$$$`"); --- .../react/src/modules/courses/coursesPublic/CoursesMarkdown.js | 2 +- public/react/src/modules/projectPackages/MDEditors.js | 2 +- public/react/src/modules/tpm/challengesnew/TPMMDEditor.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/public/react/src/modules/courses/coursesPublic/CoursesMarkdown.js b/public/react/src/modules/courses/coursesPublic/CoursesMarkdown.js index 3538aaf57..4510a7080 100644 --- a/public/react/src/modules/courses/coursesPublic/CoursesMarkdown.js +++ b/public/react/src/modules/courses/coursesPublic/CoursesMarkdown.js @@ -139,7 +139,7 @@ function create_editorMD(id, width, high, placeholder, imageUrl, callback, initV }); $("#" + _id + " [type=\"inline\"]").bind("click", function () { - _editorName.cm.replaceSelection("$$$$"); + _editorName.cm.replaceSelection("`$$$$`"); var __Cursor = _editorName.cm.getDoc().getCursor(); _editorName.cm.setCursor(__Cursor.line, __Cursor.ch - 2); _editorName.cm.focus(); diff --git a/public/react/src/modules/projectPackages/MDEditors.js b/public/react/src/modules/projectPackages/MDEditors.js index 2c11e0895..61e26db23 100644 --- a/public/react/src/modules/projectPackages/MDEditors.js +++ b/public/react/src/modules/projectPackages/MDEditors.js @@ -166,7 +166,7 @@ function create_editorMD(id, width, high, placeholder, imageUrl, callback, initV }); $("#" + _id + " [type=\"inline\"]").bind("click", function () { - _editorName.cm.replaceSelection("$$$$"); + _editorName.cm.replaceSelection("`$$$$`"); var __Cursor = _editorName.cm.getDoc().getCursor(); _editorName.cm.setCursor(__Cursor.line, __Cursor.ch - 2); _editorName.cm.focus(); diff --git a/public/react/src/modules/tpm/challengesnew/TPMMDEditor.js b/public/react/src/modules/tpm/challengesnew/TPMMDEditor.js index 10cddfd31..f50766843 100644 --- a/public/react/src/modules/tpm/challengesnew/TPMMDEditor.js +++ b/public/react/src/modules/tpm/challengesnew/TPMMDEditor.js @@ -169,7 +169,7 @@ function create_editorMD(id, width, high, placeholder, imageUrl, callback, initV }); $("#" + _id + " [type=\"inline\"]").bind("click", function () { - _editorName.cm.replaceSelection("$$$$"); + _editorName.cm.replaceSelection("`$$$$`"); var __Cursor = _editorName.cm.getDoc().getCursor(); _editorName.cm.setCursor(__Cursor.line, __Cursor.ch - 2); _editorName.cm.focus(); From 01e27c72aad734af8b5325f1ff784e85b462e993 Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Fri, 6 Sep 2019 09:42:00 +0800 Subject: [PATCH 04/18] Revert "("`$$$$`");" This reverts commit 04335a0678abecd314463faaaaca321e3d62715b. --- .../react/src/modules/courses/coursesPublic/CoursesMarkdown.js | 2 +- public/react/src/modules/projectPackages/MDEditors.js | 2 +- public/react/src/modules/tpm/challengesnew/TPMMDEditor.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/public/react/src/modules/courses/coursesPublic/CoursesMarkdown.js b/public/react/src/modules/courses/coursesPublic/CoursesMarkdown.js index 4510a7080..3538aaf57 100644 --- a/public/react/src/modules/courses/coursesPublic/CoursesMarkdown.js +++ b/public/react/src/modules/courses/coursesPublic/CoursesMarkdown.js @@ -139,7 +139,7 @@ function create_editorMD(id, width, high, placeholder, imageUrl, callback, initV }); $("#" + _id + " [type=\"inline\"]").bind("click", function () { - _editorName.cm.replaceSelection("`$$$$`"); + _editorName.cm.replaceSelection("$$$$"); var __Cursor = _editorName.cm.getDoc().getCursor(); _editorName.cm.setCursor(__Cursor.line, __Cursor.ch - 2); _editorName.cm.focus(); diff --git a/public/react/src/modules/projectPackages/MDEditors.js b/public/react/src/modules/projectPackages/MDEditors.js index 61e26db23..2c11e0895 100644 --- a/public/react/src/modules/projectPackages/MDEditors.js +++ b/public/react/src/modules/projectPackages/MDEditors.js @@ -166,7 +166,7 @@ function create_editorMD(id, width, high, placeholder, imageUrl, callback, initV }); $("#" + _id + " [type=\"inline\"]").bind("click", function () { - _editorName.cm.replaceSelection("`$$$$`"); + _editorName.cm.replaceSelection("$$$$"); var __Cursor = _editorName.cm.getDoc().getCursor(); _editorName.cm.setCursor(__Cursor.line, __Cursor.ch - 2); _editorName.cm.focus(); diff --git a/public/react/src/modules/tpm/challengesnew/TPMMDEditor.js b/public/react/src/modules/tpm/challengesnew/TPMMDEditor.js index f50766843..10cddfd31 100644 --- a/public/react/src/modules/tpm/challengesnew/TPMMDEditor.js +++ b/public/react/src/modules/tpm/challengesnew/TPMMDEditor.js @@ -169,7 +169,7 @@ function create_editorMD(id, width, high, placeholder, imageUrl, callback, initV }); $("#" + _id + " [type=\"inline\"]").bind("click", function () { - _editorName.cm.replaceSelection("`$$$$`"); + _editorName.cm.replaceSelection("$$$$"); var __Cursor = _editorName.cm.getDoc().getCursor(); _editorName.cm.setCursor(__Cursor.line, __Cursor.ch - 2); _editorName.cm.focus(); From 48322cb6a7d5f2d9b6c33e7f3a5583a643a636c4 Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Fri, 6 Sep 2019 09:43:14 +0800 Subject: [PATCH 05/18] `` --- .../react/src/modules/courses/coursesPublic/CoursesMarkdown.js | 2 +- public/react/src/modules/projectPackages/MDEditors.js | 2 +- public/react/src/modules/tpm/challengesnew/TPMMDEditor.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/public/react/src/modules/courses/coursesPublic/CoursesMarkdown.js b/public/react/src/modules/courses/coursesPublic/CoursesMarkdown.js index 3538aaf57..4510a7080 100644 --- a/public/react/src/modules/courses/coursesPublic/CoursesMarkdown.js +++ b/public/react/src/modules/courses/coursesPublic/CoursesMarkdown.js @@ -139,7 +139,7 @@ function create_editorMD(id, width, high, placeholder, imageUrl, callback, initV }); $("#" + _id + " [type=\"inline\"]").bind("click", function () { - _editorName.cm.replaceSelection("$$$$"); + _editorName.cm.replaceSelection("`$$$$`"); var __Cursor = _editorName.cm.getDoc().getCursor(); _editorName.cm.setCursor(__Cursor.line, __Cursor.ch - 2); _editorName.cm.focus(); diff --git a/public/react/src/modules/projectPackages/MDEditors.js b/public/react/src/modules/projectPackages/MDEditors.js index 2c11e0895..61e26db23 100644 --- a/public/react/src/modules/projectPackages/MDEditors.js +++ b/public/react/src/modules/projectPackages/MDEditors.js @@ -166,7 +166,7 @@ function create_editorMD(id, width, high, placeholder, imageUrl, callback, initV }); $("#" + _id + " [type=\"inline\"]").bind("click", function () { - _editorName.cm.replaceSelection("$$$$"); + _editorName.cm.replaceSelection("`$$$$`"); var __Cursor = _editorName.cm.getDoc().getCursor(); _editorName.cm.setCursor(__Cursor.line, __Cursor.ch - 2); _editorName.cm.focus(); diff --git a/public/react/src/modules/tpm/challengesnew/TPMMDEditor.js b/public/react/src/modules/tpm/challengesnew/TPMMDEditor.js index 10cddfd31..f50766843 100644 --- a/public/react/src/modules/tpm/challengesnew/TPMMDEditor.js +++ b/public/react/src/modules/tpm/challengesnew/TPMMDEditor.js @@ -169,7 +169,7 @@ function create_editorMD(id, width, high, placeholder, imageUrl, callback, initV }); $("#" + _id + " [type=\"inline\"]").bind("click", function () { - _editorName.cm.replaceSelection("$$$$"); + _editorName.cm.replaceSelection("`$$$$`"); var __Cursor = _editorName.cm.getDoc().getCursor(); _editorName.cm.setCursor(__Cursor.line, __Cursor.ch - 2); _editorName.cm.focus(); From 3970b808d2aebd81bcab51e09433a69c9ab86cdc Mon Sep 17 00:00:00 2001 From: SylorHuang Date: Fri, 6 Sep 2019 10:01:18 +0800 Subject: [PATCH 06/18] admins page change --- app/controllers/admins/department_applies_controller.rb | 5 ++++- app/views/admins/department_applies/shared/_list.html.erb | 2 +- app/views/admins/library_applies/shared/_list.html.erb | 2 +- .../admins/project_package_applies/shared/_list.html.erb | 2 +- app/views/admins/shixun_authorizations/shared/_list.html.erb | 2 +- app/views/admins/shixun_settings/shared/_td.html.erb | 2 +- app/views/admins/shixuns/shared/_list.html.erb | 2 +- .../admins/subject_authorizations/shared/_list.html.erb | 2 +- app/views/admins/unit_applies/shared/_apply_item.html.erb | 2 +- app/views/admins/video_applies/shared/_list.html.erb | 2 +- 10 files changed, 13 insertions(+), 10 deletions(-) diff --git a/app/controllers/admins/department_applies_controller.rb b/app/controllers/admins/department_applies_controller.rb index b6dece1de..458721e34 100644 --- a/app/controllers/admins/department_applies_controller.rb +++ b/app/controllers/admins/department_applies_controller.rb @@ -74,7 +74,10 @@ class Admins::DepartmentAppliesController < Admins::BaseController @depart_apply&.applied_messages&.update_all(status:3) if params[:tip] == 'unapplied' #未审批时候删除 - UserExtension.where(department_id: @depart_apply.department_id).update_all(department_id:nil) + user_extens = UserExtension.where(department_id: @depart_apply.department_id) + user_extens.update_all(department_id:nil) + User.where(id: user_extens.pluck(:user_id)).update_all(profile_completed:false) + tiding_params = { user_id: @depart_apply.user_id, trigger_user_id: 0, diff --git a/app/views/admins/department_applies/shared/_list.html.erb b/app/views/admins/department_applies/shared/_list.html.erb index bdd518a8f..0a1d803be 100644 --- a/app/views/admins/department_applies/shared/_list.html.erb +++ b/app/views/admins/department_applies/shared/_list.html.erb @@ -16,7 +16,7 @@ <%= apply.id %> <%= apply.name %> <%= apply.school.try(:name) %> - <%= apply.user.show_real_name %> + <%= apply&.user&.real_name %> <%= format_time apply.created_at %> <%= agree_link '批准', agree_admins_department_apply_path(apply, element: ".department-apply-#{apply.id}"), 'data-confirm': '确认批准通过?' %> diff --git a/app/views/admins/library_applies/shared/_list.html.erb b/app/views/admins/library_applies/shared/_list.html.erb index c6f9825dc..783d0db30 100644 --- a/app/views/admins/library_applies/shared/_list.html.erb +++ b/app/views/admins/library_applies/shared/_list.html.erb @@ -27,7 +27,7 @@ <% end %> - <%= user.real_name %> + <%= link_to user&.real_name,"/users/#{user&.login}", target: "_blank" %> <%= link_to library.title, library_path(library), :target => "_blank" %> <%= overflow_hidden_span library.content[0..50]%> <%= apply.updated_at.strftime('%Y-%m-%d %H:%M') %> diff --git a/app/views/admins/project_package_applies/shared/_list.html.erb b/app/views/admins/project_package_applies/shared/_list.html.erb index 736d939f9..d94c96184 100644 --- a/app/views/admins/project_package_applies/shared/_list.html.erb +++ b/app/views/admins/project_package_applies/shared/_list.html.erb @@ -27,7 +27,7 @@ <% end %> - <%= user.real_name %> + <%= link_to user&.real_name,"/users/#{user&.login}", target: "_blank" %> <%= link_to package.title, "/crowdsourcing/#{package.id}", :target => "_blank" %> <%= overflow_hidden_span package.content[0..50] %> <%= apply.updated_at.strftime('%Y-%m-%d %H:%M') %> diff --git a/app/views/admins/shixun_authorizations/shared/_list.html.erb b/app/views/admins/shixun_authorizations/shared/_list.html.erb index ce3b4ca43..042e4096e 100644 --- a/app/views/admins/shixun_authorizations/shared/_list.html.erb +++ b/app/views/admins/shixun_authorizations/shared/_list.html.erb @@ -27,7 +27,7 @@ <% end %> - <%= user.real_name %> + <%= link_to user&.real_name,"/users/#{user&.login}", target: "_blank" %> <%= link_to "/shixuns/#{shixun.identifier}", target: '_blank' do %> <%= overflow_hidden_span shixun.name, width: 300 %> diff --git a/app/views/admins/shixun_settings/shared/_td.html.erb b/app/views/admins/shixun_settings/shared/_td.html.erb index efdec4f8d..f72dc8a38 100644 --- a/app/views/admins/shixun_settings/shared/_td.html.erb +++ b/app/views/admins/shixun_settings/shared/_td.html.erb @@ -21,7 +21,7 @@ <%= image_tag(imageUrl, width: 60, height: 40, class: "preview-image shixun-image-#{shixun.id}", data: { toggle: 'tooltip', title: '点击预览' }, style: imageExists ? '' : 'display:none') %> <%= javascript_void_link imageExists ? '重新上传' : '上传图片', class: 'action upload-shixun-image-action', data: { source_id: shixun.id, source_type: 'Shixun', toggle: 'modal', target: '.admin-upload-file-modal' } %> -<%= link_to shixun.owner.try(:show_real_name),"/users/#{shixun.owner.login}",target:'_blank' %> +<%= link_to shixun.owner.try(:real_name),"/users/#{shixun.owner.login}",target:'_blank' %> <% if shixun.status.to_i < 3 %> <%= link_to "关闭", admins_shixun_setting_path(shixun,status:3,page_no:page_no),method: :put, :class => "", :remote => true %> diff --git a/app/views/admins/shixuns/shared/_list.html.erb b/app/views/admins/shixuns/shared/_list.html.erb index 64fb32d56..b5c7cec3b 100644 --- a/app/views/admins/shixuns/shared/_list.html.erb +++ b/app/views/admins/shixuns/shared/_list.html.erb @@ -33,7 +33,7 @@ <%= shixun.challenges.where(:st => 0).size %> <%= shixun.challenges.where(:st => 1).size %> <%= shixun_authentication_status shixun %> - <%= link_to shixun.owner.try(:show_real_name),"/users/#{shixun.owner.try(:login)}",target:'_blank' %> + <%= link_to shixun.owner.try(:real_name),"/users/#{shixun.owner.try(:login)}",target:'_blank' %> <%= format_time shixun.created_at %> class="ml-3 mr5 magic-checkbox" id="join_teacher_homepage_<%= shixun.id %>"> diff --git a/app/views/admins/subject_authorizations/shared/_list.html.erb b/app/views/admins/subject_authorizations/shared/_list.html.erb index 7b8da800d..28a699e22 100644 --- a/app/views/admins/subject_authorizations/shared/_list.html.erb +++ b/app/views/admins/subject_authorizations/shared/_list.html.erb @@ -29,7 +29,7 @@ <% end %> - <%= user.real_name %> + <%= link_to user&.real_name,"/users/#{user&.login}", target: "_blank" %> <%= link_to "/paths/#{subject.id}", target: '_blank' do %> <%= overflow_hidden_span subject.name, width: 300 %> diff --git a/app/views/admins/unit_applies/shared/_apply_item.html.erb b/app/views/admins/unit_applies/shared/_apply_item.html.erb index d8a2bdcc4..084826d72 100644 --- a/app/views/admins/unit_applies/shared/_apply_item.html.erb +++ b/app/views/admins/unit_applies/shared/_apply_item.html.erb @@ -4,7 +4,7 @@ <%= "#{apply&.province.to_s}"+"#{apply&.city.to_s}" %> <%= overflow_hidden_span apply.address %> -<%= apply.user.try(:show_real_name) %> +<%= link_to apply&.user&.real_name, "/users/#{apply&.user&.login}", target: "_blank" %> <%= format_time apply.created_at %> <%= agree_link '批准', agree_admins_unit_apply_path(apply, element: ".unit-apply-#{apply.id}"), 'data-confirm': '确认批准通过?' %> diff --git a/app/views/admins/video_applies/shared/_list.html.erb b/app/views/admins/video_applies/shared/_list.html.erb index 8ddbfb3ca..5e472bd4b 100644 --- a/app/views/admins/video_applies/shared/_list.html.erb +++ b/app/views/admins/video_applies/shared/_list.html.erb @@ -28,7 +28,7 @@ <% end %> - <%= user.real_name %> + <%= link_to user&.real_name,"/users/#{user&.login}", target: "_blank" %> <%= link_to video.title, video.file_url, :target => "_blank" %> <%= video.filesize&.to_s(:human_size) %> <%= link_to "播放视频",video.file_url, target: "_blank" %> From 67868555eddd04142a89ef3c34f45b7ee2b4015d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Fri, 6 Sep 2019 10:02:40 +0800 Subject: [PATCH 07/18] =?UTF-8?q?=E9=A2=98=E5=BA=93=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/modules/user/usersInfo/InfosTopics.js | 16 ++++++++-------- .../src/modules/user/usersInfo/usersInfo.css | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/public/react/src/modules/user/usersInfo/InfosTopics.js b/public/react/src/modules/user/usersInfo/InfosTopics.js index 7fc505478..8a5c5b389 100644 --- a/public/react/src/modules/user/usersInfo/InfosTopics.js +++ b/public/react/src/modules/user/usersInfo/InfosTopics.js @@ -397,14 +397,14 @@ class InfosTopics extends Component{
{types==="publicly"?
- 我的题库 - 公共题库 +
公共题库
:
- 我的题库 - 我的题库
+ 公共题库
} @@ -507,7 +507,7 @@ class InfosTopics extends Component{ {item.name} - {item.is_public===true?公开:""} + {item.is_public===true?types==="publicly"?"":公开:""} @@ -517,7 +517,7 @@ class InfosTopics extends Component{ {types==="publicly"?{item.creator_name}:""} {item.quotes_count} 次引用 - {item.solve_count} 次答题 + {item.solve_count} 次答题 {moment(item.updated_at).fromNow()} {item.course_list_name===null?"": diff --git a/public/react/src/modules/user/usersInfo/usersInfo.css b/public/react/src/modules/user/usersInfo/usersInfo.css index 0801e46e2..544e258b4 100644 --- a/public/react/src/modules/user/usersInfo/usersInfo.css +++ b/public/react/src/modules/user/usersInfo/usersInfo.css @@ -278,7 +278,6 @@ font-family:PingFangSC; font-weight:400; color: #666 !important; - cursor: pointer; } .topcschild{ @@ -296,6 +295,7 @@ .topcsactive{ color: #4CACFF !important; + cursor: pointer; } .topicsmidfont{ From ec83d24e518178f0b433cda9a529379349d33534 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Fri, 6 Sep 2019 10:12:08 +0800 Subject: [PATCH 08/18] =?UTF-8?q?=E9=A2=98=E5=BA=93=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/react/src/modules/user/usersInfo/InfosTopics.js | 8 ++++---- public/react/src/modules/user/usersInfo/usersInfo.css | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/public/react/src/modules/user/usersInfo/InfosTopics.js b/public/react/src/modules/user/usersInfo/InfosTopics.js index 8a5c5b389..9f5f3c150 100644 --- a/public/react/src/modules/user/usersInfo/InfosTopics.js +++ b/public/react/src/modules/user/usersInfo/InfosTopics.js @@ -367,7 +367,7 @@ class InfosTopics extends Component{ float: left; border-radius: 4px; cursor: pointer; - margin-right: 10px; + margin-right: 15px !important; display: block; margin-bottom: 2px; color: #666; @@ -421,7 +421,7 @@ class InfosTopics extends Component{ -
+ {data&&data.count===undefined?"":data&&data.count===0?"":
  • this.searchCourselistid(undefined)}>全部
  • {data===undefined?"":data.course_list===undefined||data.course_list.length===0?"":data.course_list.map((item,key)=>{ @@ -430,7 +430,7 @@ class InfosTopics extends Component{ ) })}
    -
    +
    } :

    @@ -450,7 +450,7 @@ class InfosTopics extends Component{

    {isshowprofes===false?
    -

    +

    {data&&data.count===undefined?0:data&&data.count} 已选择 {checkBoxValues.length} 个 (不支持跨页勾选)

    diff --git a/public/react/src/modules/user/usersInfo/usersInfo.css b/public/react/src/modules/user/usersInfo/usersInfo.css index 544e258b4..77a30bb4e 100644 --- a/public/react/src/modules/user/usersInfo/usersInfo.css +++ b/public/react/src/modules/user/usersInfo/usersInfo.css @@ -398,7 +398,7 @@ } .topicsItem{ - max-width: 1073px; + max-width: 1068px; max-height: 115px; overflow-y: auto; } From dcab8ad79ff25747cacab58dd3116d0e04593fee Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Fri, 6 Sep 2019 10:33:41 +0800 Subject: [PATCH 09/18] =?UTF-8?q?=E8=BF=99=E4=B8=AA=E6=B2=A1=E5=87=BA?= =?UTF-8?q?=E7=8E=B0=E6=8A=96=E5=8A=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/react/src/modules/courses/busyWork/NewWork.js | 2 +- public/react/src/modules/tpm/challengesnew/TPMMDEditor.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/public/react/src/modules/courses/busyWork/NewWork.js b/public/react/src/modules/courses/busyWork/NewWork.js index 8000de59f..411cb351b 100644 --- a/public/react/src/modules/courses/busyWork/NewWork.js +++ b/public/react/src/modules/courses/busyWork/NewWork.js @@ -455,7 +455,7 @@ class NewWork extends Component{ `} - + {/* TpmQuestionEdit 这个没出现抖动 */} { 恢复 ? / 不恢复'; From 443e427a7eead02d0086a5d6d36c7d32a1355a6b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Fri, 6 Sep 2019 10:34:08 +0800 Subject: [PATCH 10/18] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=96=B0=E5=BB=BA?= =?UTF-8?q?=E8=AF=BE=E5=A0=82=E6=96=B0=E5=BC=80=E9=A1=B5=20goback=20?= =?UTF-8?q?=E6=97=A0=E6=95=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/modules/courses/new/CoursesNew.js | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/public/react/src/modules/courses/new/CoursesNew.js b/public/react/src/modules/courses/new/CoursesNew.js index ec73cc17d..a2cc45916 100644 --- a/public/react/src/modules/courses/new/CoursesNew.js +++ b/public/react/src/modules/courses/new/CoursesNew.js @@ -335,11 +335,19 @@ class CoursesNew extends Component { // this.props.history.push(this.props.current_user.first_category_url); // } // window.history.go(-1) - if(id===undefined){ - this.props.history.goBack() - }else{ - this.props.history.push(this.props.current_user.first_category_url); - } + try { + if(id===undefined){ + this.props.history.push("/"); + }else{ + if(this.props.current_user.first_category_url===undefined){ + this.props.history.push("/"); + }else{ + this.props.history.push(this.props.current_user.first_category_url); + } + } + }catch (e) { + this.props.history.push("/"); + } } From 82c8634821da00a1110f3c6ecce826a8de5f4ef0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Fri, 6 Sep 2019 10:34:53 +0800 Subject: [PATCH 11/18] =?UTF-8?q?=E5=AE=9E=E8=AE=AD=E6=8A=A5=E5=91=8A?= =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../courses/shixunHomework/ShixunWorkReport.js | 14 ++++++++------ .../shixunreport/ConclusionEvaluation.js | 2 +- .../shixunreport/OfficialAcademicTranscript.js | 2 +- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/public/react/src/modules/courses/shixunHomework/ShixunWorkReport.js b/public/react/src/modules/courses/shixunHomework/ShixunWorkReport.js index e74627c03..11a9b2f34 100644 --- a/public/react/src/modules/courses/shixunHomework/ShixunWorkReport.js +++ b/public/react/src/modules/courses/shixunHomework/ShixunWorkReport.js @@ -168,27 +168,29 @@ class ShixunWorkReport extends Component { // }) // // } + let{work_comment,work_comment_hidden}=this.state; this.setState({ showAppraiseModaltype:true, + work_comment_hidden:work_comment===null||work_comment===undefined?this.state.work_type?true:false:work_comment_hidden, }) } hideAppraiseModal=()=>{ - let{data,work_comment}=this.state; + let{work_comment,work_comment_hidden}=this.state; this.setState({ showAppraiseModaltype:false, - work_comment_hidden:data&&data.work_comment_hidden===true?true:work_comment!=null?true:false, + work_comment_hidden:work_comment===null||work_comment===undefined?this.state.work_type===1?true:false:work_comment_hidden, }) } showAppraiseModals=(list,type)=>{ - let{data,work_comment}=this.state; + this.setState({ showAppraiseModaltype:false, - work_comment_hidden:data&&data.work_comment_hidden===true?true:work_comment!=null?true:false, + work_comment_hidden:type===0?false:true, work_comment:list, work_type:type, showAppraiseModals:true, - showAppraiseModalsshow:true + showAppraiseModalsshow:true, }) } isdeleteModal=()=>{ @@ -258,7 +260,7 @@ class ShixunWorkReport extends Component { Cancel={()=>this.hideAppraiseModal()} showCancel={(list,type)=>this.showAppraiseModals(list,type)} work_comment={this.state.work_comment} - work_type={this.state.work_type} + work_type={work_comment===null||work_comment===undefined?this.state.work_type:work_comment_hidden===true?1:0} />:""}
    diff --git a/public/react/src/modules/courses/shixunHomework/shixunreport/ConclusionEvaluation.js b/public/react/src/modules/courses/shixunHomework/shixunreport/ConclusionEvaluation.js index 3ae69dfaa..d5c8aa57f 100644 --- a/public/react/src/modules/courses/shixunHomework/shixunreport/ConclusionEvaluation.js +++ b/public/react/src/modules/courses/shixunHomework/shixunreport/ConclusionEvaluation.js @@ -81,7 +81,7 @@ class ConclusionEvaluation extends Component { ), }, { - title: '耗时', + title: '实战耗时', key: 'elapsed', dataIndex: 'elapsed', diff --git a/public/react/src/modules/courses/shixunHomework/shixunreport/OfficialAcademicTranscript.js b/public/react/src/modules/courses/shixunHomework/shixunreport/OfficialAcademicTranscript.js index 2195228e1..2a79ce829 100644 --- a/public/react/src/modules/courses/shixunHomework/shixunreport/OfficialAcademicTranscript.js +++ b/public/react/src/modules/courses/shixunHomework/shixunreport/OfficialAcademicTranscript.js @@ -150,7 +150,7 @@ class OfficialAcademicTranscript extends Component { ), }, { - title: '耗时', + title: '实战耗时', key: 'elapsedtime', dataIndex: 'elapsedtime', From 89447c3d5daca02d04931cefecbdb350271a621b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Fri, 6 Sep 2019 10:40:07 +0800 Subject: [PATCH 12/18] =?UTF-8?q?=E5=90=88=E5=B9=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../admins/department_applies_controller.rb | 5 +- .../department_applies/shared/_list.html.erb | 2 +- .../library_applies/shared/_list.html.erb | 2 +- .../shared/_list.html.erb | 2 +- .../shared/_list.html.erb | 2 +- .../shixun_settings/shared/_td.html.erb | 2 +- .../admins/shixuns/shared/_list.html.erb | 2 +- .../shared/_list.html.erb | 2 +- .../unit_applies/shared/_apply_item.html.erb | 2 +- .../video_applies/shared/_list.html.erb | 2 +- .../courses/busyWork/CommonWorkAppraise.js | 2 +- .../src/modules/courses/busyWork/NewWork.js | 415 ++++++++++++++++-- .../courses/coursesPublic/CoursesMarkdown.js | 2 +- .../src/modules/courses/new/CoursesNew.js | 18 +- .../shixunHomework/ShixunWorkReport.js | 14 +- .../shixunreport/ConclusionEvaluation.js | 2 +- .../OfficialAcademicTranscript.js | 2 +- .../src/modules/projectPackages/MDEditors.js | 2 +- .../modules/tpm/challengesnew/TPMMDEditor.js | 4 +- 19 files changed, 423 insertions(+), 61 deletions(-) diff --git a/app/controllers/admins/department_applies_controller.rb b/app/controllers/admins/department_applies_controller.rb index b6dece1de..458721e34 100644 --- a/app/controllers/admins/department_applies_controller.rb +++ b/app/controllers/admins/department_applies_controller.rb @@ -74,7 +74,10 @@ class Admins::DepartmentAppliesController < Admins::BaseController @depart_apply&.applied_messages&.update_all(status:3) if params[:tip] == 'unapplied' #未审批时候删除 - UserExtension.where(department_id: @depart_apply.department_id).update_all(department_id:nil) + user_extens = UserExtension.where(department_id: @depart_apply.department_id) + user_extens.update_all(department_id:nil) + User.where(id: user_extens.pluck(:user_id)).update_all(profile_completed:false) + tiding_params = { user_id: @depart_apply.user_id, trigger_user_id: 0, diff --git a/app/views/admins/department_applies/shared/_list.html.erb b/app/views/admins/department_applies/shared/_list.html.erb index bdd518a8f..0a1d803be 100644 --- a/app/views/admins/department_applies/shared/_list.html.erb +++ b/app/views/admins/department_applies/shared/_list.html.erb @@ -16,7 +16,7 @@ <%= apply.id %> <%= apply.name %> <%= apply.school.try(:name) %> - <%= apply.user.show_real_name %> + <%= apply&.user&.real_name %> <%= format_time apply.created_at %> <%= agree_link '批准', agree_admins_department_apply_path(apply, element: ".department-apply-#{apply.id}"), 'data-confirm': '确认批准通过?' %> diff --git a/app/views/admins/library_applies/shared/_list.html.erb b/app/views/admins/library_applies/shared/_list.html.erb index c6f9825dc..783d0db30 100644 --- a/app/views/admins/library_applies/shared/_list.html.erb +++ b/app/views/admins/library_applies/shared/_list.html.erb @@ -27,7 +27,7 @@ <% end %> - <%= user.real_name %> + <%= link_to user&.real_name,"/users/#{user&.login}", target: "_blank" %> <%= link_to library.title, library_path(library), :target => "_blank" %> <%= overflow_hidden_span library.content[0..50]%> <%= apply.updated_at.strftime('%Y-%m-%d %H:%M') %> diff --git a/app/views/admins/project_package_applies/shared/_list.html.erb b/app/views/admins/project_package_applies/shared/_list.html.erb index 736d939f9..d94c96184 100644 --- a/app/views/admins/project_package_applies/shared/_list.html.erb +++ b/app/views/admins/project_package_applies/shared/_list.html.erb @@ -27,7 +27,7 @@ <% end %> - <%= user.real_name %> + <%= link_to user&.real_name,"/users/#{user&.login}", target: "_blank" %> <%= link_to package.title, "/crowdsourcing/#{package.id}", :target => "_blank" %> <%= overflow_hidden_span package.content[0..50] %> <%= apply.updated_at.strftime('%Y-%m-%d %H:%M') %> diff --git a/app/views/admins/shixun_authorizations/shared/_list.html.erb b/app/views/admins/shixun_authorizations/shared/_list.html.erb index ce3b4ca43..042e4096e 100644 --- a/app/views/admins/shixun_authorizations/shared/_list.html.erb +++ b/app/views/admins/shixun_authorizations/shared/_list.html.erb @@ -27,7 +27,7 @@ <% end %> - <%= user.real_name %> + <%= link_to user&.real_name,"/users/#{user&.login}", target: "_blank" %> <%= link_to "/shixuns/#{shixun.identifier}", target: '_blank' do %> <%= overflow_hidden_span shixun.name, width: 300 %> diff --git a/app/views/admins/shixun_settings/shared/_td.html.erb b/app/views/admins/shixun_settings/shared/_td.html.erb index efdec4f8d..f72dc8a38 100644 --- a/app/views/admins/shixun_settings/shared/_td.html.erb +++ b/app/views/admins/shixun_settings/shared/_td.html.erb @@ -21,7 +21,7 @@ <%= image_tag(imageUrl, width: 60, height: 40, class: "preview-image shixun-image-#{shixun.id}", data: { toggle: 'tooltip', title: '点击预览' }, style: imageExists ? '' : 'display:none') %> <%= javascript_void_link imageExists ? '重新上传' : '上传图片', class: 'action upload-shixun-image-action', data: { source_id: shixun.id, source_type: 'Shixun', toggle: 'modal', target: '.admin-upload-file-modal' } %> -<%= link_to shixun.owner.try(:show_real_name),"/users/#{shixun.owner.login}",target:'_blank' %> +<%= link_to shixun.owner.try(:real_name),"/users/#{shixun.owner.login}",target:'_blank' %> <% if shixun.status.to_i < 3 %> <%= link_to "关闭", admins_shixun_setting_path(shixun,status:3,page_no:page_no),method: :put, :class => "", :remote => true %> diff --git a/app/views/admins/shixuns/shared/_list.html.erb b/app/views/admins/shixuns/shared/_list.html.erb index 64fb32d56..b5c7cec3b 100644 --- a/app/views/admins/shixuns/shared/_list.html.erb +++ b/app/views/admins/shixuns/shared/_list.html.erb @@ -33,7 +33,7 @@ <%= shixun.challenges.where(:st => 0).size %> <%= shixun.challenges.where(:st => 1).size %> <%= shixun_authentication_status shixun %> - <%= link_to shixun.owner.try(:show_real_name),"/users/#{shixun.owner.try(:login)}",target:'_blank' %> + <%= link_to shixun.owner.try(:real_name),"/users/#{shixun.owner.try(:login)}",target:'_blank' %> <%= format_time shixun.created_at %> class="ml-3 mr5 magic-checkbox" id="join_teacher_homepage_<%= shixun.id %>"> diff --git a/app/views/admins/subject_authorizations/shared/_list.html.erb b/app/views/admins/subject_authorizations/shared/_list.html.erb index 7b8da800d..28a699e22 100644 --- a/app/views/admins/subject_authorizations/shared/_list.html.erb +++ b/app/views/admins/subject_authorizations/shared/_list.html.erb @@ -29,7 +29,7 @@ <% end %> - <%= user.real_name %> + <%= link_to user&.real_name,"/users/#{user&.login}", target: "_blank" %> <%= link_to "/paths/#{subject.id}", target: '_blank' do %> <%= overflow_hidden_span subject.name, width: 300 %> diff --git a/app/views/admins/unit_applies/shared/_apply_item.html.erb b/app/views/admins/unit_applies/shared/_apply_item.html.erb index d8a2bdcc4..084826d72 100644 --- a/app/views/admins/unit_applies/shared/_apply_item.html.erb +++ b/app/views/admins/unit_applies/shared/_apply_item.html.erb @@ -4,7 +4,7 @@ <%= "#{apply&.province.to_s}"+"#{apply&.city.to_s}" %> <%= overflow_hidden_span apply.address %> -<%= apply.user.try(:show_real_name) %> +<%= link_to apply&.user&.real_name, "/users/#{apply&.user&.login}", target: "_blank" %> <%= format_time apply.created_at %> <%= agree_link '批准', agree_admins_unit_apply_path(apply, element: ".unit-apply-#{apply.id}"), 'data-confirm': '确认批准通过?' %> diff --git a/app/views/admins/video_applies/shared/_list.html.erb b/app/views/admins/video_applies/shared/_list.html.erb index 8ddbfb3ca..5e472bd4b 100644 --- a/app/views/admins/video_applies/shared/_list.html.erb +++ b/app/views/admins/video_applies/shared/_list.html.erb @@ -28,7 +28,7 @@ <% end %> - <%= user.real_name %> + <%= link_to user&.real_name,"/users/#{user&.login}", target: "_blank" %> <%= link_to video.title, video.file_url, :target => "_blank" %> <%= video.filesize&.to_s(:human_size) %> <%= link_to "播放视频",video.file_url, target: "_blank" %> diff --git a/public/react/src/modules/courses/busyWork/CommonWorkAppraise.js b/public/react/src/modules/courses/busyWork/CommonWorkAppraise.js index 698fbd398..04ccb3ea1 100644 --- a/public/react/src/modules/courses/busyWork/CommonWorkAppraise.js +++ b/public/react/src/modules/courses/busyWork/CommonWorkAppraise.js @@ -254,7 +254,7 @@ class CommonWorkAppraise extends Component{ 关联项目
    - {project_info.name} + {project_info.name}
    } diff --git a/public/react/src/modules/courses/busyWork/NewWork.js b/public/react/src/modules/courses/busyWork/NewWork.js index a17dc8ed2..411cb351b 100644 --- a/public/react/src/modules/courses/busyWork/NewWork.js +++ b/public/react/src/modules/courses/busyWork/NewWork.js @@ -7,7 +7,6 @@ import { WordsBtn, getUrl, ConditionToolTip, appendFileSizeToUploadFile, appendF , getUploadActionUrl } from 'educoder' import TPMMDEditor from '../../tpm/challengesnew/TPMMDEditor'; import CBreadcrumb from '../common/CBreadcrumb' -import NewWorkForm from './NewWorkForm' const confirm = Modal.confirm; const $ = window.$ @@ -19,8 +18,15 @@ class NewWork extends Component{ this.answerMdRef = React.createRef(); this.state={ + title_value:"", + title_num: 0, + contentFileList: [], + answerFileList: [], + workLoaded: false, + base_on_project: true, category: {}, - course_name: '' + min_num: 2, + max_num: 10, } } componentDidMount () { @@ -60,13 +66,56 @@ class NewWork extends Component{ .then((response) => { if (response.data.name) { const data = response.data; - data.isEdit = this.isEdit + + const contentFileList = data.attachments.map(item => { + return { + id: item.id, + uid: item.id, + name: appendFileSizeToUploadFile(item), + url: item.url, + filesize: item.filesize, + status: 'done' + } + }) + const answerFileList = data.ref_attachments.map(item => { + return { + id: item.id, + uid: item.id, + name: appendFileSizeToUploadFile(item), + url: item.url, + filesize: item.filesize, + status: 'done' + } + }) + this.setState({ - course_id: data.course_id, - course_name: data.course_name, - category: data.category, + ...data, + // course_id: data.course_id, + // course_name: data.course_name, + // category: data.category, + title_num: parseInt(data.name.length), + workLoaded: true, + init_min_num: data.min_num, + init_max_num: data.max_num, + // description: data.description, + reference_answer: data.reference_answer, + contentFileList, + answerFileList, + }, () => { + setTimeout(() => { + this.contentMdRef.current.setValue(data.description || '') + this.answerMdRef.current.setValue(data.reference_answer || '') + + }, 2000) + + this.props.form.setFieldsValue({ + title: data.name, + description: data.description || '', + reference_answer: data.reference_answer || '', + }); + }) - this.newWorkFormRef.initValue(response.data) + } }) .catch(function (error) { @@ -74,15 +123,72 @@ class NewWork extends Component{ }); } - onCancel = () => { - this.props.toListPage(this.props.match.params, this.state.category.category_id) + // 输入title + changeTitle=(e)=>{ + console.log(e.target.value.length); + this.setState({ + title_num: parseInt(e.target.value.length) + }) } + handleSubmit = () => { + const courseId = this.state.course_id || this.props.match.params.coursesId ; + + this.props.form.validateFieldsAndScroll((err, values) => { + console.log(values) + const mdContnet = this.contentMdRef.current.getValue().trim(); + console.log(mdContnet) + values.description = mdContnet; + // return; + + {/* max={has_commit ? init_min_num : null } */} + {/* min={has_commit ? init_max_num : (min_num == undefined ? 2 : min_num + 1) } */} + // 已有提交作品,人数范围只能扩大 + const { has_commit, max_num, init_max_num, min_num, init_min_num } = this.state; + if (has_commit) { + if (max_num < init_max_num || min_num > init_min_num) { + this.props.showNotification(`已有提交作品,人数范围只能扩大(原设置为:${init_min_num} - ${init_max_num})`) + return; + } + } - doEdit = (params) => { + // const errKeys = Object.keys(err); // || errKeys.length == 1 && errKeys[0] == 'content' && mdContnet + if (!err) { + if (this.isEdit) { + this.doEdit(courseId, values) + } else { + this.doNew(courseId, values) + } + + } else { + $("html").animate({ scrollTop: $('html').scrollTop() - 100 }) + } + }) + } + doEdit = (courseId, values) => { const workId = this.props.match.params.workId const newUrl = `/homework_commons/${workId}.json` - axios.put(newUrl, params) + let attachment_ids = this.state.contentFileList.map(item => { + return item.response ? item.response.id : item.id + }) + let reference_attachment_ids = this.state.answerFileList.map(item => { + return item.response ? item.response.id : item.id + }) + + const { min_num, max_num, base_on_project, category } = this.state + const isGroup = this.props.isGroup() + axios.put(newUrl, { + type: isGroup ? 3 : 1, + name: values.title, + description: values.description, + reference_answer: values.reference_answer, + attachment_ids, + reference_attachment_ids, + + min_num, + max_num, + base_on_project + }) .then((response) => { if (response.data.status == 0) { this.props.showNotification('保存成功') @@ -93,11 +199,30 @@ class NewWork extends Component{ console.log(error); }); } - doNew = (params) => { - const coursesId = this.props.match.params.coursesId - const newUrl = `/courses/${coursesId}/homework_commons.json` + doNew = (courseId, values) => { + const newUrl = `/courses/${courseId}/homework_commons.json` - axios.post(newUrl, params) + let attachment_ids = this.state.contentFileList.map(item => { + return item.response ? item.response.id : item.id + }) + let reference_attachment_ids = this.state.answerFileList.map(item => { + return item.response ? item.response.id : item.id + }) + const isGroup = this.props.isGroup() + const { min_num, max_num, base_on_project, category } = this.state + + axios.post(newUrl, { + type: isGroup ? 3 : 1, + name: values.title, + description: values.description, + reference_answer: values.reference_answer, + attachment_ids, + reference_attachment_ids, + + min_num, + max_num, + base_on_project + }) .then((response) => { if (response.data.status == 0) { this.props.showNotification('保存成功') @@ -140,31 +265,119 @@ class NewWork extends Component{ } } + deleteAttachment = (file, stateName) => { + // 初次上传不能直接取uid + const url = `/attachments/${file.response ? file.response.id : file.uid}.json` + axios.delete(url, { + }) + .then((response) => { + if (response.data) { + const { status } = response.data; + if (status == 0) { + console.log('--- success') + + this.setState((state) => { + const index = state[stateName].indexOf(file); + const newFileList = state[stateName].slice(); + newFileList.splice(index, 1); + return { + [stateName]: newFileList, + }; + }); + } + } + }) + .catch(function (error) { + console.log(error); + }); + } + max_num_change = (val) => { + if (val < 2) { + this.setState({ + max_num: 2, + }) + return; + } + const { min_num } = this.state; + this.setState({ + max_num: val, + min_num: val <= min_num ? val - 1 : min_num + }) + } + min_num_change = (val) => { + this.setState({ min_num: val }) + } + base_on_project_change = () => { + this.setState({ base_on_project: !this.state.base_on_project }) + } render(){ let {typeId,coursesId,pageType}=this.props.match.params; - + const { getFieldDecorator } = this.props.form; const isGroup = this.props.isGroup() const moduleName = !isGroup? "普通作业":"分组作业"; const moduleEngName = this.props.getModuleName() let{ - course_name, category + 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 }=this.state const { current_user } = this.props - const courseId = this.state.course_id || coursesId ; + const courseId = this.state.course_id || this.props.match.params.coursesId ; const isEdit = this.isEdit; - - const common = { - onCancel:this.onCancel, - isGroup: this.props.isGroup, - doNew: this.doNew, - doEdit: this.doEdit, - } + if ((isEdit == undefined || isEdit) && !this.state.workLoaded) { + return '' + } + const uploadProps = { + width: 600, + fileList: contentFileList, + multiple: true, + // https://github.com/ant-design/ant-design/issues/15505 + // showUploadList={false},然后外部拿到 fileList 数组自行渲染列表。 + // showUploadList: false, + action: `${getUploadActionUrl()}`, + onChange: this.handleContentUploadChange, + onRemove: (file) => this.onAttachmentRemove(file, 'contentFileList'), + beforeUpload: (file) => { + console.log('beforeUpload', file.name); + const isLt150M = file.size / 1024 / 1024 < 150; + if (!isLt150M) { + this.props.showNotification('文件大小必须小于150MB!'); + } + return isLt150M; + }, + }; + const answerUploadProps = { + width: 600, + fileList: answerFileList, + multiple: true, + // https://github.com/ant-design/ant-design/issues/15505 + // showUploadList={false},然后外部拿到 fileList 数组自行渲染列表。 + // showUploadList: false, + action: `${getUrl()}/api/attachments.json`, + onChange: this.handleAnswerUploadChange, + onRemove: (file) => this.onAttachmentRemove(file, 'answerFileList'), + beforeUpload: (file) => { + console.log('beforeUpload', file.name); + const isLt150M = file.size / 1024 / 1024 < 150; + if (!isLt150M) { + this.props.showNotification('文件大小必须小于150MB!'); + } + return isLt150M; + }, + }; return(
    + {/*

    + {course_name} + > + {typeId==1 ?"普通作业":"分组作业"} + > + {pageType==="new"?"新建":"编辑"} +

    */} {this.isEdit ?"编辑":"新建"}{ moduleName } + {/* history.goBack() + this.props.toListPage(this.props.match.params, category.category_id)} + */} this.props.history.goBack()}> 返回

    + {/* onSubmit={this.handleSubmit} */} - {this.newWorkFormRef = ref}} - > +
    + + {getFieldDecorator('title', { + rules: [{ + required: true, message: '请输入标题' + }], + })( + + )} + + + + {/* TpmQuestionEdit 这个没出现抖动 */} + { + {getFieldDecorator('description', { + rules: [{ + required: true, message: '请输入作业内容和要求' + }], + })( + + )} + } + + + (单个文件150M以内) + + + + { isGroup && + + {getFieldDecorator('personNum', { + rules: [{ + required: false + // required: true, message: '请输入最小人数和最大人数' + }], + })( +
    +

    + + {/* max={has_commit ? init_min_num : null } */} + + + + ~ + {/* min={has_commit ? init_max_num : (min_num == undefined ? 2 : min_num + 1) } */} + + + + +

    +

    + + 基于项目实施 + + + +

    +
    + )} +
    + } + + {getFieldDecorator('reference_answer', { + rules: [{ + required: false + }], + })( + + )} + + + (单个文件150M以内) + + + + + +
    ) } } - -export default NewWork; \ No newline at end of file +const WrappedBoardsNew = Form.create({ name: 'NewWork' })(NewWork); +export default WrappedBoardsNew; \ No newline at end of file diff --git a/public/react/src/modules/courses/coursesPublic/CoursesMarkdown.js b/public/react/src/modules/courses/coursesPublic/CoursesMarkdown.js index 3538aaf57..4510a7080 100644 --- a/public/react/src/modules/courses/coursesPublic/CoursesMarkdown.js +++ b/public/react/src/modules/courses/coursesPublic/CoursesMarkdown.js @@ -139,7 +139,7 @@ function create_editorMD(id, width, high, placeholder, imageUrl, callback, initV }); $("#" + _id + " [type=\"inline\"]").bind("click", function () { - _editorName.cm.replaceSelection("$$$$"); + _editorName.cm.replaceSelection("`$$$$`"); var __Cursor = _editorName.cm.getDoc().getCursor(); _editorName.cm.setCursor(__Cursor.line, __Cursor.ch - 2); _editorName.cm.focus(); diff --git a/public/react/src/modules/courses/new/CoursesNew.js b/public/react/src/modules/courses/new/CoursesNew.js index ec73cc17d..a2cc45916 100644 --- a/public/react/src/modules/courses/new/CoursesNew.js +++ b/public/react/src/modules/courses/new/CoursesNew.js @@ -335,11 +335,19 @@ class CoursesNew extends Component { // this.props.history.push(this.props.current_user.first_category_url); // } // window.history.go(-1) - if(id===undefined){ - this.props.history.goBack() - }else{ - this.props.history.push(this.props.current_user.first_category_url); - } + try { + if(id===undefined){ + this.props.history.push("/"); + }else{ + if(this.props.current_user.first_category_url===undefined){ + this.props.history.push("/"); + }else{ + this.props.history.push(this.props.current_user.first_category_url); + } + } + }catch (e) { + this.props.history.push("/"); + } } diff --git a/public/react/src/modules/courses/shixunHomework/ShixunWorkReport.js b/public/react/src/modules/courses/shixunHomework/ShixunWorkReport.js index e74627c03..11a9b2f34 100644 --- a/public/react/src/modules/courses/shixunHomework/ShixunWorkReport.js +++ b/public/react/src/modules/courses/shixunHomework/ShixunWorkReport.js @@ -168,27 +168,29 @@ class ShixunWorkReport extends Component { // }) // // } + let{work_comment,work_comment_hidden}=this.state; this.setState({ showAppraiseModaltype:true, + work_comment_hidden:work_comment===null||work_comment===undefined?this.state.work_type?true:false:work_comment_hidden, }) } hideAppraiseModal=()=>{ - let{data,work_comment}=this.state; + let{work_comment,work_comment_hidden}=this.state; this.setState({ showAppraiseModaltype:false, - work_comment_hidden:data&&data.work_comment_hidden===true?true:work_comment!=null?true:false, + work_comment_hidden:work_comment===null||work_comment===undefined?this.state.work_type===1?true:false:work_comment_hidden, }) } showAppraiseModals=(list,type)=>{ - let{data,work_comment}=this.state; + this.setState({ showAppraiseModaltype:false, - work_comment_hidden:data&&data.work_comment_hidden===true?true:work_comment!=null?true:false, + work_comment_hidden:type===0?false:true, work_comment:list, work_type:type, showAppraiseModals:true, - showAppraiseModalsshow:true + showAppraiseModalsshow:true, }) } isdeleteModal=()=>{ @@ -258,7 +260,7 @@ class ShixunWorkReport extends Component { Cancel={()=>this.hideAppraiseModal()} showCancel={(list,type)=>this.showAppraiseModals(list,type)} work_comment={this.state.work_comment} - work_type={this.state.work_type} + work_type={work_comment===null||work_comment===undefined?this.state.work_type:work_comment_hidden===true?1:0} />:""}
    diff --git a/public/react/src/modules/courses/shixunHomework/shixunreport/ConclusionEvaluation.js b/public/react/src/modules/courses/shixunHomework/shixunreport/ConclusionEvaluation.js index 3ae69dfaa..d5c8aa57f 100644 --- a/public/react/src/modules/courses/shixunHomework/shixunreport/ConclusionEvaluation.js +++ b/public/react/src/modules/courses/shixunHomework/shixunreport/ConclusionEvaluation.js @@ -81,7 +81,7 @@ class ConclusionEvaluation extends Component { ), }, { - title: '耗时', + title: '实战耗时', key: 'elapsed', dataIndex: 'elapsed', diff --git a/public/react/src/modules/courses/shixunHomework/shixunreport/OfficialAcademicTranscript.js b/public/react/src/modules/courses/shixunHomework/shixunreport/OfficialAcademicTranscript.js index 2195228e1..2a79ce829 100644 --- a/public/react/src/modules/courses/shixunHomework/shixunreport/OfficialAcademicTranscript.js +++ b/public/react/src/modules/courses/shixunHomework/shixunreport/OfficialAcademicTranscript.js @@ -150,7 +150,7 @@ class OfficialAcademicTranscript extends Component { ), }, { - title: '耗时', + title: '实战耗时', key: 'elapsedtime', dataIndex: 'elapsedtime', diff --git a/public/react/src/modules/projectPackages/MDEditors.js b/public/react/src/modules/projectPackages/MDEditors.js index 2c11e0895..61e26db23 100644 --- a/public/react/src/modules/projectPackages/MDEditors.js +++ b/public/react/src/modules/projectPackages/MDEditors.js @@ -166,7 +166,7 @@ function create_editorMD(id, width, high, placeholder, imageUrl, callback, initV }); $("#" + _id + " [type=\"inline\"]").bind("click", function () { - _editorName.cm.replaceSelection("$$$$"); + _editorName.cm.replaceSelection("`$$$$`"); var __Cursor = _editorName.cm.getDoc().getCursor(); _editorName.cm.setCursor(__Cursor.line, __Cursor.ch - 2); _editorName.cm.focus(); diff --git a/public/react/src/modules/tpm/challengesnew/TPMMDEditor.js b/public/react/src/modules/tpm/challengesnew/TPMMDEditor.js index 10cddfd31..ba4f1bc21 100644 --- a/public/react/src/modules/tpm/challengesnew/TPMMDEditor.js +++ b/public/react/src/modules/tpm/challengesnew/TPMMDEditor.js @@ -62,7 +62,7 @@ window.md_rec_data = md_rec_data; function md_elocalStorage(editor,mdu,id){ if (window.sessionStorage){ var oc = window.sessionStorage.getItem('content'+mdu); - if(oc !== null ){ + if(oc !== null && oc != editor.getValue()){ console.log("#e_tips_"+id) $("#e_tips_"+id).data('editor', editor); var h = '您上次有已保存的数据,是否恢复 ? / 不恢复'; @@ -169,7 +169,7 @@ function create_editorMD(id, width, high, placeholder, imageUrl, callback, initV }); $("#" + _id + " [type=\"inline\"]").bind("click", function () { - _editorName.cm.replaceSelection("$$$$"); + _editorName.cm.replaceSelection("`$$$$`"); var __Cursor = _editorName.cm.getDoc().getCursor(); _editorName.cm.setCursor(__Cursor.line, __Cursor.ch - 2); _editorName.cm.focus(); From 4293c029a61ed1fc182a91e078cd756b203e6647 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Fri, 6 Sep 2019 10:43:34 +0800 Subject: [PATCH 13/18] =?UTF-8?q?=E5=90=88=E5=B9=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/modules/courses/busyWork/NewWork.js | 683 +++++------------- 1 file changed, 167 insertions(+), 516 deletions(-) diff --git a/public/react/src/modules/courses/busyWork/NewWork.js b/public/react/src/modules/courses/busyWork/NewWork.js index 411cb351b..e11eca9e2 100644 --- a/public/react/src/modules/courses/busyWork/NewWork.js +++ b/public/react/src/modules/courses/busyWork/NewWork.js @@ -4,250 +4,125 @@ import axios from 'axios' import '../css/busyWork.css' import '../css/Courses.css' import { WordsBtn, getUrl, ConditionToolTip, appendFileSizeToUploadFile, appendFileSizeToUploadFileAll - , getUploadActionUrl } from 'educoder' + , getUploadActionUrl } from 'educoder' import TPMMDEditor from '../../tpm/challengesnew/TPMMDEditor'; import CBreadcrumb from '../common/CBreadcrumb' +import NewWorkForm from './NewWorkForm' const confirm = Modal.confirm; const $ = window.$ const MAX_TITLE_LENGTH = 60; class NewWork extends Component{ - constructor(props){ - super(props); - this.contentMdRef = React.createRef(); - this.answerMdRef = React.createRef(); - - this.state={ - title_value:"", - title_num: 0, - contentFileList: [], - answerFileList: [], - workLoaded: false, - base_on_project: true, - category: {}, - min_num: 2, - max_num: 10, - } - } - componentDidMount () { - let {typeId, coursesId, pageType, workId}=this.props.match.params; - const isEdit = pageType === "edit" - this.isEdit = isEdit; - if (isEdit) { - this.fetchWork(workId) - } else { - this.fetchCourseData(coursesId) - } - } - fetchCourseData = (courseId) => { - const isGroup = this.props.isGroup() - const url = `/courses/${courseId}/homework_commons/new.json?type=${isGroup ? 3 : 1}` - axios.get(url, { - }) - .then((response) => { - if (response.data.course_name) { - const data = response.data; - this.setState({ - course_id: data.course_id, - course_name: data.course_name, - category: data.category, - - }) - } - }) - .catch(function (error) { - console.log(error); - }); - } - fetchWork = (workId) => { - const url = `/homework_commons/${workId}/edit.json` - axios.get(url, { - }) - .then((response) => { - if (response.data.name) { - const data = response.data; - - const contentFileList = data.attachments.map(item => { - return { - id: item.id, - uid: item.id, - name: appendFileSizeToUploadFile(item), - url: item.url, - filesize: item.filesize, - status: 'done' - } - }) - const answerFileList = data.ref_attachments.map(item => { - return { - id: item.id, - uid: item.id, - name: appendFileSizeToUploadFile(item), - url: item.url, - filesize: item.filesize, - status: 'done' - } - }) - - this.setState({ - ...data, - // course_id: data.course_id, - // course_name: data.course_name, - // category: data.category, - title_num: parseInt(data.name.length), - workLoaded: true, - init_min_num: data.min_num, - init_max_num: data.max_num, - // description: data.description, - reference_answer: data.reference_answer, - contentFileList, - answerFileList, - }, () => { - setTimeout(() => { - this.contentMdRef.current.setValue(data.description || '') - this.answerMdRef.current.setValue(data.reference_answer || '') - - }, 2000) - - this.props.form.setFieldsValue({ - title: data.name, - description: data.description || '', - reference_answer: data.reference_answer || '', - }); - - }) - - } - }) - .catch(function (error) { - console.log(error); - }); - } - - // 输入title - changeTitle=(e)=>{ - console.log(e.target.value.length); - this.setState({ - title_num: parseInt(e.target.value.length) - }) - } - handleSubmit = () => { - const courseId = this.state.course_id || this.props.match.params.coursesId ; - - this.props.form.validateFieldsAndScroll((err, values) => { - console.log(values) - const mdContnet = this.contentMdRef.current.getValue().trim(); - console.log(mdContnet) - values.description = mdContnet; - // return; - - {/* max={has_commit ? init_min_num : null } */} - {/* min={has_commit ? init_max_num : (min_num == undefined ? 2 : min_num + 1) } */} - // 已有提交作品,人数范围只能扩大 - const { has_commit, max_num, init_max_num, min_num, init_min_num } = this.state; - if (has_commit) { - if (max_num < init_max_num || min_num > init_min_num) { - this.props.showNotification(`已有提交作品,人数范围只能扩大(原设置为:${init_min_num} - ${init_max_num})`) - return; - } - } - - // const errKeys = Object.keys(err); // || errKeys.length == 1 && errKeys[0] == 'content' && mdContnet - if (!err) { - if (this.isEdit) { - this.doEdit(courseId, values) - } else { - this.doNew(courseId, values) - } - - } else { - $("html").animate({ scrollTop: $('html').scrollTop() - 100 }) - } - }) - } - doEdit = (courseId, values) => { - const workId = this.props.match.params.workId - const newUrl = `/homework_commons/${workId}.json` - - let attachment_ids = this.state.contentFileList.map(item => { - return item.response ? item.response.id : item.id - }) - let reference_attachment_ids = this.state.answerFileList.map(item => { - return item.response ? item.response.id : item.id - }) - - const { min_num, max_num, base_on_project, category } = this.state - const isGroup = this.props.isGroup() - axios.put(newUrl, { - type: isGroup ? 3 : 1, - name: values.title, - description: values.description, - reference_answer: values.reference_answer, - attachment_ids, - reference_attachment_ids, - - min_num, - max_num, - base_on_project - }) - .then((response) => { - if (response.data.status == 0) { - this.props.showNotification('保存成功') - this.props.toWorkListPage(this.props.match.params, workId) - } - }) - .catch(function (error) { - console.log(error); - }); - } - doNew = (courseId, values) => { - const newUrl = `/courses/${courseId}/homework_commons.json` - - let attachment_ids = this.state.contentFileList.map(item => { - return item.response ? item.response.id : item.id - }) - let reference_attachment_ids = this.state.answerFileList.map(item => { - return item.response ? item.response.id : item.id - }) - const isGroup = this.props.isGroup() - const { min_num, max_num, base_on_project, category } = this.state - - axios.post(newUrl, { - type: isGroup ? 3 : 1, - name: values.title, - description: values.description, - reference_answer: values.reference_answer, - attachment_ids, - reference_attachment_ids, + constructor(props){ + super(props); + this.contentMdRef = React.createRef(); + this.answerMdRef = React.createRef(); + + this.state={ + category: {}, + course_name: '' + } + } + componentDidMount () { + let {typeId, coursesId, pageType, workId}=this.props.match.params; + const isEdit = pageType === "edit" + this.isEdit = isEdit; + if (isEdit) { + this.fetchWork(workId) + } else { + this.fetchCourseData(coursesId) + } + } + fetchCourseData = (courseId) => { + const isGroup = this.props.isGroup() + const url = `/courses/${courseId}/homework_commons/new.json?type=${isGroup ? 3 : 1}` + axios.get(url, { + }) + .then((response) => { + if (response.data.course_name) { + const data = response.data; + this.setState({ + course_id: data.course_id, + course_name: data.course_name, + category: data.category, + + }) + } + }) + .catch(function (error) { + console.log(error); + }); + } + fetchWork = (workId) => { + const url = `/homework_commons/${workId}/edit.json` + axios.get(url, { + }) + .then((response) => { + if (response.data.name) { + const data = response.data; + data.isEdit = this.isEdit + this.setState({ + course_id: data.course_id, + course_name: data.course_name, + category: data.category, + }) + this.newWorkFormRef.initValue(response.data) + } + }) + .catch(function (error) { + console.log(error); + }); + } + + onCancel = () => { + this.props.toListPage(this.props.match.params, this.state.category.category_id) + } + + doEdit = (params) => { + const workId = this.props.match.params.workId + const newUrl = `/homework_commons/${workId}.json` + + axios.put(newUrl, params) + .then((response) => { + if (response.data.status == 0) { + this.props.showNotification('保存成功') + this.props.toWorkListPage(this.props.match.params, workId) + } + }) + .catch(function (error) { + console.log(error); + }); + } + doNew = (params) => { + const coursesId = this.props.match.params.coursesId + const newUrl = `/courses/${coursesId}/homework_commons.json` + + axios.post(newUrl, params) + .then((response) => { + if (response.data.status == 0) { + this.props.showNotification('保存成功') + this.props.toWorkListPage(this.props.match.params, response.data.homework_id) + } + }) + .catch(function (error) { + console.log(error); + }); + } - min_num, - max_num, - base_on_project - }) - .then((response) => { - if (response.data.status == 0) { - this.props.showNotification('保存成功') - this.props.toWorkListPage(this.props.match.params, response.data.homework_id) - } - }) - .catch(function (error) { - console.log(error); - }); - } + handleContentUploadChange = (info) => { + if (info.file.status === 'uploading' || info.file.status === 'done' || info.file.status === 'removed') { + let contentFileList = info.fileList; + this.setState({ contentFileList: appendFileSizeToUploadFileAll(contentFileList) }); + } + } + handleAnswerUploadChange = (info) => { + if (info.file.status === 'uploading' || info.file.status === 'done' || info.file.status === 'removed') { + let answerFileList = info.fileList; + this.setState({ answerFileList: appendFileSizeToUploadFileAll(answerFileList) }); + } + } - handleContentUploadChange = (info) => { - if (info.file.status === 'uploading' || info.file.status === 'done' || info.file.status === 'removed') { - let contentFileList = info.fileList; - this.setState({ contentFileList: appendFileSizeToUploadFileAll(contentFileList) }); - } - } - handleAnswerUploadChange = (info) => { - if (info.file.status === 'uploading' || info.file.status === 'done' || info.file.status === 'removed') { - let answerFileList = info.fileList; - this.setState({ answerFileList: appendFileSizeToUploadFileAll(answerFileList) }); - } - } - - onAttachmentRemove = (file, stateName) => { + onAttachmentRemove = (file, stateName) => { if(!file.percent || file.percent == 100){ this.props.confirm({ content: '是否确认删除?', @@ -264,293 +139,69 @@ class NewWork extends Component{ return false; } - } - deleteAttachment = (file, stateName) => { - // 初次上传不能直接取uid - const url = `/attachments/${file.response ? file.response.id : file.uid}.json` - axios.delete(url, { - }) - .then((response) => { - if (response.data) { - const { status } = response.data; - if (status == 0) { - console.log('--- success') - - this.setState((state) => { - const index = state[stateName].indexOf(file); - const newFileList = state[stateName].slice(); - newFileList.splice(index, 1); - return { - [stateName]: newFileList, - }; - }); - } - } - }) - .catch(function (error) { - console.log(error); - }); - } - max_num_change = (val) => { - if (val < 2) { - this.setState({ - max_num: 2, - }) - return; - } - const { min_num } = this.state; - this.setState({ - max_num: val, - min_num: val <= min_num ? val - 1 : min_num - }) - } - min_num_change = (val) => { - this.setState({ min_num: val }) - } - base_on_project_change = () => { - this.setState({ base_on_project: !this.state.base_on_project }) - } + } - render(){ - let {typeId,coursesId,pageType}=this.props.match.params; - const { getFieldDecorator } = this.props.form; - const isGroup = this.props.isGroup() - const moduleName = !isGroup? "普通作业":"分组作业"; - const moduleEngName = this.props.getModuleName() - 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 - }=this.state - const { current_user } = this.props + render(){ + let {typeId,coursesId,pageType}=this.props.match.params; - const courseId = this.state.course_id || this.props.match.params.coursesId ; - const isEdit = this.isEdit; - if ((isEdit == undefined || isEdit) && !this.state.workLoaded) { - return '' - } - const uploadProps = { - width: 600, - fileList: contentFileList, - multiple: true, - // https://github.com/ant-design/ant-design/issues/15505 - // showUploadList={false},然后外部拿到 fileList 数组自行渲染列表。 - // showUploadList: false, - action: `${getUploadActionUrl()}`, - onChange: this.handleContentUploadChange, - onRemove: (file) => this.onAttachmentRemove(file, 'contentFileList'), - beforeUpload: (file) => { - console.log('beforeUpload', file.name); - const isLt150M = file.size / 1024 / 1024 < 150; - if (!isLt150M) { - this.props.showNotification('文件大小必须小于150MB!'); - } - return isLt150M; - }, - }; - const answerUploadProps = { - width: 600, - fileList: answerFileList, - multiple: true, - // https://github.com/ant-design/ant-design/issues/15505 - // showUploadList={false},然后外部拿到 fileList 数组自行渲染列表。 - // showUploadList: false, - action: `${getUrl()}/api/attachments.json`, - onChange: this.handleAnswerUploadChange, - onRemove: (file) => this.onAttachmentRemove(file, 'answerFileList'), - beforeUpload: (file) => { - console.log('beforeUpload', file.name); - const isLt150M = file.size / 1024 / 1024 < 150; - if (!isLt150M) { - this.props.showNotification('文件大小必须小于150MB!'); - } - return isLt150M; - }, - }; + const isGroup = this.props.isGroup() + const moduleName = !isGroup? "普通作业":"分组作业"; + const moduleEngName = this.props.getModuleName() + let{ + course_name, category + }=this.state + const { current_user } = this.props - return( -
    -
    - {/*

    - {course_name} - > - {typeId==1 ?"普通作业":"分组作业"} - > - {pageType==="new"?"新建":"编辑"} -

    */} - - -

    - {this.isEdit ?"编辑":"新建"}{ moduleName } - {/* history.goBack() - this.props.toListPage(this.props.match.params, category.category_id)} - */} - this.props.history.goBack()}> - 返回 - -

    -
    - {/* onSubmit={this.handleSubmit} */} - -
    - - {getFieldDecorator('title', { - rules: [{ - required: true, message: '请输入标题' - }], - })( - - )} - - - {/* TpmQuestionEdit 这个没出现抖动 */} - { - {getFieldDecorator('description', { - rules: [{ - required: true, message: '请输入作业内容和要求' - }], - })( - - )} - } - - - (单个文件150M以内) - - - - { isGroup && - - {getFieldDecorator('personNum', { - rules: [{ - required: false - // required: true, message: '请输入最小人数和最大人数' - }], - })( -
    -

    - - {/* max={has_commit ? init_min_num : null } */} - - - - ~ - {/* min={has_commit ? init_max_num : (min_num == undefined ? 2 : min_num + 1) } */} - - - - -

    -

    - - 基于项目实施 - - - -

    -
    - )} -
    - } - - {getFieldDecorator('reference_answer', { - rules: [{ - required: false - }], - })( - - )} - - - (单个文件150M以内) - - - - - - -
    -
    -
    - ) - } + ` + } + + {this.newWorkFormRef = ref}} + > +
    +
    +
    + ) + } } -const WrappedBoardsNew = Form.create({ name: 'NewWork' })(NewWork); -export default WrappedBoardsNew; \ No newline at end of file + +export default NewWork; \ No newline at end of file From 36b2db25cf35821037a20c33fe834a3c6340919c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Fri, 6 Sep 2019 10:52:59 +0800 Subject: [PATCH 14/18] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../groupjobbank/Groupjobquesanswer.js | 44 ++++++++++++------- .../courses/questionbank/Generaljobanswer.js | 4 +- 2 files changed, 31 insertions(+), 17 deletions(-) diff --git a/public/react/src/modules/courses/groupjobbank/Groupjobquesanswer.js b/public/react/src/modules/courses/groupjobbank/Groupjobquesanswer.js index 1d58a7fae..f13b97cea 100644 --- a/public/react/src/modules/courses/groupjobbank/Groupjobquesanswer.js +++ b/public/react/src/modules/courses/groupjobbank/Groupjobquesanswer.js @@ -64,28 +64,42 @@ class Groupjobquesanswer extends Component {
    { - datas&&(datas.reference_answer===null? - + datas.reference_answer===null? + "" :datas.reference_answer==="null"? - - : + "" : datas.reference_answer===""? - + "" : - //
    - ) } - {/*
    */} -
    - {datas.attachments === undefined ? "" : - } -
    - {/**/} + {datas.reference_attachments === undefined ? + (datas.reference_answer===undefined || datas.reference_answer===null? + + : + "" + ) + : + datas.reference_attachments === null ? + (datas.reference_answer===undefined || datas.reference_answer===null? + + : + "" + ) + : + datas.reference_attachments.length === 0 ? + (datas.reference_answer===undefined || datas.reference_answer===null? + + : + "" + ) + : +
    + +
    + }
    - -
    ) diff --git a/public/react/src/modules/courses/questionbank/Generaljobanswer.js b/public/react/src/modules/courses/questionbank/Generaljobanswer.js index dec9da34e..9658fad55 100644 --- a/public/react/src/modules/courses/questionbank/Generaljobanswer.js +++ b/public/react/src/modules/courses/questionbank/Generaljobanswer.js @@ -77,8 +77,8 @@ class Generaljobanswer extends Component { } {/*
    */}
    - {datas.attachments === undefined ? "" : - } + {datas.reference_attachments === undefined ? "" : + }
    {/*{datas.attachments === undefined ? "" : datas.attachments.map((item, key) => {*/} From ab8a26e6b84c0f1342cddee1d0751dfd2ef23705 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Fri, 6 Sep 2019 10:55:37 +0800 Subject: [PATCH 15/18] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../courses/questionbank/Generaljobanswer.js | 71 +++++++++++++------ 1 file changed, 50 insertions(+), 21 deletions(-) diff --git a/public/react/src/modules/courses/questionbank/Generaljobanswer.js b/public/react/src/modules/courses/questionbank/Generaljobanswer.js index 9658fad55..d803627df 100644 --- a/public/react/src/modules/courses/questionbank/Generaljobanswer.js +++ b/public/react/src/modules/courses/questionbank/Generaljobanswer.js @@ -61,33 +61,62 @@ class Generaljobanswer extends Component { return (
    + {/*{*/} + {/* datas&&(datas.reference_answer===null?*/} + {/* */} + {/* :datas.reference_answer==="null"?*/} + {/* */} + {/* :*/} + {/* datas.reference_answer===""?*/} + {/* */} + {/* :*/} + {/* */} + + {/* //
    */} + {/* )*/} + {/*}*/} + {/*/!*
    *!/*/} + {/*
    */} + {/*{datas.reference_attachments === undefined ? "" :*/} + {/* }*/} + {/*
    */} + { - datas&&(datas.reference_answer===null? + datas.reference_answer===null? + "" + :datas.reference_answer==="null"? + "" : + datas.reference_answer===""? + "" + : + + } + + {datas.reference_attachments === undefined ? + (datas.reference_answer===undefined || datas.reference_answer===null? - :datas.reference_answer==="null"? + : + "" + ) + : + datas.reference_attachments === null ? + (datas.reference_answer===undefined || datas.reference_answer===null? : - datas.reference_answer===""? + "" + ) + : + datas.reference_attachments.length === 0 ? + (datas.reference_answer===undefined || datas.reference_answer===null? - : - - - //
    - ) + : + "" + ) + : +
    + +
    } - {/*
    */} -
    - {datas.reference_attachments === undefined ? "" : - } -
    - - {/*{datas.attachments === undefined ? "" : datas.attachments.map((item, key) => {*/} - {/* return (*/} - {/* */} - {/* )*/} - {/*})}*/} - -
    From 2f9da148978d8038fce980f73c96171637c137ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Fri, 6 Sep 2019 10:57:24 +0800 Subject: [PATCH 16/18] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/modules/courses/comtopicdetails/completetopicde.css | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/public/react/src/modules/courses/comtopicdetails/completetopicde.css b/public/react/src/modules/courses/comtopicdetails/completetopicde.css index 5f0c44391..730c74d6b 100644 --- a/public/react/src/modules/courses/comtopicdetails/completetopicde.css +++ b/public/react/src/modules/courses/comtopicdetails/completetopicde.css @@ -6,8 +6,7 @@ } .yslquesHeigth{ width: 100% !important; - - + min-height: 500px !important; } .yslquesmarkdowntext{ font-size: 16px; From 21d4cebd59823c683fa92852ba967089e81a1e35 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Fri, 6 Sep 2019 11:02:20 +0800 Subject: [PATCH 17/18] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../comtopicdetails/Completetopicdetails.js | 43 ++++++++++++------- .../comtopicdetails/completetopicde.css | 1 - 2 files changed, 28 insertions(+), 16 deletions(-) diff --git a/public/react/src/modules/courses/comtopicdetails/Completetopicdetails.js b/public/react/src/modules/courses/comtopicdetails/Completetopicdetails.js index 0ee640425..f9345a4ac 100644 --- a/public/react/src/modules/courses/comtopicdetails/Completetopicdetails.js +++ b/public/react/src/modules/courses/comtopicdetails/Completetopicdetails.js @@ -65,29 +65,42 @@ class Completetopicdetails extends Component {
    { datas&&(datas.description===null? - + "" :datas.description==="null"? - + "" : datas.description===""? - + "" : + ) + } - //
    + {datas.attachment_list === undefined ? + (datas.description===undefined || datas.description===null? + + : + "" ) + : + datas.attachment_list === null ? + (datas.description===undefined || datas.description===null? + + : + "" + ) + : + datas.attachment_list.length === 0 ? + (datas.description===undefined || datas.description===null? + + : + "" + ) + : +
    + +
    } - {/*
    */} - - {/*{datas.attachment_list === undefined ? "" : datas.attachment_list.map((item, key) => {*/} - {/* return (*/} - {/* */} - {/* )*/} - {/*})}*/} -
    - {datas.attachment_list === undefined ? "" : - } -
    diff --git a/public/react/src/modules/courses/comtopicdetails/completetopicde.css b/public/react/src/modules/courses/comtopicdetails/completetopicde.css index 730c74d6b..19367b3af 100644 --- a/public/react/src/modules/courses/comtopicdetails/completetopicde.css +++ b/public/react/src/modules/courses/comtopicdetails/completetopicde.css @@ -6,7 +6,6 @@ } .yslquesHeigth{ width: 100% !important; - min-height: 500px !important; } .yslquesmarkdowntext{ font-size: 16px; From 70e7f2f69d763197ab4ff4e8999829e5ad036dd9 Mon Sep 17 00:00:00 2001 From: caicai8 <1149225589@qq.com> Date: Fri, 6 Sep 2019 11:17:46 +0800 Subject: [PATCH 18/18] fix issue --- public/react/src/modules/courses/exercise/Exercise.js | 3 ++- .../react/src/modules/user/usersInfo/banks/BanksIndex.js | 2 +- public/react/src/modules/user/usersInfo/usersInfo.css | 9 +++++++++ 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/public/react/src/modules/courses/exercise/Exercise.js b/public/react/src/modules/courses/exercise/Exercise.js index 2bc646fb3..7662b2c21 100644 --- a/public/react/src/modules/courses/exercise/Exercise.js +++ b/public/react/src/modules/courses/exercise/Exercise.js @@ -338,7 +338,8 @@ class Exercise extends Component{ checkBoxValues:[], Modalstypeloding:false }) - this.InitList(type,StudentList_value,page,limit) + this.InitList(type,StudentList_value,page,limit); + this.props.updataleftNavfun(); } }).catch((error)=>{ console.log(error); diff --git a/public/react/src/modules/user/usersInfo/banks/BanksIndex.js b/public/react/src/modules/user/usersInfo/banks/BanksIndex.js index 496c21459..2a3c5c98d 100644 --- a/public/react/src/modules/user/usersInfo/banks/BanksIndex.js +++ b/public/react/src/modules/user/usersInfo/banks/BanksIndex.js @@ -105,7 +105,7 @@ class BanksIndex extends Component{ } { - crumbData &&

    + crumbData &&

    {crumbData && crumbData.title} { crumbData.is_public == true ? 公开 diff --git a/public/react/src/modules/user/usersInfo/usersInfo.css b/public/react/src/modules/user/usersInfo/usersInfo.css index 0801e46e2..906ebb839 100644 --- a/public/react/src/modules/user/usersInfo/usersInfo.css +++ b/public/react/src/modules/user/usersInfo/usersInfo.css @@ -234,6 +234,9 @@ line-height: 18px; margin:10px 0px 0px; } +.breadcrumb .ant-breadcrumb a:hover{ + color: #459BE5 !important; +} .breadcrumb .ant-breadcrumb-separator{ margin:0px 2px!important; } @@ -252,6 +255,12 @@ border-radius:20px; margin-top:3px; } +.breadcrumb.ant-breadcrumb > span:last-child a{ + color: #05101A +} +.breadcrumb.ant-breadcrumb a{ + color:#999; +} .bank_is_private{ background: #56B998; float: left;