From d33eca5486fb518e2ddd06336dde6934862d6224 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Sun, 28 Jul 2019 10:12:04 +0800 Subject: [PATCH 01/47] =?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/courses/ListPageIndex.js | 2 +- public/react/src/modules/user/LoginRegisterComponent.js | 3 +++ public/react/src/modules/user/Notcompletedysl.js | 3 +++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/public/react/src/modules/courses/ListPageIndex.js b/public/react/src/modules/courses/ListPageIndex.js index 95342bb13..9f12f6434 100644 --- a/public/react/src/modules/courses/ListPageIndex.js +++ b/public/react/src/modules/courses/ListPageIndex.js @@ -103,7 +103,7 @@ class ListPageIndex extends Component{
{/*头部banner*/} - + {/*{yslGuideone===null||yslGuideone===undefined||yslGuideone===false?*/} {/* (*/} {/* this.props.isAdmin()===true?*/} diff --git a/public/react/src/modules/user/LoginRegisterComponent.js b/public/react/src/modules/user/LoginRegisterComponent.js index eb0a3a5c2..ebb099b2e 100644 --- a/public/react/src/modules/user/LoginRegisterComponent.js +++ b/public/react/src/modules/user/LoginRegisterComponent.js @@ -359,6 +359,9 @@ class LoginRegisterComponent extends Component { if(weekArray===undefined){ weekArray="/"; } + if(weekArray===null){ + weekArray="/"; + } window.location.href = weekArray; } } diff --git a/public/react/src/modules/user/Notcompletedysl.js b/public/react/src/modules/user/Notcompletedysl.js index 8f147957a..5f180af48 100644 --- a/public/react/src/modules/user/Notcompletedysl.js +++ b/public/react/src/modules/user/Notcompletedysl.js @@ -37,6 +37,9 @@ class Notcompletedysl extends Component { if(weekArray===undefined){ weekArray="/"; } + if(weekArray===null){ + weekArray="/"; + } window.location.href = weekArray; } From 4db7e1e058b4da33234d51405b7dd0f745c02c6c Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Mon, 29 Jul 2019 09:08:29 +0800 Subject: [PATCH 02/47] =?UTF-8?q?=E8=AF=95=E5=8D=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/react/src/common/TextUtil.js | 7 ++++++- .../common/components/markdown/MarkdownToHtml.css | 6 ++++++ .../common/components/markdown/MarkdownToHtml.js | 13 ++++++++----- 3 files changed, 20 insertions(+), 6 deletions(-) create mode 100644 public/react/src/common/components/markdown/MarkdownToHtml.css diff --git a/public/react/src/common/TextUtil.js b/public/react/src/common/TextUtil.js index 82a848cac..8aef0adbd 100644 --- a/public/react/src/common/TextUtil.js +++ b/public/react/src/common/TextUtil.js @@ -10,7 +10,8 @@ export function markdownToHTML(oldContent, selector) { window.$(selector).html(oldContent) } else { try { - var markdwonParser = window.editormd.markdownToHTML("md_div", { + // selector || + var markdwonParser = window.editormd.markdownToHTML(selector || "md_div", { markdown: oldContent, // .replace(/▁/g,"▁▁▁"), emoji: true, htmlDecode: "style,script,iframe", // you can filter tags decode @@ -23,6 +24,10 @@ export function markdownToHTML(oldContent, selector) { } catch(e) { console.error(e) } + // selector = '.' + selector + if (selector) { + return; + } const content = window.$('#md_div').html() if (selector) { diff --git a/public/react/src/common/components/markdown/MarkdownToHtml.css b/public/react/src/common/components/markdown/MarkdownToHtml.css new file mode 100644 index 000000000..affba12cd --- /dev/null +++ b/public/react/src/common/components/markdown/MarkdownToHtml.css @@ -0,0 +1,6 @@ +.markdownToHtml.editormd-html-preview, .markdownToHtml.editormd-preview-container { + overflow: hidden; +} +.markdownToHtml.editormd-html-preview p.editormd-tex, .markdownToHtml.editormd-preview-container p.editormd-tex { + text-align: left; +} \ No newline at end of file diff --git a/public/react/src/common/components/markdown/MarkdownToHtml.js b/public/react/src/common/components/markdown/MarkdownToHtml.js index 0780fc789..c7d15cf64 100644 --- a/public/react/src/common/components/markdown/MarkdownToHtml.js +++ b/public/react/src/common/components/markdown/MarkdownToHtml.js @@ -1,5 +1,6 @@ import React,{ Component } from "react"; import { markdownToHTML } from 'educoder' +import './MarkdownToHtml.css' /** selector 需要传入唯一的selector作为id,不然会引起冲突 delay 如果有公式,需要传入delay={true} @@ -14,9 +15,9 @@ class MarkdownToHtml extends Component{ if (this.props.delay == true) { (function(content, selector) { // console.log('selector: ', selector) - setTimeout(() => { + // setTimeout(() => { markdownToHTML(content, selector) - }, 600) + // }, 600) })(content, selector) } else { markdownToHTML(content, selector) @@ -25,18 +26,20 @@ class MarkdownToHtml extends Component{ componentDidUpdate = (prevProps) => { if (this.props.content) { if ( prevProps.content != this.props.content ) { - this._markdownToHTML(this.props.content, `.markdown_to_html_${this.props.selector || ''}`) + this._markdownToHTML(this.props.content, `markdown_to_html_${this.props.selector || ''}`) } } } componentDidMount () { - this.props.content && this._markdownToHTML(this.props.content, `.markdown_to_html_${this.props.selector || ''}`) + this.props.content && this._markdownToHTML(this.props.content, `markdown_to_html_${this.props.selector || ''}`) } render(){ const { style, className } = this.props + let _selector = `markdown_to_html_${this.props.selector || ''}` + return( -
From 7b610c9c95c5e0d7e3e3d2e1b53fa5b1761a9fc3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Mon, 29 Jul 2019 09:15:16 +0800 Subject: [PATCH 03/47] =?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/login/LoginDialog.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/react/src/modules/login/LoginDialog.js b/public/react/src/modules/login/LoginDialog.js index 50038366d..2db1929b9 100644 --- a/public/react/src/modules/login/LoginDialog.js +++ b/public/react/src/modules/login/LoginDialog.js @@ -360,7 +360,7 @@ class LoginDialog extends Component { if(response.status===200){ if (response.data.status === 402) { - window.location.href = response.data.url; + // window.location.href = response.data.url; }else if (response.data.status === -2) { notification.open({ message: '提示', From bfe5e24935a20fe42a37410f509ee5289ef5037f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Mon, 29 Jul 2019 09:18:05 +0800 Subject: [PATCH 04/47] =?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/user/LoginRegisterComponent.js | 3 +++ public/react/src/modules/user/Notcompletedysl.js | 3 +++ 2 files changed, 6 insertions(+) diff --git a/public/react/src/modules/user/LoginRegisterComponent.js b/public/react/src/modules/user/LoginRegisterComponent.js index ebb099b2e..ff03b11ea 100644 --- a/public/react/src/modules/user/LoginRegisterComponent.js +++ b/public/react/src/modules/user/LoginRegisterComponent.js @@ -362,6 +362,9 @@ class LoginRegisterComponent extends Component { if(weekArray===null){ weekArray="/"; } + if(weekArray==="null"){ + weekArray="/"; + } window.location.href = weekArray; } } diff --git a/public/react/src/modules/user/Notcompletedysl.js b/public/react/src/modules/user/Notcompletedysl.js index 5f180af48..e50d162a6 100644 --- a/public/react/src/modules/user/Notcompletedysl.js +++ b/public/react/src/modules/user/Notcompletedysl.js @@ -40,6 +40,9 @@ class Notcompletedysl extends Component { if(weekArray===null){ weekArray="/"; } + if(weekArray==="null"){ + weekArray="/"; + } window.location.href = weekArray; } From 0f491426c503bdd6908271dca86bc834ccd80076 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Mon, 29 Jul 2019 09:26:31 +0800 Subject: [PATCH 05/47] =?UTF-8?q?=E5=B7=A5=E7=A8=8B=E8=AE=A4=E8=AF=81?= =?UTF-8?q?=E5=AF=BC=E8=88=AA=E6=A0=8F=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/users_controller.rb | 3 +-- app/models/user.rb | 7 +++++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 23f6870c8..a1f6a5495 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -73,8 +73,7 @@ class UsersController < ApplicationController @user_url = "/users/#{@user.login}" @career = Career.where(status: true).order("created_at asc").pluck(:id, :name) - ec_user = EcSchoolUser.where(:user_id => current_user.id).first - @auth = ec_user ? "#{@old_domain}/ecs/department?school_id=#{ec_user.school_id}" : nil + @auth = User.current.ec_school.present? ? "#{@old_domain}/ecs/department?school_id=#{User.current.ec_school}" : nil end # 用户回复功能 diff --git a/app/models/user.rb b/app/models/user.rb index f2d9c7fb1..a95776be9 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -497,6 +497,13 @@ class User < ApplicationRecord ) end + # 工程认证的学校 + def ec_school + school_id = self.ec_school_users.pluck(:school_id).first || + self.ec_major_schools.pluck(:school_id).first || + (self.ec_course_users.first && self.ec_course_users.first.try(:ec_course).try(:ec_year).try(:ec_major_school).try(:school_id)) + end + # 登录,返回用户名与密码匹配的用户 def self.try_to_login(login, password) login = login.to_s.strip From 199c603ac93553454da7269b77a2c3d5f901905b Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Mon, 29 Jul 2019 09:38:49 +0800 Subject: [PATCH 06/47] md --- .../components/markdown/MarkdownToHtml.js | 14 ++------------ .../courses/exercise/ExerciseReviewAndAnswer.js | 16 +++++++++++++--- .../exercise/Exercisestatisticalresult.js | 8 +++++--- .../courses/exercise/new/JudgeDisplay.js | 7 +++++-- .../modules/courses/exercise/new/MainDisplay.js | 4 ++-- .../modules/courses/exercise/new/NullDisplay.js | 2 +- .../exercise/new/QestionDisplayHeader.js | 4 ++-- .../courses/exercise/new/SingleDisplay.js | 8 ++++---- .../courses/exercise/question/fillEmpty.js | 7 +++++-- .../courses/exercise/question/multiple.js | 7 +++++-- .../courses/exercise/question/simpleAnswer.js | 17 +++++++++++++---- .../modules/courses/exercise/question/single.js | 7 +++++-- 12 files changed, 62 insertions(+), 39 deletions(-) diff --git a/public/react/src/common/components/markdown/MarkdownToHtml.js b/public/react/src/common/components/markdown/MarkdownToHtml.js index c7d15cf64..63733165e 100644 --- a/public/react/src/common/components/markdown/MarkdownToHtml.js +++ b/public/react/src/common/components/markdown/MarkdownToHtml.js @@ -3,7 +3,6 @@ import { markdownToHTML } from 'educoder' import './MarkdownToHtml.css' /** selector 需要传入唯一的selector作为id,不然会引起冲突 - delay 如果有公式,需要传入delay={true} */ class MarkdownToHtml extends Component{ constructor(props){ @@ -11,17 +10,8 @@ class MarkdownToHtml extends Component{ this.state={ } } - _markdownToHTML = (content, selector) => { - if (this.props.delay == true) { - (function(content, selector) { - // console.log('selector: ', selector) - // setTimeout(() => { - markdownToHTML(content, selector) - // }, 600) - })(content, selector) - } else { - markdownToHTML(content, selector) - } + _markdownToHTML = (content, selector) => { + markdownToHTML(content, selector) } componentDidUpdate = (prevProps) => { if (this.props.content) { diff --git a/public/react/src/modules/courses/exercise/ExerciseReviewAndAnswer.js b/public/react/src/modules/courses/exercise/ExerciseReviewAndAnswer.js index cd3355082..778829d72 100644 --- a/public/react/src/modules/courses/exercise/ExerciseReviewAndAnswer.js +++ b/public/react/src/modules/courses/exercise/ExerciseReviewAndAnswer.js @@ -7,7 +7,7 @@ import '../poll/pollStyle.css' import '../css/Courses.css' import moment from 'moment' -import { WordsBtn,markdownToHTML,ActionBtn,getImageUrl } from 'educoder' +import { WordsBtn,markdownToHTML,ActionBtn,getImageUrl, MarkdownToHtml } from 'educoder' import Modals from '../../modals/Modals' import CoursesListType from '../coursesPublic/CoursesListType'; @@ -537,7 +537,7 @@ class ExerciseReviewAndAnswer extends Component{ />

- {courseName} + {courseName} > {data && data.left_banner_name} > @@ -712,7 +712,10 @@ class ExerciseReviewAndAnswer extends Component{

  • -

    + {/*

    */} +
  • { // 选择题和判断题共用 @@ -724,6 +727,7 @@ class ExerciseReviewAndAnswer extends Component{ questionType={item} user_exercise_status={user_exercise_status} changeQuestionStatus={(No,flag)=>this.changeQuestionStatus(No,flag)} + index={key} > } { @@ -736,6 +740,8 @@ class ExerciseReviewAndAnswer extends Component{ questionType={item} user_exercise_status={user_exercise_status} changeQuestionStatus={(No,flag)=>this.changeQuestionStatus(No,flag)} + index={key} + > } { @@ -748,6 +754,8 @@ class ExerciseReviewAndAnswer extends Component{ questionType={item} user_exercise_status={user_exercise_status} changeQuestionStatus={(No,flag)=>this.changeQuestionStatus(No,flag)} + index={key} + > } { @@ -774,6 +782,8 @@ class ExerciseReviewAndAnswer extends Component{ questionType={item} user_exercise_status={user_exercise_status} id={this.state.Id} + index={key} + > } diff --git a/public/react/src/modules/courses/exercise/Exercisestatisticalresult.js b/public/react/src/modules/courses/exercise/Exercisestatisticalresult.js index 6e7b52715..1771d87b3 100644 --- a/public/react/src/modules/courses/exercise/Exercisestatisticalresult.js +++ b/public/react/src/modules/courses/exercise/Exercisestatisticalresult.js @@ -1,5 +1,5 @@ import React, {Component} from "react"; -import {WordsBtn,markdownToHTML} from 'educoder'; +import {WordsBtn,markdownToHTML, MarkdownToHtml} from 'educoder'; import { Form, Select, Input, Button,Checkbox,Upload,Icon,message,Modal, Table, Divider,InputNumber, Tag,DatePicker,Radio,Tooltip,Pagination} from "antd"; import {Link,Switch,Route,Redirect} from 'react-router-dom'; import axios from 'axios'; @@ -194,8 +194,10 @@ class Exercisestatisticalresult extends Component { {item.ques_position+"."}{item.ques_type===0?"单选":item.ques_type===1?"多选":item.ques_type===2?"判断":item.ques_type===3?"填空":item.ques_type===4?"主观":item.ques_type===5?"实训":""}题
    {/*Q{item.ques_position}:*/} -
    - + {/*
    */} + {/**/}
    diff --git a/public/react/src/modules/courses/exercise/new/JudgeDisplay.js b/public/react/src/modules/courses/exercise/new/JudgeDisplay.js index 7beaa50e5..0f8930a8a 100644 --- a/public/react/src/modules/courses/exercise/new/JudgeDisplay.js +++ b/public/react/src/modules/courses/exercise/new/JudgeDisplay.js @@ -87,9 +87,12 @@ class JudgeDisplay extends Component{ return (
    - {item.choice_text} + {/* {item.choice_text} */} + {/* */} + dangerouslySetInnerHTML={{__html: markdownToHTML1(item.choice_text)}}> */}
    ) })} diff --git a/public/react/src/modules/courses/exercise/new/MainDisplay.js b/public/react/src/modules/courses/exercise/new/MainDisplay.js index 0581865d7..44a795374 100644 --- a/public/react/src/modules/courses/exercise/new/MainDisplay.js +++ b/public/react/src/modules/courses/exercise/new/MainDisplay.js @@ -70,10 +70,10 @@ class MainDisplay extends Component{
    参考答案:
    {/*
    */} diff --git a/public/react/src/modules/courses/exercise/new/NullDisplay.js b/public/react/src/modules/courses/exercise/new/NullDisplay.js index eade97474..079b1194f 100644 --- a/public/react/src/modules/courses/exercise/new/NullDisplay.js +++ b/public/react/src/modules/courses/exercise/new/NullDisplay.js @@ -109,7 +109,7 @@ class NullDisplay extends Component{
    { answers.answer_text.map((item, itemIndex) => { return })} diff --git a/public/react/src/modules/courses/exercise/new/QestionDisplayHeader.js b/public/react/src/modules/courses/exercise/new/QestionDisplayHeader.js index 7b82b14b6..c90d87dac 100644 --- a/public/react/src/modules/courses/exercise/new/QestionDisplayHeader.js +++ b/public/react/src/modules/courses/exercise/new/QestionDisplayHeader.js @@ -82,9 +82,9 @@ class QestionDisplayHeader extends Component{
    { question_title && - //
    } diff --git a/public/react/src/modules/courses/exercise/new/SingleDisplay.js b/public/react/src/modules/courses/exercise/new/SingleDisplay.js index cbb6da827..bce4dc4c1 100644 --- a/public/react/src/modules/courses/exercise/new/SingleDisplay.js +++ b/public/react/src/modules/courses/exercise/new/SingleDisplay.js @@ -101,10 +101,10 @@ class SingleDisplay extends Component{
    {prefix} {/* */} + dangerouslySetInnerHTML={{__html: markdownToHTML1(item.choice_text)}}> */}
    ) } else { @@ -112,10 +112,10 @@ class SingleDisplay extends Component{
    {prefix} {/* */} + dangerouslySetInnerHTML={{__html: markdownToHTML1(item.choice_text)}}> */}
    ) } })} diff --git a/public/react/src/modules/courses/exercise/question/fillEmpty.js b/public/react/src/modules/courses/exercise/question/fillEmpty.js index 79bc164d8..5179432a2 100644 --- a/public/react/src/modules/courses/exercise/question/fillEmpty.js +++ b/public/react/src/modules/courses/exercise/question/fillEmpty.js @@ -1,6 +1,6 @@ import React,{ Component } from "react"; import {Checkbox,Radio, Input} from "antd"; -import {DMDEditor,markdownToHTML } from 'educoder' +import {DMDEditor,markdownToHTML, MarkdownToHtml } from 'educoder' import axios from 'axios' @@ -140,7 +140,10 @@ class fillEmpty extends Component{ { item.answer_text && item.answer_text.map((i,index)=>{ return( -
    + + //
    ) }) } diff --git a/public/react/src/modules/courses/exercise/question/multiple.js b/public/react/src/modules/courses/exercise/question/multiple.js index 3ef3d960f..7e96f8550 100644 --- a/public/react/src/modules/courses/exercise/question/multiple.js +++ b/public/react/src/modules/courses/exercise/question/multiple.js @@ -1,6 +1,6 @@ import React,{ Component } from "react"; import {Checkbox,Radio, Input} from "antd"; -import {markdownToHTML} from 'educoder' +import {markdownToHTML, MarkdownToHtml} from 'educoder' import axios from 'axios' const tagArray = [ @@ -51,7 +51,10 @@ class Multiple extends Component{

    {prefix} {/* */} - + {/* */} +

    ) }) diff --git a/public/react/src/modules/courses/exercise/question/simpleAnswer.js b/public/react/src/modules/courses/exercise/question/simpleAnswer.js index 240f775c2..527044968 100644 --- a/public/react/src/modules/courses/exercise/question/simpleAnswer.js +++ b/public/react/src/modules/courses/exercise/question/simpleAnswer.js @@ -1,6 +1,6 @@ import React,{ Component } from "react"; import {Checkbox,Radio, Input} from "antd"; -import {markdownToHTML} from 'educoder' +import {markdownToHTML, MarkdownToHtml} from 'educoder' import TPMMDEditor from '../../../../modules/tpm/challengesnew/TPMMDEditor' import axios from 'axios' @@ -54,7 +54,10 @@ class simpleAnswer extends Component{
  • { user_exercise_status == 1 ? -
    0 ? questionType.user_answer[0]:"")}}>
    + //
    0 ? questionType.user_answer[0]:"")}}>
    + 0 ? questionType.user_answer[0]:""} selector={'simgle_' + (this.props.index + 1)} + className="answerStyle" + > :
    0 ? questionType.user_answer[0]:''} mdID={'simpleEditor'+questionType.question_id} placeholder="请输入你的答案" @@ -70,7 +73,10 @@ class simpleAnswer extends Component{ exercise.answer_status == 1 || questionType.a_flag ?

    参考答案:

    -
  • + {/*
  • */} +

    this.showAndHide(false)}>隐藏参考答案

    : @@ -82,7 +88,10 @@ class simpleAnswer extends Component{ isStudent && exercise.answer_open==true && exercise.exercise_status == 3 ?

    参考答案:

    -
  • + {/*
  • */} +
    :"" }
    diff --git a/public/react/src/modules/courses/exercise/question/single.js b/public/react/src/modules/courses/exercise/question/single.js index 4ff4bf12b..510c28b48 100644 --- a/public/react/src/modules/courses/exercise/question/single.js +++ b/public/react/src/modules/courses/exercise/question/single.js @@ -1,7 +1,7 @@ import React,{ Component } from "react"; import {Checkbox,Radio, Input} from "antd"; -import {markdownToHTML} from 'educoder' +import {markdownToHTML, MarkdownToHtml} from 'educoder' import axios from 'axios' const tagArray = [ 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', @@ -46,7 +46,10 @@ class single extends Component{

    {prefix} {/* */} - + {/* */} +

    ) }) From 71091bfe5384c8b92bad30df4177b1bedc4ec3da Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Mon, 29 Jul 2019 14:51:26 +0800 Subject: [PATCH 07/47] / --- public/react/src/modules/user/usersInfo/InfosProject.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/react/src/modules/user/usersInfo/InfosProject.js b/public/react/src/modules/user/usersInfo/InfosProject.js index 6c1f4a666..c3f023171 100644 --- a/public/react/src/modules/user/usersInfo/InfosProject.js +++ b/public/react/src/modules/user/usersInfo/InfosProject.js @@ -142,7 +142,7 @@ class InfosProject extends Component{ { item.can_visited ==false?
    - +

    非成员不能访问

    :"" } From fa5f65787a152b0517b5df9a56876203e26717be Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Mon, 29 Jul 2019 14:57:48 +0800 Subject: [PATCH 08/47] / --- public/react/src/modules/user/usersInfo/InfosCourse.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/react/src/modules/user/usersInfo/InfosCourse.js b/public/react/src/modules/user/usersInfo/InfosCourse.js index ff5321a9f..c4cefd2b6 100644 --- a/public/react/src/modules/user/usersInfo/InfosCourse.js +++ b/public/react/src/modules/user/usersInfo/InfosCourse.js @@ -147,7 +147,7 @@ class InfosCourse extends Component{ { item.can_visited ==false?
    - +

    非成员不能访问

    :"" } From 802de5004677d9e5d4e9199c6c9196cbe11f24f5 Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Mon, 29 Jul 2019 14:58:43 +0800 Subject: [PATCH 09/47] w --- .../react/src/modules/courses/members/studentsList.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/public/react/src/modules/courses/members/studentsList.js b/public/react/src/modules/courses/members/studentsList.js index 363d06c54..6780948ef 100644 --- a/public/react/src/modules/courses/members/studentsList.js +++ b/public/react/src/modules/courses/members/studentsList.js @@ -36,8 +36,10 @@ const buildColumns = (that) => { key: 'login', align:'center', className:"color-grey-6", - render: (name, record) => { - return {name} + render: (login, record) => { + return 10 ? login : ''} + >{login} } }, { title: '姓名', @@ -57,8 +59,8 @@ const buildColumns = (that) => { align:'center', className:"color-grey-6", render: (student_id, record) => { - return {student_id} + return 10 ? student_id : ''} + style={{maxWidth: '160px'}} >{student_id} } }]; if (course_groups && course_groups.length) { From 308c3cc50dd9ab1a8e64eed4df4de5ae52635ea5 Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Mon, 29 Jul 2019 15:13:23 +0800 Subject: [PATCH 10/47] none data --- public/react/src/modules/user/usersInfo/InfosCourse.js | 2 +- public/react/src/modules/user/usersInfo/InfosPath.js | 2 +- public/react/src/modules/user/usersInfo/InfosProject.js | 2 +- public/react/src/modules/user/usersInfo/InfosShixun.js | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/public/react/src/modules/user/usersInfo/InfosCourse.js b/public/react/src/modules/user/usersInfo/InfosCourse.js index c4cefd2b6..2f7d206b8 100644 --- a/public/react/src/modules/user/usersInfo/InfosCourse.js +++ b/public/react/src/modules/user/usersInfo/InfosCourse.js @@ -130,7 +130,7 @@ class InfosCourse extends Component{ this.props.current_user && this.props.current_user.user_identity != "学生" ? : "" } { - (!data || data.courses.length==0) && (this.props.current_user && this.props.current_user.user_identity === "学生" ) && + (!data || data.courses.length==0) && (!is_current || (this.props.current_user && this.props.current_user.user_identity === "学生" )) && } { data && data.courses && data.courses.map((item,key)=>{ diff --git a/public/react/src/modules/user/usersInfo/InfosPath.js b/public/react/src/modules/user/usersInfo/InfosPath.js index 759527a6e..d23739280 100644 --- a/public/react/src/modules/user/usersInfo/InfosPath.js +++ b/public/react/src/modules/user/usersInfo/InfosPath.js @@ -152,7 +152,7 @@ class InfosPath extends Component{ this.props.current_user && this.props.current_user.user_identity != "学生" ? :"" } { - (!data || data.subjects.length==0) && (this.props.current_user && this.props.current_user.user_identity === "学生" ) && + (!data || data.subjects.length==0) && (!is_current || (this.props.current_user && this.props.current_user.user_identity === "学生" )) && } { data && data.subjects && data.subjects.map((item,key)=>{ diff --git a/public/react/src/modules/user/usersInfo/InfosProject.js b/public/react/src/modules/user/usersInfo/InfosProject.js index c3f023171..195e98b73 100644 --- a/public/react/src/modules/user/usersInfo/InfosProject.js +++ b/public/react/src/modules/user/usersInfo/InfosProject.js @@ -125,7 +125,7 @@ class InfosProject extends Component{ :"" } { - (!data || data.projects.length==0) && (this.props.current_user && this.props.current_user.user_identity === "学生" ) && + (!data || data.projects.length==0) && (!is_current || (this.props.current_user && this.props.current_user.user_identity === "学生" )) && } { data && data.projects && data.projects.map((item,key)=>{ diff --git a/public/react/src/modules/user/usersInfo/InfosShixun.js b/public/react/src/modules/user/usersInfo/InfosShixun.js index bac60fe6f..1550230ab 100644 --- a/public/react/src/modules/user/usersInfo/InfosShixun.js +++ b/public/react/src/modules/user/usersInfo/InfosShixun.js @@ -161,7 +161,7 @@ class InfosShixun extends Component{ :"" } { - (!data || data.shixuns.length==0) && (this.props.current_user && this.props.current_user.user_identity === "学生" ) && + (!data || data.shixuns.length==0) && (!is_current || (this.props.current_user && this.props.current_user.user_identity === "学生" )) && } { data && data.shixuns && data.shixuns.map((item,key)=>{ From c3b2e8eefdfb9e2c7074689e5bff3d219f651d5c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Mon, 29 Jul 2019 15:19:43 +0800 Subject: [PATCH 11/47] =?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/busyWork/CommonWorkDetailIndex.js | 8 +++++--- .../react/src/modules/courses/busyWork/CommonWorkList.js | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/public/react/src/modules/courses/busyWork/CommonWorkDetailIndex.js b/public/react/src/modules/courses/busyWork/CommonWorkDetailIndex.js index ff8e3e3a2..a300e73dc 100644 --- a/public/react/src/modules/courses/busyWork/CommonWorkDetailIndex.js +++ b/public/react/src/modules/courses/busyWork/CommonWorkDetailIndex.js @@ -136,7 +136,7 @@ class CommonWorkDetailIndex extends Component{ DownloadMessageval:undefined }) } - + bindRef = ref => { this.child = ref }; render() { @@ -171,8 +171,10 @@ class CommonWorkDetailIndex extends Component{ let params = {} if (isListModule) { // TODO - // params = this.refs.commonWorkList._getRequestParams() + params =this.child._getRequestParams()!==undefined?this.child._getRequestParams():{}; } + // console.log("普通作业176176176"); + // console.log(params); let exportUrl = `/homework_commons/${workId}/works_list.zip?${queryString.stringify(params)}` let exportResultUrl = `/homework_commons/${workId}/works_list.xlsx?${queryString.stringify(params)}` return ( @@ -356,7 +358,7 @@ class CommonWorkDetailIndex extends Component{ {/* 作品列表 */} () + (props) => () } > diff --git a/public/react/src/modules/courses/busyWork/CommonWorkList.js b/public/react/src/modules/courses/busyWork/CommonWorkList.js index 5938d037a..e72758316 100644 --- a/public/react/src/modules/courses/busyWork/CommonWorkList.js +++ b/public/react/src/modules/courses/busyWork/CommonWorkList.js @@ -401,7 +401,7 @@ class CommonWorkList extends Component{ this.fetchList() on('commonwork_fetch_all', this.fetchAllListener) $("html").animate({ scrollTop: $('html').scrollTop() - 100 }) - + this.props.triggerRef(this); } componentWillUnmount() { off('commonwork_fetch_all', this.fetchAllListener) From 21f7995adde8aa236a4792afc8965a65625d630d Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Mon, 29 Jul 2019 15:20:03 +0800 Subject: [PATCH 12/47] */ --- public/react/src/modules/user/account/ChangeHeaderPicModal.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/react/src/modules/user/account/ChangeHeaderPicModal.js b/public/react/src/modules/user/account/ChangeHeaderPicModal.js index cef643094..76a1a2ebe 100644 --- a/public/react/src/modules/user/account/ChangeHeaderPicModal.js +++ b/public/react/src/modules/user/account/ChangeHeaderPicModal.js @@ -151,7 +151,7 @@ class ChangeHeaderPicModal extends Component{ text-align: center; width: 120px; height: 120px; - border: 1px solid #eee; + /* border: 1px solid #eee; */ } .previewWrap { flex-direction: column; From 042d096746c12b13d0696c293878b519a39523fe Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Mon, 29 Jul 2019 15:23:12 +0800 Subject: [PATCH 13/47] txt --- .../courses/exercise/Studentshavecompletedthelist.js | 6 +++--- .../graduation/tasks/GraduationTasksappraiseReply.js | 2 +- .../courses/graduation/tasks/GraduationTaskssettinglist.js | 4 ++-- .../modules/courses/shixunHomework/Listofworksstudentone.js | 6 +++--- .../shixunHomework/Shixunworkdetails/ShixunWorkModal.js | 2 +- public/react/src/modules/forums/MemoList.js | 2 +- public/react/src/search/SearchPage.js | 2 +- 7 files changed, 12 insertions(+), 12 deletions(-) diff --git a/public/react/src/modules/courses/exercise/Studentshavecompletedthelist.js b/public/react/src/modules/courses/exercise/Studentshavecompletedthelist.js index 6f4cec877..fffadccf6 100644 --- a/public/react/src/modules/courses/exercise/Studentshavecompletedthelist.js +++ b/public/react/src/modules/courses/exercise/Studentshavecompletedthelist.js @@ -2565,7 +2565,7 @@ class Studentshavecompletedthelist extends Component {
    -

    没有数据可以显示!

    +

    暂时还没有相关数据哦!

    @@ -2630,7 +2630,7 @@ class Studentshavecompletedthelist extends Component {
    -

    没有数据可以显示!

    +

    暂时还没有相关数据哦!

    @@ -2692,7 +2692,7 @@ class Studentshavecompletedthelist extends Component {
    -

    没有数据可以显示!

    +

    暂时还没有相关数据哦!

    diff --git a/public/react/src/modules/courses/graduation/tasks/GraduationTasksappraiseReply.js b/public/react/src/modules/courses/graduation/tasks/GraduationTasksappraiseReply.js index 1e0fb3071..6c7085ca2 100644 --- a/public/react/src/modules/courses/graduation/tasks/GraduationTasksappraiseReply.js +++ b/public/react/src/modules/courses/graduation/tasks/GraduationTasksappraiseReply.js @@ -190,7 +190,7 @@ export default ImageLayerOfCommentHOC() (GraduationTasksappraiseReply); {/*className="edu-tab-con-box clearfix edu-txt-center">*/} {/**/} - {/*

    没有数据可以显示!

    */} + {/*

    暂时还没有相关数据哦!

    */} {/**/} {/**/} {/**/} \ No newline at end of file diff --git a/public/react/src/modules/courses/graduation/tasks/GraduationTaskssettinglist.js b/public/react/src/modules/courses/graduation/tasks/GraduationTaskssettinglist.js index d773d8411..7d421da4b 100644 --- a/public/react/src/modules/courses/graduation/tasks/GraduationTaskssettinglist.js +++ b/public/react/src/modules/courses/graduation/tasks/GraduationTaskssettinglist.js @@ -1307,7 +1307,7 @@ class GraduationTaskssettinglist extends Component{
    -

    没有数据可以显示!

    +

    暂时还没有相关数据哦!

    @@ -1573,7 +1573,7 @@ class GraduationTaskssettinglist extends Component{ className="edu-tab-con-box clearfix edu-txt-center"> -

    没有数据可以显示!

    +

    暂时还没有相关数据哦!

    diff --git a/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js b/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js index 8ec2ffcbc..4dc41fcf7 100644 --- a/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js +++ b/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js @@ -2528,7 +2528,7 @@ class Listofworksstudentone extends Component {
    -

    没有数据可以显示!

    +

    暂时还没有相关数据哦!

    @@ -2747,7 +2747,7 @@ class Listofworksstudentone extends Component {
    -

    没有数据可以显示!

    +

    暂时还没有相关数据哦!

    @@ -2945,7 +2945,7 @@ class Listofworksstudentone extends Component {
    -

    没有数据可以显示!

    +

    暂时还没有相关数据哦!

    diff --git a/public/react/src/modules/courses/shixunHomework/Shixunworkdetails/ShixunWorkModal.js b/public/react/src/modules/courses/shixunHomework/Shixunworkdetails/ShixunWorkModal.js index f1d1c43f3..cc9586577 100644 --- a/public/react/src/modules/courses/shixunHomework/Shixunworkdetails/ShixunWorkModal.js +++ b/public/react/src/modules/courses/shixunHomework/Shixunworkdetails/ShixunWorkModal.js @@ -258,7 +258,7 @@ class ShixunWorkModal extends Component{
    -

    没有数据可以显示!

    +

    暂时还没有相关数据哦!

    diff --git a/public/react/src/modules/forums/MemoList.js b/public/react/src/modules/forums/MemoList.js index fae728542..26cad1448 100644 --- a/public/react/src/modules/forums/MemoList.js +++ b/public/react/src/modules/forums/MemoList.js @@ -31,7 +31,7 @@ class MemoList extends Component { {!memo_list || memo_list.length === 0 ?
    -

    没有数据可以显示!

    +

    暂时还没有相关数据哦!

    : renderMemoList() } diff --git a/public/react/src/search/SearchPage.js b/public/react/src/search/SearchPage.js index 32d88b392..ccdb9e12a 100644 --- a/public/react/src/search/SearchPage.js +++ b/public/react/src/search/SearchPage.js @@ -164,7 +164,7 @@ class SearchPage extends Component{
    -

    没有数据可以显示!

    +

    暂时还没有相关数据哦!

    From 32dfe561709d95b4c2f3c20ffa3ce705fc384745 Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Mon, 29 Jul 2019 15:23:21 +0800 Subject: [PATCH 14/47] txt --- public/react/src/modules/courses/busyWork/CommonWorkList.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/react/src/modules/courses/busyWork/CommonWorkList.js b/public/react/src/modules/courses/busyWork/CommonWorkList.js index 5938d037a..9fcf07c01 100644 --- a/public/react/src/modules/courses/busyWork/CommonWorkList.js +++ b/public/react/src/modules/courses/busyWork/CommonWorkList.js @@ -767,7 +767,7 @@ class CommonWorkList extends Component{
    -

    没有数据可以显示!

    +

    暂时还没有相关数据哦!

    From aecd13c5798888e1a56215490e8b641d44322573 Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Mon, 29 Jul 2019 15:25:49 +0800 Subject: [PATCH 15/47] MarkdownToHtml --- public/react/src/modules/courses/exercise/new/JudgeDisplay.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/react/src/modules/courses/exercise/new/JudgeDisplay.js b/public/react/src/modules/courses/exercise/new/JudgeDisplay.js index 0f8930a8a..60fbd5ac2 100644 --- a/public/react/src/modules/courses/exercise/new/JudgeDisplay.js +++ b/public/react/src/modules/courses/exercise/new/JudgeDisplay.js @@ -7,7 +7,7 @@ import { } from 'antd'; import axios from 'axios' import { qNameArray } from './common' -import {getUrl, ActionBtn, markdownToHTML} from 'educoder'; +import {getUrl, ActionBtn, markdownToHTML, MarkdownToHtml } from 'educoder'; import QestionDisplayHeader from './QestionDisplayHeader' const { TextArea } = Input; const confirm = Modal.confirm; From fc40112da87a0cab9e9a86b0c4a51de37362d42d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Mon, 29 Jul 2019 15:57:33 +0800 Subject: [PATCH 16/47] =?UTF-8?q?=E5=AE=8C=E5=96=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/react/public/css/edu-all.css | 17 +++++++++++++++-- public/react/public/index.html | 2 +- public/react/src/modules/home/shixunsHome.js | 2 +- public/react/src/modules/tpm/NewFooter.js | 3 ++- public/react/src/modules/tpm/NewHeader.js | 12 ++++++++---- public/react/src/modules/tpm/TPMIndex.css | 4 ++++ .../react/src/modules/user/Notcompletedysl.js | 2 +- public/stylesheets/educoder/edu-all.css | 17 +++++++++++++++-- 8 files changed, 47 insertions(+), 12 deletions(-) diff --git a/public/react/public/css/edu-all.css b/public/react/public/css/edu-all.css index a9e24da3d..4eeb5497c 100644 --- a/public/react/public/css/edu-all.css +++ b/public/react/public/css/edu-all.css @@ -1,11 +1,24 @@ /*--------------------------首页*/ /*头部导航条样式---2018-03-19--by-cs*/ -.newHeader{background: #24292D !important; width:100%; height: 60px !important; min-width: 1200px;position: fixed;top: 0px;left: 0px;z-index:1000;-moz-box-shadow: 0px 0px 12px rgba(0,0,0,0.1); /* 老的 Firefox */box-shadow: 0px 0px 12px rgba(0,0,0,0.1);} +.newHeader{ + overflow:hidden; + text-overflow:ellipsis; + white-space:nowrap; + background: #24292D !important; width:100%; height: 60px !important; min-width: 1200px;position: fixed;top: 0px;left: 0px;z-index:1000;-moz-box-shadow: 0px 0px 12px rgba(0,0,0,0.1); /* 老的 Firefox */box-shadow: 0px 0px 12px rgba(0,0,0,0.1); +} .newHeader .logoimg{ margin-top: 16px; float: left; width: 97px;} -.head-nav{float: left;width: 830px;text-align: center;height: 60px;box-sizing: border-box; min-width: 400px;} +.head-nav{ + text-align: center; + height: 60px; + box-sizing: border-box; + min-width: 1000px; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; +} .head-nav ul#header-nav{position: absolute;top: 0px;z-index: 3;height: 60px;box-sizing: border-box;} .head-nav ul#header-nav li{float: left;height: 60px;line-height: 60px;margin-right: 30px;cursor: pointer;position: relative;font-size: 16px} .head-nav ul#header-nav li a{display: block;height: 100%;width: 100%;color: #fff} diff --git a/public/react/public/index.html b/public/react/public/index.html index a4a795941..318268610 100755 --- a/public/react/public/index.html +++ b/public/react/public/index.html @@ -87,7 +87,7 @@ -
    +
    diff --git a/public/react/src/modules/home/shixunsHome.js b/public/react/src/modules/home/shixunsHome.js index 003724ede..65284d0f8 100644 --- a/public/react/src/modules/home/shixunsHome.js +++ b/public/react/src/modules/home/shixunsHome.js @@ -123,7 +123,7 @@ class ShixunsHome extends Component { {/*懒加载*/} - + {/**/}
    diff --git a/public/react/src/modules/tpm/NewFooter.js b/public/react/src/modules/tpm/NewFooter.js index 7f8cd502c..a85b35ccf 100644 --- a/public/react/src/modules/tpm/NewFooter.js +++ b/public/react/src/modules/tpm/NewFooter.js @@ -16,7 +16,8 @@ class NewFooter extends Component { render() { return ( -
    +
    + {/*newContainers*/}
    {/*
    diff --git a/public/react/src/modules/tpm/NewHeader.js b/public/react/src/modules/tpm/NewHeader.js index d197bc9c4..6b435b619 100644 --- a/public/react/src/modules/tpm/NewHeader.js +++ b/public/react/src/modules/tpm/NewHeader.js @@ -649,9 +649,11 @@ submittojoinclass=(value)=>{ {...this.state} {...this.props} />:""} - + 高校智能化教学与实训平台 + +
    {/*<%= link_to image_tag("/images/educoder/logo.png", alt:"高校智能化教学与实训平台", className:"logoimg"), home_path %>*/} @@ -770,6 +772,8 @@ submittojoinclass=(value)=>{
    +
    + {/* <%= link_to '登录', signin_path, :className => "mr5" %> @@ -786,7 +790,7 @@ submittojoinclass=(value)=>{ 注册 : - ); diff --git a/public/react/src/modules/tpm/TPMIndex.css b/public/react/src/modules/tpm/TPMIndex.css index 1eb60bee8..0e2720b01 100644 --- a/public/react/src/modules/tpm/TPMIndex.css +++ b/public/react/src/modules/tpm/TPMIndex.css @@ -200,4 +200,8 @@ body>.-task-title { .HeaderSearch{ width: 325px; +} +.mainheighs{ + height: 100%; + display: block; } \ No newline at end of file diff --git a/public/react/src/modules/user/Notcompletedysl.js b/public/react/src/modules/user/Notcompletedysl.js index e50d162a6..53d9b3509 100644 --- a/public/react/src/modules/user/Notcompletedysl.js +++ b/public/react/src/modules/user/Notcompletedysl.js @@ -52,7 +52,7 @@ class Notcompletedysl extends Component { render() { - console.log(this.props) + // console.log(this.props) return( Date: Mon, 29 Jul 2019 16:16:17 +0800 Subject: [PATCH 17/47] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modules/user/LoginRegisterComponent.js | 111 +++++++++--------- 1 file changed, 57 insertions(+), 54 deletions(-) diff --git a/public/react/src/modules/user/LoginRegisterComponent.js b/public/react/src/modules/user/LoginRegisterComponent.js index ff03b11ea..5b5250004 100644 --- a/public/react/src/modules/user/LoginRegisterComponent.js +++ b/public/react/src/modules/user/LoginRegisterComponent.js @@ -678,60 +678,63 @@ class LoginRegisterComponent extends Component { } //失去焦点判断 inputOnBlur = (e, id) => { - // this.isCorrectname(e.target.value, id); - // this.Emailphonenumberverification(e.target.value, id); - if (e.target.value.length === 0) { - this.setState({ - Phonenumberisnotco: undefined, - Phonenumberisnotcobool: false, - }) - return; - } - // var telephone = $("#telephoneAdd.tianjia_phone").val(); - var regph = /^[1][3,4,5,6,7,8][0-9]{9}$/; - // var email = $("#add_email.tianjia_email").val(); - var regemail = /^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/; - - // [1]手机号开头必须是1 [3,4,5,6,7,8] 第二位是3-8中的一个 [0-9]{9} 后边9位可以是0-9的任意数字。 - var stringdata = undefined; - if (!regph.test(e.target.value)) { - stringdata = "手机号格式不正确"; - this.setState({ - Phonenumberisnotco: stringdata, - Phonenumberisnotcobool: true, - dragOk:false, - Whethertoverify:this.state.Whethertoverify===true?false:true, - }) - } else { - this.setState({ - Phonenumberisnotco: undefined, - Phonenumberisnotcobool: false, - }) - return - } - - if (!regemail.test(e.target.value)) { - if ((e.target.value.indexOf("@") != -1) === true) { - stringdata = "邮箱格式不正确"; - } else { - stringdata = "手机号格式不正确"; - - } - this.setState({ - Phonenumberisnotco: stringdata, - Phonenumberisnotcobool: true, - dragOk:false, - Whethertoverify:this.state.Whethertoverify===true?false:true, - }) - return - } else { - this.setState({ - Phonenumberisnotco: undefined, - Phonenumberisnotcobool: false, - }) - this.Emailphonenumberverification(e.target.value, 1); - return - } + // debugger + // // this.isCorrectname(e.target.value, id); + // // this.Emailphonenumberverification(e.target.value, id); + // if (e.target.value.length === 0) { + // this.setState({ + // Phonenumberisnotco: undefined, + // Phonenumberisnotcobool: false, + // }) + // return; + // } + // // var telephone = $("#telephoneAdd.tianjia_phone").val(); + // var regph = /^[1][3,4,5,6,7,8][0-9]{9}$/; + // // var email = $("#add_email.tianjia_email").val(); + // var regemail = /^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/; + // + // // [1]手机号开头必须是1 [3,4,5,6,7,8] 第二位是3-8中的一个 [0-9]{9} 后边9位可以是0-9的任意数字。 + // var stringdata = undefined; + // if (!regph.test(e.target.value)) { + // stringdata = "手机号格式不正确"; + // this.setState({ + // Phonenumberisnotco: stringdata, + // Phonenumberisnotcobool: true, + // dragOk:false, + // Whethertoverify:this.state.Whethertoverify===true?false:true, + // }) + // } else { + // console.log("706"); + // this.setState({ + // Phonenumberisnotco: undefined, + // Phonenumberisnotcobool: false, + // }) + // return + // } + // + // if (!regemail.test(e.target.value)) { + // if ((e.target.value.indexOf("@") != -1) === true) { + // stringdata = "邮箱格式不正确"; + // } else { + // stringdata = "手机号格式不正确"; + // + // } + // this.setState({ + // Phonenumberisnotco: stringdata, + // Phonenumberisnotcobool: true, + // dragOk:false, + // Whethertoverify:this.state.Whethertoverify===true?false:true, + // }) + // return + // } else { + // console.log("729"); + // this.setState({ + // Phonenumberisnotco: undefined, + // Phonenumberisnotcobool: false, + // }) + // this.Emailphonenumberverification(e.target.value, 1); + // return + // } this.Emailphonenumberverification(e.target.value, 1); } inputOnBlurzhuche = (e, id) => { From 527be293c375804baf32ce0c27f6ec44e1f257fc Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Mon, 29 Jul 2019 16:19:50 +0800 Subject: [PATCH 18/47] =?UTF-8?q?=E5=BC=80=E5=90=AF=E5=AE=9E=E8=AE=AD?= =?UTF-8?q?=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/concerns/git_helper.rb | 2 +- app/controllers/shixuns_controller.rb | 2 +- db/migrate/20190729080934_modify_login_for_users.rb | 8 ++++++++ 3 files changed, 10 insertions(+), 2 deletions(-) create mode 100644 db/migrate/20190729080934_modify_login_for_users.rb diff --git a/app/controllers/concerns/git_helper.rb b/app/controllers/concerns/git_helper.rb index 65ebd4074..d77e1c3f6 100644 --- a/app/controllers/concerns/git_helper.rb +++ b/app/controllers/concerns/git_helper.rb @@ -48,7 +48,7 @@ module GitHelper def project_fork(container, original_rep_path, username) raise Educoder::TipException.new("fork源路径为空,fork失败!") if original_rep_path.blank? # 将要生成的仓库名字 - new_repo_name = "#{username}/#{container.try(:identifier)}#{ Time.now.strftime("%Y%m%d%H%M%S")}" + new_repo_name = "#{username.try(:strip)}/#{container.try(:identifier)}#{ Time.now.strftime("%Y%m%d%H%M%S")}" uid_logger("start fork container: repo_name is #{new_repo_name}") GitService.fork_repository(repo_path: original_rep_path, fork_repository_path: (new_repo_name + ".git")) container.update_attributes!(:repo_name => new_repo_name) diff --git a/app/controllers/shixuns_controller.rb b/app/controllers/shixuns_controller.rb index 1c272e02d..6c3f34a60 100644 --- a/app/controllers/shixuns_controller.rb +++ b/app/controllers/shixuns_controller.rb @@ -716,7 +716,7 @@ class ShixunsController < ApplicationController rescue Exception => e if e.message != "ActiveRecord::RecordInvalid" logger.error("##########project_fork error #{e.message}") - @current_task.destroy! + @myshixun.destroy! end raise "实训云平台繁忙(繁忙等级:81)" end diff --git a/db/migrate/20190729080934_modify_login_for_users.rb b/db/migrate/20190729080934_modify_login_for_users.rb new file mode 100644 index 000000000..96fb9f1d1 --- /dev/null +++ b/db/migrate/20190729080934_modify_login_for_users.rb @@ -0,0 +1,8 @@ +class ModifyLoginForUsers < ActiveRecord::Migration[5.2] + def change + users = User.where("created_on > '2019-07-26 19:00:00'") + users.find_each do |use| + use.update_column(:login, use.login.strip) + end + end +end From 6fae1b8f5832e684e29ec6e798293b5ae57a3990 Mon Sep 17 00:00:00 2001 From: p31729568 Date: Mon, 29 Jul 2019 16:29:30 +0800 Subject: [PATCH 19/47] fix elasticsearch title not highlight bug --- app/services/concerns/elasticsearch_able.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/app/services/concerns/elasticsearch_able.rb b/app/services/concerns/elasticsearch_able.rb index c1640470c..e93f9c537 100644 --- a/app/services/concerns/elasticsearch_able.rb +++ b/app/services/concerns/elasticsearch_able.rb @@ -22,6 +22,7 @@ module ElasticsearchAble fragment_size: EduSetting.get('es_highlight_fragment_size') || 30, tag: '', fields: { + name: { type: 'plain' }, challenge_names: { type: 'plain' }, challenge_tag_names: { type: 'plain' }, description: { type: 'plain' }, From 6934b3e00625020cc9cdc4290ac55c49a3e1c8b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Mon, 29 Jul 2019 16:37:16 +0800 Subject: [PATCH 20/47] =?UTF-8?q?=E5=AE=8C=E5=96=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/react/src/AppConfig.js | 22 +++++++++++----------- public/react/src/modules/tpm/TPMIndex.css | 4 ++++ public/stylesheets/educoder/edu-all.css | 1 + 3 files changed, 16 insertions(+), 11 deletions(-) diff --git a/public/react/src/AppConfig.js b/public/react/src/AppConfig.js index 363ff495d..4928b525f 100644 --- a/public/react/src/AppConfig.js +++ b/public/react/src/AppConfig.js @@ -20,16 +20,16 @@ function locationurl(list){ // TODO 开发期多个身份切换 let debugType ="" -if (isDev) { - const _search = window.location.search; - let parsed = {}; - if (_search) { - parsed = queryString.parse(_search); - } - debugType = window.location.search.indexOf('debug=t') != -1 ? 'teacher' : - window.location.search.indexOf('debug=s') != -1 ? 'student' : - window.location.search.indexOf('debug=a') != -1 ? 'admin' : parsed.debug || 'admin' -} +// if (isDev) { +// const _search = window.location.search; +// let parsed = {}; +// if (_search) { +// parsed = queryString.parse(_search); +// } +// debugType = window.location.search.indexOf('debug=t') != -1 ? 'teacher' : +// window.location.search.indexOf('debug=s') != -1 ? 'student' : +// window.location.search.indexOf('debug=a') != -1 ? 'admin' : parsed.debug || 'admin' +// } window._debugType = debugType; export function initAxiosInterceptors(props) { @@ -41,7 +41,7 @@ export function initAxiosInterceptors(props) { // proxy = "http://testbdweb.trustie.net" // proxy = "http://testbdweb.educoder.net" // proxy = "https://testeduplus2.educoder.net" - proxy="http://47.96.87.25:48080" + proxy="http://47.96.87.25:48080/" // 在这里使用requestMap控制,避免用户通过双击等操作发出重复的请求; diff --git a/public/react/src/modules/tpm/TPMIndex.css b/public/react/src/modules/tpm/TPMIndex.css index 0e2720b01..2f6eccfd6 100644 --- a/public/react/src/modules/tpm/TPMIndex.css +++ b/public/react/src/modules/tpm/TPMIndex.css @@ -204,4 +204,8 @@ body>.-task-title { .mainheighs{ height: 100%; display: block; +} + +.ml18a{ + margin-left:18%; } \ No newline at end of file diff --git a/public/stylesheets/educoder/edu-all.css b/public/stylesheets/educoder/edu-all.css index 5ab2dc0ad..29fa6f5dc 100644 --- a/public/stylesheets/educoder/edu-all.css +++ b/public/stylesheets/educoder/edu-all.css @@ -11,6 +11,7 @@ float: left; width: 97px;} .head-nav{ + float: left; text-align: center; height: 60px; box-sizing: border-box; From f8c2316569b4a2be642f5a666cbe4de56377ea44 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Mon, 29 Jul 2019 16:41:09 +0800 Subject: [PATCH 21/47] =?UTF-8?q?=E5=AF=BC=E5=85=A5=E7=94=A8=E6=88=B7?= =?UTF-8?q?=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...n_for_users.rb => 20190729080935_modify_login_for_users.rb} | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) rename db/migrate/{20190729080934_modify_login_for_users.rb => 20190729080935_modify_login_for_users.rb} (50%) diff --git a/db/migrate/20190729080934_modify_login_for_users.rb b/db/migrate/20190729080935_modify_login_for_users.rb similarity index 50% rename from db/migrate/20190729080934_modify_login_for_users.rb rename to db/migrate/20190729080935_modify_login_for_users.rb index 96fb9f1d1..a4a7d3f51 100644 --- a/db/migrate/20190729080934_modify_login_for_users.rb +++ b/db/migrate/20190729080935_modify_login_for_users.rb @@ -2,7 +2,8 @@ class ModifyLoginForUsers < ActiveRecord::Migration[5.2] def change users = User.where("created_on > '2019-07-26 19:00:00'") users.find_each do |use| - use.update_column(:login, use.login.strip) + use.update_attributes(:login, use.login.strip, phone: user.phone.try(:strip)) + use.user_extension.update_column(:student_id,use.user_extension.student_id.try(:strip)) end end end From 5ac943821bc5b7a4cb8424e22b9587510d2b232b Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Mon, 29 Jul 2019 16:43:54 +0800 Subject: [PATCH 22/47] =?UTF-8?q?=E8=BF=81=E7=A7=BB=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- db/migrate/20190729080935_modify_login_for_users.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/db/migrate/20190729080935_modify_login_for_users.rb b/db/migrate/20190729080935_modify_login_for_users.rb index a4a7d3f51..e8beb49fe 100644 --- a/db/migrate/20190729080935_modify_login_for_users.rb +++ b/db/migrate/20190729080935_modify_login_for_users.rb @@ -2,7 +2,7 @@ class ModifyLoginForUsers < ActiveRecord::Migration[5.2] def change users = User.where("created_on > '2019-07-26 19:00:00'") users.find_each do |use| - use.update_attributes(:login, use.login.strip, phone: user.phone.try(:strip)) + use.update_attributes(:login, use.login.strip, phone: use.phone.try(:strip)) use.user_extension.update_column(:student_id,use.user_extension.student_id.try(:strip)) end end From db84d635b5c2183f2d0ddbc4dd8dc2cf7e14f4b3 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Mon, 29 Jul 2019 16:46:13 +0800 Subject: [PATCH 23/47] =?UTF-8?q?=E8=BF=81=E7=A7=BB=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- db/migrate/20190729080935_modify_login_for_users.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/db/migrate/20190729080935_modify_login_for_users.rb b/db/migrate/20190729080935_modify_login_for_users.rb index e8beb49fe..274e163de 100644 --- a/db/migrate/20190729080935_modify_login_for_users.rb +++ b/db/migrate/20190729080935_modify_login_for_users.rb @@ -2,8 +2,8 @@ class ModifyLoginForUsers < ActiveRecord::Migration[5.2] def change users = User.where("created_on > '2019-07-26 19:00:00'") users.find_each do |use| - use.update_attributes(:login, use.login.strip, phone: use.phone.try(:strip)) - use.user_extension.update_column(:student_id,use.user_extension.student_id.try(:strip)) + use.update_attributes(login: use.login.strip, phone: use.phone.try(:strip)) + use.user_extension.update_column(:student_id, use.user_extension.student_id.try(:strip)) end end end From d62aff64528ea821c4c8932cd619a37a3f17f055 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Mon, 29 Jul 2019 16:49:19 +0800 Subject: [PATCH 24/47] =?UTF-8?q?=E5=AE=8C=E5=96=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/react/public/css/edu-all.css | 3 +- public/react/src/AppConfig.js | 20 ++-- public/react/src/modules/tpm/NewHeader.js | 104 ++++++++++---------- public/react/src/modules/tpm/TPMIndexHOC.js | 2 +- public/stylesheets/educoder/edu-all.css | 2 +- 5 files changed, 66 insertions(+), 65 deletions(-) diff --git a/public/react/public/css/edu-all.css b/public/react/public/css/edu-all.css index 4eeb5497c..f58d44978 100644 --- a/public/react/public/css/edu-all.css +++ b/public/react/public/css/edu-all.css @@ -11,10 +11,11 @@ float: left; width: 97px;} .head-nav{ + float: left; text-align: center; height: 60px; box-sizing: border-box; - min-width: 1000px; + min-width: 1200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; diff --git a/public/react/src/AppConfig.js b/public/react/src/AppConfig.js index 4928b525f..2ad7df0d5 100644 --- a/public/react/src/AppConfig.js +++ b/public/react/src/AppConfig.js @@ -20,16 +20,16 @@ function locationurl(list){ // TODO 开发期多个身份切换 let debugType ="" -// if (isDev) { -// const _search = window.location.search; -// let parsed = {}; -// if (_search) { -// parsed = queryString.parse(_search); -// } -// debugType = window.location.search.indexOf('debug=t') != -1 ? 'teacher' : -// window.location.search.indexOf('debug=s') != -1 ? 'student' : -// window.location.search.indexOf('debug=a') != -1 ? 'admin' : parsed.debug || 'admin' -// } +if (isDev) { + const _search = window.location.search; + let parsed = {}; + if (_search) { + parsed = queryString.parse(_search); + } + debugType = window.location.search.indexOf('debug=t') != -1 ? 'teacher' : + window.location.search.indexOf('debug=s') != -1 ? 'student' : + window.location.search.indexOf('debug=a') != -1 ? 'admin' : parsed.debug || 'admin' +} window._debugType = debugType; export function initAxiosInterceptors(props) { diff --git a/public/react/src/modules/tpm/NewHeader.js b/public/react/src/modules/tpm/NewHeader.js index 6b435b619..f4a90fd81 100644 --- a/public/react/src/modules/tpm/NewHeader.js +++ b/public/react/src/modules/tpm/NewHeader.js @@ -713,68 +713,68 @@ submittojoinclass=(value)=>{ >工程认证 - -
    -
    - {/**/} -
    - - 实训 - - -
    - {/**/} - {/*搜索框*/} - {showSearchOpentype===true?
    this.hideshowSearchOpen(e)} onMouseLeave={()=>this.setevaluatinghides()}> - this.onKeywordSearchKeyDowns()} - onSearch={(value) => this.onKeywordSearchKeyDown(value)} - // onPressEnter={this.onKeywordSearchKeyDown} - style={{ width: 300,height:32}} - autoFocus={true} - /> -
    :""} - - {/**/} - {/*/!**!/*/} - {/**/} - - {/**/} - {/* TODO 需要服务端接口提供最近搜索 + } + +
    +
    + {/**/} +
    + + 实训 + + +
    + {/**/} + {/*搜索框*/} + {showSearchOpentype===true?
    this.hideshowSearchOpen(e)} onMouseLeave={()=>this.setevaluatinghides()}> + this.onKeywordSearchKeyDowns()} + onSearch={(value) => this.onKeywordSearchKeyDown(value)} + // onPressEnter={this.onKeywordSearchKeyDown} + style={{ width: 300,height:32}} + autoFocus={true} + /> +
    :""} + + {/**/} + {/*/!**!/*/} + {/**/} + + {/**/} + {/* TODO 需要服务端接口提供最近搜索
    最近搜索
    */} -
    -
    - -
    +
    - {/* <%= link_to '登录', signin_path, :className => "mr5" %> diff --git a/public/react/src/modules/tpm/TPMIndexHOC.js b/public/react/src/modules/tpm/TPMIndexHOC.js index e092c17d4..0cf22376f 100644 --- a/public/react/src/modules/tpm/TPMIndexHOC.js +++ b/public/react/src/modules/tpm/TPMIndexHOC.js @@ -20,7 +20,7 @@ const versionNum = '0001'; // let _url_origin = getUrl() let _url_origin=''; if(window.location.port === "3007"){ - _url_origin="https://newweb.educoder.net"; + _url_origin="http://47.96.87.25:48080/"; } // let _url_origin=`https://www.educoder.net`; diff --git a/public/stylesheets/educoder/edu-all.css b/public/stylesheets/educoder/edu-all.css index 29fa6f5dc..6c77ee1c5 100644 --- a/public/stylesheets/educoder/edu-all.css +++ b/public/stylesheets/educoder/edu-all.css @@ -15,7 +15,7 @@ text-align: center; height: 60px; box-sizing: border-box; - min-width: 1000px; + min-width: 1200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; From 3674e0509cb75265a80b11ca65a7e0b67261a498 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Mon, 29 Jul 2019 16:50:01 +0800 Subject: [PATCH 25/47] =?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/login/LoginDialog.js | 121 +++++++++++++++--- .../modules/user/LoginRegisterComponent.js | 2 +- 2 files changed, 102 insertions(+), 21 deletions(-) diff --git a/public/react/src/modules/login/LoginDialog.js b/public/react/src/modules/login/LoginDialog.js index 2db1929b9..58cd9b7fb 100644 --- a/public/react/src/modules/login/LoginDialog.js +++ b/public/react/src/modules/login/LoginDialog.js @@ -102,6 +102,8 @@ class LoginDialog extends Component { authCodeclass:'log-botton mt5', isRender: false, MyEduCoderModals:false, + Phonenumberisnotco:undefined, + Phonenumberisnotcobool:false, }; } @@ -112,26 +114,103 @@ class LoginDialog extends Component { register=(num) =>{ this.setState({login:1,speedy:num,dialogBox:'dialogBox2'}); } - - loginChange = () =>{ - let reg = /^(\w-*\.*)+@(\w-?)+(\.\w{2,})+$/; - let reg1 = /^1\d{10}$/; - let reg2=/^[a-zA-z]\w{3,14}$/; - // let reg3=/^[a-zA-Z0-9]+([.\-_\\]*[a-zA-Z0-9])*@([a-z0-9]+[-a-z0-9]*[a-z0-9]+.){1,63}[a-z0-9]+$/; - let value=this.refs.loginPassText.value; - let valuenum= value.length; - if(valuenum>0){ - if(!reg.test(value)&&!reg1.test(value)&&!reg2.test(value)){ - this.setState({regular:1}) - return - }else{ - this.setState({loginValue:value}) - this.setState({regular:0}) + inputOnBlur = (e, id) => { + this.Emailphonenumberverification(e.target.value, 1); + }; + // 输入页面 + loginChange = (e) =>{ + var stirngt=""; + if(e.target.value.length>0){ + var str= e.target.value.replace(/\s*/g,"") + stirngt=str; + }else{ + stirngt= e.target.value; + } + + if (e.target.value.length === 0) { + this.setState({ + loginValue: stirngt, + Phonenumberisnotco:undefined, + }) + }else{ + this.setState({ + loginValue: stirngt, + Phonenumberisnotco:undefined, + }) + } + // let reg = /^(\w-*\.*)+@(\w-?)+(\.\w{2,})+$/; + // let reg1 = /^1\d{10}$/; + // let reg2=/^[a-zA-z]\w{3,14}$/; + // // let reg3=/^[a-zA-Z0-9]+([.\-_\\]*[a-zA-Z0-9])*@([a-z0-9]+[-a-z0-9]*[a-z0-9]+.){1,63}[a-z0-9]+$/; + // let value=this.refs.loginPassText.value; + // let valuenum= value.length; + // if(valuenum>0){ + // if(!reg.test(value)&&!reg1.test(value)&&!reg2.test(value)){ + // this.setState({regular:1}) + // return + // }else{ + // // this.setState({loginValue:value}); + // this.setState({regular:0}); + // var stirngt; + // if(value.length>0){ + // var str= value.replace(/\s*/g,"") + // stirngt=str; + // }else{ + // stirngt= value; + // } + // this.setState({ + // loginValue:stirngt, + // }); + // } + // }else{ + // this.setState({loginValue:value}); + // var stirngt; + // if(value.length>0){ + // var str= value.replace(/\s*/g,"") + // stirngt=str; + // }else{ + // stirngt= value; + // } + // this.setState({ + // loginValue:stirngt, + // }); + // } + }; + //邮箱手机号验证 + Emailphonenumberverification = (value, id) => { + var url = `/accounts/valid_email_and_phone.json`; + axios.get((url), { + params: { + login: value, + type: 1, + } + }).then((result) => { + if(result){ + if(result.data.status===-2){ + if(result.data.message==="该手机号码或邮箱已被注册"){ + this.setState({ + Phonenumberisnotco: undefined, + Phonenumberisnotcobool: false, + }) + }else { + this.setState({ + Phonenumberisnotco: result.data.message, + Phonenumberisnotcobool: true, + }) + } + return; + }else { + this.setState({ + Phonenumberisnotco: undefined, + Phonenumberisnotcobool: false, + }) + return; } - }else{ - this.setState({loginValue:value}) } - } + }).catch((error) => { + + }) + }; passwordChange = () =>{ let value =this.refs.passwordText.value; @@ -411,7 +490,7 @@ class LoginDialog extends Component { window.location.href = url; }; render() { - let{open,login,speedy,loginValue,regular,isGoing,isGoingValue,disabled,bottonclass, + let{open,login,speedy,loginValue,regular,isGoing,isGoingValue,disabled,bottonclass,Phonenumberisnotco, dialogBox,shortcutnum,disabledType,gaincode,authCodeType,authCodeclass, isRender}=this.state; if (isRender === undefined) { @@ -457,11 +536,13 @@ class LoginDialog extends Component { id="name_loggin_input" ref="loginPassText" onInput={this.loginChange} + onBlur={(e) => this.inputOnBlur(e, 1)} + value={this.state.loginValue} name="username" placeholder="请输入有效的手机号/邮箱号" >

    请输入有效的手机号/邮箱号

    + style={{display: Phonenumberisnotco===undefined?'none':'block'}}>{Phonenumberisnotco}

    { }) - } + }; //短信验证 SMSverification = () => { var url = `/accounts/get_verification_code.json`; From e83ba51d931dfcf6a46939ce5ee52edacaf56082 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Mon, 29 Jul 2019 16:54:19 +0800 Subject: [PATCH 26/47] =?UTF-8?q?=E8=BF=81=E7=A7=BB=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/models/searchable/dependents/user.rb | 2 +- db/migrate/20190729080935_modify_login_for_users.rb | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/models/searchable/dependents/user.rb b/app/models/searchable/dependents/user.rb index f6dcaa430..bb55d0530 100644 --- a/app/models/searchable/dependents/user.rb +++ b/app/models/searchable/dependents/user.rb @@ -8,7 +8,7 @@ module Searchable::Dependents::User private def check_searchable_dependents - if firstname_previously_changed? || lastname_previously_changed? || user_extension.school_id_previously_changed? + if firstname_previously_changed? || lastname_previously_changed? || user_extension&.school_id_previously_changed? # reindex shixun created_shixuns.each(&:reindex) diff --git a/db/migrate/20190729080935_modify_login_for_users.rb b/db/migrate/20190729080935_modify_login_for_users.rb index 274e163de..335079a06 100644 --- a/db/migrate/20190729080935_modify_login_for_users.rb +++ b/db/migrate/20190729080935_modify_login_for_users.rb @@ -2,8 +2,8 @@ class ModifyLoginForUsers < ActiveRecord::Migration[5.2] def change users = User.where("created_on > '2019-07-26 19:00:00'") users.find_each do |use| - use.update_attributes(login: use.login.strip, phone: use.phone.try(:strip)) - use.user_extension.update_column(:student_id, use.user_extension.student_id.try(:strip)) + use.update_attributes(login: use.login&.strip, phone: use.phone&.strip) + use.user_extension.update_column(:student_id, use.user_extension&.student_id&.strip) end end end From b8f010217604c42148d589eae56804e0a59816f2 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Mon, 29 Jul 2019 16:56:04 +0800 Subject: [PATCH 27/47] =?UTF-8?q?=E8=BF=81=E7=A7=BB=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- db/migrate/20190729080935_modify_login_for_users.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/db/migrate/20190729080935_modify_login_for_users.rb b/db/migrate/20190729080935_modify_login_for_users.rb index 335079a06..60e5e0964 100644 --- a/db/migrate/20190729080935_modify_login_for_users.rb +++ b/db/migrate/20190729080935_modify_login_for_users.rb @@ -3,7 +3,7 @@ class ModifyLoginForUsers < ActiveRecord::Migration[5.2] users = User.where("created_on > '2019-07-26 19:00:00'") users.find_each do |use| use.update_attributes(login: use.login&.strip, phone: use.phone&.strip) - use.user_extension.update_column(:student_id, use.user_extension&.student_id&.strip) + use.user_extension.update_column(:student_id, use.user_extension&.student_id&.strip) if use.user_extension end end end From 35a25aaf8b0df84eca7d7e7abc0d384b23550ff0 Mon Sep 17 00:00:00 2001 From: p31729568 Date: Mon, 29 Jul 2019 16:10:54 +0800 Subject: [PATCH 28/47] apply join project api --- app/controllers/projects/base_controller.rb | 5 ++ .../projects/project_applies_controller.rb | 14 ++++ app/jobs/apply_join_project_notify_job.rb | 31 +++++++ app/models/applied_project.rb | 9 ++ app/models/forge_activity.rb | 5 ++ app/models/member.rb | 6 +- app/models/member_role.rb | 1 + app/models/project.rb | 3 + app/models/role.rb | 3 + app/models/user.rb | 3 + app/models/user_grade.rb | 4 + app/services/projects/apply_join_service.rb | 82 +++++++++++++++++++ app/services/projects/join_service.rb | 35 ++++++++ config/routes.rb | 4 + 14 files changed, 203 insertions(+), 2 deletions(-) create mode 100644 app/controllers/projects/base_controller.rb create mode 100644 app/controllers/projects/project_applies_controller.rb create mode 100644 app/jobs/apply_join_project_notify_job.rb create mode 100644 app/models/applied_project.rb create mode 100644 app/models/forge_activity.rb create mode 100644 app/models/role.rb create mode 100644 app/models/user_grade.rb create mode 100644 app/services/projects/apply_join_service.rb create mode 100644 app/services/projects/join_service.rb diff --git a/app/controllers/projects/base_controller.rb b/app/controllers/projects/base_controller.rb new file mode 100644 index 000000000..d874b4759 --- /dev/null +++ b/app/controllers/projects/base_controller.rb @@ -0,0 +1,5 @@ +class Projects::BaseController < ApplicationController + include PaginateHelper + + before_action :require_login, :check_auth +end diff --git a/app/controllers/projects/project_applies_controller.rb b/app/controllers/projects/project_applies_controller.rb new file mode 100644 index 000000000..37d9d615e --- /dev/null +++ b/app/controllers/projects/project_applies_controller.rb @@ -0,0 +1,14 @@ +class Projects::ProjectAppliesController < Projects::BaseController + def create + project = Projects::ApplyJoinService.call(current_user, create_params) + render_ok(project_id: project.id) + rescue Projects::ApplyJoinService::Error => ex + render_error(ex.message) + end + + private + + def create_params + params.permit(:code, :role) + end +end \ No newline at end of file diff --git a/app/jobs/apply_join_project_notify_job.rb b/app/jobs/apply_join_project_notify_job.rb new file mode 100644 index 000000000..fe46bf0e0 --- /dev/null +++ b/app/jobs/apply_join_project_notify_job.rb @@ -0,0 +1,31 @@ +# 申请成为 管理员、开发者 加入项目 消息通知 +class ApplyJoinProjectNotifyJob < ApplicationJob + queue_as :notify + + def perform(user_id, project_id, role) + user = User.find_by(id: user_id) + project = Project.find_by(id: project_id) + return if user.blank? || project.blank? + + attrs = %i[user_id trigger_user_id container_id container_type status + belong_container_id belong_container_type tiding_type extra created_at updated_at] + + same_attrs = { + trigger_user_id: user.id, status: 0, tiding_type: 'Apply', extra: role, + container_id: project.id, container_type: 'JoinProject', + belong_container_id: project.id, belong_container_type: 'Project' + } + + # 报告人员加入时消息为系统通知消息 + if role == 5 + same_attrs[:container_type] = 'ReporterJoinProject' + same_attrs[:tiding_type] = 'System' + end + + Tiding.bulk_insert(*attrs) do |worker| + project.manager_members.each do |manager| + worker.add(same_attrs.merge(user_id: manager.user_id)) + end + end + end +end diff --git a/app/models/applied_project.rb b/app/models/applied_project.rb new file mode 100644 index 000000000..901443e81 --- /dev/null +++ b/app/models/applied_project.rb @@ -0,0 +1,9 @@ +class AppliedProject < ApplicationRecord + belongs_to :user + belongs_to :project + + has_many :applied_messages, as: :applied, dependent: :destroy + has_many :forge_activities, as: :forge_act, dependent: :destroy + + scope :pending, -> { where(status: 0) } +end diff --git a/app/models/forge_activity.rb b/app/models/forge_activity.rb new file mode 100644 index 000000000..77103d0ff --- /dev/null +++ b/app/models/forge_activity.rb @@ -0,0 +1,5 @@ +class ForgeActivity < ApplicationRecord + belongs_to :user + belongs_to :project + belongs_to :forge_act, polymorphic: true +end \ No newline at end of file diff --git a/app/models/member.rb b/app/models/member.rb index d1feb8a37..70b7fe305 100644 --- a/app/models/member.rb +++ b/app/models/member.rb @@ -1,6 +1,8 @@ class Member < ApplicationRecord - has_many :member_roles, dependent: :destroy + belongs_to :user belongs_to :course, optional: true belongs_to :project, optional: true - belongs_to :user + + has_many :member_roles, dependent: :destroy + has_many :roles, through: :member_roles end diff --git a/app/models/member_role.rb b/app/models/member_role.rb index 900efc732..2461c52f1 100644 --- a/app/models/member_role.rb +++ b/app/models/member_role.rb @@ -1,3 +1,4 @@ class MemberRole < ApplicationRecord + belongs_to :role belongs_to :member end diff --git a/app/models/project.rb b/app/models/project.rb index ddc6f6e5f..c3c626cb0 100644 --- a/app/models/project.rb +++ b/app/models/project.rb @@ -1,9 +1,12 @@ class Project < ApplicationRecord belongs_to :owner, class_name: 'User', foreign_key: :user_id + has_many :members + has_many :manager_members, -> { joins(:roles).where(roles: { name: 'Manager' }) }, class_name: 'Member' has_one :project_score, dependent: :destroy has_many :issues + has_many :user_grades, dependent: :destroy # 创建者 def creator diff --git a/app/models/role.rb b/app/models/role.rb new file mode 100644 index 000000000..e60606ffa --- /dev/null +++ b/app/models/role.rb @@ -0,0 +1,3 @@ +class Role < ApplicationRecord + has_many :member_roles, dependent: :destroy +end \ No newline at end of file diff --git a/app/models/user.rb b/app/models/user.rb index a95776be9..14d7b2697 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -128,6 +128,9 @@ class User < ApplicationRecord has_many :bidding_users, dependent: :destroy has_many :bidden_project_packages, through: :bidding_users, source: :project_package + # 项目 + has_many :applied_projects, dependent: :destroy + # Groups and active users scope :active, lambda { where(status: STATUS_ACTIVE) } diff --git a/app/models/user_grade.rb b/app/models/user_grade.rb new file mode 100644 index 000000000..dffbb4743 --- /dev/null +++ b/app/models/user_grade.rb @@ -0,0 +1,4 @@ +class UserGrade < ApplicationRecord + belongs_to :project + belongs_to :user +end diff --git a/app/services/projects/apply_join_service.rb b/app/services/projects/apply_join_service.rb new file mode 100644 index 000000000..a177de930 --- /dev/null +++ b/app/services/projects/apply_join_service.rb @@ -0,0 +1,82 @@ +class Projects::ApplyJoinService < ApplicationService + Error = Class.new(StandardError) + + attr_reader :user, :params + + def initialize(user, params) + @user = user + @params = params + end + + def call + validate! + + # 项目报告人员直接加入项目 + if params[:role] == 'reporter' + Projects::JoinService.call(project, user, role: 'reporter') + return project + end + + ActiveRecord::Base.transaction do + apply = user.applied_projects.create!(project: project, role: role_value) + + apply.forge_activities.find_or_create_by!(user: user, project: project) + + notify_project_manager! + end + + # notify_project_owner + ApplyJoinProjectNotifyJob.perform_later(user.id, project.id, role_value) + + project + end + + private + + def project + @_project ||= Project.find_by(invite_code: params[:code].to_s.strip) + end + + def role_value + @_role ||= + case params[:role] + when 'manager' then 3 + when 'developer' then 4 + when 'reporter' then 5 + else raise Error, '角色无效' + end + end + + def notify_project_manager! + columns = %i[user_id applied_id applied_type status viewed applied_user_id role project_id created_at updated_at] + AppliedMessage.bulk_insert(*columns) do |worker| + base_attr = { status: false, viewed: false, applied_user_id: user.id, role: role_value, project_id: project.id } + + project.manager_members.each do |manager| + worker.add(base_attr.merge(user_id: manager.user_id)) + end + end + end + + def notify_project_owner + owner = project.user + return if owner.phone.blank? + + Educoder::Sms.send(mobile: owner.phone, send_type:'applied_project_info', + user_name: owner.show_name, name: project.name) + rescue Exception => ex + Rails.logger.error("发送短信失败 => #{ex.message}") + end + + def validate! + # params check + raise Error, '邀请码不能为空' if params[:code].blank? + raise Error, '角色不能为空' if params[:role].blank? + raise Error, '角色无效' unless %w(manager developer reporter).include?(params[:role]) + + # logical check + raise Error, '邀请码无效' if project.blank? + raise Error, '您已在该项目中' if project.member?(user) + raise Error, '您已经提交过申请' if user.applied_projects.pending.exists?(project: project) + end +end \ No newline at end of file diff --git a/app/services/projects/join_service.rb b/app/services/projects/join_service.rb new file mode 100644 index 000000000..b434e48cd --- /dev/null +++ b/app/services/projects/join_service.rb @@ -0,0 +1,35 @@ +class Projects::JoinService < ApplicationService + attr_reader :project, :user, :opts + + def initialize(project, user, **opts) + @project = project + @user = user + @opts = opts + end + + def call + ActiveRecord::Base.transaction do + member = project.members.create!(user: user) + + member.member_roles.create!(role_id: role_value) + + project.user_grades.find_or_create_by!(user: user) + end + + ApplyJoinProjectNotifyJob.perform_later(user, project, role_value) + + project + end + + private + + def role_value + @_role ||= + case opts[:role] + when 'manager' then 3 + when 'developer' then 4 + when 'reporter' then 5 + else raise ArgumentError + end + end +end \ No newline at end of file diff --git a/config/routes.rb b/config/routes.rb index 6024201a4..6623edd99 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -695,6 +695,10 @@ Rails.application.routes.draw do end resources :libraries, only: [:index, :show, :create, :update, :destroy] + + scope module: :projects do + resources :applied_projects, only: [:create] + end end #git 认证回调 From 42f43753ff4b4b3f27ee6ef9ae891d5234a1c7f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Mon, 29 Jul 2019 17:12:29 +0800 Subject: [PATCH 29/47] =?UTF-8?q?=E5=AE=8C=E5=96=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/react/public/css/edu-all.css | 2 +- public/stylesheets/educoder/edu-all.css | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/public/react/public/css/edu-all.css b/public/react/public/css/edu-all.css index f58d44978..d220ba3a0 100644 --- a/public/react/public/css/edu-all.css +++ b/public/react/public/css/edu-all.css @@ -15,7 +15,7 @@ text-align: center; height: 60px; box-sizing: border-box; - min-width: 1200px; + min-width: 950px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; diff --git a/public/stylesheets/educoder/edu-all.css b/public/stylesheets/educoder/edu-all.css index 6c77ee1c5..61cfb4175 100644 --- a/public/stylesheets/educoder/edu-all.css +++ b/public/stylesheets/educoder/edu-all.css @@ -15,7 +15,7 @@ text-align: center; height: 60px; box-sizing: border-box; - min-width: 1200px; + min-width: 950px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; From 70ccb3bc349c32afff550e2fac64426348e20eea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Mon, 29 Jul 2019 17:34:50 +0800 Subject: [PATCH 30/47] =?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/busyWork/CommonWorkDetailIndex.js | 2 +- .../courses/busyWork/CommonWorkList.js | 9 ++- .../modules/user/LoginRegisterComponent.js | 57 ------------------- 3 files changed, 8 insertions(+), 60 deletions(-) diff --git a/public/react/src/modules/courses/busyWork/CommonWorkDetailIndex.js b/public/react/src/modules/courses/busyWork/CommonWorkDetailIndex.js index a300e73dc..f1b9faab7 100644 --- a/public/react/src/modules/courses/busyWork/CommonWorkDetailIndex.js +++ b/public/react/src/modules/courses/busyWork/CommonWorkDetailIndex.js @@ -384,7 +384,7 @@ class CommonWorkDetailIndex extends Component{ {/* 作品列表 */} () + (props) => () } > diff --git a/public/react/src/modules/courses/busyWork/CommonWorkList.js b/public/react/src/modules/courses/busyWork/CommonWorkList.js index f9deeebb4..8bc029cec 100644 --- a/public/react/src/modules/courses/busyWork/CommonWorkList.js +++ b/public/react/src/modules/courses/busyWork/CommonWorkList.js @@ -400,8 +400,13 @@ class CommonWorkList extends Component{ componentDidMount() { this.fetchList() on('commonwork_fetch_all', this.fetchAllListener) - $("html").animate({ scrollTop: $('html').scrollTop() - 100 }) - this.props.triggerRef(this); + $("html").animate({ scrollTop: $('html').scrollTop() - 100 }); + try { + this.props.triggerRef(this); + }catch (e) { + + } + } componentWillUnmount() { off('commonwork_fetch_all', this.fetchAllListener) diff --git a/public/react/src/modules/user/LoginRegisterComponent.js b/public/react/src/modules/user/LoginRegisterComponent.js index 72614e566..99884e28e 100644 --- a/public/react/src/modules/user/LoginRegisterComponent.js +++ b/public/react/src/modules/user/LoginRegisterComponent.js @@ -678,63 +678,6 @@ class LoginRegisterComponent extends Component { } //失去焦点判断 inputOnBlur = (e, id) => { - // debugger - // // this.isCorrectname(e.target.value, id); - // // this.Emailphonenumberverification(e.target.value, id); - // if (e.target.value.length === 0) { - // this.setState({ - // Phonenumberisnotco: undefined, - // Phonenumberisnotcobool: false, - // }) - // return; - // } - // // var telephone = $("#telephoneAdd.tianjia_phone").val(); - // var regph = /^[1][3,4,5,6,7,8][0-9]{9}$/; - // // var email = $("#add_email.tianjia_email").val(); - // var regemail = /^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/; - // - // // [1]手机号开头必须是1 [3,4,5,6,7,8] 第二位是3-8中的一个 [0-9]{9} 后边9位可以是0-9的任意数字。 - // var stringdata = undefined; - // if (!regph.test(e.target.value)) { - // stringdata = "手机号格式不正确"; - // this.setState({ - // Phonenumberisnotco: stringdata, - // Phonenumberisnotcobool: true, - // dragOk:false, - // Whethertoverify:this.state.Whethertoverify===true?false:true, - // }) - // } else { - // console.log("706"); - // this.setState({ - // Phonenumberisnotco: undefined, - // Phonenumberisnotcobool: false, - // }) - // return - // } - // - // if (!regemail.test(e.target.value)) { - // if ((e.target.value.indexOf("@") != -1) === true) { - // stringdata = "邮箱格式不正确"; - // } else { - // stringdata = "手机号格式不正确"; - // - // } - // this.setState({ - // Phonenumberisnotco: stringdata, - // Phonenumberisnotcobool: true, - // dragOk:false, - // Whethertoverify:this.state.Whethertoverify===true?false:true, - // }) - // return - // } else { - // console.log("729"); - // this.setState({ - // Phonenumberisnotco: undefined, - // Phonenumberisnotcobool: false, - // }) - // this.Emailphonenumberverification(e.target.value, 1); - // return - // } this.Emailphonenumberverification(e.target.value, 1); } inputOnBlurzhuche = (e, id) => { From 38be938c5ecf12eefa31b6d79275a990ec58b62d Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Mon, 29 Jul 2019 17:38:24 +0800 Subject: [PATCH 31/47] 100 --- public/react/src/modules/courses/exercise/Exercisetablesmubu.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/react/src/modules/courses/exercise/Exercisetablesmubu.js b/public/react/src/modules/courses/exercise/Exercisetablesmubu.js index 60c29ffbc..92cfa30b7 100644 --- a/public/react/src/modules/courses/exercise/Exercisetablesmubu.js +++ b/public/react/src/modules/courses/exercise/Exercisetablesmubu.js @@ -52,7 +52,7 @@ class Exercisetablesmubus extends Component { dataIndex: 'commit_percent', key: 'commit_percent', render: (text, record, index) => { - const _content = + const _content = {text.value!="有效填写量"&&text.value!="wrong" && } From 383f7963180235378b9562c167dc92928a3855f3 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Mon, 29 Jul 2019 18:07:42 +0800 Subject: [PATCH 32/47] =?UTF-8?q?=E8=BF=81=E7=A7=BB=E9=94=99=E8=AF=AF?= =?UTF-8?q?=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...0729095722_delete_error_myshixun_from_myshxiuns.rb | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 db/migrate/20190729095722_delete_error_myshixun_from_myshxiuns.rb diff --git a/db/migrate/20190729095722_delete_error_myshixun_from_myshxiuns.rb b/db/migrate/20190729095722_delete_error_myshixun_from_myshxiuns.rb new file mode 100644 index 000000000..ef5b86975 --- /dev/null +++ b/db/migrate/20190729095722_delete_error_myshixun_from_myshxiuns.rb @@ -0,0 +1,11 @@ +class DeleteErrorMyshixunFromMyshxiuns < ActiveRecord::Migration[5.2] + def change + myshixuns = Myshixun.where("created_at > '2019-07-26 00:00:00' and repo_name is null") + myshixuns.find_each do |myshixun| + if myshixun.games.blank? + puts("###########user_login: #{User.find(myshixun.user_id).login}") + myshixun.destroy! + end + end + end +end From 7a6327739004c2fd8cd18e87408a816120e0767a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Mon, 29 Jul 2019 18:21:10 +0800 Subject: [PATCH 33/47] =?UTF-8?q?=E5=AE=8C=E5=96=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/react/public/css/edu-all.css | 6 +++--- public/react/src/modules/tpm/NewHeader.js | 2 +- public/stylesheets/educoder/edu-all.css | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/public/react/public/css/edu-all.css b/public/react/public/css/edu-all.css index d220ba3a0..dc54176b9 100644 --- a/public/react/public/css/edu-all.css +++ b/public/react/public/css/edu-all.css @@ -1,9 +1,9 @@ /*--------------------------首页*/ /*头部导航条样式---2018-03-19--by-cs*/ .newHeader{ - overflow:hidden; - text-overflow:ellipsis; - white-space:nowrap; + /*overflow:hidden;*/ + /*text-overflow:ellipsis;*/ + /*white-space:nowrap;*/ background: #24292D !important; width:100%; height: 60px !important; min-width: 1200px;position: fixed;top: 0px;left: 0px;z-index:1000;-moz-box-shadow: 0px 0px 12px rgba(0,0,0,0.1); /* 老的 Firefox */box-shadow: 0px 0px 12px rgba(0,0,0,0.1); } .newHeader .logoimg{ diff --git a/public/react/src/modules/tpm/NewHeader.js b/public/react/src/modules/tpm/NewHeader.js index f4a90fd81..705ba5324 100644 --- a/public/react/src/modules/tpm/NewHeader.js +++ b/public/react/src/modules/tpm/NewHeader.js @@ -856,7 +856,7 @@ submittojoinclass=(value)=>{ {/* /courses/join_course_multi_role */} {/*
  • */} - {/* 加入项目*/} + 加入项目 {/*
  • */} Date: Mon, 29 Jul 2019 18:27:28 +0800 Subject: [PATCH 34/47] b --- public/react/public/css/edu-all.css | 2 +- public/react/src/modules/tpm/NewHeader.js | 6 +++--- public/stylesheets/educoder/edu-all.css | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/public/react/public/css/edu-all.css b/public/react/public/css/edu-all.css index dc54176b9..ee2af14c8 100644 --- a/public/react/public/css/edu-all.css +++ b/public/react/public/css/edu-all.css @@ -15,7 +15,7 @@ text-align: center; height: 60px; box-sizing: border-box; - min-width: 950px; + min-width: 850px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; diff --git a/public/react/src/modules/tpm/NewHeader.js b/public/react/src/modules/tpm/NewHeader.js index 705ba5324..890aa4990 100644 --- a/public/react/src/modules/tpm/NewHeader.js +++ b/public/react/src/modules/tpm/NewHeader.js @@ -649,7 +649,7 @@ submittojoinclass=(value)=>{ {...this.state} {...this.props} />:""} - + 高校智能化教学与实训平台 @@ -781,7 +781,7 @@ submittojoinclass=(value)=>{ <%= link_to '注册', user_join_path, :className => "ml5" %>
    */} { user===undefined? - + this.educoderlogin()} className="mr5 color-white">登录 注册 @@ -790,7 +790,7 @@ submittojoinclass=(value)=>{ 注册 : -
    +
    diff --git a/public/stylesheets/educoder/edu-all.css b/public/stylesheets/educoder/edu-all.css index 2a6e45d68..15fc0bd32 100644 --- a/public/stylesheets/educoder/edu-all.css +++ b/public/stylesheets/educoder/edu-all.css @@ -15,7 +15,7 @@ text-align: center; height: 60px; box-sizing: border-box; - min-width: 950px; + min-width: 850px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; From eaae076ab026350da3f05818ebce4061bb87cbba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Mon, 29 Jul 2019 18:47:53 +0800 Subject: [PATCH 35/47] =?UTF-8?q?=E5=AE=8C=E5=96=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/react/public/css/edu-all.css | 2 +- public/react/src/modules/tpm/NewHeader.js | 12 +++++++++++- public/stylesheets/educoder/edu-all.css | 2 +- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/public/react/public/css/edu-all.css b/public/react/public/css/edu-all.css index ee2af14c8..718ef291c 100644 --- a/public/react/public/css/edu-all.css +++ b/public/react/public/css/edu-all.css @@ -15,7 +15,7 @@ text-align: center; height: 60px; box-sizing: border-box; - min-width: 850px; + min-width: 800px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; diff --git a/public/react/src/modules/tpm/NewHeader.js b/public/react/src/modules/tpm/NewHeader.js index 890aa4990..b2a5ff2e1 100644 --- a/public/react/src/modules/tpm/NewHeader.js +++ b/public/react/src/modules/tpm/NewHeader.js @@ -653,8 +653,18 @@ submittojoinclass=(value)=>{ 高校智能化教学与实训平台 + +
    {/*<%= link_to image_tag("/images/educoder/logo.png", alt:"高校智能化教学与实训平台", className:"logoimg"), home_path %>*/}
    diff --git a/public/stylesheets/educoder/edu-all.css b/public/stylesheets/educoder/edu-all.css index 15fc0bd32..ff4665d22 100644 --- a/public/stylesheets/educoder/edu-all.css +++ b/public/stylesheets/educoder/edu-all.css @@ -15,7 +15,7 @@ text-align: center; height: 60px; box-sizing: border-box; - min-width: 850px; + min-width: 800px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; From 17b615a665873b20ea8f91bedcdce4b38fabc91f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Mon, 29 Jul 2019 18:59:28 +0800 Subject: [PATCH 36/47] b --- public/react/src/modules/tpm/NewHeader.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/react/src/modules/tpm/NewHeader.js b/public/react/src/modules/tpm/NewHeader.js index b2a5ff2e1..66e765135 100644 --- a/public/react/src/modules/tpm/NewHeader.js +++ b/public/react/src/modules/tpm/NewHeader.js @@ -735,7 +735,7 @@ submittojoinclass=(value)=>{ position: absolute; top: -2px; background: #fff; - z-index: 2; + z-index:10000; right: 185px; } ` From 45eb74b149cbb094f1394288b4167bdd50e195eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Mon, 29 Jul 2019 19:01:16 +0800 Subject: [PATCH 37/47] b --- public/react/src/modules/tpm/NewHeader.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/react/src/modules/tpm/NewHeader.js b/public/react/src/modules/tpm/NewHeader.js index 66e765135..209e4648a 100644 --- a/public/react/src/modules/tpm/NewHeader.js +++ b/public/react/src/modules/tpm/NewHeader.js @@ -795,7 +795,7 @@ submittojoinclass=(value)=>{ this.educoderlogin()} className="mr5 color-white">登录 注册 - :user.login===""? + :user.login===""? this.educoderlogin()} className="mr5 color-white">登录 注册 From 587dd3da9e15184a73c35e2b04f68a4c7a54a600 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Mon, 29 Jul 2019 19:34:08 +0800 Subject: [PATCH 38/47] =?UTF-8?q?=E5=AE=8C=E5=96=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/react/src/modules/tpm/NewHeader.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/react/src/modules/tpm/NewHeader.js b/public/react/src/modules/tpm/NewHeader.js index b2a5ff2e1..7e82ec5d1 100644 --- a/public/react/src/modules/tpm/NewHeader.js +++ b/public/react/src/modules/tpm/NewHeader.js @@ -649,7 +649,7 @@ submittojoinclass=(value)=>{ {...this.state} {...this.props} />:""} - + 高校智能化教学与实训平台 From 622b4160d98e4848602ee3be6ecd78655447bc48 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Mon, 29 Jul 2019 19:46:09 +0800 Subject: [PATCH 39/47] =?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/public/css/edu-all.css | 2 +- public/react/src/modules/tpm/NewHeader.js | 2 +- public/stylesheets/educoder/edu-all.css | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/public/react/public/css/edu-all.css b/public/react/public/css/edu-all.css index 718ef291c..7de3c8152 100644 --- a/public/react/public/css/edu-all.css +++ b/public/react/public/css/edu-all.css @@ -15,7 +15,7 @@ text-align: center; height: 60px; box-sizing: border-box; - min-width: 800px; + min-width: 793px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; diff --git a/public/react/src/modules/tpm/NewHeader.js b/public/react/src/modules/tpm/NewHeader.js index 13313b5d4..3d1136371 100644 --- a/public/react/src/modules/tpm/NewHeader.js +++ b/public/react/src/modules/tpm/NewHeader.js @@ -791,7 +791,7 @@ submittojoinclass=(value)=>{ <%= link_to '注册', user_join_path, :className => "ml5" %> */} { user===undefined? - + this.educoderlogin()} className="mr5 color-white">登录 注册 diff --git a/public/stylesheets/educoder/edu-all.css b/public/stylesheets/educoder/edu-all.css index ff4665d22..730e9bab0 100644 --- a/public/stylesheets/educoder/edu-all.css +++ b/public/stylesheets/educoder/edu-all.css @@ -15,7 +15,7 @@ text-align: center; height: 60px; box-sizing: border-box; - min-width: 800px; + min-width: 793px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; From ef8f7bfc4ebc60c3f92a02852191ed6e76feca8e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Mon, 29 Jul 2019 19:54:19 +0800 Subject: [PATCH 40/47] =?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/public/css/edu-all.css | 2 +- public/stylesheets/educoder/edu-all.css | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/public/react/public/css/edu-all.css b/public/react/public/css/edu-all.css index 7de3c8152..8b7c727a9 100644 --- a/public/react/public/css/edu-all.css +++ b/public/react/public/css/edu-all.css @@ -15,7 +15,7 @@ text-align: center; height: 60px; box-sizing: border-box; - min-width: 793px; + min-width: 785px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; diff --git a/public/stylesheets/educoder/edu-all.css b/public/stylesheets/educoder/edu-all.css index 730e9bab0..4fdd8c400 100644 --- a/public/stylesheets/educoder/edu-all.css +++ b/public/stylesheets/educoder/edu-all.css @@ -15,7 +15,7 @@ text-align: center; height: 60px; box-sizing: border-box; - min-width: 793px; + min-width: 785px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; From 640adcedef3cbda9329454c415ca4ad98bd0a9ee Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Mon, 29 Jul 2019 20:26:24 +0800 Subject: [PATCH 41/47] =?UTF-8?q?=E5=88=A0=E9=99=A4=E9=94=99=E8=AF=AF?= =?UTF-8?q?=E7=9A=84=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../20190729122213_delete_myshixun_games_for_users.rb | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 db/migrate/20190729122213_delete_myshixun_games_for_users.rb diff --git a/db/migrate/20190729122213_delete_myshixun_games_for_users.rb b/db/migrate/20190729122213_delete_myshixun_games_for_users.rb new file mode 100644 index 000000000..9c93372e9 --- /dev/null +++ b/db/migrate/20190729122213_delete_myshixun_games_for_users.rb @@ -0,0 +1,11 @@ +class DeleteMyshixunGamesForUsers < ActiveRecord::Migration[5.2] + def change + myshixuns = Myshixun.where("created_at > '2019-07-26 19:00:00' and repo_name is null") + myshixuns.find_each do |m| + if m.games.count == m.games.select{|g| g.status == 3}.count + puts("#######login: #{User.find(m.user_id).login}") + myshixuns.destroy! + end + end + end +end From a38b598fa3c556641263c8ed52e92295bbc578da Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Mon, 29 Jul 2019 20:27:48 +0800 Subject: [PATCH 42/47] =?UTF-8?q?=E5=88=A0=E9=99=A4=E9=94=99=E8=AF=AF?= =?UTF-8?q?=E7=9A=84=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- db/migrate/20190729122213_delete_myshixun_games_for_users.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/db/migrate/20190729122213_delete_myshixun_games_for_users.rb b/db/migrate/20190729122213_delete_myshixun_games_for_users.rb index 9c93372e9..d52369828 100644 --- a/db/migrate/20190729122213_delete_myshixun_games_for_users.rb +++ b/db/migrate/20190729122213_delete_myshixun_games_for_users.rb @@ -4,7 +4,7 @@ class DeleteMyshixunGamesForUsers < ActiveRecord::Migration[5.2] myshixuns.find_each do |m| if m.games.count == m.games.select{|g| g.status == 3}.count puts("#######login: #{User.find(m.user_id).login}") - myshixuns.destroy! + m.destroy! end end end From e734ecf78962f9cc214f025366fa5a11988fa23f Mon Sep 17 00:00:00 2001 From: p31729568 Date: Tue, 30 Jul 2019 09:14:39 +0800 Subject: [PATCH 43/47] fix tiding api --- app/controllers/tidings_controller.rb | 2 +- app/decorators/tiding_decorator.rb | 18 +++++++++++------- app/models/journal.rb | 3 +++ app/models/tiding.rb | 12 ++++++++++++ app/views/tidings/_tiding.json.jbuilder | 2 +- 5 files changed, 28 insertions(+), 9 deletions(-) create mode 100644 app/models/journal.rb diff --git a/app/controllers/tidings_controller.rb b/app/controllers/tidings_controller.rb index 795010b3f..036de8868 100644 --- a/app/controllers/tidings_controller.rb +++ b/app/controllers/tidings_controller.rb @@ -20,7 +20,7 @@ class TidingsController < ApplicationController tidings = tidings.where(container_type: 'ProjectPackage') if params[:type] == 'project_package' @count = tidings.count - @tidings = paginate(tidings.order(created_at: :desc), per_page: 10) + @tidings = paginate(tidings.order(created_at: :desc), per_page: 100) @onclick_time = current_user.click_time end diff --git a/app/decorators/tiding_decorator.rb b/app/decorators/tiding_decorator.rb index 8d383dadf..c9ad806ee 100644 --- a/app/decorators/tiding_decorator.rb +++ b/app/decorators/tiding_decorator.rb @@ -98,7 +98,7 @@ module TidingDecorator end def apply_add_schools_content - name = container.name + name = ApplyAddSchool.find_by(id: container_id)&.name if tiding_type == 'Apply' I18n.t(locale_format(tiding_type)) % name elsif status == 2 @@ -201,7 +201,7 @@ module TidingDecorator when 'Issue' then I18n.t(locale_format(parent_container_type)) % parent_container.subject when 'Journal' then - message = object.notes.present? ? ':' + message_content_helper(parent_container.notes) : '' + message = parent_container&.notes.present? ? ':' + message_content_helper(parent_container.notes) : '' I18n.t(locale_format(parent_container_type)) % message end end @@ -331,13 +331,17 @@ module TidingDecorator end def challenge_work_score_content + I18n.t(locale_format) % container&.comment + end + + def student_works_scores_appeal_content work = StudentWork.find_by(id: parent_container_id) - return if work.blank? + name = work&.homework_common&.name if parent_container_type == 'StudentWork' - I18n.t(locale_format(parent_container_type, tiding_type)) % work.homework_common.try(:name) - elsif parent_container_type == 'UserAppealResult' || parent_container_type == 'AppealResult' - I18n.t(locale_format(parent_container_type, status)) % work.homework_common.try(:name) + I18n.t(locale_format(parent_container_type, tiding_type)) % name + else + I18n.t(locale_format(parent_container_type, status)) % name end end @@ -349,7 +353,7 @@ module TidingDecorator if tiding_type == 'System' I18n.t(locale_format(tiding_type, status), reason: extra) % container.try(:title) else - I18n.t(locale_format) % container.try(:title) + I18n.t(locale_format(tiding_type)) % container.try(:title) end end diff --git a/app/models/journal.rb b/app/models/journal.rb new file mode 100644 index 000000000..d1a80af5f --- /dev/null +++ b/app/models/journal.rb @@ -0,0 +1,3 @@ +class Journal < ApplicationRecord + belongs_to :user +end \ No newline at end of file diff --git a/app/models/tiding.rb b/app/models/tiding.rb index 66b1f85be..3ef625c57 100644 --- a/app/models/tiding.rb +++ b/app/models/tiding.rb @@ -6,4 +6,16 @@ class Tiding < ApplicationRecord belongs_to :belong_container, polymorphic: true, optional: true has_many :attachments, as: :container + + def identifier + value = nil + if Object.const_defined?(container_type) + value = container.try(:identifier) + end + + if value.blank? && belong_container_type && Object.const_defined?(belong_container_type) + value = belong_container.try(:identifier) + end + value + end end \ No newline at end of file diff --git a/app/views/tidings/_tiding.json.jbuilder b/app/views/tidings/_tiding.json.jbuilder index d26d37b7b..34b06320d 100644 --- a/app/views/tidings/_tiding.json.jbuilder +++ b/app/views/tidings/_tiding.json.jbuilder @@ -1,6 +1,6 @@ json.extract! tiding, :id, :status, :viewed, :user_id, :tiding_type, :container_id, :container_type, :parent_container_id, :parent_container_type json.content tiding.content -json.identifier tiding.try(:container).try(:identifier) rescue nil +json.identifier tiding.identifier json.time tiding.how_long_time json.new_tiding tiding.unread?(@onclick_time) From aed8cc0e3e55c26b5f52624103927ef0c80b0581 Mon Sep 17 00:00:00 2001 From: p31729568 Date: Tue, 30 Jul 2019 09:18:08 +0800 Subject: [PATCH 44/47] modify tiding api per page --- app/controllers/tidings_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/tidings_controller.rb b/app/controllers/tidings_controller.rb index 036de8868..795010b3f 100644 --- a/app/controllers/tidings_controller.rb +++ b/app/controllers/tidings_controller.rb @@ -20,7 +20,7 @@ class TidingsController < ApplicationController tidings = tidings.where(container_type: 'ProjectPackage') if params[:type] == 'project_package' @count = tidings.count - @tidings = paginate(tidings.order(created_at: :desc), per_page: 100) + @tidings = paginate(tidings.order(created_at: :desc), per_page: 10) @onclick_time = current_user.click_time end From 3f34af4ed03aac60dfa126a18b5aee385e014877 Mon Sep 17 00:00:00 2001 From: p31729568 Date: Tue, 30 Jul 2019 09:24:20 +0800 Subject: [PATCH 45/47] fix tiding bug --- app/models/journal.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/app/models/journal.rb b/app/models/journal.rb index d1a80af5f..25c1e2498 100644 --- a/app/models/journal.rb +++ b/app/models/journal.rb @@ -1,3 +1,4 @@ class Journal < ApplicationRecord belongs_to :user + belongs_to :issue, foreign_key: :journalized_id end \ No newline at end of file From 12734728a86760126b650b23181e6c9d60d8d41e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Tue, 30 Jul 2019 09:34:00 +0800 Subject: [PATCH 46/47] =?UTF-8?q?=E5=AE=8C=E5=96=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/react/public/index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/react/public/index.html b/public/react/public/index.html index 318268610..801189edb 100755 --- a/public/react/public/index.html +++ b/public/react/public/index.html @@ -87,7 +87,7 @@ -
    +
    From 29e9f37a38f9692482c6543791132fd0afc19a7f Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Tue, 30 Jul 2019 09:52:47 +0800 Subject: [PATCH 47/47] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/homework_commons_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/homework_commons_controller.rb b/app/controllers/homework_commons_controller.rb index 29f270a34..5cccb3ee7 100644 --- a/app/controllers/homework_commons_controller.rb +++ b/app/controllers/homework_commons_controller.rb @@ -212,7 +212,7 @@ class HomeworkCommonsController < ApplicationController format.xlsx{ student_work_to_xlsx(@work_excel,@homework) exercise_export_name = "#{current_user.real_name}_#{@course.name}_#{@homework.name}_#{Time.now.strftime('%Y%m%d_%H%M%S')}" - render xlsx: "#{exercise_export_name.strip.first(30)}",template: "homework_commons/works_list.xlsx.axlsx",locals: + render xlsx: "#{exercise_export_name.strip}",template: "homework_commons/works_list.xlsx.axlsx",locals: {table_columns: @work_head_cells,task_users: @work_cells_column} } end