chromesetting
jingquan huang 5 years ago
commit 2f52167335

@ -160,5 +160,16 @@ $(document).on('turbolinks:load', function() {
$addMemberModal.modal('hide');
}
});
$(".laboratory-list-container").on("change", '.laboratory-sync-course', function () {
var s_id = $(this).attr("data-id");
var json = {};
$.ajax({
url: "/admins/laboratories/" + s_id + "/update_sync_course",
type: "POST",
dataType:'script',
data: json
})
});
}
});

@ -56,6 +56,10 @@ class Admins::LaboratoriesController < Admins::BaseController
users.update_all(laboratory_id: current_laboratory.id)
end
def update_sync_course
current_laboratory.update!(sync_course: !current_laboratory.sync_course)
@laboratory = current_laboratory
end
private

@ -61,7 +61,7 @@ class CoursesController < ApplicationController
@user = current_user
# 根据分类查询课堂(全部,我的,最新,最热)
@order = params[:order].present? ? params[:order] : "all"
@courses = current_laboratory.courses.not_deleted
@courses = current_laboratory.all_courses.not_deleted
if @order == "visits"
order_str = "courses.id = 1309 DESC, courses.visits DESC"
@courses = @courses.where(is_hidden: 0)

@ -768,8 +768,8 @@ class GamesController < ApplicationController
# REDO:需要添加详细的说明
def cost_time
#return if @game.status >= 2
cost_time = (Time.now.to_i - @game.play_time.to_i) + @game.cost_time.to_i
@game.update_attributes(cost_time: cost_time, play_sign: 0)
cost_time = params[:time].to_i < @game.cost_time.to_i ? (@game.cost_time.to_i + params[:time].to_i) : params[:time].to_i
@game.update_attribute(:cost_time, cost_time)
end
# 同步challenge的更新时间
@ -939,13 +939,6 @@ class GamesController < ApplicationController
game.update_attributes(status: 0, open_time: Time.now) if game.open_time.blank? || game.status == 3
# 开启实训更新myshixuns的时间方便跟踪用于的学习进度。
game.myshixun.update_column(:updated_at, Time.now)
# 如果异常关闭的话 更新完关卡的时间
if game.status < 2 && @game.play_sign == 0
@game.update_attributes(play_time: Time.now, play_sign: 1)
elsif game.status < 2 && @game.play_sign == 1
cost_time = Time.now.to_i - (@game.play_time.presence || Time.now).to_i + cost_time.to_i
@game.update_attributes(play_time: Time.now, cost_time: cost_time, play_sign: 1)
end
end
# vnc连接

@ -38,7 +38,6 @@ class GitsController < ApplicationController
else
# 用户是否对对象拥有权限
system_user = User.find_by_login(input_username) || User.find_by_mail(input_username) || User.find_by_phone(input_username)
# 如果用户名密码错误
if system_user && !system_user.check_password?(input_password)
uid_logger_error("git start: password is wrong")
@ -49,7 +48,7 @@ class GitsController < ApplicationController
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, laboratory_id: nil).first
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)}")
@ -64,7 +63,7 @@ class GitsController < ApplicationController
else
uid_logger_error("shixun is not exist")
# result = false
result = true # 为了测试跳出
result = false # 为了测试跳出
end
end
end

@ -625,14 +625,12 @@ class HomeworkCommonsController < ApplicationController
@homework.score_open = params[:score_open]
@homework.save!
# if score_change
# @homework.student_works.has_committed.each do |student_work|
# HomeworksService.new.set_shixun_final_score student_work
# end
# end
if score_change && @homework.end_or_late_none_group
UpdateShixunWorkScoreJob.perform_now(@homework.id)
end
# 更新所有学生的效率分(作业允许补交且补交已截止 或者 作业不允许补交且提交已截止)
if update_eff_score && @homework.end_or_late_none_group
if !score_change && update_eff_score && @homework.end_or_late_none_group
HomeworksService.new.update_student_eff_score HomeworkCommon.find_by(id: @homework.id)
end

@ -977,9 +977,7 @@ class ShixunsController < ApplicationController
@courses = Course.where(:id => course_ids)
## 云上实验室过滤
unless current_laboratory.main_site?
@courses = @courses.where(laboratory_id: current_laboratory.id )
end
@courses = @courses.where(id: current_laboratory.all_courses)
@course_count = @courses.count
@courses = @courses.page(page).per(limit)

@ -218,9 +218,8 @@ class SubjectsController < ApplicationController
AND m.user_id=#{current_user.id} AND c.is_delete = 0 AND c.is_end = 0").map(&:id)
@courses = Course.where(id: course_ids)
## 云上实验室过滤
unless current_laboratory.main_site?
@courses = @courses.where(laboratory_id: current_laboratory.id )
end
@courses = @courses.where(id: current_laboratory.all_courses)
@none_shixun_ids = ShixunSchool.where("school_id != #{current_user.user_extension.try(:school_id).to_i}").pluck(:shixun_id)
end

@ -2,7 +2,7 @@ class Users::CoursesController < Users::BaseController
def index
courses = Users::CourseService.new(observed_user, query_params).call
courses = courses.where(laboratory_id: current_laboratory.id)
courses = courses.where(id: current_laboratory.all_courses)
@count = courses.count
@courses = paginate(courses.includes(teacher: { user_extension: :school }), special: observed_user.is_teacher?)

@ -66,7 +66,18 @@ class Weapps::CoursesController < Weapps::BaseController
end
def students
@course = current_course
course_group_id = params[:course_group_id].present? ? params[:course_group_id].to_i : nil
@students = CourseMember.students(@course)
if course_group_id.present?
course_group = CourseGroup.find(course_group_id) if course_group_id != 0
@students = @students.where(course_group_id: course_group&.id.to_i)
end
@students_count = @students.size
@students = @students.includes(user: :user_extension)
end
# 批量修改角色

@ -0,0 +1,10 @@
class UpdateShixunWorkScoreJob < ApplicationJob
queue_as :default
def perform(homework_id)
homework = HomeworkCommon.find_by(id: homework_id)
return if homework.blank?
homework.update_homework_work_score
end
end

@ -54,6 +54,10 @@ class Laboratory < ApplicationRecord
main_site? ? Subject.all : Subject.joins(:laboratory_subjects).where(laboratory_subjects: { laboratory_id: id })
end
def all_courses
main_site? || !sync_course ? courses : courses.or(Course.where(school_id: school_id))
end
def shixun_repertoires
where_sql = ShixunTagRepertoire.where("shixun_tag_repertoires.tag_repertoire_id = tag_repertoires.id")

@ -39,7 +39,7 @@ module Searchable::Shixun
end
def should_index?
[0, 1, 2].include?(status) # published
!hidden? && [0, 1, 2].include?(status) # published
end
def to_searchable_json

@ -111,14 +111,14 @@ class StudentWork < ApplicationRecord
# 作品总体评价
def overall_appraisal
case self.work_score.to_i
when (90..100)
case (self.work_score.to_f / homework_common.total_score).round(2)
when (0.90..1.00)
'优秀'
when (70...90)
when (0.70...0.90)
'良好'
when (60...70)
when (0.60...0.70)
'及格'
when (0...60)
when (0.00...0.60)
'不及格'
end
end

@ -699,6 +699,10 @@ class User < ApplicationRecord
LimitForbidControl::UserLogin.new(self).clear
end
def from_sub_site?
laboratory_id.present? && laboratory_id != 1
end
protected
def validate_password_length
# 管理员的初始密码是5位

@ -5,7 +5,8 @@ class Subjects::CopySubjectService < ApplicationService
@subject = subject
@user = user
@laboratory = laboratory
subject_params = subject.attributes.dup.except('id', 'copy_subject_id', 'user_id', 'homepage_show')
subject_params = subject.attributes.dup.except('id', 'copy_subject_id', 'user_id', 'homepage_show',
'stages_count', 'shixuns_count', 'stage_shixuns_count')
@to_subject = Subject.new(subject_params)
end
@ -59,7 +60,7 @@ class Subjects::CopySubjectService < ApplicationService
shixun = stage_shixun.shixun
to_shixun = Shixun.new
to_shixun.attributes = shixun.attributes.dup.except('id', 'user_id', 'identifier', 'homepage_show',
'use_scope', 'averge_star', 'myshixuns_count')
'use_scope', 'averge_star', 'myshixuns_count', 'challenges_count')
to_shixun.identifier = Util::UUID.generate_identifier(Shixun, 8)
to_shixun.user_id = user.id
if laboratory

@ -29,6 +29,11 @@
</div>
</td>
<td><%= laboratory.created_at.strftime('%Y-%m-%d %H:%M') %></td>
<td>
<% if school.present? && laboratory.id != 1 %>
<%= check_box_tag :sync_course,!laboratory.sync_course,laboratory.sync_course,remote:true,data:{id:laboratory.id},class:"laboratory-sync-course" %>
<% end %>
</td>
<td class="action-container">
<%= link_to '定制', admins_laboratory_laboratory_setting_path(laboratory), class: 'action' %>

@ -1,11 +1,12 @@
<table class="table table-hover text-center laboratory-list-table">
<thead class="thead-light">
<tr>
<th width="20%" class="text-left">单位名称</th>
<th width="14%" class="text-left">单位名称</th>
<th width="16%" class="text-left">域名</th>
<th width="10%">统计链接</th>
<th width="22%">管理员</th>
<th width="14%"><%= sort_tag('创建时间', name: 'id', path: admins_laboratories_path) %></th>
<th width="6%" title="同步显示显示主站下该单位的课堂">同步课堂</th>
<th width="20%">操作</th>
</tr>
</thead>

@ -0,0 +1 @@
$("#laboratory-item-<%= @laboratory.id %>").html("<%= j render partial: 'admins/laboratories/shared/laboratory_item', locals: {laboratory: @laboratory} %>")

@ -0,0 +1 @@
json.identifier @game.identifier

@ -11,13 +11,13 @@ if @shixun
json.myself_experience @work.myshixun.try(:total_score).to_i
json.total_experience @shixun.all_score
json.work_score number_with_precision @work.work_score.to_f.round(2), precision: 1
json.all_work_score number_with_precision 100, precision: 1
json.all_work_score number_with_precision @homework.total_score, precision: 1
json.time_consuming @work.myshixun_consume
json.evaluate_count @user_evaluate_count.to_i
if @homework.work_efficiency
json.eff_score_full number_with_precision @homework.eff_score, precision: 1
json.eff_score number_with_precision @work.eff_score.to_f.round(2), precision: 1
json.challenge_score_full number_with_precision (100 - @homework.eff_score), precision: 1
json.challenge_score_full number_with_precision (@homework.total_score - @homework.eff_score), precision: 1
json.challenge_score number_with_precision @work.final_score.to_f.round(2), precision: 1
end

@ -1,4 +1,4 @@
json.qrcode_img Util::FileManage.exists?(@subject, '_qrcode') ? Util::FileManage.source_disk_file_url(@subject, '_qrcode') : nil
json.qrcode_img nil
json.members @members do |member|
json.partial! 'subject_member', locals: { user: member.user }

@ -1,4 +1,4 @@
json.(@course, :id, :name, :course_members_count, :credit)
json.(@course, :id, :name, :course_members_count, :credit, :invite_code_halt)
json.teachers_count @course.teachers.count
json.students_count @course.students.count
json.course_identity @current_user.course_identity(@course)

@ -0,0 +1,12 @@
json.students do
json.array! @students do |student|
json.user_id student.user_id
json.login student.user.try(:login)
json.name student.user.try(:real_name)
json.student_id student.user.try(:student_id)
json.course_member_id student.id
json.user_phone @course.excellent ? "" : student.user.hidden_phone
json.image_url url_to_avatar(student.user)
end
end
json.students_count @students_count

@ -908,6 +908,8 @@ Rails.application.routes.draw do
get :teachers
delete :delete_course_teachers
post :change_member_roles
get :students
delete :delete_course_students
end
end
end
@ -1075,6 +1077,7 @@ Rails.application.routes.draw do
get :shixuns_for_select
get :subjects_for_select
get :synchronize_user
post :update_sync_course
end
resource :laboratory_setting, only: [:show, :update]

@ -1,7 +0,0 @@
class AddCloseBrowserTimeForGames < ActiveRecord::Migration[5.2]
def change
remove_column :games,:close_browse_time
add_column :games, :play_time, :timestamp
add_column :games, :play_sign, :integer, :default => 0
end
end

@ -0,0 +1,5 @@
class AddSyncCourseToLaboratorySettings < ActiveRecord::Migration[5.2]
def change
add_column :laboratories, :sync_course, :boolean, default: 0
end
end

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -509,7 +509,7 @@ li.li-width7{width: 7%;text-align: left}
background-position: center;
background-repeat: no-repeat;
}
.invite-tip{position: absolute;top: -5px;right: 140px;color: #fff; box-sizing: border-box;width: 170px;text-align: center;border-radius: 2px;background-color: rgba(5,16,26,0.6)}
.invite-tip{position: absolute;top: -5px;right: 140px;color: #fff; box-sizing: border-box;width: 170px;text-align: center;border-radius: 2px;background-color: rgba(5,16,26,0.6);z-index: 5000;}
.inviteTipbtn a{font-size:14px;width: 100%;height: 30px;line-height: 30px;display: block;color: #747A7F;background-color: rgba(5,16,26,0.4)}
.inviteTipbtn a:hover{color: #4cacff!important;}
.top-black-trangle{display: block;border-width: 8px;position: absolute;top: -16px;right: 4px;border-style: dashed solid dashed dashed;border-color: transparent transparent rgba(5,16,26,0.6) transparent;font-size: 0;line-height: 0;}

@ -129,7 +129,7 @@ class TPIContextProvider extends Component {
tpm_cases_modified,
tpm_modified,
tpm_script_modified,
showUpdateDialog: false
showUpdateDialog: false,
})
}
@ -145,7 +145,6 @@ class TPIContextProvider extends Component {
window.__fetchAllFlag = false;
this.fetchAll(stageId);
this.costTimeInterval = window.setInterval(()=> {
const { game } = this.state;
if (!game || game.status === 2) { // 已完成的任务不需要计时
@ -183,7 +182,7 @@ class TPIContextProvider extends Component {
url: url,
async: async, //IMPORTANT, the call will be synchronous
data: {
time: game.cost_time
time: game.cost_time
}
}).done((data) => {
console.log('complete');
@ -406,7 +405,6 @@ pop_box_new(htmlvalue, 480, 182);
}
resData.game = game;
const { tpm_cases_modified, tpm_modified, tpm_script_modified, myshixun } = resData;
if (myshixun.system_tip) {
// system_tip为true的时候 不弹框提示用户更新
@ -440,7 +438,6 @@ pop_box_new(htmlvalue, 480, 182);
this.setState({
...resData,
currentGamePassed: false,
loading: false,
testSetsExpandedArray: testSetsExpandedArrayInitVal.slice(0),
@ -519,7 +516,6 @@ pop_box_new(htmlvalue, 480, 182);
// var url = `/api/v1/games/${stageId}`
var url = `/tasks/${stageId}.json`
// {"status":1,"message":"undefined method `authenticate!' for #<Grape::Endpoint:0xc8c91c0>"}
window.__fetchAllFlag = true;

@ -38,8 +38,8 @@ class CompetitionMaxImg extends React.Component {
<div className="registrationback"
style={{"background": `url(${getImageUrl(`images/educoder/competitions/tipregistit.jpg`)})`}}
>
<p className="registrationbackp1">Educoder竞赛平台</p>
<p className="registrationbackp2">Educoder是一个面向计算机类的互联网IT教育和实战平台</p>
<p className="registrationbackp1">在线竞赛平台</p>
<p className="registrationbackp2">在线竞赛平台是一个面向计算机类的互联网IT教育和实战平台</p>
<p className="registrationbackp3">提供企业级工程实训以实现工程化专业教学的自动化和智能化</p>
<div className="registrationbackp2button">
<div className="registbut1">
@ -57,8 +57,8 @@ class CompetitionMaxImg extends React.Component {
<div className="registrationback"
style={{"background": `url(${getImageUrl(`images/educoder/competitions/tipregistit.jpg`)})`}}
>
<p className="registrationbackp1">Educoder竞赛平台</p>
<p className="registrationbackp2">Educoder是一个面向计算机类的互联网IT教育和实战平台</p>
<p className="registrationbackp1">在线竞赛平台</p>
<p className="registrationbackp2">在线竞赛平台是一个面向计算机类的互联网IT教育和实战平台</p>
<p className="registrationbackp3">提供企业级工程实训以实现工程化专业教学的自动化和智能化</p>
<div className="registrationbackp2button">
<div className="registbut1">
@ -76,8 +76,8 @@ class CompetitionMaxImg extends React.Component {
<div className="registrationback"
style={{"background": `url(${getImageUrl(`images/educoder/competitions/tipregistit.jpg`)})`}}
>
<p className="registrationbackp1">Educoder竞赛平台</p>
<p className="registrationbackp2">Educoder是一个面向计算机类的互联网IT教育和实战平台</p>
<p className="registrationbackp1">在线竞赛平台</p>
<p className="registrationbackp2">在线竞赛平台是一个面向计算机类的互联网IT教育和实战平台</p>
<p className="registrationbackp3">提供企业级工程实训以实现工程化专业教学的自动化和智能化</p>
<div className="registrationbackp2button">
<div className="registbut1">
@ -92,8 +92,8 @@ class CompetitionMaxImg extends React.Component {
: type === 6 ?
<div className="registrationback"
style={{"background": `url(${getImageUrl(`images/educoder/competitions/tipregistit.jpg`)})`}}>
<p className="registrationbackp1">Educoder竞赛平台</p>
<p className="registrationbackp2">Educoder是一个面向计算机类的互联网IT教育和实战平台</p>
<p className="registrationbackp1">在线竞赛平台</p>
<p className="registrationbackp2">在线竞赛平台是一个面向计算机类的互联网IT教育和实战平台</p>
<p className="registrationbackp3">提供企业级工程实训以实现工程化专业教学的自动化和智能化</p>
<div className="registrationbackp2button">
{
@ -160,4 +160,4 @@ export default CompetitionMaxImg;
// // </div>
// //
// // </div>
// // </div>
// // </div>

@ -122,11 +122,11 @@ class MessagSub extends Component {
if (item.tiding_type === "Apply") {
if (item.auth_type === 1) {
//系统管理页面
return window.open("/managements/identity_authentication");
return window.open("/admins/identity_authentications");
}
if (item.auth_type === 2) {
//系统管理页面
return window.open("/managements/professional_authentication")
return window.open("/admins/professional_authentications")
}
}
if (item.tiding_type === "System") {
@ -143,7 +143,7 @@ class MessagSub extends Component {
case "ApplyAddDepartment" :
if (item.tiding_type === "Apply") {
//部门审批
return window.open("/managements/depart")
return window.open("/admins/department_applies")
}
if (item.tiding_type === "System") {
// 账号管理页/account/profile
@ -153,7 +153,7 @@ class MessagSub extends Component {
case "ApplyAddSchools" :
if (item.tiding_type === "Apply") {
// 单位审批
return window.open(" /managements/unit")
return window.open("/admins/unit_applies")
}
if (item.tiding_type === "System") {
// 账号管理页
@ -164,7 +164,7 @@ class MessagSub extends Component {
switch (item.parent_container_type) {
case "ApplyShixun" :
if (item.tiding_type === "Apply") {
return window.open("/managements/shixun_authorization")
return window.open("/admins/shixun_authorizations")
}
if (item.tiding_type === "System") {
// 实训详情页 :identifier = identifier
@ -173,10 +173,10 @@ class MessagSub extends Component {
case "ApplySubject" :
if (item.tiding_type === "Apply") {
// 实训课程发布
return window.open("/managements/subject_authorization")
return window.open("/admins/subject_authorizations")
}
if (item.tiding_type === "System") {
// 实践课程详情页 :parent_container_id = parent_container_id
// 课程汇总详情页 :parent_container_id = parent_container_id
return window.open(`/paths/${item.parent_container_id}`)
}
@ -222,7 +222,7 @@ class MessagSub extends Component {
case "Shixun" :
return window.open(`/shixuns/${item.identifier}/challenges`)
case "Subject" :
// 实践课程详情页 :id = container_id
// 课程汇总详情页 :id = container_id
return window.open(`/paths/${item.container_id}`)
case "JournalsForMessage" :
switch (item.parent_container_type) {
@ -452,7 +452,7 @@ class MessagSub extends Component {
case "Library" :
if (item.tiding_type === 'Apply') {
// /managements/library_applies
return window.open(`/managements/library_applies`)
return window.open(`/admins/library_applies`)
}
if (item.tiding_type === 'System') {
//教学案例详情 :id = container_id
@ -467,7 +467,7 @@ class MessagSub extends Component {
} else {
if (item.tiding_type === 'Apply') {
///managements/project_package_applies
return window.open(`/managements/project_package_applies`)
return window.open(`/admins/project_package_applies`)
}
// if(item.tiding_type === 'System'){
//众包详情 :id = container_id
@ -478,7 +478,7 @@ class MessagSub extends Component {
return window.open(`/shixuns/${item.identifier}/shixun_discuss`);
case "Video":
if (item.tiding_type === "Apply") {
return window.open(`/managements/video_applies`);
return window.open(`/admins/video_applies`);
} else if (item.tiding_type === "System") {
return window.open(`/users/${this.props.current_user.login}/videos`);
}
@ -515,7 +515,7 @@ class MessagSub extends Component {
render() {
let {page, limit, typeysl, count, isSpin, data} = this.state;
// console.log("6868686868");
console.log(data);
console.log(data);
return (
<div className="clearfix ml20">
{/*头部筛选数据*/}
@ -529,7 +529,7 @@ class MessagSub extends Component {
onClick={(s, i) => this.getdata("project", 1)}>项目提醒</a></li>
{/*<li className={typeysl && typeysl === "project_package" ? "active" : ""}><a*/}
{/*onClick={(s, i) => this.getdata("project_package", 1)}>众包提醒</a></li>*/}
{/*onClick={(s, i) => this.getdata("project_package", 1)}>众包提醒</a></li>*/}
<li className={typeysl && typeysl === "interaction" ? "active" : ""}><a
onClick={(s, i) => this.getdata("interaction", 1)}>互动提醒</a></li>
@ -545,123 +545,122 @@ class MessagSub extends Component {
{/*下面内容页面*/}
<div className="bor-top-greyE mycenter">
{/*这里可以进行数据处理*/}
<div className="myw100baifenbi edu-back-white">
<div className="myw100baifenbi">
<Spin size="large" className="myw100baifenbi mt10" spinning={isSpin}>
{
data === undefined ?
<NoneData></NoneData> :
data.length === 0 ?
<NoneData></NoneData>
: 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;
}
if (item.container_type === "JournalsForMessage") {
if (item.parent_container_type === "Principal") {
<NoneData></NoneData>
: 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;
}
if (item.parent_container_type === "HomeworkCommon") {
if (item.homework_type === null || item.homework_type === undefined) {
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.container_type==="HomeworkCommon"){
// if(item.parent_container_type==="AnonymousAppeal"){
// boolps=false;
// }
// }
if (item.container_type === "ProjectPackage") {
if (item.tiding_type === "Destroyed_end") {
boolps = false;
}
if (item.tiding_type === "Destroyed") {
boolps = false;
// if(item.container_type==="HomeworkCommon"){
// if(item.parent_container_type==="AnonymousAppeal"){
// boolps=false;
// }
// }
if (item.container_type === "ProjectPackage") {
if (item.tiding_type === "Destroyed_end") {
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;
}
}
}
if (item.container_type === "DeleteCourse") {
if (item.tiding_type === "System") {
boolps = false;
if (item.container_type === "DeleteCourse") {
if (item.tiding_type === "System") {
boolps = false;
}
}
}
if (item.container_type === "DeleteCourseMember") {
if (item.tiding_type === "System") {
boolps = false;
if (item.container_type === "DeleteCourseMember") {
if (item.tiding_type === "System") {
boolps = false;
}
}
}
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="fl flex1">
<p>
<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> : ""
) : ""}
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="fl flex1">
<p>
<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> : ""
) : ""}
</p>
<style>
{
`.yslspansk span{
</p>
<style>
{
`.yslspansk span{
color: #FF9966!important;
}
`
}
</style>
<p className="color-grey-6 yslspansk markdown-body mt10" style={{wordBreak: "break-word"}}
dangerouslySetInnerHTML={{__html: markdownToHTML(item.content).replace(/▁/g, "▁▁▁")}}></p>
}
</style>
<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>
</div>
<span className={item.new_tiding === true ? "new-point fr mr40 mt22" : ""}></span>
</div>
</div>
)
})}
)
})}
</Spin>
{/*页数*/}
{data === undefined ? ""
:
(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>
</div>
{/*页数*/}
{data === undefined ? ""
:
(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>
)
}
}
export default MessagSub;
export default MessagSub;

@ -112,29 +112,6 @@ class CodeRepositoryView extends Component {
.removeClass("codeRepoShow")
// .removeClass("fa-caret-down").addClass("fa-caret-right");
})
// $('#codetab_con_1').append(``)
// $('#codetab_con_1 .codemirrorBackground').hide()
window.addEventListener('beforeunload', this.beforeUnload);
}
componentWillUnmount () {
window.removeEventListener('beforeunload', this.beforeUnload);
}
beforeUnload = (e) => {
// console.log(this.props);
const { game } = this.props;
const url = `/api/tasks/${game.identifier}/cost_time.json`;
axios.get(url).then(res => {
// TODO
});
const msg = '确定要离开吗?';
e = e || window.event;
if (e) {
e.returnValue = msg;
}
return msg;
}
onTreeSelect = (selectedKeys, info) => {

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

@ -327,8 +327,7 @@ class InfosPath extends Component{
<div className="square-list clearfix">
{/* 295 */}
{
page == 1 && is_current && !category &&
this.props.current_user && this.props.current_user.user_identity != "学生" ? <Create href={"/paths/new"} name={"新建实践课程"} index="3"></Create>:""
page == 1 && is_current && !category ? <Create href={"/paths/new"} name={"新建实践课程"} index="3"></Create>:""
}
{
(!data || (data && data.subjects.length==0)) && category && <NoneData></NoneData>

@ -313,7 +313,7 @@ class InfosProject extends Component{
<div className="square-list clearfix">
{/* 289 */}
{
page == 1 && is_current && this.props.current_user && !category && this.props.current_user.user_identity != "学生" ?
page == 1 && is_current ?
<Create href={`${this.props.Headertop && this.props.Headertop.old_url}/projects/new`} name={"新建开发项目"} index="4" Createtype={"projects"}
{...this.props} {...this.state}
></Create>:""

@ -335,7 +335,7 @@ class InfosShixun extends Component{
<div className="square-list clearfix">
{/* 298 */}
{
page == 1 && is_current && !category && this.props.current_user && this.props.current_user.user_identity != "学生" ?
page == 1 && is_current && !category ?
<Create href={"/shixuns/new"} name={"新建实训"} index="2"></Create>:""
}
{

@ -513,7 +513,7 @@ li.li-width7{width: 7%;text-align: left}
background-position: center;
background-repeat: no-repeat;
}
.invite-tip{position: absolute;top: -5px;right: 140px;color: #fff; box-sizing: border-box;width: 170px;text-align: center;border-radius: 2px;background-color: rgba(5,16,26,0.6)}
.invite-tip{position: absolute;top: -5px;right: 140px;color: #fff; box-sizing: border-box;width: 170px;text-align: center;border-radius: 2px;background-color: rgba(5,16,26,0.6);z-index: 5000;}
.inviteTipbtn a{font-size:14px;width: 100%;height: 30px;line-height: 30px;display: block;color: #747A7F;background-color: rgba(5,16,26,0.4)}
.inviteTipbtn a:hover{color: #4cacff!important;}
.top-black-trangle{display: block;border-width: 8px;position: absolute;top: -16px;right: 4px;border-style: dashed solid dashed dashed;border-color: transparent transparent rgba(5,16,26,0.6) transparent;font-size: 0;line-height: 0;}

Loading…
Cancel
Save