Merge branches 'dev_aliyun' and 'develop' of https://bdgit.educoder.net/Hjqreturn/educoder

dev_forum
杨树林 5 years ago
commit 8a416ee644

@ -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)

@ -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)
@ -434,12 +442,18 @@ class ApplicationController < ActionController::Base
shixun.shixun_service_configs.each do |config|
mirror = config.mirror_repository
if mirror.name.present?
# 资源限制没有就传默认值。
cpu_limit = config.cpu_limit.presence || 1
cpu_request = config.lower_cpu_limit.presence || 0.1
memory_limit = config.memory_limit.presence || 1024
request_limit = config.resource_limit.presence || 10
resource_limit = config.resource_limit.presence || 10000
container << {:image => mirror.name,
:cpuLimit => config.cpu_limit,
:cpuRequest => config.lower_cpu_limit,
:memoryLimit => "#{config.memory_limit}M",
:memoryRequest => "#{config.request_limit}M",
:resourceLimit => "#{config.resource_limit}K",
:cpuLimit => cpu_limit,
:cpuRequest => cpu_request,
:memoryLimit => "#{memory_limit}M",
:memoryRequest => "#{request_limit}M",
:resourceLimit => "#{resource_limit}K",
:type => mirror.try(:main_type) == "1" ? "main" : "sub"}
end
end

@ -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)
@ -1219,7 +1221,7 @@ class CoursesController < ApplicationController
@user_activity_level = []
course_user_level = []
course_activity_title = "课堂活跃度统计"
user_cell_head = %w(排名 真实姓名 登录名 邮箱 学号 分班 作业完成数(*10) 试卷完成数(*10) 问卷完成数(*7) 资源发布数(*5) 帖子发布数(*2) 帖子回复数(*1) 作业回复数(*1) 活跃度)
user_cell_head = %w(排名 真实姓名 登录名 邮箱 学号 学校 分班 作业完成数(*10) 试卷完成数(*10) 问卷完成数(*7) 资源发布数(*5) 帖子发布数(*2) 帖子回复数(*1) 作业回复数(*1) 活跃度)
all_members.each do |u|
#用户的基本信息
user = u.user
@ -1227,8 +1229,9 @@ class CoursesController < ApplicationController
user_name = user.real_name
user_mail = user.mail
user_stu_id = u.student_id.present? ? (u.student_id.to_s + "\t") : "--"
user_school = user.school_name
user_course_group = u.course_group_name
user_info_array = [user_login,user_name,user_mail,user_stu_id,user_course_group] #用户的信息集合
user_info_array = [user_login,user_name,user_mail,user_stu_id,user_school,user_course_group] #用户的信息集合
user_work_scores = []
#课堂活跃度统计
@ -1252,15 +1255,16 @@ class CoursesController < ApplicationController
u_2: user_login,
u_2_1: user_mail,
u_3: user_stu_id,
u_4: user_course_group,
u_5: c_works_num,
u_6: c_exercise_num,
u_7: c_poll_num,
u_8: c_file_num,
u_9: c_message_num,
u_10: c_reply_num,
u_11: user_work_reply_num,
u_12: user_activity_levels
u_4: user_school,
u_5: user_course_group,
u_6: c_works_num,
u_7: c_exercise_num,
u_8: c_poll_num,
u_9: c_file_num,
u_10: c_message_num,
u_11: c_reply_num,
u_12: user_work_reply_num,
u_13: user_activity_levels
}
course_user_level.push(user_ac_level)
@ -1370,7 +1374,7 @@ class CoursesController < ApplicationController
course_user_score_title = "学生总成绩"
score_title_cells = shixun_titles + common_titles + group_titles + task_titles + exercise_titles
score_title_counts = [shixun_titles.count,common_titles.count,group_titles.count,task_titles.count,exercise_titles.count]
score_cell_head = %w(序号 真实姓名 登录名 邮箱 学号 分班) + score_title_cells + ["个人总成绩"]
score_cell_head = %w(序号 真实姓名 登录名 邮箱 学号 学校 分班) + score_title_cells + ["个人总成绩"]
@course_user_scores = [course_user_score_title,score_cell_head,score_title_counts,total_user_score_array]
#作业的全部集合

@ -1,5 +1,5 @@
class EduSettingsController < ApplicationController
# before_action :require_admin
before_action :require_admin
before_action :set_edu_setting, only: [:show, :edit, :update, :destroy]
# GET /edu_settings

@ -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

@ -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) &&

@ -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

@ -896,13 +896,31 @@ class PollsController < ApplicationController
def commit_poll
ActiveRecord::Base.transaction do
begin
poll_user_current = @poll.poll_users.find_by_group_ids(current_user.id).first
poll_user_params = {
:commit_status => 1,
:end_at => Time.now
}
poll_user_current.update_attributes(poll_user_params)
normal_status(0, "问卷提交成功!")
@poll_multi_questions = @poll.poll_questions.where(question_type:2).select(:id,:max_choices,:min_choices,:question_number)
error_question = []
@poll_multi_questions.each do |q|
poll_user_votes = current_user.poll_votes.where(poll_question_id:q.id)&.size
if q.max_choices.present? && (poll_user_votes > q.max_choices)
error_messages = "#{q.question_number}题:超过最大选项限制"
elsif q.min_choices.present? && (poll_user_votes < q.min_choices)
error_messages = "#{q.question_number}题:不得少于最小选项限制"
else
error_messages = nil
end
error_question.push(error_messages)
end
error_question = error_question.reject(&:blank?)
if error_question.reject(&:blank?).length > 0
normal_status(-1, "#{error_question.join("")}")
else
poll_user_current = @poll.poll_users.find_by_group_ids(current_user.id).first
poll_user_params = {
:commit_status => 1,
:end_at => Time.now
}
poll_user_current.update_attributes(poll_user_params)
normal_status(0, "问卷提交成功!")
end
## 需添加发送消息的接口,稍后添加
rescue Exception => e
uid_logger_error(e.message)

@ -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

@ -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,

@ -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

@ -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

@ -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

@ -59,18 +59,19 @@ wb.styles do |s|
sheet.merge_cells("D1:D2")
sheet.merge_cells("E1:E2")
sheet.merge_cells("F1:F2")
sheet.merge_cells("G1:G2")
sheet.merge_cells (Axlsx::cell_r(sheet_length-1,0) + ':' + Axlsx::cell_r(sheet_length-1,1)) #最后一行的合并
sheet_first = sheet.rows.first #第一行
sheet_second = sheet.rows.second #第二行
work_head_title = %w(实训作业 普通作业 分组作业 毕设任务 试卷)
(0..(sheet_length-1)).each do |i|
if i <= 5 || i == sheet_length-1
if i <= 6 || i == sheet_length-1
sheet_first.cells[i].value = sheet_title[i]
else
sheet_second.cells[i].value = sheet_title[i]
end
end
st_col = 6
st_col = 7
sheet_title_counts.each_with_index do |c,index|
end_col = (st_col + c - 1)
sheet.merge_cells sheet_first.cells[(st_col..end_col)]

@ -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

@ -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

@ -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

@ -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

@ -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

@ -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 {
<Trialapplicationysl {...this.props} {...this.state}></Trialapplicationysl>
<Trialapplicationreview {...this.props} {...this.state}></Trialapplicationreview>
<Addcourses {...this.props} {...this.state}/>
<AccountProfile {...this.props} {...this.state}/>
{/*{*/}
{/* isRender === true?*/}
{/* <LoginDialog></LoginDialog> : ""*/}

@ -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('<p')) { // 普通html处理
window.$(selector).html(oldContent)
} else {
try {
var markdwonParser = window.editormd.markdownToHTML("md_div", {
markdown: oldContent, // .replace(/▁/g,"▁▁▁"),
emoji: true,
htmlDecode: "style,script,iframe", // you can filter tags decode
taskList: true,
tex: true, // 默认不解析
flowChart: true, // 默认不解析
sequenceDiagram: true // 默认不解析
});
var markdwonParser = window.editormd.markdownToHTML("md_div", {
markdown: oldContent,
emoji: true,
htmlDecode: "style,script,iframe", // you can filter tags decode
taskList: true,
tex: true, // 默认不解析
flowChart: true, // 默认不解析
sequenceDiagram: true // 默认不解析
});
} catch(e) {
console.error(e)
}
const content = window.$('#md_div').html()
if (selector) {
window.$(selector).html(content)
} catch(e) {
console.error(e)
}
const content = window.$('#md_div').html()
if (selector) {
window.$(selector).html(content)
}
return content
}
return content
}
export function appendFileSizeToUploadFile(item) {

@ -1,27 +1,44 @@
import React,{ Component } from "react";
import { markdownToHTML } from 'educoder'
/**
selector 需要传入唯一的selector作为id不然会引起冲突
delay 如果有公式需要传入delay={true}
*/
class MarkdownToHtml extends Component{
constructor(props){
super(props);
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)
}
}
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(
<div id="memo_content_editorMd" className={`new_li markdown-body ${this.props.className} markdown_to_html_${this.props.selector || ''}`}
<div id="memo_content_editorMd" className={`new_li markdown-body ${className} markdown_to_html_${this.props.selector || ''}`}
// dangerouslySetInnerHTML={{__html: markdownToHTML(this.props.content)}}
style={style}
>
</div>
)

@ -297,6 +297,7 @@ class BoardsNew extends Component{
.courseForm .noBorder {
border-bottom: none;
}
`}</style>
<div className="edu-class-container edu-position courseForm">
<CBreadcrumb items={[

@ -87,7 +87,7 @@ class CommonWorkQuestion extends Component{
{/* 内容区 */}
<div className="padding40 memoContent new_li">
<MarkdownToHtml content={description}></MarkdownToHtml>
<MarkdownToHtml content={description} selector="work_content"></MarkdownToHtml>
{ attachments && attachments.map((item) => {
return ( <div className="color-grey">

@ -370,7 +370,7 @@ class NewWork extends Component{
<span>{pageType==="new"?"新建":"编辑"}</span>
</p> */}
<CBreadcrumb items={[
{ to: current_user.first_category_url, name: this.state.course_name},
{ to: current_user && current_user.first_category_url, name: this.state.course_name},
{ to: `/courses/${courseId}/${moduleEngName}/${category && category.category_id ? category.category_id : ''}`
, name: category && category.category_name },
{ name: `${ this.isEdit ? '编辑' : '新建'}` }
@ -388,7 +388,7 @@ class NewWork extends Component{
</p>
<div>
{/* onSubmit={this.handleSubmit} */}
<Form >
<Form className="courseForm">
<Form.Item
label="标题"
className="AboutInputForm"

@ -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) => {

@ -36,6 +36,17 @@ class ModalWrapper extends Component{
className={className || ''}
keyboard={false}
>
{
visible == true ? <style>
{
`
body {
overflow: hidden !important;
}
`
}
</style>:""
}
<div className="newupload_conbox clearfix">
{this.props.children}
{this.props.checkBoxValuestype===true?<div className={"mt10 color-red"}>

@ -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 (
<div>
{
is_guide && <Guide></Guide>
}
{AccountProfiletype===true?<AccountProfile
hideAccountProfile={()=>this.hideAccountProfile()}
{...this.state}
{...this.props}
/>:""}
{
coursedata === undefined || coursedata.status===401? <div id="course_info_1309" className="courseHead" style={{height: '206px'}}></div>:<div id="course_info_1309" className="courseHead" style={{height: '206px'}}>

@ -38,7 +38,6 @@ class Addcourses extends Component{
}
return response;
}, (error) => {
//TODO 这里如果样式变了会出现css不加载的情况
});

@ -984,6 +984,26 @@ samp {
line-height: 40px;
}
.courseForm .ant-input-group > .ant-input:first-child, .ant-input-group-addon:first-child {
height: 40px;
}
.courseForm .ant-select-selection, .courseForm .ant-select-selection-selected-value {
height: 40px;
line-height: 40px;
}
.courseForm .ant-input-affix-wrapper .ant-input {
height: 40px;
}
.courseForm .ant-select-auto-complete.ant-select .ant-input {
height: 40px;
}
.courseForm .ant-select-auto-complete.ant-select .ant-select-selection__rendered {
line-height: 40px;
}
.courseForm .ant-select-auto-complete.ant-select .ant-input {
height: 40px;
}
/*新建课堂*/
@ -1560,9 +1580,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{

@ -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] &&
<React.Fragment>
<div style={{color: '#05101A'}} className="font-16 mb5 font-bd">参考答案</div>
<div className="mainQuestionDisplay markdown-body"
<MarkdownToHtml content={standard_answer[0]} selector={'answer_' + qNumber}
delay={true} className=""
></MarkdownToHtml>
{/* <div className="mainQuestionDisplay markdown-body"
dangerouslySetInnerHTML={{__html: markdownToHTML(standard_answer[0])}}
>
</div>
</div> */}
</React.Fragment>
}

@ -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{
<span className="lineh-40">答案填空{index+1}</span>
<div className="answers">
{ answers.answer_text.map((item, itemIndex) => {
return <span className="answer" key={itemIndex}>{item}</span>
return <MarkdownToHtml
className="answer" key={itemIndex} delay={true}
content={item} selector={'null_' + (index + 1) + '' + (itemIndex + 1)}
></MarkdownToHtml>
})}
{/* <span className="answer" key={itemIndex}>{item}</span> */}
</div>
</div>
})

@ -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{
</React.Fragment>}
</div>
</div>
<span className="markdown-body" dangerouslySetInnerHTML={{__html: markdownToHTML(question_title)}}
style={{ display: 'inline-block', width:'100%' , margin: '10px 0px 15px' }}></span>
{ question_title &&
<MarkdownToHtml content={question_title} selector={'qtitle_' + (index + 1)} style={{ display: 'inline-block', width:'100%' , margin: '10px 0px 15px' }}
delay={true}
></MarkdownToHtml>
// <div className="markdown-body" dangerouslySetInnerHTML={{__html: markdownToHTML(question_title)}}
// style={{ display: 'inline-block', width:'100%' , margin: '10px 0px 15px' }}></div>
}
</React.Fragment>
)
}

@ -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 (
<div className="mb10 clearfix" key={optionIndex}>
<Radio disabled className="fl lineh-20" checked={item.standard_boolean}>{prefix}</Radio>
<span style={{ display: 'inline-block'}} className="markdown-body fl"
dangerouslySetInnerHTML={{__html: markdownToHTML(item.choice_text)}}></span>
<MarkdownToHtml content={item.choice_text} selector={'single_' + (index + 1) + '' + (optionIndex + 1)} style={{ float: 'left', display: 'inline-block' }}
delay={true}
></MarkdownToHtml>
{/* <span style={{ display: 'inline-block'}} className="markdown-body fl"
dangerouslySetInnerHTML={{__html: markdownToHTML(item.choice_text)}}></span> */}
</div>)
} else {
return (
<div className="mb10 clearfix" key={optionIndex}>
<Checkbox disabled className="fl lineh-20" checked={item.standard_boolean}>{prefix}</Checkbox>
<span style={{ display: 'inline-block'}} className="markdown-body fl"
dangerouslySetInnerHTML={{__html: markdownToHTML(item.choice_text)}}></span>
<MarkdownToHtml content={item.choice_text} selector={'single_' + (index + 1)+ '' + (optionIndex + 1)} style={{ float: 'left', display: 'inline-block' }}
delay={true}
></MarkdownToHtml>
{/* <span style={{ display: 'inline-block'}} className="markdown-body fl"
dangerouslySetInnerHTML={{__html: markdownToHTML(item.choice_text)}}></span> */}
</div>)
}
})}

@ -135,8 +135,8 @@ class shixunAnswer extends Component{
let url=`/exercise_questions/${this.props.questionType.question_id}/adjust_score.json`
const list = Object.assign({}, this.state.dataCopy[key])
console.log("111111111111111111111111");
console.log(this.props);
// console.log("111111111111111111111111");
// console.log(this.props);
// 调分值为0且和第一次的数据相同则不修改
if(parseInt(e.target.value)==parseInt(list.my_score)){
return;

@ -93,13 +93,14 @@ class AddStudentModal extends Component{
}
onSendOk = () => {
this.setState({
isSpin:true
})
if(!this.state.checkBoxValues || this.state.checkBoxValues.length == 0) {
this.props.showNotification('请从列表中先选择用户。')
return;
}
this.setState({
isSpin:true
})
const courseId = this.props.match.params.coursesId
const url = `/courses/${courseId}/add_students_by_search.json`
const params = {
@ -159,7 +160,7 @@ class AddStudentModal extends Component{
title={`添加${moduleName}`}
{...this.props }
onOk={this.onOk}
className="addStudentModal"
className="addStudentModal courseForm"
>
<style>
{`

@ -196,7 +196,7 @@ class AddTeacherModal extends Component{
title={`添加${moduleName}`}
{...this.props }
onOk={this.onOk}
className="addTeacherModal"
className="addTeacherModal courseForm"
>
<AddGraduationGroupModal ref="addGraduationGroupModal"
{...this.props} onOk={this.onAddGraduationGroupOk}

@ -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,
@ -453,6 +459,11 @@ class CoursesNew extends Component {
width: 280px;
margin-left: 10px;
}
.construction .ant-select-selection__placeholder, .ant-select-search__field__placeholder {
line-height: 28px;
z-index: 2000;
}
`}
</style>
@ -635,7 +646,7 @@ class CoursesNew extends Component {
</Form.Item>
</div>
<div className="stud-class-set padding10200 coursenavbox mb20">
<div className="stud-class-set padding10200 mb20">
<Form.Item label="课堂所属单位">
{getFieldDecorator('school', {
rules: [{required: true, message: "不能为空"}],

@ -464,7 +464,7 @@ class Poll extends Component{
modalsBottomval,
loadtype
}=this.state;
console.log(this.props);
// console.log(this.props);
let {child}=this.props;
let {coursesId,Id}=this.props.match.params
const isAdmin = this.props.isAdmin()

@ -34,7 +34,7 @@ class PollDetailIndex extends Component{
}
getPollInfo=()=>{
console.log(this.props);
// console.log(this.props);
let pollId=this.props.match.params.pollId;
let url=`/polls/${pollId}/common_header.json`
axios.get(url).then((result)=>{
@ -123,7 +123,7 @@ class PollDetailIndex extends Component{
/>
<div className="educontent mt10 mb50">
<p className="clearfix mb20">
<WordsBtn style="grey" className="fl" to={current_user.first_category_url}>{this.props.coursedata.name}</WordsBtn>
<WordsBtn style="grey" className="fl" to={current_user && current_user.first_category_url}>{this.props.coursedata.name}</WordsBtn>
<span className="color-grey-9 fl ml3 mr3">&gt;</span>
<WordsBtn style="grey" className="fl" to={`/courses/${this.props.match.params.coursesId}/polls/${user_permission && user_permission.left_banner_id}`}>问卷</WordsBtn>
<span className="color-grey-9 fl ml3 mr3">&gt;</span>

@ -66,7 +66,7 @@ class PollDetailTabSecond extends Component{
<span className="font-16 clearfix">
<span className="color-blue fl">{parseInt(page-1)*parseInt(limit)+(key+1)}{map[item.question.question_type]}</span>
{ item.question.is_necessary==1 ? <span className="mustAnswer fl ml10 mr10 mt6">必答</span>:"" }
{ item.question.question_type == 2 ?
{ item.question.question_type == 2 && item.question.min_choices && item.question.max_choices ?
<span className="color-grey-9">
{
item.question.min_choices == item.question.max_choices ? "可选"+item.question.max_choices+"项" :
@ -127,9 +127,9 @@ class PollDetailTabSecond extends Component{
<span className="color-green">{options.answer_users_count}</span>
<span>
<p className="percentForm fl mr15">
<span className="percentValue" style={{"width":`${parseFloat(options.answer_percent ? options.answer_percent : 0 ).toFixed(2)*100}%`}}></span>
<span className="percentValue" style={{"width":`${(options.answer_percent * 100).toFixed(1)}%`}}></span>
</p>
<font className="color-grey-9">{parseFloat(options.answer_percent ? options.answer_percent : 0 ).toFixed(2)*100} %</font>
<font className="color-grey-9">{(options.answer_percent * 100).toFixed(1)}%</font>
</span>
</ul>
{

@ -71,7 +71,7 @@ class PollDetailTabThird extends Component{
<p className="pl30 pr30 pt30 pb15 font-16 clearfix">
<span className="color-blue mr8 fl">{item.question.question_number}{map[item.question.question_type]}</span>
{ item.question.is_necessary==1 ? <span className="mustAnswer fl ml10 mr10">必答</span>:<span className="mustAnswer fl ml10 mr10"></span> }
{ item.question.question_type == 2 && item.question.min_choices && item.question.max_choice ?
{ item.question.question_type == 2 && item.question.min_choices && item.question.max_choices ?
<span className="color-grey-9 font-14 fl mt2">
{
item.question.min_choices == item.question.max_choices ? "可选"+item.question.max_choices+"项" :
@ -89,8 +89,8 @@ class PollDetailTabThird extends Component{
item.question.answers.map((index,k)=>{
return(
<li className="df">
<Radio value={index.answer_id}></Radio>
<span className={index.answer_text=="其他"?"break_word":"break_word flex1"}>{index.answer_text}</span>
<Radio className="fl" value={index.answer_id}></Radio>
<span className={index.answer_text=="其他"?"break-word":"break-word flex1"}>{index.answer_text}</span>
{
index.answer_text=="其他" ? <p className="textLine"></p>:""
}
@ -109,8 +109,8 @@ class PollDetailTabThird extends Component{
item.question.answers.map((index,k)=>{
return(
<li className="df">
<Checkbox value={index.answer_id}></Checkbox>
<span className={index.answer_text=="其他"?"break_word":"break_word flex1"}>{index.answer_text}</span>
<Checkbox className="fl mr8" value={index.answer_id}></Checkbox>
<span className={index.answer_text=="其他"?"break-word":"break-word flex1"}>{index.answer_text}</span>
{
index.answer_text=="其他" ? <p className="textLine"></p>:""
}

@ -135,7 +135,7 @@ class PollInfo extends Component{
postAnswer=(q_id,a_id,text,key)=>{
let url=`/poll_questions/${q_id}/poll_votes.json`;
console.log(text);
axios.post(url,{
poll_answer_id:a_id,
vote_text:text
@ -207,8 +207,9 @@ class PollInfo extends Component{
})
if(text!=undefined){
url+="vote_text="+text;
axios.post(url).then((result)=>{
axios.post((url),{
vote_text:text
}).then((result)=>{
if(result.status==200){
const answer=Object.assign({}, this.state.question_answered[key]);
answer.ques_status=result.data.poll_vote.question_status;
@ -315,7 +316,7 @@ class PollInfo extends Component{
></Modals>
<div className="educontent mt10 mb50">
<p className="clearfix mb20">
<WordsBtn style="grey" className="fl" to={current_user.first_category_url}>{courseName}</WordsBtn>
<WordsBtn style="grey" className="fl" to={current_user && current_user.first_category_url}>{courseName}</WordsBtn>
<span className="color-grey-9 fl ml3 mr3">&gt;</span>
<WordsBtn style="grey" className="fl" to={`/courses/${this.props.match.params.coursesId}/polls/${poll && poll.left_banner_id}`}>问卷</WordsBtn>
<span className="color-grey-9 fl ml3 mr3">&gt;</span>
@ -383,7 +384,7 @@ class PollInfo extends Component{
<div className="pl30 pr30 mt30 mb10 clearfix">
<span className="color-blue fl font-16">{item.question.question_number}{map[item.question.question_type]}</span>
{ item.question.is_necessary==1 ? <span className="mustAnswer fl ml10 mr10 mt5">必答</span>:<span className="mustAnswer fl ml10 mr10 mt5"></span> }
{ item.question.question_type == 2 && item.question.min_choices && item.question.max_choice ?
{ item.question.question_type == 2 && item.question.min_choices && item.question.max_choices ?
<span className="color-grey-9 font-14 fl mt2">
{
item.question.min_choices == item.question.max_choices ? "可选"+item.question.max_choices+"项" :
@ -400,8 +401,9 @@ class PollInfo extends Component{
{
item.question.answers && item.question.answers.map((i,k)=>{
return(
<li className={i.answer_text=="其他"?"df":""}>
<Radio name={[item.question.id,key]} className="break-word" value={i.answer_id} >{i.answer_text}</Radio>
<li className={i.answer_text=="其他"?"df clearfix":"clearfix"}>
<Radio name={[item.question.id,key]} className="fl" value={i.answer_id} ></Radio>
<span className="break-word fl" style={{maxWidth:"1116px"}}>{i.answer_text}</span>
{
i.answer_text=="其他" ?
<React.Fragment>
@ -442,8 +444,9 @@ class PollInfo extends Component{
{
item.question.answers && item.question.answers.map((i,k)=>{
return(
<li className={i.answer_text=="其他"?"df":""}>
<Checkbox className="break-word" value={i.answer_id}>{i.answer_text}</Checkbox>
<li className={i.answer_text=="其他"?"df clearfix":"clearfix"}>
<Checkbox className="fl mr8" value={i.answer_id}></Checkbox>
<span className="break-word fl" style={{maxWidth:"1116px"}}>{i.answer_text}</span>
{
i.answer_text=="其他"?
<React.Fragment>

@ -844,12 +844,12 @@ class PollNew extends Component {
if (object.question.question_type === 2) {
if (object.question.max_choices > 0) {
if (object.question.min_choices < 2) {
this.props.showNotification(`可选最小不能少于2个`);
return;
}
// if (object.question.min_choices < 2) {
// this.props.showNotification(`可选最小不能少于2个`);
//
// return;
//
// }
}
}
@ -1332,10 +1332,10 @@ class PollNew extends Component {
if (object.question.question_type === 2) {
if (object.question.max_choices > 0) {
if (object.question.min_choices < 2) {
this.props.showNotification(`可选最小不能少于2个`);
return;
}
// if (object.question.min_choices < 2) {
// this.props.showNotification(`可选最小不能少于2个`);
// return;
// }
}
}
if (object.question.new === "new") {
@ -2108,14 +2108,24 @@ class PollNew extends Component {
}
//最大值
HandleGradationGroupChangeee = (value, index) => {
HandleGradationGroupChangeee = (value, index,minchoices) => {
// console.log("2112");
// console.log(value);
// console.log(minchoices);
let arr = this.state.adddom;
for (var i = 0; i < arr.length; i++) {
if (index === i) {
arr[i].question.max_choices = parseInt(value);
if(parseInt(value)===0&&parseInt(minchoices)===0){
arr[i].question.min_choices= parseInt(minchoices);
arr[i].question.max_choices = parseInt(value);
}else {
arr[i].question.min_choices= minchoices===null?2:minchoices===undefined?2:minchoices===0?2:parseInt(minchoices);
arr[i].question.max_choices = parseInt(value);
}
}
}
// console.log(2119);
// console.log(arr);
this.setState({
adddom: arr
})
@ -2285,7 +2295,7 @@ class PollNew extends Component {
readOnlys: "readOnly",
cancellation: false,
})
window.location.href = `/courses/${coursesId}/polls/${result.data.data.id}/edit`;
})
} else {
@ -2322,7 +2332,7 @@ class PollNew extends Component {
gotohome=()=>{
const { current_user} = this.props
this.props.history.push(current_user.first_category_url);
this.props.history.push(current_user && current_user.first_category_url);
// let courseId=this.props.match.params.coursesId;
@ -2388,7 +2398,7 @@ class PollNew extends Component {
<a className=" btn colorgrey fl hovercolorblue" onClick={()=>this.gotohome()}>{this.props.coursedata.name}</a>
<span className="color-grey-9 fl ml3 mr3">&gt;</span>
<a className=" btn colorgrey fl hovercolorblue"
to={`/courses/${this.props.match.params.coursesId}/polls/${this.props.match.params.pollid}`}>问卷</a>
href={`/courses/${this.props.match.params.coursesId}/polls/${this.props.match.params.pollid}`}>问卷</a>
<span className="color-grey-9 fl ml3 mr3">&gt;</span>
<span>{this.props.match.params.news === undefined ? "新建" : this.props.match.params.news === "new" ? "新建" : "编辑"}</span>
</p>
@ -2772,7 +2782,7 @@ class PollNew extends Component {
className="ml10 mr10 color-grey-6 lineh-40 fl">~</span>
{/*可选最大*/}
<Select className="fl w100"
onChange={(value) => this.HandleGradationGroupChangeee(value, indexo)}
onChange={(value) => this.HandleGradationGroupChangeee(value, indexo,itemo.question.min_choices)}
value={itemo.question.max_choices === 0 || itemo.question.max_choices === "0" ? "--" : itemo.question.min_choices === null ? "--" : itemo.question.min_choices === undefined ? "--" : itemo.question.max_choices}
>
<Option value={String("0")}>--</Option>
@ -3015,7 +3025,7 @@ class PollNew extends Component {
className="ml10 mr10 color-grey-6 lineh-40 fl">~</span>
{/*可选最大*/}
<Select className="fl w100"
onChange={(value) => this.HandleGradationGroupChangeee(value, indexo)}
onChange={(value) => this.HandleGradationGroupChangeee(value, indexo,itemo.question.min_choices)}
value={itemo.question.max_choices === 0 || itemo.question.max_choices === "0" ? "--" : itemo.question.min_choices === null ? "--" : itemo.question.min_choices === undefined ? "--" : itemo.question.max_choices}
>
<Option value={String("0")}>--</Option>
@ -3267,7 +3277,7 @@ class PollNew extends Component {
className="ml10 mr10 color-grey-6 lineh-40 fl">~</span>
{/*可选最大*/}
<Select className="fl w100"
onChange={(value) => this.HandleGradationGroupChangeee(value, indexo)}
onChange={(value) => this.HandleGradationGroupChangeee(value, indexo,itemo.question.min_choices)}
value={itemo.question.max_choices === 0 || itemo.question.max_choices === "0" ? "--" : itemo.question.min_choices === null ? "--" : itemo.question.min_choices === undefined ? "--" : itemo.question.max_choices}
>
<Option value={String("0")}>--</Option>

@ -113,7 +113,7 @@
text-align: left;
}
.percentForm{
width: 340px;
width: 330px;
height: 11px;
background: #F5F5F5;
border-radius: 6px;

@ -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 = <Icon type="loading" style={{ fontSize: 24 }} spin />;
// 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;
}
`}
</style>
{computeTimetype===false?<li className="clearfix startbox">
<Spin indicator={antIcon} spinning={!computeTimetype} className={"shixunSpin"}/>
<span className={"startfont"}>
正在执行成绩计算请稍后刷新页面查看结果
温馨提示执行时间因作品数量而异
正在执行成绩计算完成后将为您自动刷新结果温馨提示执行时间因作品数量而异
</span>
</li>:""}
@ -2630,10 +2634,10 @@ class Listofworksstudentone extends Component {
<style>
{
`
body {
overflow: hidden !important;
}
`
body {
overflow: hidden !important;
}
`
}
</style>
<TraineetraininginformationModal
@ -2654,12 +2658,19 @@ class Listofworksstudentone extends Component {
<div className={"educontent "}>
<div className="edu-back-white" style={{width: "1200"}}>
<style>
{
`
.shixunSpin{
color:#FF6801;
margin-right: 10px;
}
`}
</style>
{computeTimetype===false?<li className="clearfix startbox mb20">
<Spin indicator={antIcon} spinning={!computeTimetype} className={"shixunSpin"}/>
<span className={"startfont"}>
正在执行成绩计算请稍后刷新页面查看结果
温馨提示执行时间因作品数量而异
正在执行成绩计算完成后将为您自动刷新结果温馨提示执行时间因作品数量而异
</span>
</li>:""}
@ -2774,12 +2785,20 @@ class Listofworksstudentone extends Component {
<div className={"educontent mb20"}>
<div className="edu-back-white">
<style>
{
`
.shixunSpin{
color:#FF6801;
margin-right: 10px;
}
`}
</style>
{computeTimetype===false?<li className="clearfix startbox mb20">
<Spin indicator={antIcon} spinning={!computeTimetype} className={"shixunSpin"}/>
<span className={"startfont"}>
正在执行成绩计算请稍后刷新页面查看结果
温馨提示执行时间因作品数量而异
正在执行成绩计算完成后将为您自动刷新结果温馨提示执行时间因作品数量而异
</span>
</li>:""}

@ -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 = <Icon type="loading" style={{ fontSize: 24 }} spin />;
return (
<div className=" clearfix " style={{margin: "auto" , minWidth:"1200px"}}>
{this.state.showmodel===true?<ShixunWorkModal
@ -716,11 +717,16 @@ class ShixunStudentWork extends Component {
color:rgba(255,104,0,1);
}
.shixunSpin{
color:#FF6801;
margin-right: 10px;
}
`}
</style>
<li className="clearfix startbox mb20" style={{display:duplicatechecking===true?"":"none"}}>
<Spin indicator={antIcon} spinning={duplicatechecking} className={"shixunSpin"}/>
<span className={"startfont"}>
正在执行查重请稍后刷新页面查看结果 温馨提示执行时间因查重作品数以及作品的代码量而异
正在执行查重完成后将为您自动刷新结果 温馨提示执行时间因查重作品数以及作品的代码量而异
</span>
</li>

@ -135,7 +135,7 @@ class ShixunWorkReport extends Component {
<span className={"color-grey-9"}>{data===undefined?"":data.category===null?"":data.category.category_name}</span>
</a>
<span className="color-grey-9 fl ml3 mr3">&gt;</span>
<a to={"/courses/"+this.props.match.params.coursesId+"/"+this.state.shixuntypes+"/"+homework_common_id+"/list?tab=0"} className="fl color-grey-9">作业详情</a>
<a href={"/courses/"+this.props.match.params.coursesId+"/"+this.state.shixuntypes+"/"+homework_common_id+"/list?tab=0"} className="fl color-grey-9">作业详情</a>
<span className="color-grey-9 fl ml3 mr3">&gt;</span>
<WordsBtn className="fl">{data&&data.username}</WordsBtn>
</p>

@ -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()}
>
<Notcompletedysl
modalsType={this.state.MyEduCoderModals}
setNotcompleteds={()=>{this.setNotcompleteds()}}
/>
{isRender===true?
<div className={dialogBox}>
<div id="closeIcon" onClick={()=>{this.handleDialogClose()}}>

@ -100,7 +100,8 @@ class Header extends Component {
{/*<img src="/images/task/coin.png" className="fl" width="30" height="30" alt=""/>*/}
<span style={{width:'20px', height:'20px', background:'#FFD633', borderRadius: '10px', marginTop: '3px' }} className="fl"></span>
<span className="ml5 color-white fl" id="user_grade">
<a href={`${user.user_url}/user_grade`} target="_blank">{ grade === 0 ? grade : (grade || '')}</a>
{/* href={`${user.user_url}/user_grade`} target="_blank" */}
<span>{ grade === 0 ? grade : (grade || '')}</span>
</span>
</div>}

@ -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)

@ -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(
<div>
{AccountProfiletype===true?<AccountProfile
hideAccountProfile={()=>this.hideAccountProfile()}
{...this.state}
{...this.props}
/>:""}
<Modals
modalsType={Modalstype}
modalsTopval={Modalstopval}

@ -466,7 +466,7 @@ class DetailCardsEditAndAdd extends Component{
<span className="color-orange-tip">{ChooseShixunList && ChooseShixunList.shixuns_count}</span>
<span>个实训</span>
</span>
<div className="fr search-new">
<div className="fr search-new mb0">
<Search
placeholder="请输入创建者或者实训名称进行搜索"
onInput={this.searchNameInput}

@ -499,7 +499,7 @@ class DetailCardsEditAndEdit extends Component{
<span className="color-orange-tip">{ChooseShixunList && ChooseShixunList.shixuns_count}</span>
<span>个实训</span>
</span>
<div className="fr search-new">
<div className="fr search-new mb0">
<Search
placeholder="请输入创建者或者实训名称进行搜索"
onInput={this.searchNameInput}

@ -158,6 +158,15 @@ class PathNew extends Component{
}
componentDidMount() {
let url = "/paths/new.json"
axios.get(url).then((result) => {
console.log(result)
}).catch((error) => {
console.log(error);
})
let pathId = this.props.match.params.pathId;
if (pathId) {
this.isEditPage = true

@ -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?<AccountProfile
hideAccountProfile={()=>this.hideAccountProfile()}
{...this.state}
{...this.props}
/>:""}
<div className="educontent clearfix">
{/*<%= link_to image_tag("/images/educoder/logo.png", alt:"高校智能化教学与实训平台", className:"logoimg"), home_path %>*/}
<a href="/">

@ -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 {
<div>
<div className="shixunDetail_top">
{AccountProfiletype===true?<AccountProfile
hideAccountProfile={()=>this.hideAccountProfile()}
{...this.state}
{...this.props}
/>:""}
{this.state.Modalstype===true?<Modals
modalsType={this.state.Modalstype}
modalsTopval={this.state.Modalstopval}

File diff suppressed because it is too large Load Diff

@ -42,7 +42,7 @@ class TPMNav extends Component {
className={`${match.url.indexOf('ranking_list') != -1 ? 'active' : ''} fl`}>排行榜</Link>
{/* target="_blank"*/}
<a
href={`/shixuns/${shixunId}/settings`} className="fr"
href={`/shixuns/${shixunId}/settings`} className="edu-default-btn edu-blueline-btn ml20 fr"
style={{display: this.props.identity >4||this.props.identity===undefined ? "none" : 'block'}}
>配置</a>
</div>

@ -67,7 +67,7 @@ class TPMRightSection extends Component {
<div className="edu-back-white padding40-20 mb10">
<p className="font-16 mb20">创建者</p>
<div className="df">
<a href={TPMRightSectionData===undefined?"":TPMRightSectionData.creator===undefined?"":TPMRightSectionData.creator.user_url}>
<a href={TPMRightSectionData===undefined?"":TPMRightSectionData.creator===undefined?"":`/users/${TPMRightSectionData.creator.login}/courses`}>
<img alt="头像" className="radius mr10" height="80" src={getImageUrl(TPMRightSectionData===undefined?"":TPMRightSectionData.creator===undefined?"":'images/'+TPMRightSectionData.creator.image_url+"?1532489442")} width="80" />
</a>
<div className="flex1">

@ -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 = <Icon type="loading" style={{ fontSize: 24 }} spin />;
return (
<React.Fragment>
{AccountProfiletype===true?<AccountProfile
hideAccountProfile={()=>this.hideAccountProfile()}
{...this.state}
{...this.props}
/>:""}
{loadingContent ?
<CircularProgress size={40} thickness={3} style={{
marginLeft: 'auto',

@ -0,0 +1,74 @@
import React, { Component } from 'react';
import {getImageUrl} from 'educoder';
import {Modal} from 'antd';
import axios from 'axios';
class AccountProfile extends Component {
constructor(props) {
super(props);
this.state = {
AccountProfiletype:false
}
}
componentDidMount() {
if(this.props.AccountProfiletype!=undefined){
this.setState({
AccountProfiletype:this.props.AccountProfiletype
})
}
axios.interceptors.response.use((response) => {
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(
<Modal
keyboard={false}
title="提示"
visible={this.state.AccountProfiletype}
closable={false}
footer={null}
destroyOnClose={true}
centered={true}
width="530px"
>
<div className="task-popup-content">
<p className="task-popup-text-center font-16">您需要去完善您的个人资料才能使用此功能</p>
<div className="clearfix mt30 edu-txt-center">
<a className="task-btn mr30" onClick={()=>this.gotoback()}>取消</a>
<a className="task-btn task-btn-orange" href={"/account/profile/edit"}>立即完善</a>
</div>
</div>
</Modal>
)
}
}
export default AccountProfile;

@ -691,7 +691,7 @@ class LoginRegisterComponent extends Component {
<Input style={loginInputsyl} type="text" autoComplete="off" onClick={this.changeTypey}
className={Phonenumberisnotco && Phonenumberisnotco !== "" ?" color-grey-9 loginInputzhucheyslass bor-reds":" color-grey-9 loginInputzhuche"}
placeholder="输入注册手机号或邮箱" value={this.state.login}
onBlur={(e) => this.inputOnBlurzhuche(e)}
// onBlur={(e) => this.inputOnBlurzhuche(e)}
onChange={this.loginInputonChange} style={{marginTop: '10px', height: "38px"}}></Input>
{
Phonenumberisnotco && Phonenumberisnotco !== "" ?

@ -65,6 +65,7 @@ class LoginRegisterComponent extends Component {
Whethertoverify:false,
pciphone:true,
MyEduCoderModals:false,
registered:undefined,
}
}
@ -101,6 +102,7 @@ class LoginRegisterComponent extends Component {
Whethertoverify:false,
pciphone:true,
MyEduCoderModals:false,
registered:undefined,
}
}
@ -340,10 +342,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) {
@ -358,7 +360,6 @@ class LoginRegisterComponent extends Component {
weekArray="/";
}
window.location.href = weekArray;
}
}
@ -458,13 +459,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();
}
}
@ -881,12 +882,15 @@ class LoginRegisterComponent extends Component {
setNotcompleteds=()=>{
this.setState({
Notcompleteds:true,
MyEduCoderModals:false
MyEduCoderModals:false,
registered:undefined,
})
};
setMyEduCoderModals=()=>{
this.setState({
MyEduCoderModals:true
MyEduCoderModals:true,
registered:"注册成功"
})
};
render() {
@ -1028,7 +1032,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"}}></Input>
{
Phonenumberisnotcos && Phonenumberisnotcos !== "" ?
@ -1038,10 +1042,11 @@ class LoginRegisterComponent extends Component {
: <div style={{height:"25px"}}></div>
}
<Notcompletedysl
{this.state.MyEduCoderModals===true? <Notcompletedysl
modalsType={this.state.MyEduCoderModals}
registered={this.state.registered}
setNotcompleteds={()=>{this.setNotcompleteds()}}
/>
/>:""}
{
Whethertoverify===false&&pciphone===true?

@ -16,19 +16,19 @@ 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不加载的情况
//
// });
}
@ -53,13 +53,13 @@ class Notcompletedysl extends Component {
closable={false}
footer={null}
destroyOnClose={true}
title="提示"
title={this.props.registered===undefined?"提示":"注册成功"}
centered={true}
visible={this.state.modalsType}
visible={this.props.modalsType}
width="530px"
>
<div className="educouddiv">
<div className={"tabeltext-alignleft mt20"}><p>完善您的资料将获得更多的使用权限</p></div>
<div className={"tabeltext-alignleft"}><p style={{fontSize: "16px"}}>完善您的资料将获得更多的使用权限</p></div>
<div className="clearfix mt30 edu-txt-center">
<a className="task-btn mr30" onClick={()=>this.modalCancel()}>取消</a>
<a className="task-btn task-btn-orange" onClick={()=>this.setDownload()}>立即完善</a>

@ -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 {
</Form.Item>
{!filterSchoolList || (filterSchoolList && filterSchoolList.length==0 )&& school &&
<div style={{marginLeft: '100px',height:"20px",lineHeight:"20px"}}>
<div style={{marginLeft: '113px',height:"20px",lineHeight:"20px"}}>
<span>
<span style={{color: '#CDCDCD'}}>未找到包含{school}的高校</span>
<span style={{color: '#4CACFF', cursor: 'pointer'}} onClick={this.showApplyForAddOrgModal}>申请新增</span>
@ -716,10 +719,12 @@ class AccountBasic extends Component {
</Form.Item>
{
!filterDepartments || (filterDepartments && filterDepartments.length==0 )&& departmentsName &&
<div style={{marginLeft: '100px',height:"20px",lineHeight:"20px"}}>
(!filterDepartments || (filterDepartments && filterDepartments.length==0 )
|| (departmentsName == '' && !this.state.department_id
&& (!departments || departments.length == 0) )) &&
<div style={{marginLeft: '113px',height:"20px",lineHeight:"20px"}}>
<span>
<span style={{color: '#CDCDCD'}}>未找到包含{departmentsName}的院系/部门</span>
<span style={{color: '#CDCDCD'}}>{departmentsName ? `未找到包含“${departmentsName}”的院系/部门` : '未找到院系'}</span>
<span style={{color: '#4CACFF', cursor: 'pointer'}} onClick={this.showApplyForAddChildOrgModal}>申请新增</span>
</span>
</div>

@ -14,7 +14,7 @@ class AccountNav extends Component {
}
render() {
let { basicInfo } = this.props
console.log(this.props);
// console.log(this.props);
const path = window.location.pathname
const isBasic = path.indexOf('profile') != -1 || path == "/account"
const isCertification = path.indexOf('certification') != -1

@ -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,
};

@ -239,14 +239,14 @@ class Infos extends Component{
<div className="inline">
<div className="fl headtab">
<span>{is_current ? "我":"TA"}的经验值</span>
<a
<a style={{ cursor: 'default' }}
// href={`${this.props.Headertop && this.props.Headertop.old_url}/users/${username}/user_experience`}
>{data && data.experience}</a>
</div>
<em className="v-h-line fl"></em>
<div className="fl headtab">
<span>{is_current ? "我":"TA"}的金币</span>
<a
<a style={{ cursor: 'default' }}
// href={`${this.props.Headertop && this.props.Headertop.old_url}/users/${username}/user_grade`}
id="user_code">{data && data.grade}</a>
</div>
@ -255,14 +255,14 @@ class Infos extends Component{
</div>
<div className="fl headtab">
<span>{is_current ? "我":"TA"}的粉丝</span>
<a
<a style={{ cursor: 'default' }}
// href={`${this.props.Headertop && this.props.Headertop.old_url}/users/${username}/user_fanslist`}
id="user_h_fan_count">{data && data.fan_count}</a>
</div>
<em className="v-h-line fl"></em>
<div className="fl headtab">
<span>{is_current ? "我":"TA"}的关注</span>
<a
<a style={{ cursor: 'default' }}
// href={`${this.props.Headertop && this.props.Headertop.old_url}/users/${username}/user_watchlist`}
>{data && data.follow_count}</a>
</div>

@ -130,7 +130,7 @@ class InfosCourse extends Component{
this.props.current_user && this.props.current_user.user_identity != "学生" ? <Create href={"/courses/new"} name={"新建课堂"} index="1"></Create> : ""
}
{
(!data || data.courses.length==0) && (this.props.current_user && this.props.current_user.user_identity === "学生" || category) && <NoneData></NoneData>
(!data || data.courses.length==0) && (this.props.current_user && this.props.current_user.user_identity === "学生" ) && <NoneData></NoneData>
}
{
data && data.courses && data.courses.map((item,key)=>{

@ -152,7 +152,7 @@ class InfosPath extends Component{
this.props.current_user && this.props.current_user.user_identity != "学生" ? <Create href={"/paths/new"} name={"新建实践课程"} index="3"></Create>:""
}
{
(!data || data.subjects.length==0) && (this.props.current_user && this.props.current_user.user_identity === "学生" || category) && <NoneData></NoneData>
(!data || data.subjects.length==0) && (this.props.current_user && this.props.current_user.user_identity === "学生" ) && <NoneData></NoneData>
}
{
data && data.subjects && data.subjects.map((item,key)=>{

@ -125,7 +125,7 @@ class InfosProject extends Component{
<Create href={`${this.props.Headertop && this.props.Headertop.old_url}/projects/new`} name={"新建项目"} index="4"></Create>:""
}
{
(!data || data.projects.length==0) && (this.props.current_user && this.props.current_user.user_identity === "学生" || category) && <NoneData></NoneData>
(!data || data.projects.length==0) && (this.props.current_user && this.props.current_user.user_identity === "学生" ) && <NoneData></NoneData>
}
{
data && data.projects && data.projects.map((item,key)=>{

@ -161,7 +161,7 @@ class InfosShixun extends Component{
<Create href={"/shixuns/new"} name={"新建实训"} index="2"></Create>:""
}
{
(!data || data.shixuns.length==0) && (this.props.current_user && this.props.current_user.user_identity === "学生" || category) && <NoneData></NoneData>
(!data || data.shixuns.length==0) && (this.props.current_user && this.props.current_user.user_identity === "学生" ) && <NoneData></NoneData>
}
{
data && data.shixuns && data.shixuns.map((item,key)=>{

Loading…
Cancel
Save