diff --git a/app/controllers/accounts_controller.rb b/app/controllers/accounts_controller.rb index 324e5bde3..d1357d43f 100644 --- a/app/controllers/accounts_controller.rb +++ b/app/controllers/accounts_controller.rb @@ -125,8 +125,8 @@ class AccountsController < ApplicationController set_autologin_cookie(user) UserAction.create(:action_id => user.try(:id), :action_type => "Login", :user_id => user.try(:id), :ip => request.remote_ip) - # 注册完成后有一天的试用申请 - UserDayCertification.create(user_id: user.id, status: 1) + # 注册完成后有一天的试用申请(先去掉) + # UserDayCertification.create(user_id: user.id, status: 1) end def set_autologin_cookie(user) diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index bf8a0651e..af0158cfd 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -185,21 +185,29 @@ class ApplicationController < ActionController::Base render :json => { status: status, message: message } end - # 系统全局认证 - def check_auth - day_cer = UserDayCertification.find_by(user_id: current_user.id) - # 如果注册超过24小时则需要完善资料及授权 - if (Time.now.to_i - day_cer.try(:created_at).to_i) > 86400 - if !current_user.profile_completed? - info_url = '/account/profile' - tip_exception(402, info_url) - elsif current_user.certification != 1 - if current_user.apply_actions.exists?(container_type: 'TrialAuthorization', status: 0) - tip_exception(408, "您的试用申请正在审核中,请耐心等待") - end - tip_exception(407, "系统未授权") - end + # 资料是否完善 + def check_account + if !current_user.profile_completed? + info_url = '/account/profile' + tip_exception(402, info_url) end + end + + # 系统全局认证(暂时隐藏试用申请的判断) + def check_auth + # day_cer = UserDayCertification.find_by(user_id: current_user.id) + # # 如果注册超过24小时则需要完善资料及授权 + # if (Time.now.to_i - day_cer.try(:created_at).to_i) > 86400 + # if !current_user.profile_completed? + # info_url = '/account/profile' + # tip_exception(402, info_url) + # elsif current_user.certification != 1 + # if current_user.apply_actions.exists?(container_type: 'TrialAuthorization', status: 0) + # tip_exception(408, "您的试用申请正在审核中,请耐心等待") + # end + # tip_exception(407, "系统未授权") + # end + # end # if current_user.certification != 1 && current_user.apply_actions.exists?(container_type: 'TrialAuthorization', status: 0) diff --git a/app/controllers/courses_controller.rb b/app/controllers/courses_controller.rb index faad02173..a1f37687d 100644 --- a/app/controllers/courses_controller.rb +++ b/app/controllers/courses_controller.rb @@ -13,6 +13,7 @@ class CoursesController < ApplicationController before_action :require_login, except: [:index, :show, :students, :teachers, :board_list, :mine, :all_course_groups, :left_banner, :top_banner] + before_action :check_account, only: [:new, :create, :apply_to_join_course] before_action :check_auth, except: [:index, :show, :students, :teachers, :board_list, :mine, :all_course_groups, :left_banner, :top_banner, :apply_to_join_course, :exit_course] before_action :set_course, :user_course_identity, only: [:show, :update, :destroy, :settings, :set_invite_code_halt, @@ -116,6 +117,7 @@ class CoursesController < ApplicationController # GET /courses/new def new @course = Course.new + normal_status("成功") end # Get /courses/:id/settings @@ -926,12 +928,12 @@ class CoursesController < ApplicationController role = course_message.content == 2 ? '7' : '9' # 7:助教 9:教师 ApplyTeacherRoleJoinCourseNotifyJob.perform_later(current_user.id, course.id, role) - teacher_role = 1 message = "#{course_message.content == 2 ? '助教' : '教师'}申请已提交,请等待审核" else message = "#{existing_course_message.content == 2 ? '助教' : '教师'}申请已提交,请等待审核" end end + teacher_role = 1 end if teacher_role && current_user.student_of_course?(course) diff --git a/app/controllers/games_controller.rb b/app/controllers/games_controller.rb index a51dccb6f..b2de6dcad 100644 --- a/app/controllers/games_controller.rb +++ b/app/controllers/games_controller.rb @@ -37,7 +37,8 @@ class GamesController < ApplicationController # 上一关、下一关 prev_game = @game.prev_of_current_game(@shixun.id, @game.myshixun_id, game_challenge.position) - next_game = @game.next_of_current_game(@shixun.id, @game.myshixun_id, game_challenge.position) + #next_game = @game.next_of_current_game(@shixun.id, @game.myshixun_id, game_challenge.position) + next_game = user_next_game(@shixun, game_challenge, @game, @identity) # 关卡点赞数, praise_or_tread = 1则表示赞过 praise_count = game_challenge.praises_count @@ -962,4 +963,14 @@ class GamesController < ApplicationController @identity = current_user.game_identity(@game) raise Educoder::TipException.new(403, "..") if @identity > User::EDU_GAME_MANAGER end + # identity用户身份 + def user_next_game(shixun, challenge, game, identity) + next_game = game.next_of_current_game(shixun.id, game.myshixun_id, challenge.position) + # 实训允许跳关 、 当前关卡已经通关、 用户是已认证的老师以上权限的人,允许跳关 + if shixun.task_pass || game.status == 2 || identity <= User::EDU_CERTIFICATION_TEACHER + next_game + else + nil + end + end end diff --git a/app/controllers/homework_commons_controller.rb b/app/controllers/homework_commons_controller.rb index f92ed8e2e..29f270a34 100644 --- a/app/controllers/homework_commons_controller.rb +++ b/app/controllers/homework_commons_controller.rb @@ -113,6 +113,15 @@ class HomeworkCommonsController < ApplicationController else if @user_course_identity == Course::STUDENT @work = @homework.user_work(current_user.id) + # 学生访问列表时计算个人成绩 + if @homework.homework_type == "practice" + myshixun = Myshixun.find_by(shixun_id: @shixun.id, user_id: current_user.id) + if @work && myshixun + challenge_settings = @homework.homework_challenge_settings + games = myshixun.games.where(challenge_id: challenge_settings.pluck(:challenge_id)) + HomeworksService.new.update_myshixun_work_score @work, myshixun, games, @homework, challenge_settings + end + end # 学生已提交作品且补交(提交)已截止、作品公开、非匿评阶段 if @work&.work_status.to_i > 0 && (@homework.work_public || @homework.score_open) && diff --git a/app/controllers/myshixuns_controller.rb b/app/controllers/myshixuns_controller.rb index cdeca4871..fa47fd7f6 100644 --- a/app/controllers/myshixuns_controller.rb +++ b/app/controllers/myshixuns_controller.rb @@ -7,9 +7,9 @@ class MyshixunsController < ApplicationController ## TPI关卡列表 def challenges # @challenges = Challenge.where(shixun_id: params[:shixun_id]) - - @shixun_status = @myshixun.shixun.status + @shixun = @myshixun.shixun @games = @myshixun.games.includes(:challenge).reorder("challenges.position") + @identity = current_user.game_identity(@games.first) end @@ -42,7 +42,7 @@ class MyshixunsController < ApplicationController if e.message != "ActiveRecord::RecordInvalid" logger.error("######delete_repository_error:#{e.message}") end - raise ActiveRecord::Rollback + raise "delete_repository_error:#{e.message}" end end diff --git a/app/controllers/shixuns_controller.rb b/app/controllers/shixuns_controller.rb index 99cee4185..1c272e02d 100644 --- a/app/controllers/shixuns_controller.rb +++ b/app/controllers/shixuns_controller.rb @@ -3,6 +3,8 @@ class ShixunsController < ApplicationController include ApplicationHelper before_action :require_login, :check_auth, except: [:download_file, :index, :menus] + before_action :check_account, only: [:new, :create, :shixun_exec] + before_action :check_auth, except: [:download_file, :index, :menus] before_action :find_shixun, :shixun_access_allowed, except: [:index, :new, :create, :menus, :get_recommend_shixuns, @@ -716,7 +718,7 @@ class ShixunsController < ApplicationController logger.error("##########project_fork error #{e.message}") @current_task.destroy! end - raise ActiveRecord::Rollback + raise "实训云平台繁忙(繁忙等级:81)" end end end diff --git a/app/controllers/subjects_controller.rb b/app/controllers/subjects_controller.rb index 5cbb2a462..bc5b0a607 100644 --- a/app/controllers/subjects_controller.rb +++ b/app/controllers/subjects_controller.rb @@ -1,6 +1,7 @@ class SubjectsController < ApplicationController before_action :require_login, :check_auth, except: [:index] # before_action :check_auth, except: [:index] + before_action :check_account, only: [:new, :create] before_action :find_subject, except: [:index, :create, :new, :append_to_stage] before_action :allowed, only: [:update, :edit, :destroy, :publish, :cancel_publish, :cancel_has_publish, :search_members, :add_subject_members, :statistics, :shixun_report, :school_report, diff --git a/app/helpers/myshixuns_helper.rb b/app/helpers/myshixuns_helper.rb index 650f32f40..2a487e361 100644 --- a/app/helpers/myshixuns_helper.rb +++ b/app/helpers/myshixuns_helper.rb @@ -1,2 +1,14 @@ module MyshixunsHelper + + # 获取tpi的identifier, + # identity表示用户关卡的身份 + # task_pass: 实训是否允许跳关 + def get_game_identifier task_pass, game, game_identity + # 允许跳关、 关卡已经开启、 用户是已认证老师以上的身份 + if task_pass || game.status != 3 || game_identity <= User::EDU_CERTIFICATION_TEACHER + game.identifier + else + nil + end + end end diff --git a/app/models/homework_common.rb b/app/models/homework_common.rb index ac64b92c1..9aa4a8fe1 100644 --- a/app/models/homework_common.rb +++ b/app/models/homework_common.rb @@ -35,7 +35,7 @@ class HomeworkCommon < ApplicationRecord has_many :homework_review_results, :dependent => :destroy validates :name, length: { maximum: 60 } - validates :description, length: { maximum: 5000 } + validates :description, length: { maximum: 15000 } validates :reference_answer, length: { maximum: 5000 } # after_update :update_activity diff --git a/app/models/shixun.rb b/app/models/shixun.rb index e35f9f1a6..82f689e3f 100644 --- a/app/models/shixun.rb +++ b/app/models/shixun.rb @@ -4,6 +4,7 @@ class Shixun < ApplicationRecord # status: 0:编辑 1:申请发布 2:正式发布 3:关闭 -1:软删除 # hide_code: 隐藏代码窗口 # code_hidden: 隐藏代码目录 + # task_pass: 跳关 has_many :challenges, dependent: :destroy has_many :challenge_tags, through: :challenges has_many :myshixuns, :dependent => :destroy diff --git a/app/views/courses/search_users.json.jbuilder b/app/views/courses/search_users.json.jbuilder index d735de970..ac826fdf2 100644 --- a/app/views/courses/search_users.json.jbuilder +++ b/app/views/courses/search_users.json.jbuilder @@ -2,8 +2,8 @@ json.users do json.array! @users do |user| json.id user.id json.name user.real_name - json.student_id user.user_extension.try(:student_id) - json.school_name user.user_extension.school.name + json.student_id user&.student_id + json.school_name user&.school_name json.added @course.course_member?(user.id, 4) end end diff --git a/app/views/myshixuns/challenges.json.jbuilder b/app/views/myshixuns/challenges.json.jbuilder index 802c2b561..0be94d9fd 100644 --- a/app/views/myshixuns/challenges.json.jbuilder +++ b/app/views/myshixuns/challenges.json.jbuilder @@ -3,7 +3,7 @@ json.array! @games do |game| json.partial! 'challenges/challenge', locals: { challenge: challenge } json.status game.status json.star game.star - json.identifier game.identifier - json.get_gold game.user_get_gold_and_experience(@shixun_status, challenge)[0] - json.get_experience game.user_get_gold_and_experience(@shixun_status, challenge)[1] + json.identifier get_game_identifier(@shixun.task_pass, game, @identity) + json.get_gold game.user_get_gold_and_experience(@shixun.status, challenge)[0] + json.get_experience game.user_get_gold_and_experience(@shixun.status, challenge)[1] end \ No newline at end of file diff --git a/app/views/users/get_user_info.json.jbuilder b/app/views/users/get_user_info.json.jbuilder index 164c943d0..d9eb736ad 100644 --- a/app/views/users/get_user_info.json.jbuilder +++ b/app/views/users/get_user_info.json.jbuilder @@ -7,6 +7,7 @@ json.is_teacher @user.user_extension&.teacher? json.user_identity @user.identity json.tidding_count 0 json.user_phone_binded @user.phone.present? +json.profile_completed @user.profile_completed? if @course json.course_identity @course_identity json.course_name @course.name diff --git a/db/migrate/20190726082937_add_is_md_for_homeworks.rb b/db/migrate/20190726082937_add_is_md_for_homeworks.rb new file mode 100644 index 000000000..0b25dde97 --- /dev/null +++ b/db/migrate/20190726082937_add_is_md_for_homeworks.rb @@ -0,0 +1,12 @@ +class AddIsMdForHomeworks < ActiveRecord::Migration[5.2] + def change + # add_column :homework_commons, :is_md, :boolean, :default => true + # add_column :homework_banks, :is_md, :boolean, :default => true + # + # + # add_column :exercise_questions,:is_md, :boolean, :default => true + # add_column :poll_questions,:is_md, :boolean, :default => true + # + # add_column :exercise_bank_questions, :is_md, :boolean, :default => true + end +end diff --git a/db/migrate/20190726083814_migrate_course_is_md.rb b/db/migrate/20190726083814_migrate_course_is_md.rb new file mode 100644 index 000000000..6988db14a --- /dev/null +++ b/db/migrate/20190726083814_migrate_course_is_md.rb @@ -0,0 +1,14 @@ +class MigrateCourseIsMd < ActiveRecord::Migration[5.2] + def change + # HomeworkCommon.where(homework_type: [1, 3]).where("created_at < '2019-07-21 00:00:00'").update_all(is_md: false) + # HomeworkBank.where(homework_type: [1, 3]).where("created_at < '2019-07-21 00:00:00'").update_all(is_md: false) + # + # HomeworkCommon.where(homework_type: [1, 3]).where("created_at >= '2019-07-21 00:00:00' and homework_bank_id is not null").each do |homework| + # + # end + # + # ExerciseQuestion.where("created_at < '2019-07-21 00:00:00'").update_all(is_md: false) + # PollQuestion.where("created_at < '2019-07-21 00:00:00'").update_all(is_md: false) + # ExerciseBankQuestion.where("created_at < '2019-07-21 00:00:00'").update_all(is_md: false) + end +end diff --git a/public/react/src/App.js b/public/react/src/App.js index 191b0f0c8..49dac07cd 100644 --- a/public/react/src/App.js +++ b/public/react/src/App.js @@ -18,6 +18,9 @@ import Notcompletedysl from './modules/user/Notcompletedysl'; import Trialapplicationysl from './modules/login/Trialapplicationysl'; import Trialapplicationreview from './modules/user/Trialapplicationreview'; import Addcourses from "./modules/courses/coursesPublic/Addcourses"; +import AccountProfile from"./modules/user/AccountProfile"; + + import Trialapplication from './modules/login/Trialapplication' import NotFoundPage from './NotFoundPage' @@ -278,6 +281,7 @@ class App extends Component { + {/*{*/} {/* isRender === true?*/} {/* : ""*/} diff --git a/public/react/src/common/TextUtil.js b/public/react/src/common/TextUtil.js index bd524c4a9..82a848cac 100644 --- a/public/react/src/common/TextUtil.js +++ b/public/react/src/common/TextUtil.js @@ -6,28 +6,30 @@ export function isImageExtension(fileName) { export function markdownToHTML(oldContent, selector) { window.$('#md_div').html('') // markdown to html - try { + if (selector && oldContent && oldContent.startsWith(' { + if (this.props.delay == true) { + (function(content, selector) { + // console.log('selector: ', selector) + setTimeout(() => { + markdownToHTML(content, selector) + }, 600) + })(content, selector) + } else { + markdownToHTML(content, selector) + } + } componentDidUpdate = (prevProps) => { if (this.props.content) { if ( prevProps.content != this.props.content ) { - 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 && 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 return( -
) diff --git a/public/react/src/modules/courses/busyWork/CommonWorkQuestion.js b/public/react/src/modules/courses/busyWork/CommonWorkQuestion.js index 7932311b1..49f1e5158 100644 --- a/public/react/src/modules/courses/busyWork/CommonWorkQuestion.js +++ b/public/react/src/modules/courses/busyWork/CommonWorkQuestion.js @@ -87,7 +87,7 @@ class CommonWorkQuestion extends Component{ {/* 内容区 */}
- + { attachments && attachments.map((item) => { return (
diff --git a/public/react/src/modules/courses/common/CNotificationHOC.js b/public/react/src/modules/courses/common/CNotificationHOC.js index a74620764..4dfa25f0b 100644 --- a/public/react/src/modules/courses/common/CNotificationHOC.js +++ b/public/react/src/modules/courses/common/CNotificationHOC.js @@ -18,14 +18,22 @@ export function CNotificationHOC(options = {}) { } showNotification = (description, message = "提示", icon) => { - const data = { - message, - description - } - if (icon) { - data.icon = icon; - } - notification.open(data); + // const data = { + // message, + // description + // } + // if (icon) { + // data.icon = icon; + // } + // notification.open(data); + + notification.open({ + message:message, + description: description, + style: { + zIndex: 99999999 + }, + }); } bytesToSize = (bytes) => { diff --git a/public/react/src/modules/courses/coursesDetail/CoursesBanner.js b/public/react/src/modules/courses/coursesDetail/CoursesBanner.js index cc3646b9d..afe7b606a 100644 --- a/public/react/src/modules/courses/coursesDetail/CoursesBanner.js +++ b/public/react/src/modules/courses/coursesDetail/CoursesBanner.js @@ -4,6 +4,7 @@ import axios from 'axios'; import {getImageUrl, trigger, on, off} from 'educoder'; import { Tooltip, message,Popover} from 'antd'; import CoursesListType from '../coursesPublic/CoursesListType'; +import AccountProfile from"../../user/AccountProfile"; import Addcourses from '../coursesPublic/Addcourses'; import '../css/Courses.css'; import Modals from "../../modals/Modals"; @@ -88,6 +89,13 @@ class CoursesBanner extends Component { } tojoinclass = (val) => { + if(this.props.current_user&&this.props.current_user.profile_completed===false){ + this.setState({ + AccountProfiletype:true + }) + return + } + if (val === 1) { this.setState({ Addcoursestypes: true, @@ -326,15 +334,30 @@ class CoursesBanner extends Component { postsettings=()=>{ window.location.href = "/courses/" + this.props.match.params.coursesId + "/settings"; } + + + hideAccountProfile=()=>{ + this.setState({ + AccountProfiletype:false + }) + } + render() { - let { Addcoursestypes, coursedata, modalsType, modalsTopval, loadtype,modalsBottomval,antIcon,is_guide} = this.state; + let { Addcoursestypes, coursedata, modalsType, modalsTopval, loadtype,modalsBottomval,antIcon,is_guide,AccountProfiletype} = this.state; return (
{ is_guide && } - + + {AccountProfiletype===true?this.hideAccountProfile()} + {...this.state} + {...this.props} + />:""} + + { coursedata === undefined || coursedata.status===401?
:
diff --git a/public/react/src/modules/courses/coursesPublic/Addcourses.js b/public/react/src/modules/courses/coursesPublic/Addcourses.js index 922c68650..8225907b8 100644 --- a/public/react/src/modules/courses/coursesPublic/Addcourses.js +++ b/public/react/src/modules/courses/coursesPublic/Addcourses.js @@ -38,7 +38,6 @@ class Addcourses extends Component{ } return response; }, (error) => { - //TODO 这里如果样式变了会出现css不加载的情况 }); diff --git a/public/react/src/modules/courses/css/Courses.css b/public/react/src/modules/courses/css/Courses.css index e214bd81d..f8d0ec76c 100644 --- a/public/react/src/modules/courses/css/Courses.css +++ b/public/react/src/modules/courses/css/Courses.css @@ -1560,9 +1560,28 @@ input.ant-input-number-input:focus { border-radius: 5px; } -.ant-modal-wrap{ - overflow: hidden; +@media screen and (min-width: 1400px) { + .ant-modal-wrap{ + overflow: hidden; + } +} +/* 设置了浏览器宽度不小于1201px时 abc 显示1200px宽度 */ + +@media screen and (max-width: 1400px) { + +} +/* 设置了浏览器宽度不大于1200px时 abc 显示900px宽度 */ + +@media screen and (max-width: 900px) { + +} +/* 设置了浏览器宽度不大于900px时 abc 显示200px宽度 */ + +@media screen and (max-width: 500px) { + } +/* 设置了浏览器宽度不大于500px时 abc 显示100px宽度 */ + /* 试卷答题 */ .stageTable .ant-table-tbody tr:last-child td,.stageTable .ant-table-thead > tr > th{ diff --git a/public/react/src/modules/courses/exercise/new/MainDisplay.js b/public/react/src/modules/courses/exercise/new/MainDisplay.js index 73e5864d6..0581865d7 100644 --- a/public/react/src/modules/courses/exercise/new/MainDisplay.js +++ b/public/react/src/modules/courses/exercise/new/MainDisplay.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; @@ -68,10 +68,14 @@ class MainDisplay extends Component{ { standard_answer[0] &&
参考答案:
-
+ {/*
-
+
*/}
} diff --git a/public/react/src/modules/courses/exercise/new/NullDisplay.js b/public/react/src/modules/courses/exercise/new/NullDisplay.js index e61c1d2f7..eade97474 100644 --- a/public/react/src/modules/courses/exercise/new/NullDisplay.js +++ b/public/react/src/modules/courses/exercise/new/NullDisplay.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; @@ -108,8 +108,12 @@ class NullDisplay extends Component{ 答案(填空{index+1}):
{ answers.answer_text.map((item, itemIndex) => { - return {item} + return })} + {/* {item} */}
}) diff --git a/public/react/src/modules/courses/exercise/new/QestionDisplayHeader.js b/public/react/src/modules/courses/exercise/new/QestionDisplayHeader.js index d4a827a68..7b82b14b6 100644 --- a/public/react/src/modules/courses/exercise/new/QestionDisplayHeader.js +++ b/public/react/src/modules/courses/exercise/new/QestionDisplayHeader.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'; const { TextArea } = Input; const confirm = Modal.confirm; const $ = window.$ @@ -80,8 +80,13 @@ 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 13d1e838c..cbb6da827 100644 --- a/public/react/src/modules/courses/exercise/new/SingleDisplay.js +++ b/public/react/src/modules/courses/exercise/new/SingleDisplay.js @@ -7,7 +7,7 @@ import { } from 'antd'; import axios from 'axios' import QestionDisplayHeader from './QestionDisplayHeader' -import {getUrl, ActionBtn, markdownToHTML} from 'educoder'; +import {getUrl, ActionBtn, markdownToHTML, MarkdownToHtml} from 'educoder'; const { TextArea } = Input; const confirm = Modal.confirm; const $ = window.$ @@ -100,16 +100,22 @@ class SingleDisplay extends Component{ return (
{prefix} - + + {/* */}
) } else { return (
{prefix} - + + {/* */}
) } })} diff --git a/public/react/src/modules/courses/new/CoursesNew.js b/public/react/src/modules/courses/new/CoursesNew.js index b620ba0c3..0114f564c 100644 --- a/public/react/src/modules/courses/new/CoursesNew.js +++ b/public/react/src/modules/courses/new/CoursesNew.js @@ -78,6 +78,12 @@ class CoursesNew extends Component { console.log(error); }) }else{ + let url = "/courses/new.json" + axios.get(url).then((result) => { + console.log(result) + }).catch((error) => { + console.log(error); + }) // console.log(user_school); this.props.form.setFieldsValue({ school:user_school, @@ -302,7 +308,7 @@ class CoursesNew extends Component { if(value!=""){ this.props.form.setFieldsValue({ classroom:value, - course:value + // course:value }); this.Searchvalue(value) } @@ -312,7 +318,7 @@ class CoursesNew extends Component { handleChange=(value)=>{ this.props.form.setFieldsValue({ - course:value, + // course:value, classroom:value }) }; @@ -325,7 +331,8 @@ class CoursesNew extends Component { // fetching: true, // }); this.setState({ - fetching: true + fetching: true, + school: value }) this.getschool(value) } @@ -365,9 +372,13 @@ class CoursesNew extends Component { if (result.data.status===0) { this.setState({ searchlistscholl: result.data.school_names, - fetching: false - }) + }) + if(result.data.school_names.length!=0){ + this.setState({ + fetching: false + }) + } } }).catch((error)=>{ console.log(error) @@ -460,7 +471,7 @@ class CoursesNew extends Component { diff --git a/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js b/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js index 8bb2bbcfd..8ec2ffcbc 100644 --- a/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js +++ b/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js @@ -15,7 +15,8 @@ import { Pagination, Radio, Tooltip, - notification + notification, + Spin, } from "antd"; import './style.css'; import 'moment/locale/zh-cn'; @@ -2253,7 +2254,7 @@ class Listofworksstudentone extends Component { render() { let {columns,course_groupysls,datajs,isAdmin, course_groupyslstwo, unlimited, unlimitedtwo, course_group_info, orders, task_status, checkedValuesine, searchtext, teacherlist, visible,visibles, game_list,columnsstu, limit,experience, boolgalist,viewtrainingdata, teacherdata, page, data, jobsettingsdata, styletable, datas, order, loadingstate,computeTimetype} = this.state; - + const antIcon = ; // console.log(this.state.student_works); // console.log("841"); // console.log(this.state.columns); @@ -2384,13 +2385,16 @@ class Listofworksstudentone extends Component { background:#EDEDED; cursor: pointer; } - + .shixunSpin{ + color:#FF6801; + margin-right: 10px; + } `} {computeTimetype===false?
  • + - 正在执行成绩计算,请稍后刷新页面查看结果 - 温馨提示:执行时间因作品数量而异 + 正在执行成绩计算,完成后将为您自动刷新结果。温馨提示:执行时间因作品数量而异
  • :""} @@ -2630,10 +2634,10 @@ class Listofworksstudentone extends Component {
    - - + {computeTimetype===false?
  • + - 正在执行成绩计算,请稍后刷新页面查看结果 - 温馨提示:执行时间因作品数量而异 + 正在执行成绩计算,完成后将为您自动刷新结果。温馨提示:执行时间因作品数量而异
  • :""} @@ -2774,12 +2785,20 @@ class Listofworksstudentone extends Component {
    - + {computeTimetype===false?
  • + - 正在执行成绩计算,请稍后刷新页面查看结果 - 温馨提示:执行时间因作品数量而异 + 正在执行成绩计算,完成后将为您自动刷新结果。温馨提示:执行时间因作品数量而异
  • :""} diff --git a/public/react/src/modules/courses/shixunHomework/ShixunStudentWork.js b/public/react/src/modules/courses/shixunHomework/ShixunStudentWork.js index 0c808e01d..4bb44b697 100644 --- a/public/react/src/modules/courses/shixunHomework/ShixunStudentWork.js +++ b/public/react/src/modules/courses/shixunHomework/ShixunStudentWork.js @@ -23,7 +23,8 @@ import { Radio, Tooltip, notification, - Pagination + Pagination, + Spin, } from "antd"; import {Link, Switch, Route, Redirect} from 'react-router-dom'; import axios from 'axios'; @@ -653,7 +654,7 @@ class ShixunStudentWork extends Component { ) } - + const antIcon = ; return (
    {this.state.showmodel===true?
  • + - 正在执行查重,请稍后刷新页面查看结果 温馨提示:执行时间因查重作品数以及作品的代码量而异 + 正在执行查重,完成后将为您自动刷新结果。 温馨提示:执行时间因查重作品数以及作品的代码量而异
  • diff --git a/public/react/src/modules/login/LoginDialog.js b/public/react/src/modules/login/LoginDialog.js index d3df6090e..50038366d 100644 --- a/public/react/src/modules/login/LoginDialog.js +++ b/public/react/src/modules/login/LoginDialog.js @@ -13,6 +13,7 @@ import axios from 'axios'; import './LoginDialog.css'; import { broadcastChannelPostMessage } from 'educoder' +import Notcompletedysl from "../user/Notcompletedysl"; const $ = window.$; var wait = 60; @@ -100,6 +101,7 @@ class LoginDialog extends Component { authCodeType:true, authCodeclass:'log-botton mt5', isRender: false, + MyEduCoderModals:false, }; } @@ -365,11 +367,9 @@ class LoginDialog extends Component { description:response.data.message, }); }else{ - if(response.data.identity === null || response.data.identity === undefined){ - this.props.history.push("/interesse"); - return; - } - broadcastChannelPostMessage('refreshPage') + + + broadcastChannelPostMessage('refreshPage') this.setState({ isRender:false }) @@ -388,17 +388,28 @@ class LoginDialog extends Component { console.log(error) }) - } + }; + setNotcompleteds=()=>{ + this.setState({ + Notcompleteds:true, + MyEduCoderModals:false + }) + }; + setMyEduCoderModals=()=>{ + this.setState({ + MyEduCoderModals:true + }) + }; onKeydowns=(e)=>{ let {disabled}=this.state; if( disabled===false&& e.keyCode === 13){ this.loginEDU() console.log(1) } - } + }; getloginurl=(url)=>{ window.location.href = url; - } + }; render() { let{open,login,speedy,loginValue,regular,isGoing,isGoingValue,disabled,bottonclass, dialogBox,shortcutnum,disabledType,gaincode,authCodeType,authCodeclass, isRender}=this.state; @@ -414,6 +425,10 @@ class LoginDialog extends Component { disableBackdropClick={true} onClose={() => this.handleDialogClose()} > + {this.setNotcompleteds()}} + /> {isRender===true?
    {this.handleDialogClose()}}> diff --git a/public/react/src/modules/page/Header.js b/public/react/src/modules/page/Header.js index 05cb62743..1c24b6a52 100644 --- a/public/react/src/modules/page/Header.js +++ b/public/react/src/modules/page/Header.js @@ -100,7 +100,8 @@ class Header extends Component { {/**/} - { grade === 0 ? grade : (grade || '')} + {/* href={`${user.user_url}/user_grade`} target="_blank" */} + { grade === 0 ? grade : (grade || '')}
    } diff --git a/public/react/src/modules/page/component/monaco/TPIMonaco.js b/public/react/src/modules/page/component/monaco/TPIMonaco.js index 2ebdb5eab..26f020586 100644 --- a/public/react/src/modules/page/component/monaco/TPIMonaco.js +++ b/public/react/src/modules/page/component/monaco/TPIMonaco.js @@ -320,20 +320,23 @@ class TPIMonaco extends Component { editor.focus(); }, 600) - + window.editor_monaco.addCommand(monaco.KeyMod.CtrlCmd | monaco.KeyCode.KEY_S, () => { + this.props.doFileUpdateRequestOnCodeMirrorBlur(); + return false; + }); }) - window.document.onkeydown = (e) => { - e = window.event || e; - if(e.keyCode== 83 && e.ctrlKey){ - /*延迟,兼容FF浏览器 */ - // setTimeout(function(){ - // alert('ctrl+s'); - // },1); - this.props.doFileUpdateRequestOnCodeMirrorBlur(); - return false; - } - }; + // window.document.onkeydown = (e) => { + // e = window.event || e; + // if(e.keyCode== 83 && e.ctrlKey){ + // /*延迟,兼容FF浏览器 */ + // // setTimeout(function(){ + // // alert('ctrl+s'); + // // },1); + // this.props.doFileUpdateRequestOnCodeMirrorBlur(); + // return false; + // } + // }; } onFontSizeChange = (value) => { toStore('cmFontSize', value) diff --git a/public/react/src/modules/paths/PathDetail/DetailCards.js b/public/react/src/modules/paths/PathDetail/DetailCards.js index fc75961ec..19894e856 100644 --- a/public/react/src/modules/paths/PathDetail/DetailCards.js +++ b/public/react/src/modules/paths/PathDetail/DetailCards.js @@ -1,14 +1,14 @@ import React, { Component } from 'react'; import {getImageUrl} from 'educoder'; import {Tooltip,Modal,Icon,Spin,message} from 'antd'; -import '../../paths/ShixunPaths.css'; import DetailCardsEditAndAdd from './DetailCardsEditAndAdd'; import DetailCardsEditAndEdit from './DetailCardsEditAndEdit'; +import AccountProfile from"../../user/AccountProfile"; import { BrowserRouter as Router, Route, Link } from "react-router-dom"; import axios from 'axios'; import { DragDropContext , Draggable, Droppable} from 'react-beautiful-dnd'; import Modals from '../../modals/Modals'; - +import '../../paths/ShixunPaths.css'; const $ = window.$ // // //a little function to help us with reordering the result @@ -193,7 +193,12 @@ class DetailCards extends Component{ } startgameid=(id)=>{ - + if(this.props.current_user&&this.props.current_user.profile_completed===false){ + this.setState({ + AccountProfiletype:true + }) + return + } let url = "/shixuns/" + id + "/shixun_exec.json"; axios.get(url).then((response) => { @@ -292,10 +297,16 @@ class DetailCards extends Component{ startshixunCombattype:false }) } - render(){ + hideAccountProfile=()=>{ + this.setState({ + AccountProfiletype:false + }) + } + + render(){ let { pathCardsList, dropid, - dropidtype, + AccountProfiletype, idsum, pathCardsedittype, pathlistedit, @@ -317,6 +328,12 @@ class DetailCards extends Component{ return(
    + {AccountProfiletype===true?this.hideAccountProfile()} + {...this.state} + {...this.props} + />:""} + {ChooseShixunList && ChooseShixunList.shixuns_count} 个实训 -
    +
    {ChooseShixunList && ChooseShixunList.shixuns_count} 个实训 -
    +
    { + console.log(result) + }).catch((error) => { + console.log(error); + }) + + let pathId = this.props.match.params.pathId; if (pathId) { this.isEditPage = true diff --git a/public/react/src/modules/tpm/NewHeader.js b/public/react/src/modules/tpm/NewHeader.js index 94319a819..b89d59fe7 100644 --- a/public/react/src/modules/tpm/NewHeader.js +++ b/public/react/src/modules/tpm/NewHeader.js @@ -1,7 +1,7 @@ import React, { Component } from 'react'; import { BrowserRouter as Router, Route, Link } from "react-router-dom"; import { Redirect } from 'react-router'; - +import AccountProfile from"../user/AccountProfile"; import PropTypes from 'prop-types'; // import searchImg from '../../../../images/educoder/icon/search.svg' @@ -182,7 +182,15 @@ class NewHeader extends Component { }) return; } - this.setState({ + + if(user&&user.profile_completed===false){ + this.setState({ + AccountProfiletype:true + }) + return; + } + + this.setState({ Addcoursestypes:true, }) } @@ -201,7 +209,15 @@ class NewHeader extends Component { }) return; } - this.setState({ + + if(user&&user.profile_completed===false){ + this.setState({ + AccountProfiletype:true + }) + return; + } + + this.setState({ tojoinitemtype:true }) } @@ -527,24 +543,36 @@ submittojoinclass=(value)=>{ } //头部获取是否已经登录了 getUser=(url)=>{ - console.log("点击了503") - console.log(url); + // console.log("点击了503") + // console.log(url); let{user} =this.state; + if(user===undefined){ this.setState({ isRender:true }) return } + if(user&&user.login===""){ this.setState({ isRender:true }) return; } + + if(user&&user.profile_completed===false){ + this.setState({ + AccountProfiletype:true + }) + return; + } + if(url !== undefined || url!==""){ window.location.href = url; } + + } //修改登录方法 @@ -554,6 +582,12 @@ submittojoinclass=(value)=>{ }) } + hideAccountProfile=()=>{ + this.setState({ + AccountProfiletype:false + }) + } + render() { const isLogin = true; // 这里不会出现未登录的情况,服务端在服务端路由时发现如果是未登录,则跳转到登录页了。 const {match ,} = this.props; @@ -568,7 +602,7 @@ submittojoinclass=(value)=>{ Checkboxteachingtype, code_notice, checked_notice, - RadioGroupvalue, + AccountProfiletype, submitapplications, submitapplicationsvalue, user, @@ -610,6 +644,12 @@ submittojoinclass=(value)=>{ {...this.props} />:""} + {AccountProfiletype===true?this.hideAccountProfile()} + {...this.state} + {...this.props} + />:""} +
    {/*<%= link_to image_tag("/images/educoder/logo.png", alt:"高校智能化教学与实训平台", className:"logoimg"), home_path %>*/} diff --git a/public/react/src/modules/tpm/TPMBanner.js b/public/react/src/modules/tpm/TPMBanner.js index 5efadc1d1..33dc7fc5b 100644 --- a/public/react/src/modules/tpm/TPMBanner.js +++ b/public/react/src/modules/tpm/TPMBanner.js @@ -8,6 +8,8 @@ import PropTypes from 'prop-types'; import {Modal,Input,Radio,Pagination,message,Spin,Icon,Tooltip} from 'antd'; +import AccountProfile from"../user/AccountProfile"; + import 'antd/lib/pagination/style/index.css'; import axios from 'axios' @@ -381,6 +383,14 @@ class TPMBanner extends Component { //开始实战按钮 startshixunCombat=(id, reset)=>{ + + if(this.props.current_user&&this.props.current_user.profile_completed===false){ + this.setState({ + AccountProfiletype:true + }) + return + } + let {shixunsDetails} = this.props if( shixunsDetails.shixun_status>1){ this.setState({ @@ -455,7 +465,11 @@ class TPMBanner extends Component { }) } - + hideAccountProfile=()=>{ + this.setState({ + AccountProfiletype:false + }) + } render() { let { @@ -480,7 +494,7 @@ class TPMBanner extends Component { shixunsreplace, hidestartshixunsreplacevalue, Forkvisibletype, - Senttothevcaluetype, + AccountProfiletype, isIE} = this.state; let {shixunsDetails, shixunId, star_info, star_infos} = this.props; let challengeBtnTipText = ''; @@ -555,6 +569,13 @@ class TPMBanner extends Component {
    + {AccountProfiletype===true?this.hideAccountProfile()} + {...this.state} + {...this.props} + />:""} + + {this.state.Modalstype===true?{ + getfilepath=(e,shixunfilepath,type)=>{ this.setState({ evaluationvisible: true, selectpath:e.target.value, selectpatharr:[], + pathtype:type }); let id = this.props.match.params.shixunId; let url ="/shixuns/"+id+"/repository.json"; @@ -283,9 +284,9 @@ export default class TPMevaluation extends Component { }); } - sendgetfilepath=(newpath,type)=>{ + sendgetfilepath=(newpath,type,newpathtype)=>{ let id = this.props.match.params.shixunId; - let{path,main}=this.state; + let{path,main,pathtype}=this.state; let ary=main; let paths=path; @@ -329,10 +330,18 @@ export default class TPMevaluation extends Component { }); } + if(pathtype===2){ + this.setState({ + selectpath: newpathtype, + }) + } } goblakepath=(path,key)=>{ - let {main,selectpath} =this.state; + let {main,selectpath,pathtype} =this.state; + + + let newmain=[] for(var i=0;i<=key;i++){ newmain.push(main[i]) @@ -355,6 +364,17 @@ export default class TPMevaluation extends Component { }).catch((error) => { console.log(error) }); + + if(pathtype===2){ + // var str=path; + // str.slice(0,str.length-1) + // debugger + // console.log(str) + this.setState({ + selectpath: path, + }) + } + } // delesavegetfilepath=(value)=>{ // let {selectpatharr} = this.state @@ -381,7 +401,36 @@ export default class TPMevaluation extends Component { // }) // } savegetfilepath=(value)=>{ - let {selectpath,saveshixunfilepath} = this.state + let {selectpath,saveshixunfilepath,pathtype} = this.state + + if(pathtype===1){ + let newselectpath; + + if(saveshixunfilepath==="shixunfilepathplay"){ + newselectpath=value + }else{ + const type = selectpath.split(';'); + let types=false; + for(var i=0; i{ @@ -650,9 +675,10 @@ export default class TPMevaluation extends Component { selectpath:e.target.value }) } - updatepath=(e,name)=>{ + updatepath=(e,name,type)=>{ this.setState({ - [name]:e.target.value + [name]:e.target.value, + pathtype:type }) } @@ -818,8 +844,8 @@ export default class TPMevaluation extends Component { placeholder="请选择版本库中的代码文件。例: src/step1/HelloWorld.java" value={shixunfilepath} style={{ width:StudentTaskPapers===true?'100%':""}} - onInput={(e)=>this.updatepath(e,"shixunfilepath")} - onClick={(e)=>this.getfilepath(e,"shixunfilepath")} + onInput={(e)=>this.updatepath(e,"shixunfilepath",1)} + onClick={(e)=>this.getfilepath(e,"shixunfilepath",1)} />

    该文件将直接显示给学生,需要学生在其中填写代码

    @@ -844,7 +870,7 @@ export default class TPMevaluation extends Component { { main.length===0?"":main.map((item,key)=>{ return( -
    this.goblakepath(item.path,key)}>{item.val} + this.goblakepath(item.path,key,item)}>{item.val} ) }) } @@ -853,7 +879,7 @@ export default class TPMevaluation extends Component { return(
  • { - item.type==="tree"?this.sendgetfilepath(item.name,item.type)} data-remote="true"> + item.type==="tree"?this.sendgetfilepath(item.name,item.type,path+item.name)} data-remote="true"> {path+item.name}: @@ -873,7 +899,7 @@ export default class TPMevaluation extends Component {
    this.saveselectpath(e)} value={selectpath}/>
    @@ -897,8 +923,8 @@ export default class TPMevaluation extends Component { placeholder="请选择版本库中的代码文件。例:src/step1/HelloWorldTest.java" value={shixunfilepathplay} style={{width:StudentTaskDocs===true?'100%':""}} - onInput={(e)=>this.updatepath(e,"shixunfilepathplay")} - onClick={(e)=>this.getfilepath(e,"shixunfilepathplay")} + onInput={(e)=>this.updatepath(e,"shixunfilepathplay",1)} + onClick={(e)=>this.getfilepath(e,"shixunfilepathplay",1)} />

    该文件由平台执行,用来测试平台学员代码是否正确

    @@ -958,8 +984,8 @@ export default class TPMevaluation extends Component { id="shixun_file_expect_picture_path" name="challenge[original_picture_path]" placeholder="请选择版本库中存储了待处理图片的路径。例:src/step1/expectedimages" value={shixunfileexpectpicturepath} - onInput={(e)=>this.updatepath(e,"shixunfileexpectpicturepath")} - onClick={(e)=>this.getfilepath(e,"shixunfileexpectpicturepath")} + onInput={(e)=>this.updatepath(e,"shixunfileexpectpicturepath",2)} + onClick={(e)=>this.getfilepath(e,"shixunfileexpectpicturepath",2)} />

    该路径下的文件将在学员评测本关任务时,作为原始图片显示在查看效果页,供学员参考,任务为图片处理时请指定该路径,并注意与程序文件所在文件夹分开 @@ -980,8 +1006,8 @@ export default class TPMevaluation extends Component { id="shixun_file_standard_picture_path" name="challenge[expect_picture_path]" placeholder="请选择版本库中存储了标准答案代码输出文件的路径。例:src/step1/expectedimages" value={shixunfilestandardpicturepath} - onInput={(e)=>this.updatepath(e,"shixunfilestandardpicturepath")} - onClick={(e)=>this.getfilepath(e,"shixunfilestandardpicturepath")} + onInput={(e)=>this.updatepath(e,"shixunfilestandardpicturepath",2)} + onClick={(e)=>this.getfilepath(e,"shixunfilestandardpicturepath",2)} />

    该路径下的文件将在学员评测本关任务时,作为参考答案显示在查看效果页,供学员参考任务输出结果为文件时请指定该路径,并注意与程序文件所在文件夹分开 @@ -1001,8 +1027,8 @@ export default class TPMevaluation extends Component { this.updatepath(e,"shixunfilepicturepath")} - onClick={(e)=>this.getfilepath(e,"shixunfilepicturepath")} + onInput={(e)=>this.updatepath(e,"shixunfilepicturepath",2)} + onClick={(e)=>this.getfilepath(e,"shixunfilepicturepath",2)} placeholder="请在版本库中指定用来保存学员代码实际输出结果的路径。例:src/step1/outputimages"/>

    学员评测本关任务时生成的文件将保存在该路径下,并作为实际输出显示在查看效果页,供学员确认任务输出结果为文件时请指定该路径,并注意与程序文件所在文件夹分开 diff --git a/public/react/src/modules/tpm/newshixuns/Newshixuns.js b/public/react/src/modules/tpm/newshixuns/Newshixuns.js index 346be3351..f9c8f5b10 100644 --- a/public/react/src/modules/tpm/newshixuns/Newshixuns.js +++ b/public/react/src/modules/tpm/newshixuns/Newshixuns.js @@ -743,10 +743,12 @@ class Newshixuns extends Component { onChangeTimePicker = (value, dateString) => { this.setState({ - TimePickervalue: handleDateStrings(dateString) + TimePickervalue: moment(handleDateStrings(dateString)) }) } - // 附件相关 START + + + // 附件相关 START handleChange = (info) => { console.log("handleChange1"); let fileList = info.fileList; @@ -1279,13 +1281,14 @@ class Newshixuns extends Component {

  • diff --git a/public/react/src/modules/tpm/shixunchild/Challenges/Challenges.js b/public/react/src/modules/tpm/shixunchild/Challenges/Challenges.js index 65e95319e..c710d4b8c 100644 --- a/public/react/src/modules/tpm/shixunchild/Challenges/Challenges.js +++ b/public/react/src/modules/tpm/shixunchild/Challenges/Challenges.js @@ -20,6 +20,8 @@ import '../shixunchildCss/Challenges.css' import axios from 'axios'; +import AccountProfile from"../../../user/AccountProfile"; + const $ = window.$; class Challenges extends Component { @@ -218,7 +220,14 @@ class Challenges extends Component { //开始实战按钮 startshixunCombat = (type, ids, id) => { - + if(this.props.current_user&&this.props.current_user.profile_completed===false){ + this.setState({ + AccountProfiletype:true + }) + return + } + + debugger let { ChallengesDataList } = this.state; // let id = this.props.match.params.shixunId; this.setState({ @@ -271,8 +280,15 @@ class Challenges extends Component { startshixunCombattype:false }) } + + hideAccountProfile=()=>{ + this.setState({ + AccountProfiletype:false + }) + } + render() { - let { ChallengesDataList, startbtns, sumidtype ,startshixunCombattype,shixunsreplace,shixunsmessage,hidestartshixunsreplacevalue,operationstrue} = this.state; + let { ChallengesDataList, startbtns, sumidtype ,startshixunCombattype,shixunsreplace,shixunsmessage,hidestartshixunsreplacevalue,operationstrue,AccountProfiletype} = this.state; let { loadingContent } = this.props; if (ChallengesDataList != undefined) { this.updatamakedown("ReactMarkdown") @@ -281,6 +297,12 @@ class Challenges extends Component { const antIcon = ; return ( + {AccountProfiletype===true?this.hideAccountProfile()} + {...this.state} + {...this.props} + />:""} + {loadingContent ? { + if (response != undefined) + if (response && response.data.status === 402) { + this.setState({ + AccountProfiletype: true + }) + + } + return response; + }, (error) => { + + }); + + } + + gotoback=()=>{ + if(this.props.AccountProfiletype!=undefined){ + this.setState({ + AccountProfiletype:false + }) + this.props.hideAccountProfile() + }else{ + window.location.href="/"; + this.setState({ + AccountProfiletype:false + }) + } + } + + + +render() { + return( + + + + ) + } +} + +export default AccountProfile; \ No newline at end of file diff --git a/public/react/src/modules/user/FindPasswordComponent.js b/public/react/src/modules/user/FindPasswordComponent.js index 408ca6142..b2e89da52 100644 --- a/public/react/src/modules/user/FindPasswordComponent.js +++ b/public/react/src/modules/user/FindPasswordComponent.js @@ -691,7 +691,7 @@ class LoginRegisterComponent extends Component { this.inputOnBlurzhuche(e)} + // onBlur={(e) => this.inputOnBlurzhuche(e)} onChange={this.loginInputonChange} style={{marginTop: '10px', height: "38px"}}> { Phonenumberisnotco && Phonenumberisnotco !== "" ? diff --git a/public/react/src/modules/user/LoginRegisterComponent.js b/public/react/src/modules/user/LoginRegisterComponent.js index 1377298a9..3f54149bf 100644 --- a/public/react/src/modules/user/LoginRegisterComponent.js +++ b/public/react/src/modules/user/LoginRegisterComponent.js @@ -340,10 +340,10 @@ class LoginRegisterComponent extends Component { } - if(response.data.identity === null || response.data.identity === undefined){ - this.props.history.push("/interesse"); - return; - } + // if(response.data.profile_completed !== null || response.data.profile_completed === false){ + // this.setMyEduCoderModals(); + // return; + // } if (response.status === 200) { if (response.data.status === 402) { @@ -458,13 +458,13 @@ class LoginRegisterComponent extends Component { return; } }else { - this.setState({ - logins: "", - dragOk: false, - codes: "", - passwords: "", - Agreetotheterms: "", - }) + // this.setState({ + // logins: "", + // dragOk: false, + // codes: "", + // passwords: "", + // Agreetotheterms: "", + // }) this.setMyEduCoderModals(); } } @@ -1028,7 +1028,7 @@ class LoginRegisterComponent extends Component { value={this.state.logins} type="text" autoComplete="off" onChange={this.loginInputonChanges} - onBlur={(e) => this.inputOnBlurzhuche(e, 2)} + // onBlur={(e) => this.inputOnBlurzhuche(e, 2)} style={{marginTop: '30px' , height: '38px',color:'#999999',fontSize:"14px"}}> { Phonenumberisnotcos && Phonenumberisnotcos !== "" ? @@ -1038,10 +1038,10 @@ class LoginRegisterComponent extends Component { :
    } - {this.setNotcompleteds()}} - /> + />:""} { Whethertoverify===false&&pciphone===true? diff --git a/public/react/src/modules/user/Notcompletedysl.js b/public/react/src/modules/user/Notcompletedysl.js index cc7a78e13..fc70f838e 100644 --- a/public/react/src/modules/user/Notcompletedysl.js +++ b/public/react/src/modules/user/Notcompletedysl.js @@ -16,24 +16,28 @@ class Notcompletedysl extends Component { // console.log("Notcompletedysl"); // console.log("开发了402了"); - axios.interceptors.response.use((response) => { - // console.log(response); - if (response != undefined) - if (response && response.data.status === 402) { - this.setState({ - modalsType: true - }) - } - return response; - }, (error) => { - //TODO 这里如果样式变了会出现css不加载的情况 - - }); + // axios.interceptors.response.use((response) => { + // // console.log(response); + // if (response != undefined) + // if (response && response.data.status === 402) { + // this.setState({ + // modalsType: true + // }) + // } + // return response; + // }, (error) => { + // //TODO 这里如果样式变了会出现css不加载的情况 + // + // }); } modalCancel=()=>{ - window.location.href = "/"; + var weekArray = JSON.parse(window.sessionStorage.getItem('yslgeturls')); + if(weekArray===undefined){ + weekArray="/"; + } + window.location.href = weekArray; } setDownload=()=>{ @@ -51,15 +55,14 @@ class Notcompletedysl extends Component { destroyOnClose={true} title="提示" centered={true} - visible={this.state.modalsType} + visible={this.props.modalsType} width="530px" >
    -

    您尚未完善个人资料

    -

    请在完成资料后,提交试用申请

    +

    完善您的资料,将获得更多的使用权限

    diff --git a/public/react/src/modules/user/account/AccountBasicEdit.js b/public/react/src/modules/user/account/AccountBasicEdit.js index 82f7d60d8..a4637c00e 100644 --- a/public/react/src/modules/user/account/AccountBasicEdit.js +++ b/public/react/src/modules/user/account/AccountBasicEdit.js @@ -106,6 +106,8 @@ class AccountBasic extends Component { this.setState({ school_id, school: selectedName + }, () => { + this.filterList(selectedName) }) } else if(basicInfo && basicInfo.school_name){ this.setState({ @@ -199,7 +201,7 @@ class AccountBasic extends Component { } // 过滤学校 - filterList=(e)=>{ + filterList =(e)=>{ const inputVal = e.trim() let arr=[]; if(inputVal){ @@ -211,7 +213,7 @@ class AccountBasic extends Component { }) this.setState({ school: inputVal, - filterSchoolList:arr + filterSchoolList: arr }) } else { this.setState({ @@ -254,6 +256,7 @@ class AccountBasic extends Component { this.setState({ department_id: '', departmentsName: e, + filterDepartments: [], }) this.this_department_id = '' return; @@ -261,7 +264,7 @@ class AccountBasic extends Component { this.this_department_id = arr[0].id this.setState({ departmentsName:e, - department_id: arr[0].id + department_id: arr[0].id, }) } @@ -365,7 +368,6 @@ class AccountBasic extends Component { // this.setState({ schoolList }) this.getSchoolList(this.props.basicInfo, name); - this.props.form.setFieldsValue({ name: name }) @@ -400,6 +402,7 @@ class AccountBasic extends Component { filterDepartments, school, school_id, + departments, departmentsName, identity }=this.state; @@ -676,7 +679,7 @@ class AccountBasic extends Component { {!filterSchoolList || (filterSchoolList && filterSchoolList.length==0 )&& school && -
    +
    未找到包含“{school}”的高校, 申请新增 @@ -716,10 +719,12 @@ class AccountBasic extends Component { { - !filterDepartments || (filterDepartments && filterDepartments.length==0 )&& departmentsName && -
    + (!filterDepartments || (filterDepartments && filterDepartments.length==0 ) + || (departmentsName == '' && !this.state.department_id + && (!departments || departments.length == 0) )) && +
    - 未找到包含“{departmentsName}”的院系/部门, + {departmentsName ? `未找到包含“${departmentsName}”的院系/部门` : '未找到院系'}, 申请新增
    diff --git a/public/react/src/modules/user/modal/RealNameCertificationModal.js b/public/react/src/modules/user/modal/RealNameCertificationModal.js index bdd2270ae..1d17b7c20 100644 --- a/public/react/src/modules/user/modal/RealNameCertificationModal.js +++ b/public/react/src/modules/user/modal/RealNameCertificationModal.js @@ -132,7 +132,7 @@ class RealNameCertificationModal extends Component{ multiple: true, showUploadList: false, // https://newweb.educoder.net - action: `/api/users/accounts/${this.props.current_user.login}/auth_attachment.json`, + action: this.props.current_user ? `/api/users/accounts/${this.props.current_user.login}/auth_attachment.json` : '', className: 'idPic-uploader', onChange: this.handleChange2, }; diff --git a/public/react/src/modules/user/usersInfo/Infos.js b/public/react/src/modules/user/usersInfo/Infos.js index 42a713a88..3b58681da 100644 --- a/public/react/src/modules/user/usersInfo/Infos.js +++ b/public/react/src/modules/user/usersInfo/Infos.js @@ -239,14 +239,14 @@ class Infos extends Component{
    {is_current ? "我":"TA"}的经验值 - {data && data.experience}
    {is_current ? "我":"TA"}的金币 - {data && data.grade}
    @@ -255,14 +255,14 @@ class Infos extends Component{
    {is_current ? "我":"TA"}的粉丝 - {data && data.fan_count}
    {is_current ? "我":"TA"}的关注 - {data && data.follow_count}
    diff --git a/public/react/src/modules/user/usersInfo/InfosCourse.js b/public/react/src/modules/user/usersInfo/InfosCourse.js index 1623e9097..ff5321a9f 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 === "学生" || category) && + (!data || data.courses.length==0) && (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 a7b0b95f6..759527a6e 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 === "学生" || category) && + (!data || data.subjects.length==0) && (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 d308e0fd3..6c1f4a666 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 === "学生" || category) && + (!data || data.projects.length==0) && (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 7e911202e..bac60fe6f 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 === "学生" || category) && + (!data || data.shixuns.length==0) && (this.props.current_user && this.props.current_user.user_identity === "学生" ) && } { data && data.shixuns && data.shixuns.map((item,key)=>{