From 2abd11f4e202ba9e6e5700bda35ccc880273ecf9 Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Fri, 13 Dec 2019 19:48:08 +0800 Subject: [PATCH 1/7] =?UTF-8?q?=E5=AE=9E=E8=AE=AD=E6=8A=A5=E5=91=8A?= =?UTF-8?q?=E5=AF=BC=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/student_works_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/student_works_controller.rb b/app/controllers/student_works_controller.rb index dfdce7bd2..946b65d24 100644 --- a/app/controllers/student_works_controller.rb +++ b/app/controllers/student_works_controller.rb @@ -529,7 +529,7 @@ class StudentWorksController < ApplicationController @echart_data = student_efficiency(@homework, @work) @myself_eff = @echart_data[:efficiency_list].find { |item| item.last == @user.id } @myself_consume = @echart_data[:consume_list].find { |item| item.last == @user.id } - filename_ = "#{@use&.student_id}_#{@use&.real_name}_#{@shixun&.name}_#{Time.now.strftime('%Y%m%d_%H%M%S')}.pdf" + filename_ = "#{@user&.student_id}_#{@user&.real_name}_#{@shixun&.name}_#{Time.now.strftime('%Y%m%d_%H%M%S')}.pdf" filename = filename_.strip.tr("+/", "-_") stylesheets = %w(shixun_work/shixun_work.css shared/codemirror.css) if params[:export].present? && params[:export] From acb654308ad912576abda5efa92549fb73a581f7 Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Fri, 13 Dec 2019 19:53:28 +0800 Subject: [PATCH 2/7] =?UTF-8?q?=E8=B0=83=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/services/shixun_search_service.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/app/services/shixun_search_service.rb b/app/services/shixun_search_service.rb index fce8a2fd5..f5af69179 100644 --- a/app/services/shixun_search_service.rb +++ b/app/services/shixun_search_service.rb @@ -38,6 +38,7 @@ class ShixunSearchService < ApplicationService @shixuns = @shixuns.where(trainee: params[:diff]) end + Rails.logger.info("search_shixun_ids: #{@shixuns.pluck(:id)}") Shixun.search(keyword, search_options) end From 4446c1e943871a71dd851640f523e6790cb823ee 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, 13 Dec 2019 20:01:56 +0800 Subject: [PATCH 3/7] =?UTF-8?q?=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/modals/Modals.js | 8 ++++-- public/react/src/modules/tpm/TPMBanner.js | 20 ++++++++++++-- .../modules/tpm/TPMsettings/Configuration.js | 26 +++++++++---------- 3 files changed, 36 insertions(+), 18 deletions(-) diff --git a/public/react/src/modules/modals/Modals.js b/public/react/src/modules/modals/Modals.js index e241f379a..686dae46a 100644 --- a/public/react/src/modules/modals/Modals.js +++ b/public/react/src/modules/modals/Modals.js @@ -31,6 +31,9 @@ render() { } .ant-modal-body { padding: 20px 40px; + } + .color848282{ + color:#848282; } ` } @@ -38,8 +41,9 @@ render() {

{this.props.modalsTopval}

- {this.props.modalsMidval===undefined?"":

{this.props.modalsMidval}

} -

{this.props.modalsBottomval}

+ {this.props.modalsMidval===undefined?"":

{this.props.modalsMidval}

} +

{this.props.modalsBottomval}

{this.props.loadtype===true?
知道啦 diff --git a/public/react/src/modules/tpm/TPMBanner.js b/public/react/src/modules/tpm/TPMBanner.js index a43bacd5e..57dadd858 100644 --- a/public/react/src/modules/tpm/TPMBanner.js +++ b/public/react/src/modules/tpm/TPMBanner.js @@ -347,6 +347,7 @@ class TPMBanner extends Component { Modalstopval: "", modalsMidval:undefined, ModalsBottomval:"", + modalstyles:"", }) } ModalSave = () => { @@ -368,15 +369,29 @@ class TPMBanner extends Component { ModalsBottomval:"卡,学员需要重新体验课程", ModalCancel: this.ModalCancel, ModalSave: this.ModalSave, + modalstyles:"848282" }) } - + ModalSaveopenpublic= () => { + this.setState({ + Modalstype: true, + Modalstopval: "公开申请已提交,请等待管理员的审核", + modalsMidval:"• 我们将在1-2个工作日内完成审核", + ModalCancel: this.eopenpublicupdatadata, + ModalSave: this.eopenpublicupdatadata, + modalstyles:"848282" + }) + } + eopenpublicupdatadata=()=>{ + window.location.reload() + } openpublic=()=>{ let id = this.props.match.params.shixunId; let url = `/shixuns/${id}/apply_public.json`; axios.get(url).then((response) => { if(response.data.status===0){ - window.location.reload() + this.ModalSaveopenpublic() + } }).catch((error) => { console.log(error) @@ -791,6 +806,7 @@ class TPMBanner extends Component { modalsBottomval={this.state.ModalsBottomval} modalsMidval={this.state.modalsMidval} loadtype={this.state.Loadtype} + modalstyles={this.state.modalstyles} /> : ""}
diff --git a/public/react/src/modules/tpm/TPMsettings/Configuration.js b/public/react/src/modules/tpm/TPMsettings/Configuration.js index 129ca457c..03720798a 100644 --- a/public/react/src/modules/tpm/TPMsettings/Configuration.js +++ b/public/react/src/modules/tpm/TPMsettings/Configuration.js @@ -115,7 +115,8 @@ export default class Shixuninformation extends Component { onChangeTimePicker = (value, dateString) => { this.setState({ opening_time: dateString === "" ? "" : handleDateStrings(dateString), - opening_timetype:false + opening_timetype:false, + loading: false }) } @@ -133,12 +134,20 @@ export default class Shixuninformation extends Component { return } } + let list=[] + scope_partment.map((item,key)=>{ + list.push(item) + }) + + oldscope_partment.map((item,key)=>{ + list.push(item) + }) let id = this.props.match.params.shixunId; let url = `/shixuns/${id}/update_permission_setting.json`; axios.post(url, { - scope_partment: scope_partment, + scope_partment: list, shixun: { can_copy: can_copy, use_scope: use_scope, @@ -149,16 +158,6 @@ export default class Shixuninformation extends Component { if (response.data.status === -1) { } else { - - let list=[] - scope_partment.map((item,key)=>{ - list.push(item) - }) - - oldscope_partment.map((item,key)=>{ - list.push(item) - }) - this.props.showNotification("权限配置保存成功!") this.setState({ loading: false, @@ -292,7 +291,6 @@ export default class Shixuninformation extends Component {
- {this.props.data && this.props.data.shixun.use_scope === 0 && this.props.data && this.props.data.shixun.status === 2 ? "" :
公开程度: @@ -371,7 +369,7 @@ export default class Shixuninformation extends Component { -
} +
开启时间: From 377199683a5ef57983fd71e27296d816a4b3bc02 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, 13 Dec 2019 20:10:10 +0800 Subject: [PATCH 4/7] =?UTF-8?q?=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/tpm/TPMBanner.js | 4 ++-- public/react/src/modules/tpm/shixuns/css/TPMBanner.css | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/public/react/src/modules/tpm/TPMBanner.js b/public/react/src/modules/tpm/TPMBanner.js index a43bacd5e..55a26563c 100644 --- a/public/react/src/modules/tpm/TPMBanner.js +++ b/public/react/src/modules/tpm/TPMBanner.js @@ -1208,7 +1208,7 @@ class TPMBanner extends Component { {this.props.identity < 8 && shixunsDetails.shixun_status != -1 && shixunsDetails.shixun_status != 0? -
{!!shixunsDetails.fork_num && - + {shixunsDetails.fork_num} } diff --git a/public/react/src/modules/tpm/shixuns/css/TPMBanner.css b/public/react/src/modules/tpm/shixuns/css/TPMBanner.css index f5970a55b..54f25b590 100644 --- a/public/react/src/modules/tpm/shixuns/css/TPMBanner.css +++ b/public/react/src/modules/tpm/shixuns/css/TPMBanner.css @@ -156,3 +156,4 @@ a:active{text-decoration:none;} box-sizing: border-box; color: #ffffff !important; } +.forkNumst{display: block;float: left;width: 36px;text-align: center;border-left: 1px solid #ffffff !important;color: #ffffff!important; } From 9781f407a527a8aa0d74d392f81f227915413a7e 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, 13 Dec 2019 20:15:16 +0800 Subject: [PATCH 5/7] =?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/tpm/shixunchild/Collaborators/Collaborators.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/react/src/modules/tpm/shixunchild/Collaborators/Collaborators.js b/public/react/src/modules/tpm/shixunchild/Collaborators/Collaborators.js index 747a1cbe6..30c752a39 100644 --- a/public/react/src/modules/tpm/shixunchild/Collaborators/Collaborators.js +++ b/public/react/src/modules/tpm/shixunchild/Collaborators/Collaborators.js @@ -634,7 +634,7 @@ class Collaborators extends Component {

-

{item.user.identity}

+

{item.user.identity}

{item.user.school_name}

发布实训项目  {item.user.user_shixuns_count}

From aa3714724e013300312e74e781202b625040c13a 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, 13 Dec 2019 20:16:36 +0800 Subject: [PATCH 6/7] =?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/tpm/shixunchild/Collaborators/Collaborators.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/react/src/modules/tpm/shixunchild/Collaborators/Collaborators.js b/public/react/src/modules/tpm/shixunchild/Collaborators/Collaborators.js index 30c752a39..7a8e2ed75 100644 --- a/public/react/src/modules/tpm/shixunchild/Collaborators/Collaborators.js +++ b/public/react/src/modules/tpm/shixunchild/Collaborators/Collaborators.js @@ -634,7 +634,7 @@ class Collaborators extends Component {

-

{item.user.identity}

+

{item.user.identity}

{item.user.school_name}

发布实训项目  {item.user.user_shixuns_count}

From 1d63e7485da87b12c29490224e51fec97950eefb 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, 13 Dec 2019 20:18:14 +0800 Subject: [PATCH 7/7] =?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/tpm/TPMsettings/Configuration.js | 11 +++++++---- .../modules/tpm/TPMsettings/LearningSettings.js | 16 ++++++++-------- 2 files changed, 15 insertions(+), 12 deletions(-) diff --git a/public/react/src/modules/tpm/TPMsettings/Configuration.js b/public/react/src/modules/tpm/TPMsettings/Configuration.js index 03720798a..79f253191 100644 --- a/public/react/src/modules/tpm/TPMsettings/Configuration.js +++ b/public/react/src/modules/tpm/TPMsettings/Configuration.js @@ -121,9 +121,7 @@ export default class Shixuninformation extends Component { } onSubmits = () => { - this.setState({ - loading: true - }) + let {can_copy, use_scope, scope_partment, opening_time,oldscope_partment} = this.state; if(this.state.opentime===true){ if(opening_time===null){ @@ -145,6 +143,9 @@ export default class Shixuninformation extends Component { let id = this.props.match.params.shixunId; let url = `/shixuns/${id}/update_permission_setting.json`; + this.setState({ + loading: true + }) axios.post(url, { scope_partment: list, @@ -172,7 +173,9 @@ export default class Shixuninformation extends Component { }) }) - + this.setState({ + loading: false + }) } CheckboxonChange = (e) => { this.setState({ diff --git a/public/react/src/modules/tpm/TPMsettings/LearningSettings.js b/public/react/src/modules/tpm/TPMsettings/LearningSettings.js index ac1b0e25a..681cbc956 100644 --- a/public/react/src/modules/tpm/TPMsettings/LearningSettings.js +++ b/public/react/src/modules/tpm/TPMsettings/LearningSettings.js @@ -20,7 +20,7 @@ export default class Shixuninformation extends Component { this.state = { vnc: false, hide_code: false, - is_secret_repository: false, + code_edit_permission: false, code_hidden: false, forbid_copy: false, test_set_permission: true, @@ -43,7 +43,7 @@ export default class Shixuninformation extends Component { hide_code: this.props.data && this.props.data.shixun.hide_code, task_pass: this.props.data && this.props.data.shixun.task_pass, test_set_permission: this.props.data && this.props.data.shixun.test_set_permission, - is_secret_repository: this.props.data && this.props.data.shixun.is_secret_repository, + code_edit_permission: this.props.data && this.props.data.shixun.code_edit_permission, websshshow: this.props.data && this.props.data.shixun.webssh === 0 ? false : true, multi_webssh: this.props.data && this.props.data.shixun.multi_webssh, opensshRadio: this.props.data && this.props.data.shixun.webssh === 0 ? null : this.props.data && this.props.data.shixun.webssh, @@ -71,7 +71,7 @@ export default class Shixuninformation extends Component { hide_code: this.props.data && this.props.data.shixun.hide_code, task_pass: this.props.data && this.props.data.shixun.task_pass, test_set_permission: this.props.data && this.props.data.shixun.test_set_permission, - is_secret_repository: this.props.data && this.props.data.shixun.is_secret_repository, + code_edit_permission: this.props.data && this.props.data.shixun.code_edit_permission, websshshow: this.props.data && this.props.data.shixun.webssh === 0 ? false : true, multi_webssh: this.props.data && this.props.data.shixun.multi_webssh, opensshRadio: this.props.data && this.props.data.shixun.webssh === 0 ? null : this.props.data && this.props.data.shixun.webssh, @@ -106,7 +106,7 @@ export default class Shixuninformation extends Component { test_set_permission: this.state.test_set_permission, vnc: this.state.vnc, webssh: this.state.websshshow === false ? 0 : this.state.opensshRadio, - code_edit_permission:this.state.is_secret_repository + code_edit_permission:this.state.code_edit_permission }, } ).then((response) => { @@ -131,7 +131,7 @@ export default class Shixuninformation extends Component { if (this.state.vnc === false) { this.setState({ hide_code: false, - is_secret_repository: false, + code_edit_permission: false, code_hidden: false, forbid_copy: false, multi_webssh: false, @@ -146,7 +146,7 @@ export default class Shixuninformation extends Component { Checkhide_code = () => { if (this.state.hide_code === false) { this.setState({ - is_secret_repository: false + code_edit_permission: false }) } this.setState({ @@ -156,7 +156,7 @@ export default class Shixuninformation extends Component { Checkis_secret_repository = () => { this.setState({ - is_secret_repository: !this.state.is_secret_repository + code_edit_permission: !this.state.code_edit_permission }) } @@ -289,7 +289,7 @@ export default class Shixuninformation extends Component { 公开版本库: