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

dev_cs
daiao 5 years ago
commit a411308d82

@ -478,16 +478,15 @@ class StudentWorksController < ApplicationController
ActiveRecord::Base.transaction do
challenge = @homework.shixuns.first&.challenges.find_by(id: params[:challenge_id]) unless params[:challenge_id].blank?
if challenge.present?
comment = @work.shixun_work_comments.find_by(challenge_id: challenge.id) ||
@comment = @work.shixun_work_comments.find_by(challenge_id: challenge.id) ||
ShixunWorkComment.new(student_work_id: @work.id, user_id: current_user.id, challenge_id: challenge.id)
else
comment = @work.shixun_work_comments.find_by(challenge_id: 0) ||
@comment = @work.shixun_work_comments.find_by(challenge_id: 0) ||
ShixunWorkComment.new(student_work_id: @work.id, user_id: current_user.id, challenge_id: 0)
end
comment.comment = params[:comment]
comment.hidden_comment = params[:hidden_comment]
comment.save!
normal_status("评阅成功")
@comment.comment = params[:comment]
@comment.hidden_comment = params[:hidden_comment]
@comment.save!
end
end

@ -0,0 +1,3 @@
json.comment_id @comment.id
json.status 0
json.message "评阅成功"

@ -72,8 +72,9 @@ class AppraiseModal extends Component{
challenge_id:challenge_id
}).then((response) => {
if(response.data.status===0){
debugger
this.props.showNotification(response.data.message)
this.props.showCancel(comment,hidden_comment,challenge_id)
this.props.showCancel(comment,hidden_comment,response.data.comment_id)
}else{
this.props.showNotification(response.data.message)
}

@ -157,7 +157,7 @@ class ShixunWorkReport extends Component {
showAppraiseModal=(type,id,show,hidden)=>{
let{data}=this.state;
debugger
if(type==="child"){
data.stage_list.forEach((item,key)=>{
if(item.challenge_id===id){
@ -192,12 +192,13 @@ class ShixunWorkReport extends Component {
let{data,showAppraisetype}=this.state;
debugger
if(showAppraisetype==="child"){
data.stage_list.forEach((item,key)=>{
if(item.challenge_id===id){
item.challenge_comment=show;
item.challenge_comment_hidden=hidden;
item.challenge_id=id;
}
})
this.setState({
@ -205,10 +206,12 @@ class ShixunWorkReport extends Component {
data:data
})
}else{
data.comment_id=id
this.setState({
showAppraiseModaltype:false,
work_comment:show,
work_comment_hidden:hidden
work_comment_hidden:hidden,
data:data
})
}

@ -15,31 +15,7 @@ class OfficialAcademicTranscript extends Component {
}
componentDidMount() {
let {data}=this.props;
let datas=[];
if(data!=undefined){
data.stage_list===undefined?"":data.stage_list.forEach((item,key)=>{
datas.push({
customs: key+1,
taskname:{name:item.name,complete_status:item.complete_status},
openingtime:item.open_time,
evaluating: item.evaluate_count,
finishtime:item.finished_time,
elapsedtime:item.time_consuming,
empvalue:{myself:item.myself_experience,experience:item.experience},
game_scores:{game_score:item.game_score,game_score_full:item.game_score_full},
challenge_id:{id:item.challenge_id},
challenge_comment: item.challenge_comment,
challenge_comment_hidden: item.challenge_comment_hidden,
// adjustmentminute:asdasd
})
})
this.setState({
datas:datas
})
}
}
myjumptopic=(e)=>{
console.log("获取到值");
@ -98,7 +74,28 @@ class OfficialAcademicTranscript extends Component {
}
render() {
let {datas,customsids}=this.state;
let {customsids}=this.state;
let {data}=this.props;
let datas=[];
if(data!=undefined){
data.stage_list===undefined?"":data.stage_list.forEach((item,key)=>{
datas.push({
customs: key+1,
taskname:{name:item.name,complete_status:item.complete_status},
openingtime:item.open_time,
evaluating: item.evaluate_count,
finishtime:item.finished_time,
elapsedtime:item.time_consuming,
empvalue:{myself:item.myself_experience,experience:item.experience},
game_scores:{game_score:item.game_score,game_score_full:item.game_score_full},
challenge_id:{id:item.challenge_id},
challenge_comment: item.challenge_comment,
challenge_comment_hidden: item.challenge_comment_hidden,
// adjustmentminute:asdasd
})
})
}
let columns=[{
title: '关卡',

Loading…
Cancel
Save