Merge branch 'dev_aliyun' of http://bdgit.educoder.net/Hjqreturn/educoder into dev_aliyun

dev_admin
cxt 6 years ago
commit 13c1954810

@ -160,7 +160,7 @@ class AccountsController < ApplicationController
# 发送验证码
# params[:login] 手机号或者邮箱号
# params[:type]为事件通知类型 1用户注册注册 2忘记密码 3: 绑定手机 4: 绑定邮箱 # 如果有新的继续后面加
# params[:type]为事件通知类型 1用户注册注册 2忘记密码 3: 绑定手机 4: 绑定邮箱, 5: 验收手机号有效 # 如果有新的继续后面加
# 发送验证码send_type 1注册手机验证码 2找回密码手机验证码 3找回密码邮箱验证码 4绑定手机 5绑定邮箱
# 6手机验证码登录 7邮箱验证码登录 8邮箱注册验证码 9: 验收手机号有效
def get_verification_code
@ -200,7 +200,7 @@ class AccountsController < ApplicationController
session[:user_id] = nil
end
# type 事件类型 1用户注册 2忘记密码 3: 绑定手机 4: 绑定邮箱 # 如果有新的继续后面加
# type 事件类型 1用户注册 2忘记密码 3: 绑定手机 4: 绑定邮箱, 5: 验证手机号是否有效 # 如果有新的继续后面加
# login_type 1手机类型 2邮箱类型
def verify_type login_type, type
case type
@ -212,6 +212,8 @@ class AccountsController < ApplicationController
login_type == 1 ? 4 : tip_exception('请填写正确的手机号')
when 4
login_type == 1 ? tip_exception('请填写正确的邮箱') : 5
when 5
login_type == 1 ? 9 : tip_exception('请填写正确的手机号')
end
end

@ -64,10 +64,10 @@ class ApplicationController < ActionController::Base
# 发送及记录激活码
# 发送验证码type 1注册手机验证码 2找回密码手机验证码 3找回密码邮箱验证码 4绑定手机 5绑定邮箱
# 6手机验证码登录 7邮箱验证码登录 8邮箱注册验证码
# 6手机验证码登录 7邮箱验证码登录 8邮箱注册验证码 9验证手机号有效
def check_verification_code(code, send_type, value)
case send_type
when 1, 2, 4
when 1, 2, 4, 9
# 手机类型的发送
sigle_para = {phone: value}
status = Educoder::Sms.send(mobile: value, code: code)
@ -241,14 +241,18 @@ class ApplicationController < ActionController::Base
User.current = User.find 57703
end
if params[:debug] == 'teacher' #todo 为了测试,记得讲debug删除
User.current = User.find 81403
elsif params[:debug] == 'student'
User.current = User.find 8686
elsif params[:debug] == 'admin'
User.current = User.find 1
end
# 测试版前端需求
logger.info("######domain: #{request.host}")
if request.host == "47.96.87.25"
if params[:debug] == 'teacher' #todo 为了测试,记得讲debug删除
User.current = User.find 81403
elsif params[:debug] == 'student'
User.current = User.find 8686
elsif params[:debug] == 'admin'
User.current = User.find 1
end
end
# User.current = User.find 81403
end
@ -583,4 +587,8 @@ class ApplicationController < ActionController::Base
def render_parameter_missing
render json: { status: -1, message: '参数缺失' }
end
def set_export_cookies
cookies[:fileDownload] = true
end
end

@ -1027,7 +1027,10 @@ class CoursesController < ApplicationController
tip_exception(403,"无权限操作")
elsif @all_members.size == 0
normal_status(-1,"课堂暂时没有学生")
elsif params[:export].present? && params[:export]
normal_status(0,"正在下载中")
else
set_export_cookies
member_to_xlsx(@course, @all_members, @c_homeworks, @c_exercises, @c_tasks)
filename_ = "#{current_user.real_name}_#{@course.name}_全部成绩_#{Time.now.strftime('%Y%m%d_%H%M%S')}"
render xlsx: "#{format_sheet_name filename_.strip}",template: "courses/export_member_scores_excel.xlsx.axlsx",

@ -1256,9 +1256,12 @@ class ExercisesController < ApplicationController
normal_status(-1,"试卷未发布")
elsif (@exercise_users_size == 0) || ( @export_ex_users&.exercise_user_committed.size == 0)
normal_status(-1,"暂无用户提交")
elsif params[:export].present? && params[:export]
normal_status(0,"正在下载中")
else
respond_to do |format|
format.xlsx{
set_export_cookies
get_export_users(@exercise,@course,@export_ex_users)
exercise_export_name_ =
"#{current_user.real_name}_#{@course.name}_#{@exercise.exercise_name}_#{Time.now.strftime('%Y%m%d_%H%M%S')}"
@ -1281,7 +1284,12 @@ class ExercisesController < ApplicationController
@exercise_questions = @exercise.exercise_questions.includes(:exercise_choices).order("question_number ASC")
filename_ = "#{@exercise.user.real_name}_#{@course.name}_#{Time.now.strftime('%Y%m%d_%H%M%S')}.pdf"
stylesheets = "#{Rails.root}/app/templates/exercise_export/exercise_export.css"
render pdf: 'exercise_export/blank_exercise', filename: filename_, stylesheets: stylesheets
if params[:export].present? && params[:export]
normal_status(0,"正在下载中")
else
set_export_cookies
render pdf: 'exercise_export/blank_exercise', filename: filename_, stylesheets: stylesheets
end
end
#空白试卷预览页面,仅供测试使用,无其他任何用途

@ -116,10 +116,11 @@ class GamesController < ApplicationController
@qrcode_str = Base64.encode64( qr.to_img.resize(400,400).to_s )
else
@type = "image"
#conv = Iconv.new("GBK", "utf-8")
@game_challenge = @game.challenge
type = @game_challenge.show_type
@type = shixun_show_type type
workspace_path = @game.try(:picture_path)
@answer_path = "#{Rails.root}/#{workspace_path}/#{@game_challenge.expect_picture_path}"
@user_path = "#{Rails.root}/#{workspace_path}/#{@game_challenge.picture_path}"

@ -132,6 +132,8 @@ class GraduationTasksController < ApplicationController
tip_exception(403, "无权限操作")
elsif complete_works == 0
normal_status(-1,"暂无用户提交")
elsif params[:export].present? && params[:export]
normal_status(0,"正在下载中")
else
respond_to do |format|
format.xlsx{
@ -148,12 +150,17 @@ class GraduationTasksController < ApplicationController
zip_works = @work_excel.where("work_status > 0")
status = checkfileSize(zip_works)
if status == 0
respond_to do |format|
format.zip{
zipfile = zip_homework_common @task, zip_works
file = decode64(zipfile[0][:base64file])
send_file "#{OUTPUT_FOLDER}/#{file}", filename: filename_for_content_disposition(file), type: 'application/zip'
}
if params[:export].present? && params[:export]
normal_status(0,"正在下载中")
else
respond_to do |format|
format.zip{
set_export_cookies
zipfile = zip_homework_common @task, zip_works
file = decode64(zipfile[0][:base64file])
send_file "#{OUTPUT_FOLDER}/#{file}", filename: filename_for_content_disposition(file), type: 'application/zip'
}
end
end
else
normal_status(status,status == -2 ? "500M" : "无附件可下载")

@ -271,7 +271,12 @@ class GraduationTopicsController < ApplicationController
students = course.students.joins(user: :user_extension).order("user_extensions.student_id")
graduation_topic_to_xlsx(students,course)
topic_export_name_ = "#{current_user.real_name}_#{course.name}_毕设选题_#{Time.now.strftime('%Y%m%d_%H%M%S')}"
render xlsx: "#{topic_export_name_.strip}",template: "graduation_topics/export.xlsx.axlsx",locals: {table_columns:@topic_head_cells,topic_users:@topic_body_cells}
if params[:export].present? && params[:export]
normal_status(0,"正在下载中")
else
set_export_cookies
render xlsx: "#{topic_export_name_.strip}",template: "graduation_topics/export.xlsx.axlsx",locals: {table_columns:@topic_head_cells,topic_users:@topic_body_cells}
end
rescue Exception => e
uid_logger(e.message)
missing_template

@ -207,9 +207,12 @@ class HomeworkCommonsController < ApplicationController
tip_exception(403, "无权限操作")
elsif @work_excel.blank? || @work_excel.size == 0
normal_status(-1,"暂无用户提交!")
elsif params[:export].present? && params[:export]
normal_status(0,"正在下载中")
else
respond_to do |format|
format.xlsx{
set_export_cookies
student_work_to_xlsx(@work_excel,@homework)
exercise_export_name = "#{current_user.real_name}_#{@course.name}_#{@homework.name}_#{Time.now.strftime('%Y%m%d_%H%M%S')}"
render xlsx: "#{exercise_export_name.strip}",template: "homework_commons/works_list.xlsx.axlsx",locals:
@ -229,12 +232,17 @@ class HomeworkCommonsController < ApplicationController
end
if status == 0
respond_to do |format|
format.zip{
zipfile = zip_homework_common @homework, zip_works
file = decode64(zipfile[0][:base64file])
send_file "#{OUTPUT_FOLDER}/#{file}", filename: filename_for_content_disposition(file), type: 'application/zip'
}
if params[:export].present? && params[:export]
normal_status(0,"正在下载中")
else
respond_to do |format|
format.zip{
set_export_cookies
zipfile = zip_homework_common @homework, zip_works
file = decode64(zipfile[0][:base64file])
send_file "#{OUTPUT_FOLDER}/#{file}", filename: filename_for_content_disposition(file), type: 'application/zip'
}
end
end
else
normal_status(status, status == -2 ? "500M" : "无附件可下载")

@ -24,7 +24,7 @@ class MyshixunsController < ApplicationController
ActiveRecord::Base.transaction do
begin
@shixun = Shixun.select(:id, :identifier).find(@myshixun.shixun_id)
@myshixun.destroy
@myshixun.destroy!
StudentWork.where(:myshixun_id => @myshixun.id).update_all(:myshixun_id => 0, :work_status => 0)

@ -945,9 +945,12 @@ class PollsController < ApplicationController
tip_exception(403,"无权限操作")
elsif (@poll.polls_status == 1) || (@poll_export_questions.size == 0) || (@poll_commit_ids.size == 0)
normal_status(-1,"暂无用户提交")
elsif params[:export].present? && params[:export]
normal_status(0,"正在下载中")
else
respond_to do |format|
format.xlsx{
set_export_cookies
polls_export_name_ = "#{current_user.real_name}_#{@course.name}_#{@poll.polls_name}_#{Time.now.strftime('%Y%m%d_%H%M%S')}"
polls_user_commit = poll_commit_result(@poll,@poll_export_questions,@poll_users,@poll_commit_ids)
render xlsx: "#{polls_export_name_.strip}",template: "polls/commit_result.xlsx.axlsx",locals: {polls_user_commit:polls_user_commit}

@ -1,10 +1,2 @@
class ProjectsController < ApplicationController
def search
query_params = { keyword: params[:keyword], category: 'manage' }
projects = Users::ProjectService.new(current_user, query_params).call
params[:limit] = params[:per_page].to_i.zero? ? 20 : params[:per_page].to_i
@count = projects.count
@projects = paginate projects
end
end

@ -43,7 +43,7 @@ class Users::BaseController < ApplicationController
page = page_value
per_page = per_page_value
return Kaminari.paginate_array(objs).page(page).per(per_page) unless observed_logged_user? && opts[:special]
return Kaminari.paginate_array(objs).page(page).per(per_page) unless opts[:special] && observed_logged_user?
# note: 为实现第一页少一条记录,让前端放置新建入口
if page == 1

@ -1,4 +1,6 @@
class Users::ProjectsController < Users::BaseController
skip_before_action :check_observed_user_exists!, only: [:search]
def index
projects = Users::ProjectService.new(observed_user, query_params).call
@ -6,6 +8,15 @@ class Users::ProjectsController < Users::BaseController
@projects = paginate(projects.includes(:project_score, owner: { user_extension: :school }), special: true)
end
def search
query_params = { keyword: params[:keyword], category: 'manage' }
projects = Users::ProjectService.new(current_user, query_params).call
params[:limit] = params[:per_page].to_i.zero? ? 20 : params[:per_page].to_i
@count = projects.count
@projects = paginate projects
end
private
def query_params

@ -8,7 +8,13 @@ class ZipsController < ApplicationController
def shixun_report
service = BatchExportShixunReportService.new(@homework, @all_student_works)
filename_ = filename_for_content_disposition(service.filename)
send_file service.zip, filename: filename_, type: 'application/zip'
if params[:export].present? && params[:export]
normal_status(0,"正在下载中")
else
set_export_cookies
send_file service.zip, filename: filename_, type: 'application/zip'
end
rescue BatchExportShixunReportService::Error => ex
normal_status(-1, ex.message)
end
@ -18,7 +24,12 @@ class ZipsController < ApplicationController
exercises = ExportExercisesService.new(@exercise,@ex_users,@request_url)
file_name_ = filename_for_content_disposition(exercises.filename)
send_file exercises.ex_zip, filename: file_name_, type: 'application/zip'
if params[:export].present? && params[:export]
normal_status(0,"正在下载中")
else
set_export_cookies
send_file exercises.ex_zip, filename: file_name_, type: 'application/zip'
end
rescue Exception => e
normal_status(-1, e.message)
end

@ -6,7 +6,7 @@ module GamesHelper
end
# 获取目录下所有文件,返回一个文件名的数组 type是查看文件的类型image表示图片
# type [[1, "图片"], [2, "apk/exe"], [3, "txt"], [4, "html"]]
# type [[1, "图片"], [2, "apk/exe"], [3, "txt"], [4, "html"], [5, "mp3"], [6, "mp4"]]
def get_dir_filename(path, type, game_id)
answer_picture = []
return answer_picture unless File.directory?(path)
@ -39,6 +39,12 @@ module GamesHelper
end
f.close
@type = 'txt'
elsif extension == 'mp3' && type == 5
answer_picture << file
@type = 'mp3'
elsif extension == 'mp4' && type == 6
answer_picture << file
@type = 'mp4'
end
end
@ -51,4 +57,21 @@ module GamesHelper
"编译失败,请在测试结果中查看具体的错误信息" : test_set.try(:actual_output)
end
end
def shixun_show_type type
case type.to_i
when 1
"image"
when 2
"apk/exe"
when 3
"txt"
when 4
"html"
when 5
"mp3"
when 6
"mp4"
end
end
end

@ -1,5 +1,6 @@
class Challenge < ApplicationRecord
# difficulty: 关卡难度: 1.简单 2.中等 3.困难
# show_type: 效果展示:-1.无效果 1.图片 2.apk/exe 3.txt 4.html 5.mp3 6.mp4
default_scope { order("challenges.position asc") }
belongs_to :shixun, :touch => true, counter_cache: true

@ -3,7 +3,7 @@ class PrivateMessages::CreateService < ApplicationService
attr_reader :sender, :receiver, :params
def initialize(sender, receiver, **params)
def initialize(sender, receiver, params)
@sender = sender
@receiver = receiver
@params = params

@ -24,5 +24,30 @@ elsif @type == "txt"
json.contents @contents.html_safe
elsif @type =="qrcode"
json.qrcode_str @qrcode_str
elsif @type == "mp3" || @type == "mp4"
if @type == "mp4"
json.orignal_file [{"file_url": "http://120.27.231.56:48080/attachments/download/378171/123.mp4"}]
json.user_file [{"file_url": "http://120.27.231.56:48080/attachments/download/378172/456.mp4"}]
json.answer_file [{"file_url": "http://120.27.231.56:48080/attachments/download/378173/789.mp4"}]
else
json.orignal_file [{"file_url": "http://120.27.231.56:48080/attachments/download/378174/58099.mp3"}]
json.user_file [{"file_url": "http://120.27.231.56:48080/attachments/download/378175/654058514.mp3"}]
json.answer_file [{"file_url": "http://120.27.231.56:48080/attachments/download/378175/654058514.mp3"}]
end
# json.orignal_file do
# json.array! @orignal_picture do |file|
# json.file_url attachment_show_users_path(:file_name => file, :path => @original_path)
# end
# end
# json.user_file do
# json.array! @user_picture do |file|
# json.file_url attachment_show_users_path(:file_name => file, :path => @user_path, :time => Time.now.to_i)
# end
# end
# json.answer_file do
# json.array! @answer_picture do |file|
# json.file_url attachment_show_users_path(:file_name => file, :path => @answer_path)
# end
# end
end

@ -1,4 +1,5 @@
json.username @user.full_name
json.real_name @user.real_name
json.login @user.login
json.user_id @user.id
json.image_url url_to_avatar(@user)

@ -84,7 +84,7 @@ Rails.application.routes.draw do
get :system_update
resource :trial_apply, only: [:create]
resources :projects, only: [] do
resources :projects, module: :users, only: [] do
get :search, on: :collection
end

@ -5,9 +5,9 @@
<title>EduCoder</title>
<meta name="viewport" content="width=device-width,initial-scale=1">
<link rel="stylesheet" type="text/css" href="/stylesheets/css/edu-common.css?1525440977">
<link rel="stylesheet" type="text/css" href="/stylesheets/educoder/edu-main.css?1525440977">
<link rel="stylesheet" type="text/css" href="/stylesheets/educoder/edu-all.css?1525440977">
<link rel="stylesheet" type="text/css" href="/stylesheets/css/edu-common.css?15254409771">
<link rel="stylesheet" type="text/css" href="/stylesheets/educoder/edu-main.css?15254409771">
<link rel="stylesheet" type="text/css" href="/stylesheets/educoder/edu-all.css?15254409771">
</head>
<body style="" data-gr-c-s-loaded="true">

Binary file not shown.

After

Width:  |  Height:  |  Size: 53 KiB

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -332,8 +332,12 @@ label.infolabel{display: block;float: left;width: 56px;text-align: right;margin-
}
.shixunDes{font-family: 'panmen-webfont';display: block;position: absolute;height: 100%;width: 100%;text-align: center;line-height: 220px;color: #fff;top: 0px;font-size: 24px;background-color: rgba(5,16,26,0.4);border-radius: 6px 6px 0px 0px;}
/*TPM*/
.shixunDetail_top{width: 100%;background-image: url("/images/educoder/shixun-detail.jpg");background-size: 100% 100%;height: 240px;
justify-content: center;align-items: center;display: -webkit-flex;}
.shixunDetail_top{width: 100%;background-image: url("/images/educoder/shixun-detail.jpg"); height: 240px;
justify-content: center;align-items: center;display: -webkit-flex;
background-size: cover;
background-position: center;
background-repeat: no-repeat;
}
.task-item{margin-top: 30px;padding-bottom: 30px;border-bottom: 1px solid #eee}
.task-item:last-child{border-bottom: none;}
.challengeNav a.active{color: #4CACFF;}
@ -420,14 +424,23 @@ table.text-file{}
/*-------------------------------实训路径-------------------------------*/
.path-head{width: 100%;height: 300px;background-image: url("/images/educoder/path.jpg");background-color: #081C4B;background-size: 100% 100%;}
.path-head{width: 100%;height: 300px;background-image: url("/images/educoder/path.png");
background-color: #081C4B;
background-size: cover;
background-position: center;
background-repeat: no-repeat;
}
.pathNavLine{position: absolute;bottom: -8px;width: 100%;}
.path-nav li{float: left;padding: 0px 30px;height: 42px;}
.path-nav li a{color:#fff;font-size: 16px;display: block; height: 40px;}
.path-nav li.active a{border-bottom: 3px solid #4CACFF;color:#4CACFF;}
/*---实训路径详情----*/
.subhead{width: 100%;margin-bottom:40px;background-size: 100% 100%;background-image: url("/images/educoder/path-detail.jpg");height: 240px;
justify-content: center;align-items: center;display: -webkit-flex;}
justify-content: center;align-items: center;display: -webkit-flex;
background-size: cover;
background-position: center;
background-repeat: no-repeat;
}
.subhead_content{width: 1200px;margin: 0px auto;}
.pathInfo li{text-align: center;float: left;margin-right: 38px;}
.pathInfo li span{display: block;}
@ -467,7 +480,11 @@ li.li-width7{width: 7%;text-align: left}
/*-----------------------------在线课堂动态----------------------------------*/
.courseHead{width: 100%;margin-bottom:40px;background-size: 100% 100%;background-image: url("/images/educoder/course-detail.jpg");height: 240px;
justify-content: center;align-items: center;display: -webkit-flex;}
justify-content: center;align-items: center;display: -webkit-flex;
background-size: cover;
background-position: center;
background-repeat: no-repeat;
}
.invite-tip{position: absolute;top: -5px;right: 140px;color: #fff; box-sizing: border-box;width: 170px;text-align: center;border-radius: 2px;background-color: rgba(5,16,26,0.6)}
.inviteTipbtn a{font-size:14px;width: 100%;height: 30px;line-height: 30px;display: block;color: #747A7F;background-color: rgba(5,16,26,0.4)}
.inviteTipbtn a:hover{color: #4cacff!important;}

@ -288,20 +288,9 @@ class App extends Component {
<Trialapplicationreview {...this.props} {...this.state}></Trialapplicationreview>
<Addcourses {...this.props} {...this.state}/>
<AccountProfile {...this.props} {...this.state}/>
{/*{*/}
{/* isRender === true?*/}
{/* <LoginDialog></LoginDialog> : ""*/}
{/*}*/}
{/*{*/}
{/* isRenders === true?*/}
{/*<Trialapplication></Trialapplication>*/}
{/*:""*/}
{/*}*/}
<Router>
<Switch>
{/*<Route path="/login" component={LoginRegisterPage}/>*/}
{/*众包创新*/}
<Route path={"/crowdsourcings"} component={ProjectPackages}/>
@ -327,9 +316,7 @@ class App extends Component {
render={
(props) => (<UsersInfo {...this.props} {...props} {...this.state} />)
}></Route>
{/*<Route*/}
{/* path="/trialapplication" component={Trialapplication}*/}
{/*/>*/}
<Route
path="/changepassword" component={EducoderLogin}
/>
@ -349,14 +336,6 @@ class App extends Component {
{/*列表页*/}
<Route path="/shixuns" component={TPMShixunsIndexComponent}/>
{/* <Route path="/shixunchild" component={TPMShixunchildIndexComponent}>
</Route>
<Route path="/fork_list" component={TPMshixunfork_listIndexComponent}>
</Route> */}
{/*<Route path="/forums" component={ForumsIndexComponent}>*/}
{/*</Route>*/}
{/*实训课程(原实训路径)*/}
<Route path="/paths" component={ShixunPaths}></Route>
@ -370,16 +349,9 @@ class App extends Component {
{/*课堂*/}
<Route path="/courses" component={CoursesIndex} {...this.props}></Route>
{/* 课堂讨论 */}
{/* <Route path="/board" component = {BoardIndex} {...this.props}></Route> */}
{/* <Route path="/tpforums" component={TPForumsIndexComponent}>
</Route> */}
{/* <Route path="/myshixuns/:shixunId/stages/:stageId" component={Index}/> */}
{/* 兴趣页面*/}
{/*<Route path="/interest" component={Interestpage}/>*/}
{/* <Route path="/forums" component={ForumsIndexComponent}>
</Route> */}
<Route path="/comment" component={CommentComponent}/>
<Route path="/testMaterial" component={TestMaterialDesignComponent}/>
<Route path="/test" component={TestIndex}/>
@ -387,14 +359,9 @@ class App extends Component {
<Route path="/testRCComponent" component={TestComponent}/>
<Route path="/testUrlQuery" component={TestUrlQueryComponent}/>
{/* <Route component={NotFoundPage}/> */}
{/*列表页*/}
{/*<Route component={TPMShixunsIndexComponent}/>*/}
{/*首页*/}
<Route exact path="/" component={ShixunsHome}/>
<Route component={Shixunnopage}/>
{/*<Route component={ShixunsHome}/>*/}
</Switch>
</Router>

@ -0,0 +1,79 @@
import React,{ Component } from "react";
import { getUrl2 } from "educoder";
const $ = window.$
let _url_origin = getUrl2()
class Clappr extends Component{
constructor(props){
super(props);
this.state={
}
}
componentDidMount() {
const source = this.props.source || "http://your.video/here.mp4"
const { id } = this.props
const _id = `#_player${id}`
if (window['Clappr']) {
const player = new window.Clappr.Player({
source: source, parentId: _id,
plugins: {
'core': [window.Clappr.MediaControl, window.Clappr.Playback]
}
});
} else {
$.getScript(
`${_url_origin}/javascripts/media/clappr.min.js`,
(data, textStatus, jqxhr) => {
window.clappr = window.Clappr
$.getScript(
`${_url_origin}/javascripts/media/clappr-playback-rate-plugin.min.js`,
(data, textStatus, jqxhr) => {
const player = new window.Clappr.Player({
source: source, parentId: _id,
plugins: {
'core': [window.Clappr.MediaControl, window['clappr-playback-rate-plugin'].default]
}
});
})
});
//
// $.when(
// $.getScript( `${_url_origin}/javascripts/media/clappr.min.js` ),
// // $.getScript( `${_url_origin}/javascripts/media/clappr-thumbnails-plugin.js` ),
// $.getScript( `${_url_origin}/javascripts/media/clappr-playback-rate-plugin.min.js` ),
// $.Deferred(function( deferred ){
// $( deferred.resolve );
// })
// ).done(function(){
// //place your code here, the scripts are all loaded
// const player = new window.Clappr.Player({
// source: source, parentId: _id,
// plugins: {
// 'core': [window.Clappr.MediaControl, window.Clappr.Playback]
// }
// });
// });
}
}
render(){
let { source, id, className } = this.props;
const _id = `_player${id}`
return(
<React.Fragment>
<style>{`
.playback_rate {
margin-right: 16px;
}
`}</style>
<div id={_id} className={className}></div>
</React.Fragment>
)
}
}
export default Clappr;

@ -53,6 +53,8 @@ export { default as MarkdownToHtml } from './components/markdown/MarkdownToHtml'
export { default as DMDEditor } from './components/markdown/DMDEditor'
export { default as Clappr } from './components/media/Clappr'
export { default as ImageLayerHook } from './hooks/ImageLayerHook'

@ -0,0 +1,50 @@
import React, { Component } from 'react';
class EffectDisplayContent extends Component {
constructor(props) {
super(props)
this.state = {
}
}
render() {
const { typeName, content1, content2, content3 } = this.props;
return (
<div className="task-popup-content effectDisplay">
<style>{`
.effectDisplay .content_title {
flex: 1 1 0
}
.effectDisplay .content>div {
flex: 1
}
.effectDisplay .clappr {
display: flex;
justify-content: center;
}
.effectDisplay .clappr>div {
width: 400px !important;
}
`}</style>
<div className="clearfix df">
{content1 && <p className="content_title edu-txt-center fl mr03precent font-18">原始{typeName}</p>}
{content2 && <p className="content_title edu-txt-center fl font-18 mr03precent">实际输出{typeName}</p>}
{content3 && <p className="content_title edu-txt-center fl font-18 mr03precent">预期输出{typeName}</p>}
</div>
<div className="clearfix df content" >
{content1 && <div className="fl mr03precent pt10 mb50">
{content1}
</div>}
{content2 && <div className="fl mr03precent pt10 mb50">
{content2}
</div>}
{content3 && <div className="fl mr03precent pt10 mb50">
{content3}
</div>}
</div>
</div>
);
}
}
export default EffectDisplayContent;

@ -2,9 +2,9 @@ import React, { Component } from 'react';
import { Redirect } from 'react-router';
import PropTypes from 'prop-types';
import { Clappr } from 'educoder'
import axios from 'axios';
import EffectDisplayContent from './EffectDisplayContent'
class EvaluateSuccessEffectDisplay extends Component {
constructor(props) {
super(props)
@ -35,7 +35,8 @@ class EvaluateSuccessEffectDisplay extends Component {
// qrcode
// const type = 'image' // 'qrcode'
const { type, qrcode_str,
answer_picture, orignal_picture, user_picture, contents } = this.props;
answer_picture, orignal_picture, user_picture, contents,
user_file, answer_file, orignal_file } = this.props;
if (type == 'qrcode') {
// 单张图片比如安卓评测完显示qrcode
return (
@ -54,22 +55,35 @@ class EvaluateSuccessEffectDisplay extends Component {
return (
<div className="task-popup-content">
<div className="clearfix">
<p className="edu-txt-center fl with33 mr03precent font-18">原始图片</p>
{orignal_picture[0] && <p className="edu-txt-center fl with33 mr03precent font-18">原始图片</p>}
<p className="edu-txt-center fl font-18 with33 mr03precent">实际输出图片</p>
<p className="edu-txt-center fl font-18 with33 mr03precent">预期输出图片</p>
</div>
<div className="clearfix" id="picture-content">
{orignal_picture[0] && <div className="fl with33 mr03precent pt10 mb50">
{orignal_picture.map(item => {
return (
<img alt="Icon"
src={ item.pic_url}/> )
})}
{/* {orignal_picture[0] && <img alt="Icon"
src={ orignal_picture[0].pic_url}/>} */}
</div>}
<div className="fl with33 mr03precent pt10 mb50">
{orignal_picture[0] && <img alt="Icon"
src={ orignal_picture[0].pic_url}/>}
</div>
<div className="fl with33 mr03precent pt10 mb50">
{user_picture[0] && <img alt="Icon"
src={ user_picture[0].pic_url }/>}
</div>
{user_picture.map(item => {
return (
<img alt="Icon"
src={ item.pic_url}/> )
})}
</div>
<div className="fl with33 mr03precent pt10 mb50">
{ answer_picture[0] && <img alt="Icon"
src={ answer_picture[0].pic_url}/> }
{answer_picture.map(item => {
return (
<img alt="Icon"
src={ item.pic_url}/> )
})}
{/* { answer_picture[0] && <img alt="Icon"
src={ answer_picture[0].pic_url}/> } */}
</div>
</div>
</div>
@ -88,7 +102,31 @@ class EvaluateSuccessEffectDisplay extends Component {
return (
<iframe id="_displayIframe"></iframe>
)
}
} else if (type == 'mp3') {
return (
<EffectDisplayContent
typeName="音频"
content1={ orignal_file[0] && orignal_file[0].file_url
? <Clappr source={orignal_file[0].file_url} id="1" className="clappr"></Clappr> : null }
content2={ user_file[0] && user_file[0].file_url
? <Clappr source={user_file[0].file_url} id="2" className="clappr"></Clappr> : null }
content3={ answer_file[0] && answer_file[0].file_url
? <Clappr source={answer_file[0].file_url} id="3" className="clappr"></Clappr> : null }
></EffectDisplayContent>
)
} else if (type == 'mp4') {
return (
<EffectDisplayContent
typeName="视频"
content1={ orignal_file[0] && orignal_file[0].file_url
? <Clappr source={orignal_file[0].file_url} id="1" className="clappr"></Clappr> : null }
content2={ user_file[0] && user_file[0].file_url
? <Clappr source={user_file[0].file_url} id="2" className="clappr"></Clappr> : null }
content3={ answer_file[0] && answer_file[0].file_url
? <Clappr source={answer_file[0].file_url} id="3" className="clappr"></Clappr> : null }
></EffectDisplayContent>
)
}
/* <div className="with49 fr">
<p className="font-18 mb20 edu-txt-center">预期输出</p>

@ -66,7 +66,7 @@ class CommonWorkDetailIndex extends Component{
this.state = {
DownloadType:false,
DownloadMessageval:undefined,
donwloading: false,
donwloading:false,
}
}
initWorkDetailCommonState = (data) => {
@ -106,7 +106,10 @@ class CommonWorkDetailIndex extends Component{
/// 确认是否下载
confirmysl(url){
axios.get(url).then((response) => {
axios.get(url+ '&export=true').then((response) => {
if(response===undefined){
return
}
if(response.data.status&&response.data.status===-1){
}else if(response.data.status&&response.data.status===-2){
@ -187,7 +190,9 @@ class CommonWorkDetailIndex extends Component{
let params = {}
if (isListModule) {
// TODO
params =this.child._getRequestParams()!==undefined?this.child._getRequestParams():{};
if(this.child!=undefined) {
params = this.child._getRequestParams() !== undefined ? this.child._getRequestParams() : {};
}
}
// console.log("普通作业176176176");
// console.log(params);
@ -311,15 +316,15 @@ class CommonWorkDetailIndex extends Component{
导出<i className="iconfont icon-xiajiantou font-12 ml2"></i>
<ul className="drop_down_menu" style={{"right":"-34px","left":"unset","height":"auto"}}>
<li>
<a href={"javascript:void(0)"} className="color-dark"
onClick={() => this.confirmysl(exportResultUrl, exportParams)}
onClick={() => this.confirmysl(exportResultUrl)}
>导出成绩</a>
</li>
<li>
<a href={"javascript:void(0)"} className="color-dark"
onClick={() => this.confirmysl(exportUrl, exportParams)}
onClick={() => this.confirmysl(exportUrl)}
>导出作品附件</a>
</li>
</ul>

@ -425,7 +425,8 @@ class CommonWorkList extends Component{
teacher_comment: arg_teacher_comment.length == 0 ? '' : arg_teacher_comment[0],
order,
limit: PAGE_SIZE,
b_order: orderMap[order]
b_order: orderMap[order],
group_id:arg_course_group,
}
}
fetchList = () => {

@ -44,7 +44,7 @@ class TabRightComponents extends Component{
}
/// 确认是否下载
confirmysl(url){
axios.get(url).then((response) => {
axios.get(url + '?export=true' ).then((response) => {
if(response.data.status&&response.data.status===-1){
}else if(response.data.status&&response.data.status===-2){

@ -1,33 +1,35 @@
.courses-head{
width: 100%;
height: 300px;
background-image: url(./courses.jpg);
background-color: #081C4B;
background-size: 100% 100%;
}
a{
text-decoration: none;
color: #05101a;
}
.ant-input-affix-wrapper .ant-input:not(:last-child) {
padding-right: 24px;
}
.memberscount{
font-size: 55px !important;
background: #fff;
color: #dfdfdf;
display: inline-block;
padding-right: 15px;
}
.biaoqiancours{
overflow: hidden;
position: relative;
}
.coursesover{
position: absolute;
color: #fff;
left: 17px;
background: #dfdfdf;
width: 200px;
.courses-head{
width: 100%;
height: 300px;
background-image: url(./courses.jpg);
background-color: #081C4B;
background-size: cover;
background-position: center;
background-repeat: no-repeat;
}
a{
text-decoration: none;
color: #05101a;
}
.ant-input-affix-wrapper .ant-input:not(:last-child) {
padding-right: 24px;
}
.memberscount{
font-size: 55px !important;
background: #fff;
color: #dfdfdf;
display: inline-block;
padding-right: 15px;
}
.biaoqiancours{
overflow: hidden;
position: relative;
}
.coursesover{
position: absolute;
color: #fff;
left: 17px;
background: #dfdfdf;
width: 200px;
}

@ -20,6 +20,14 @@ function disabledDateTime() {
// disabledSeconds: () => [55, 56],
};
}
function disabledDate(current) {
return current && current < moment().endOf('day').subtract(1, 'days');
}
class HomeworkModal extends Component{
constructor(props){
super(props);
@ -81,7 +89,7 @@ class HomeworkModal extends Component{
// console.log('startValue',dateString);
this.setState({
endtime: handleDateString(dateString),
endtime: date===null?"":handleDateString(dateString),
})
}
@ -188,6 +196,7 @@ class HomeworkModal extends Component{
dropdownClassName="hideDisable"
showTime={{ format: 'HH:mm' }}
disabledTime={disabledDateTime}
disabledDate={disabledDate}
showToday={false}
locale={locale}
format={dateFormat}

@ -16,12 +16,17 @@ function range(start, end) {
}
return result;
}
function disabledDateTime() {
return {
disabledMinutes: () => range(1, 30).concat(range(31, 60)),
// disabledSeconds: () => range(1,60)
}
}
function disabledDate(current) {
return current && current < moment().endOf('day').subtract(1, 'days');
}
class Selectsetting extends Component{
constructor(props){
super(props);
@ -698,6 +703,7 @@ class Selectsetting extends Component{
onChange={(e,index)=>this.onChangeTimepublishs(e,index,key)}
// onChange={ this.onChangeTimepublish }
disabledTime={disabledDateTime}
disabledDate={disabledDate}
/>
{key!=0?<i className="iconfont icon-shanchu color-grey-c font-14 font-n ml20" onClick={()=>this.deletegrouppublish(key)}></i>:""}
@ -730,7 +736,7 @@ class Selectsetting extends Component{
value={datatime===undefined||datatime===""?"":moment(datatime, dateFormat)}
onChange={this.onChangeTimepublish}
disabledTime={disabledDateTime}
disabledDate={disabledDate}
/>
</span>
</p>:""}

@ -22,6 +22,11 @@ function disabledDateTime() {
};
}
function disabledDate(current) {
return current && current < moment().endOf('day').subtract(1, 'days');
}
const dateFormat="YYYY-MM-DD HH:mm";
class Sendresource extends Component{
constructor(props){
@ -525,6 +530,7 @@ class Sendresource extends Component{
onChange={(e,index)=>this.onChangeTimepublish(e,index,key,2)}
// onChange={ this.onChangeTimepublish }
disabledTime={disabledDateTime}
disabledDate={disabledDate}
/>
{key!=0?<i className="iconfont icon-shanchu color-grey-c font-14 font-n ml20" onClick={()=>this.deletegrouppublish(key)}></i>:""}
{key===course_group_publish_times.length-1&&key<this.state.course_groups_count-1?<i className="iconfont icon-tianjiafangda color-green ml15" onClick={this.addgrouppublish}></i>:""}
@ -551,7 +557,7 @@ class Sendresource extends Component{
value={datatime===undefined||datatime===""?undefined:moment(datatime, dateFormat)}
onChange={(e,index)=>this.onChangeTimepublish(e,index,undefined,1)}
disabledTime={disabledDateTime}
disabledDate={disabledDate}
/>
</span>
</p>:""}

@ -33,6 +33,21 @@ class ExerciseDisplay extends Component{
this.state = {
exercise_questions: [],
exercise_group_id:[],
page:1,
limit:10,
searchtext:"",
order: "end_at",
}
}
_getRequestParams() {
const { order, exercise_group_id,searchtext, page ,limit} = this.state
return {
page,
search:searchtext,
order,
limit: limit,
group_id:exercise_group_id,
}
}
componentDidMount = () => {
@ -49,6 +64,21 @@ class ExerciseDisplay extends Component{
console.log(error);
});
}
try {
this.props.triggerRef(this);
}catch (e) {
}
}
_getRequestParams() {
const { order, exercise_group_id,searchtext, page ,limit} = this.state
return {
page,
search:searchtext,
order,
limit: limit,
group_id:exercise_group_id,
}
}
render() {
// let { question_title, question_score, question_type, question_choices, standard_answer,

@ -23,6 +23,7 @@ function range(start, end) {
}
return result;
}
function disabledDateTime() {
return {
// disabledHours: () => range(0, 24).splice(4, 20),
@ -30,6 +31,11 @@ function disabledDateTime() {
// disabledSeconds: () => [0, 60],
};
}
function disabledDate(current) {
return current && current < moment().endOf('day').subtract(1, 'days');
}
const dataformat="YYYY-MM-DD HH:mm";
class Exercisesetting extends Component{
@ -63,17 +69,46 @@ class Exercisesetting extends Component{
choice_random:true,
time:0,
publish_timetype:false,
end_timetype:false
end_timetype:false,
exercise_group_id:[],
page:1,
limit:10,
searchtext:"",
order: "end_at",
}
console.log("Exercisesetting");
console.log("69");
console.log(props);
}
_getRequestParams() {
const { order, exercise_group_id,searchtext, page ,limit} = this.state
return {
page,
search:searchtext,
order,
limit: limit,
group_id:exercise_group_id,
}
}
//加载
componentDidMount=()=>{
this.getSettingInfo();
// window.addEventListener('click', this.handleClick);
try {
this.props.triggerRef(this);
}catch (e) {
}
}
_getRequestParams() {
const { order, exercise_group_id,searchtext, page ,limit} = this.state
return {
page,
search:searchtext,
order,
limit: limit,
group_id:exercise_group_id,
}
}
// handleClick=(e)=>{
@ -607,6 +642,7 @@ class Exercisesetting extends Component{
format="YYYY-MM-DD HH:mm"
showToday={false}
disabledTime={disabledDateTime}
disabledDate={disabledDate}
onChange={this.onChangeTimepublish}
value={publish_time && moment(publish_time,"YYYY-MM-DD HH:mm")}
disabled={ publish_timetype===true?true:!flagPageEdit }
@ -632,6 +668,7 @@ class Exercisesetting extends Component{
width={"240px"}
format="YYYY-MM-DD HH:mm"
disabledTime={disabledDateTime}
disabledDate={disabledDate}
onChange={this.onChangeTimeEnd}
value={end_time && moment(end_time,"YYYY-MM-DD HH:mm")}
disabled={ end_timetype===true?true:!flagPageEdit}

@ -23,15 +23,32 @@ class Exercisestatisticalresult extends Component {
exercise_group_id:[],
page:1,
limit:10,
searchtext:"",
order: "end_at",
}
}
componentDidMount() {
let{sort,exercise_group_id,page,limit}=this.state;
this.updatefun(sort,exercise_group_id,page,limit)
}
this.updatefun(sort,exercise_group_id,page,limit);
try {
this.props.triggerRef(this);
}catch (e) {
}
}
_getRequestParams() {
const { order, exercise_group_id,searchtext, page ,limit} = this.state
return {
page,
search:searchtext,
order,
limit: limit,
group_id:exercise_group_id,
}
}
updatefun=(sort,exercise_group_id,page,limit)=>{
let ExerciseId=this.props.match.params.Id;
let url = `/exercises/`+ExerciseId+`/exercise_result.json`;

@ -1213,6 +1213,11 @@ class Studentshavecompletedthelist extends Component {
// console.log("2222222222222");
// console.log(this.props.isAdmin());
// }
try {
this.props.triggerRef(this);
}catch (e) {
}
}
componentWillReceiveProps = (nextProps) => {
@ -1384,7 +1389,8 @@ class Studentshavecompletedthelist extends Component {
loadingstate: true,
})
}
console.log(response);
console.log(1393);
thiss.Generatenewdatasy(response.data.exercise_users, response);
}
}).catch((error) => {
@ -1984,9 +1990,14 @@ class Studentshavecompletedthelist extends Component {
}).then((response) => {
// console.log("528");
// console.log(JSON.stringify(response));
if(response===undefined){
return
}
this.setState({
loadingstate: false,
})
console.log(response);
console.log(1997);
this.Generatenewdatasy(response.data.exercise_users, response);
}).catch((error) => {
console.log(error)
@ -2279,22 +2290,8 @@ class Studentshavecompletedthelist extends Component {
this.Searchdatasys(this.state.order, this.state.commit_status, this.state.review, this.state.checkedValuesineinfo, this.state.searchtext, 1, this.state.limit);
}
}
//搜索学生 文字输入
inputSearchValues = (e) => {
// console.log(e.target.value)
if (e.target.value === "") {
this.setState({
searchtext: undefined,
})
} else {
this.setState({
searchtext: e.target.value,
})
}
}
//搜索学生按钮输入
};
//搜索学生按钮输入 老师
searchValues = (value) => {
//点击直接搜索
// if(value === ""){
@ -2313,8 +2310,36 @@ class Studentshavecompletedthelist extends Component {
// console.log(value)
};
_getRequestParams() {
const { order, checkedValuesineinfo,course_groupyslstwo ,searchtext, page ,limit,course_groupyslsthree} = this.state
return {
page,
review:course_groupyslsthree,
commit_status:course_groupyslstwo,
search:searchtext,
exercise_group_id:checkedValuesineinfo,
limit: limit,
order,
}
}
//搜索学生 文字输入
inputSearchValues = (e) => {
// console.log(e.target.value)
if (e.target.value === "") {
this.setState({
searchtext: undefined,
})
} else {
this.setState({
searchtext: e.target.value,
})
}
};
//排序
funordersy = (e) => {
if (e === "end_at") {

@ -1,7 +1,7 @@
import React,{ Component } from "react";
import {Checkbox,Input,Table, Pagination,Menu} from "antd";
import {Checkbox,Input,Table, Pagination,Menu,Spin} from "antd";
import {Link,NavLink} from 'react-router-dom';
import { WordsBtn ,ActionBtn} from 'educoder';
import { WordsBtn ,ActionBtn,queryString,downloadFile} from 'educoder';
import CoursesListType from '../coursesPublic/CoursesListType';
import '../css/members.css';
import '../css/busyWork.css';
@ -19,7 +19,7 @@ import Ecerciseallbackagain from './Ecerciseallbackagain';
const polls_status={1:"未发布",2:"提交中",3:"已截止",4:"已结束"}
const start_Value={0:"继续答题",1:"查看答题",2:"开始答题"}
const qs = require('qs');
//试卷主要设置页面
class Testpapersettinghomepage extends Component{
constructor(props) {
@ -33,6 +33,7 @@ class Testpapersettinghomepage extends Component{
current_status:undefined,
DownloadType:false,
DownloadMessageval:undefined,
donwloading:false,
}
}
//切换tab
@ -163,8 +164,17 @@ class Testpapersettinghomepage extends Component{
}
/// 确认是否下载
confirmysl(url){
axios.get(url).then((response) => {
confirmysl(url,child){
let params ={}
if(child!=undefined){
params =child._getRequestParams()!==undefined?child._getRequestParams():{};
}
console.log("170");
console.log(params);
axios.get(url+`?${queryString.stringify(params)}`+ '&export=true').then((response) => {
if(response===undefined){
return
}
if(response.data.status&&response.data.status===-1){
}else if(response.data.status&&response.data.status===-2){
@ -183,8 +193,21 @@ class Testpapersettinghomepage extends Component{
})
}
}else {
this.props.showNotification(`正在下载中`);
window.open("/api"+url, '_blank');
this.setState({ donwloading: true })
downloadFile({
url: url+`?${queryString.stringify(params)}`+ '&export=true',
successCallback: (url) => {
this.setState({ donwloading: false });
console.log('successCallback')
},
failCallback: (responseHtml, url) => {
this.setState({ donwloading: false });
console.log('failCallback')
}
})
this.props.showNotification(`正在下载中`);
// window.open("/api"+url+`?${queryString.stringify(params)}`+ '&export=true', '_blank');
}
}).catch((error) => {
console.log(error)
@ -218,6 +241,7 @@ class Testpapersettinghomepage extends Component{
// DownloadMessageval:undefined
// })
// }
bindRef = ref => { this.child = ref };
goback=()=>{
// let {datalist}=this.state;
// let courseId=this.props.match.params.coursesId;
@ -236,6 +260,7 @@ class Testpapersettinghomepage extends Component{
let {tab,visible,Commonheadofthetestpaper}=this.state;
const isAdmin =this.props.isAdmin();
const isStudent = this.props.isStudent();
// TODO
return(
<div className="newMain clearfix ">
@ -342,14 +367,14 @@ class Testpapersettinghomepage extends Component{
`}
</style>
<div className={"studentList_operation_ul mt23"}>
{isAdmin === true? <li className="li_line drop_down fr color-blue font-15" style={{"paddingLeft":"0px"}}>
{isAdmin === true? <Spin spinning={this.state.donwloading} style={{ }}><li className="li_line drop_down fr color-blue font-15" style={{"paddingLeft":"0px"}}>
导出<i className="iconfont icon-xiajiantou font-12 ml2"></i>
<ul className="drop_down_menu" style={{"right":"-34px","left":"unset","height":"auto"}}>
<li><a onClick={()=>this.confirmysl(`/exercises/${this.props.match.params.Id}/exercise_lists.xlsx`)}>学生成绩</a></li>
{/*<li><a onClick={()=>this.confirmysl(`/exercises/${this.props.match.params.Id}/export_exercise`)} >空白试卷</a></li>*/}
<li><a onClick={()=>this.confirmysl(`/exercises/${this.props.match.params.Id}/exercise_lists.xlsx`,this.child)}>学生成绩</a></li>
<li><a onClick={()=>this.confirmysl(`/exercises/${this.props.match.params.Id}/export_exercise`,this.child)} >空白试卷</a></li>
{/*<li><a onClick={()=>this.confirmysl(`/zip/export_exercises?exercise_id=${this.props.match.params.Id}${this.state.groupyslsval===null||this.state.groupyslsval===undefined?null:this.state.groupyslsval}`)}>学生答题试卷</a></li>*/}
</ul>
</li>:""}
</li></Spin>:""}
</div>
{
@ -400,22 +425,22 @@ class Testpapersettinghomepage extends Component{
/>
{
// 教师列表
parseInt(tab[0])==0 && <Studentshavecompletedthelist {...this.props} {...this.state} setcourse_groupysls={(value)=>this.setcourse_groupysls(value)} current_status = {this.state.current_status}></Studentshavecompletedthelist>
parseInt(tab[0])==0 && <Studentshavecompletedthelist {...this.props} {...this.state} triggerRef={this.bindRef} setcourse_groupysls={(value)=>this.setcourse_groupysls(value)} current_status = {this.state.current_status}></Studentshavecompletedthelist>
}
{/*统计结果*/}
{
parseInt(tab[0])==1 && <Exercisestatisticalresult {...this.props} {...this.state}></Exercisestatisticalresult>
parseInt(tab[0])==1 && <Exercisestatisticalresult {...this.props} {...this.state} triggerRef={this.bindRef}></Exercisestatisticalresult>
}
{
parseInt(tab[0])==2 && <ExerciseDisplay {...this.props} {...this.state}></ExerciseDisplay>
parseInt(tab[0])==2 && <ExerciseDisplay {...this.props} {...this.state} triggerRef={this.bindRef}></ExerciseDisplay>
}
{
parseInt(tab[0])==3 && <WrappedExercisesetting {...this.props} {...this.state} ></WrappedExercisesetting>
parseInt(tab[0])==3 && <WrappedExercisesetting {...this.props} {...this.state} triggerRef={this.bindRef}></WrappedExercisesetting>
}
</div>
</div>

@ -27,6 +27,11 @@ function disabledDateTime() {
};
}
function disabledDate(current) {
return current && current < moment().endOf('day').subtract(1, 'days');
}
class GraduationTaskssettingapp extends Component{
constructor(props){
@ -896,7 +901,7 @@ class GraduationTaskssettingapp extends Component{
}
/// 确认是否下载
confirmysl(url){
axios.get(url).then((response) => {
axios.get(url + '?export=true' ).then((response) => {
if(response === undefined){
return
}
@ -1181,6 +1186,7 @@ class GraduationTaskssettingapp extends Component{
value={publish_time===null||publish_time===""?"":moment(publish_time, dateFormat)}
onChange={this.onChangeTimepublish}
disabledTime={disabledDateTime}
disabledDate={disabledDate}
disabled={this.props.isAdmin()===true?starttimetype===true?true:flagPageEdit===true?false:true:true}
className={ this.state.publishTimetypes===true?"noticeTip":""}
/>
@ -1218,6 +1224,7 @@ class GraduationTaskssettingapp extends Component{
value={end_time===null||end_time===""?"":moment(end_time, dateFormat)}
onChange={this.onChangeTimeend}
disabledTime={disabledDateTime}
disabledDate={disabledDate}
// disabled={this.props.isSuperAdmin()===true?flagPageEdit===true?false:true:this.props.isAdmin()===true?endtimetype===true?true:flagPageEdit===true?false:true:true}
disabled={this.props.isAdmin()===true?endtimetype===true?true:flagPageEdit===true?false:true:true}
className={this.state.endTimetypes===true||end_timetype===true?"noticeTip":""}
@ -1269,6 +1276,7 @@ class GraduationTaskssettingapp extends Component{
width={"210px"}
value={latetime===null||latetime===""?"":moment(latetime, dateFormat)}
disabledTime={disabledDateTime}
disabledDate={disabledDate}
onChange={this.onChangeTimelatetime}
disabled={this.props.isAdmin()===true?allowlate===true||allowlate===1?flagPageEdit===true?false:true:true:true}
className={ latetimetype===true?"noticeTip":""}
@ -1319,6 +1327,7 @@ class GraduationTaskssettingapp extends Component{
width={"210px"}
value={commenttime===null||commenttime=== ""?"":moment(commenttime, dateFormat)}
disabledTime={disabledDateTime}
disabledDate={disabledDate}
onChange={this.onChangeTimecommenttime}
disabled={this.props.isAdmin()===true?flagPageEdit===true?false:true:true}
className={ commenttimetype===true?"noticeTip":""}

@ -645,7 +645,7 @@ class GraduationTaskssettinglist extends Component{
b_order:b_order,
search:search,
}
axios.get(url,{
axios.get(url + '?export=true',{
params
}).then((response) => {
if(response === undefined){

@ -199,7 +199,7 @@ class GraduationTasksquestions extends Component{
/// 确认是否下载
confirmysl(url){
axios.get(url).then((response) => {
axios.get(url + '?export=true').then((response) => {
if(response === undefined){
return
}

@ -322,7 +322,7 @@ onBoardsNew=()=>{
}
/// 确认是否下载
confirmysl(url){
axios.get(url).then((response) => {
axios.get(url + '?export=true').then((response) => {
if(response.data.status&&response.data.status===-1){
}else if(response.data.status&&response.data.status===-2){

@ -127,7 +127,7 @@ class studentsList extends Component{
}
/// 确认是否下载
confirmysl(url){
axios.get(url).then((response) => {
axios.get(url + '&export=true').then((response) => {
if(response === undefined){
return
}

@ -28,6 +28,9 @@ function disabledDateTime() {
};
}
function disabledDate(current) {
return current && current < moment().endOf('day').subtract(1, 'days');
}
class CoursesNew extends Component {
@ -572,6 +575,7 @@ class CoursesNew extends Component {
width={"210px"}
value={datatime === undefined ? "" :datatime === null ? "" : moment(datatime, dateFormat)}
disabledTime={disabledDateTime}
disabledDate={disabledDate}
dropdownClassName="hideDisable"
onChange={this.onChangeTimepublishs}
/>

@ -75,7 +75,7 @@ class PollDetailIndex extends Component{
/// 确认是否下载
confirmysl(url){
axios.get(url).then((response) => {
axios.get(url + '?export=true' ).then((response) => {
if(response.data.status&&response.data.status===-1){
}else if(response.data.status&&response.data.status===-2){

@ -26,6 +26,12 @@ function disabledDateTime() {
// disabledSeconds: () => range(1,60)
}
}
function disabledDate(current) {
return current && current < moment().endOf('day').subtract(1, 'days');
}
class PollDetailTabForthRules extends Component{
constructor(props){
super(props);
@ -404,6 +410,7 @@ class PollDetailTabForthRules extends Component{
showTime={{ format: 'HH:mm' }}
format="YYYY-MM-DD HH:mm"
disabledTime={disabledDateTime}
disabledDate={disabledDate}
disabled={ rule.e_timeflag ===undefined?rule.publish_time===null?false:!flagPageEdit:rule.p_timeflag == true ? true : !flagPageEdit}
style={{"height":"42px",width:'100%'}}
></DatePicker>
@ -429,6 +436,7 @@ class PollDetailTabForthRules extends Component{
showTime={{ format: 'HH:mm' }}
format="YYYY-MM-DD HH:mm"
disabledTime={disabledDateTime}
disabledDate={disabledDate}
disabled={ rule.e_timeflag ===undefined?rule.publish_time===null?false:!flagPageEdit:rule.e_timeflag == true ? true : !flagPageEdit}
style={{"height":"42px"}}
></DatePicker>

@ -2214,7 +2214,7 @@ class Listofworksstudentone extends Component {
confirmysl(url){
axios.get(url).then((response) => {
axios.get(url + '&export=true').then((response) => {
if(response === undefined){
return
}

@ -539,7 +539,7 @@ class ShixunStudentWork extends Component {
}
confirmysl(url){
axios.get(url).then((response) => {
axios.get(url + '?export=true').then((response) => {
if(response === undefined){
return
}

@ -47,6 +47,9 @@ function disabledDateTime() {
}
}
function disabledDate(current) {
return current && current < moment().endOf('day').subtract(1, 'days');
}
class Trainingjobsetting extends Component {
//unifiedsetting 统一设置
@ -1766,16 +1769,16 @@ class Trainingjobsetting extends Component {
daochushixunbaogao=()=>{
let url =`/zip/shixun_report?homework_common_id=${this.props.match.params.homeworkid}`;
this.confirmysl(url);
this.confirmysl(url, url + '&export=true');
}
daochuzuoye =() =>{
let url = `/homework_commons/${this.props.match.params.homeworkid}/works_list.xlsx`;
this.confirmysl(url);
this.confirmysl(url, url + '?export=true');
}
confirmysl(url){
axios.get(url).then((response) => {
confirmysl(url, urlWithExport){
axios.get(urlWithExport).then((response) => {
if(response === undefined){
return
}
@ -1935,6 +1938,7 @@ class Trainingjobsetting extends Component {
id={"publishtimeid"}
disabledDate={this.disabledStartDatestart}
disabledTime={disabledDateTime}
disabledDate={disabledDate}
className={borreds}
showTime={{ format: 'HH:mm' }}
format="YYYY-MM-DD HH:mm"
@ -1967,6 +1971,7 @@ class Trainingjobsetting extends Component {
showToday={false}
id={"end_timeid"}
disabledTime={disabledDateTime}
disabledDate={disabledDate}
showTime={{ format: 'HH:mm' }}
className={borredss}
format="YYYY-MM-DD HH:mm"
@ -2049,6 +2054,7 @@ class Trainingjobsetting extends Component {
showToday={false}
id={"late_timeid"}
disabledTime={disabledDateTime}
disabledDate={disabledDate}
format="YYYY-MM-DD HH:mm"
value={late_time && moment(late_time, dataformat)}
onChange={this.onEndChangeys}

@ -339,16 +339,16 @@ class Workquestionandanswer extends Component {
daochushixunbaogao=()=>{
let url =`/zip/shixun_report?homework_common_id=${this.props.match.params.homeworkid}`;
this.confirmysl(url);
this.confirmysl(url, url + '&export=true');
}
daochuzuoye =() =>{
let url = `/homework_commons/${this.props.match.params.homeworkid}/works_list.xlsx`;
this.confirmysl(url);
this.confirmysl(url, url + '?export=true');
}
confirmysl(url){
axios.get(url).then((response) => {
confirmysl(url, urlWithExport){
axios.get(urlWithExport).then((response) => {
if(response === undefined){
return
}

@ -18,7 +18,7 @@ class DownloadMessage extends Component {
setDownload=()=>{
this.modalCancel();
window.open(`/users/${this.props.user.login}/private_messages`)
window.open(`/users/${this.props.user.login}/message_detail?user_id=1`)
}
modalCancel = () => {
this.setState({

@ -11,7 +11,7 @@ class DownloadMessageysl extends Component {
setDownload=()=>{
this.props.modalCancel();
window.open(`/users/${this.props.user.login}/private_messages`)
window.open(`/users/${this.props.user.login}/message_detail?user_id=1`)
}
render() {

@ -500,7 +500,9 @@ class DetailCardsEditAndAdd extends Component{
<div className="clearfix edu-txt-center lineh-40 bor-bottom-greyE" key={key}>
<li className="fl with40">
<Checkbox
id={"shixun_input_"+item.shixun_id} value={item.shixun_id}
id={"shixun_input_"+item.shixun_id}
value={item.shixun_id}
key={item.shixun_id}
className="fl task-hide edu-txt-left"
style={{"width":"298px"}}
name="shixun_homework[]"

@ -533,7 +533,9 @@ class DetailCardsEditAndEdit extends Component{
<div className="clearfix edu-txt-center lineh-40 bor-bottom-greyE" key={key}>
<li className="fl with40">
<Checkbox
id={"shixun_input_"+item.shixun_id} value={item.shixun_id}
id={"shixun_input_"+item.shixun_id}
value={item.shixun_id}
key={item.shixun_id}
className="fl task-hide edu-txt-left"
style={{"width":"298px"}}
name="shixun_homework[]"

@ -15,7 +15,6 @@ class sendPanel extends Component{
openSearch:false,
sendToCourseId:undefined,
sendToShixunArray:[],
shixunNum:0,
Modalstype:false,
cardsModalcancel:this.cardsModalcancel,
cardsModalsave:this.cardsModalsave,
@ -35,7 +34,9 @@ class sendPanel extends Component{
//隐藏发送至弹框
hideSenttothevalue =()=>{
this.setState({
sentShixunPath:false
sentShixunPath:false,
sendToShixunArray:[],
sendToCourseId:undefined,
})
}
//打开课堂列表下拉框
@ -63,7 +64,7 @@ class sendPanel extends Component{
changeCheckBoxs=(list)=>{
this.setState({
sendToShixunArray:list,
shixunNum:list.length
// shixunNum:list.length
})
}
@ -86,7 +87,9 @@ class sendPanel extends Component{
Modalstype:true,
sentShixunPath:false,
Modalstopval:result.data.message,
courseurl:result.data.url
courseurl:result.data.url,
sendToShixunArray:[],
sendToCourseId:undefined,
})
}
}).catch((error)=>{
@ -118,8 +121,33 @@ class sendPanel extends Component{
let {courseurl}=this.state;
window.location.href =courseurl;
}
allChange = (e) => {
if(e.target.checked===false){
this.setState({
sendToShixunArray: [],
})
}else{
let { sendToCourseList} = this.state;
let newlist = [];
sendToCourseList.stages.map((item,key)=>{
item.shixuns.map((items,keys)=>{
newlist.push(items.shixun_id)
})
})
this.setState({
sendToShixunArray: newlist,
})
}
}
render(){
let{sentShixunPath,sendToCourseList,openSearch,shixunNum,Modalstype,Modalstopval,Modalsbottomval,cardsModalcancel,cardsModalsave}= this.state;
let{sentShixunPath,sendToCourseList,Modalstype,Modalstopval,Modalsbottomval,cardsModalcancel,cardsModalsave}= this.state;
return(
<div>
@ -178,7 +206,7 @@ class sendPanel extends Component{
</Select>
</div>
<div className="edu-back-skyblue pl15 pr15 clearfix over280 pt5">
<CheckboxGroup onChange={this.changeCheckBoxs}>
<CheckboxGroup onChange={this.changeCheckBoxs} value={this.state.sendToShixunArray}>
{
sendToCourseList && sendToCourseList.stages.map((item,key)=>{
@ -197,7 +225,16 @@ class sendPanel extends Component{
</CheckboxGroup>
</div>
<p className="color-grey-9 pl15 font-12 mt10">已选择 {shixunNum} 个实训</p>
<div className="mt10 clearfix">
<span className="fl ml15">
<Checkbox className="fl"
onChange={(e)=>this.allChange(e)}
>全选</Checkbox>
</span>
</div>
<p className="color-grey-9 pl15 font-12 mt10">已选择 {this.state.sendToShixunArray.length} 个实训</p>
<div className="mt20 clearfix edu-txt-center">
<a onClick={this.hideSenttothevalue} className="pop_close task-btn mr30">取消</a>
<a className="task-btn task-btn-orange" onClick={this.submitInfo}>确定</a>

@ -2,7 +2,7 @@ import React, {Component} from 'react';
import {Link} from "react-router-dom";
import axios from 'axios';
import { Input ,Icon,Button,Pagination,DatePicker,Breadcrumb} from 'antd';
import { handleDateString,markdownToHTML,bytesToSize} from 'educoder';
import { handleDateString,markdownToHTML,bytesToSize,getImageUrl} from 'educoder';
import NEITaskDetailsModel from './NEITaskDetailsModel';
import moment from 'moment';
import '../packageconcnet.css';
@ -236,9 +236,9 @@ class PackageIndexNEITaskDetails extends Component {
render() {
let {overtype,data}=this.state;
// console.log(data&&data.creator.login)
// console.log(this.props.current_user.login)
console.log(data)
return (
<div>
data===undefined?"":<div>
<div className="clearfix">
<NEITaskDetailsModel
applytype={this.state.applytype}
@ -265,7 +265,7 @@ class PackageIndexNEITaskDetails extends Component {
<div className={"stud-class-set coursenavbox edu-back-white mt20"}>
<div className={"ant-row contentbox mdInForm "}>
<div className="educontent project-packages-list">
<div className="educontent project-packages-list relative">
{data&&data.status==="pending"?<div>
<div className="publicpart orangeBlack "></div>
<span className="smalltrangle"></span>
@ -281,7 +281,8 @@ class PackageIndexNEITaskDetails extends Component {
<div className="fl edu-back-white ">
<a href={`/users/${data&&data.creator.login}`}>
<img alt="头像" className="radius mt10 ml5" height="70" id="nh_user_logo" name="avatar_image"
src={data&&data.creator.image_url} width="70"/>
src={`/images/${data&&data.creator.image_url}`}
width="70"/>
</a>
<div className=" edu-back-white pagemancenter mt10 ">
{data&&data.creator.name}
@ -403,7 +404,7 @@ class PackageIndexNEITaskDetails extends Component {
return(
<div className="ysldivhomediv1s homehove" key={key}>
{item.status==="bidding_won"?<img src={gouxuan} className="yslgouxuanimg"/>:""}
<a href={`/users/${item.login}`}><img className="div1imgs" src={item.image_url}/></a>
<a href={`/users/${item.login}`}><img className="div1imgs" src={getImageUrl("images/"+item.image_url)}/></a>
<div className="textall mt10" title={item.name}> <p className="ptext">{item.name}</p></div>
{this.props.current_user&&this.props.current_user.login!=item.login?<a className="ContacttheTAs fl none" target="_blank" href={`/users/${item.login}/message_detail?user_id=${item.id}`}>
<img alt="头像" className="mr5" src={require('./newstwo.png')}/>联系TA
@ -451,7 +452,7 @@ class PackageIndexNEITaskDetails extends Component {
return(
<div className="ysldivhomediv1s" onClick={()=>this.Clickteacher2(item.id)} key={key}>
{item.bool===true?<img src={gouxuan} className="yslgouxuanimg"/>:<img src={weigouxuan} className="yslgouxuanimg"/>}
<a href={`/users/${item.login}`} target="_blank"><img className="div1imgs" src={item.image_url}/></a>
<a href={`/users/${item.login}`} target="_blank"><img className="div1imgs" src={getImageUrl("images/"+item.image_url)}/></a>
<span className={item.bool===true?"textall mt10 color-blue":"textall mt10"} title={item.name}> <p className="ptext">{item.name}</p></span>
</div>
)

@ -66,13 +66,7 @@ class PackageIndexNEIBannerConcent extends Component {
categories:[]
}
}
componentDidUpdate = (prevProps) => {
if(prevProps.current_user.username!=this.props.current_user.username){
this.setState({
contact_name:this.props.current_user.username
})
}
}
componentDidMount() {
window.document.title = '众包创新'
@ -99,9 +93,7 @@ class PackageIndexNEIBannerConcent extends Component {
})
}else{
this.setState({
contact_name:this.props.current_user.username
})
console.log(this.props.current_user&&this.props.current_user.username)
}
let Url = `/project_package_categories.json`;
@ -119,8 +111,24 @@ class PackageIndexNEIBannerConcent extends Component {
console.log(error)
})
this.setState({
contact_name:this.props.current_user&&this.props.current_user.username
})
// this.contentMdRef.current.setValue("测试赋值")
}
componentDidUpdate = (prevProps) => {
if(prevProps.current_user!=this.props.current_user){
if(this.props.current_user!=undefined){
this.setState({
contact_name:this.props.current_user.username
})
}
}
}
//获取验证码;
getverificationcode =()=>{
// if (this.state.logins&&this.state.logins.length === 0) {
@ -707,7 +715,7 @@ class PackageIndexNEIBannerConcent extends Component {
<p className="clearfix" id={"publishtimestart"}>
<div className={"stud-class-set pd30a0 coursenavbox edu-back-white pb20"}>
<div className={"ant-row contentbox mdInForm "}>
<div className={"ant-row contentbox mdInForm mb20"}>
<div className="ant-form-item-label mb10">
<label htmlFor="coursesNew_description" className="ant-form-item-requireds font-16">请选择需求类型</label>
</div>
@ -856,7 +864,7 @@ class PackageIndexNEIBannerConcent extends Component {
placeholder="请输入手机号"
disabled={true}
/>
<a className="fl ml20">
<a className="fl ml20 mt10">
<i className="iconfont icon-bianjidaibeijing font-20 color-blue" onClick={()=>this.editmodels()}></i>
</a>
</p>:""}
@ -897,7 +905,7 @@ class PackageIndexNEIBannerConcent extends Component {
{/*<Button type="primary" className="defalutSubmitbtn ml10 defalutSubmitbtnmodels">重新发送()</Button>*/}
</span>
</span>
<a className="fl mt8">
<a className="fl mt8 mt15">
<span className="font-18 color-blue" onClick={()=>this.modalCancel()}>X</span>
</a>
</p>:""}

@ -29,8 +29,8 @@ class PackageIndexNEISubmit extends Component {
<p className="clearfix ">
<div className={"stud-class-set padding200 coursenavbox edu-back-white"}>
<div className={"mb20"}><Icon type="check-circle" theme="filled" className={"fontcircle color-green"}/></div>
<div className={"sumbtongs mb5"}>恭喜!</div>
<div className={"sumbtongs mb5"}>提交成功</div>
<div className={"sumbtongs mb10"}>恭喜!</div>
<div className={"sumbtongs mb10"}>提交成功</div>
<div className={"terraces mb5"}>平台正在审核您的申请审核结果将以平台消息的形式通知您</div>
<div className="clearfix mt30 mb30 padding251">
<a className="defalutCancelbtns fl" onClick={()=>this.setageload(this.props.id)}>查看发布需求</ a>

@ -27,6 +27,12 @@ class PackageIndexNewandEditIndex extends Component{
id:ids
})
}
goback = () => {
// window.history.go(-1)
window.location.href="/crowdsourcings";
}
render() {
let {setPublication}=this.state;
return (
@ -37,6 +43,7 @@ class PackageIndexNewandEditIndex extends Component{
<p className="clearfix mt20 mb20">
<span className="fl font-24 color-grey-3">
{this.props.match.params.id!=undefined?"编辑":"新建"}</span>
<a className="color-grey-6 fr font-15 mr20" onClick={this.goback}>返回</a>
</p>
<PackageIndexNEIBanner {...this.props} />

@ -167,7 +167,7 @@
color:#999;
}
.padding251{
padding: 0px 251px;
padding: 0px 245px;
}
.ant-modal-title{

@ -718,7 +718,7 @@ submittojoinclass=(value)=>{
<li className=""><a href={this.props.Headertop===undefined?"":this.props.Headertop.moop_cases_url}>教学案例</a></li>
<li className=""><a
// href={this.props.Headertop===undefined?"":this.props.Headertop.crowdsourcing_url}
href={'/crowdsourcing'}
href={'/crowdsourcings'}
>众包创新</a></li>
<li className={`${activeForums === true ? 'active' : ''}`}><a href={this.props.Headertop===undefined?"":this.props.Headertop.topic_url}>交流问答</a></li>
<li
@ -816,7 +816,7 @@ submittojoinclass=(value)=>{
<li><Link to={`/users/${this.props.current_user===undefined?"":this.props.current_user.login}/shixuns`}>我的实训</Link></li>
<li><Link to={`/users/${this.props.current_user===undefined?"":this.props.current_user.login}/paths`}>我的实践课程</Link></li>
<li><Link to={`/users/${this.props.current_user===undefined?"":this.props.current_user.login}/projects`}>我的项目</Link></li>
<li><Link to={`/users/${this.props.current_user===undefined?"":this.props.current_user.login}/projects`}>我的众包</Link></li>
{/*<li><Link to={`/users/${this.props.current_user===undefined?"":this.props.current_user.login}/package`}>我的众包</Link></li>*/}
<li><a href={`/account/profile`}>账号管理</a></li>
{/*<li><a onClick={()=>this.educoderlogin()} >登入测试接口</a></li>*/}
{/*<li><a onClick={()=>this.trialapplications()} >试用申请</a> </li>*/}

@ -20,7 +20,7 @@ const versionNum = '0001';
// let _url_origin = getUrl()
let _url_origin='';
if(window.location.port === "3007"){
_url_origin="http://47.96.87.25:48080/";
_url_origin="http://47.96.87.25:48080";
}
// let _url_origin=`https://www.educoder.net`;
@ -32,14 +32,14 @@ if (!window['indexHOCLoaded']) {
// $('head').append($('<link rel="stylesheet" type="text/css" />')
// .attr('href', `${_url_origin}/stylesheets/educoder/antd.min.css?1525440977`));
$('head').append($('<link rel="stylesheet" type="text/css" />')
.attr('href', `${_url_origin}/stylesheets/css/edu-common.css?1525440977`));
.attr('href', `${_url_origin}/stylesheets/css/edu-common.css?15254409771`));
$('head').append($('<link rel="stylesheet" type="text/css" />')
.attr('href', `${_url_origin}/stylesheets/educoder/edu-main.css?1525440978`));
.attr('href', `${_url_origin}/stylesheets/educoder/edu-main.css?15254409781`));
// index.html有加载
$('head').append($('<link rel="stylesheet" type="text/css" />')
.attr('href', `${_url_origin}/stylesheets/educoder/edu-all.css?1525440978`));
.attr('href', `${_url_origin}/stylesheets/educoder/edu-all.css?15254409781`));
// $('head').append($('<link rel="stylesheet" type="text/css" />')

@ -199,6 +199,10 @@ function disabledDateTime() {
// disabledSeconds: () => [0, 60],
};
}
function disabledDate(current) {
return current && current < moment().endOf('day').subtract(1, 'days');
}
export default class TPMsettings extends Component {
constructor(props) {
super(props)
@ -1144,7 +1148,7 @@ export default class TPMsettings extends Component {
}
onChangeTimePicker =(value, dateString)=> {
this.setState({
opening_time:moment(handleDateStrings(dateString))
opening_time: dateString=== ""?"":moment(handleDateStrings(dateString))
})
}
@ -1871,6 +1875,7 @@ export default class TPMsettings extends Component {
width={178}
locale={locale}
disabledTime={disabledDateTime}
disabledDate={disabledDate}
placeholder="请选择开启时间"
value={opening_time===null||opening_time===""?"":moment(opening_time, dateFormat)}
onChange={this.onChangeTimePicker}

@ -191,7 +191,9 @@ function disabledDateTime() {
};
}
function disabledDate(current) {
return current && current < moment().endOf('day').subtract(1, 'days');
}
class Newshixuns extends Component {
constructor(props) {
super(props)
@ -743,7 +745,7 @@ class Newshixuns extends Component {
onChangeTimePicker = (value, dateString) => {
this.setState({
TimePickervalue: moment(handleDateStrings(dateString))
TimePickervalue: dateString=== ""?"":moment(handleDateStrings(dateString))
})
}
@ -1288,7 +1290,7 @@ class Newshixuns extends Component {
placeholder="请选择开启时间"
onChange={this.onChangeTimePicker}
value={TimePickervalue && moment(TimePickervalue, "YYYY-MM-DD HH:mm")}
disabledDate={disabledDate}
disabledTime={disabledDateTime}
dropdownClassName="hideDisable"
/>

@ -532,13 +532,14 @@ class Collaborators extends Component {
</Spin>
</div>
<div className="mt10 clearfix">
<span className="fl mr15">
<Checkbox className="fl" checked={allChangechecked} onChange={this.allChange}>全选</Checkbox>
<div className="fl" style={{height: '27px'}}>
<span className="color-orange fl" id="add_teacher_notice"
style={{display: Collaboratorslisttype === true ? 'inline' : 'none'}}>请至少选择一个用户</span>
</div>
</span>
<span className="fl mr15">
<Checkbox className="fl" checked={allChangechecked} onChange={this.allChange}>全选</Checkbox>
<div className="fl" style={{height: '27px'}}>
<span className="color-orange fl" id="add_teacher_notice"
style={{display: Collaboratorslisttype === true ? 'inline' : 'none'}}>请至少选择一个用户</span>
</div>
</span>
</div>

@ -719,7 +719,7 @@ class AccountBasic extends Component {
</Form.Item>
{
(!filterDepartments || (filterDepartments && filterDepartments.length==0 )
filterDepartments != undefined && ( (filterDepartments && filterDepartments.length==0 )
|| (departmentsName == '' && !this.state.department_id
&& (!departments || departments.length == 0) )) &&
<div style={{marginLeft: '113px',height:"20px",lineHeight:"20px"}}>

@ -16,7 +16,7 @@ class ApplyForAddChildOrgModal extends Component{
}
componentDidUpdate=(prevState)=>{
if(this.props.departmentName && prevState.departmentName != this.props.departmentName){
if(prevState.departmentName != this.props.departmentName){
this.setValue(this.props.departmentName)
}
}

@ -17,6 +17,12 @@ import "../../courses/css/Courses.css"
import Trialapplication from '../../login/Trialapplication'
const InfosPackage = Loadable({
loader: () => import('./InfosPackage'),
loading:Loading,
})
const InfosCourse = Loadable({
loader: () => import('./InfosCourse'),
loading:Loading,
@ -373,11 +379,17 @@ class Infos extends Component{
to={`/users/${username}/paths`}>实践课程</Link>
</li>
<li className={`${moduleName == 'projects' ? 'active' : '' }`}>
<Link
<Link
onClick={() => this.setState({moduleName: 'projects'})}
to={`/users/${username}/projects`}>项目</Link>
</li>
{/*<li className={`${moduleName == 'package' ? 'active' : '' }`}>*/}
{/*<Link*/}
{/*onClick={() => this.setState({moduleName: 'package'})}*/}
{/*to={`/users/${username}/package`}>众包</Link>*/}
{/*</li>*/}
{/*{ data && data.identity!="学生" && <li> <a href={`${this.props.Headertop && this.props.Headertop.old_url}/users/${username}?type=m_bank`}>题库</a></li>}*/}
</div>
@ -389,6 +401,15 @@ class Infos extends Component{
{/* --------------------------------------------------------------------- */}
{/* 众包 */}
{/* http://localhost:3007/courses/1309/homework/9300/setting */}
<Route exact path="/users/:username/package"
render={
(props) => (<InfosPackage {...this.props} {...props} {...this.state} />)
}
></Route>
{/* 课堂 */}
{/* http://localhost:3007/courses/1309/homework/9300/setting */}
<Route exact path="/users/:username/courses"
@ -417,6 +438,8 @@ class Infos extends Component{
(props) => (<InfosProject {...this.props} {...props} {...this.state} />)
}
></Route>
<Route exact path="/users/:username"
render={
(props) => (<InfosCourse {...this.props} {...props} {...this.state} />)

@ -0,0 +1,126 @@
import React, { Component } from 'react';
import { SnackbarHOC } from 'educoder';
import {BrowserRouter as Router,Route,Switch} from 'react-router-dom';
import {Tooltip,Menu,Pagination,Spin} from 'antd';
import Loadable from 'react-loadable';
import Loading from '../../../Loading';
import axios from 'axios';
import NoneData from '../../courses/coursesPublic/NoneData'
import {getImageUrl} from 'educoder';
import { TPMIndexHOC } from '../../tpm/TPMIndexHOC';
import { CNotificationHOC } from '../../courses/common/CNotificationHOC'
import "./usersInfo.css"
import Create from './publicCreatNew'
class InfosPackage extends Component{
constructor(props){
super(props);
this.state={
category:undefined,
status:undefined,
page:1,
per_page:16,
totalCount:undefined,
data:undefined,
isSpin:false
}
}
componentDidMount=()=>{
this.setState({
isSpin:true
})
let{category,status,page}=this.state;
this.getCourses(category,status,page);
}
getCourses=(category,status,page)=>{
let url=`/users/${this.props.match.params.username}/courses.json`;
axios.get((url),{params:{
category,
status,
page,
per_page: this.props.is_current && category && page ==1?17:16
}}).then((result)=>{
if(result){
this.setState({
totalCount:result.data.count,
data:result.data,
isSpin:false
})
}
}).catch((error)=>{
console.log(error);
})
}
//切换种类
changeCategory=(cate)=>{
this.setState({
category:cate,
page:1,
isSpin:true
})
let{status}=this.state;
this.getCourses(cate,status,1);
}
//切换状态
changeStatus=(status)=>{
this.setState({
status:status,
page:1,
isSpin:true
})
let{category}=this.state;
this.getCourses(category,status,1);
}
//切换页数
changePage=(page)=>{
this.setState({
page,
isSpin:true
})
let{category,status}=this.state;
this.getCourses(category,status,page);
}
// 进入课堂
turnToCourses=(url,flag)=>{
if(flag){
this.props.history.push(url);
}
}
render(){
let{
category,
status,
page,
data,
totalCount,
isSpin
} = this.state;
let is_current=this.props.is_current;
console.log(this.props.current_user&&this.props.current_user.user_identity==="学生")
return(
<div className="educontent">
<Spin size="large" spinning={isSpin}>
<div className="white-panel edu-back-white pt25 pb25 clearfix ">
<li className={category ? "" : "active"}><a href="javascript:void(0)" onClick={()=>this.changeCategory()}>全部</a></li>
<li className={category=="manage" ? "active" : ""}><a href="javascript:void(0)" onClick={()=>this.changeCategory("manage")}>{is_current ? "我":"TA"}管理的</a></li>
<li className={category=="study" ? "active" : ""}><a href="javascript:void(0)" onClick={()=>this.changeCategory("study")}>{is_current ? "我":"TA"}参与的</a></li>
</div>
<p className="pl25 pr25 clearfix font-12 mb20 mt20">
<span className="fl color-grey-9">{0}</span>
<span className="fr color-grey-9">发布时间</span>
</p>
</Spin>
</div>
)
}
}
export default InfosPackage;

@ -334,8 +334,12 @@ label.infolabel{display: block;float: left;width: 56px;text-align: right;margin-
}
.shixunDes{font-family: 'panmen-webfont';display: block;position: absolute;height: 100%;width: 100%;text-align: center;line-height: 220px;color: #fff;top: 0px;font-size: 24px;background-color: rgba(5,16,26,0.4);border-radius: 6px 6px 0px 0px;}
/*TPM*/
.shixunDetail_top{width: 100%;background-image: url("/images/educoder/shixun-detail.jpg");background-size: 100% 100%;height: 240px;
justify-content: center;align-items: center;display: -webkit-flex;}
.shixunDetail_top{width: 100%;background-image: url("/images/educoder/shixun-detail.jpg"); height: 240px;
justify-content: center;align-items: center;display: -webkit-flex;
background-size: cover;
background-position: center;
background-repeat: no-repeat;
}
.task-item{margin-top: 30px;padding-bottom: 30px;border-bottom: 1px solid #eee}
.task-item:last-child{border-bottom: none;}
.challengeNav a.active{color: #4CACFF;}
@ -422,14 +426,23 @@ table.text-file{}
/*-------------------------------实训路径-------------------------------*/
.path-head{width: 100%;height: 300px;background-image: url("/images/educoder/path.jpg");background-color: #081C4B;background-size: 100% 100%;}
.path-head{width: 100%;height: 300px;background-image: url("/images/educoder/path.png");
background-color: #081C4B;
background-size: cover;
background-position: center;
background-repeat: no-repeat;
}
.pathNavLine{position: absolute;bottom: -8px;width: 100%;}
.path-nav li{float: left;padding: 0px 30px;height: 42px;}
.path-nav li a{color:#fff;font-size: 16px;display: block; height: 40px;}
.path-nav li.active a{border-bottom: 3px solid #4CACFF;color:#4CACFF;}
/*---实训路径详情----*/
.subhead{width: 100%;margin-bottom:40px;background-size: 100% 100%;background-image: url("/images/educoder/path-detail.jpg");height: 240px;
justify-content: center;align-items: center;display: -webkit-flex;}
justify-content: center;align-items: center;display: -webkit-flex;
background-size: cover;
background-position: center;
background-repeat: no-repeat;
}
.subhead_content{width: 1200px;margin: 0px auto;}
.pathInfo li{text-align: center;float: left;margin-right: 38px;}
.pathInfo li span{display: block;}
@ -469,7 +482,11 @@ li.li-width7{width: 7%;text-align: left}
/*-----------------------------在线课堂动态----------------------------------*/
.courseHead{width: 100%;margin-bottom:40px;background-size: 100% 100%;background-image: url("/images/educoder/course-detail.jpg");height: 240px;
justify-content: center;align-items: center;display: -webkit-flex;}
justify-content: center;align-items: center;display: -webkit-flex;
background-size: cover;
background-position: center;
background-repeat: no-repeat;
}
.invite-tip{position: absolute;top: -5px;right: 140px;color: #fff; box-sizing: border-box;width: 170px;text-align: center;border-radius: 2px;background-color: rgba(5,16,26,0.6)}
.inviteTipbtn a{font-size:14px;width: 100%;height: 30px;line-height: 30px;display: block;color: #747A7F;background-color: rgba(5,16,26,0.4)}
.inviteTipbtn a:hover{color: #4cacff!important;}
@ -3055,7 +3072,11 @@ a.singlepublishtwo{
padding: 0px;
}
.project_packagesHead{width: 100%;margin-bottom:40px;background-size: 100% 100%;background-image: url("/images/educoder/project_packagesHead.jpg");height: 240px;
justify-content: center;align-items: center;display: -webkit-flex;}
justify-content: center;align-items: center;display: -webkit-flex;
background-size: cover;
background-position: center;
background-repeat: no-repeat;
}
/* 个人中心-众包 */

Loading…
Cancel
Save