From b39e5d7d19dc8673a501e361aba6553a938cafda Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Fri, 9 Aug 2019 09:39:06 +0800 Subject: [PATCH 1/5] =?UTF-8?q?=E6=B2=A1=E6=9C=89=E5=88=86=E7=8F=AD?= =?UTF-8?q?=E7=9A=84=E4=BD=9C=E4=B8=9A=E4=B9=9F=E8=83=BD=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E6=9F=A5=E9=87=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/homework_commons/group_list.json.jbuilder | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/views/homework_commons/group_list.json.jbuilder b/app/views/homework_commons/group_list.json.jbuilder index aa951bf7d..b0c322aba 100644 --- a/app/views/homework_commons/group_list.json.jbuilder +++ b/app/views/homework_commons/group_list.json.jbuilder @@ -7,7 +7,8 @@ json.group_list do end end # 未分班展示情况放在最后 -if @course_groups.count != (@page.to_i - 1)*@limit.to_i && @course_groups.count < @limit.to_i +if (@course_groups.count != (@page.to_i - 1)*@limit.to_i && @course_groups.count < @limit.to_i) || + (@page.to_i == 1 && @course_groups.count == 0) ungroup_work_count = homework_ungroup_works_count(@homework, @ungroup_user_ids) if ungroup_work_count > 0 json.ungroup_list do From 8eaaf03d92f1cdb1eefad967421a1ae67db376ec Mon Sep 17 00:00:00 2001 From: p31729568 Date: Fri, 9 Aug 2019 09:42:51 +0800 Subject: [PATCH 2/5] ES search subject with subject member name --- app/models/searchable/dependents/user.rb | 1 + app/models/searchable/subject.rb | 1 + app/services/concerns/elasticsearch_able.rb | 1 + 3 files changed, 3 insertions(+) diff --git a/app/models/searchable/dependents/user.rb b/app/models/searchable/dependents/user.rb index bb55d0530..e77bc9a40 100644 --- a/app/models/searchable/dependents/user.rb +++ b/app/models/searchable/dependents/user.rb @@ -17,6 +17,7 @@ module Searchable::Dependents::User # reindex subject created_subjects.each(&:reindex) + subjects.each(&:reindex) end end end \ No newline at end of file diff --git a/app/models/searchable/subject.rb b/app/models/searchable/subject.rb index abefcd6dc..a0036c200 100644 --- a/app/models/searchable/subject.rb +++ b/app/models/searchable/subject.rb @@ -27,6 +27,7 @@ module Searchable::Subject { author_name: user.real_name, author_school_name: user.school_name, + member_user_names: users.map(&:real_name).join(' ') } end diff --git a/app/services/concerns/elasticsearch_able.rb b/app/services/concerns/elasticsearch_able.rb index e93f9c537..eb7d4de04 100644 --- a/app/services/concerns/elasticsearch_able.rb +++ b/app/services/concerns/elasticsearch_able.rb @@ -29,6 +29,7 @@ module ElasticsearchAble subject_stages: { type: 'plain' }, content: { type: 'plain' }, descendants_contents: { type: 'plain' }, + member_user_names: { type: 'plain' } } } end From bfe20710765632d6b3c7abcfb8ada4523fdf66be 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, 9 Aug 2019 09:56:47 +0800 Subject: [PATCH 3/5] =?UTF-8?q?=20=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/react/config/webpack.config.prod.js | 4 ++-- .../Shixunworkdetails/ShixunWorkModal.js | 12 +++++++++--- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/public/react/config/webpack.config.prod.js b/public/react/config/webpack.config.prod.js index 0abd707af..7b9795e80 100644 --- a/public/react/config/webpack.config.prod.js +++ b/public/react/config/webpack.config.prod.js @@ -301,8 +301,8 @@ module.exports = { }, warnings: false, compress: { - drop_debugger: false, - drop_console: false + drop_debugger: true, + drop_console: true } } }), diff --git a/public/react/src/modules/courses/shixunHomework/Shixunworkdetails/ShixunWorkModal.js b/public/react/src/modules/courses/shixunHomework/Shixunworkdetails/ShixunWorkModal.js index cc9586577..051fbd32a 100644 --- a/public/react/src/modules/courses/shixunHomework/Shixunworkdetails/ShixunWorkModal.js +++ b/public/react/src/modules/courses/shixunHomework/Shixunworkdetails/ShixunWorkModal.js @@ -132,13 +132,14 @@ class ShixunWorkModal extends Component{ onChange=(e)=>{ let{group_list}=this.state; - let {data}=this.props; if(e.target.checked===true){ if(data&&data.length===0){ let id=[] group_list.forEach((item,key)=>{ - id.push(item.id) + if(item.works_count!=0){ + id.push(item.id) + } }) this.setState({ group_ids:id, @@ -147,7 +148,9 @@ class ShixunWorkModal extends Component{ }else{ let id=[] group_list.forEach((item,key)=>{ - id.push(item.id) + if(item.works_count!=0){ + id.push(item.id) + } }) this.setState({ group_ids:id, @@ -161,6 +164,9 @@ class ShixunWorkModal extends Component{ }) } + + + } From 459810bf9622d66e6371d4647c02131d6ac4bfc5 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, 9 Aug 2019 10:03:20 +0800 Subject: [PATCH 4/5] =?UTF-8?q?=E4=B8=AA=E6=A3=80=E7=B4=A2=E7=BB=93?= =?UTF-8?q?=E6=9E=9C=20=E6=95=B0=E9=87=8F=E7=BB=9F=E8=AE=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/react/src/search/SearchPage.js | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/public/react/src/search/SearchPage.js b/public/react/src/search/SearchPage.js index 3a2d1df8a..5b3d51d22 100644 --- a/public/react/src/search/SearchPage.js +++ b/public/react/src/search/SearchPage.js @@ -247,8 +247,20 @@ class SearchPage extends Component{ }) } +
+ {/*合作单位*/} + {item.content.member_user_names === undefined || item.content.member_user_names===0?"": item.content.member_user_names.map((item7, key7) => { + return ( +
+ 合作单位: + 1?" tzbq ":" tzbqx"} + dangerouslySetInnerHTML={{__html:item7}} /> +
+ ) + }) + } +
-
{/* From fa20d8f123865053f4bca49498cb4ca1a87dbe45 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Fri, 9 Aug 2019 10:15:03 +0800 Subject: [PATCH 5/5] =?UTF-8?q?=E8=B7=AF=E7=94=B1=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/models/shixun.rb | 4 ++++ app/views/challenges/edit.json.jbuilder | 1 + 2 files changed, 5 insertions(+) diff --git a/app/models/shixun.rb b/app/models/shixun.rb index 61d15de55..3977e9204 100644 --- a/app/models/shixun.rb +++ b/app/models/shixun.rb @@ -246,6 +246,10 @@ class Shixun < ApplicationRecord Game.joins(:myshixun).where(user_id: user.id, status: 2, myshixuns: { shixun_id: id }).count end + def has_web_route? + self.mirror_name.include?('JFinal') || self.mirror_name.include?('PHP') && self.mirror_name.include?('Mysql') || self.mirror_name.include?('Web') + end + private def send_tiding diff --git a/app/views/challenges/edit.json.jbuilder b/app/views/challenges/edit.json.jbuilder index 2774b5a05..5ae15cf67 100644 --- a/app/views/challenges/edit.json.jbuilder +++ b/app/views/challenges/edit.json.jbuilder @@ -13,6 +13,7 @@ elsif @tab == 1 # 评测设置的编辑模式 json.(@challenge, :id, :path, :exec_path, :show_type, :original_picture_path, :expect_picture_path, :picture_path, :web_route, :test_set_score, :test_set_average) + json.has_web_route @shixun.has_web_route? json.test_sets @challenge.test_sets do |set| json.hidden (set.is_public ? 0 : 1) json.(set, :input, :output, :score)