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

dev_newshixunModel
hjm 6 years ago
commit 41e89a3fbe

@ -253,7 +253,10 @@ class ApplicationController < ActionController::Base
if Digest::MD5.hexdigest(content) == params[:chinaoocKey] if Digest::MD5.hexdigest(content) == params[:chinaoocKey]
user = open_class_user user = open_class_user
start_user_session(user) if user if user
start_user_session(user)
set_autologin_cookie(user)
end
User.current = user User.current = user
end end
end end

@ -51,7 +51,7 @@ class CommonsController < ApplicationController
200 200
end end
when 'journals_for_message' when 'journals_for_message'
course = @object.jour&.course || @object.jour&.student_work&.homework_common&.course course = @object&.jour_type.to_s == "StudentWorksScore" ? @object.jour&.student_work&.homework_common&.course : @object.jour&.course
if current_user.course_identity(course) >= Course::STUDENT && @object.user != current_user if current_user.course_identity(course) >= Course::STUDENT && @object.user != current_user
403 403
else else

@ -128,8 +128,8 @@ class CoursesController < ApplicationController
# POST /courses # POST /courses
# POST /courses.json # POST /courses.json
def create def create
ActiveRecord::Base.transaction do begin
begin ActiveRecord::Base.transaction do
@course = Course.new(name: params[:name], class_period: params[:class_period], credit: params[:credit], @course = Course.new(name: params[:name], class_period: params[:class_period], credit: params[:credit],
end_date: params[:end_date], is_public: params[:is_public], school_id: @school.id, end_date: params[:end_date], is_public: params[:is_public], school_id: @school.id,
authentication: params[:authentication], professional_certification: params[:professional_certification]) authentication: params[:authentication], professional_certification: params[:professional_certification])
@ -174,11 +174,12 @@ class CoursesController < ApplicationController
course_module_types = params[:course_module_types] course_module_types = params[:course_module_types]
@course.create_course_modules(course_module_types) @course.create_course_modules(course_module_types)
end end
rescue => e
uid_logger_error(e.message)
tip_exception(e.message)
raise ActiveRecord::Rollback
end end
CreateSubjectCourseStudentJob.perform_later(@course.id) if @course.subject && @course.subject.subject_appointments.count > 0
rescue => e
uid_logger_error(e.message)
tip_exception(e.message)
raise ActiveRecord::Rollback
end end
end end

@ -19,43 +19,48 @@ class GitsController < ApplicationController
result = false result = false
if request.env["HTTP_AUTHORIZATION"] && request.env["HTTP_AUTHORIZATION"].split(" ").length == 2 if request.env["HTTP_AUTHORIZATION"] && request.env["HTTP_AUTHORIZATION"].split(" ").length == 2
username_password = Base64.decode64(request.env["HTTP_AUTHORIZATION"].split(" ")[1]) username_password = Base64.decode64(request.env["HTTP_AUTHORIZATION"].split(" ")[1])
input_username = username_password.split(":")[0].strip()
input_password = username_password.split(":")[1].strip()
uid_logger("git start auth: input_username is #{input_username}")
if username_password.split(":")[0].nil? || username_password.split(":")[1].nil?
# Git 超级权限用户 result = false
if input_username.strip == gituser.strip && input_password.strip == gitpassword.strip
result = true
else else
# 用户是否对对象拥有权限 input_username = username_password.split(":")[0].strip()
system_user = User.find_by_login(input_username) || User.find_by_mail(input_username) || User.find_by_phone(input_username) input_password = username_password.split(":")[1].strip()
uid_logger("git start auth: input_username is #{input_username}")
# 如果用户名密码错误 # Git 超级权限用户
if system_user && !system_user.check_password?(input_password) if input_username.strip == gituser.strip && input_password.strip == gitpassword.strip
uid_logger_error("git start: password is wrong") result = true
result = false
else else
git_url = params["url"] # 用户是否对对象拥有权限
username = git_url.split("/")[0] system_user = User.find_by_login(input_username) || User.find_by_mail(input_username) || User.find_by_phone(input_username)
shixunname = git_url.split("/")[1].split(".")[0]
repo_name = username + "/" + shixunname
uid_logger("git start: repo_name is #{repo_name}")
shixun = Shixun.select([:id, :user_id, :repo_name, :identifier]).where(repo_name: repo_name).first
uid_logger("git start auth: shixun identifier is #{shixun.try(:identifier)}")
uid_logger("git start auth: systemuser is #{system_user.try(:login)}")
if shixun.present? # 如果用户名密码错误
if system_user.present? && system_user.manager_of_shixun?(shixun) if system_user && !system_user.check_password?(input_password)
result = true uid_logger_error("git start: password is wrong")
result = false
else
git_url = params["url"]
username = git_url.split("/")[0]
shixunname = git_url.split("/")[1].split(".")[0]
repo_name = username + "/" + shixunname
uid_logger("git start: repo_name is #{repo_name}")
shixun = Shixun.select([:id, :user_id, :repo_name, :identifier]).where(repo_name: repo_name).first
uid_logger("git start auth: shixun identifier is #{shixun.try(:identifier)}")
uid_logger("git start auth: systemuser is #{system_user.try(:login)}")
if shixun.present?
if system_user.present? && system_user.manager_of_shixun?(shixun)
result = true
else
uid_logger_error("gituser is not shixun manager")
result = false
end
else else
uid_logger_error("gituser is not shixun manager") uid_logger_error("shixun is not exist")
result = false # result = false
result = true # 为了测试跳出
end end
else
uid_logger_error("shixun is not exist")
# result = false
result = true # 为了测试跳出
end end
end end
end end

@ -0,0 +1,22 @@
class CreateSubjectCourseStudentJob < ApplicationJob
queue_as :default
def perform(course_id)
course = Course.find_by(id: course_id)
return if course.blank? || course.subject.blank?
attrs = %i[course_id user_id role created_at updated_at]
same_attrs = {course_id: course.id, role: 4}
Rails.logger.info("1:course.students.count:##{course.students.count}")
CourseMember.bulk_insert(*attrs) do |worker|
course.subject.subject_appointments.each do |app|
Rails.logger.info("##{course.students.where(user_id: app.user_id)}")
next if course.students.where(user_id: app.user_id).any?
worker.add same_attrs.merge(user_id: app.user_id)
end
end
Rails.logger.info("2:course.students.count:##{course.students.count}")
course.subject.subject_appointments.destroy_all
end
end

@ -10,9 +10,11 @@ json.results do
# 去除开头标点符号 # 去除开头标点符号
reg = /^[,。?:;‘’!“”—……、]/ reg = /^[,。?:;‘’!“”—……、]/
# 附件的替换 # 附件的替换
atta_reg = /!\[\]\(\/api\/attachments\/\d+\)/ atta_reg = /!\[.*]\(\/api\/attachments\/\d+\)/
highlights[:description]&.first&.sub!(reg, '').sub!(atta_reg, '') highlights[:description]&.first&.sub!(reg, '')
highlights[:content]&.first&.sub!(reg, '').sub!(atta_reg, '') highlights[:description]&.map{|des| des.gsub!(atta_reg, '')}
highlights[:content]&.first&.sub!(reg, '')
highlights[:content]&.map{|des| des.gsub!(atta_reg, '')}
json.content highlights json.content highlights
end end

@ -8,9 +8,12 @@ json.shixun_list do
# 去除开头标点符号 # 去除开头标点符号
reg = /^[,。?:;‘’!“”—……、]/ reg = /^[,。?:;‘’!“”—……、]/
# 附件的替换 # 附件的替换
atta_reg = /!\[\]\(\/api\/attachments\/\d+\)/ atta_reg = /!\[.*]\(\/api\/attachments\/\d+\)/
highlights[:description]&.first&.sub!(reg, '')&.sub!(atta_reg, '')
highlights[:content]&.first&.sub!(reg, '')&.sub!(atta_reg, '') highlights[:description]&.first&.sub!(reg, '')
highlights[:description]&.map{|des| des.gsub!(atta_reg, '')}
highlights[:content]&.first&.sub!(reg, '')
highlights[:content]&.map{|des| des.gsub!(atta_reg, '')}
json.title highlights.delete(:name)&.join('...') || obj.searchable_title json.title highlights.delete(:name)&.join('...') || obj.searchable_title
json.description highlights[:description]&.join('...') || Util.extract_content(obj.description)[0..300]&.sub!(atta_reg, '') json.description highlights[:description]&.join('...') || Util.extract_content(obj.description)[0..300]&.sub!(atta_reg, '')

@ -1,4 +1,4 @@
document.write("<link href='//at.alicdn.com/t/font_653600_qa9lwwv74z.css' rel='stylesheet' type='text/css'/>"); document.write("<link href='https://at.alicdn.com/t/font_653600_qa9lwwv74z.css' rel='stylesheet' type='text/css'/>");
/*! /*!
* JavaScript Cookie v2.2.0 * JavaScript Cookie v2.2.0

@ -1,8 +1,11 @@
<!DOCTYPE html> <!DOCTYPE html>
<html lang="en"> <html lang="en">
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<!-- width=device-width, initial-scale=1 , shrink-to-fit=no --> <!--<meta http-equiv="Content-Security-Policy" content="upgrade-insecure-requests" />-->
<!-- width=device-width, initial-scale=1 , shrink-to-fit=no -->
<!-- <meta name="viewport" content=""> --> <!-- <meta name="viewport" content=""> -->
<meta name="theme-color" content="#000000"> <meta name="theme-color" content="#000000">
<!--<meta http-equiv="Content-Security-Policy" content="upgrade-insecure-requests">--> <!--<meta http-equiv="Content-Security-Policy" content="upgrade-insecure-requests">-->

@ -22,7 +22,7 @@ import 'moment/locale/zh-cn';
import './yslexercisetable.css'; import './yslexercisetable.css';
import {getImageUrl, toPath} from 'educoder'; import {getImageUrl, toPath} from 'educoder';
import CheckBoxGroup from "../../page/component/CheckBoxGroup"; import CheckBoxGroup from "../../page/component/CheckBoxGroup";
import NoneData from '../../../modules/courses/coursesPublic/NoneData'
const Search = Input.Search; const Search = Input.Search;
const RadioGroup = Radio.Group; const RadioGroup = Radio.Group;
const CheckboxGroup = Checkbox.Group; const CheckboxGroup = Checkbox.Group;
@ -1217,6 +1217,7 @@ class Studentshavecompletedthelist extends Component {
) )
}, },
], ],
exercise_status:0,
} }
// console.log("Studentshavecompletedthelist"); // console.log("Studentshavecompletedthelist");
// console.log(props.current_status); // console.log(props.current_status);
@ -1277,6 +1278,20 @@ class Studentshavecompletedthelist extends Component {
}catch (e) { }catch (e) {
} }
try {
if(this.props.Commonheadofthetestpaper.exercise_status !== undefined){
this.setState({
exercise_status:this.props.Commonheadofthetestpaper.exercise_status,
})
}else{
this.setState({
exercise_status:0,
})
}
}catch (e) {
}
} }
componentWillReceiveProps = (nextProps) => { componentWillReceiveProps = (nextProps) => {
@ -2065,11 +2080,11 @@ class Studentshavecompletedthelist extends Component {
this.setState({ this.setState({
loadingstate: false, loadingstate: false,
}) })
console.log(response); // console.log(response);
console.log(1997); // console.log(1997);
this.Generatenewdatasy(response.data.exercise_users, response); this.Generatenewdatasy(response.data.exercise_users, response);
}).catch((error) => { }).catch((error) => {
console.log(error) // console.log(error)
this.setState({ this.setState({
loadingstate: false, loadingstate: false,
}) })
@ -2472,7 +2487,7 @@ class Studentshavecompletedthelist extends Component {
render() { render() {
const isAdmin = this.props.isAdmin(); const isAdmin = this.props.isAdmin();
let {data, datas, page, columns, course_groupyslsthree, columnstwo, styletable, course_groupyslstwodatas, limit, course_groupysls, course_groupyslstwodata, course_groupyslstwo, teacherlists, Teacherliststudentlist, order, columnss, course_groupsdatas, course_groups, Evaluationarray, unlimited, unlimiteds, unlimitedtwo, teacherlist, searchtext, loadingstate, review, nocomment, commented, unsubmitted, submitted, columnsys, exercise_users,mylistansum} = this.state; let {data, datas, page, columns, course_groupyslsthree, columnstwo, styletable,exercise_status, course_groupyslstwodatas, limit, course_groupysls, course_groupyslstwodata, course_groupyslstwo, teacherlists, Teacherliststudentlist, order, columnss, course_groupsdatas, course_groups, Evaluationarray, unlimited, unlimiteds, unlimitedtwo, teacherlist, searchtext, loadingstate, review, nocomment, commented, unsubmitted, submitted, columnsys, exercise_users,mylistansum} = this.state;
// console.log("Studentshavecompletedthelist"); // console.log("Studentshavecompletedthelist");
// console.log(this.props.current_status); // console.log(this.props.current_status);
return ( return (
@ -2483,202 +2498,211 @@ class Studentshavecompletedthelist extends Component {
" min-width": " 1200px", " min-width": " 1200px",
}}> }}>
{/*老师*/} {/*老师*/}
<div className="edu-back-white" > {
<ul className="clearfix" style={{padding: '10px 30px 10px 30px'}}> exercise_status===0 || exercise_status===1 ?
<div className="edu-back-white">
<NoneData></NoneData>
</div>
:
<div>
<div className="edu-back-white" >
<ul className="clearfix" style={{padding: '10px 30px 10px 30px'}}>
{/*你的评阅:*/} {/*你的评阅:*/}
{ {
Teacherliststudentlist === undefined || Teacherliststudentlist.exercise_types.subjective === 0 ? Teacherliststudentlist === undefined || Teacherliststudentlist.exercise_types.subjective === 0 ?
<li className="clearfix mt10"> <li className="clearfix mt10">
<span className="fl mr10 color-grey-8 ">作品状态</span> <span className="fl mr10 color-grey-8 ">作品状态</span>
<span className="fl "><a id="graduation_comment_no_limit" <span className="fl "><a id="graduation_comment_no_limit"
className={unlimiteds === 0 ? "pl10 pr10 mr20 check_on" : "pl10 pr10 mr20 "} className={unlimiteds === 0 ? "pl10 pr10 mr20 check_on" : "pl10 pr10 mr20 "}
onClick={() => this.notlimiteds()}>不限</a></span> onClick={() => this.notlimiteds()}>不限</a></span>
<CheckboxGroup value={course_groupyslstwo} <CheckboxGroup value={course_groupyslstwo}
onChange={(e) => this.checkeboxstwo(e, course_groupyslstwodata && course_groupyslstwodata)}> onChange={(e) => this.checkeboxstwo(e, course_groupyslstwodata && course_groupyslstwodata)}>
{ {
course_groupyslstwodata.map((item, key) => { course_groupyslstwodata.map((item, key) => {
return ( return (
<span key={key}><Checkbox className="fl mt5" <span key={key}><Checkbox className="fl mt5"
key={item.id} key={item.id}
value={item.id}>{item.tu}<span>({Teacherliststudentlist === undefined ? "0" : key === 0 ? Teacherliststudentlist.exercise_types.unanswer_users : Teacherliststudentlist.exercise_types.answer_users})</span></Checkbox></span> value={item.id}>{item.tu}<span>({Teacherliststudentlist === undefined ? "0" : key === 0 ? Teacherliststudentlist.exercise_types.unanswer_users : Teacherliststudentlist.exercise_types.answer_users})</span></Checkbox></span>
) )
}) })
} }
</CheckboxGroup> </CheckboxGroup>
<div className="fr mr5 search-new" style={{marginBottom: '1px'}}> <div className="fr mr5 search-new" style={{marginBottom: '1px'}}>
<Search <Search
placeholder="请输入姓名或学号搜索" placeholder="请输入姓名或学号搜索"
id="subject_search_input" id="subject_search_input"
autoComplete="off" autoComplete="off"
value={searchtext} value={searchtext}
onKeyUp={(e) => this.onSearchKeywordKeyUp(e)} onKeyUp={(e) => this.onSearchKeywordKeyUp(e)}
onInput={this.inputSearchValues} onInput={this.inputSearchValues}
onSearch={this.searchValues} onSearch={this.searchValues}
></Search> ></Search>
</div> </div>
</li> </li>
: :
<div> <div>
<li className="clearfix mt10"> <li className="clearfix mt10">
<span className="fl mr10 color-grey-8 ">你的评阅</span> <span className="fl mr10 color-grey-8 ">你的评阅</span>
<span className="fl "><a id="graduation_comment_no_limit" <span className="fl "><a id="graduation_comment_no_limit"
className={unlimited === 0 ? "pl10 pr10 mr20 check_on" : "pl10 pr10 mr20 "} className={unlimited === 0 ? "pl10 pr10 mr20 check_on" : "pl10 pr10 mr20 "}
onClick={() => this.notlimited()}>不限</a></span> onClick={() => this.notlimited()}>不限</a></span>
<CheckboxGroup value={course_groupyslsthree} <CheckboxGroup value={course_groupyslsthree}
onChange={(e) => this.checkeboxs(e, course_groupyslstwodata && course_groupyslstwodata)}> onChange={(e) => this.checkeboxs(e, course_groupyslstwodata && course_groupyslstwodata)}>
{ {
course_groupyslstwodatas.map((item, key) => { course_groupyslstwodatas.map((item, key) => {
return ( return (
<span key={key}><Checkbox className="fl mt5" <span key={key}><Checkbox className="fl mt5"
key={item.id} key={item.id}
value={item.id}>{item.tu}<span>({Teacherliststudentlist === undefined ? "0" : key === 0 ? Teacherliststudentlist.exercise_types.unreview_counts : Teacherliststudentlist.exercise_types.review_counts})</span></Checkbox></span> value={item.id}>{item.tu}<span>({Teacherliststudentlist === undefined ? "0" : key === 0 ? Teacherliststudentlist.exercise_types.unreview_counts : Teacherliststudentlist.exercise_types.review_counts})</span></Checkbox></span>
) )
}) })
} }
</CheckboxGroup> </CheckboxGroup>
<div className="fr mr5 search-new" style={{marginBottom: '1px'}}> <div className="fr mr5 search-new" style={{marginBottom: '1px'}}>
<Search <Search
placeholder="请输入姓名或学号搜索" placeholder="请输入姓名或学号搜索"
id="subject_search_input" id="subject_search_input"
autoComplete="off" autoComplete="off"
value={searchtext} value={searchtext}
onKeyUp={(e) => this.onSearchKeywordKeyUp(e)} onKeyUp={(e) => this.onSearchKeywordKeyUp(e)}
onInput={this.inputSearchValues} onInput={this.inputSearchValues}
onSearch={this.searchValues} onSearch={this.searchValues}
></Search> ></Search>
</div> </div>
</li> </li>
{/*作品状态*/} {/*作品状态*/}
<li className="clearfix mt10"> <li className="clearfix mt10">
<span className="fl mr10 color-grey-8 ">作品状态</span> <span className="fl mr10 color-grey-8 ">作品状态</span>
<span className="fl "><a id="graduation_comment_no_limit" <span className="fl "><a id="graduation_comment_no_limit"
className={unlimiteds === 0 ? "pl10 pr10 mr20 check_on" : "pl10 pr10 mr20 "} className={unlimiteds === 0 ? "pl10 pr10 mr20 check_on" : "pl10 pr10 mr20 "}
onClick={() => this.notlimiteds()}>不限</a></span> onClick={() => this.notlimiteds()}>不限</a></span>
<CheckboxGroup value={course_groupyslstwo} <CheckboxGroup value={course_groupyslstwo}
onChange={(e) => this.checkeboxstwo(e, course_groupyslstwodata && course_groupyslstwodata)}> onChange={(e) => this.checkeboxstwo(e, course_groupyslstwodata && course_groupyslstwodata)}>
{ {
course_groupyslstwodata.map((item, key) => { course_groupyslstwodata.map((item, key) => {
return ( return (
<span key={key}><Checkbox className="fl mt5" <span key={key}><Checkbox className="fl mt5"
key={item.id} key={item.id}
value={item.id}>{item.tu}<span>({Teacherliststudentlist === undefined ? "0" : key === 0 ? Teacherliststudentlist.exercise_types.unanswer_users : Teacherliststudentlist.exercise_types.answer_users})</span></Checkbox></span> value={item.id}>{item.tu}<span>({Teacherliststudentlist === undefined ? "0" : key === 0 ? Teacherliststudentlist.exercise_types.unanswer_users : Teacherliststudentlist.exercise_types.answer_users})</span></Checkbox></span>
) )
}) })
} }
</CheckboxGroup> </CheckboxGroup>
</li> </li>
</div> </div>
} }
{/*分班情况*/} {/*分班情况*/}
{course_groups === undefined ? "" : course_groups === null ? "" : course_groups.length < 2 ? "" : JSON.stringify(course_groups) === "[]" ? "" : {course_groups === undefined ? "" : course_groups === null ? "" : course_groups.length < 2 ? "" : JSON.stringify(course_groups) === "[]" ? "" :
<li className="clearfix mt10"> <li className="clearfix mt10">
<tr> <tr>
<td className="w80" style={{"vertical-align": "top"}}><span <td className="w80" style={{"vertical-align": "top"}}><span
className=" mr10 color-grey-8 ">分班情况</span></td> className=" mr10 color-grey-8 ">分班情况</span></td>
<td className="w70" style={{"vertical-align": "top"}}><span><a <td className="w70" style={{"vertical-align": "top"}}><span><a
id="graduation_comment_no_limit" id="graduation_comment_no_limit"
className={unlimitedtwo === 0 ? "pl10 pr10 mr20 check_on" : "pl10 pr10 mr20 "} className={unlimitedtwo === 0 ? "pl10 pr10 mr20 check_on" : "pl10 pr10 mr20 "}
onClick={() => this.funtaskstatustwos()}>不限</a></span> onClick={() => this.funtaskstatustwos()}>不限</a></span>
</td> </td>
<td> <td>
<CheckboxGroup value={course_groupysls} <CheckboxGroup value={course_groupysls}
onChange={(e) => this.funtaskstatustwo(e, course_groups && course_groups)} onChange={(e) => this.funtaskstatustwo(e, course_groups && course_groups)}
style={{paddingTop: '4px', display: "inline"}}> style={{paddingTop: '4px', display: "inline"}}>
{ {
course_groups.map((item, key) => { course_groups.map((item, key) => {
return ( return (
<span key={key}><Checkbox className="fl mt5" <span key={key}><Checkbox className="fl mt5"
key={item.exercise_group_id} key={item.exercise_group_id}
value={item.exercise_group_id}>{item.exercise_group_name}<span>({item.exercise_group_students})</span></Checkbox></span> value={item.exercise_group_id}>{item.exercise_group_name}<span>({item.exercise_group_students})</span></Checkbox></span>
) )
}) })
} }
</CheckboxGroup> </CheckboxGroup>
</td> </td>
</tr> </tr>
</li> </li>
} }
</ul> </ul>
<div id="graduation_work_list" style={{padding: '0px 30px 10px 30px'}}> <div id="graduation_work_list" style={{padding: '0px 30px 10px 30px'}}>
<div className="clearfix"> <div className="clearfix">
<span <span
className="fl color-grey-6 font-12"><span className="fl color-grey-6 font-12"><span
style={{color: '#FF6800'}}>{Teacherliststudentlist === undefined ? "0" : Teacherliststudentlist.exercise_types.total_users}</span><span style={{color: '#FF6800'}}>{Teacherliststudentlist === undefined ? "0" : Teacherliststudentlist.exercise_types.total_users}</span><span
className="color-orange-tip"></span>{Teacherliststudentlist === undefined ? "0" : Teacherliststudentlist.exercise_types.exercise_all_users} </span> className="color-orange-tip"></span>{Teacherliststudentlist === undefined ? "0" : Teacherliststudentlist.exercise_types.exercise_all_users} </span>
<div className="fr color-grey-6 edu-menu-panel"> <div className="fr color-grey-6 edu-menu-panel">
<ul> <ul>
<li className="edu-position edu-position-hidebox"> <li className="edu-position edu-position-hidebox">
<a className="font-12"> <a className="font-12">
{order === "end_at" ? "时间" : order === "score" ? "成绩" : order === "student_id" ? "学号" : ""}排序</a> {order === "end_at" ? "时间" : order === "score" ? "成绩" : order === "student_id" ? "学号" : ""}排序</a>
<i className="iconfont icon-xiajiantou ml5 font-12"></i> <i className="iconfont icon-xiajiantou ml5 font-12"></i>
<ul className="edu-position-hide undis mt10"> <ul className="edu-position-hide undis mt10">
<li><a onClick={(e) => this.funordersy("end_at")} data-remote="true" <li><a onClick={(e) => this.funordersy("end_at")} data-remote="true"
className=" font-12" style={{textAlign: "center "}}>提交时间</a></li> className=" font-12" style={{textAlign: "center "}}>提交时间</a></li>
<li><a onClick={(e) => this.funordersy("score")} data-remote="true" <li><a onClick={(e) => this.funordersy("score")} data-remote="true"
className=" font-12" style={{textAlign: "center "}}>最终成绩</a></li> className=" font-12" style={{textAlign: "center "}}>最终成绩</a></li>
<li><a onClick={(e) => this.funordersy("student_id")} data-remote="true" <li><a onClick={(e) => this.funordersy("student_id")} data-remote="true"
className=" font-12" style={{textAlign: "center "}}>学生学号</a></li> className=" font-12" style={{textAlign: "center "}}>学生学号</a></li>
</ul> </ul>
</li> </li>
</ul> </ul>
</div> </div>
</div> </div>
</div> </div>
{JSON.stringify(data) !== "[]" ? {JSON.stringify(data) !== "[]" ?
<div className={"justify break_full_word new_li edu-back-white"} <div className={"justify break_full_word new_li edu-back-white"}
style={{minHeight: "480px"}}> style={{minHeight: "480px"}}>
<style>{` <style>{`
.ant-spin-nested-loading > div > .ant-spin .ant-spin-dot { .ant-spin-nested-loading > div > .ant-spin .ant-spin-dot {
top: 72%;} top: 72%;}
} }
`}</style> `}</style>
<div className="edu-table edu-back-white"> <div className="edu-table edu-back-white">
{data === undefined ? "" : <Table {data === undefined ? "" : <Table
dataSource={data} dataSource={data}
columns={columnsys} columns={columnsys}
className="mysjysltable1" className="mysjysltable1"
pagination={false} pagination={false}
loading={loadingstate} loading={loadingstate}
// onChange={this.TablePaginationsy} // onChange={this.TablePaginationsy}
/>} />}
</div> </div>
</div> </div>
: :
<div id="forum_list" className="forum_table"> <div id="forum_list" className="forum_table">
<div className="minH-560 edu-back-white"> <div className="minH-560 edu-back-white">
<div className="edu-tab-con-box clearfix edu-txt-center"> <div className="edu-tab-con-box clearfix edu-txt-center">
<img className="edu-nodata-img mb20" <img className="edu-nodata-img mb20"
src={getImageUrl("images/educoder/nodata.png")}/> src={getImageUrl("images/educoder/nodata.png")}/>
<p className="edu-nodata-p mb30">暂时还没有相关数据哦</p> <p className="edu-nodata-p mb30">暂时还没有相关数据哦</p>
</div> </div>
</div> </div>
</div> </div>
} }
</div> </div>
{ {
Teacherliststudentlist && Teacherliststudentlist.exercise_types.total_users && Teacherliststudentlist.exercise_types.total_users > limit ? Teacherliststudentlist && Teacherliststudentlist.exercise_types.total_users && Teacherliststudentlist.exercise_types.total_users > limit ?
<div className="edu-txt-center mt30 mb50"> <div className="edu-txt-center mt30 mb50">
<Pagination showQuickJumper current={page} onChange={this.paginationonChange} <Pagination showQuickJumper current={page} onChange={this.paginationonChange}
pageSize={limit} pageSize={limit}
total={Teacherliststudentlist.exercise_types.total_users}></Pagination> total={Teacherliststudentlist.exercise_types.total_users}></Pagination>
</div>
: ""
}
</div> </div>
: ""
} }
</div> </div>
@ -2691,16 +2715,22 @@ class Studentshavecompletedthelist extends Component {
<div> <div>
<div className=" clearfix " <div className=" clearfix "
style={{"margin": "0 auto", "padding-bottom": "100px", " min-width": " 1200px"}}> style={{"margin": "0 auto", "padding-bottom": "100px", " min-width": " 1200px"}}>
<div className={"educontent mb20"}> {
exercise_status === 0 || exercise_status === 1 ?
<div className="edu-back-white">
<NoneData></NoneData>
</div>
:
<div className={"educontent mb20"}>
<div className="edu-back-white" id="graduation_work_list" <div className="edu-back-white" id="graduation_work_list"
style={{ style={{
padding: '0px 30px 10px 30px', padding: '0px 30px 10px 30px',
"height": "50px", "height": "50px",
"margin-bottom": "10px" "margin-bottom": "10px"
}}> }}>
<div className="clearfix "> <div className="clearfix ">
<span className="fl color-grey-6 font-12 mt10"> <span className="fl color-grey-6 font-12 mt10">
<span className="color-orange-tip" <span className="color-orange-tip"
style={{color: '#FF6800'}}>{Teacherliststudentlist === undefined ? "0" : Teacherliststudentlist.exercise_types.answer_users}</span><span style={{color: '#FF6800'}}>{Teacherliststudentlist === undefined ? "0" : Teacherliststudentlist.exercise_types.answer_users}</span><span
@ -2716,45 +2746,45 @@ class Studentshavecompletedthelist extends Component {
</span>} </span>}
</span> </span>
</div> </div>
</div> </div>
{JSON.stringify(datas) === "[]" ? {JSON.stringify(datas) === "[]" ?
<div id="forum_list" className="forum_table"> <div id="forum_list" className="forum_table">
<div className="mh650 edu-back-white"> <div className="mh650 edu-back-white">
<div className="edu-tab-con-box clearfix edu-txt-center"> <div className="edu-tab-con-box clearfix edu-txt-center">
<img className="edu-nodata-img mb20" <img className="edu-nodata-img mb20"
src={getImageUrl("images/educoder/nodata.png")}/> src={getImageUrl("images/educoder/nodata.png")}/>
<p className="edu-nodata-p mb30">暂时还没有相关数据哦</p> <p className="edu-nodata-p mb30">暂时还没有相关数据哦</p>
</div> </div>
</div> </div>
</div> </div>
: :
<div className={"justify break_full_word new_li edu-back-white"} <div className={"justify break_full_word new_li edu-back-white"}
style={{minHeight: "480px"}}> style={{minHeight: "480px"}}>
<style>{` <style>{`
.ant-spin-nested-loading > div > .ant-spin .ant-spin-dot { .ant-spin-nested-loading > div > .ant-spin .ant-spin-dot {
top: 72%;} top: 72%;}
} }
`}</style> `}</style>
<div className="edu-table edu-back-white minH-560"> <div className="edu-table edu-back-white minH-560">
{datas === undefined ? "" : <Table {datas === undefined ? "" : <Table
dataSource={datas} dataSource={datas}
columns={columnss} columns={columnss}
className="mysjysltable2" className="mysjysltable2"
pagination={false} pagination={false}
loading={false} loading={false}
/>} />}
</div> </div>
</div> </div>
} }
</div>
</div>
}
</div> </div>
</div> </div>
@ -2766,10 +2796,17 @@ class Studentshavecompletedthelist extends Component {
"padding-bottom": "100px", "padding-bottom": "100px",
" min-width": " 1200px" " min-width": " 1200px"
}}> }}>
<div className={"educontent mb20 edu-back-white"}> {
<style> exercise_status === 0 || exercise_status === 1 ?
{ <div className="edu-back-white">
` <NoneData></NoneData>
</div>
:
<div>
<div className={"educontent mb20 edu-back-white"}>
<style>
{
`
.edu-table .ant-table-tbody > tr > td { .edu-table .ant-table-tbody > tr > td {
height: 58px; height: 58px;
} }
@ -2786,40 +2823,40 @@ class Studentshavecompletedthelist extends Component {
padding: 9px; padding: 9px;
} }
` `
} }
</style> </style>
<div className={"justify break_full_word new_li edu-back-white ysltableows"} <div className={"justify break_full_word new_li edu-back-white ysltableows"}
> >
{data === undefined ? "" : <Table {data === undefined ? "" : <Table
dataSource={data} dataSource={data}
columns={columnstwo} columns={columnstwo}
className="mysjysltable3" className="mysjysltable3"
pagination={false} pagination={false}
loading={false} loading={false}
showHeader={false} showHeader={false}
/>} />}
</div>
{JSON.stringify(datas) === "[]" ?
<div id="forum_list" className="forum_table ">
<div className="mh650 edu-back-white">
<div className="edu-tab-con-box clearfix edu-txt-center">
<img className="edu-nodata-img mb20"
src={getImageUrl("images/educoder/nodata.png")}/>
<p className="edu-nodata-p mb30">暂时还没有相关数据哦</p>
</div> </div>
</div> {JSON.stringify(datas) === "[]" ?
</div> <div id="forum_list" className="forum_table ">
: <div className="mh650 edu-back-white">
<div className="edu-back-white"> <div className="edu-tab-con-box clearfix edu-txt-center">
< div id="graduation_work_list" style={{ <img className="edu-nodata-img mb20"
padding: '0px 30px 10px 30px', src={getImageUrl("images/educoder/nodata.png")}/>
"margin-top": "20px", <p className="edu-nodata-p mb30">暂时还没有相关数据哦</p>
"margin-bottom": "10px" </div>
}}> </div>
<div className="clearfix"> </div>
:
<div className="edu-back-white">
< div id="graduation_work_list" style={{
padding: '0px 30px 10px 30px',
"margin-top": "20px",
"margin-bottom": "10px"
}}>
<div className="clearfix">
<span className="fl color-grey-6 font-12"><span <span className="fl color-grey-6 font-12"><span
className="color-orange-tip" className="color-orange-tip"
style={{color: '#FF6800'}}>{Teacherliststudentlist === undefined ? "0" : Teacherliststudentlist.exercise_types.answer_users}</span><span style={{color: '#FF6800'}}>{Teacherliststudentlist === undefined ? "0" : Teacherliststudentlist.exercise_types.answer_users}</span><span
@ -2832,32 +2869,32 @@ class Studentshavecompletedthelist extends Component {
<span <span
style={{color: '#FF6800'}}> {Teacherliststudentlist === undefined ? "0" : Teacherliststudentlist.exercise_types.exercise_end_time}</span>} style={{color: '#FF6800'}}> {Teacherliststudentlist === undefined ? "0" : Teacherliststudentlist.exercise_types.exercise_end_time}</span>}
</span> </span>
<div className="fr color-grey-6 edu-menu-panel"> <div className="fr color-grey-6 edu-menu-panel">
<ul> <ul>
<li className="edu-position edu-position-hidebox"> <li className="edu-position edu-position-hidebox">
<a className="font-12 "> <a className="font-12 ">
{order === "end_at" ? "时间" : order === "score" ? "成绩" : order === "student_id" ? "学号" : ""}排序</a> {order === "end_at" ? "时间" : order === "score" ? "成绩" : order === "student_id" ? "学号" : ""}排序</a>
<i className="iconfont icon-xiajiantou ml5 font-12 color-grey-6"></i> <i className="iconfont icon-xiajiantou ml5 font-12 color-grey-6"></i>
<ul className="edu-position-hide undis mt10"> <ul className="edu-position-hide undis mt10">
<li><a onClick={(e) => this.funorder("end_at")} data-remote="true" <li><a onClick={(e) => this.funorder("end_at")} data-remote="true"
className=" font-12" style={{textAlign: "center "}}>提交时间</a> className=" font-12" style={{textAlign: "center "}}>提交时间</a>
</li> </li>
<li><a onClick={(e) => this.funorder("score")} data-remote="true" <li><a onClick={(e) => this.funorder("score")} data-remote="true"
className=" font-12" style={{textAlign: "center "}}>最终成绩</a> className=" font-12" style={{textAlign: "center "}}>最终成绩</a>
</li> </li>
<li><a onClick={(e) => this.funorder("student_id")} data-remote="true" <li><a onClick={(e) => this.funorder("student_id")} data-remote="true"
className=" font-12" style={{textAlign: "center "}}>学生学号</a> className=" font-12" style={{textAlign: "center "}}>学生学号</a>
</li> </li>
</ul> </ul>
</li> </li>
</ul> </ul>
</div> </div>
</div> </div>
</div> </div>
<div className={"justify break_full_word new_li edu-back-white"} <div className={"justify break_full_word new_li edu-back-white"}
style={{minHeight: "480px"}}> style={{minHeight: "480px"}}>
<style>{` <style>{`
.ant-spin-nested-loading > div > .ant-spin .ant-spin-dot { .ant-spin-nested-loading > div > .ant-spin .ant-spin-dot {
top: 72%;} top: 72%;}
} }
@ -2877,30 +2914,32 @@ class Studentshavecompletedthelist extends Component {
padding: 9px; padding: 9px;
} }
`}</style> `}</style>
<div className="edu-table edu-back-white minH-560 ysltableowss"> <div className="edu-table edu-back-white minH-560 ysltableowss">
{datas === undefined ? "" : <Table {datas === undefined ? "" : <Table
dataSource={datas} dataSource={datas}
columns={columns} columns={columns}
pagination={false} pagination={false}
className="mysjysltable4" className="mysjysltable4"
loading={loadingstate} loading={loadingstate}
/>}</div> />}</div>
</div> </div>
</div> </div>
} }
</div> </div>
{ {
mylistansum && mylistansum > limit ? mylistansum && mylistansum > limit ?
<div className="edu-txt-center mt30 mb20"> <div className="edu-txt-center mt30 mb20">
<Pagination showQuickJumper current={page} <Pagination showQuickJumper current={page}
onChange={this.paginationonChanges} pageSize={limit} onChange={this.paginationonChanges} pageSize={limit}
total={mylistansum}></Pagination> total={mylistansum}></Pagination>
</div>
: ""
}
</div> </div>
: ""
} }
</div> </div>

@ -436,7 +436,7 @@ class Testpapersettinghomepage extends Component{
/> />
{ {
// 教师列表 // 教师列表
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])==0 && <Studentshavecompletedthelist {...this.props} {...this.state} triggerRef={this.bindRef} setcourse_groupysls={(value)=>this.setcourse_groupysls(value)} current_status = {this.state.current_status} Commonheadofthetestpaper={this.state.Commonheadofthetestpaper}></Studentshavecompletedthelist>
} }
{/*统计结果*/} {/*统计结果*/}

@ -86,7 +86,7 @@ class Trainingjobsetting extends Component {
latepenaltytype: false, latepenaltytype: false,
unifiedsetting: true, unifiedsetting: true,
allowreplenishment: undefined, allowreplenishment: undefined,
completionefficiencyscore: true, completionefficiencyscore: false,
whethertopay: false, whethertopay: false,
proportion: undefined, proportion: undefined,
level: undefined, level: undefined,
@ -120,6 +120,7 @@ class Trainingjobsetting extends Component {
showmodel:false, showmodel:false,
code_review:false, code_review:false,
testscripttiptype:false, testscripttiptype:false,
end_timebool:false, end_timebool:false,
late_timesbool:false, late_timesbool:false,
} }
@ -659,6 +660,7 @@ class Trainingjobsetting extends Component {
flagPageEditsthrees:false, flagPageEditsthrees:false,
flagPageEditsfor:false, flagPageEditsfor:false,
whethertopay:false, whethertopay:false,
completionefficiencyscore:true,
}) })
this.refs.targetElementTrainingjobsetting.scrollIntoView() this.refs.targetElementTrainingjobsetting.scrollIntoView()
@ -1067,7 +1069,7 @@ class Trainingjobsetting extends Component {
// //占比分 // //占比分
changeTopicNametwo = (value) => { changeTopicNametwo = (value) => {
// console.log("2e.target.value", value) // console.log("TrainingjobsettingTrainingjobsetting", value)
if (value === "" || value === undefined) { if (value === "" || value === undefined) {
return return
} }
@ -1701,6 +1703,7 @@ class Trainingjobsetting extends Component {
flagPageEditstwo:releasetime, flagPageEditstwo:releasetime,
flagPageEditsthrees:deadline, flagPageEditsthrees:deadline,
flagPageEditsfor:endtime, flagPageEditsfor:endtime,
completionefficiencyscore:true,
unifiedsetting:this.state.unifiedsetting, unifiedsetting:this.state.unifiedsetting,
}) })
if(this.state.proportion === "自定义分值"){ if(this.state.proportion === "自定义分值"){
@ -1733,6 +1736,8 @@ class Trainingjobsetting extends Component {
hand__e_tip: "", hand__e_tip: "",
hand_flags: false, hand_flags: false,
handclass: undefined, handclass: undefined,
completionefficiencyscore:true,
latedeductiontwo:0,
unit_e_tip: "", unit_e_tip: "",
}) })
this.refs.targetElementTrainingjobsetting.scrollIntoView(); this.refs.targetElementTrainingjobsetting.scrollIntoView();
@ -2139,7 +2144,7 @@ class Trainingjobsetting extends Component {
</div> </div>
<div className=" mt20" style={{marginLeft:"75px"}}> <div className=" mt20" style={{marginLeft:"75px"}}>
<span className="c_grey mr10" style={{"color":"#999999"}}>分值</span> <span className="c_grey mr10" style={{"color":"#999999"}}>分值</span>
<InputNumber min={0} disabled={!flagPageEdit} max={100} className="ml10 h40 mr10 color-grey-9" <InputNumber min={0} disabled={!this.state.completionefficiencyscore} max={100} className="ml10 h40 mr10 color-grey-9"
style={{width: "100px","color":"#999999"}} style={{width: "100px","color":"#999999"}}
onChange={this.changeTopicNametwo} onChange={this.changeTopicNametwo}
value={this.state.latedeductiontwo}/> value={this.state.latedeductiontwo}/>

@ -1064,8 +1064,7 @@ class ShixunHomework extends Component{
<div className="edu-back-white"> <div className="edu-back-white">
<p className="clearfix padding30 bor-bottom-greyE"> <p className="clearfix padding30 bor-bottom-greyE">
<p style={{height: '20px'}}> <p style={{height: '20px'}}>
{/*<span className="font-18 fl color-dark-21">{datas&&datas.category_name===undefined||datas&&datas.category_name===null?datas&&datas.main_category_name:datas&&datas.category_name+" 作业列表"}</span>*/} <span className="font-18 fl color-dark-21">{datas&&datas.category_name===undefined||datas&&datas.category_name===null?datas&&datas.main_category_name:datas&&datas.category_name+" 作业列表"}</span>
<span className="font-18 fl color-dark-21">实训作业</span>
<li className="fr"> <li className="fr">
{datas===undefined?"":datas.homeworks && datas.homeworks.length>1?this.props.isAdminOrCreator()===true?datas&&datas.category_name===undefined||datas&&datas.category_name===null? {datas===undefined?"":datas.homeworks && datas.homeworks.length>1?this.props.isAdminOrCreator()===true?datas&&datas.category_name===undefined||datas&&datas.category_name===null?
<span> <span>

@ -39,20 +39,20 @@ class EcStudentList extends Component {
let major_id=this.props.match.params.major_id; let major_id=this.props.match.params.major_id;
let year_id=this.props.match.params.year_id; let year_id=this.props.match.params.year_id;
const url ='/ec_major_schools/'+major_id+'/academic_years/'+year_id+'/student_lists_data'; // const url ='/ec_major_schools/'+major_id+'/academic_years/'+year_id+'/student_lists_data';
axios.get(url, { // axios.get(url, {
withCredentials: true, // withCredentials: true,
}).then((response) => { // }).then((response) => {
if(response.status===200){ // if(response.status===200){
this.setState({ // this.setState({
majorschoollist:response.data, // majorschoollist:response.data,
ismanager:response.data.ismanager, // ismanager:response.data.ismanager,
}) // })
} // }
}) // })
.catch(function (error) { // .catch(function (error) {
console.log(error); // console.log(error);
}); // });
// let majorschoollist={ // let majorschoollist={
// ec_students: [{index: 1, student_name: "同意", student_id: "s20111458"}, // ec_students: [{index: 1, student_name: "同意", student_id: "s20111458"},
// {index: 1, student_name: "同意", student_id: "s20111458"}, // {index: 1, student_name: "同意", student_id: "s20111458"},

@ -479,6 +479,8 @@ class MessagSub extends Component{
return ''; return '';
case "PublicCourseStart": case "PublicCourseStart":
return window.open(`/courses/${item.container_id}/informs`); return window.open(`/courses/${item.container_id}/informs`);
case "SubjectStartCourse":
return window.open(`/paths/${item.container_id}`);
default : default :
return window.open("/") return window.open("/")
} }

@ -1,47 +1,56 @@
import React, { Component } from 'react'; import React, { Component } from 'react';
import {getImageUrl} from 'educoder'; import {getImageUrl} from 'educoder';
import { Spin, Icon , Modal} from 'antd'; import { Spin, Icon , Modal} from 'antd';
class Modals extends Component { class Modals extends Component {
constructor(props) { constructor(props) {
super(props); super(props);
this.state = { this.state = {
funmodalsType:false, funmodalsType:false,
istype:false istype:false
} }
} }
render() { render() {
const antIcons = <Icon type="loading" style={{ fontSize: 24 }} spin /> const antIcons = <Icon type="loading" style={{ fontSize: 24 }} spin />
return( return(
<Modal <Modal
className={this.props.className} className={this.props.className}
keyboard={false} keyboard={false}
title="提示" title="提示"
visible={this.props.modalsType===undefined?false:this.props.modalsType} visible={this.props.modalsType===undefined?false:this.props.modalsType}
closable={false} closable={false}
footer={null} footer={null}
destroyOnClose={true} destroyOnClose={true}
centered={true} centered={true}
width="530px" width="530px"
> >
<Spin indicator={antIcons} spinning={this.props.antIcon===undefined?false:this.props.antIcon} > {this.props.modalsType===true?<style>
<div className="task-popup-content"> {
<p className="task-popup-text-center font-16">{this.props.modalsTopval}</p> `
<p className="task-popup-text-center font-16 mt5">{this.props.modalsBottomval}</p> body{
{this.props.loadtype===true? overflow: hidden !important;
<div className="clearfix edu-txt-center mt20"> }
<a className="task-btn task-btn-orange pop_close" onClick={this.props.modalSave}>知道啦</a> `
</div> }
: </style>:""}
<div className="clearfix mt30 edu-txt-center"> <Spin indicator={antIcons} spinning={this.props.antIcon===undefined?false:this.props.antIcon} >
<a className="task-btn mr30" onClick={this.props.modalCancel}>取消</a> <div className="task-popup-content">
<a className="task-btn task-btn-orange" onClick={this.props.modalSave}>{this.props.okText || '确定'}</a> <p className="task-popup-text-center font-16">{this.props.modalsTopval}</p>
</div> <p className="task-popup-text-center font-16 mt5">{this.props.modalsBottomval}</p>
} {this.props.loadtype===true?
</div> <div className="clearfix edu-txt-center mt20">
</Spin> <a className="task-btn task-btn-orange pop_close" onClick={this.props.modalSave}>知道啦</a>
</Modal> </div>
) :
} <div className="clearfix mt30 edu-txt-center">
} <a className="task-btn mr30" onClick={this.props.modalCancel}>取消</a>
<a className="task-btn task-btn-orange" onClick={this.props.modalSave}>{this.props.okText || '确定'}</a>
</div>
}
</div>
</Spin>
</Modal>
)
}
}
export default Modals; export default Modals;

@ -336,7 +336,7 @@ class DetailCards extends Component{
showparagraphindex showparagraphindex
}=this.state; }=this.state;
const antIcon = <Icon type="loading" style={{ fontSize: 24 }} spin />; const antIcon = <Icon type="loading" style={{ fontSize: 24 }} spin />;
// console.log("zzz"+this.props.MenuItemsindextype)
return( return(
<div> <div>
{AccountProfiletype===true?<AccountProfile {AccountProfiletype===true?<AccountProfile
@ -495,7 +495,7 @@ class DetailCards extends Component{
: :
<li className={showparagraph===false?"none":"fr status_li"}> <li className={showparagraph===false?"none":"fr status_li"}>
{ {
showparagraphkey===key&&showparagraphindex===index?<div> showparagraphkey===key&&showparagraphindex===index?this.props.detailInfoList&&this.props.detailInfoList.allow_statistics===false&&this.props.MenuItemsindextype===2?"":<div>
<Link to={'/shixuns/'+line.identifier+'/challenges'} className="mr30 color-blue_4C shixun_detail pointer fl" target="_blank">查看详情</Link> <Link to={'/shixuns/'+line.identifier+'/challenges'} className="mr30 color-blue_4C shixun_detail pointer fl" target="_blank">查看详情</Link>
{line.shixun_status==="暂未公开"?"":<a onClick={()=>this.startgameid(line.identifier)} className="btn_auto user_bluebg_btn fl" id="shixun_operation" >开始实战</a>} {line.shixun_status==="暂未公开"?"":<a onClick={()=>this.startgameid(line.identifier)} className="btn_auto user_bluebg_btn fl" id="shixun_operation" >开始实战</a>}
</div>:"" </div>:""

@ -66,4 +66,16 @@
text-overflow: ellipsis; text-overflow: ellipsis;
white-space: nowrap; white-space: nowrap;
height: 40px; height: 40px;
} }
.mb100{
margin-bottom: 100px !important;
}
.task-btn-28BE6C{
background: #28BE6C !important;
color: #fff!important;
}
.mt43{
margin-top: 43px;
}

@ -26,7 +26,9 @@ class DetailTop extends Component{
MenuItemskey:1, MenuItemskey:1,
courseslist:[], courseslist:[],
Pathcourseid:undefined, Pathcourseid:undefined,
OpenCourseTypes:false OpenCourseTypes:false,
putappointmenttype:false,
getappointmenttype:false
} }
} }
componentDidMount(){ componentDidMount(){
@ -48,33 +50,43 @@ class DetailTop extends Component{
}) })
}else{ }else{
this.props.courses.map((item,key)=>{ let type=undefined;
if(listtype===false){
keys=key+1
if(item.course_status.status===0) {
listtype=true
return (
courseslist.push(item)
)
}
}
})
this.props.courses.map((item,key)=>{ this.props.courses.map((item,key)=>{
if(listtype===false){ let arr=[]
keys=key+1 keys=key+1
if(item.course_status.status===2) { if(item.course_status.status===2) {
type=key+1
arr.push(item)
}
courseslist=arr;
})
this.props.courses.map((item,key)=>{
let arr=[]
if(listtype===false){
keys=key+1
if(item.course_status.status===0) {
listtype=true listtype=true
return ( // courseslist.push(item)
courseslist.push(item) arr.push(item)
) courseslist=arr
} }
} }
}) })
console.log(courseslist)
}
if(courseslist.length!=0){
this.props.getMenuItemsindex(keys,courseslist[0].course_status.status)
} }
} }
this.setState({ this.setState({
courseslist:courseslist, courseslist:courseslist,
MenuItemskey:keys, MenuItemskey:keys,
@ -156,7 +168,8 @@ class DetailTop extends Component{
Modalstype:false, Modalstype:false,
Modalsbottomval:'', Modalsbottomval:'',
loadtype:false, loadtype:false,
deletepathtype:false deletepathtype:false,
putappointmenttype:false
}) })
} }
@ -219,6 +232,8 @@ class DetailTop extends Component{
) )
} }
}) })
this.props.getMenuItemsindex(keys,courseslist[0].course_status.status)
this.setState({ this.setState({
MenuItemskey:keys, MenuItemskey:keys,
courseslist:courseslist, courseslist:courseslist,
@ -245,6 +260,20 @@ class DetailTop extends Component{
pathcousestypeid:typeid pathcousestypeid:typeid
}) })
} }
putappointment=()=>{
this.setState({
Modalstype:true,
Modalstopval:"是否确认立即预约?",
Modalsbottomval:"",
cardsModalcancel:()=>this.cardsModalcancel(),
putappointmenttype:true,
loadtype:false
})
}
ysljoinmodalCancel=()=>{ ysljoinmodalCancel=()=>{
this.setState({ this.setState({
yslJointhe:false yslJointhe:false
@ -267,9 +296,34 @@ class DetailTop extends Component{
OpenCourseTypes:false OpenCourseTypes:false
}) })
} }
getappointment=()=>{
let pathid=this.props.match.params.pathId;
let url=`/paths/${pathid}/appointment.json`
axios.post(url).then((response) => {
if (response.status === 200) {
if(response.data.status===0){
this.setState({
getappointmenttype:true
})
this.cardsModalcancel()
// this.props.getlistdatas()
this.props.showNotification(response.data.message)
}else{
this.props.showNotification(response.data.message)
}
}
}).catch((error) => {
console.log(error)
this.cardsModalcancel()
})
}
render(){ render(){
let{detailInfoList}=this.props; let{detailInfoList}=this.props;
let{Modalstype,Modalstopval,cardsModalcancel,OpenCourseTypes,Modalsbottomval,cardsModalsavetype,loadtype}=this.state; let{Modalstype,Modalstopval,cardsModalcancel,putappointmenttype,Modalsbottomval,cardsModalsavetype,loadtype,getappointmenttype}=this.state;
const radioStyle = { const radioStyle = {
display: 'block', display: 'block',
height: '30px', height: '30px',
@ -292,15 +346,19 @@ class DetailTop extends Component{
let applypath=this.props.detailInfoList&&this.props.detailInfoList.participant_count!=undefined&&this.props.detailInfoList&&this.props.detailInfoList.allow_statistics===false;
let coursestypes=this.props.courses!=undefined&&this.props.courses.length===0;
let isadminallow_statistics=this.props.courses&&this.props.courses.length===0&&this.props.detailInfoList&&this.props.detailInfoList.allow_statistics===true;
return( return(
<div className={this.props.courses===undefined||this.props.courses.length===0?"subhead":"subhead mb70"}> <div className={this.props.courses===undefined||this.props.courses.length===0?"subhead":applypath===false?"subhead mb70":this.state.MenuItemskey===this.props.courses.length?"subhead mb100":"subhead mb70"}>
<Modals <Modals
modalsType={Modalstype} modalsType={Modalstype}
modalsTopval={Modalstopval} modalsTopval={Modalstopval}
modalsBottomval={Modalsbottomval} modalsBottomval={Modalsbottomval}
modalCancel={cardsModalcancel} modalCancel={cardsModalcancel}
modalSave={cardsModalsavetype===true?this.reovkissuePaths:this.cardsModalsave} modalSave={cardsModalsavetype===true?()=>this.reovkissuePaths():putappointmenttype===true?()=>this.getappointment():()=>this.cardsModalsave()}
loadtype={loadtype} loadtype={loadtype}
> >
</Modals> </Modals>
@ -309,7 +367,7 @@ class DetailTop extends Component{
{ {
detailInfoList && detailInfoList &&
<div className={this.props.courses===undefined||this.props.courses.length===0?"subhead_content":"subhead_content pt100"}> <div className={this.props.courses===undefined?"subhead_content":this.props.courses.length===0?"subhead_content pt40":"subhead_content pt100"}>
<div className="font-28 color-white clearfix"> <div className="font-28 color-white clearfix">
{/*<Tooltip placement="bottom" title={detailInfoList.name.length>27?detailInfoList.name:""}>*/} {/*<Tooltip placement="bottom" title={detailInfoList.name.length>27?detailInfoList.name:""}>*/}
@ -428,9 +486,7 @@ class DetailTop extends Component{
</div> </div>
{this.props.courses===undefined||this.props.courses.length===0?"":<div className="userNavs mt20"> {this.props.courses===undefined||isadminallow_statistics===true?"":<div className="userNavs mt20" style={applypath===false?{}:this.state.MenuItemskey===this.props.courses.length?{height:'158px'}:{}}>
<li className={"fl pd4020"}>
<style> <style>
{ {
` `
@ -453,32 +509,32 @@ class DetailTop extends Component{
` `
} }
</style> </style>
{this.props.courses===undefined||this.props.courses.length===0?"":<li className={"fl pd4020"}>
{this.state.courseslist.map((item,key)=>{
{this.props.courses===undefined?"":this.state.courseslist.map((item,key)=>{ if(item.course_identity<4){
if(item.course_identity<4){ return(
return( <Tooltip placement="bottom" title={"编辑课堂"} key={key}>
<Tooltip placement="bottom" title={"编辑课堂"} key={key}> <a href={`/courses/${item.course_id}/newgolds/settings`} target={"_blank"}>
<a href={`/courses/${item.course_id}/newgolds/settings`} target={"_blank"}> <i className="iconfont icon-bianji1 newbianji1"></i>
<i className="iconfont icon-bianji1 newbianji1"></i> </a>
</a> </Tooltip>
</Tooltip> )}})
)}}) }
}
<Dropdown <Dropdown
overlay={menu} overlay={menu}
onVisibleChange={this.onVisibleChanges} onVisibleChange={this.onVisibleChanges}
> >
<a className={"alist"}> <a className={"alist"}>
<span className={"color-orange"}> {this.state.MenuItemskey} </span>次开课 <Icon className="aIcons" type={!this.state.onVisibleChangestype?"down":"up"} /> <span className={"color-orange"}> {this.state.MenuItemskey} </span>次开课 <Icon className="aIcons" type={!this.state.onVisibleChangestype?"down":"up"} />
</a> </a>
</Dropdown> </Dropdown>
</li> </li>}
<style> <style>
{ {
` `
.pdt28{ .pdt28{
padding-top: 28px; padding-top: 28px;
} }
@ -494,12 +550,12 @@ class DetailTop extends Component{
font-size: 14px; font-size: 14px;
} }
` `
} }
</style> </style>
<li className={"ml20"}> {this.props.courses===undefined||this.props.courses.length===0?"":<li className={"ml20"}>
{this.state.courseslist.map((item,key)=>{ {this.state.courseslist.map((item,key)=>{
return( return(
<div className={"ant-breadcrumb pdt28"} key={key}> <div className={"ant-breadcrumb pdt28"} key={key}>
<span> <span>
<div className="ant-breadcrumb-link fl mr23"> <div className="ant-breadcrumb-link fl mr23">
<div className={"pathtime"}> <div className={"pathtime"}>
@ -512,7 +568,7 @@ class DetailTop extends Component{
<div className="fl solidright"></div> <div className="fl solidright"></div>
</span> </span>
<span> <span>
<div className="ant-breadcrumb-link fl mr23 ml23"> <div className="ant-breadcrumb-link fl mr23 ml23">
<div className={"pathtime"}> <div className={"pathtime"}>
结课时间 结课时间
@ -524,7 +580,7 @@ class DetailTop extends Component{
<div className="fl solidright"></div> <div className="fl solidright"></div>
</span> </span>
<span> <span>
<div className="ant-breadcrumb-link fl mr23 ml23"> <div className="ant-breadcrumb-link fl mr23 ml23">
<div className={"pathtime"}> <div className={"pathtime"}>
报名人数 报名人数
@ -534,17 +590,15 @@ class DetailTop extends Component{
</div> </div>
</div> </div>
</span> </span>
</div> </div>
) )
}) })
} }
</li>
<li className={"fr mr25"}> </li>}
<style> <style>
{ {
` `
.user-colorgrey-9b{color:#9B9B9B} .user-colorgrey-9b{color:#9B9B9B}
.user-colorgrey-green{color:#7ED321} .user-colorgrey-green{color:#7ED321}
.background191{ .background191{
@ -565,40 +619,84 @@ class DetailTop extends Component{
.courseslistsa{ .courseslistsa{
color:#fff !important; color:#fff !important;
} }
.pathbtensbox{
width: 215px !important;
height: 46px !important;
background: rgba(76,172,255,1);
border-radius: 4px;
line-height: 46px !important;
}
.lineHeight0{
line-height: 0px;
}
.font153{
font-size: 14px;
font-weight: 400;
color: rgba(153,153,153,1);
line-height: 14px;
margin-left: 30px;
}
.absolutewidth{
position: absolute;
top: -21px;
right: 71px;
}
.relativewidth{
position: relative;
width: 100%;
}
` `
} }
</style> </style>
{this.state.courseslist.map((item,key)=>{ {this.props.courses===undefined||this.props.courses.length===0?"":<li className={"fr mr25"}>
{/*
height: 158px;
}*/}
{this.state.courseslist.map((item,key)=>{
return(
<div key={key}>
{/*{item.course_status.status===0?<div className="mr51 shixun_detail pointer fl user-colorgrey-green pathdefault">即将开课</div>:""}*/}
{item.course_status.status===1?<div className="mr51 shixun_detail pointer fl color-orange pathdefault">{item.course_status.time}</div>:""}
{item.course_status.status===2&&item.course_identity<6?<div className="mr20 shixun_detail pointer fl user-colorgrey-9b pathdefault">已结束</div>:""}
{/*<div className="fr user_default_btn background191 font-18 mt28 pathbtens pathdefault">已结束</div>*/}
{item.course_status.status===0?
item.course_identity<5?<a className="fr user_default_btn task-btn-orange font-18 mt28 pathbtens courseslistsa" href={item.first_category_url} target="_blank">
进入课堂
</a>:item.course_identity<6?<div className="fr user_default_btn background191 font-18 mt28 pathbtens pathdefault"></div>
:<a className="fr user_default_btn task-btn-orange font-18 mt28 pathbtens" onClick={()=>this.JoinnowCourse(item.course_id)}>立即报名</a>:""}
{item.course_status.status===1?
item.course_identity<5?<a className="courseslistsa fr user_default_btn task-btn-orange font-18 mt28 pathbtens" href={item.first_category_url} target="_blank">
进入课堂
</a>:item.course_identity<6?<a className="courseslistsa fr user_default_btn task-btn-orange font-18 mt28 pathbtens" href={item.first_category_url} target="_blank">
立即学习
</a>:<a className="fr user_default_btn task-btn-orange font-18 mt28 pathbtens" onClick={()=>this.JoinnowCourse(item.course_id,item.course_status.status)}></a>:""}
{item.course_status.status===2?
item.course_identity<6?<a className="fr user_default_btn task-btn-orange font-18 mt28 pathbtens courseslistsa" href={item.first_category_url} target="_blank">
进入课堂
</a>:<div className="mr80 shixun_detail pointer fl user-colorgrey-9b pathdefault"></div>:""}
</div>
)})}
</li>}
{applypath===false?"":this.state.MenuItemskey===this.props.courses.length?<div className={"clear"}></div>:""}
{applypath===false?"":this.state.MenuItemskey===this.props.courses.length||coursestypes===true?<span className={coursestypes===true?"fl ml20 lineHeight0 relativewidth mt43":"fl ml20 lineHeight0 relativewidth"}>
<span>当前预约报名人数<span className={"color-red mr5"}>{getappointmenttype===true?this.props.detailInfoList&&this.props.detailInfoList.participant_count+1:this.props.detailInfoList&&this.props.detailInfoList.participant_count}</span></span>
<span className={"font153"}>当预约报名人数达到 {this.props.detailInfoList&&this.props.detailInfoList.student_count} 人时即将开课</span>
{this.props.detailInfoList&&this.props.detailInfoList.has_participate===false?
getappointmenttype===true?<span className={coursestypes===true?"fr user_default_btn background191 font-18 pathbtensbox absolutewidth mt5":"fr user_default_btn background191 font-18 pathbtensbox absolutewidth"}>预约报名成功</span>:<a className={coursestypes===true?"fr user_default_btn task-btn-28BE6C font-18 pathbtensbox absolutewidth mt5":"fr user_default_btn task-btn-28BE6C font-18 pathbtensbox absolutewidth"} onClick={()=>this.putappointment()}></a>:
<span className={coursestypes===true?"fr user_default_btn background191 font-18 pathbtensbox absolutewidth mt5":"fr user_default_btn background191 font-18 pathbtensbox absolutewidth"}>预约报名成功</span>}
</span>:""}
return(
<div key={key}>
{item.course_status.status===0?<div className="mr51 shixun_detail pointer fl user-colorgrey-green pathdefault">即将开课</div>:""}
{item.course_status.status===1?<div className="mr51 shixun_detail pointer fl color-orange pathdefault">{item.course_status.time}</div>:""}
{item.course_status.status===2&&item.course_identity<6?<div className="mr51 shixun_detail pointer fl user-colorgrey-9b pathdefault">已结束</div>:""}
{item.course_status.status===0?
item.course_identity<5?<a className="fr user_default_btn task-btn-orange font-18 mt28 pathbtens courseslistsa" href={item.first_category_url} target="_blank">
进入课堂
</a>:item.course_identity<6?<div className="fr user_default_btn background191 font-18 mt28 pathbtens pathdefault"></div>
:<a className="fr user_default_btn task-btn-orange font-18 mt28 pathbtens" onClick={()=>this.JoinnowCourse(item.course_id)}>立即报名</a>:""}
{item.course_status.status===1?
item.course_identity<5?<a className="courseslistsa fr user_default_btn task-btn-orange font-18 mt28 pathbtens" href={item.first_category_url} target="_blank">
进入课堂
</a>:item.course_identity<6?<a className="courseslistsa fr user_default_btn task-btn-orange font-18 mt28 pathbtens" href={item.first_category_url} target="_blank">
立即学习
</a>:<a className="fr user_default_btn task-btn-orange font-18 mt28 pathbtens" onClick={()=>this.JoinnowCourse(item.course_id,item.course_status.status)}></a>:""}
{item.course_status.status===2?
item.course_identity<6?<a className="fr user_default_btn task-btn-orange font-18 mt28 pathbtens courseslistsa" href={item.first_category_url} target="_blank">
进入课堂
</a>:<div className="fr user_default_btn background191 font-18 mt28 pathbtens pathdefault"></div>:""}
</div>
)})}
</li>
</div>} </div>}
</div> </div>

@ -85,6 +85,8 @@ class PathDetailIndex extends Component{
items: getItems(10), items: getItems(10),
pathtopskey:1, pathtopskey:1,
dataquerys:{}, dataquerys:{},
MenuItemsindex:1,
MenuItemsindextype:0
} }
this.onDragEnd = this.onDragEnd.bind(this); this.onDragEnd = this.onDragEnd.bind(this);
@ -147,7 +149,10 @@ class PathDetailIndex extends Component{
} }
componentDidMount(){ componentDidMount(){
this.getlistdatas()
}
getlistdatas=()=>{
const query = this.props.location.search; const query = this.props.location.search;
// const type = query.split('?chinaoocTimestamp='); // const type = query.split('?chinaoocTimestamp=');
// console.log("Eduinforms12345"); // console.log("Eduinforms12345");
@ -254,7 +259,13 @@ class PathDetailIndex extends Component{
console.log(error); console.log(error);
}) })
}; };
getMenuItemsindex=(key,status)=>{
this.setState({
MenuItemsindex:key,
MenuItemsindextype:status
})
}
getdatasindex=(key)=>{ getdatasindex=(key)=>{
// yslwebobject 后端需要的接口 // yslwebobject 后端需要的接口
let pathid=this.props.match.params.pathId; let pathid=this.props.match.params.pathId;
@ -460,9 +471,13 @@ class PathDetailIndex extends Component{
members, members,
tags, tags,
courses, courses,
MenuItemsindex,
MenuItemsindextype
} = this.state } = this.state
// console.log(MenuItemsindex)
// console.log(MenuItemsindextype===2&&detailInfoList&&detailInfoList.allow_statistics===false)
return( return(
<div className="newContainer"> <div className="newContainer">
<style> <style>
@ -487,7 +502,7 @@ class PathDetailIndex extends Component{
> >
</Modals> </Modals>
<div className="newMain clearfix"> <div className="newMain clearfix">
<DetailTop {...this.state} {...this.props} getdatasindex={(key)=>this.getdatasindex(key)}></DetailTop> <DetailTop {...this.state} {...this.props} getdatasindex={(key)=>this.getdatasindex(key)} getMenuItemsindex={(key,status)=>this.getMenuItemsindex(key,status)} getlistdatas={()=>this.getlistdatas()}></DetailTop>
<div className="educontent clearfix mb80"> <div className="educontent clearfix mb80">
<div className="with65 fl"> <div className="with65 fl">
<div className="produce-content mb10"> <div className="produce-content mb10">

@ -0,0 +1,5 @@
require 'rails_helper'
RSpec.describe CreateSubjectCourseStudentJob, type: :job do
pending "add some examples to (or delete) #{__FILE__}"
end
Loading…
Cancel
Save