From 40dfc7d490ed6d8b0b1123af9152fe4b9622c09a Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Wed, 23 Oct 2019 17:27:15 +0800 Subject: [PATCH 01/31] =?UTF-8?q?python=E6=96=87=E4=BB=B6=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/myshixuns_controller.rb | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/app/controllers/myshixuns_controller.rb b/app/controllers/myshixuns_controller.rb index 4e587513a..4b2e3f54f 100644 --- a/app/controllers/myshixuns_controller.rb +++ b/app/controllers/myshixuns_controller.rb @@ -264,11 +264,13 @@ class MyshixunsController < ApplicationController unless @hide_code || (@myshixun.shixun&.vnc_evaluate && params[:evaluate].present?) # 远程版本库文件内容 last_content = GitService.file_content(repo_path: @repo_path, path: path)["content"] - content = if @myshixun.mirror_name.select {|a| a.include?("MachineLearning") || a.include?("Python")}.present? && params[:content].present? - params[:content].gsub(/\t/, ' ').gsub(/ /, ' ') # 这个不是空格,在windows机器上带来的问题 - else - params[:content] - end + + content = + if python_file?(path) + params[:content].gsub(/\t/, ' ').gsub(/ /, ' ') + else + params[:content] + end uid_logger_dubug("###11222333####{content}") uid_logger_dubug("###222333####{last_content}") @@ -374,4 +376,9 @@ class MyshixunsController < ApplicationController @repo_path = @myshixun.try(:repo_path) @path = params[:path] end + + def python_file?(path) + false if path.blank? + path.to_s.split(".").last.downcase == "py" + end end From b1658ead34f88911e29fb6492b1afe11de422dfd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Thu, 24 Oct 2019 12:23:17 +0800 Subject: [PATCH 02/31] tiaozheng --- .../src/modules/courses/coursesDetail/CoursesBanner.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/public/react/src/modules/courses/coursesDetail/CoursesBanner.js b/public/react/src/modules/courses/coursesDetail/CoursesBanner.js index 9ebd3f767..f6e3ce781 100644 --- a/public/react/src/modules/courses/coursesDetail/CoursesBanner.js +++ b/public/react/src/modules/courses/coursesDetail/CoursesBanner.js @@ -481,9 +481,9 @@ class CoursesBanner extends Component { document.title=coursedata===undefined || coursedata.status===401 || coursedata.status===407?"":coursedata.name; return (
- { - is_guide && - } + {/*{*/} + {/* is_guide && */} + {/*}*/} {AccountProfiletype===true?this.hideAccountProfile()} From 46567871bd1b4f2eefe3fd776941ac6197565ce7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Thu, 24 Oct 2019 12:32:04 +0800 Subject: [PATCH 03/31] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Competitimain/CompetitionsIndex.js | 13 ++++++---- .../Competitimain/Competitionsindex.css | 24 ++++++++++++------- .../Competition_teams/Competitionteams.js | 22 +++++++++++++---- 3 files changed, 40 insertions(+), 19 deletions(-) diff --git a/public/react/src/modules/competitions/Competitimain/CompetitionsIndex.js b/public/react/src/modules/competitions/Competitimain/CompetitionsIndex.js index 61e6419b7..b0a9ff4c9 100644 --- a/public/react/src/modules/competitions/Competitimain/CompetitionsIndex.js +++ b/public/react/src/modules/competitions/Competitimain/CompetitionsIndex.js @@ -1,6 +1,6 @@ import React, { Component } from 'react'; import { Link } from 'react-router-dom'; -import { Menu, Icon, List, Avatar,Row, Col,Tag,Pagination} from 'antd'; +import { Menu, Icon, List, Avatar,Row, Col,Tag,Pagination,Alert} from 'antd'; import {getImageUrl} from 'educoder'; import axios from 'axios'; import './Competitionsindex.css'; @@ -78,8 +78,7 @@ class CompetitionsIndex extends Component{ } render() { let {datas,page,count}=this.state; - admin: true - business: false + console.log(this.props.current_user&&this.props.current_user.business) return (
@@ -133,7 +132,11 @@ class CompetitionsIndex extends Component{ dataSource={datas&&datas} renderItem={(item,key) => (
+
+ {item.competition_status==="nearly_published"? + this.props.current_user&&this.props.current_user.admin===true?"":this.props.current_user&&this.props.current_user.business===true?"":
即将发布 敬请期待
:""} + {/*
即将发布 敬请期待
*/} {item.description===null||item.description===undefined||item.description===""? From cfd9e4f6c04c6f3bbc11911726c0daa85bd92963 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Thu, 24 Oct 2019 17:30:57 +0800 Subject: [PATCH 12/31] =?UTF-8?q?=E7=AB=9E=E8=B5=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/modules/competition/Registration.js | 2 +- .../competition/competmodal/PersonModal.js | 20 +++++++++++++--- .../personal/PersonalCompetititem.js | 23 ++++++++++--------- 3 files changed, 30 insertions(+), 15 deletions(-) diff --git a/public/react/src/modules/competition/Registration.js b/public/react/src/modules/competition/Registration.js index e41f33fde..a32b36147 100644 --- a/public/react/src/modules/competition/Registration.js +++ b/public/react/src/modules/competition/Registration.js @@ -394,7 +394,7 @@ class Registration extends React.Component { //已经报名 this.setState({ messagePerbool: true, - intpermessages: "您已报名,无需重复报" + intpermessages: "你已经报名,不能重复报名" }) return; } diff --git a/public/react/src/modules/competition/competmodal/PersonModal.js b/public/react/src/modules/competition/competmodal/PersonModal.js index 76823550f..7f7637dce 100644 --- a/public/react/src/modules/competition/competmodal/PersonModal.js +++ b/public/react/src/modules/competition/competmodal/PersonModal.js @@ -198,7 +198,12 @@ class PersonModal extends Component { }) return } - + this.setState({ + Thecurrentnumberbool: false, + Thecurrentnumber: i, + booltech: false, + boolstud: false + }) } } } catch (e) { @@ -226,7 +231,12 @@ class PersonModal extends Component { }) return } - + this.setState({ + Thecurrentnumberboolstu: false, + Thecurrentnumberstu: s, + booltech: false, + boolstud: false + }) } } } catch (e) { @@ -582,13 +592,15 @@ class PersonModal extends Component { // ////console.log("inputOnBlur"); // ////console.log(e); this.setState({ - person1: false + person1: false, + person2: false }) } inputOnBlur2 = (e) => { // ////console.log("inputOnBlur"); // ////console.log(e); this.setState({ + person1: false, person2: false }) } @@ -1141,6 +1153,7 @@ class PersonModal extends Component { placeholder="请输入老师姓名的任意关键字进行搜索,可以后续在添加" onPressEnter={this.startSearch} onFocus={this.inputOnFocus} + onBlur={this.inputOnBlur} onChange={(e) => this.teacheronChange(e)} value={this.state.keywordteachers} suffix={ @@ -1199,6 +1212,7 @@ class PersonModal extends Component { placeholder="请输入想要队员姓名的任意关键字进行搜索" onPressEnter={this.startSearch2} onFocus={this.inputOnFocus2} + onBlur={this.inputOnBlur2} onChange={(e) => this.studentsonChange(e)} value={this.state.keywordstudents} suffix={ diff --git a/public/react/src/modules/competition/personal/PersonalCompetititem.js b/public/react/src/modules/competition/personal/PersonalCompetititem.js index a39605154..5dd4a6dbe 100644 --- a/public/react/src/modules/competition/personal/PersonalCompetititem.js +++ b/public/react/src/modules/competition/personal/PersonalCompetititem.js @@ -9,7 +9,7 @@ import moment from 'moment'; import {SnackbarHOC, WordsBtn, getImageUrl} from 'educoder'; import {TPMIndexHOC} from '../../tpm/TPMIndexHOC'; import competition from '../comcss/competition.css'; -import {Button, message} from 'antd'; +import {Button, message, Tooltip} from 'antd'; // 点击按钮复制功能 function jsCopy() { var e = document.getElementById("copy_invite_code"); @@ -175,16 +175,17 @@ class PersonalCompetititem extends React.Component { > : - { - jsCopy() - }} - > - - + + { + jsCopy() + }} + > + + } { From b48bd3aabb9b5b259b1ea01c427ab0343432a650 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Thu, 24 Oct 2019 18:17:34 +0800 Subject: [PATCH 13/31] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Competitioncommon/CompetitionCommon.js | 7 ++++--- .../Competitioncommon/CompetitionContents.js | 13 ++++++++----- .../Competitioncommon/CompetitionContentsChart.js | 2 +- 3 files changed, 13 insertions(+), 9 deletions(-) diff --git a/public/react/src/modules/competitions/Competitioncommon/CompetitionCommon.js b/public/react/src/modules/competitions/Competitioncommon/CompetitionCommon.js index a60e91adb..845182958 100644 --- a/public/react/src/modules/competitions/Competitioncommon/CompetitionCommon.js +++ b/public/react/src/modules/competitions/Competitioncommon/CompetitionCommon.js @@ -17,7 +17,8 @@ class CompetitionCommon extends Component{ this.state={ data:undefined, bannerdata:undefined, - module_type:undefined + module_type:undefined, + mdContentdata:undefined } } @@ -69,7 +70,7 @@ class CompetitionCommon extends Component{ axios.get(url).then((response) => { if(response.status===200){ this.setState({ - mdContent:response.data + mdContentdata:response.data }) } }).catch((error) => { @@ -80,7 +81,7 @@ class CompetitionCommon extends Component{ } render() { - let {data,bannerdata,module_type,module_id,mdContent}=this.state; + let {data,bannerdata,module_type,module_id,mdContentdata}=this.state; console.log(module_type) return ( data===undefined?"":
diff --git a/public/react/src/modules/competitions/Competitioncommon/CompetitionContents.js b/public/react/src/modules/competitions/Competitioncommon/CompetitionContents.js index 767e6b956..f9d966be0 100644 --- a/public/react/src/modules/competitions/Competitioncommon/CompetitionContents.js +++ b/public/react/src/modules/competitions/Competitioncommon/CompetitionContents.js @@ -21,15 +21,18 @@ class CompetitionContents extends Component{ render() { - let{mdContent}=this.props; + let{mdContentdata}=this.props; + // return (
- - - + :""} +
+ + +
) diff --git a/public/react/src/modules/competitions/Competitioncommon/CompetitionContentsChart.js b/public/react/src/modules/competitions/Competitioncommon/CompetitionContentsChart.js index 730fae89b..765559e52 100644 --- a/public/react/src/modules/competitions/Competitioncommon/CompetitionContentsChart.js +++ b/public/react/src/modules/competitions/Competitioncommon/CompetitionContentsChart.js @@ -86,7 +86,7 @@ class CompetitionContents extends Component{ return (
- + From 8007cf0145aae8bd55c7de90b245d6890faedc07 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Thu, 24 Oct 2019 18:27:02 +0800 Subject: [PATCH 14/31] =?UTF-8?q?=E7=AB=9E=E8=B5=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/modules/competition/Registration.js | 5 +- .../competition/comcss/competition.css | 25 +++ .../competition/competmodal/PersonModal.js | 195 +++++++++++++----- 3 files changed, 178 insertions(+), 47 deletions(-) diff --git a/public/react/src/modules/competition/Registration.js b/public/react/src/modules/competition/Registration.js index a32b36147..d599fdf3d 100644 --- a/public/react/src/modules/competition/Registration.js +++ b/public/react/src/modules/competition/Registration.js @@ -64,6 +64,7 @@ class Registration extends React.Component { pint: 0, competition_name: undefined, mutiple_limited: false, + teamutiple_limited: false, } } @@ -117,6 +118,7 @@ class Registration extends React.Component { teacher_staff: result.data.teacher_staff, member_staff: result.data.member_staff, mutiple_limited: result.data.member_staff.mutiple_limited, + teamutiple_limited: result.data.teacher_staff.mutiple_limited }) if (result.data.enroll_ended === true) { this.setState({ @@ -631,7 +633,7 @@ class Registration extends React.Component { render() { - const {page, pages, limit, type, tmodalsType, tmodalsTypes, data, count, competition_teams, Newtit, itemiddata, messagePerbool, messageexitol, GetenrollmentAPI, loadingstate, pint, competition_name, mutiple_limited} = this.state; + const {page, pages, limit, type, tmodalsType, tmodalsTypes, data, count, competition_teams, Newtit, itemiddata, messagePerbool, messageexitol, GetenrollmentAPI, loadingstate, pint, competition_name, mutiple_limited, teamutiple_limited} = this.state; return (
@@ -659,6 +661,7 @@ class Registration extends React.Component { tmodalsType === true ? this.Tmoconfirm1(bool)} GetenrollmentAPIopens={() => this.GetenrollmentAPI()} diff --git a/public/react/src/modules/competition/comcss/competition.css b/public/react/src/modules/competition/comcss/competition.css index e9fd84944..0f34dbf0d 100644 --- a/public/react/src/modules/competition/comcss/competition.css +++ b/public/react/src/modules/competition/comcss/competition.css @@ -774,6 +774,31 @@ reglistviewdivs2 { cursor: default; } +.maxnamewidth85 { + max-width: 85px; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + cursor: default; +} + +.maxnamewidth90 { + max-width: 90px; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + cursor: default; +} + +.maxnamewidth110 { + max-width: 110px; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + cursor: default; +} + + .maxnamewidth160 { max-width: 160px; overflow: hidden; diff --git a/public/react/src/modules/competition/competmodal/PersonModal.js b/public/react/src/modules/competition/competmodal/PersonModal.js index 7f7637dce..a27ba9b00 100644 --- a/public/react/src/modules/competition/competmodal/PersonModal.js +++ b/public/react/src/modules/competition/competmodal/PersonModal.js @@ -878,37 +878,107 @@ class PersonModal extends Component { var cpersondiv1Items = []; if (teacher_ids) { cpersondiv1Items = teacher_ids.map((item, index) => - this.getdatacpersondiv1Items(item)} + onClick={() => this.getdatacpersondiv1Items(item)} + > -

{item.name === undefined || item.name === null || item.name === "" ? "--" : item.name}

-

{item.identity === undefined || item.identity === null || item.identity === "" ? "--" : item.identity}

-

{item.school_name === undefined || item.school_name === null || item.school_name === "" ? "--" : item.school_name}

+ + {item.name === undefined || item.name === null || item.name === "" ? +
-- + : + {item.name} + } + {item.identity === undefined || item.identity === null || item.identity === "" ? +

--

+ : + {item.identity}} + {item.school_name === undefined || item.school_name === null || item.school_name === "" ? + +

--

+ : + {item.school_name} + } + + { + this.props.teamutiple_limited === undefined || this.props.teamutiple_limited === null ? +

{""}

+ : + ( + this.props.teamutiple_limited === true ? +

{item.enrollable === false ? "已加入其他战队" : ""}

+ : +

{""}

+ ) + + } + + + + ); } @@ -953,24 +1023,62 @@ class PersonModal extends Component { }} onClick={() => this.getdatacpersondiv1Items2(item)} > -

{item.name === undefined || item.name === null || item.name === "" ? "--" : item.name}

-

{item.identity === undefined || item.identity === null || item.identity === "" ? "--" : item.identity}

-

{item.school_name === undefined || item.school_name === null || item.school_name === "" ? "--" : item.school_name}

+ + {item.name === undefined || item.name === null || item.name === "" ? + -- + : + {item.name} + } + {item.student_id === undefined || item.student_id === null || item.student_id === "" ? +

--

+ : + {"学号:" + item.student_id}} + {item.school_name === undefined || item.school_name === null || item.school_name === "" ? + +

--

+ : + {item.school_name} + } + { this.props.mutiple_limited === undefined || this.props.mutiple_limited === null ?

- {/* this.onSearch(value)}*/} - {/*/>*/} trigger.parentNode} visible={this.state.person2}> From c13dfbaa5b2bbe63057756a9b628dfc333abee79 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Thu, 24 Oct 2019 22:49:42 +0800 Subject: [PATCH 15/31] =?UTF-8?q?=E7=AB=9E=E8=B5=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/modules/competition/Registration.js | 2 +- .../competition/comcss/competition.css | 31 ++++ .../competition/competmodal/PersonModal.js | 80 +++++++++-- .../competmodal/PersonalModalteam.js | 13 ++ .../personal/PersonalCompetititem.js | 136 ++++++++++++------ 5 files changed, 205 insertions(+), 57 deletions(-) diff --git a/public/react/src/modules/competition/Registration.js b/public/react/src/modules/competition/Registration.js index d599fdf3d..f0fc873c8 100644 --- a/public/react/src/modules/competition/Registration.js +++ b/public/react/src/modules/competition/Registration.js @@ -508,7 +508,7 @@ class Registration extends React.Component { }) if (bool) { //确认 - + this.Refreshteam(); } else { //取消 diff --git a/public/react/src/modules/competition/comcss/competition.css b/public/react/src/modules/competition/comcss/competition.css index 0f34dbf0d..075934e4b 100644 --- a/public/react/src/modules/competition/comcss/competition.css +++ b/public/react/src/modules/competition/comcss/competition.css @@ -410,6 +410,15 @@ } +.regitemimgs222 { + margin-top: 12px; + width: 28px; + height: 28px; + margin-left: 20px; + border-radius: 50%; + +} + .regitemimgs3 { /* border: 0.5px solid; */ height: 22px; @@ -426,6 +435,11 @@ margin-top: 18px; } +.regitemimgs444 { + display: flex; + flex-direction: row-reverse; + margin-top: 18px; +} .regitemimgs5 { margin-left: 10px; text-align: center; @@ -442,6 +456,23 @@ cursor: pointer } +.regitemimgs555 { + margin-left: 33px; + text-align: center; + background: #ffffff; + height: 40px; + width: 72px; + color: #459be5; + border-radius: 4px; + display: flex; + align-items: center; + justify-content: center; + border: 1px; + border-style: solid; + border-color: #459BE5; + cursor: pointer +} + .regitemimgs6 { text-align: center; background: #ffffff; diff --git a/public/react/src/modules/competition/competmodal/PersonModal.js b/public/react/src/modules/competition/competmodal/PersonModal.js index a27ba9b00..bbaa0332f 100644 --- a/public/react/src/modules/competition/competmodal/PersonModal.js +++ b/public/react/src/modules/competition/competmodal/PersonModal.js @@ -10,6 +10,8 @@ import NoneData from '../../../modules/courses/coursesPublic/NoneData' const {Search} = Input; //创建战队 +var myabool = true; +var myabool2 = true; class PersonModal extends Component { //导师是搜索 和学生搜索都会添加到下面框中 /** @@ -146,6 +148,16 @@ class PersonModal extends Component { }; //创建战队 Createateam = () => { + debugger + try { + if (this.state.polls_nametest.length === 0) { + this.props.showNotification(`请输入您的战队名称,最多不超过60个字符`); + return + } + } catch (e) { + + } + const {polls_nametest, mydatas, GetenrollmentAPI} = this.state; @@ -177,6 +189,25 @@ class PersonModal extends Component { } } + try { + if (i === 0) { + this.props.showNotification(`请添加导师`); + return; + } + } catch (e) { + + } + + try { + if (s === 0) { + this.props.showNotification(`请添加队员`); + return; + } + } catch (e) { + + } + + //确认的时候 去确认老师人数是否符合 try { if (GetenrollmentAPI) { @@ -424,7 +455,18 @@ class PersonModal extends Component { //点击获取老师数据 getdatacpersondiv1Items = (object) => { + try { + if (this.props.teamutiple_limited === true) { + if (object.enrollable === false) { + myabool = false; + return + } + } + } catch (e) { + myabool = true; + } + myabool = true; var datas = { enrollable: object.enrollable, id: object.id, @@ -470,15 +512,15 @@ class PersonModal extends Component { try { if (this.props.GetenrollmentAPI.teacher_staff.mutiple_limited === true) { if (object.enrollable === false) { - + myabool2 = false; return } } } catch (e) { - + myabool2 = true; } - + myabool2 = true; var datas = { enrollable: object.enrollable, id: object.id, @@ -589,20 +631,26 @@ class PersonModal extends Component { } inputOnBlur = (e) => { - // ////console.log("inputOnBlur"); - // ////console.log(e); - this.setState({ - person1: false, - person2: false - }) + console.log("inputOnBlur"); + console.log(e); + if (myabool === true) { + this.setState({ + person1: false, + person2: false + }) + } + } inputOnBlur2 = (e) => { // ////console.log("inputOnBlur"); // ////console.log(e); - this.setState({ - person1: false, - person2: false - }) + if (myabool2 === true) { + this.setState({ + person1: false, + person2: false + }) + } + } startSearch = (e) => { @@ -876,6 +924,8 @@ class PersonModal extends Component {

); var cpersondiv1Items = []; + // console.log("this.props.teamutiple_limited "); + // console.log(this.props.teamutiple_limited ); if (teacher_ids) { cpersondiv1Items = teacher_ids.map((item, index) => this.getdatacpersondiv1Items(item)} + onMouseDown={() => this.getdatacpersondiv1Items(item)} > + {item.name === undefined || item.name === null || item.name === "" ? "--" : item.name}

+ >{item.name === undefined || item.name === null || item.name === "" ? "--" : item.name}
{ index === 0 ?

创建者

: -

{item.type === undefined || item.type === null || item.type === "" ? "--" : item.type}

+ >{item.type === undefined || item.type === null || item.type === "" ? "--" : item.type} } -

{item.school_name === undefined || item.school_name === null || item.school_name === "" ? "--" : item.school_name}

-

{item.school_name === undefined || item.school_name === null || item.school_name === "" ? "--" : item.school_name} + {item.identity === undefined || item.identity === null || item.identity === "" ? "--" : item.identity}

+ >{item.identity === undefined || item.identity === null || item.identity === "" ? "--" : item.identity} { index === 0 ? -

: -

- +

  • - +
  • +
    ); } const cpersondiv1 = (
    -
    + ); } const persondiv2 = (
    {/*this.state.loading2*/} -
    +
    { persondiv2Items.length === 0 ? @@ -1205,16 +1219,16 @@ class PersonModal extends Component { width="620px" > - + {/**/}
    {/*队名*/}