dev_newshixunModel
杨树林 5 years ago
commit 2659d11712

@ -378,7 +378,6 @@ DEPENDENCIES
kaminari (~> 1.1, >= 1.1.1)
listen (>= 3.0.5, < 3.2)
mysql2 (>= 0.4.4, < 0.6.0)
newrelic_rpm
oauth2
pdfkit
puma (~> 3.11)

@ -127,21 +127,21 @@ class AccountsController < ApplicationController
# UserDayCertification.create(user_id: user.id, status: 1)
end
def set_autologin_cookie(user)
token = Token.get_or_create_permanent_login_token(user, "autologin")
cookie_options = {
:value => token.value,
:expires => 1.month.from_now,
:path => '/',
:secure => false,
:httponly => true
}
if edu_setting('cookie_domain').present?
cookie_options = cookie_options.merge(domain: edu_setting('cookie_domain'))
end
cookies[autologin_cookie_name] = cookie_options
logger.info("cookies is #{cookies}")
end
# def set_autologin_cookie(user)
# token = Token.get_or_create_permanent_login_token(user, "autologin")
# cookie_options = {
# :value => token.value,
# :expires => 1.month.from_now,
# :path => '/',
# :secure => false,
# :httponly => true
# }
# if edu_setting('cookie_domain').present?
# cookie_options = cookie_options.merge(domain: edu_setting('cookie_domain'))
# end
# cookies[autologin_cookie_name] = cookie_options
# logger.info("cookies is #{cookies}")
# end
def logout
UserAction.create(action_id: User.current.id, action_type: "Logout", user_id: User.current.id, :ip => request.remote_ip)

@ -253,7 +253,10 @@ class ApplicationController < ActionController::Base
if Digest::MD5.hexdigest(content) == params[:chinaoocKey]
user = open_class_user
start_user_session(user) if user
if user
start_user_session(user)
set_autologin_cookie(user)
end
User.current = user
end
end
@ -617,6 +620,22 @@ class ApplicationController < ActionController::Base
cookies[:fileDownload] = true
end
def set_autologin_cookie(user)
token = Token.get_or_create_permanent_login_token(user, "autologin")
cookie_options = {
:value => token.value,
:expires => 1.month.from_now,
:path => '/',
:secure => false,
:httponly => true
}
if edu_setting('cookie_domain').present?
cookie_options = cookie_options.merge(domain: edu_setting('cookie_domain'))
end
cookies[autologin_cookie_name] = cookie_options
logger.info("cookies is #{cookies}")
end
# 149课程的评审用户数据创建包含创建课堂学生
def open_class_user
user = User.find_by(login: "OpenClassUser")

@ -51,7 +51,7 @@ class CommonsController < ApplicationController
200
end
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
403
else

@ -128,8 +128,8 @@ class CoursesController < ApplicationController
# POST /courses
# POST /courses.json
def create
ActiveRecord::Base.transaction do
begin
ActiveRecord::Base.transaction do
@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,
authentication: params[:authentication], professional_certification: params[:professional_certification])
@ -174,13 +174,14 @@ class CoursesController < ApplicationController
course_module_types = params[:course_module_types]
@course.create_course_modules(course_module_types)
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
# PATCH/PUT /courses/1
# PATCH/PUT /courses/1.json

@ -476,10 +476,13 @@ class GamesController < ApplicationController
if @myshixun.shixun.try(:status) < 2
tip_exception("代码获取异常,请检查实训模板的评测设置是否正确")
else
# 报错继续retry
tip_exception(-3, "#{e.message}")
end
end
# 如果报错了并且retry 为1的时候则fork一个新的仓库
if params[:retry].to_i == 1
project_fork(@myshixun, @shixun.repo_path, current_user.login)
end
tip_exception(0, e.message)
end
end

@ -19,6 +19,10 @@ class GitsController < ApplicationController
result = false
if request.env["HTTP_AUTHORIZATION"] && request.env["HTTP_AUTHORIZATION"].split(" ").length == 2
username_password = Base64.decode64(request.env["HTTP_AUTHORIZATION"].split(" ")[1])
if username_password.split(":")[0].nil? || username_password.split(":")[1].nil?
result = false
else
input_username = username_password.split(":")[0].strip()
input_password = username_password.split(":")[1].strip()
uid_logger("git start auth: input_username is #{input_username}")
@ -60,6 +64,7 @@ class GitsController < ApplicationController
end
end
end
end
authenticate_or_request_with_http_basic do |username, password|
result

@ -692,7 +692,7 @@ class PollsController < ApplicationController
else
unified_setting = @poll.unified_setting
end
show_result = params[:show_result] ? 1 : 0
show_result = params[:show_result].to_i
un_anonymous = params[:un_anonymous] ? true : false
# 统一设置或者分班为0则更新问卷并删除问卷分组
if unified_setting || (course_group_ids.size == 0)

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

@ -134,6 +134,11 @@ class HomeworkCommon < ApplicationRecord
self.homework_type == 'practice' && self.publish_time.present? && self.publish_time < Time.now && self.homework_group_reviews.count == 0
end
# 作业查看最新成绩
def update_score identity
identity < Course::NORMAL && publish_time.present? && publish_time < Time.now && !course.is_end
end
# 作业能否立即发布
def publish_immediately user
homework_detail_manual.try(:comment_status) == 0 || homework_group_settings.where(course_group_id: course.charge_group_ids(user)).

@ -104,7 +104,7 @@ class Poll < ApplicationRecord
status = 4
else
if user.present? && user.student_of_course?(course)
ex_time = get_poll_times(user_id,false)
ex_time = get_poll_times(user.id,false)
pb_time = ex_time[:publish_time]
ed_time = ex_time[:end_time]
if pb_time.present? && ed_time.present? && pb_time <= Time.now && ed_time > Time.now

@ -4,6 +4,7 @@ json.partial! "homework_btn_check", locals: {identity: @user_course_identity, ho
json.partial! "student_btn_check", locals: {identity: @user_course_identity, homework: @homework, work: @work}
json.update_score @homework.update_score(@user_course_identity) if @homework.homework_type == "practice"
json.work_count @work_count
json.all_member_count @all_member_count
json.course_group_count @course.course_groups_count

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

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

@ -5,6 +5,7 @@ json.members_count course.course_members_count
# json.homework_commons_count course.homework_commons_count
json.homework_commons_count get_tasks_count course
json.attachments_count course.attachments.count
json.visits course.visits
json.first_category_url module_url(course.course_modules.where(hidden: 0).order(position: :desc).first, course)

File diff suppressed because one or more lines are too long

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

@ -32,7 +32,7 @@ module.exports = {
// See the discussion in https://github.com/facebookincubator/create-react-app/issues/343.s
// devtool: "cheap-module-eval-source-map",
// 开启调试
// devtool: "eval", // 开启调试
// devtool: "eval-source-map", // 开启调试
// These are the "entry points" to our application.
// This means they will be the "root" imports that are included in JS bundle.
// The first two entry points enable "hot" CSS and auto-refreshes for JS.

@ -70,10 +70,23 @@ class NewWorkForm extends Component{
contentFileList,
answerFileList,
}, () => {
setTimeout(() => {
this.contentMdRef.current.setValue(data.description || '')
this.answerMdRef.current.setValue(data.reference_answer || '')
}, 2000)
// setTimeout(() => {
// this._scrollToTop()
// 阻止setValue的滚动
// $(window).scroll( function() {
// $("html").scrollTop(0)
// $(window).unbind("scroll");
// });
/**
setValue会调用到 codemirror的 o.scrollIntoView(i), 会导致滚动条跳动
*/
// $('.editormd').parent().css('position', 'fixed').css('left', '-1000px')
// this.contentMdRef.current.setValue(data.description || '')
// this.answerMdRef.current.setValue(data.reference_answer || '')
// setTimeout(() => {
// $('.editormd').parent().css('position', '').css('left', 'auto')
// }, 100);
// }, 500)
this.props.form.setFieldsValue({
title: data.name,
@ -85,12 +98,13 @@ class NewWorkForm extends Component{
} else { // new
}
this._scrollToTop()
// this._scrollToTop()
}
_scrollToTop = () => {
setTimeout(() => {
$("html").animate({ scrollTop: 0 })
}, 1500)
// setTimeout(() => {
$("html").scrollTop(0)
// $("html").animate({ scrollTop: 0 })
// }, 1000)
}
// 输入title
@ -292,6 +306,8 @@ class NewWorkForm extends Component{
this.setState({ base_on_project: !this.state.base_on_project })
}
componentDidMount() {
this.isEdit = this.props.match.url.indexOf('/edit')
window.$('.groupSetting .ant-form-item-label > label').addClass('ant-form-item-required')
this._scrollToTop()
}
@ -303,15 +319,13 @@ class NewWorkForm extends Component{
let{
title_value, contentFileList, answerFileList, max_num, min_num, base_on_project,
init_max_num, init_min_num,
title_num, course_name, category, has_commit, has_project,
isEdit
title_num, course_name, category, has_commit, has_project
}=this.state
const { current_user } = this.props
const courseId = this.state.course_id || this.props.match.params.coursesId ;
if ((isEdit) && !this.state.workLoaded) {
if ((this.isEdit) && !this.state.description) {
return ''
}
const uploadProps = {
@ -439,7 +453,8 @@ class NewWorkForm extends Component{
}],
})(
<TPMMDEditor ref={this.contentMdRef} placeholder="请在此输入作业内容和要求,最大限制5000个字符" mdID={'courseContentMD'} refreshTimeout={1500}
className="courseMessageMD" initValue={this.state.description}></TPMMDEditor>
initValue={this.state.description} noSetValue={true}
className="courseMessageMD" ></TPMMDEditor>
)}
</Form.Item> }
<Upload {...uploadProps} className="upload_1 newWorkUpload">
@ -479,7 +494,7 @@ class NewWorkForm extends Component{
<InputNumber className="winput-240-40" placeholder="请填写每组最大人数" value={max_num} max={10}
onChange={this.max_num_change} style={{width:'180px'}} />
</ConditionToolTip>
<label className="color-grey-9 ml20 font-14">项目管理员角色的成员都可以提交作品提交作品时需要关联同组成员组内成员作品共享</label>
<label className="color-grey-9 ml20 font-14">学生提交作品时需要关联同组成员组内成员作品共享</label>
</p>
<p className="mt20">
<ConditionToolTip condition={has_commit || has_project} title={'已有关联项目或作品,不能修改'}>
@ -488,7 +503,7 @@ class NewWorkForm extends Component{
>基于项目实施</Checkbox>
</ConditionToolTip>
<label className="color-grey-9 ml12 font-14">勾选后各小组必须在educoder平台创建项目教师可随时观察平台对各小组最新进展的实时统计</label>
<label className="color-grey-9 ml12 font-14">选中则必须在本平台创建项目项目管理员可以提交作品不选中无需在平台创建项目任意小组成员均可以提交作品</label>
</p>
</div>
)}
@ -507,7 +522,8 @@ class NewWorkForm extends Component{
}],
})(
<TPMMDEditor ref={this.answerMdRef} placeholder="请在此输入作业的参考答案,最大限制5000个字符" mdID={'workAnswerMD'}
className="courseMessageMD" refreshTimeout={1500} initValue={this.state.reference_answer || ''}></TPMMDEditor>
initValue={this.state.reference_answer || ''} noSetValue={true}
className="courseMessageMD" refreshTimeout={1500} ></TPMMDEditor>
)}
</Form.Item>
<Upload {...answerUploadProps} className="upload_1 newWorkUpload resetNewWorkUpload">

@ -30,7 +30,7 @@ class CoursesListType extends Component {
return(
<span style={{display:'inline-block'}}>
{
typelist===undefined?"":typelist.map((item,key)=>{
typelist===undefined || typelist=== 403 || typelist === 401 || typelist=== 407 || typelist=== 408|| typelist=== 409 || typelist === 500?"":typelist.map((item,key)=>{
return(
<Tooltip placement="bottom" title={tipval} getPopupContainer={()=>document.querySelector('.TabsWarp')} key={key}>
<span key={key}>

@ -233,7 +233,7 @@ class Bullsubdirectory extends Component{
{
whethertoeditysl === false?
<div>
<div>
<div className="fudonyingxiangysls">
<div className="fudonyingxiangysl">
<div style={{marginRight:"60px"}}>
<span className="ysltitbt">{myname}</span>

@ -70,6 +70,10 @@
.fudonyingxiangysl{
width: 100%;
}
.fudonyingxiangysls{
display: flex;
flex-direction:column;
}
.yslbianji{
padding-top: 31px;

@ -285,7 +285,7 @@ class GraduationTasksSubmitedit extends Component{
let{ search,page,limit,workslist}=this.state;
let newpage=page+2
let newpage=page+1
this.searchList(search,newpage,limit,workslist.task_id,1)

@ -271,20 +271,27 @@ class GraduationTasksSubmitnew extends Component{
contentViewScroll=(e)=>{
//滑动到底判断
const {memberslist} = this.state;
let newscrollTop=parseInt(e.currentTarget.scrollTop);
let allclientHeight=e.currentTarget.clientHeight+newscrollTop;
if(e.currentTarget.scrollHeight-allclientHeight===0||e.currentTarget.scrollHeight-allclientHeight===1||e.currentTarget.scrollHeight-allclientHeight===-1){
// console.log("到达底部");
if(memberslist.length===0){
return;
}else{
let{ search,page,limit }=this.state;
let newpage=page+2
let newpage=page+1
this.searchList(search,newpage,limit,1)
}
}
}

@ -32,8 +32,10 @@ class GraduationTasksappraise extends Component{
axios.get(zrl).then((result)=>{
if(result.status===200){
let status=result.data.status;
if(status===undefined || status=== 403 || status === 401 || status=== 407 || status=== 408|| status=== 409 || status === 500||status===-1){
if(result.data.status!=-1){
}else{
this.setState({
firelistdata:result.data,
})

@ -80,6 +80,8 @@ class GraduationTaskssettingapp extends Component{
starttime:undefined,
DownloadType:false,
DownloadMessageval:undefined,
commentstatustype:undefined,
commenttimeone:undefined
}
}
@ -102,10 +104,10 @@ class GraduationTaskssettingapp extends Component{
}
let starttype=false;
let endtype=false;
if(moment(result.data.publish_time)<moment()){
if(moment(result.data.publish_time)<=moment()){
starttype=true
}
if(moment(result.data.end_time)<moment()){
if(moment(result.data.end_time)<=moment()){
endtype=true
}
@ -130,6 +132,7 @@ class GraduationTaskssettingapp extends Component{
taskname: result.data.task_name,
coursename: result.data.course_name,
commentstatus: result.data.comment_status,
commentstatustype:result.data.status,
commentnum: result.data.comment_num,
operworks: result.data.open_work,
opergrade: result.data.open_score,
@ -343,28 +346,33 @@ class GraduationTaskssettingapp extends Component{
let {endtimetype}=this.state;
if(types===1){
this.setState({
latetime:newlatetime,
// latetime:newlatetime,
crosscomment:true,
commenttime:newcommenttime
commenttime:newlatetime,
commenttimeone:newlatetime,
})
}else{
if(endtimetype===true){
this.setState({
crosscomment:true,
commenttime:newcommenttime
commenttime:newlatetime,
commenttimeone:newlatetime,
})
}else{
this.setState({
end_time:newlatetime,
// end_time:newlatetime,
crosscomment:true,
commenttime:newcommenttime
commenttime:newlatetime,
commenttimeone:newlatetime,
})
}
}
}
funcrosscomment=(e)=>{
let {latetime,end_time,allowlate}=this.state;
let {latetime,end_time,allowlate,commenttime,commenttimeone}=this.state;
let commenttimetype=commenttime===null||commenttime==="";
let newlatetimea=moment(new Date()).add(7, 'days').format("YYYY-MM-DD HH:mm");
let newcommenttimea=moment(new Date()).format("YYYY-MM-DD HH:mm");
@ -377,8 +385,8 @@ class GraduationTaskssettingapp extends Component{
let newend_timed=moment(end_time).add(7, 'days').format("YYYY-MM-DD HH:mm");
let newcommenttimed=moment(end_time).add(8, 'days').format("YYYY-MM-DD HH:mm");
let newtime;
if(e.target.checked===true){
if(commenttimetype===true){
if(allowlate===1||allowlate===true){
if(latetime===null||latetime===""){
@ -393,6 +401,13 @@ class GraduationTaskssettingapp extends Component{
this.updatesfuncrosscomment(2,newend_timed,newcommenttimed)
}
}
}else{
this.setState({
crosscomment:e.target.checked,
commenttime:commenttimeone,
})
}
}else{
this.setState({
crosscomment:e.target.checked,
@ -519,10 +534,10 @@ class GraduationTaskssettingapp extends Component{
}
if(moment(end_time)<moment(publish_time)){
if(moment(end_time)<=moment(publish_time)){
this.setState({
endTimetypes:true,
endTimetypesval:"截止时间不能早于发布时间"
endTimetypesval:"截止时间必须晚于发布时间"
})
return
}else{
@ -531,16 +546,16 @@ class GraduationTaskssettingapp extends Component{
})
}
if(moment(latetime)<moment(publish_time)){
if(moment(latetime)<=moment(publish_time)){
this.setState({
latetimetype:true,
latetimetypeval:"结束时间不能早于发布时间"
latetimetypeval:"结束时间必须晚于发布时间"
})
return
}else if(moment(latetime)<moment(end_time)){
}else if(moment(latetime)<=moment(end_time)){
this.setState({
latetimetype:true,
latetimetypeval:"结束时间不能早于截止时间"
latetimetypeval:"结束时间必须晚于截止时间"
})
return
}else{
@ -562,7 +577,7 @@ class GraduationTaskssettingapp extends Component{
commenttimetype:false
})
}
if(moment(this.state.commenttime)<moment(publish_time)){
if(moment(this.state.commenttime)<=moment(publish_time)){
this.setState({
commenttimetype:true,
commenttimevalue:"开始时间不能小于发布时间",
@ -574,7 +589,7 @@ class GraduationTaskssettingapp extends Component{
})
}
if(moment(this.state.commenttime)<moment(end_time)){
if(moment(this.state.commenttime)<=moment(end_time)){
this.setState({
commenttimetype:true,
commenttimevalue:"开始时间不能小于截止时间",
@ -918,7 +933,8 @@ class GraduationTaskssettingapp extends Component{
endtimetype,
commenttimetype,
commenttimevalue,
flagPageEdit
flagPageEdit,
commentstatustype
} =this.state;
let courseId=this.props.match.params.coursesId;
@ -992,7 +1008,7 @@ class GraduationTaskssettingapp extends Component{
}
{/*内容*/}
{task_type===2?<div className="stud-class-set bor-bottom-greyE pd20 edu-back-white pl30" >
<div className={"xingrequired font-16 color-dark h20 mb20"}>分组设置 <span className={"font-14 color-grey-c"}>提交作品时需要关联同组成员组内成员作品共享</span></div>
<div className={"xingrequired font-16 color-dark h20 mb20"}>分组设置 <span className={"font-14 color-grey-c"}></span></div>
<div className={"mb30 h20 ml40"}>
<Input className={numtype===true?"noticeTip mr20":"mr20"} style={{ width:"100px" }} value={minnum} onInput={this.setminnum} disabled={this.props.isAdmin()===true?flagPageEdit===true?false:true:true}/>
<span className="mr20">~</span>
@ -1154,7 +1170,7 @@ class GraduationTaskssettingapp extends Component{
<div className={" font-16 color-dark h20 mb20"}>评分设置 </div>
<div className={"font-16 h20 mb20"}>最终成绩组成 <span className={"font-14 color-grey-c"}>取各教师最终评分的平均分</span></div>
<Checkbox className="ml40 font-16" checked={crosscomment} onChange={this.funcrosscomment}
disabled={this.props.isAdmin()===true?flagPageEdit===true?false:true:true} >启用交叉评阅 <span className={"font-14 color-grey-c"}>给老师分配其他指导老师的学生作品</span>
disabled={this.props.isAdmin()===true?flagPageEdit===true?commentstatustype===3?true:false:true:true} >启用交叉评阅 <span className={"font-14 color-grey-c"}>给老师分配其他指导老师的学生作品</span>
</Checkbox>
{crosscomment===true?<div>
<div className={"h20 mb30 ml30 mt20 ml87"}>

@ -107,9 +107,10 @@ class GraduationTasks extends Component{
if (response.data.status == 0) {
// {"status":1,"message":"删除成功"}
this.fetchAll(search,page,order)
this.props.showNotification(response.data.message);
this.setState({
Modalstype:true,
Modalstopval:response.data.message,
// Modalstype:true,
// Modalstopval:response.data.message,
ModalsBottomval:"",
ModalSave:this.cancelmodel,
Loadtype:true,

@ -382,7 +382,7 @@ class GraduateTopicPostWorksNew extends Component{
)}
</Form.Item>
<span className="tag color-grey9 ">(项目管理员角色的成员都可以提交作品提交作品时需要关联同组成员组内成员作品共享)</span>
<span className="tag color-grey9 ">(学生提交作品时需要关联同组成员组内成员作品共享)</span>
<Form.Item
label=""
className=" "
@ -394,7 +394,7 @@ class GraduateTopicPostWorksNew extends Component{
<Checkbox >基于项目实施</Checkbox>
)}
</Form.Item>
<span className="tag color-grey9 ">(勾选后各小组必须在educoder平台创建项目教师可随时观察平台对各小组最小进展的实时统计)</span>
<span className="tag color-grey9 ">(选中则必须在本平台创建项目项目管理员可以提交作品不选中无需在平台创建项目任意小组成员均可以提交作品)</span>
</div>
<div className="formBlock">

@ -2863,7 +2863,7 @@ class PollNew extends Component {
}
</style>
<Input placeholder="请输入问卷标题最大限制60个字符" maxLength="60"
style={{"margin-top": "15px", "text-align": "left"}}
style={{"margin-top": "15px", textAlign: "left"}}
onInput={this.changeTopicName}
readOnly={readOnlys}
autoComplete="off"
@ -2887,7 +2887,7 @@ class PollNew extends Component {
<div style={{"color": "#212121", "font-size": "16px"}}>问卷须知</div>
<TextArea placeholder="请输入本次问卷答题的相关说明最大限制100个字符"
style={{"height": "120px", "margin-top": "15px", "text-align": "left"}}
style={{"height": "120px", "margin-top": "15px", textAlign: "left"}}
maxLength="100"
readOnly={readOnlys}
onInput={this.changeTopicNametwo}
@ -3012,8 +3012,8 @@ class PollNew extends Component {
{item.question.answers === undefined ? "" : item.question.answers.map((items, i) => {
return (
<div className="h20 pt20" style={{"clear": "both"}}>
<Radio value={i} className={"fl"} style={{"text-align": "left",marginTop:"3px"}}></Radio>
<span className={" flex1 "} style={{"text-align": "left","white-space":"pre-wrap","word-break": "break-all","word-wrap": "break-word","float": "left","width":"1116px"}} >{items.answer_text}</span>
<Radio value={i} className={"fl"} style={{textAlign: "left",marginTop:"3px"}}></Radio>
<span className={" flex1 "} style={{textAlign: "left","white-space":"pre-wrap","word-break": "break-all","word-wrap": "break-word","float": "left","width":"1116px"}} >{items.answer_text}</span>
</div>
)
@ -3029,8 +3029,8 @@ class PollNew extends Component {
{item.question.answers === undefined ? "" : item.question.answers.map((items, i) => {
return (
<div className="mt10 pt20 " style={{"clear": "both"}}>
<Checkbox value={i} key={i} className={"fl"} style={{"text-align": "left"}}></Checkbox>
<span className={" flex1"} style={{"text-align": "left","white-space":"pre-wrap","word-break": "break-all","word-wrap": "break-word","float": "left","width":"1120px"}}>{items.answer_text}</span>
<Checkbox value={i} key={i} className={"fl"} style={{textAlign: "left",marginRight:"8px"}}></Checkbox>
<span className={" flex1"} style={{textAlign: "left","white-space":"pre-wrap","word-break": "break-all","word-wrap": "break-word","float": "left","width":"1116px"}}>{items.answer_text}</span>
</div>
)
})}
@ -3086,7 +3086,7 @@ class PollNew extends Component {
<p className="df mb20">
<span
className="color-grey-6 mr3 w60 font-16 lineh-40"
style={{"text-align": "center"}}>其它</span>
style={{textAlign: "center"}}>其它</span>
<input
className="mr20 input-flex-40 TextAreainput" disabled
@ -3100,7 +3100,7 @@ class PollNew extends Component {
: ""}
</p>) : (<p className="df mb20">
<span className="color-grey-6 mr10 w60 font-16 lineh-40"
style={{"text-align": "center"}}>选项</span>
style={{textAlign: "center"}}>选项</span>
<TextArea
autosize={{minRows: 1, maxRows: 5}}
@ -3172,7 +3172,7 @@ class PollNew extends Component {
"height": "80%";
"margin-top": "5px";
"margin-left": "5px";
"text-align": "center";
textAlign: "center";
"display": "block";
"opacity": "1";
}
@ -3328,7 +3328,7 @@ class PollNew extends Component {
<p className="df mb20">
<span
className="color-grey-6 mr3 w60 font-16 lineh-40"
style={{"text-align": "center"}}>其它</span>
style={{textAlign: "center"}}>其它</span>
<input
className="mr20 input-flex-40 TextAreainput" disabled
@ -3342,7 +3342,7 @@ class PollNew extends Component {
: ""}
</p>) : (<p className="df mb20">
<span className="color-grey-6 mr10 w60 font-16 lineh-40"
style={{"text-align": "center"}}>选项</span>
style={{textAlign: "center"}}>选项</span>
<TextArea
autosize={{minRows: 1, maxRows: 5}}
@ -3414,7 +3414,7 @@ class PollNew extends Component {
"height": "80%";
"margin-top": "5px";
"margin-left": "5px";
"text-align": "center";
textAlign: "center";
"display": "block";
"opacity": "1";
}
@ -3579,7 +3579,7 @@ class PollNew extends Component {
<p className="df mb20">
<span
className="color-grey-6 mr3 w60 font-16 lineh-40"
style={{"text-align": "center"}}>其它</span>
style={{textAlign: "center"}}>其它</span>
<input
className="mr20 input-flex-40 TextAreainput" disabled
@ -3593,7 +3593,7 @@ class PollNew extends Component {
: ""}
</p>) : (<p className="df mb20">
<span className="color-grey-6 mr10 w60 font-16 lineh-40"
style={{"text-align": "center"}}>选项</span>
style={{textAlign: "center"}}>选项</span>
<TextArea
autosize={{minRows: 1, maxRows: 5}}
@ -3665,7 +3665,7 @@ class PollNew extends Component {
"height": "80%";
"margin-top": "5px";
"margin-left": "5px";
"text-align": "center";
textAlign: "center";
"display": "block";
"opacity": "1";
}

@ -3059,20 +3059,20 @@ class Listofworksstudentone extends Component {
// console.log(this.props.isAdmin());
let course_is_end = this.props.current_user&&this.props.current_user.course_is_end;
try {
if(this.props.isAdmin() === false){
if(teacherdata&&teacherdata.student_works){
if(teacherdata&&teacherdata.student_works.length>0){
console.log("这是双层页面。。。。");
}
}
}
}catch (e) {
console.log("Listofworksstudentone123");
console.log(e);
}
// try {
// if(this.props.isAdmin() === false){
// if(teacherdata&&teacherdata.student_works){
// if(teacherdata&&teacherdata.student_works.length>0){
// console.log("这是双层页面。。。。");
//
// }
// }
//
// }
// }catch (e) {
// console.log("Listofworksstudentone123");
// console.log(e);
// }
return (
@ -3151,12 +3151,12 @@ class Listofworksstudentone extends Component {
typs={this.state.typs}
/>
{
homework_status.length===0?
homework_status&&homework_status.length===0?
<div className="edu-back-white">
<NoneData></NoneData>
</div>
:
homework_status.length>0 && homework_status[0]==="未发布"?
homework_status&&homework_status.length>0 && homework_status[0]==="未发布"?
<div className="edu-back-white">
<NoneData></NoneData>
</div>
@ -3231,7 +3231,7 @@ class Listofworksstudentone extends Component {
<div className="fr mr5 search-newysl" style={{marginBottom: '1px'}}>
{course_is_end===true?"":<span>
{teacherdata&&teacherdata.publish_immediately===false&&computeTimetype===true?
{teacherdata&&teacherdata.update_score===true&&computeTimetype===true?
(this.props.isNotMember()===false?<div className={"computeTime font-16"} onClick={this.setComputeTimet}>
查看最新成绩
</div>:""):
@ -3491,12 +3491,12 @@ class Listofworksstudentone extends Component {
}
{
homework_status.length===0?
homework_status&&homework_status.length&&homework_status.length===0?
<div className=" clearfix edu-back-white" style={{margin: "auto" , minWidth:"1200px"}}>
<NoneData></NoneData>
</div>
:
homework_status.length>0 && homework_status[0]==="未发布"?
homework_status&&homework_status.length>0 && homework_status&&homework_status[0]==="未发布"?
<div className=" clearfix edu-back-white " style={{margin: "auto" , minWidth:"1200px"}}>
<NoneData></NoneData>
</div>
@ -3555,9 +3555,13 @@ class Listofworksstudentone extends Component {
{ course_is_end===true?"":teacherdata&&teacherdata.task_operation[0]==="开启挑战"?"":<span>
{computeTimetype===true?
(this.props.isNotMember()===false?
(
teacherdata&&teacherdata.update_score===true?
<div className={"computeTime font-16"} onClick={this.setComputeTime}>
查看最新成绩
</div>
:""
)
:"")
:
(teacherdata&&teacherdata.homework_status!==undefined&&teacherdata.homework_status[0]=== "未发布"? "":
@ -3651,12 +3655,12 @@ class Listofworksstudentone extends Component {
}
{
homework_status.length===0?
homework_status&&homework_status.length===0?
<div className=" clearfix edu-back-white" style={{margin: "auto" , minWidth:"1200px"}}>
<NoneData></NoneData>
</div>
:
homework_status.length>0 && homework_status[0]==="未发布"?
homework_status&&homework_status.length>0 && homework_status&&homework_status[0]==="未发布"?
<div className=" clearfix edu-back-white" style={{margin: "auto" , minWidth:"1200px"}}>
<NoneData></NoneData>
</div>
@ -3783,9 +3787,15 @@ class Listofworksstudentone extends Component {
<span className="fl mr10 color-grey-6 ">计算成绩时间{teacherdata&&teacherdata.calculation_time==null?"--": moment(teacherdata&&teacherdata.calculation_time).format('YYYY-MM-DD HH:mm')}</span>
{ course_is_end===true?"":teacherdata&&teacherdata.task_operation&&teacherdata.task_operation[0]==="开启挑战"?"":<span>
{computeTimetype===true?
(this.props.isNotMember()===false?<div className={"computeTime font-16"} onClick={this.setComputeTime}>
(this.props.isNotMember()===false?
(
teacherdata&&teacherdata.update_score===true?
<div className={"computeTime font-16"} onClick={this.setComputeTime}>
查看最新成绩
</div>:""):
</div>:""
)
:""):
teacherdata&&teacherdata.homework_status!==undefined&&teacherdata.homework_status[0]=== "未发布"? "":
(this.props.isNotMember()===false?<div className={"computeTimes font-16"}>
查看最新成绩

@ -92,7 +92,7 @@ class Trainingjobsetting extends Component {
level: undefined,
ealuation: false,
latededuction: undefined,
latedeductiontwo: "20",
latedeductiontwo: "0",
database: false,
datasheet: false,
databasetwo: undefined,
@ -120,8 +120,10 @@ class Trainingjobsetting extends Component {
showmodel:false,
code_review:false,
testscripttiptype:false,
end_timebool:false,
late_timesbool:false,
work_efficiencys:false,
}
// console.log("获取到的值")
// console.log("Trainingjobsetting")
@ -283,7 +285,7 @@ class Trainingjobsetting extends Component {
allowreplenishment: result.data.allow_late,
latededuction: result.data.late_penalty,
level: result.data.answer_open_evaluation === true ? "满分" : "扣分",
completionefficiencyscore: result.data.work_efficiency,
work_efficiencys: result.data.work_efficiency,
latedeductiontwo: result.data.eff_score,
proportion: result.data.shixun_evaluation === 0 ? "均分比例" : result.data.shixun_evaluation === 1 ? "经验值比例" : result.data.shixun_evaluation === 2 ? "自定义分值" : "",
publicwork: result.data.work_public,
@ -291,6 +293,12 @@ class Trainingjobsetting extends Component {
code_review:result.data.code_review
})
this.props.Getdataback(result,result.data);
if(this.props.isAdmin()!== undefined){
if(this.props.isAdmin()===true){
this.editSettings(result);
}
}
}
})
@ -634,7 +642,7 @@ class Trainingjobsetting extends Component {
late_penalty: parseInt(this.state.latededuction), //迟交扣分
late_time: moment(this.state.late_time).format('YYYY-MM-DD HH:mm'), //结束时间
answer_open_evaluation: this.state.level === "满分" ? true : false, //扣分项
work_efficiency: this.state.completionefficiencyscore, //完成效率评分占比
work_efficiency: this.state.work_efficiencys, //完成效率评分占比
eff_score: this.state.completionefficiencyscore === true ? this.state.latedeductiontwo : undefined,//占比分
shixun_evaluation: this.state.proportion === "均分比例" ? 0 : this.state.proportion === "经验值比例" ? 1 : this.state.proportion === "自定义分值" ? 2 : 0,
challenge_settings: array,
@ -659,6 +667,7 @@ class Trainingjobsetting extends Component {
flagPageEditsthrees:false,
flagPageEditsfor:false,
whethertopay:false,
completionefficiencyscore:false,
})
this.refs.targetElementTrainingjobsetting.scrollIntoView()
@ -1003,6 +1012,7 @@ class Trainingjobsetting extends Component {
this.state.latedeductiontwo=20;
this.setState({
completionefficiencyscore: e.target.checked,
work_efficiencys:e.target.checked,
latedeductiontwo: 20,
})
//均分比例
@ -1019,6 +1029,7 @@ class Trainingjobsetting extends Component {
this.state.latedeductiontwo=0;
this.setState({
completionefficiencyscore: e.target.checked,
work_efficiencys:e.target.checked,
latedeductiontwo: 0,
})
//均分比例
@ -1067,7 +1078,7 @@ class Trainingjobsetting extends Component {
// //占比分
changeTopicNametwo = (value) => {
// console.log("2e.target.value", value)
// console.log("TrainingjobsettingTrainingjobsetting", value)
if (value === "" || value === undefined) {
return
}
@ -1694,17 +1705,78 @@ class Trainingjobsetting extends Component {
if(this.state.allowreplenishment === false){
whethertopays=false;
}
if(this.state.jobsettingsdata!==undefined){
}
try {
if(this.state.jobsettingsdata&& this.state.jobsettingsdata.data.homework_status[0]==="未发布"){
this.setState({
flagPageEditsbox:true,
flagPageEdit: true,
completionefficiencyscore:true,
whethertopay:whethertopays,
flagPageEditstwo:releasetime,
flagPageEditsthrees:deadline,
flagPageEditsfor:endtime,
completionefficiencyscore:true,
work_efficiencys:true,
unifiedsetting:this.state.unifiedsetting,
latedeductiontwo:20,
});
//均分比例
try {
if(this.state.proportion==="均分比例"){
this.Equalproportion(20);
}else if(this.state.proportion==="经验值比例"){
this.Empiricalvalueratio(20);
}
}catch (e) {
}
}else {
this.setState({
flagPageEditsbox:true,
flagPageEdit: true,
whethertopay:whethertopays,
flagPageEditstwo:releasetime,
flagPageEditsthrees:deadline,
flagPageEditsfor:endtime,
unifiedsetting:this.state.unifiedsetting,
});
if(this.state.work_efficiencys===true){
this.setState({
completionefficiencyscore:true,
})
}else{
this.setState({
completionefficiencyscore:false,
})
}
}
}catch (e) {
this.setState({
flagPageEditsbox:true,
flagPageEdit: true,
whethertopay:whethertopays,
flagPageEditstwo:releasetime,
flagPageEditsthrees:deadline,
flagPageEditsfor:endtime,
unifiedsetting:this.state.unifiedsetting,
});
if(this.state.work_efficiencys===true){
this.setState({
completionefficiencyscore:true,
})
}else{
this.setState({
completionefficiencyscore:false,
})
}
}
if(this.state.proportion === "自定义分值"){
this.setState({
boolUnitetwoname:"自定义分值",
@ -1717,8 +1789,122 @@ class Trainingjobsetting extends Component {
} catch (e) {
}
};
//一进来就是老师要用的编辑页面
editSettings=(datas)=>{
console.log("编辑页面");
console.log(datas);
try {
if (datas.data.is_end === true) {
this.setState({
modalsType: true,
modalsTopval: "课堂已结束不能再修改!",
loadtype: true,
modalSave: this.cancelBox
})
} else {
var releasetime =true;
var deadline = true;
var endtime =true;
var whethertopays =true;
//发布时间
if(moment(datas.data.publish_time,"YYYY-MM-DD HH:mm")<=moment()){
releasetime=false;
}
//截止时间
if(moment(datas.data.end_time,"YYYY-MM-DD HH:mm")<=moment()){
deadline=false;
}
//结束时间
if(moment(datas.data.late_time,"YYYY-MM-DD HH:mm")<=moment()){
endtime=false;
}
if(datas.data.allowreplenishment === false){
whethertopays=false;
}
try {
if(datas.data&& datas.data.homework_status[0]==="未发布"){
this.setState({
flagPageEditsbox:true,
flagPageEdit: true,
whethertopay:whethertopays,
flagPageEditstwo:releasetime,
flagPageEditsthrees:deadline,
flagPageEditsfor:endtime,
completionefficiencyscore:true,
work_efficiencys:true,
unifiedsetting:datas.data.unifiedsetting,
latedeductiontwo:20,
});
//均分比例
try {
if(datas.data.proportion==="均分比例"){
this.Equalproportion(20);
}else if(datas.data.proportion==="经验值比例"){
this.Empiricalvalueratio(20);
}
}catch (e) {
}
}else {
this.setState({
flagPageEditsbox:true,
flagPageEdit: true,
whethertopay:whethertopays,
flagPageEditstwo:releasetime,
flagPageEditsthrees:deadline,
flagPageEditsfor:endtime,
unifiedsetting:datas.data.unifiedsetting,
});
if(datas.data.work_efficiencys===true){
this.setState({
completionefficiencyscore:true,
})
}else{
this.setState({
completionefficiencyscore:false,
})
}
}
}catch (e) {
this.setState({
flagPageEditsbox:true,
flagPageEdit: true,
whethertopay:whethertopays,
flagPageEditstwo:releasetime,
flagPageEditsthrees:deadline,
flagPageEditsfor:endtime,
unifiedsetting:datas.data.unifiedsetting,
});
if(datas.data.work_efficiencys===true){
this.setState({
completionefficiencyscore:true,
})
}else{
this.setState({
completionefficiencyscore:false,
})
}
}
if(datas.data.proportion === "自定义分值"){
this.setState({
boolUnitetwoname:"自定义分值",
boolUnitetwo: false,
flagPageEdits:true,
})
}
}
} catch (e) {
}
}
//取消编辑
cancelEdit = () => {
this.setState({
@ -1735,6 +1921,8 @@ class Trainingjobsetting extends Component {
hand__e_tip: "",
hand_flags: false,
handclass: undefined,
completionefficiencyscore:false,
latedeductiontwo:0,
unit_e_tip: "",
})
this.refs.targetElementTrainingjobsetting.scrollIntoView();
@ -1849,9 +2037,9 @@ class Trainingjobsetting extends Component {
const dataformat = 'YYYY-MM-DD HH:mm';
let {flagPageEdit,testscripttiptype,publish_timebool,end_timebool,late_timesbool,flagPageEdits,flagPageEditstwo,flagPageEditsbox,whethertopay,handclass,flagPageEditsthrees, flagPageEditsfor,rules,rulest,unifiedsetting,group_settings, course_group,unit_e_tip, borreds,borredss,unit_p_tip, end_time, late_time, score_open, publish_time, starttimetype, modalsType, modalsTopval, loadtype, modalSave, endtimetype, latetimetype, allowlate, latepenaltytype, jobsettingsdata, endOpen, mystyle, mystyles} = this.state;
console.log(publish_timebool);
console.log(!flagPageEditstwo);
let {flagPageEdit,testscripttiptype,publish_timebool,end_timebool,late_timesbool,work_efficiencys,flagPageEdits,flagPageEditstwo,flagPageEditsbox,whethertopay,handclass,flagPageEditsthrees, flagPageEditsfor,rules,rulest,unifiedsetting,group_settings, course_group,unit_e_tip, borreds,borredss,unit_p_tip, end_time, late_time, score_open, publish_time, starttimetype, modalsType, modalsTopval, loadtype, modalSave, endtimetype, latetimetype, allowlate, latepenaltytype, jobsettingsdata, endOpen, mystyle, mystyles} = this.state;
// console.log(publish_timebool);
// console.log(!flagPageEditstwo);
const radioStyle = {
display: 'block',
height: '30px',
@ -1877,6 +2065,8 @@ class Trainingjobsetting extends Component {
// }
// console.log(this.props.isAdmin())
// console.log(this.state.code_review===false)
// console.log("引入的分值");
// console.log(this.state.work_efficiencys);
return (
<div className=" clearfix " ref='targetElementTrainingjobsetting' style={{margin: "auto", minWidth:"1200px"}}>
{this.state.showmodel===true?<ShixunWorkModal
@ -2131,7 +2321,7 @@ class Trainingjobsetting extends Component {
<div className=" clearfix edu-back-white poll_list mt10" style={{marginLeft:" 40px"}}>
<Checkbox disabled={!flagPageEdit} className=" font-13 mt10"
onChange={this.onChangeeffectiveness}
checked={this.state.completionefficiencyscore} style={{"color":"#666666"}}>效率分<span
checked={this.state.work_efficiencys} style={{"color":"#666666"}}>效率分<span
className={"font-14 color-grey-c font-14 ml15"} style={{"text-align":"left"}}>(选中则学生最终成绩包含效率分)</span>
</Checkbox>
<div>

@ -1,58 +1,62 @@
import React, { Component } from 'react';
import React, {Component} from 'react';
import {
Spin,
Pagination,
} from "antd";
import axios from 'axios';
import {getImageUrl,markdownToHTML} from 'educoder';
import {getImageUrl, markdownToHTML} from 'educoder';
import "../css/messagemy.css"
//消息页面
class MessagSub extends Component{
class MessagSub extends Component {
constructor(props) {
super(props);
this.state={
page:1,
limit:10,
typeysl:"",
count:0,
isSpin:false,
data:undefined,
this.state = {
page: 1,
limit: 10,
typeysl: "",
count: 0,
isSpin: false,
data: undefined,
}
}
// 初始化数据
componentDidMount(){
componentDidMount() {
// console.log("初始化数据了MessagSub");
// console.log(this.props);
this.getdata("",this.state.page);
this.getdata("", this.state.page);
// this.Messageprivatemessageunreadmessage();
try {
this.props.Mtab(1);
}catch (e) {
} catch (e) {
}
this.props.triggerRef(this)
}
//塞选页数
paginationonChanges=(pageNumber)=>{
paginationonChanges = (pageNumber) => {
this.setState({
page: pageNumber,
})
this.getdata(this.state.typeysl,pageNumber);
this.getdata(this.state.typeysl, pageNumber);
}
//获取数据源
getdata=(types,page)=>{
getdata = (types, page) => {
this.setState({
isSpin:true,
isSpin: true,
})
let{limit}=this.state;
let {limit} = this.state;
let url = `/users/tidings.json`;
axios.get((url),{params:{
type:types,
page:page,
per_page:limit,
}}).then((result) => {
axios.get((url), {
params: {
type: types,
page: page,
per_page: limit,
}
}).then((result) => {
if (result) {
// if (result.data.status === 0) {
@ -68,21 +72,23 @@ class MessagSub extends Component{
}).catch((error) => {
console.log(error);
this.setState({
isSpin:false,
isSpin: false,
})
})
};
getdatas=()=>{
getdatas = () => {
this.setState({
isSpin:true,
isSpin: true,
})
let{typeysl,page,limit}=this.state;
let {typeysl, page, limit} = this.state;
let url = `/users/tidings.json`;
axios.get((url),{params:{
type:typeysl,
page:page,
per_page:limit,
}}).then((result) => {
axios.get((url), {
params: {
type: typeysl,
page: page,
per_page: limit,
}
}).then((result) => {
if (result) {
// if (result.data.status === 0) {
@ -98,36 +104,36 @@ class MessagSub extends Component{
}).catch((error) => {
console.log(error);
this.setState({
isSpin:false,
isSpin: false,
})
})
}
componentWillUnmount(){
componentWillUnmount() {
// 卸载异步操作设置状态
this.setState = (state, callback) => {
return;
}
}
gettourl=(item)=>{
gettourl = (item) => {
switch (item.container_type) {
case "ApplyUserAuthentication" :
if(item.tiding_type==="Apply"){
if(item.auth_type===1){
if (item.tiding_type === "Apply") {
if (item.auth_type === 1) {
//系统管理页面
return window.open("/managements/identity_authentication");
}
if(item.auth_type===2){
if (item.auth_type === 2) {
//系统管理页面
return window.open("/managements/professional_authentication")
}
}
if(item.tiding_type ==="System"){
if (item.tiding_type === "System") {
// 账号管理页-认证信息
return window.open("/account/certification")
}
return ;
return;
case "CancelUserAuthentication" :
// 账号管理页-认证信息
return window.open("/account/certification")
@ -135,65 +141,65 @@ class MessagSub extends Component{
// 账号管理页-认证信息
return window.open("/account/certification")
case "ApplyAddDepartment" :
if(item.tiding_type==="Apply"){
if (item.tiding_type === "Apply") {
//部门审批
return window.open("/managements/depart")
}
if(item.tiding_type==="System"){
if (item.tiding_type === "System") {
// 账号管理页/account/profile
return window.open("/account/profile")
}
return ;
return;
case "ApplyAddSchools" :
if(item.tiding_type==="Apply"){
if (item.tiding_type === "Apply") {
// 单位审批
return window.open(" /managements/unit")
}
if(item.tiding_type==="System"){
if (item.tiding_type === "System") {
// 账号管理页
return window.open("/account/profile")
}
return ;
return;
case "ApplyAction" :
switch (item.parent_container_type) {
case "ApplyShixun" :
if(item.tiding_type==="Apply"){
if (item.tiding_type === "Apply") {
return window.open("/managements/shixun_authorization")
}
if(item.tiding_type==="System"){
if (item.tiding_type === "System") {
// 实训详情页 :identifier = identifier
return window.open(`/shixuns/${item.identifier}/challenges`)
}
case "ApplySubject" :
if(item.tiding_type==="Apply"){
if (item.tiding_type === "Apply") {
// 实训课程发布
return window.open("/managements/subject_authorization")
}
if(item.tiding_type==="System"){
if (item.tiding_type === "System") {
// 实践课程详情页 :parent_container_id = parent_container_id
return window.open(`/paths/${item.parent_container_id}`)
}
case "TrialAuthorization" :
if(item.tiding_type==="Apply"){
if (item.tiding_type === "Apply") {
// 试用授权页面
return window.open("/managements/trial_authorization")
}
if(item.tiding_type==="System"){
if (item.tiding_type === "System") {
// 账号管理页
return window.open("/account/profile")
}
}
return ;
return;
case 'JoinCourse' :
// 课堂详情页 :id =
return window.open(`/courses/${item.belong_container_id}/teachers`)
case 'StudentJoinCourse':
// 课堂详情页 :id = container_id
if(item.tiding_type === 'Apply') {
if (item.tiding_type === 'Apply') {
return window.open(`/courses/${item.belong_container_id}/teachers`);
}
if(item.tiding_type === 'System'){
if (item.tiding_type === 'System') {
//教学案例详情 :id = container_id
return window.open(`/courses/${item.belong_container_id}/students`);
}
@ -205,7 +211,7 @@ class MessagSub extends Component{
return window.open(`/courses/${item.belong_container_id}/shixun_homeworks/${item.container_id}`)
case 'Course' :
// 课堂详情页 :id = container_id
if(item.tiding_type==="Delete"){
if (item.tiding_type === "Delete") {
return;
}
@ -226,15 +232,15 @@ class MessagSub extends Component{
return '';
case "HomeworkCommon" :
//学生作业页 homework = parent_container_id
if(item.homework_type==="normal"){
if (item.homework_type === "normal") {
//普通作业
return window.open(`/courses/${item.belong_container_id}/common_homeworks/${item.parent_container_id}/question`)
}
if(item.homework_type==="group"){
if (item.homework_type === "group") {
//分组作业
return window.open(`/courses/${item.belong_container_id}/group_homeworks/${item.parent_container_id}/question`)
}
if(item.homework_type==="practice"){
if (item.homework_type === "practice") {
//实训作业
return window.open(`/courses/${item.belong_container_id}/shixun_homeworks/${item.parent_container_id}/list?tab=1`)
}
@ -244,15 +250,15 @@ class MessagSub extends Component{
return window.open(`/courses/${item.belong_container_id}/graduation_topics/${item.parent_container_id}/detail`)
case "StudentWorksScore" :
//学生作业页
if(item.homework_type==="normal"){
if (item.homework_type === "normal") {
//普通作业
return window.open(`/courses/${item.belong_container_id}/common_homeworks/${item.parent_container_id}/question`)
}
if(item.homework_type==="group"){
if (item.homework_type === "group") {
//分组作业
return window.open(`/courses/${item.belong_container_id}/group_homeworks/${item.parent_container_id}/question`)
}
if(item.homework_type==="practice"){
if (item.homework_type === "practice") {
//实训作业
return window.open(`/courses/${item.belong_container_id}/shixun_homeworks/${item.parent_container_id}/list?tab=1`)
}
@ -329,70 +335,70 @@ class MessagSub extends Component{
switch (item.parent_container_type) {
case "AnonymousCommentFail" :
// 课堂-作业列表 homework = container_id
if(item.homework_type==="normal"){
if (item.homework_type === "normal") {
//普通作业
return window.open(`/courses/${item.belong_container_id}/common_homeworks/${item.parent_container_id}/list`)
}
if(item.homework_type==="group"){
if (item.homework_type === "group") {
//分组作业
return window.open(`/courses/${item.belong_container_id}/group_homeworks/${item.parent_container_id}/list`)
}
if(item.homework_type==="practice"){
if (item.homework_type === "practice") {
//实训作业
return window.open(`/courses/${item.belong_container_id}/shixun_homeworks/${item.parent_container_id}/list?tab=0`)
}
case "HomeworkPublish" :
if(item.homework_type==="normal"){
if (item.homework_type === "normal") {
//普通作业
return window.open(`/courses/${item.belong_container_id}/common_homeworks/${item.parent_container_id}/list`)
}
if(item.homework_type==="group"){
if (item.homework_type === "group") {
//分组作业
return window.open(`/courses/${item.belong_container_id}/group_homeworks/${item.parent_container_id}/list`)
}
if(item.homework_type==="practice"){
if (item.homework_type === "practice") {
//实训作业
return window.open(`/courses/${item.belong_container_id}/shixun_homeworks/${item.parent_container_id}/list?tab=0`)
}
case "AnonymousAppeal" :
if(item.homework_type==="normal"){
if (item.homework_type === "normal") {
//普通作业
return window.open(`/courses/${item.belong_container_id}/common_homeworks/${item.parent_container_id}/list`)
}
if(item.homework_type==="group"){
if (item.homework_type === "group") {
//分组作业
return window.open(`/courses/${item.belong_container_id}/group_homeworks/${item.parent_container_id}/list`)
}
if(item.homework_type==="practice"){
if (item.homework_type === "practice") {
//实训作业
return window.open(`/courses/${item.belong_container_id}/shixun_homeworks/${item.parent_container_id}/list?tab=0`)
}
default :
// 课堂-作业列表 homework = container_id
if(item.homework_type==="normal"){
if (item.homework_type === "normal") {
//普通作业
return window.open(`/courses/${item.belong_container_id}/common_homeworks/${item.parent_container_id}/list`)
}
if(item.homework_type==="group"){
if (item.homework_type === "group") {
//分组作业
return window.open(`/courses/${item.belong_container_id}/group_homeworks/${item.parent_container_id}/list`)
}
if(item.homework_type==="practice"){
if (item.homework_type === "practice") {
//实训作业
return window.open(`/courses/${item.belong_container_id}/shixun_homeworks/${item.parent_container_id}/list?tab=0`)
}
}
case "StudentWork" :
//课堂-作业 :id = container_id
if(item.homework_type==="normal"){
if (item.homework_type === "normal") {
//普通作业
return window.open(`/courses/${item.belong_container_id}/common_homeworks/${item.parent_container_id}/${item.container_id}/appraise`)
}
if(item.homework_type==="group"){
if (item.homework_type === "group") {
//分组作业/courses/1208/group_homeworks/22373/1219130/appraise
return window.open(`/courses/${item.belong_container_id}/group_homeworks/${item.parent_container_id}/${item.container_id}/appraise`)
}
if(item.homework_type==="practice"){
if (item.homework_type === "practice") {
//实训作业
return window.open(`/courses/${item.belong_container_id}/shixun_homeworks/${item.parent_container_id}/list?tab=0`)
}
@ -448,17 +454,17 @@ class MessagSub extends Component{
// /managements/library_applies
return window.open(`/managements/library_applies`)
}
if(item.tiding_type === 'System'){
if (item.tiding_type === 'System') {
//教学案例详情 :id = container_id
return window.open(`/moop_cases/${item.container_id}`)
}
case "ProjectPackage" :
if(item.tiding_type==="Destroyed"){
return ;
if (item.tiding_type === "Destroyed") {
return;
}
if(item.tiding_type==="Destroyed_end"){
return ;
}else {
if (item.tiding_type === "Destroyed_end") {
return;
} else {
if (item.tiding_type === 'Apply') {
///managements/project_package_applies
return window.open(`/managements/project_package_applies`)
@ -471,42 +477,54 @@ class MessagSub extends Component{
case "Discuss":
return window.open(`/shixuns/${item.identifier}/shixun_discuss`);
case "Video":
if(item.tiding_type==="Apply"){
if (item.tiding_type === "Apply") {
return window.open(`/managements/video_applies`);
}else if(item.tiding_type==="System"){
} else if (item.tiding_type === "System") {
return window.open(`/users/${this.props.current_user.login}/videos`);
}
return '';
case "PublicCourseStart":
return window.open(`/courses/${item.container_id}/informs`);
case "SubjectStartCourse":
return window.open(`/paths/${item.container_id}`);
case "ResubmitStudentWork":
return window.open(`/courses/${item.belong_container_id}/graduation_tasks/${item.container_id}/appraise`);
case "AdjustScore":
//belong_container_id course的id
return window.open(`/courses/${item.belong_container_id}/graduation_tasks/${item.parent_container_id}`);
default :
return window.open("/")
}
}
render() {
let{page,limit,typeysl,count,isSpin,data}=this.state;
let {page, limit, typeysl, count, isSpin, data} = this.state;
// console.log("6868686868");
// console.log(data);
return (
<div className="clearfix ml20">
{/*头部筛选数据*/}
<ul className="pl10 ridingNav clearfix edu-back-white">
<li className={typeysl===""?"active":""}><a onClick={(s,i)=>this.getdata("",1)}>全部</a></li>
<li className={typeysl&&typeysl==="course"?"active":""} ><a onClick={(s,i)=>this.getdata("course",1)}>课堂提醒</a></li>
<li className={typeysl&&typeysl==="project"?"active":""} ><a onClick={(s,i)=>this.getdata("project",1)}>项目提醒</a></li>
<li className={typeysl === "" ? "active" : ""}><a onClick={(s, i) => this.getdata("", 1)}>全部</a></li>
<li className={typeysl&&typeysl==="project_package"?"active":""}><a onClick={(s,i)=>this.getdata("project_package",1)}>众包提醒</a></li>
<li className={typeysl && typeysl === "course" ? "active" : ""}><a
onClick={(s, i) => this.getdata("course", 1)}>课堂提醒</a></li>
<li className={typeysl&&typeysl==="interaction"?"active":""}><a onClick={(s,i)=>this.getdata("interaction",1)}>互动提醒</a></li>
<li className={typeysl && typeysl === "project" ? "active" : ""}><a
onClick={(s, i) => this.getdata("project", 1)}>项目提醒</a></li>
<li className={typeysl&&typeysl==="apply"?"active":""}><a onClick={(s,i)=>this.getdata("apply",1)}>审核</a></li>
<li className={typeysl && typeysl === "project_package" ? "active" : ""}><a
onClick={(s, i) => this.getdata("project_package", 1)}>众包提醒</a></li>
<li className={typeysl&&typeysl==="notice"?"active":""}><a onClick={(s,i)=>this.getdata("notice",1)}>通知</a></li>
<li className={typeysl && typeysl === "interaction" ? "active" : ""}><a
onClick={(s, i) => this.getdata("interaction", 1)}>互动提醒</a></li>
<li className={typeysl && typeysl === "apply" ? "active" : ""}><a
onClick={(s, i) => this.getdata("apply", 1)}>审核</a></li>
<li className={typeysl && typeysl === "notice" ? "active" : ""}><a
onClick={(s, i) => this.getdata("notice", 1)}>通知</a></li>
</ul>
@ -517,25 +535,25 @@ class MessagSub extends Component{
<Spin size="large" className="myw100baifenbi mt10" spinning={isSpin}>
{
data===undefined?"":data.length===0?
data === undefined ? "" : data.length === 0 ?
<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 mb20">暂无数据哦~</p>
</div>
:data.map((item,key)=>{
: data.map((item, key) => {
// console.log(data)
// ridinglist-subs
var boolps=true;
if(item.container_type==="PraiseTread"||item.container_type==="Grade"||item.container_type==="ChallengeWorkScore"){
boolps=false;
var boolps = true;
if (item.container_type === "PraiseTread" || item.container_type === "Grade" || item.container_type === "ChallengeWorkScore") {
boolps = false;
}
if(item.container_type==="JournalsForMessage"){
if(item.parent_container_type==="Principal"){
boolps=false;
if (item.container_type === "JournalsForMessage") {
if (item.parent_container_type === "Principal") {
boolps = false;
}
if(item.parent_container_type==="HomeworkCommon"){
if(item.homework_type===null||item.homework_type===undefined){
boolps=false;
if (item.parent_container_type === "HomeworkCommon") {
if (item.homework_type === null || item.homework_type === undefined) {
boolps = false;
}
}
}
@ -544,36 +562,41 @@ class MessagSub extends Component{
// boolps=false;
// }
// }
if(item.container_type==="ProjectPackage"){
if(item.tiding_type==="Destroyed_end"){
boolps=false;
if (item.container_type === "ProjectPackage") {
if (item.tiding_type === "Destroyed_end") {
boolps = false;
}
if(item.tiding_type==="Destroyed"){
boolps=false;
if (item.tiding_type === "Destroyed") {
boolps = false;
}
}
if(item.container_type==="Course"){
if(item.tiding_type==="Delete"){
boolps=false;
if (item.container_type === "Course") {
if (item.tiding_type === "Delete") {
boolps = false;
}
}
return(
return (
<div className="pl25 ridinglist edu-back-white" key={key}>
<div className={boolps===true?"ridinglist-sub clearfix df tiding_item":"ridinglist-subs clearfix df tiding_item"} onClick={()=>this.gettourl(item)}>
<img onMouseDown={()=>this.myCome(item)} src={getImageUrl("images/"+item.trigger_user.image_url)} className="radius mr10 fl myimgw48 myimgh48"/>
<div
className={boolps === true ? "ridinglist-sub clearfix df tiding_item" : "ridinglist-subs clearfix df tiding_item"}
onClick={() => this.gettourl(item)}>
<img onMouseDown={() => this.myCome(item)}
src={getImageUrl("images/" + item.trigger_user.image_url)}
className="radius mr10 fl myimgw48 myimgh48"/>
<div className="fl flex1">
<p>
<a className="mr20 private_message_a" onMouseDown={()=>this.myCome(item)}>{item.trigger_user.name}</a>
<a className="mr20 private_message_a"
onMouseDown={() => this.myCome(item)}>{item.trigger_user.name}</a>
<span className="color-grey-c">{item.time}</span>
{item.tiding_type==="Apply"?(
item.status===0?
<span className="edu-filter-btn ml20 edu-filter-btn-red">待处理</span>:""
):""}
{item.tiding_type==="Apply"?(
item.status===1?
<span className="edu-filter-btn ml20 edu-filter-btn-green">已处理</span>:""
):""}
{item.tiding_type === "Apply" ? (
item.status === 0 ?
<span className="edu-filter-btn ml20 edu-filter-btn-red">待处理</span> : ""
) : ""}
{item.tiding_type === "Apply" ? (
item.status === 1 ?
<span className="edu-filter-btn ml20 edu-filter-btn-green">已处理</span> : ""
) : ""}
</p>
<style>
@ -584,10 +607,11 @@ class MessagSub extends Component{
`
}
</style>
<p className="color-grey-6 yslspansk markdown-body mt10" style={{wordBreak: "break-word"}} dangerouslySetInnerHTML={{__html: markdownToHTML(item.content).replace(/▁/g, "▁▁▁")}} ></p>
<p className="color-grey-6 yslspansk markdown-body mt10" style={{wordBreak: "break-word"}}
dangerouslySetInnerHTML={{__html: markdownToHTML(item.content).replace(/▁/g, "▁▁▁")}}></p>
</div>
<span className={item.new_tiding===true?"new-point fr mr40 mt22":""}></span>
<span className={item.new_tiding === true ? "new-point fr mr40 mt22" : ""}></span>
</div>
</div>
@ -596,16 +620,16 @@ class MessagSub extends Component{
</Spin>
{/*页数*/}
{ data===undefined?""
{data === undefined ? ""
:
(count>10?
(count > 10 ?
<div style={{textAlign: "center"}} className="new_expand mt10">
<div className="edu-txt-center mt30">
<Pagination showQuickJumper current={page}
onChange={this.paginationonChanges} pageSize={limit}
total={count}></Pagination>
</div>
</div>:""
</div> : ""
)
}
@ -616,4 +640,5 @@ class MessagSub extends Component{
)
}
}
export default MessagSub;

@ -145,10 +145,6 @@ class MainContent extends Component {
{
st === 0
?
readRepoTimeout === true ? <div className="readRepoFailed">
代码加载失败<a className="retry"
onClick={() => this.props.fetchRepositoryCode(this.props, null, null, true, true)}>重试</a>
</div> :
<React.Fragment>
<div style={{display: (codeLoading ? 'block' : 'none'), textAlign: 'center'}}>
<CircularProgress size={40} thickness={3}

@ -319,7 +319,8 @@ class MainContentContainer extends Component {
readingRepoTimes = readingRepoTimes + 1;
if(readingRepoTimes > 9) {
this.setState({
readRepoTimeout: true
readRepoTimeout: true,
codeLoading: false
})
readingRepoTimes = 0;
showSnackbar(`网络异常,请稍后重试。`);

@ -474,7 +474,9 @@ class CodeRepositoryView extends Component {
<span id="return_last_code">
</span>
{ challenge.pathIndex !== -1 && game.status === 2 && tabIndex === 0 && <a href="javascript:void(0);" className="iconButton" id="reset_success_game_code" onClick={showResetPassedCodeDialog}>
{ challenge.pathIndex !== -1 && game.status === 2 && tabIndex === 0 &&
this.props.readRepoTimeout !== true &&
<a href="javascript:void(0);" className="iconButton" id="reset_success_game_code" onClick={showResetPassedCodeDialog}>
<Tooltip title={ "加载上次通过的代码"} disableFocusListener={true}>
<i className="iconfont icon-fanhuishangcidaima font-20 "></i>
</Tooltip>
@ -482,7 +484,7 @@ class CodeRepositoryView extends Component {
}
{
challenge.pathIndex !== -1 && tabIndex === 0 &&
challenge.pathIndex !== -1 && tabIndex === 0 && this.props.readRepoTimeout !== true &&
<a href="javascript:void(0);" className="iconButton" id="reset_game_code" onClick={showResetCodeDialog}>
<Tooltip title={ "恢复初始代码"} disableFocusListener={true}>
<i className="iconfont icon-zhongzhi font-20 "></i>
@ -491,7 +493,7 @@ class CodeRepositoryView extends Component {
}
{
tabIndex === 0 &&
tabIndex === 0 && this.props.readRepoTimeout !== true &&
<a href="javascript:void(0);" className="iconButton" id="setting" onClick={() => showSettingDrawer(true)}>
<Tooltip title={ "设置"} disableFocusListener={true}>
<i className="iconfont icon-shezhi " style={{fontSize: '19px'}}></i>
@ -510,6 +512,7 @@ class CodeRepositoryView extends Component {
<div className="cl"></div>
</ul>
<div className="cl"></div>
<div id="codetab_con_1" style={{display: 'block', flex: 'auto'}} style={ tabIndex === 0 ? {display: 'block'} : {display: 'none'} }>
{/* 没必要显示这个,注释掉了 */}
{/* { !isEditablePath &&
@ -519,6 +522,11 @@ class CodeRepositoryView extends Component {
</div>
</Tooltip>
} */}
{this.props.readRepoTimeout === true ? <div className="readRepoFailed">
代码加载失败<a className="retry"
onClick={() => this.props.fetchRepositoryCode(this.props, null, null, true, true)}>重试</a>
</div> :
<React.Fragment>
<div className="codemirrorBackground"
style={{ backgroundImage: `url('${notEditablePathImg}')`
, display: (isEditablePath || this.props.shixun && this.props.shixun.code_edit_permission ? 'none' : 'block') }}></div>
@ -526,6 +534,8 @@ class CodeRepositoryView extends Component {
{/* cm monaco 切换 */}
{/* <TPICodeMirror {...this.props} ></TPICodeMirror> */}
<TPIMonaco {...this.props}></TPIMonaco>
</React.Fragment>
}
</div>
<div id="codetab_con_81" className="undis -relative"
style={ { color: '#fff', display: tabIndex === STABLE_SSH_TAB_ID ? 'block' : 'none', 'marginLeft': '2px'} }>

@ -336,7 +336,7 @@ class DetailCards extends Component{
showparagraphindex
}=this.state;
const antIcon = <Icon type="loading" style={{ fontSize: 24 }} spin />;
// console.log("zzz"+this.props.MenuItemsindextype)
return(
<div>
{AccountProfiletype===true?<AccountProfile

@ -17,7 +17,7 @@
box-sizing: border-box;
}
.userNavs{
line-height: 96px;
line-height: 75px;
background: #fff;
height:96px;
background:rgba(255,255,255,1);
@ -67,3 +67,22 @@
white-space: nowrap;
height: 40px;
}
.mb100{
margin-bottom: 100px !important;
}
.task-btn-28BE6C{
background: #28BE6C !important;
color: #fff!important;
}
.mt43{
margin-top: 43px;
}
.mb120{
margin-bottom: 120px !important;
}
.mb80{
margin-bottom: 80px !important;
}

@ -5,10 +5,12 @@ import SendPanel from "./sendPanel.js";
import { getImageUrl } from 'educoder';
import axios from 'axios';
import Modals from '../../modals/Modals';
import AccountProfile from"../../user/AccountProfile";
import OpenCourse from './OpenCourse';
import Jointheclass from '../../modals/Jointheclass'
import Jointheclass from '../../modals/Jointheclass';
import './DetailTop.css';
const Search = Input.Search;
const RadioGroup = Radio.Group;
class DetailTop extends Component{
@ -50,35 +52,43 @@ class DetailTop extends Component{
})
}else{
let type=undefined;
this.props.courses.map((item,key)=>{
if(listtype===false){
let arr=[]
keys=key+1
if(item.course_status.status===0) {
listtype=true
return (
courseslist.push(item)
)
}
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===2) {
if(item.course_status.status===0) {
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({
courseslist:courseslist,
MenuItemskey:keys,
@ -254,6 +264,18 @@ class DetailTop extends Component{
}
putappointment=()=>{
if(this.props.checkIfLogin()===false){
this.props.showLoginDialog()
return
}
if(this.props.current_user&&this.props.current_user.profile_completed===false){
this.setState({
AccountProfiletype:true
})
return
}
this.setState({
Modalstype:true,
Modalstopval:"是否确认立即预约?",
@ -313,9 +335,15 @@ class DetailTop extends Component{
this.cardsModalcancel()
})
}
hideAccountProfile=()=>{
this.setState({
AccountProfiletype:false
})
}
render(){
let{detailInfoList}=this.props;
let{Modalstype,Modalstopval,cardsModalcancel,putappointmenttype,Modalsbottomval,cardsModalsavetype,loadtype,getappointmenttype}=this.state;
let{Modalstype,Modalstopval,cardsModalcancel,putappointmenttype,Modalsbottomval,cardsModalsavetype,loadtype,getappointmenttype,AccountProfiletype}=this.state;
const radioStyle = {
display: 'block',
height: '30px',
@ -339,11 +367,18 @@ 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;
// console.log(this.props.courses)
return(
<div className={this.props.courses===undefined||this.props.courses.length===0?"subhead":"subhead mb70"}>
<div className={this.props.courses===undefined?"subhead":this.props.courses.length===0?applypath===true?"subhead mb100":"subhead":applypath===false?detailInfoList.name.length>40?"subhead mb100":"subhead mb70":this.state.MenuItemskey===this.props.courses.length?"subhead mb120":detailInfoList.name.length>40?"subhead mb100":"subhead mb80"}>
{AccountProfiletype===true?<AccountProfile
hideAccountProfile={()=>this.hideAccountProfile()}
{...this.props}
{...this.state}
/>:""}
<Modals
modalsType={Modalstype}
modalsTopval={Modalstopval}
@ -355,10 +390,24 @@ class DetailTop extends Component{
</Modals>
{this.state.yslJointhe===true?<Jointheclass {...this.props} {...this.state} ysljoinmodalCancel={()=>this.ysljoinmodalCancel()} ysljoinmodalCanceltwo={()=>this.ysljoinmodalCanceltwo(this.state.MenuItemskey)}></Jointheclass>:""}
{this.state.OpenCourseTypes===true?<OpenCourse {...this.props} {...this.state} OpenCourseCancel={()=>this.OpenCourseCancel()}/>:""}
<style>
{
`
.subhead_content{
position: relative;
}
.userNavs{
position: absolute;
width: 1200px;
}
`
}
</style>
{
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 "}>
<div className="font-28 color-white clearfix">
{/*<Tooltip placement="bottom" title={detailInfoList.name.length>27?detailInfoList.name:""}>*/}
@ -477,9 +526,7 @@ class DetailTop extends Component{
</div>
{this.props.courses===undefined||this.props.courses.length===0?"":<div className="userNavs mt20" style={applypath===false?{}:this.state.MenuItemskey===this.props.courses.length?{height:'158px'}:{}}>
<li className={"fl pd4020"}>
{this.props.courses===undefined||isadminallow_statistics===true?"":<div className="userNavs mt20" style={applypath===false?{}:this.state.MenuItemskey===this.props.courses.length?{height:'135px'}:{}}>
<style>
{
`
@ -502,9 +549,9 @@ class DetailTop extends Component{
`
}
</style>
{this.props.courses===undefined||this.props.courses.length===0?"":<li className={"fl pd4020 mt10"}>
{this.props.courses===undefined?"":this.state.courseslist.map((item,key)=>{
{this.state.courseslist.map((item,key)=>{
if(item.course_identity<4){
return(
<Tooltip placement="bottom" title={"编辑课堂"} key={key}>
@ -524,7 +571,7 @@ class DetailTop extends Component{
<span className={"color-orange"}> {this.state.MenuItemskey} </span>次开课 <Icon className="aIcons" type={!this.state.onVisibleChangestype?"down":"up"} />
</a>
</Dropdown>
</li>
</li>}
<style>
{
`
@ -545,7 +592,7 @@ class DetailTop extends Component{
`
}
</style>
<li className={"ml20"}>
{this.props.courses===undefined||this.props.courses.length===0?"":<li className={"ml20"}>
{this.state.courseslist.map((item,key)=>{
return(
<div className={"ant-breadcrumb pdt28"} key={key}>
@ -588,9 +635,7 @@ class DetailTop extends Component{
})
}
</li>
<li className={"fr mr25"}>
</li>}
<style>
{
`
@ -615,35 +660,46 @@ class DetailTop extends Component{
color:#fff !important;
}
.pathbtensbox{
width: 188px !important;
width: 215px !important;
height: 46px !important;
background: rgba(76,172,255,1);
border-radius: 4px;
line-height: 46px !important;
}
.lineHeight0{
line-height: 0px;
.lineHeight1{
line-height: 1px;
}
.font153{
font-size: 14px;
font-weight: 400;
color: rgba(153,153,153,1);
line-height: 14px;
margin-left: 30px;
}
.absolutewidth{
position: absolute;
top: -21px;
top: 19px;
right: 71px;
}
.relativewidth{
position: relative;
width: 100%;
}
.padding040{
padding: 0 43px;
}
.mt26{
margin-top:26px;
}
.mt10block{
margin-top: 10px;
display: inline-block;
}
`
}
</style>
{this.props.courses===undefined||this.props.courses.length===0?"":<li className={"fr padding040"}>
{/*
height: 158px;
@ -652,42 +708,60 @@ class DetailTop extends Component{
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>:""}
{applypath===false?"":this.state.MenuItemskey===this.props.courses.length||coursestypes===true?
this.props.detailInfoList&&this.props.detailInfoList.has_participate===false?
getappointmenttype===true?<span className={coursestypes===true?"fr user_default_btn background191 font-18 pathbtensbox mt5":"fr user_default_btn background191 font-18 pathbtensbox mt26"}>预约报名成功</span>:<a className={coursestypes===true?"fr user_default_btn task-btn-28BE6C font-18 pathbtensbox mt5":"fr user_default_btn task-btn-28BE6C font-18 pathbtensbox mt26"} onClick={()=>this.putappointment()}></a>:
<span className={coursestypes===true?"fr user_default_btn background191 font-18 pathbtensbox mt5":"fr user_default_btn background191 font-18 pathbtensbox mt26"}>预约报名成功</span>:""}
{/*{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 mt10">{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 mt10">已结束</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">
item.course_identity<5?<a className="fr user_default_btn task-btn-orange font-18 mt28 pathbtens courseslistsa mr20" 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>:""}
</a>:item.course_identity<6?<div className="fr user_default_btn background191 font-18 mt28 pathbtens pathdefault mr20"></div>
:<a className="fr user_default_btn task-btn-orange font-18 mt28 pathbtens mr20" 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">
item.course_identity<5?<a className="courseslistsa fr user_default_btn task-btn-orange font-18 mt28 pathbtens mr20" 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>:item.course_identity<6?<a className="courseslistsa fr user_default_btn task-btn-orange font-18 mt28 pathbtens mr20" 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>:""}
</a>:<a className="fr user_default_btn task-btn-orange font-18 mt28 pathbtens mr20" 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">
item.course_identity<6?<a className="fr user_default_btn task-btn-orange font-18 mt28 pathbtens courseslistsa mr20" href={item.first_category_url} target="_blank">
进入课堂
</a>:<div className="fr user_default_btn background191 font-18 mt28 pathbtens pathdefault"></div>:""}
</a>:<div className="mr20 shixun_detail pointer fl user-colorgrey-9b pathdefault mt10"></div>:""}
</div>
)})}
</li>
</li>}
{applypath===false?"":this.state.MenuItemskey===this.props.courses.length?<div className={"clear"}></div>:""}
{applypath===false?"":this.state.MenuItemskey===this.props.courses.length?<span className={"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>
{applypath===false?"":this.props.courses.length===0?"":this.state.MenuItemskey===this.props.courses.length||coursestypes===true?<span className={coursestypes===true?"fr lineHeight1 relativewidth mt43":"fl lineHeight1 relativewidth"}>
<span className={"fr mr30"}>当前预约报名人数<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 fr mr12"}>当预约报名人数达到 {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>
:""}
{applypath===true&&this.props.courses.length===0?this.state.MenuItemskey===this.props.courses.length||coursestypes===true?<span className={coursestypes===true?"fl ml20 lineHeight0 relativewidth":"fl ml20 lineHeight0 relativewidth"}>
<span className={"mt10block"}>当前预约报名人数<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 mt10block"}>当预约报名人数达到 {this.props.detailInfoList&&this.props.detailInfoList.student_count} 人时即将开课</span>
{this.props.detailInfoList&&this.props.detailInfoList.has_participate===false?
getappointmenttype===true?<a className="fr user_default_btn background191 font-18 pathbtensbox absolutewidth">预约报名成功</a>:<a className="fr user_default_btn task-btn-orange font-18 pathbtensbox absolutewidth" onClick={()=>this.putappointment()}></a>:
<a className="fr user_default_btn background191 font-18 pathbtensbox absolutewidth">预约报名成功</a>}
</span>:""}
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>:"":""}
</div>}

@ -86,7 +86,7 @@ class PathDetailIndex extends Component{
pathtopskey:1,
dataquerys:{},
MenuItemsindex:1,
MenuItemsindextype:2
MenuItemsindextype:0
}
this.onDragEnd = this.onDragEnd.bind(this);
@ -621,7 +621,10 @@ class PathDetailIndex extends Component{
{/*}*/}
</p>
<div className="clearfix">
<p className="color-grey-9 font-12 fl"><span className="mr10">{item.school}</span><span>{item.identity}</span></p>
<p className="color-grey-9 font-12 fl">
<span className="mr10">{item.school}</span>
{/*<span>{item.identity}</span>*/}
</p>
</div>
</div>
</div>
@ -645,7 +648,9 @@ class PathDetailIndex extends Component{
}
</p>
<div className="clearfix">
<p className="color-grey-9 font-12 fl"><span className="mr10">{item.school}</span><span>{item.identity}</span></p>
<p className="color-grey-9 font-12 fl"><span className="mr10">{item.school}</span>
{/*<span>{item.identity}</span>*/}
</p>
</div>
{
detailInfoList===undefined?"":detailInfoList.allow_add_member===true? <div>
@ -674,7 +679,9 @@ class PathDetailIndex extends Component{
{/*}*/}
</p>
<div className="clearfix">
<p className="color-grey-9 font-12 fl"><span className="mr10">{item.school}</span><span>{item.identity}</span></p>
<p className="color-grey-9 font-12 fl"><span className="mr10">{item.school}</span>
{/*<span>{item.identity}</span>*/}
</p>
</div>
</div>
</div>

@ -865,7 +865,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}/package`}>我的众包</Link></li>
{/*<li><Link to={`/users/${this.props.current_user===undefined?"":this.props.current_user.login}/package`}>我的众包</Link></li>*/}
<li style={{display: this.props.Headertop === undefined ? 'none' : this.props.Headertop.customer_management_url===null || this.props.Headertop.customer_management_url===""? 'none' : 'block'}}>
<a href={this.props.Headertop === undefined ? '' : this.props.Headertop.customer_management_url}>客户管理</a>
</li>

@ -236,19 +236,24 @@ export default class TPMMDEditor extends Component {
setTimeout(() => {
if (that.props.needRecreate == true) {
__editorName.recreate()
__editorName.recreate() // 注意 必须在setValue之前触发不然会清空
} else {
__editorName.resize()
}
console.log('timeout', __editorName.id)
__editorName.cm && __editorName.cm.refresh()
}, that.props.refreshTimeout || 500)
if (this.props.noSetValue) {
} else {
if (that.props.initValue != undefined && that.props.initValue != '') {
__editorName.setValue(that.props.initValue)
}
if (that.state.initValue) {
__editorName.setValue(that.state.initValue)
}
}
__editorName.cm.on("change", (_cm, changeObj) => {
that.contentChanged = true;
if (that.state.showError) {

@ -39,21 +39,21 @@ class InfosBanner extends Component{
<div className="bannerPanel mb60">
<div className="educontent">
<div className="clearfix color-white mb25">
<p className="myPhoto mr20 fl"><img alt="头像" src={data && `${getImageUrl('images/'+data.avatar_url)}`}/></p>
<p className="myPhoto mr20 fl"><img alt="头像" src={data && `${getImageUrl('images/'+data.avatar_url)}?t=${new Date().getTime()}`}/></p>
<div className="fl">
<p className="clearfix mt20">
<span className="username task-hide" style={{"maxWidth":'370px'}}>{data && data.name}</span>
{
data && is_current == false && data.identity =="学生" ? "" :
<span className="userpost"><label>{data && data.identity}</label></span>
}
{/*{*/}
{/*data && is_current == false && data.identity =="学生" ? "" : */}
{/*<span className="userpost"><label>{data && data.identity}</label></span>*/}
{/*}*/}
</p>
<p className="mt15">
<Tooltip placement='bottom' title={ data && data.professional_certification ?"已职业认证":"未职业认证"}>
<i className={ data && data.professional_certification ? "iconfont icon-shenfenzhenghaomaguizheng font-18 user-colorgrey-green mr20 ml2":"iconfont icon-shenfenzhenghaomaguizheng font-18 user-colorgrey-B8 mr20 ml2"}></i>
<i className={ data && data.professional_certification ? "iconfont icon-shenfenzhenghaomaguizheng font-18 user-colorgrey-blue mr20 ml2":"iconfont icon-shenfenzhenghaomaguizheng font-18 user-colorgrey-B8 mr20 ml2"}></i>
</Tooltip>
<Tooltip placement='bottom' title={ data && data.authentication ?"已实名认证":"未实名认证"}>
<i className={ data && data.authentication ? "iconfont icon-renzhengshangjia font-18 user-colorgrey-green":"iconfont icon-renzhengshangjia font-18 user-colorgrey-B8"}></i>
<i className={ data && data.authentication ? "iconfont icon-renzhengshangjia font-18 user-colorgrey-blue":"iconfont icon-renzhengshangjia font-18 user-colorgrey-B8"}></i>
</Tooltip>
</p>
</div>
@ -111,11 +111,11 @@ class InfosBanner extends Component{
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>
{/*<li className={`${moduleName == 'package' ? 'active' : '' }`}>*/}
{/* <Link*/}
{/* onClick={() => this.setState({moduleName: 'package'})}*/}
{/* to={`/users/${username}/package`}>众包</Link>*/}
{/*</li>*/}
{((is_current && current_user && current_user.is_teacher ) || current_user && current_user.admin)
&& <li className={`${moduleName == 'videos' ? 'active' : '' }`}>
<Link

@ -168,6 +168,7 @@
}
.user-colorgrey-B8{color:#B8B8B8}
.user-colorgrey-green{color:#7ED321}
.user-colorgrey-blue{color:#98EBFF}
.user_yellow_btn {
color: #fff!important;
background-color: #FF8E02;

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