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

dev_cs_new
hjm 6 years ago
commit 2ad274a59f

@ -1,7 +1,7 @@
class DiscussesController < ApplicationController class DiscussesController < ApplicationController
LIMIT = 10 LIMIT = 10
before_action :find_container, only: [:index, :hidden] before_action :find_container, only: [:index, :hidden]
before_action :find_discuss, except: [:create, :index, :new_message, :reward_code, :forum_discusses] before_action :find_discuss, except: [:create, :index, :new_message, :reward_code, :forum_discusses, :plus]
def index def index
page = params[:page].to_i page = params[:page].to_i

@ -25,6 +25,8 @@ class JournalsForMessage < ApplicationRecord
# "is_comprehensive_evaluation", # 1 教师评论、2 匿评、3 留言 # "is_comprehensive_evaluation", # 1 教师评论、2 匿评、3 留言
# "hidden", 隐藏 # "hidden", 隐藏
after_create :send_tiding
# course_identity 课堂用户身份 # course_identity 课堂用户身份
def contents_show course_identity def contents_show course_identity
@ -47,4 +49,29 @@ class JournalsForMessage < ApplicationRecord
JournalsForMessage.includes(:user).where(m_parent_id: self.id).page(page).per(limit).reorder("created_on asc") JournalsForMessage.includes(:user).where(m_parent_id: self.id).page(page).per(limit).reorder("created_on asc")
end end
def send_tiding
# 回复和@同一个人时:只发@的消息(因@的消息先创建)
case self.jour_type
# 用户留言当做私信处理 不发消息
when "Principal"
=begin
user_id = self.m_parent_id.present? ? JournalsForMessage.find(self.m_parent_id).user_id : self.jour_id
if user_id != self.user_id && !self.tidings.where(:user_id => user_id, :trigger_user_id => self.user_id, :tiding_type => "Mentioned").first.present?
self.tidings << Tiding.new(:trigger_user_id => self.user_id, :user_id => user_id, :parent_container_id => self.jour_id, :parent_container_type => self.jour_type, :belong_container_id => self.jour_id, :belong_container_type => "User", :viewed => 0, :tiding_type => self.m_parent_id.present? ? "Comment" : "Journal")
end
=end
when "HomeworkCommon", "GraduationTopic"
user_id = self.m_parent_id.present? ? JournalsForMessage.find(self.m_parent_id).user_id : (self.jour_type == "HomeworkCommon" ? self.jour.user_id : self.jour.tea_id)
if user_id != self.user_id && !self.tidings.where(:user_id => user_id, :trigger_user_id => self.user_id, :tiding_type => "Mentioned").first.present?
self.tidings << Tiding.new(:trigger_user_id => self.user_id, :user_id => user_id, :parent_container_id => self.jour_id, :parent_container_type => self.jour_type, :belong_container_id => self.jour.course_id, :belong_container_type => "Course", :viewed => 0, :tiding_type => "Comment")
end
when "StudentWorksScore"
course_id = self.jour.try(:student_work).try(:homework_common).try(:course_id)
user_id = self.m_parent_id.present? ? JournalsForMessage.find(self.m_parent_id).user_id : self.jour.user_id
if user_id != self.user_id && !self.tidings.where(:user_id => user_id, :trigger_user_id => self.user_id, :tiding_type => "Mentioned").first.present?
self.tidings << Tiding.new(:trigger_user_id => self.user_id, :user_id => user_id, :parent_container_id => self.jour_id, :parent_container_type => self.jour_type, :belong_container_id => course_id, :belong_container_type => "Course", :viewed => 0, :tiding_type => "Comment")
end
end
end
end end

@ -9,6 +9,6 @@ json.memo do
json.tag memo.tag_repertoires.map(&:name) json.tag memo.tag_repertoires.map(&:name)
json.time memo.created_at json.time memo.created_at
json.replies_count memo.all_replies_count json.replies_count memo.all_replies_count
json.user_praise memo.praise_treads.user_liker(@user.try(:id)).count > 1 ? true : false json.user_praise memo.praise_treads.user_liker(@user.try(:id)).count > 0 ? true : false
json.memo_praise_count memo.praise_treads.liker.count json.memo_praise_count memo.praise_treads.liker.count
end end

@ -203,7 +203,7 @@ class CoursesNew extends Component {
// debugger // debugger
if (response.data.status === 0) { if (response.data.status === 0) {
// this.goback() // this.goback()
this.props.history.push(first_category_url); window.location.href=first_category_url;
} }
}).catch((error) => { }).catch((error) => {
console.log(error) console.log(error)
@ -247,7 +247,7 @@ class CoursesNew extends Component {
).then((response) => { ).then((response) => {
if (response.status === 200) { if (response.status === 200) {
// this.goback // this.goback
this.props.history.push(response.data.first_category_url); window.location.href=response.data.first_category_url;
} }
}).catch((error) => { }).catch((error) => {
console.log(error) console.log(error)

@ -20,6 +20,10 @@
.ant-modal-header{ .ant-modal-header{
border-radius: 0px !important; border-radius: 0px !important;
} }
.ridinglist-subs{
border-bottom: 1px solid #F5F5F5;
padding: 25px 0px;
}
.search-new{ .search-new{
width: 100% !important; width: 100% !important;
margin-bottom: 0px !important; margin-bottom: 0px !important;

@ -656,7 +656,7 @@ class MessagChat extends Component{
</p> </p>
<p className="color-grey-6 lineh-20 justify break_word task-hide-2" style={{wordBreak:"break-word"}} id="MakedownHTML" dangerouslySetInnerHTML={{__html:item.content}}> <p className="color-grey-6 lineh-20 justify break_word task-hide-2 markdown-body" style={{wordBreak:"break-word"}} id="MakedownHTML" dangerouslySetInnerHTML={{__html:item.content}}>
</p> </p>
</div> </div>

@ -116,94 +116,94 @@ class MessagSub extends Component{
if(item.tiding_type==="Apply"){ if(item.tiding_type==="Apply"){
if(item.auth_type===1){ if(item.auth_type===1){
//系统管理页面 //系统管理页面
return window.location.href="/managements/identity_authentication"; return window.open("/managements/identity_authentication");
} }
if(item.auth_type===2){ if(item.auth_type===2){
//系统管理页面 //系统管理页面
return window.location.href="/managements/professional_authentication"; return window.open("/managements/professional_authentication")
} }
} }
if(item.tiding_type ==="System"){ if(item.tiding_type ==="System"){
// 账号管理页-认证信息 // 账号管理页-认证信息
return window.location.href="/account/certification"; return window.open("/account/certification")
} }
case "CancelUserAuthentication" : case "CancelUserAuthentication" :
// 账号管理页-认证信息 // 账号管理页-认证信息
return window.location.href="/account/certification"; return window.open("/account/certification")
case "CancelUserProCertification" : case "CancelUserProCertification" :
// 账号管理页-认证信息 // 账号管理页-认证信息
return window.location.href="/account/certification"; return window.open("/account/certification")
case "ApplyAddDepartment" : case "ApplyAddDepartment" :
if(item.tiding_type==="Apply"){ if(item.tiding_type==="Apply"){
//部门审批 //部门审批
return window.location.href="/managements/depart"; return window.open("/managements/depart")
} }
if(item.tiding_type==="System"){ if(item.tiding_type==="System"){
// 账号管理页/account/profile // 账号管理页/account/profile
return window.location.href="/account/profile"; return window.open("/account/profile")
} }
case "ApplyAddSchools" : case "ApplyAddSchools" :
if(item.tiding_type==="Apply"){ if(item.tiding_type==="Apply"){
// 单位审批 // 单位审批
return window.location.href=" /managements/unit"; return window.open(" /managements/unit")
} }
if(item.tiding_type==="System"){ if(item.tiding_type==="System"){
// 账号管理页 // 账号管理页
return window.location.href="/account/profile"; return window.open("/account/profile")
} }
case "ApplyAction" : case "ApplyAction" :
switch (item.parent_container_type) { switch (item.parent_container_type) {
case "ApplyShixun" : case "ApplyShixun" :
if(item.tiding_type==="Apply"){ if(item.tiding_type==="Apply"){
return window.location.href="/managements/shixun_authorization"; return window.open("/managements/shixun_authorization")
} }
if(item.tiding_type==="System"){ if(item.tiding_type==="System"){
// 实训详情页 :identifier = identifier // 实训详情页 :identifier = identifier
return window.location.href=`/shixuns/${item.identifier}/challenges`; return window.open(`/shixuns/${item.identifier}/challenges`)
} }
case "ApplySubject" : case "ApplySubject" :
if(item.tiding_type==="Apply"){ if(item.tiding_type==="Apply"){
// 实训课程发布 // 实训课程发布
return window.location.href="/managements/subject_authorization"; return window.open("/managements/subject_authorization")
} }
if(item.tiding_type==="System"){ if(item.tiding_type==="System"){
// 实践课程详情页 :identifier = identifier // 实践课程详情页 :parent_container_id = parent_container_id
return window.location.href=`/paths/${item.identifier}`; return window.open(`/paths/${item.parent_container_id}`)
} }
case "TrialAuthorization" : case "TrialAuthorization" :
if(item.tiding_type==="Apply"){ if(item.tiding_type==="Apply"){
// 试用授权页面 // 试用授权页面
return window.location.href="/managements/trial_authorization"; return window.open("/managements/trial_authorization")
} }
if(item.tiding_type==="System"){ if(item.tiding_type==="System"){
// 账号管理页 // 账号管理页
return window.location.href="/account/profile"; return window.open("/account/profile")
} }
} }
case 'JoinCourse' : case 'JoinCourse' :
// 课堂详情页 :id = // 课堂详情页 :id =
return window.location.href=`/courses/${item.belong_container_id}/shixun_homeworks/${item.container_id}`; return window.open(`/courses/${item.belong_container_id}/shixun_homeworks/${item.container_id}`)
case 'StudentJoinCourse': case 'StudentJoinCourse':
// 课堂详情页 :id = container_id // 课堂详情页 :id = container_id
return window.location.href=`/courses/${item.belong_container_id}/shixun_homeworks/${item.container_id}`; return window.open(`/courses/${item.belong_container_id}/shixun_homeworks/${item.container_id}`)
case 'DealCourse': case 'DealCourse':
// 课堂详情页 :id = container_id // 课堂详情页 :id = container_id
return window.location.href=`/courses/${item.belong_container_id}/shixun_homeworks/${item.container_id}`; return window.open(`/courses/${item.belong_container_id}/shixun_homeworks/${item.container_id}`)
case 'TeacherJoinCourse': case 'TeacherJoinCourse':
// 课堂详情页 :id = container_id // 课堂详情页 :id = container_id
return window.location.href=`/courses/${item.belong_container_id}/shixun_homeworks/${item.container_id}`; return window.open(`/courses/${item.belong_container_id}/shixun_homeworks/${item.container_id}`)
case 'Course' : case 'Course' :
// 课堂详情页 :id = container_id // 课堂详情页 :id = container_id
return window.location.href=`/courses/${item.belong_container_id}/shixun_homeworks/${item.container_id}`; return window.open(`/courses/${item.belong_container_id}/shixun_homeworks/${item.container_id}`)
case 'ArchiveCourse' : case 'ArchiveCourse' :
// 课堂详情页 :id = container_id // 课堂详情页 :id = container_id
return window.location.href=`/courses/${item.belong_container_id}/shixun_homeworks/${item.container_id}`; return window.open(`/courses/${item.belong_container_id}/shixun_homeworks/${item.container_id}`)
case "Shixun" : case "Shixun" :
return window.location.href=`/shixuns/${item.identifier}/challenges`; return window.open(`/shixuns/${item.identifier}/challenges`)
case "Subject" : case "Subject" :
// 实践课程详情页 :id = container_id // 实践课程详情页 :id = container_id
return window.location.href=`/paths/${item.identifier}`; return window.open(`/paths/${item.container_id}`)
case "JournalsForMessage" : case "JournalsForMessage" :
switch (item.parent_container_type) { switch (item.parent_container_type) {
case "Principal" : case "Principal" :
@ -214,235 +214,235 @@ class MessagSub extends Component{
//学生作业页 homework = parent_container_id //学生作业页 homework = parent_container_id
if(item.homework_type===1){ if(item.homework_type===1){
//普通作业 //普通作业
return window.location.href=`t/courses/${item.belong_container_id}/common_homeworks/${item.parent_container_id}/list`; return window.open(`/courses/${item.belong_container_id}/common_homeworks/${item.parent_container_id}/list`)
} }
if(item.homework_type===3){ if(item.homework_type===3){
//分组作业 //分组作业
return window.location.href=`/courses/${item.belong_container_id}/group_homeworks/${item.parent_container_id}/list`; return window.open(`/courses/${item.belong_container_id}/group_homeworks/${item.parent_container_id}/list`)
} }
if(item.homework_type===4){ if(item.homework_type===4){
//实训作业 //实训作业
return window.location.href=`/courses/${item.belong_container_id}/shixun_homeworks/${item.parent_container_id}/list?tab=0`; return window.open(`/courses/${item.belong_container_id}/shixun_homeworks/${item.parent_container_id}/list?tab=0`)
} }
return '';
case "GraduationTopic" : case "GraduationTopic" :
// 毕业目标页 parent_container_id // 毕业目标页 parent_container_id
return window.location.href=`/courses/${item.belong_container_id}/graduation_topics/${item.parent_container_id}/detail`; return window.open(`/courses/${item.belong_container_id}/graduation_topics/${item.parent_container_id}/detail`)
case "StudentWorksScore" : case "StudentWorksScore" :
//学生作业页 //学生作业页
if(item.homework_type===1){ if(item.homework_type===1){
//普通作业 //普通作业
return window.location.href=`t/courses/${item.belong_container_id}/common_homeworks/${item.parent_container_id}/list`; return window.open(`/courses/${item.belong_container_id}/common_homeworks/${item.parent_container_id}/list`)
} }
if(item.homework_type===3){ if(item.homework_type===3){
//分组作业 //分组作业
return window.location.href=`/courses/${item.belong_container_id}/group_homeworks/${item.parent_container_id}/list`; return window.open(`/courses/${item.belong_container_id}/group_homeworks/${item.parent_container_id}/list`)
} }
if(item.homework_type===4){ if(item.homework_type===4){
//实训作业 //实训作业
return window.location.href=`/courses/${item.belong_container_id}/shixun_homeworks/${item.parent_container_id}/list?tab=0`; return window.open(`/courses/${item.belong_container_id}/shixun_homeworks/${item.parent_container_id}/list?tab=0`)
} }
} }
case "Memo" : case "Memo" :
// 交流问答页 :id = parent_container_id // 交流问答页 :id = parent_container_id
return window.location.href="/forums/categories/all?order=newest"; return window.open(`/forums/${item.parent_container_id}`)
case "Watcher" : case "Watcher" :
// 用户个人中心页 :id = item.trigger_user.login // 用户个人中心页 :id = item.trigger_user.login
return window.location.href=`/users/${item.trigger_user.login}/courses`; return window.open(`/users/${item.trigger_user.login}/courses`)
case "PraiseTread" : case "PraiseTread" :
// 这块太复杂 不好处理 // 这块太复杂 不好处理
return ''; return '';
case "Grade" : case "Grade" :
//个人中心页 :id = item.trigger_user.login //个人中心页 :id = item.trigger_user.login
return window.location.href=`/users/${item.trigger_user.login}/courses`; // return window.open(`/users/${item.trigger_user.login}/courses`;
return "";
case "JoinProject" : case "JoinProject" :
//项目详情-申请加入项目审核页 :id = container_id //项目详情-申请加入项目审核页 :id = container_id
return window.location.href=`/projects/${item.container_id}`; return window.open(`/projects/${item.container_id}`)
case 'ReporterJoinProject': case 'ReporterJoinProject':
//项目详情页 :id = container_id //项目详情页 :id = container_id
return window.location.href=`/projects/${item.container_id}`; return window.open(`/projects/${item.container_id}`)
case 'DealProject': case 'DealProject':
//项目详情页 :id = container_id //项目详情页 :id = container_id
return window.location.href=`/projects/${item.container_id}`; return window.open(`/projects/${item.container_id}`)
case 'ManagerJoinProject': case 'ManagerJoinProject':
//项目详情页 :id = container_id //项目详情页 :id = container_id
return window.location.href=`/projects/${item.container_id}`; return window.open(`/projects/${item.container_id}`)
case "Poll": case "Poll":
switch (item.parent_container_type) { switch (item.parent_container_type) {
case "CommitPoll" : case "CommitPoll" :
// 课堂id belong_container_id // 课堂id belong_container_id
//课堂-学生已提交问卷列表 :id = container_id //课堂-学生已提交问卷列表 :id = container_id
return window.location.href=` /courses/${item.belong_container_id}/polls/${item.container_id}`; return window.open(` /courses/${item.belong_container_id}/polls/${item.container_id}`)
default : default :
// 课堂-问卷列表 :id = container_id // 课堂-问卷列表 :id = container_id
return window.location.href=` /courses/${item.belong_container_id}/polls/${item.container_id}`; return window.open(` /courses/${item.belong_container_id}/polls/${item.container_id}`)
} }
case "Exercise" : case "Exercise" :
switch (item.parent_container_type) { switch (item.parent_container_type) {
case "CommitExercise": case "CommitExercise":
// 课堂-学生试卷详情 :id = container_id :user_id = trigger_user.id // 课堂-学生试卷详情 :id = container_id :user_id = trigger_user.id
return window.location.href=` /courses/${item.belong_container_id}/exercises/${item.container_id}/student_exercise_list?tab=0`; return window.open(` /courses/${item.belong_container_id}/exercises/${item.container_id}/student_exercise_list?tab=0`)
case "ExerciseScore": case "ExerciseScore":
// 课堂-学生试卷详情 :id = container_id :user_id = trigger_user.id // 课堂-学生试卷详情 :id = container_id :user_id = trigger_user.id
return window.location.href=` /courses/${item.belong_container_id}/exercises/${item.container_id}/student_exercise_list?tab=0`; return window.open(` /courses/${item.belong_container_id}/exercises/${item.container_id}/student_exercise_list?tab=0`)
default : default :
// 课堂-试卷列表详情 :id = container_id // 课堂-试卷列表详情 :id = container_id
return window.location.href=`/courses/${item.belong_container_id}/exercises/${item.container_id}`; return window.open(`/courses/${item.belong_container_id}/exercises/${item.container_id}`)
} }
case 'StudentGraduationTopic' : case 'StudentGraduationTopic' :
//课堂-毕业选题详情 :id = parent_container_id //课堂-毕业选题详情 :id = parent_container_id
return window.location.href=`/courses/${item.belong_container_id}/graduation_topics/${item.parent_container_id}/detail`; return window.open(`/courses/${item.belong_container_id}/graduation_topics/${item.parent_container_id}/detail`)
case 'DealStudentTopicSelect' : case 'DealStudentTopicSelect' :
//课堂-毕业选题详情 :id = parent_container_id //课堂-毕业选题详情 :id = parent_container_id
return window.location.href=`/courses/${item.belong_container_id}/graduation_topics/${item.parent_container_id}/detail`; return window.open(`/courses/${item.belong_container_id}/graduation_topics/${item.parent_container_id}/detail`)
case 'GraduationTask' : case 'GraduationTask' :
//课堂-毕业任务页 :id = container_id //课堂-毕业任务页 :id = container_id
return window.location.href=`/courses/${item.belong_container_id}/graduation_tasks/${item.container_id}`; return window.open(`/courses/${item.belong_container_id}/graduation_tasks/${item.container_id}`)
case "GraduationWork" : case "GraduationWork" :
//课堂-毕业xx页 :id = container_id //课堂-毕业xx页 :id = container_id
return window.location.href=`/courses/${item.belong_container_id}/graduation_tasks/${item.container_id}`; return window.open(`/courses/${item.belong_container_id}/graduation_tasks/${item.container_id}`)
case "GraduationWorkScore" : case "GraduationWorkScore" :
// 课堂-毕业xx页 :id = parent_container_id // 课堂-毕业xx页 :id = parent_container_id
return window.location.href=`/courses/${item.belong_container_id}/graduation_tasks/${item.parent_container_id}`; return window.open(`/courses/${item.belong_container_id}/graduation_tasks/${item.parent_container_id}`)
case "HomeworkCommon" : case "HomeworkCommon" :
switch (item.parent_container_type) { switch (item.parent_container_type) {
case "AnonymousCommentFail" : case "AnonymousCommentFail" :
// 课堂-作业列表 homework = container_id // 课堂-作业列表 homework = container_id
if(item.homework_type===1){ if(item.homework_type===1){
//普通作业 //普通作业
return window.location.href=`t/courses/${item.belong_container_id}/common_homeworks/${item.parent_container_id}/list`; return window.open(`/courses/${item.belong_container_id}/common_homeworks/${item.parent_container_id}/list`)
} }
if(item.homework_type===3){ if(item.homework_type===3){
//分组作业 //分组作业
return window.location.href=`/courses/${item.belong_container_id}/group_homeworks/${item.parent_container_id}/list`; return window.open(`/courses/${item.belong_container_id}/group_homeworks/${item.parent_container_id}/list`)
} }
if(item.homework_type===4){ if(item.homework_type===4){
//实训作业 //实训作业
return window.location.href=`/courses/${item.belong_container_id}/shixun_homeworks/${item.parent_container_id}/list?tab=0`; return window.open(`/courses/${item.belong_container_id}/shixun_homeworks/${item.parent_container_id}/list?tab=0`)
} }
case "HomeworkPublish" : case "HomeworkPublish" :
if(item.homework_type===1){ if(item.homework_type===1){
//普通作业 //普通作业
return window.location.href=`t/courses/${item.belong_container_id}/common_homeworks/${item.parent_container_id}/list`; return window.open(`/courses/${item.belong_container_id}/common_homeworks/${item.parent_container_id}/list`)
} }
if(item.homework_type===3){ if(item.homework_type===3){
//分组作业 //分组作业
return window.location.href=`/courses/${item.belong_container_id}/group_homeworks/${item.parent_container_id}/list`; return window.open(`/courses/${item.belong_container_id}/group_homeworks/${item.parent_container_id}/list`)
} }
if(item.homework_type===4){ if(item.homework_type===4){
//实训作业 //实训作业
return window.location.href=`/courses/${item.belong_container_id}/shixun_homeworks/${item.parent_container_id}/list?tab=0`; return window.open(`/courses/${item.belong_container_id}/shixun_homeworks/${item.parent_container_id}/list?tab=0`)
} }
case "AnonymousAppeal" : case "AnonymousAppeal" :
if(item.homework_type===1){ if(item.homework_type===1){
//普通作业 //普通作业
return window.location.href=`t/courses/${item.belong_container_id}/common_homeworks/${item.parent_container_id}/list`; return window.open(`/courses/${item.belong_container_id}/common_homeworks/${item.parent_container_id}/list`)
} }
if(item.homework_type===3){ if(item.homework_type===3){
//分组作业 //分组作业
return window.location.href=`/courses/${item.belong_container_id}/group_homeworks/${item.parent_container_id}/list`; return window.open(`/courses/${item.belong_container_id}/group_homeworks/${item.parent_container_id}/list`)
} }
if(item.homework_type===4){ if(item.homework_type===4){
//实训作业 //实训作业
return window.location.href=`/courses/${item.belong_container_id}/shixun_homeworks/${item.parent_container_id}/list?tab=0`; return window.open(`/courses/${item.belong_container_id}/shixun_homeworks/${item.parent_container_id}/list?tab=0`)
} }
default : default :
// 课堂-作业列表 homework = container_id // 课堂-作业列表 homework = container_id
if(item.homework_type===1){ if(item.homework_type===1){
//普通作业 //普通作业
return window.location.href=`t/courses/${item.belong_container_id}/common_homeworks/${item.parent_container_id}/list`; return window.open(`/courses/${item.belong_container_id}/common_homeworks/${item.parent_container_id}/list`)
} }
if(item.homework_type===3){ if(item.homework_type===3){
//分组作业 //分组作业
return window.location.href=`/courses/${item.belong_container_id}/group_homeworks/${item.parent_container_id}/list`; return window.open(`/courses/${item.belong_container_id}/group_homeworks/${item.parent_container_id}/list`)
} }
if(item.homework_type===4){ if(item.homework_type===4){
//实训作业 //实训作业
return window.location.href=`/courses/${item.belong_container_id}/shixun_homeworks/${item.parent_container_id}/list?tab=0`; return window.open(`/courses/${item.belong_container_id}/shixun_homeworks/${item.parent_container_id}/list?tab=0`)
} }
} }
case "StudentWork" : case "StudentWork" :
//课堂-作业 :id = container_id //课堂-作业 :id = container_id
if(item.homework_type===1){ if(item.homework_type===1){
//普通作业 //普通作业
return window.location.href=`t/courses/${item.belong_container_id}/common_homeworks/${item.parent_container_id}/list`; return window.open(`/courses/${item.belong_container_id}/common_homeworks/${item.container_id}/list`)
} }
if(item.homework_type===3){ if(item.homework_type===3){
//分组作业 //分组作业
return window.location.href=`/courses/${item.belong_container_id}/group_homeworks/${item.parent_container_id}/list`; return window.open(`/courses/${item.belong_container_id}/group_homeworks/${item.container_id}/list`)
} }
if(item.homework_type===4){ if(item.homework_type===4){
//实训作业 //实训作业
return window.location.href=`/courses/${item.belong_container_id}/shixun_homeworks/${item.parent_container_id}/list?tab=0`; return window.open(`/courses/${item.belong_container_id}/shixun_homeworks/${item.container_id}/list?tab=0`)
} }
case "StudentWorksScore" : case "StudentWorksScore" :
//课堂-作业 :id = parent_container_id //课堂-作业 :id = parent_container_id
if(item.homework_type===1){ if(item.homework_type===1){
//普通作业 //普通作业
return window.location.href=`t/courses/${item.belong_container_id}/common_homeworks/${item.parent_container_id}/list`; return window.open(`/courses/${item.belong_container_id}/common_homeworks/${item.parent_container_id}/list`)
} }
if(item.homework_type===3){ if(item.homework_type===3){
//分组作业 //分组作业
return window.location.href=`/courses/${item.belong_container_id}/group_homeworks/${item.parent_container_id}/list`; return window.open(`/courses/${item.belong_container_id}/group_homeworks/${item.parent_container_id}/list`)
} }
if(item.homework_type===4){ if(item.homework_type===4){
//实训作业 //实训作业
return window.location.href=`/courses/${item.belong_container_id}/shixun_homeworks/${item.parent_container_id}/list?tab=0`; return window.open(`/courses/${item.belong_container_id}/shixun_homeworks/${item.parent_container_id}/list?tab=0`)
} }
case "StudentWorksScoresAppeal" : case "StudentWorksScoresAppeal" :
if(item.homework_type===1){ if(item.homework_type===1){
//普通作业 //普通作业
return window.location.href=`t/courses/${item.belong_container_id}/common_homeworks/${item.parent_container_id}/list`; return window.open(`courses/${item.belong_container_id}/common_homeworks/${item.parent_container_id}/list`)
} }
if(item.homework_type===3){ if(item.homework_type===3){
//分组作业 //分组作业
return window.location.href=`/courses/${item.belong_container_id}/group_homeworks/${item.parent_container_id}/list`; return window.open(`/courses/${item.belong_container_id}/group_homeworks/${item.parent_container_id}/list`)
} }
if(item.homework_type===4){ if(item.homework_type===4){
//实训作业 //实训作业
return window.location.href=`/courses/${item.belong_container_id}/shixun_homeworks/${item.parent_container_id}/list?tab=0`; return window.open(`/courses/${item.belong_container_id}/shixun_homeworks/${item.parent_container_id}/list?tab=0`)
} }
case "ChallengeWorkScore" : case "ChallengeWorkScore" :
return ''; return '';
case "SendMessage" : case "SendMessage" :
// /managements/mirror_repository // /managements/mirror_repository
return window.location.href=`/managements/mirror_repository`; return window.open(`/managements/mirror_repository`)
case "Journal" : case "Journal" :
//项目Issue页 :id = parent_container_id //项目Issue页 :id = parent_container_id
return window.location.href=`/projects/${item.parent_container_id}/issues?remote=true`; return window.open(`/projects/${item.parent_container_id}/issues?remote=true`)
case "Issue" : case "Issue" :
//项目Issue页 :id = container_id //项目Issue页 :id = container_id
return window.location.href=`/projects/${item.container_id}/issues?remote=true`; return window.open(`/projects/${item.container_id}/issues?remote=true`)
case "PullRequest" : case "PullRequest" :
// 项目pull request页 :id = parent_container_id // 项目pull request页 :id = parent_container_id
return window.location.href=`/projects/${item.parent_container_id}/pull_requests`; return window.open(`/projects/${item.parent_container_id}/pull_requests`)
case "Department" : case "Department" :
//账号管理页 //账号管理页
return window.location.href=`/account/profile`; return window.open(`/account/profile`)
case "Library" : case "Library" :
if (item.tiding_type === 'Apply') { if (item.tiding_type === 'Apply') {
// /managements/library_applies // /managements/library_applies
return window.location.href=`/managements/library_applies`; return window.open(`/managements/library_applies`)
} }
if(item.tiding_type === 'System'){ if(item.tiding_type === 'System'){
//教学案例详情 :id = container_id //教学案例详情 :id = container_id
return window.location.href=`/moop_cases/${item.container_id}`; return window.open(`/moop_cases/${item.container_id}`)
} }
case "ProjectPackage" : case "ProjectPackage" :
if(item.tiding_type==="Destroyed_end"){ if(item.tiding_type==="Destroyed_end"){
return ; return ;
}else { }else {
// if (item.tiding_type === 'Apply') { if (item.tiding_type === 'Apply') {
// ///managements/project_package_applies ///managements/project_package_applies
// return window.location.href=`/managements/project_package_applies`; return window.open(`/managements/project_package_applies`)
// } }
// if(item.tiding_type === 'System'){ // if(item.tiding_type === 'System'){
//众包详情 :id = container_id //众包详情 :id = container_id
return window.location.href=`/crowdsourcing/${item.container_id}`; return window.open(`/crowdsourcing/${item.container_id}`)
// } // }
} }
default : default :
return window.location.href="/"; return window.open("/")
} }
} }
@ -485,10 +485,30 @@ class MessagSub extends Component{
<p className="edu-nodata-p mb20">暂无数据哦~</p> <p className="edu-nodata-p mb20">暂无数据哦~</p>
</div> </div>
:data.map((item,key)=>{ :data.map((item,key)=>{
console.log(data) // 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"){
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;
}
}
return( return(
<div className="pl25 ridinglist edu-back-white" key={key}> <div className="pl25 ridinglist edu-back-white" key={key}>
<div className="ridinglist-sub clearfix df tiding_item" onClick={()=>this.gettourl(item)}> <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"/> <img onMouseDown={()=>this.myCome(item)} src={getImageUrl("images/"+item.trigger_user.image_url)} className="radius mr10 fl myimgw48 myimgh48"/>
<div className="fl flex1"> <div className="fl flex1">
<p> <p>
@ -512,7 +532,7 @@ class MessagSub extends Component{
` `
} }
</style> </style>
<p className="color-grey-6 break_word_firefox yslspansk" style={{wordBreak: "break-word"}} dangerouslySetInnerHTML={{__html:item.content}}></p> <p className="color-grey-6 break_word_firefox yslspansk markdown-body" style={{wordBreak: "break-word"}} dangerouslySetInnerHTML={{__html:item.content}}></p>
</div> </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>

@ -179,7 +179,7 @@ class MessagePrivate extends Component{
<span className="color-grey-c mr20">[{item.message_count}{"条"}]</span> <span className="color-grey-c mr20">[{item.message_count}{"条"}]</span>
<span className="color-grey-c">{moment(item.send_time).fromNow()}</span> <span className="color-grey-c">{moment(item.send_time).fromNow()}</span>
</p> </p>
<span className="color-grey-6 break_word_firefox " dangerouslySetInnerHTML={{__html:item.content}}></span> <span className="color-grey-6 break_word_firefox markdown-body" dangerouslySetInnerHTML={{__html:item.content}}></span>
</div> </div>
{item.unread === true ?<span className="new-point fr mt22"></span>:""} {item.unread === true ?<span className="new-point fr mt22"></span>:""}

@ -297,8 +297,8 @@ class PackageIndexNEITaskDetails extends Component {
onMouseOver={this.setover} onMouseOver={this.setover}
onMouseOut={this.setout} onMouseOut={this.setout}
> >
{overtype===false?<a className="ContacttheTA fl" target="_blank" href={`/messages/${this.props.current_user&&this.props.current_user.login}/message_detail?target_ids=${data&&data.creator.login}`}> <img alt="头像" class="mr5" src={require('./newsone.png')} />联系TA</a>: {overtype===false?<a className="ContacttheTA fl" target="_blank" href={`/messages/${this.props.current_user&&this.props.current_user.login}/message_detail?target_ids=${data&&data.creator.id}`}> <img alt="头像" class="mr5" src={require('./newsone.png')} />联系TA</a>:
<a className="ContacttheTAs fl" target="_blank" href={`/messages/${this.props.current_user&&this.props.current_user.login}/message_detail?target_ids=${data&&data.creator.login}`}> <img alt="头像" className="mr5" <a className="ContacttheTAs fl" target="_blank" href={`/messages/${this.props.current_user&&this.props.current_user.login}/message_detail?target_ids=${data&&data.creator.id}`}> <img alt="头像" className="mr5"
src={require('./newstwo.png')}/>联系TA</a>} src={require('./newstwo.png')}/>联系TA</a>}
</div>} </div>}
</div> </div>
@ -411,7 +411,7 @@ class PackageIndexNEITaskDetails extends Component {
{item.status==="bidding_won"?<img src={gouxuan} className="yslgouxuanimg"/>:""} {item.status==="bidding_won"?<img src={gouxuan} className="yslgouxuanimg"/>:""}
<a href={`/users/${item.login}`}><img className="div1imgs" src={getImageUrl("images/"+item.image_url)}/></a> <a href={`/users/${item.login}`}><img className="div1imgs" src={getImageUrl("images/"+item.image_url)}/></a>
<div className="textall mt10" title={item.name}> <p className="ptext">{item.name}</p></div> <div className="textall mt10" title={item.name}> <p className="ptext">{item.name}</p></div>
{this.props.current_user&&this.props.current_user.login!=item.login?<a className="ContacttheTAs fl none" target="_blank" href={`/messages/${this.props.current_user&&this.props.current_user.login}/message_detail?target_ids=${item.login}`}> {this.props.current_user&&this.props.current_user.login!=item.login?<a className="ContacttheTAs fl none" target="_blank" href={`/messages/${this.props.current_user&&this.props.current_user.login}/message_detail?target_ids=${item.id}`}>
<img alt="头像" className="mr5" src={require('./newstwo.png')}/>联系TA <img alt="头像" className="mr5" src={require('./newstwo.png')}/>联系TA
</a>:""} </a>:""}
</div> </div>

Loading…
Cancel
Save