From 8eaaf03d92f1cdb1eefad967421a1ae67db376ec Mon Sep 17 00:00:00 2001 From: p31729568 Date: Fri, 9 Aug 2019 09:42:51 +0800 Subject: [PATCH 1/3] 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 2/3] =?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 3/3] =?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}} /> +
+ ) + }) + } +
-
{/*