Merge branch 'dev_aliyun' into dev_daiao

dev_daiao
daiao 5 years ago
commit c4b010dd28

@ -33,10 +33,11 @@ class CoursesController < ApplicationController
before_action :teacher_allowed, only: [:update, :destroy, :settings, :search_teacher_candidate, before_action :teacher_allowed, only: [:update, :destroy, :settings, :search_teacher_candidate,
:transfer_to_course_group, :delete_from_course, :export_member_scores_excel, :transfer_to_course_group, :delete_from_course, :export_member_scores_excel,
:search_users, :add_students_by_search, :get_historical_courses, :add_teacher_popup, :search_users, :add_students_by_search, :get_historical_courses, :add_teacher_popup,
:add_teacher, :export_couser_info, :export_member_act_score] :add_teacher, :export_couser_info, :export_member_act_score,
:update_informs, :new_informs, :delete_informs]
before_action :admin_allowed, only: [:set_invite_code_halt, :set_public_or_private, :change_course_admin, before_action :admin_allowed, only: [:set_invite_code_halt, :set_public_or_private, :change_course_admin,
:set_course_group, :create_group_by_importing_file, :update_informs, :new_informs, :set_course_group, :create_group_by_importing_file,
:update_task_position, :tasks_list, :delete_informs] :update_task_position, :tasks_list]
before_action :teacher_or_admin_allowed, only: [:graduation_group_list, :create_graduation_group, :join_graduation_group, before_action :teacher_or_admin_allowed, only: [:graduation_group_list, :create_graduation_group, :join_graduation_group,
:change_course_teacher, :course_group_list, :change_course_teacher, :course_group_list,
:teacher_application_review, :apply_teachers, :delete_course_teacher] :teacher_application_review, :apply_teachers, :delete_course_teacher]

@ -541,6 +541,8 @@ class GamesController < ApplicationController
testSet << test_cases testSet << test_cases
end end
logger.info("##############testSet: #{testSet}")
testCases = Base64.urlsafe_encode64(testSet.to_json) unless testSet.blank? testCases = Base64.urlsafe_encode64(testSet.to_json) unless testSet.blank?
# 评测类型: 012 用于webssh的评测 3用于vnc # 评测类型: 012 用于webssh的评测 3用于vnc
podType = @shixun.vnc_evaluate ? 3 : @shixun.webssh podType = @shixun.vnc_evaluate ? 3 : @shixun.webssh
@ -562,9 +564,11 @@ class GamesController < ApplicationController
# 私密仓库的设置 # 私密仓库的设置
secret_rep = @shixun.shixun_secret_repository secret_rep = @shixun.shixun_secret_repository
logger.info("############secret_rep: #{secret_rep}")
if secret_rep&.repo_name if secret_rep&.repo_name
secretGitUrl = repo_url secret_rep.repo_path secretGitUrl = repo_url secret_rep.repo_path
br_params.merge({secretGitUrl: secretGitUrl, secretDir: secret_rep.secret_dir_path}) br_params.merge!({secretGitUrl: Base64.urlsafe_encode64(secretGitUrl), secretDir: secret_rep.secret_dir_path})
logger.info("#######br_params:#{br_params}")
end end
# 中间层交互 # 中间层交互

@ -109,8 +109,8 @@ class GraduationTopicsController < ApplicationController
@attachments = @graduation_topic.attachments @attachments = @graduation_topic.attachments
left_banner_content = @course.course_modules.search_by_module_type("graduation") left_banner_content = @course.course_modules.search_by_module_type("graduation")
if left_banner_content.present? if left_banner_content.present?
@left_banner_id = left_banner_content.first.course_second_categories.first.id @left_banner_id = left_banner_content.first.id
@left_banner_name = left_banner_content.first.course_second_categories.first.name @left_banner_name = "毕设选题"
end end
end end

@ -220,6 +220,16 @@ class ShixunsController < ApplicationController
evaluate_script: @shixun.evaluate_script) evaluate_script: @shixun.evaluate_script)
end end
# 同步私密版本库
if @shixun.shixun_secret_repository
repo_name = "#{current_user.login}/secret_#{@shixun.identifier}"
fork_repository_name = "#{current_user.login}/secret_#{@new_shixun.identifier}"
ShixunSecretRepository.create!(shixun_id: @new_shixun.id,
repo_name: "#{repo_name}",
secret_dir_path: @shixun.shixun_secret_repository.secret_dir_path)
GitService.fork_repository(repo_path: "#{repo_name}.git", fork_repository_path: (fork_repository_name + ".git"))
end
# 同步镜像 # 同步镜像
if @shixun.mirror_repositories.present? if @shixun.mirror_repositories.present?
@shixun.mirror_repositories.each do |mirror| @shixun.mirror_repositories.each do |mirror|
@ -479,6 +489,7 @@ class ShixunsController < ApplicationController
else else
# 如果有仓库,就要删 # 如果有仓库,就要删
if @shixun.shixun_secret_repository&.repo_name if @shixun.shixun_secret_repository&.repo_name
@shixun.shixun_secret_repository.lock!
GitService.delete_repository(repo_path: @shixun.shixun_secret_repository.repo_path) GitService.delete_repository(repo_path: @shixun.shixun_secret_repository.repo_path)
@shixun.shixun_secret_repository.destroy @shixun.shixun_secret_repository.destroy
end end

@ -478,31 +478,31 @@ class StudentWorksController < ApplicationController
ActiveRecord::Base.transaction do ActiveRecord::Base.transaction do
challenge = @homework.shixuns.first&.challenges.find_by(id: params[:challenge_id]) unless params[:challenge_id].blank? challenge = @homework.shixuns.first&.challenges.find_by(id: params[:challenge_id]) unless params[:challenge_id].blank?
if challenge.present? 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) ShixunWorkComment.new(student_work_id: @work.id, user_id: current_user.id, challenge_id: challenge.id)
else 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) ShixunWorkComment.new(student_work_id: @work.id, user_id: current_user.id, challenge_id: 0)
end end
comment.comment = params[:comment] @comment.comment = params[:comment]
comment.hidden_comment = params[:hidden_comment] @comment.hidden_comment = params[:hidden_comment]
comment.save! @comment.save!
normal_status("评阅成功")
end end
end end
# 删除实训作品评阅 # 删除实训作品评阅
def destroy_work_comment def destroy_work_comment
ActiveRecord::Base.transaction do ActiveRecord::Base.transaction do
tip_exception("visible_comment参数有误") if params[:visible_comment].nil? # tip_exception("visible_comment参数有误") if params[:visible_comment].nil?
comment = @work.shixun_work_comments.find_by!(id: params[:comment_id]) comment = @work.shixun_work_comments.find_by!(id: params[:comment_id])
params[:visible_comment] ? comment.comment = nil : comment.hidden_comment = nil comment.destroy!
if comment.comment.nil? && comment.hidden_comment.nil? # params[:visible_comment] ? comment.comment = nil : comment.hidden_comment = nil
comment.destroy! # if comment.comment.nil? && comment.hidden_comment.nil?
else # comment.destroy!
comment.save! # else
end # comment.save!
# end
normal_status("删除成功") normal_status("删除成功")
end end
end end

@ -6,6 +6,12 @@ json.results do
json.title highlights.delete(:name)&.join('...') || obj.searchable_title json.title highlights.delete(:name)&.join('...') || obj.searchable_title
# json.description highlights.values[0,5].each { |arr| arr.is_a?(Array) ? arr.join('...') : arr }.join('<br/>') # json.description highlights.values[0,5].each { |arr| arr.is_a?(Array) ? arr.join('...') : arr }.join('<br/>')
# 去除开头标点符号
reg = /^[,。?:;‘’!“”—……、]/
highlights[:description]&.first&.sub!(reg, '')
highlights[:content]&.first&.sub!(reg, '')
json.content highlights json.content highlights
end end
end end

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

@ -38,7 +38,7 @@ if @shixun
json.game_score @work.work_challenge_score game, challenge_score json.game_score @work.work_challenge_score game, challenge_score
challenge_comment = @work.shixun_work_comments.find_by(challenge_id: game.challenge_id) challenge_comment = @work.shixun_work_comments.find_by(challenge_id: game.challenge_id)
json.challenge_comment challenge_comment&.comment json.challenge_comment challenge_comment&.comment
json.challenge_comment_hidden challenge_comment&.hidden_comment json.challenge_comment_hidden @user_course_identity < Course::STUDENT ? challenge_comment&.hidden_comment : nil
json.comment_id challenge_comment&.id json.comment_id challenge_comment&.id
end end
end end

@ -37,7 +37,7 @@ import {MuiThemeProvider, createMuiTheme} from 'material-ui/styles';
import history from './history'; import history from './history';
import {SnackbarHOC} from 'educoder' import {SnackbarHOC, configShareForIndex} from 'educoder'
import {initAxiosInterceptors} from './AppConfig' import {initAxiosInterceptors} from './AppConfig'
@ -326,22 +326,7 @@ class App extends Component {
}); });
wx.ready(function () { wx.ready(function () {
console.log('wx is ready') console.log('wx is ready')
var shareData = { configShareForIndex()
title: 'EduCoder - 首页',
desc: 'Educoder是一个面向计算机类的互联网IT教育和实战平台提供企业级工程实训以实现工程化专业教学的自动化和智能化。高校和企业人员可以在此开展计算机实践性教学活动将传统的知识传授和时兴的工程实战一体化。',
link: currentUrl,
imgUrl: window.__testImageUrl
|| (currentUrl.endsWith('/') ? currentUrl : currentUrl + '/') + 'react/build/images/share_logo_icon.jpg'
};
wx.onMenuShareAppMessage(shareData);//分享给好友
wx.onMenuShareTimeline(shareData);//分享到朋友圈
wx.onMenuShareQQ(shareData);//分享给手机QQ
wx.onMenuShareWeibo(shareData);//分享腾讯微博
wx.onMenuShareQZone(shareData);//分享到QQ空间
}); });
wx.error(function (res) { wx.error(function (res) {
console.log('wx is error') console.log('wx is error')

@ -20,7 +20,7 @@ export { markdownToHTML, uploadNameSizeSeperator, appendFileSizeToUploadFile, ap
downloadFile, sortDirections } from './TextUtil' downloadFile, sortDirections } from './TextUtil'
export { handleDateString, getNextHalfHourOfMoment,formatDuring } from './DateUtil' export { handleDateString, getNextHalfHourOfMoment,formatDuring } from './DateUtil'
export { configShareForIndex, configShareForPaths, configShareForShixuns, configShareForCourses, configShareForSinglePath, configShareForSingleShixun } from './util/ShareUtil' export { configShareForIndex, configShareForPaths, configShareForShixuns, configShareForCourses, configShareForCustom } from './util/ShareUtil'
export { isDev as isDev, isMobile } from './Env' export { isDev as isDev, isMobile } from './Env'

@ -1,12 +1,17 @@
const host = window.location.host const host = window.location.host
const wx = window.wx const wx = window.wx
function share(shareData) { function share(shareData) {
wx.onMenuShareAppMessage(shareData);//分享给好友 try {
wx.onMenuShareTimeline(shareData);//分享到朋友圈 wx.onMenuShareAppMessage(shareData);//分享给好友
wx.onMenuShareQQ(shareData);//分享给手机QQ wx.onMenuShareTimeline(shareData);//分享到朋友圈
wx.onMenuShareWeibo(shareData);//分享腾讯微博 wx.onMenuShareQQ(shareData);//分享给手机QQ
wx.onMenuShareQZone(shareData);//分享到QQ空间 wx.onMenuShareWeibo(shareData);//分享腾讯微博
wx.onMenuShareQZone(shareData);//分享到QQ空间
} catch(e) {
console.log(e)
}
} }
/** /**
实践课程 平台提供涵盖基础入门案例实践和创新应用的完整实训项目体系通过由浅入深的实训路径帮助学生快速提升实战能力 实践课程 平台提供涵盖基础入门案例实践和创新应用的完整实训项目体系通过由浅入深的实训路径帮助学生快速提升实战能力
实训项目 覆盖不同专业的IT实验和实训每周更新无需配置本机实验环境随时随地开启企业级真实实训 实训项目 覆盖不同专业的IT实验和实训每周更新无需配置本机实验环境随时随地开启企业级真实实训
@ -15,6 +20,7 @@ function share(shareData) {
*/ */
export function configShareForIndex () { export function configShareForIndex () {
if (!wx) return;
var shareData = { var shareData = {
title: 'EduCoder - 首页', title: 'EduCoder - 首页',
desc: 'Educoder是一个面向计算机类的互联网IT教育和实战平台提供企业级工程实训以实现工程化专业教学的自动化和智能化。高校和企业人员可以在此开展计算机实践性教学活动将传统的知识传授和时兴的工程实战一体化。', desc: 'Educoder是一个面向计算机类的互联网IT教育和实战平台提供企业级工程实训以实现工程化专业教学的自动化和智能化。高校和企业人员可以在此开展计算机实践性教学活动将传统的知识传授和时兴的工程实战一体化。',
@ -25,6 +31,7 @@ export function configShareForIndex () {
share(shareData) share(shareData)
} }
export function configShareForPaths () { export function configShareForPaths () {
if (!wx) return;
var shareData = { var shareData = {
title: 'EduCoder - 实践课程', title: 'EduCoder - 实践课程',
desc: '平台提供涵盖基础入门、案例实践和创新应用的完整实训项目体系,通过由浅入深的实训路径,帮助学生快速提升实战能力。', desc: '平台提供涵盖基础入门、案例实践和创新应用的完整实训项目体系,通过由浅入深的实训路径,帮助学生快速提升实战能力。',
@ -35,6 +42,7 @@ export function configShareForPaths () {
share(shareData) share(shareData)
} }
export function configShareForShixuns () { export function configShareForShixuns () {
if (!wx) return;
var shareData = { var shareData = {
title: 'EduCoder - 实训项目', title: 'EduCoder - 实训项目',
desc: '覆盖不同专业的IT实验和实训每周更新无需配置本机实验环境随时随地开启企业级真实实训。', desc: '覆盖不同专业的IT实验和实训每周更新无需配置本机实验环境随时随地开启企业级真实实训。',
@ -45,6 +53,7 @@ export function configShareForShixuns () {
share(shareData) share(shareData)
} }
export function configShareForCourses () { export function configShareForCourses () {
if (!wx) return;
var shareData = { var shareData = {
title: 'EduCoder - 翻转课堂', title: 'EduCoder - 翻转课堂',
desc: '自动评测实训任务,支持技能统计,提供教学活动分析报告,减轻教师和助教的辅导压力,免去作业发布和批改的困扰,实时了解学生学习情况,全面提升教师施教效率和水平。', desc: '自动评测实训任务,支持技能统计,提供教学活动分析报告,减轻教师和助教的辅导压力,免去作业发布和批改的困扰,实时了解学生学习情况,全面提升教师施教效率和水平。',
@ -56,7 +65,8 @@ export function configShareForCourses () {
} }
// detail // detail
export function configShareForSinglePath (title, desc, path, imgUrl) { export function configShareForCustom (title, desc, path, imgUrl) {
if (!wx) return;
var shareData = { var shareData = {
title: title, title: title,
desc: desc, desc: desc,
@ -66,14 +76,3 @@ export function configShareForSinglePath (title, desc, path, imgUrl) {
}; };
share(shareData) share(shareData)
} }
export function configShareForSingleShixun (title, desc, path, imgUrl) {
var shareData = {
title: title,
desc: desc,
link: `${host}/${path}`,
imgUrl: imgUrl || window.__testImageUrl
|| host + '/react/build/images/share_logo_icon.jpg'
};
share(shareData)
}

@ -391,7 +391,7 @@ class CommonWorkDetailIndex extends Component{
{ work_statuses && work_statuses.indexOf('补交作品') != -1 && { work_statuses && work_statuses.indexOf('补交作品') != -1 &&
<a className={"fr color-blue font-16"} href={"javascript:void(0)"} <a className={"fr color-blue font-16"} href={"javascript:void(0)"}
onClick={() => { this.props.toWorkPostPage(this.props.match.params, null, true, work_id)}}> onClick={() => { this.props.toWorkPostPage(this.props.match.params)}}>
补交作品</a> } 补交作品</a> }
{work_statuses && work_statuses.indexOf('修改作品') != -1 && <a className={"fr color-blue font-16"} href={"javascript:void(0)"} {work_statuses && work_statuses.indexOf('修改作品') != -1 && <a className={"fr color-blue font-16"} href={"javascript:void(0)"}

@ -10,7 +10,6 @@ class AppraiseModal extends Component{
group_ids:[], group_ids:[],
fileList:[], fileList:[],
Inputsval:undefined, Inputsval:undefined,
valuetype:0,
textareavaltype:false, textareavaltype:false,
comment:undefined, comment:undefined,
hidden_comment:undefined hidden_comment:undefined
@ -18,11 +17,23 @@ class AppraiseModal extends Component{
} }
componentDidMount() { componentDidMount() {
let{data,work_comment,work_comment_hidden}=this.props;
this.setState({
valuetype:this.props.work_type===undefined?0:this.props.work_type, if(this.props.showAppraisetype==="child"){
textareaval:this.props.work_comment, data.stage_list.map((item,key)=>{
}) if(this.props.challenge_id===item.challenge_id){
this.setState({
comment:item.challenge_comment,
hidden_comment:item.challenge_comment_hidden,
})
}
})
}else{
this.setState({
comment:work_comment,
hidden_comment:work_comment_hidden,
})
}
} }
@ -38,11 +49,10 @@ class AppraiseModal extends Component{
}) })
} }
Saves=()=>{ Saves=()=>{
let{textareaval,valuetype,comment,hidden_comment}=this.state; let{comment,hidden_comment}=this.state;
let commenttype=comment===undefined||comment===null||comment===""; let commenttype=comment===undefined||comment===null||comment==="";
let hidden_commenttype=hidden_comment===undefined||hidden_comment===null||hidden_comment===""; let hidden_commenttype=hidden_comment===undefined||hidden_comment===null||hidden_comment==="";
if(commenttype===true&&hidden_commenttype===true){ if(commenttype===true&&hidden_commenttype===true){
this.setState({ this.setState({
textareavaltype:true textareavaltype:true
@ -50,20 +60,20 @@ class AppraiseModal extends Component{
return return
} }
//comment 是 text 可见的评阅内容 //comment 是 text 可见的评阅内容
// hidden_comment 是 text 不可见的评阅内容 // hidden_comment 是 text 不可见的评阅内容
// challenge_id 否 int 关卡id关卡评阅才需传关卡id // challenge_id 否 int 关卡id关卡评阅才需传关卡id
let challenge_id=this.props.showAppraisetype==="child"?this.props.challenge_id:undefined
let url=`/student_works/${this.props.match.params.homeworkid}/shixun_work_comment.json` let url=`/student_works/${this.props.match.params.homeworkid}/shixun_work_comment.json`
axios.post(url, { axios.post(url, {
comment:textareaval, comment:comment,
hidden_comment:valuetype hidden_comment:hidden_comment,
challenge_id:challenge_id
}).then((response) => { }).then((response) => {
if(response.data.status===0){ if(response.data.status===0){
this.props.showCancel(comment,hidden_comment,challenge_id,response.data.comment_id)
this.props.showNotification(response.data.message) this.props.showNotification(response.data.message)
this.props.showCancel(textareaval,valuetype)
}else{ }else{
this.props.showNotification(response.data.message) this.props.showNotification(response.data.message)
} }

@ -0,0 +1,49 @@
.maxnamewidth100{
max-width: 100px;
overflow:hidden;
text-overflow:ellipsis;
white-space:nowrap;
cursor: default;
}
.maxnamewidth110{
max-width: 100px;
overflow:hidden;
text-overflow:ellipsis;
white-space:nowrap;
cursor: default;
}
.maxnamewidth200{
max-width: 200px;
overflow:hidden;
text-overflow:ellipsis;
white-space:nowrap;
cursor: default;
}
.maxnamewidth145{
max-width: 145px;
overflow:hidden;
text-overflow:ellipsis;
white-space:nowrap;
cursor: default;
}
.maxnamewidth215{
max-width: 215px;
overflow:hidden;
text-overflow:ellipsis;
white-space:nowrap;
cursor: default;
}
.maxnamewidth255{
max-width: 255px;
overflow:hidden;
text-overflow:ellipsis;
white-space:nowrap;
cursor: default;
}
.maxnamewidth175{
max-width: 175px;
overflow:hidden;
text-overflow:ellipsis;
white-space:nowrap;
cursor: default;
}

@ -241,7 +241,7 @@ class Bullsubdirectory extends Component{
<div> <div>
<span className="fr yslbianji" style={{marginRight:"17px"}}> <span className="fr yslbianji" style={{marginRight:"17px"}}>
{ {
this.props.isClassManagement() === true ? this.props.isAdmin() === true ?
(this.props.yslbool===false? (this.props.yslbool===false?
<Tooltip placement="bottom" title={<div> <Tooltip placement="bottom" title={<div>
编辑 编辑
@ -256,7 +256,7 @@ class Bullsubdirectory extends Component{
</span> </span>
<span className="fr yslbianji" style={{marginRight:"22px"}}> <span className="fr yslbianji" style={{marginRight:"22px"}}>
{ {
this.props.isClassManagement() === true ? this.props.isAdmin() === true ?
(this.props.yslbool===false? (this.props.yslbool===false?
<Tooltip placement="bottom" title={<div> <Tooltip placement="bottom" title={<div>
删除 删除

@ -231,7 +231,7 @@ class Eduinforms extends Component{
<p style={{height: '20px'}}> <p style={{height: '20px'}}>
<span className="font-18 fl color-dark-21">公告栏</span> <span className="font-18 fl color-dark-21">公告栏</span>
{ {
this.props.isClassManagement()===true? this.props.isAdmin()===true?
(this.state.yslbool===false? (this.state.yslbool===false?
<li className="btn colorblue font-16 fr bluebkbk pointer" <li className="btn colorblue font-16 fr bluebkbk pointer"
onClick={() => this.bianji(true)}> onClick={() => this.bianji(true)}>

@ -11,6 +11,7 @@ import Coursesshixundetails from './shixunreport/Coursesshixundetails';
import Shixunechart from './shixunreport/Shixunechart'; import Shixunechart from './shixunreport/Shixunechart';
import DownloadMessageysl from "../../modals/DownloadMessageysl" import DownloadMessageysl from "../../modals/DownloadMessageysl"
import AppraiseModal from "../coursesPublic/AppraiseModal"; import AppraiseModal from "../coursesPublic/AppraiseModal";
import ShowAppraiseList from './ShowAppraiseList';
import {UnControlled as CodeMirror} from 'react-codemirror2'; import {UnControlled as CodeMirror} from 'react-codemirror2';
import 'codemirror/mode/cmake/cmake'; import 'codemirror/mode/cmake/cmake';
import 'codemirror/mode/xml/xml'; import 'codemirror/mode/xml/xml';
@ -34,9 +35,8 @@ class ShixunWorkReport extends Component {
DownloadMessageval:undefined, DownloadMessageval:undefined,
isspinning:false, isspinning:false,
showAppraiseModaltype:false, showAppraiseModaltype:false,
work_comment_hidden:false, work_comment_hidden:undefined,
showAppraiseModalsshow:true, work_comment:undefined,
work_comment:null
} }
} }
@ -102,7 +102,7 @@ class ShixunWorkReport extends Component {
let homeworkid=this.props.match.params.homeworkid; let homeworkid=this.props.match.params.homeworkid;
let url = `/student_works/${homeworkid}/shixun_work_report.json` let url = `/student_works/${homeworkid}/shixun_work_report.json`
axios.get(url).then((result) => { axios.get(url).then((result) => {
if (result.data.status === 403||result.data.status === 401||result.data.status === 407||result.data.status === 408||result.data.status === 409) { if (result.data.status === 403 || result.data.status === 401 || result.data.status === 407 || result.data.status === 408|| result.data.status === 409 || result.data.status === 500) {
}else{ }else{
this.setState({ this.setState({
@ -155,86 +155,153 @@ class ShixunWorkReport extends Component {
}) })
} }
showAppraiseModal=(type,id)=>{ showAppraiseModal=(type,id,show,hidden)=>{
let{data}=this.state;
if(type==="child"){ if(type==="child"){
data.stage_list.forEach((item,key)=>{
if(item.challenge_id===id){
item.challenge_comment=show;
item.challenge_comment_hidden=hidden;
}
})
this.setState({ this.setState({
showAppraiseModaltype:true,
showAppraisetype:type, showAppraisetype:type,
challenge_id:id challenge_id:id,
data:data
}) })
}else{ }else{
this.setState({ this.setState({
showAppraiseModaltype:true,
showAppraisetype:type, showAppraisetype:type,
challenge_id:undefined challenge_id:undefined,
work_comment:show,
work_comment_hidden:hidden
}) })
} }
let{work_comment,work_comment_hidden}=this.state;
this.setState({
showAppraiseModaltype:true,
work_comment_hidden:work_comment===null||work_comment===undefined?this.state.work_type?true:false:work_comment_hidden,
})
} }
hideAppraiseModal=()=>{ hideAppraiseModal=()=>{
let{work_comment,work_comment_hidden}=this.state;
this.setState({ this.setState({
showAppraiseModaltype:false, showAppraiseModaltype:false,
work_comment_hidden:work_comment===null||work_comment===undefined?this.state.work_type===1?true:false:work_comment_hidden,
}) })
} }
showAppraiseModals=(list,type)=>{ showAppraiseModals=(show,hidden,id,comment_id)=>{
let{data,showAppraisetype}=this.state;
if(showAppraisetype==="child"){
data.stage_list.forEach((item,key)=>{
if(item.challenge_id===id){
item.challenge_comment=show;
item.challenge_comment_hidden=hidden;
item.comment_id=comment_id
}
})
this.setState({
showAppraiseModaltype:false,
data:data
})
}else{
data.comment_id=comment_id;
this.setState({
showAppraiseModaltype:false,
work_comment:show,
work_comment_hidden:hidden,
data:data
})
}
this.setState({
showAppraiseModaltype:false,
work_comment_hidden:type===0?false:true,
work_comment:list,
work_type:type,
showAppraiseModals:true,
showAppraiseModalsshow:true,
})
} }
isdeleteModal=()=>{ isdeleteModal=(comment_id,visible_comment,type)=>{
let newcomment_id=comment_id;
let newvisible_comment=visible_comment;
let newtype=type;
this.setState({ this.setState({
modalsType: true, modalsType: true,
modalsTopval:"是否确认删除?", modalsTopval:"是否确认删除?",
modalSave: ()=>this.isdeleteModals(), modalSave: ()=>this.isdeleteModals(newcomment_id,newvisible_comment,newtype),
modalCancel:()=>this.hideisdeleteModal(), modalCancel:()=>this.hideisdeleteModals(),
}) })
} }
hideisdeleteModal=()=>{ hideisdeleteModals=()=>{
this.setState({ this.setState({
modalsType: false, modalsType:false,
modalsTopval:"是否确认删除?", modalsTopval:"是否确认删除?",
modalSave: ()=>this.isdeleteModals(), modalSave: "",
modalCancel:()=>this.hideisdeleteModal(), modalCancel:"",
}) })
} }
isdeleteModals=()=>{
let url =`/student_works/${this.props.match.params.homeworkid}/destroy_work_comment.json` hideisdeleteModal=(comment_id,visible_comment,type)=>{
axios.delete(url).then((response) => {
// const { status } = response.data;
if(response.data.status===0){ let{data,work_comment,work_comment_hidden}=this.state;
this.props.showNotification(response.data.message)
this.setState({ if(type==="child"){
showAppraiseModalsshow:false, data.stage_list.map((item,key)=>{
work_comment_hidden:false, console.log(item)
work_comment:undefined, if(item.comment_id!=null){
work_type:0, if(item.comment_id===comment_id){
}) item.challenge_comment=null;
this.hideisdeleteModal() item.challenge_comment_hidden=null;
}else{ }
this.props.showNotification(response.data.message)
} }
}) })
.catch(function (error) {
console.log(error); this.setState({
}); modalsType:false,
modalsTopval:"是否确认删除?",
modalSave: "",
modalCancel:"",
data:data
})
}else{
this.setState({
modalsType:false,
modalsTopval:"是否确认删除?",
modalSave: "",
modalCancel:"",
work_comment:null,
work_comment_hidden:null
})
}
}
isdeleteModals=(comment_id,visible_comment,type)=>{
let newcomment_id=comment_id;
let newvisible_comment=visible_comment;
let newtype=type;
if(comment_id!=null){
let url =`/student_works/${this.props.match.params.homeworkid}/destroy_work_comment.json`
axios.delete(url, { data: {
comment_id:comment_id,
}}).then((response) => {
// const { status } = response.data;
if(response.data.status===0){
this.props.showNotification(response.data.message)
this.hideisdeleteModal(newcomment_id,newvisible_comment,newtype)
}else{
this.props.showNotification(response.data.message)
}
})
.catch(function (error) {
console.log(error);
});
}
} }
render() { render() {
let{data,showAppraiseModaltype,work_comment_hidden,showAppraiseModalsshow,work_comment} =this.state; let{data,showAppraiseModaltype,work_comment_hidden,work_comment} =this.state;
let category_id=data===undefined?"":data.category===null?"":data.category.category_id; let category_id=data===undefined?"":data.category===null?"":data.category.category_id;
let homework_common_id=data===undefined?"":data.homework_common_id; let homework_common_id=data===undefined?"":data.homework_common_id;
@ -243,7 +310,7 @@ class ShixunWorkReport extends Component {
// let showAppraiseModals=this.props&&this.props.isAdminOrTeacher()===true?work_comment===null||work_comment===undefined?false:true:work_comment===null||work_comment===undefined?false:true; // let showAppraiseModals=this.props&&this.props.isAdminOrTeacher()===true?work_comment===null||work_comment===undefined?false:true:work_comment===null||work_comment===undefined?false:true;
let showAppraiseModals=work_comment===null||work_comment===undefined?false:true; let showAppraiseModals=work_comment===null||work_comment===undefined?false:true;
console.log(showAppraiseModals)
return ( return (
data===undefined?"":<Spin indicator={antIcon} spinning={this.state.spinning}> data===undefined?"":<Spin indicator={antIcon} spinning={this.state.spinning}>
@ -262,10 +329,12 @@ class ShixunWorkReport extends Component {
{...this.state} {...this.state}
visible={showAppraiseModaltype} visible={showAppraiseModaltype}
Cancel={()=>this.hideAppraiseModal()} Cancel={()=>this.hideAppraiseModal()}
showCancel={(list,type)=>this.showAppraiseModals(list,type)} showCancel={(show,hidden,id,comment_id)=>this.showAppraiseModals(show,hidden,id,comment_id)}
work_comment={this.state.work_comment} work_comment={this.state.work_comment}
work_type={work_comment===null||work_comment===undefined?this.state.work_type:work_comment_hidden===true?1:0} work_type={work_comment===null||work_comment===undefined?this.state.work_type:work_comment_hidden===true?1:0}
/>:""} />:""}
<div className="newMain clearfix "> <div className="newMain clearfix ">
<div className={"educontent mb20" }> <div className={"educontent mb20" }>
<div className="educontent"> <div className="educontent">
@ -303,9 +372,11 @@ class ShixunWorkReport extends Component {
{/*>评阅</a> : ""}*/} {/*>评阅</a> : ""}*/}
{this.props.isAdmin() ?<a {this.props.isAdmin() ?<a
className=" color-blue font-14 fr ml20 mt15" className=" color-blue font-14 fr ml20 mt15"
onClick={()=>this.showAppraiseModal("main")} onClick={()=>this.showAppraiseModal("main",undefined,work_comment,work_comment_hidden)}
>评阅</a>:""} >评阅</a>:""}
</div> </div>
{/*{work_comment===null||work_comment===undefined?"评阅":"编辑评阅"}*/} {/*{work_comment===null||work_comment===undefined?"评阅":"编辑评阅"}*/}
<style>{ <style>{
` `
@ -425,7 +496,7 @@ class ShixunWorkReport extends Component {
jumptopic={this.jumptopic} jumptopic={this.jumptopic}
getdatalist={()=>this.getdatalist()} getdatalist={()=>this.getdatalist()}
setupdalist={(challenge_score,overall_appraisal,work_score)=>this.setupdalist(challenge_score,overall_appraisal,work_score)} setupdalist={(challenge_score,overall_appraisal,work_score)=>this.setupdalist(challenge_score,overall_appraisal,work_score)}
showAppraiseModal={(type,id)=>this.showAppraiseModal(type,id)} showAppraiseModal={(type,id,show,hidden)=>this.showAppraiseModal(type,id,show,hidden)}
/> />
</div> </div>
@ -477,33 +548,12 @@ class ShixunWorkReport extends Component {
</div> </div>
{showAppraiseModals===true&&showAppraiseModalsshow===true?<div className="stud-class-set mt17"> <ShowAppraiseList
<div className="clearfix edu-back-white poll_list"> {...this.props}
{...this.state}
<div className="font-16 color-dark-21 shixunreporttitleboxtop pd20 color333"> isdeleteModal={(comment_id,visible_comment,type)=>this.isdeleteModal(comment_id,visible_comment,type)}
老师评阅<span>{work_comment_hidden===true||this.state.work_type===1?"(仅对课堂老师可见)":""}</span> showAppraiseModal={(type,id,show,hidden)=>this.showAppraiseModal(type,id,show,hidden)}
/>
{this.props&&this.props.isAdminOrTeacher()===true?<a className="color-blue font-14 fr ml20"
onClick={()=>this.isdeleteModal()}
>删除</a>:""}
{this.props&&this.props.isAdminOrTeacher()===true?<a className="color-blue font-14 fr"
onClick={()=>this.showAppraiseModal("main")}
>编辑</a>:""}
</div>
<div className="font-16 color-dark-21 shixunreporttitleboxbom pd30">
<div style={{minHeight:'50px'}}>
<div className={"personalsummary"}>
<div className={"markdown-body"}
dangerouslySetInnerHTML={{__html: markdownToHTML(work_comment).replace(/▁/g, "▁▁▁")}}></div>
</div>
</div>
</div>
</div>
</div>:""}
<div className="stud-class-set bor-bottom-greyE mt17"> <div className="stud-class-set bor-bottom-greyE mt17">

@ -0,0 +1,176 @@
import React,{ Component } from "react";
import { Modal,Checkbox,Upload,Button,Icon,message,Input,Radio} from "antd";
import { WordNumberTextarea,markdownToHTML } from 'educoder';
import axios from 'axios';
import './style.css';
class ShowAppraiseList extends Component{
constructor(props){
super(props);
this.state={
}
}
render(){
let {data, work_comment,work_comment_hidden}=this.props;
let work_commenttype=work_comment===undefined||work_comment===null||work_comment==="";
let work_comment_hiddentype=work_comment_hidden===undefined||work_comment_hidden===null||work_comment_hidden==="";
return(
<div>
<style>
{
`
.appraisebox{
width: 65px;
height: 22px;
background: rgba(76,172,255,1);
border-radius: 2px;
display: inline-block;
margin-right: 20px;
color: #fff;
font-size: 14px;
text-align: center;
line-height: 22px;
}
.markdown-body{
padding-bottom: 10px;
}
.borderbom{
margin-bottom: 15px;
border-bottom: 2px solid #fafafa;
}
`
}
</style>
{data===undefined?"":work_commenttype===true&&work_comment_hiddentype===true?"":
<div className="stud-class-set mt17">
<div className="clearfix edu-back-white poll_list">
<div className="font-16 color-dark-21 shixunreporttitleboxtop pd20 color333">
<span className={"appraisebox"}>总体评阅</span>
{this.props&&this.props.isAdmin()===true?<a className="color-blue font-14 fr ml20"
onClick={()=>this.props.isdeleteModal(data.comment_id,true,"main")}
>删除</a>:""}
{this.props&&this.props.isAdmin()===true?<a className="color-blue font-14 fr"
onClick={()=>this.props.showAppraiseModal("main",undefined,work_comment,work_comment_hidden)}
>编辑</a>:""}
</div>
{this.props&&this.props.isAdmin()===true?
<div className="font-16 color-dark-21 shixunreporttitleboxbom pd30bt">
{work_commenttype===true?"":<div>
<span className={"z000"}>学生可见<span className={"z666"}>学生可查看老师的评阅内容</span></span>
</div>}
{work_commenttype===true?"":<div className={work_comment_hiddentype===true?"":"borderbom"} style={{minHeight:'40px'}}>
<div className={"personalsummary"}>
<div className={"markdown-body"}
dangerouslySetInnerHTML={{__html: markdownToHTML(work_comment).replace(/▁/g, "▁▁▁")}}></div>
</div>
</div>}
{work_comment_hiddentype===true?"":<div>
<span className={"z000"}>学生不可见<span className={"z666"}>仅对课堂老师可见</span></span>
</div>}
{work_comment_hiddentype===true?"":<div style={{minHeight:'40px'}}>
<div className={"personalsummary"}>
<div className={"markdown-body"}
dangerouslySetInnerHTML={{__html: markdownToHTML(work_comment_hidden).replace(/▁/g, "▁▁▁")}}></div>
</div>
</div>}
</div>:<div className="font-16 color-dark-21 shixunreporttitleboxbom pd30">
<div style={{minHeight:'40px'}}>
<div className={"personalsummary"}>
<div className={"markdown-body"}
dangerouslySetInnerHTML={{__html: markdownToHTML(work_comment).replace(/▁/g, "▁▁▁")}}></div>
</div>
</div>
</div>}
</div>
</div>}
{data===undefined?"":data.stage_list.map((item,key)=>{
let challenge_comment_hidden=item.challenge_comment_hidden===undefined||item.challenge_comment_hidden===null||item.challenge_comment_hidden==="";
let challenge_comment=item.challenge_comment===undefined||item.challenge_comment===null||item.challenge_comment==="";
return(
<div key={key}>
{challenge_comment===false||challenge_comment_hidden==false?<div className="stud-class-set mt17" >
<div className="clearfix edu-back-white poll_list">
<div className="font-16 color-dark-21 shixunreporttitleboxtop pd20 color333">
<span className={"appraisebox"}>{key+1}</span>{item.name}
{this.props&&this.props.isAdmin()===true?<a className="color-blue font-14 fr ml20"
onClick={()=>this.props.isdeleteModal(item.comment_id,true,"child")}
>删除</a>:""}
{this.props&&this.props.isAdmin()===true?<a className="color-blue font-14 fr"
onClick={()=>this.props.showAppraiseModal("child",item.challenge_id,item.challenge_comment,item.challenge_comment_hidden)}
>编辑</a>:""}
</div>
{this.props&&this.props.isAdmin()===true?
<div className="font-16 color-dark-21 shixunreporttitleboxbom pd30bt">
{challenge_comment===true?"":<div>
<span className={"z000"}>学生可见<span className={"z666"}>学生可查看老师的评阅内容</span></span>
</div>}
{challenge_comment===true?"":<div className={challenge_comment_hidden===true?"":"borderbom"} style={{minHeight:'40px'}}>
<div className={"personalsummary"}>
<div className={"markdown-body"}
dangerouslySetInnerHTML={{__html: markdownToHTML(item.challenge_comment).replace(/▁/g, "▁▁▁")}}></div>
</div>
</div>}
{challenge_comment_hidden===true?"":<div>
<span className={"z000"}>学生不可见<span className={"z666"}>仅对课堂老师可见</span></span>
</div>}
{challenge_comment_hidden===true?"":<div style={{minHeight:'40px'}}>
<div className={"personalsummary"}>
<div className={"markdown-body"}
dangerouslySetInnerHTML={{__html: markdownToHTML(item.challenge_comment_hidden).replace(/▁/g, "▁▁▁")}}></div>
</div>
</div>}
</div>: <div className="font-16 color-dark-21 shixunreporttitleboxbom pd30">
<div style={{minHeight:'40px'}}>
<div className={"personalsummary"}>
<div className={"markdown-body"}
dangerouslySetInnerHTML={{__html: markdownToHTML(item.challenge_comment).replace(/▁/g, "▁▁▁")}}></div>
</div>
</div>
</div>}
</div>
</div>:""}
</div>)
})
}
</div>
)
}
}
export default ShowAppraiseList;

@ -15,31 +15,7 @@ class OfficialAcademicTranscript extends Component {
} }
componentDidMount() { 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)=>{ myjumptopic=(e)=>{
console.log("获取到值"); console.log("获取到值");
@ -98,7 +74,28 @@ class OfficialAcademicTranscript extends Component {
} }
render() { 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=[{ let columns=[{
title: '关卡', title: '关卡',
@ -207,7 +204,7 @@ class OfficialAcademicTranscript extends Component {
render: (text, record) => ( render: (text, record) => (
<span> <span>
{console.log(record)}
<a <a
className=" color-blue font-14 fr mr22" className=" color-blue font-14 fr mr22"
onClick={()=>this.props.showAppraiseModal("child",record.challenge_id.id,record.challenge_comment,record.challenge_comment_hidden)} onClick={()=>this.props.showAppraiseModal("child",record.challenge_id.id,record.challenge_comment,record.challenge_comment_hidden)}

@ -38,13 +38,34 @@
.TopicDetailTable .bottomBody li:last-child{border-bottom: none;} .TopicDetailTable .bottomBody li:last-child{border-bottom: none;}
.maxnamewidth100{ .maxnamewidth100{
max-width: 145px; max-width: 100px;
overflow:hidden; overflow:hidden;
text-overflow:ellipsis; text-overflow:ellipsis;
white-space:nowrap; white-space:nowrap;
cursor: default; cursor: default;
} }
.maxnamewidth110{ .maxnamewidth110{
max-width: 100px;
overflow:hidden;
text-overflow:ellipsis;
white-space:nowrap;
cursor: default;
}
.maxnamewidth200{
max-width: 200px;
overflow:hidden;
text-overflow:ellipsis;
white-space:nowrap;
cursor: default;
}
.maxnamewidth145{
max-width: 145px;
overflow:hidden;
text-overflow:ellipsis;
white-space:nowrap;
cursor: default;
}
.maxnamewidth145{
max-width: 145px; max-width: 145px;
overflow:hidden; overflow:hidden;
text-overflow:ellipsis; text-overflow:ellipsis;
@ -53,4 +74,17 @@
} }
.ysyslxh{ .ysyslxh{
background: #fafafa; background: #fafafa;
}
.z666{
color: #666;
font-size:14px;
}
.z000{
color: #000;
font-size:16px;
}
.pd30bt{
padding: 10px 30px 0px 30px;
} }

@ -12,7 +12,7 @@ import SiderBar from '../tpm/SiderBar';
import UpgradeModals from '../modals/UpgradeModals'; import UpgradeModals from '../modals/UpgradeModals';
import { SnackbarHOC , getImageUrl} from 'educoder'; import { SnackbarHOC , getImageUrl, configShareForIndex} from 'educoder';
import Slider from '@icedesign/base/lib/slider'; import Slider from '@icedesign/base/lib/slider';
@ -37,6 +37,7 @@ class ShixunsHome extends Component {
} }
} }
componentDidMount(){ componentDidMount(){
configShareForIndex()
const upsystem=`/users/system_update.json`; const upsystem=`/users/system_update.json`;
axios.get(upsystem).then((response)=>{ axios.get(upsystem).then((response)=>{
let updata=response.data; let updata=response.data;

@ -144,6 +144,11 @@ class VNCContainer extends Component {
.codeEvaluateDrawer .ant-drawer-body { .codeEvaluateDrawer .ant-drawer-body {
padding: 0px; padding: 0px;
} }
.codeEvaluateDrawer .ant-drawer-content-wrapper, .codeEvaluateDrawer .ant-drawer-mask {
position: absolute;
}
.codeEvaluateFloatButton { .codeEvaluateFloatButton {
bottom: 180px !important; bottom: 180px !important;
left: unset; left: unset;
@ -211,7 +216,7 @@ class VNCContainer extends Component {
mask={true} mask={true}
title="" title=""
width={firstDrawerWidth} width={firstDrawerWidth}
// closable={false} closable={false}
onClose={this.onBottomDrawerClose} onClose={this.onBottomDrawerClose}
visible={this.state.bottomDrawer} visible={this.state.bottomDrawer}
className={'codeEvaluateDrawer'} className={'codeEvaluateDrawer'}

@ -14,24 +14,24 @@ import TPMRightSection from "../../tpm/component/TPMRightSection";
import styled from "styled-components"; import styled from "styled-components";
const getItemStyle = (isDragging, draggableStyle) => ({ const getItemStyle = (isDragging, draggableStyle) => ({
// change background colour if dragging // change background colour if dragging
background: isDragging ? '#dceeff' : '', background: isDragging ? '#dceeff' : '',
// styles we need to apply on draggables // styles we need to apply on draggables
...draggableStyle, ...draggableStyle,
}); });
const getItems = count => const getItems = count =>
Array.from({ length: count }, (v, k) => k).map(k => ({ Array.from({ length: count }, (v, k) => k).map(k => ({
id: `item-${k}`, id: `item-${k}`,
content: `item ${k}` content: `item ${k}`
})); }));
// a little function to help us with reordering the result // a little function to help us with reordering the result
const reorder = (list, startIndex, endIndex) => { const reorder = (list, startIndex, endIndex) => {
const result = Array.from(list); const result = Array.from(list);
const [removed] = result.splice(startIndex, 1); const [removed] = result.splice(startIndex, 1);
result.splice(endIndex, 0, removed); result.splice(endIndex, 0, removed);
return result; return result;
}; };
const List = styled.div` const List = styled.div`
@ -66,90 +66,90 @@ const DragHandle = styled.div`
`; `;
const $ =window.$ const $ =window.$
class PathDetailIndex extends Component{ class PathDetailIndex extends Component{
constructor(props){ constructor(props){
super(props) super(props)
this.state={ this.state={
progress:undefined, progress:undefined,
tags:undefined, tags:undefined,
members:undefined, members:undefined,
detailInfoList:undefined, detailInfoList:undefined,
clickdetailInfoListtype:false, clickdetailInfoListtype:false,
Modalstype:false, Modalstype:false,
Modalstopval:undefined, Modalstopval:undefined,
Modalsbottomval:undefined, Modalsbottomval:undefined,
cardsModalcancel:this.cardsModalcancel, cardsModalcancel:this.cardsModalcancel,
cardsModalsave:this.cardsModalsave, cardsModalsave:this.cardsModalsave,
user_id:undefined, user_id:undefined,
loadtype:false, loadtype:false,
courses:undefined, courses:undefined,
items: getItems(10), items: getItems(10),
pathtopskey:1 pathtopskey:1
} }
this.onDragEnd = this.onDragEnd.bind(this); this.onDragEnd = this.onDragEnd.bind(this);
} }
onDragEnd(result) { onDragEnd(result) {
// dropped outside the list // dropped outside the list
if (!result.destination) { if (!result.destination) {
return; return;
} }
try { try {
}catch (e) { }catch (e) {
} }
const items = reorder( const items = reorder(
this.state.members, this.state.members,
result.source.index, result.source.index,
result.destination.index result.destination.index
); );
this.setState({ this.setState({
detailInfoList:this.state.detailInfoList, detailInfoList:this.state.detailInfoList,
members:items, members:items,
items items
}); });
console.log(this.state.members) console.log(this.state.members)
console.log("items 数组数组数组数组") console.log("items 数组数组数组数组")
console.log(items) console.log(items)
} }
cardsModalcancel=()=>{ cardsModalcancel=()=>{
this.setState({ this.setState({
Modalstype:false, Modalstype:false,
}) })
// TODO 这个是临时处理,还需要优化,这里要看怎么区分处理 // TODO 这个是临时处理,还需要优化,这里要看怎么区分处理
if (this.state.Modalstopval == '你确定要删除该成员吗?') { if (this.state.Modalstopval == '你确定要删除该成员吗?') {
return; return;
} }
this.props.history.goBack() this.props.history.goBack()
} }
cardsModalsave=()=>{ cardsModalsave=()=>{
this.setState({ this.setState({
Modalstype:false, Modalstype:false,
}) })
this.props.history.goBack() this.props.history.goBack()
} }
// 加载markdown // 加载markdown
updatamakedown=(id)=>{ updatamakedown=(id)=>{
setTimeout(()=>{ setTimeout(()=>{
var shixunDescr = window.editormd.markdownToHTML(id, { var shixunDescr = window.editormd.markdownToHTML(id, {
htmlDecode: "style,script,iframe", htmlDecode: "style,script,iframe",
taskList: true, taskList: true,
tex: true, tex: true,
flowChart: true, flowChart: true,
sequenceDiagram: true sequenceDiagram: true
}); });
$("#"+id+" p:first").addClass("ReactMarkdown"); $("#"+id+" p:first").addClass("ReactMarkdown");
}, 200) }, 200)
} }
componentDidMount(){ componentDidMount(){
this.getdatasindex() this.getdatasindex()
} }
getdatasindex=(key)=>{ getdatasindex=(key)=>{
let pathid=this.props.match.params.pathId; let pathid=this.props.match.params.pathId;
let url="/paths/"+pathid+".json"; let url="/paths/"+pathid+".json";
@ -168,7 +168,7 @@ class PathDetailIndex extends Component{
if(result.data.allow_visit===true){ if(result.data.allow_visit===true){
this.setState({ this.setState({
detailInfoList:result.data, detailInfoList:result.data,
courses:result.data.courses, courses:result.data.courses,
pathtopskey:key===undefined?1:key, pathtopskey:key===undefined?1:key,
// items: getItems(result.data.members.length), // items: getItems(result.data.members.length),
}) })
@ -205,157 +205,157 @@ class PathDetailIndex extends Component{
}) })
} }
updatadetailInfoList=()=>{ updatadetailInfoList=()=>{
this.getdatasindex(); this.getdatasindex();
} }
clickNewsubscript=(val)=>{
if(val===0){
this.setState({
clickdetailInfoListtype:true
})
}else{
this.setState({
clickdetailInfoListtype:false
})
}
} clickNewsubscript=(val)=>{
if(val===0){
this.setState({
clickdetailInfoListtype:true
})
}else{
this.setState({
clickdetailInfoListtype:false
})
}
timeStamp=(value)=>{ }
var secondTime = parseInt(value);// 秒
var minuteTime = 0;// 分
var hourTime = 0;// 小时
if(secondTime > 60) {//如果秒数大于60将秒数转换成整数
//获取分钟除以60取整数得到整数分钟
minuteTime = parseInt(secondTime / 60);
//获取秒数,秒数取佘,得到整数秒数
secondTime = parseInt(secondTime % 60);
//如果分钟大于60将分钟转换成小时
if(minuteTime > 60) {
//获取小时获取分钟除以60得到整数小时
hourTime = parseInt(minuteTime / 60);
//获取小时后取佘的分获取分钟除以60取佘的分
minuteTime = parseInt(minuteTime % 60);
}
}
var result = "" + parseInt(secondTime) + "秒";
if(minuteTime > 0) {
result = "" + parseInt(minuteTime) + "分" + result;
}
if(hourTime > 0) {
result = "" + parseInt(hourTime) + "小时" + result;
}
return result;
}
timeStamp=(value)=>{
var secondTime = parseInt(value);// 秒
var minuteTime = 0;// 分
var hourTime = 0;// 小时
if(secondTime > 60) {//如果秒数大于60将秒数转换成整数
//获取分钟除以60取整数得到整数分钟
minuteTime = parseInt(secondTime / 60);
//获取秒数,秒数取佘,得到整数秒数
secondTime = parseInt(secondTime % 60);
//如果分钟大于60将分钟转换成小时
if(minuteTime > 60) {
//获取小时获取分钟除以60得到整数小时
hourTime = parseInt(minuteTime / 60);
//获取小时后取佘的分获取分钟除以60取佘的分
minuteTime = parseInt(minuteTime % 60);
}
}
var result = "" + parseInt(secondTime) + "秒";
if(minuteTime > 0) {
result = "" + parseInt(minuteTime) + "分" + result;
}
if(hourTime > 0) {
result = "" + parseInt(hourTime) + "小时" + result;
}
return result;
}
shanchuallow=(id)=>{
this.setState({
user_id:id,
Modalstype:true,
Modalstopval:"你确定要删除该成员吗?",
cardsModalsave:this.delectshanchuallow,
loadtype:false
})
}
delectshanchuallow=()=>{ shanchuallow=(id)=>{
let{user_id}=this.state; this.setState({
let pathid=this.props.match.params.pathId; user_id:id,
let url="/paths/"+pathid+"/delete_member.json"; Modalstype:true,
let param={user_id:user_id}; Modalstopval:"你确定要删除该成员吗?",
axios.delete(url,{data:param}).then((response) => { cardsModalsave:this.delectshanchuallow,
if(response.data.status===1){ loadtype:false
if (this.props.current_user.user_id == user_id) { })
this.props.history.push('/paths') }
return;
}
this.props.showNotification(response.data.message)
this.setState({
Modalstype:false,
// Modalstopval:response.data.message,
loadtype:false,
// cardsModalsave:this.cardsModalsave,
})
this.updatadetailInfoList();
}
}).catch((error) => {
console.log(error)
})
}
//上移 delectshanchuallow=()=>{
moveup=(data)=>{ let{user_id}=this.state;
// console.log(data); let pathid=this.props.match.params.pathId;
let pathid=this.props.match.params.pathId; let url="/paths/"+pathid+"/delete_member.json";
let url=`/paths/${pathid}/up_member_position.json`; let param={user_id:user_id};
axios.post(url,{ axios.delete(url,{data:param}).then((response) => {
user_id:data.id if(response.data.status===1){
}).then((response) => { if (this.props.current_user.user_id == user_id) {
if(response.status === 200){ this.props.history.push('/paths')
console.log("上移"); return;
// console.log(this.state.detailInfoList.members); }
// console.log(response); this.props.showNotification(response.data.message)
this.setState({
this.setState({ Modalstype:false,
detailInfoList:this.state.detailInfoList, // Modalstopval:response.data.message,
loadtype:false,
// cardsModalsave:this.cardsModalsave,
})
this.updatadetailInfoList();
}
}).catch((error) => {
console.log(error)
})
}
//上移
moveup=(data)=>{
// console.log(data);
let pathid=this.props.match.params.pathId;
let url=`/paths/${pathid}/up_member_position.json`;
axios.post(url,{
user_id:data.id
}).then((response) => {
if(response.status === 200){
console.log("上移");
// console.log(this.state.detailInfoList.members);
// console.log(response);
this.setState({
detailInfoList:this.state.detailInfoList,
members:response.data.members members:response.data.members
}); });
// console.log(this.state.detailInfoList.members); // console.log(this.state.detailInfoList.members);
} }
}).catch((error) => { }).catch((error) => {
console.log(error) console.log(error)
}) })
} }
//下移 //下移
movedown =(data) => { movedown =(data) => {
// console.log(data); // console.log(data);
let pathid=this.props.match.params.pathId; let pathid=this.props.match.params.pathId;
let url=`/paths/${pathid}/down_member_position.json`; let url=`/paths/${pathid}/down_member_position.json`;
axios.post(url,{ axios.post(url,{
user_id:data.id user_id:data.id
}).then((response) => { }).then((response) => {
if( response.status === 200){ if( response.status === 200){
console.log("下移"); console.log("下移");
// console.log(this.state.detailInfoList.members); // console.log(this.state.detailInfoList.members);
// console.log(response); // console.log(response);
this.setState({ this.setState({
detailInfoList:this.state.detailInfoList, detailInfoList:this.state.detailInfoList,
members:response.data.members members:response.data.members
}); });
// console.log(this.state.detailInfoList.members); // console.log(this.state.detailInfoList.members);
} }
}).catch((error) => { }).catch((error) => {
console.log(error) console.log(error)
}) })
} }
render(){ render(){
this.updatamakedown("shixuns_propaedeutics"); this.updatamakedown("shixuns_propaedeutics");
this.updatamakedown("subject_learning_notes"); this.updatamakedown("subject_learning_notes");
let {detailInfoList, let {detailInfoList,
clickdetailInfoListtype, clickdetailInfoListtype,
Modalstype, Modalstype,
Modalstopval, Modalstopval,
Modalsbottomval, Modalsbottomval,
cardsModalcancel, cardsModalcancel,
cardsModalsave, cardsModalsave,
loadtype, loadtype,
progress, progress,
members, members,
tags, tags,
courses, courses,
} = this.state } = this.state
return( return(
<div className="newContainer"> <div className="newContainer">
<style> <style>
{ {
` `
@ -365,206 +365,206 @@ class PathDetailIndex extends Component{
` `
} }
</style> </style>
<Modals <Modals
modalsType={Modalstype} modalsType={Modalstype}
modalsTopval={Modalstopval} modalsTopval={Modalstopval}
modalsBottomval={Modalsbottomval} modalsBottomval={Modalsbottomval}
modalCancel={cardsModalcancel} modalCancel={cardsModalcancel}
modalSave={cardsModalsave} modalSave={cardsModalsave}
loadtype={loadtype} loadtype={loadtype}
> >
</Modals> </Modals>
<div className="newMain clearfix"> <div className="newMain clearfix">
<DetailTop {...this.state} {...this.props} getdatasindex={(key)=>this.getdatasindex(key)}></DetailTop> <DetailTop {...this.state} {...this.props} getdatasindex={(key)=>this.getdatasindex(key)}></DetailTop>
<div className="educontent clearfix mb80"> <div className="educontent clearfix mb80">
<div className="with65 fl"> <div className="with65 fl">
<div className="produce-content mb10"> <div className="produce-content mb10">
<p className="clearfix mb20"> <p className="clearfix mb20">
<span className="fl font-18 font-bd">简介</span> <span className="fl font-18 font-bd">简介</span>
{/*{detailInfoList===undefined?"":detailInfoList.allow_statistics===true?*/} {/*{detailInfoList===undefined?"":detailInfoList.allow_statistics===true?*/}
{/*<Tooltip placement="bottom" title={"编辑"}>*/} {/*<Tooltip placement="bottom" title={"编辑"}>*/}
{/*<Link className="fr" to={"/paths/"+this.props.match.params.pathId+"/edit"}>*/} {/*<Link className="fr" to={"/paths/"+this.props.match.params.pathId+"/edit"}>*/}
{/*<i className="iconfont icon-bianjidaibeijing font-20 color-green"></i>*/} {/*<i className="iconfont icon-bianjidaibeijing font-20 color-green"></i>*/}
{/*</Link>*/} {/*</Link>*/}
{/*</Tooltip>*/} {/*</Tooltip>*/}
{/*:""*/} {/*:""*/}
{/*}*/} {/*}*/}
</p> </p>
<div className="color-grey-6 clearfix"> <div className="color-grey-6 clearfix">
<div id="shixuns_propaedeutics" className="new_li fl" style={{"padding":" 0px","textAlign": "justify;"}}> <div id="shixuns_propaedeutics" className="new_li fl" style={{"padding":" 0px","textAlign": "justify;"}}>
{detailInfoList === undefined ? "" :detailInfoList.description===null?"": {detailInfoList === undefined ? "" :detailInfoList.description===null?"":
<div className={"markdown-body font-14"} dangerouslySetInnerHTML={{__html: markdownToHTML(detailInfoList.description).replace(/▁/g,"▁▁▁")}}></div> <div className={"markdown-body font-14"} dangerouslySetInnerHTML={{__html: markdownToHTML(detailInfoList.description).replace(/▁/g,"▁▁▁")}}></div>
}
</div>
</div>
</div>
<DetailCards
{...this.props}
{...this.state}
updatadetailInfoLists={this.updatadetailInfoList}
></DetailCards>
</div>
<div className="with35 fr pl20">
<div className="edu-back-white mustlearn mb10">
<p className="clearfix mb30">
<span className="font-16">课程须知</span>
{/*{detailInfoList===undefined?"":detailInfoList.allow_statistics===true?*/}
{/*<Tooltip placement="bottom" title={"编辑"}>*/}
{/*<Link to={"/paths/"+this.props.match.params.pathId+"/edit#learning_notes"} className="fr mtf5">*/}
{/*<i className="iconfont icon-bianjidaibeijing font-20 color-green"></i>*/}
{/*</Link>*/}
{/*</Tooltip>*/}
{/*:""*/}
{/*}*/}
</p>
<div id="subject_learning_notes" className="color-grey-6 new_li markdown-body editormd-html-preview justify">
{detailInfoList === undefined ? "" :detailInfoList.learning_notes===null?"":
<div className={"markdown-body font-14"} dangerouslySetInnerHTML={{__html: markdownToHTML(detailInfoList.learning_notes).replace(/▁/g,"▁▁▁")}}></div>
} }
</div> </div>
</div> </div>
{tags === undefined ? "" :tags === null ? "": </div>
<div className="edu-back-white padding40-20 mb10 relative">
<p className="font-16 mb20">技能标签 <span className="color-grey-c">{tags.length}</span></p> <DetailCards
{...this.props}
<div className={clickdetailInfoListtype===false?"newedbox newedboxheight":"newedbox newminheight"}> {...this.state}
<div className="clearfix" id="boxheight"> updatadetailInfoLists={this.updatadetailInfoList}
{ ></DetailCards>
tags && tags.map((item,key)=>{ </div>
return( <div className="with35 fr pl20">
<span value={key} className = {item.status == true ? "edu-filter-btn29BD8B fl" : "newedu-filter-btn fl"}>{item.tag_name}</span> <div className="edu-back-white mustlearn mb10">
) <p className="clearfix mb30">
}) <span className="font-16">课程须知</span>
} {/*{detailInfoList===undefined?"":detailInfoList.allow_statistics===true?*/}
</div> {/*<Tooltip placement="bottom" title={"编辑"}>*/}
</div> {/*<Link to={"/paths/"+this.props.match.params.pathId+"/edit#learning_notes"} className="fr mtf5">*/}
{/*<i className="iconfont icon-bianjidaibeijing font-20 color-green"></i>*/}
<Tooltip placement="bottom" title={"显示全部"}> {/*</Link>*/}
<div className={tags.length>20&&clickdetailInfoListtype===false?"newsubscript mb9 color-grey-9 fr":"newsubscript mb9 color-grey-9 none"} {/*</Tooltip>*/}
onClick={()=>this.clickNewsubscript(0)} {/*:""*/}
><span className="mr8">...</span><Icon type="caret-down" /> {/*}*/}
</div> </p>
</Tooltip> <div id="subject_learning_notes" className="color-grey-6 new_li markdown-body editormd-html-preview justify">
{detailInfoList === undefined ? "" :detailInfoList.learning_notes===null?"":
<Tooltip placement="bottom" title={"收起"}> <div className={"markdown-body font-14"} dangerouslySetInnerHTML={{__html: markdownToHTML(detailInfoList.learning_notes).replace(/▁/g,"▁▁▁")}}></div>
<div className={clickdetailInfoListtype===false?"newsubscript mb9 color-grey-9 none":"newsubscript mb9 color-grey-9 fr"} }
onClick={()=>this.clickNewsubscript(1)}><Icon type="caret-up" /> </div>
</div> </div>
</Tooltip> {tags === undefined ? "" :tags === null ? "":
<div className="edu-back-white padding40-20 mb10 relative">
</div> <p className="font-16 mb20">技能标签 <span className="color-grey-c">{tags.length}</span></p>
}
{ <div className={clickdetailInfoListtype===false?"newedbox newedboxheight":"newedbox newminheight"}>
this.props.checkIfLogin()===false?"":progress === undefined ? "" : progress === null ? "" : <div className="clearfix" id="boxheight">
<div className="edu-back-white myProgress padding40-20 mb10"> {
<p className="mb20"> tags && tags.map((item,key)=>{
<span className="font-16 mr10">关卡数</span> return(
<Tooltip placement="bottom" title="已通过关卡数/总关卡数"> <span value={key} className = {item.status == true ? "edu-filter-btn29BD8B fl" : "newedu-filter-btn fl"}>{item.tag_name}</span>
<span className="color-green" >{progress.my_score} / {progress.all_score}</span> )
</Tooltip> })
</p> }
<p className="clearfix mb10"> </div>
<span className="fl color-green">已学 {progress.learned}%</span> </div>
<span className="fr color-grey-9" id="time-consuming">学习耗时{this.timeStamp(progress.time)} </span>
</p> <Tooltip placement="bottom" title={"显示全部"}>
<div className="myProgressNav"><div className="myProgressGreen" style={{"width":`${progress.learned+"%"}`}}></div></div> <div className={tags.length>20&&clickdetailInfoListtype===false?"newsubscript mb9 color-grey-9 fr":"newsubscript mb9 color-grey-9 none"}
</div> onClick={()=>this.clickNewsubscript(0)}
} ><span className="mr8">...</span><Icon type="caret-down" />
</div>
{ </Tooltip>
members ===undefined ?"":members === null ?"":
<div className="teacherTeam edu-back-white clearfix" id="subject_members"> <Tooltip placement="bottom" title={"收起"}>
<p className="font-16 clearfix">教学团队</p> <div className={clickdetailInfoListtype===false?"newsubscript mb9 color-grey-9 none":"newsubscript mb9 color-grey-9 fr"}
onClick={()=>this.clickNewsubscript(1)}><Icon type="caret-up" />
{ members===undefined? </div>
members && members.map((item,key)=>{ </Tooltip>
return(
<div className="teacherTeamItem clearfix df" key={key}> </div>
<a href={item.user_url} target="_blank" className="fl"> }
<img alt="头像" className="radius" height="80" src={getImageUrl(`${"images/"+item.image_url}`)} width="80"/> {
</a> this.props.checkIfLogin()===false?"":progress === undefined ? "" : progress === null ? "" :
<div className="edu-back-white myProgress padding40-20 mb10">
<div className="fl ml15 flex1"> <p className="mb20">
<p className="mb10 mt5">{item.name} <span className="font-16 mr10">我的进展</span>
{/*{*/} <Tooltip placement="bottom" title="获得经验值/总经验值">
{/* detailInfoList===undefined?"":detailInfoList.allow_add_member===true?*/} <span className="color-green" >{progress.my_score} / {progress.all_score}</span>
{/* <a className="fr" onClick={()=>this.shanchuallow(item.id)}><i className="iconfont icon-shanchu color-grey-c font-14 font-n"></i></a>:""*/} </Tooltip>
{/*}*/} </p>
</p> <p className="clearfix mb10">
<div className="clearfix"> <span className="fl color-green">已学 {progress.learned}%</span>
<p className="color-grey-9 font-12 fl"><span className="mr10">{item.school}</span><span>{item.identity}</span></p> <span className="fr color-grey-9" id="time-consuming">学习耗时{this.timeStamp(progress.time)} </span>
</div> </p>
</div> <div className="myProgressNav"><div className="myProgressGreen" style={{"width":`${progress.learned+"%"}`}}></div></div>
</div> </div>
) }
})
:detailInfoList===undefined?"":detailInfoList.allow_add_member===true? {
members && members.map((item,key)=>{ members ===undefined ?"":members === null ?"":
return( <div className="teacherTeam edu-back-white clearfix" id="subject_members">
<div className="teacherTeamItem clearfix df" key={key}> <p className="font-16 clearfix">教学团队</p>
<a href={item.user_url} target="_blank" className="fl">
<img alt="头像" className="radius" height="80" src={getImageUrl(`${"images/"+item.image_url}`)} width="80"/> { members===undefined?
</a> members && members.map((item,key)=>{
return(
<div className="fl ml15 flex1"> <div className="teacherTeamItem clearfix df" key={key}>
<p className="mb10 mt5">{item.name} <a href={item.user_url} target="_blank" className="fl">
{/* 新增role 判断是否能删除 1 管理员 2 合作者 */} <img alt="头像" className="radius" height="80" src={getImageUrl(`${"images/"+item.image_url}`)} width="80"/>
</a>
{
detailInfoList===undefined?"":detailInfoList.allow_add_member===true && item.role == 2? <div className="fl ml15 flex1">
<a className="fr" onClick={()=>this.shanchuallow(item.id)}><i className="iconfont icon-shanchu color-grey-c font-14 font-n"></i></a>:"" <p className="mb10 mt5">{item.name}
} {/*{*/}
</p> {/* detailInfoList===undefined?"":detailInfoList.allow_add_member===true?*/}
<div className="clearfix"> {/* <a className="fr" onClick={()=>this.shanchuallow(item.id)}><i className="iconfont icon-shanchu color-grey-c font-14 font-n"></i></a>:""*/}
<p className="color-grey-9 font-12 fl"><span className="mr10">{item.school}</span><span>{item.identity}</span></p> {/*}*/}
</div> </p>
{ <div className="clearfix">
detailInfoList===undefined?"":detailInfoList.allow_add_member===true? <div> <p className="color-grey-9 font-12 fl"><span className="mr10">{item.school}</span><span>{item.identity}</span></p>
{key!=0?<div className="fr ml15 flex1"><a onClick={()=>this.moveup(item)}><Tooltip title="上移"><i className="color-green font-18 iconfont icon-xiangshangyi"></i></Tooltip></a></div>:""} </div>
{key+1== members.length?"":<div className="fr ml15 flex1 "><a onClick={()=>this.movedown(item)}><Tooltip title="下移"><i className="color-green font-18 iconfont icon-xiangxiayi"></i></Tooltip></a></div>} </div>
</div> </div>
:"" )
} })
:detailInfoList===undefined?"":detailInfoList.allow_add_member===true?
</div> members && members.map((item,key)=>{
</div> return(
) <div className="teacherTeamItem clearfix df" key={key}>
}) <a href={item.user_url} target="_blank" className="fl">
: members && members.map((item,key)=>{ <img alt="头像" className="radius" height="80" src={getImageUrl(`${"images/"+item.image_url}`)} width="80"/>
return( </a>
<div className="teacherTeamItem clearfix df" key={key}>
<a href={item.user_url} target="_blank" className="fl"> <div className="fl ml15 flex1">
<img alt="头像" className="radius" height="80" src={getImageUrl(`${"images/"+item.image_url}`)} width="80"/> <p className="mb10 mt5">{item.name}
</a> {/* 新增role 判断是否能删除 1 管理员 2 合作者 */}
<div className="fl ml15 flex1"> {
<p className="mb10 mt5">{item.name} detailInfoList===undefined?"":detailInfoList.allow_add_member===true && item.role == 2?
{/*{*/} <a className="fr" onClick={()=>this.shanchuallow(item.id)}><i className="iconfont icon-shanchu color-grey-c font-14 font-n"></i></a>:""
{/* detailInfoList===undefined?"":detailInfoList.allow_add_member===true?*/} }
{/* <a className="fr" onClick={()=>this.shanchuallow(item.id)}><i className="iconfont icon-shanchu color-grey-c font-14 font-n"></i></a>:""*/} </p>
{/*}*/} <div className="clearfix">
</p> <p className="color-grey-9 font-12 fl"><span className="mr10">{item.school}</span><span>{item.identity}</span></p>
<div className="clearfix"> </div>
<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>
</div> {key!=0?<div className="fr ml15 flex1"><a onClick={()=>this.moveup(item)}><Tooltip title="上移"><i className="color-green font-18 iconfont icon-xiangshangyi"></i></Tooltip></a></div>:""}
</div> {key+1== members.length?"":<div className="fr ml15 flex1 "><a onClick={()=>this.movedown(item)}><Tooltip title="下移"><i className="color-green font-18 iconfont icon-xiangxiayi"></i></Tooltip></a></div>}
) </div>
})} :""
}
</div>
} </div>
</div>
)
<AddCollaborators {...this.props} {...this.state} updatadetailInfoLists={this.updatadetailInfoList}></AddCollaborators> })
: members && members.map((item,key)=>{
</div> return(
</div> <div className="teacherTeamItem clearfix df" key={key}>
</div> <a href={item.user_url} target="_blank" className="fl">
<img alt="头像" className="radius" height="80" src={getImageUrl(`${"images/"+item.image_url}`)} width="80"/>
</div> </a>
)
} <div className="fl ml15 flex1">
<p className="mb10 mt5">{item.name}
{/*{*/}
{/* detailInfoList===undefined?"":detailInfoList.allow_add_member===true?*/}
{/* <a className="fr" onClick={()=>this.shanchuallow(item.id)}><i className="iconfont icon-shanchu color-grey-c font-14 font-n"></i></a>:""*/}
{/*}*/}
</p>
<div className="clearfix">
<p className="color-grey-9 font-12 fl"><span className="mr10">{item.school}</span><span>{item.identity}</span></p>
</div>
</div>
</div>
)
})}
</div>
}
<AddCollaborators {...this.props} {...this.state} updatadetailInfoLists={this.updatadetailInfoList}></AddCollaborators>
</div>
</div>
</div>
</div>
)
}
} }
export default PathDetailIndex; export default PathDetailIndex;

@ -1,12 +1,16 @@
import React, { Component } from 'react'; import React, { Component } from 'react';
import PathSearch from './ShixunPathSearch.js'; import PathSearch from './ShixunPathSearch.js';
import { configShareForPaths } from 'educoder'
class ShixunPath extends Component{ class ShixunPath extends Component{
constructor(props) { constructor(props) {
super(props) super(props)
} }
componentDidMount() {
configShareForPaths()
}
render(){ render(){
return( return(
<div> <div>

@ -287,6 +287,10 @@ class TPMIndex extends Component {
(props) => (<TPMRepositoryCommits {...this.props} {...this.state} {...props} (props) => (<TPMRepositoryCommits {...this.props} {...this.state} {...props}
/>) />)
}></Route> }></Route>
<Route path="/shixuns/:shixunId/secret_repository/:repoId/commits" render={
(props) => (<TPMRepositoryCommits {...this.props} {...this.state} {...props} secret_repository_tab={true}
/>)
}></Route>
<Route exact path="/shixuns/:shixunId/challenges" render={ <Route exact path="/shixuns/:shixunId/challenges" render={
(props) => (<TPMChallengeComponent {...this.props} {...this.state} {...props} (props) => (<TPMChallengeComponent {...this.props} {...this.state} {...props}

@ -11,7 +11,7 @@ import Repository from './shixunchild/Repository/Repository'
import TPMRightSection from './component/TPMRightSection' import TPMRightSection from './component/TPMRightSection'
import TPMNav from './component/TPMNav' import TPMNav from './component/TPMNav'
import RepositoryChooseModal from './component/modal/RepositoryChooseModal' // import RepositoryChooseModal from './component/modal/RepositoryChooseModal'
class TPMRepository extends Component { class TPMRepository extends Component {
constructor(props) { constructor(props) {

@ -449,7 +449,7 @@ export default class TPMsettings extends Component {
multi_webssh:false multi_webssh:false
}); });
} else { } else {
if (this.state.init_is_secret_repository && !this.state.vnc) { if (this.state.init_is_secret_repository && !this.state.vnc && this.state.is_secret_repository == true) {
this.confirmDeleteSecretRepo({ this.confirmDeleteSecretRepo({
onOk: () => { onOk: () => {
this.setState({ this.setState({
@ -615,7 +615,7 @@ export default class TPMsettings extends Component {
// } // }
const vnc = e.target.checked; const vnc = e.target.checked;
if (!vnc) { if (!vnc) {
if (this.state.init_is_secret_repository && this.state.webssh != 2) { if (this.state.init_is_secret_repository && this.state.webssh != 2 && this.state.is_secret_repository == true) {
this.confirmDeleteSecretRepo({ this.confirmDeleteSecretRepo({
onOk: () => { onOk: () => {
this.setState({ this.setState({
@ -859,7 +859,8 @@ export default class TPMsettings extends Component {
// }); // });
// } // }
submit_edit_shixun = () => { submit_edit_shixun = () => {
if (this.saving == true) return;
this.saving = true;
if(this.state.status===-1){ if(this.state.status===-1){
this.props.showSnackbar("该实训已被删除,保存失败!"); this.props.showSnackbar("该实训已被删除,保存失败!");
return return
@ -1002,6 +1003,7 @@ export default class TPMsettings extends Component {
axios.put(Url, data).then((response) => { axios.put(Url, data).then((response) => {
// console.log(response) // console.log(response)
this.saving = false;
if(response.status){ if(response.status){
if (response.data.status === -1) { if (response.data.status === -1) {
this.props.showSnackbar(response.data.message); this.props.showSnackbar(response.data.message);
@ -1013,6 +1015,7 @@ export default class TPMsettings extends Component {
}).catch((error) => { }).catch((error) => {
console.log(error) console.log(error)
this.saving = false;
}) })

@ -13,192 +13,192 @@ import {Icon,Tooltip} from 'antd';
// import "antd/dist/antd.css"; // import "antd/dist/antd.css";
class TPMRightSection extends Component { class TPMRightSection extends Component {
constructor(props) { constructor(props) {
super(props) super(props)
this.state = { this.state = {
TPMRightSection:false, TPMRightSection:false,
clickNewsubscripttype:false clickNewsubscripttype:false
} }
} }
// componentDidMount() { // componentDidMount() {
// let id=this.props.match.params.shixunId; // let id=this.props.match.params.shixunId;
// //
// let shixunsDetailsURL=`/shixuns/`+id+`/show_right.json`; // let shixunsDetailsURL=`/shixuns/`+id+`/show_right.json`;
// //
// axios.get(shixunsDetailsURL).then((response)=> { // axios.get(shixunsDetailsURL).then((response)=> {
// if(response.status===200){ // if(response.status===200){
// this.setState({ // this.setState({
// TPMRightSectionData: response.data // TPMRightSectionData: response.data
// }); // });
// } // }
// }).catch((error)=>{ // }).catch((error)=>{
// console.log(error) // console.log(error)
// }); // });
// } // }
// shouldComponentUpdate(nextProps, nextState) { // shouldComponentUpdate(nextProps, nextState) {
// return nextProps.TPMRightSectionData !== this.state.TPMRightSectionData // return nextProps.TPMRightSectionData !== this.state.TPMRightSectionData
// } // }
clickNewsubscript=(val)=>{ clickNewsubscript=(val)=>{
if(val===0){ if(val===0){
this.setState({ this.setState({
TPMRightSection:true, TPMRightSection:true,
clickNewsubscripttype:true clickNewsubscripttype:true
}) })
}else{ }else{
this.setState({ this.setState({
TPMRightSection:false, TPMRightSection:false,
clickNewsubscripttype:false clickNewsubscripttype:false
}) })
} }
} }
render() { render() {
let {TPMRightSection,clickNewsubscripttype}=this.state; let {TPMRightSection,clickNewsubscripttype}=this.state;
let {TPMRightSectionData}=this.props let {TPMRightSectionData}=this.props
return ( return (
<div> <div>
{ {
TPMRightSectionData===undefined?"": TPMRightSectionData===undefined?"":
<div> <div>
<div className="edu-back-white padding40-20 mb10"> <div className="edu-back-white padding40-20 mb10">
<p className="font-16 mb20">创建者</p> <p className="font-16 mb20">创建者</p>
<div className="df"> <div className="df">
<a href={TPMRightSectionData===undefined?"":TPMRightSectionData.creator===undefined?"":`/users/${TPMRightSectionData.creator.login}/courses`}> <a href={TPMRightSectionData===undefined?"":TPMRightSectionData.creator===undefined?"":`/users/${TPMRightSectionData.creator.login}/courses`}>
<img alt="头像" className="radius mr10" height="80" src={getImageUrl(TPMRightSectionData===undefined?"":TPMRightSectionData.creator===undefined?"":'images/'+TPMRightSectionData.creator.image_url+"?1532489442")} width="80" /> <img alt="头像" className="radius mr10" height="80" src={getImageUrl(TPMRightSectionData===undefined?"":TPMRightSectionData.creator===undefined?"":'images/'+TPMRightSectionData.creator.image_url+"?1532489442")} width="80" />
</a> </a>
<div className="flex1"> <div className="flex1">
<p className="mb20">{TPMRightSectionData===undefined?"":TPMRightSectionData.creator===undefined?"":TPMRightSectionData.creator.name}</p> <p className="mb20">{TPMRightSectionData===undefined?"":TPMRightSectionData.creator===undefined?"":TPMRightSectionData.creator.name}</p>
<div className="clearfix"> <div className="clearfix">
<span>发布 {TPMRightSectionData.user_shixuns_count}</span> <span>发布 {TPMRightSectionData.user_shixuns_count}</span>
{/*<span className="ml20">粉丝 <span id="user_h_fan_count">{TPMRightSectionData.fans_count}</span></span>*/} {/*<span className="ml20">粉丝 <span id="user_h_fan_count">{TPMRightSectionData.fans_count}</span></span>*/}
{/* <a href="/watchers/unwatch?className=fr+user_watch_btn+edu-default-btn+edu-focus-btn&amp;object_id=3039&amp;object_type=user&amp;shixun_id=61&amp;target_id=3039" className="fr edu-default-btn user_watch_btn edu-focus-btn" data-method="post" data-remote="true" id="cancel_watch" rel="nofollow">取消关注</a> */} {/* <a href="/watchers/unwatch?className=fr+user_watch_btn+edu-default-btn+edu-focus-btn&amp;object_id=3039&amp;object_type=user&amp;shixun_id=61&amp;target_id=3039" className="fr edu-default-btn user_watch_btn edu-focus-btn" data-method="post" data-remote="true" id="cancel_watch" rel="nofollow">取消关注</a> */}
</div> </div>
</div> </div>
</div> </div>
</div> </div>
{ {
TPMRightSectionData === undefined ? "" :TPMRightSectionData.tags===undefined?"": TPMRightSectionData.tags.length === 0 ? "" : TPMRightSectionData === undefined ? "" :TPMRightSectionData.tags===undefined?"": TPMRightSectionData.tags.length === 0 ? "" :
<div className="edu-back-white padding40-20 mb10 relative"> <div className="edu-back-white padding40-20 mb10 relative">
<p className="font-16 mb20">技能标签 <span className="color-grey-c">{TPMRightSectionData.tags.length}</span></p> <p className="font-16 mb20">技能标签 <span className="color-grey-c">{TPMRightSectionData.tags.length}</span></p>
<div className={TPMRightSection===false?"newedbox newedboxheight":"newedbox newminheight"}> <div className={TPMRightSection===false?"newedbox newedboxheight":"newedbox newminheight"}>
<div className="clearfix" id="boxheight"> <div className="clearfix" id="boxheight">
{ TPMRightSectionData.tags.map((item,key)=>{ { TPMRightSectionData.tags.map((item,key)=>{
return( return(
<span className={item.status===false?"newedu-filter-btn fl":"edu-filter-btn29BD8B fl"} <span className={item.status===false?"newedu-filter-btn fl":"edu-filter-btn29BD8B fl"}
style={{display:item.tag_name===" "||item.tag_name===""?"none":""}} style={{display:item.tag_name===" "||item.tag_name===""?"none":""}}
key={key}>{item.tag_name}</span> key={key}>{item.tag_name}</span>
)}) )})
} }
</div> </div>
</div> </div>
<div className={TPMRightSectionData.tags.length>15&&clickNewsubscripttype===false?"newsubscript mb9 color-grey-9":"newsubscript mb9 color-grey-9 none"} <div className={TPMRightSectionData.tags.length>15&&clickNewsubscripttype===false?"newsubscript mb9 color-grey-9":"newsubscript mb9 color-grey-9 none"}
data-tip-down="显示全部" data-tip-down="显示全部"
onClick={()=>this.clickNewsubscript(0)}><span className="mr8">...</span><Icon type="caret-down" /> onClick={()=>this.clickNewsubscript(0)}><span className="mr8">...</span><Icon type="caret-down" />
</div> </div>
<div className={clickNewsubscripttype===false?"newsubscript mb9 color-grey-9 none":"newsubscript mb9 color-grey-9"} <div className={clickNewsubscripttype===false?"newsubscript mb9 color-grey-9 none":"newsubscript mb9 color-grey-9"}
data-tip-down="显示全部" data-tip-down="显示全部"
onClick={()=>this.clickNewsubscript(1)}><Icon type="caret-up" /> onClick={()=>this.clickNewsubscript(1)}><Icon type="caret-up" />
</div> </div>
</div> </div>
} }
<div className="padding20 edu-back-white mb10 mt10" style={{ <div className="padding20 edu-back-white mb10 mt10" style={{
display: TPMRightSectionData === undefined?"none":TPMRightSectionData.paths===undefined?"":TPMRightSectionData.paths.length === 0 ? "none" : "block" display: TPMRightSectionData === undefined?"none":TPMRightSectionData.paths===undefined?"":TPMRightSectionData.paths.length === 0 ? "none" : "block"
}}> }}>
<p className="mb20 font-16 clearfix">所属课程</p> <p className="mb20 font-16 clearfix">相关实践课程</p>
<div className="recommend-list" > <div className="recommend-list" >
{ {
TPMRightSectionData===undefined?"":TPMRightSectionData.paths===undefined?"":TPMRightSectionData.paths.map((i,k)=>{ TPMRightSectionData===undefined?"":TPMRightSectionData.paths===undefined?"":TPMRightSectionData.paths.map((i,k)=>{
return( return(
<div className="recomments clearfix df" key={k}> <div className="recomments clearfix df" key={k}>
<a href={"/paths/"+i.id} height="96" width="128" target="_blank"> <a href={"/paths/"+i.id} height="96" width="128" target="_blank">
<img alt="实训" height="96" src={"/"+i.image_url} width="128" /> <img alt="实训" height="96" src={"/"+i.image_url} width="128" />
</a> </a>
<div className="ml10 flex1"> <div className="ml10 flex1">
<a href={"/paths/"+i.id} target="_blank" data-tip-down={i.name} className="color-grey-6 task-hide mb12 recomment-name">{i.name}</a> <a href={"/paths/"+i.id} target="_blank" data-tip-down={i.name} className="color-grey-6 task-hide mb12 recomment-name">{i.name}</a>
<p className="clearfix mt8 font-12 color-grey-B4"> <p className="clearfix mt8 font-12 color-grey-B4">
<Tooltip placement="bottom" title={"章节"}> <Tooltip placement="bottom" title={"章节"}>
<span className="mr10 fl squareIconSpan"><i className="iconfont icon-shixun fl mr3"></i>{i.stages_count}</span> <span className="mr10 fl squareIconSpan"><i className="iconfont icon-shixun fl mr3"></i>{i.stages_count}</span>
</Tooltip> </Tooltip>
{/*<Tooltip placement="bottom" title={"经验值"}>*/} {/*<Tooltip placement="bottom" title={"经验值"}>*/}
{/*<span className="mr10 fl squareIconSpan"><i className="iconfont icon-jingyan fl mr3"></i>{i.score_count}</span>*/} {/*<span className="mr10 fl squareIconSpan"><i className="iconfont icon-jingyan fl mr3"></i>{i.score_count}</span>*/}
{/*</Tooltip>*/} {/*</Tooltip>*/}
<Tooltip placement="bottom" title={"学习人数"}> <Tooltip placement="bottom" title={"学习人数"}>
<span className="mr10 fl squareIconSpan"><i className="iconfont icon-chengyuan fl mr3"></i>{i.members_count}</span> <span className="mr10 fl squareIconSpan"><i className="iconfont icon-chengyuan fl mr3"></i>{i.members_count}</span>
</Tooltip> </Tooltip>
</p> </p>
</div> </div>
</div> </div>
) )
}) })
} }
</div> </div>
</div> </div>
<div className="padding20 edu-back-white" <div className="padding20 edu-back-white"
style={{ style={{
display: display:
TPMRightSectionData === undefined?"none":TPMRightSectionData.recommands===undefined?"none":TPMRightSectionData.recommands.length === 0 ||TPMRightSectionData.paths===undefined?"":TPMRightSectionData.paths.length === 0 ? "none" : "block" TPMRightSectionData === undefined?"none":TPMRightSectionData.recommands===undefined?"none":TPMRightSectionData.recommands.length === 0 ? "none" : "block"
}} }}
> >
<p className="mb20 font-16 clearfix">推荐实训</p> <p className="mb20 font-16 clearfix">推荐实训</p>
<div className="recommend-list"> <div className="recommend-list">
{ {
TPMRightSectionData===undefined?"":TPMRightSectionData.recommands===undefined?"":TPMRightSectionData.recommands.map((item,key)=>{ TPMRightSectionData===undefined?"":TPMRightSectionData.recommands===undefined?"":TPMRightSectionData.recommands.map((item,key)=>{
return( return(
<div className="recomments clearfix df" key={key}> <div className="recomments clearfix df" key={key}>
<a href={"/shixuns/"+item.identifier+"/challenges"} target="_blank"> <a href={"/shixuns/"+item.identifier+"/challenges"} target="_blank">
<img alt="69?1526971094" height="96" src={"/"+item.pic} width="128"/> <img alt="69?1526971094" height="96" src={"/"+item.pic} width="128"/>
</a> </a>
<div className="ml10 flex1"> <div className="ml10 flex1">
<Tooltip placement="bottom" title={item.name}> <Tooltip placement="bottom" title={item.name}>
<a href={"/shixuns/"+item.identifier+"/challenges"} target="_blank" className="color-grey-6 task-hide mb12 recomment-name">{item.name}</a> <a href={"/shixuns/"+item.identifier+"/challenges"} target="_blank" className="color-grey-6 task-hide mb12 recomment-name">{item.name}</a>
</Tooltip> </Tooltip>
<p className="clearfix mt8 font-12 color-grey-B4"> <p className="clearfix mt8 font-12 color-grey-B4">
{item.stu_num} 人学习 {item.stu_num} 人学习
</p> </p>
<p className="edu-txt-right color-orange pr10">{item.level}</p> <p className="edu-txt-right color-orange pr10">{item.level}</p>
</div> </div>
</div> </div>
) )
}) })
} }
</div> </div>
</div> </div>
</div> </div>
} }
</div> </div>
) )
} }
} }
export default TPMRightSection; export default TPMRightSection;

@ -1,148 +1,153 @@
import React, { useState, useEffect, memo } from 'react'; // import React, { useState, useEffect, memo } from 'react';
import axios from 'axios' // import axios from 'axios'
import { Modal, Input } from 'antd'; // import { Modal, Input } from 'antd';
function RepositoryChooseModal(props) { // function RepositoryChooseModal(props) {
const [trees, setTrees] = useState([]) // const [trees, setTrees] = useState([])
const [path, setPath] = useState('') // const [path, setPath] = useState('')
const [pathArray, setPathArray] = useState([{val: "根目录/", path: ""}]) // const [pathArray, setPathArray] = useState([{val: "根目录/", path: ""}])
const [modalVisible, setModalVisible] = useState(true) // const [modalVisible, setModalVisible] = useState(true)
useEffect(() => { // useEffect(() => {
repository('') // repository('')
}, []) // }, [])
function onOk() { // function onOk() {
} // }
function onCancel() { // function onCancel() {
} // }
/** // /**
点nav 会传入key // 点nav 会传入key
点item 会传入 newPath // 点item 会传入 newPath
item => name, type type tree/leaf // item => name, type type tree/leaf
*/ // */
const repository=(item, key, newPath)=>{ // const repository=(item, key, newPath)=>{
let newPathArray = [] // // let newPathArray = [] //
// // //
if (key) { // if (key) {
for(var i=0; i<=key; i++){ // for(var i=0; i<=key; i++){
newPathArray.push(pathArray[i]) // newPathArray.push(pathArray[i])
} // }
} else if (item) { // } else if (item) {
newPathArray = pathArray.slice(0) // newPathArray = pathArray.slice(0)
newPathArray.push({val: item.name, path: pathArray[pathArray.length - 1] + "/" + item.name}) // newPathArray.push({val: item.name, path: pathArray[pathArray.length - 1] + "/" + item.name})
} // }
const path = item || key ? newPathArray[newPathArray.length - 1] : '' // const path = item || key ? newPathArray[newPathArray.length - 1] : ''
let id = this.props.match.params.shixunId; // let id = props.match.params.shixunId;
let url ="/shixuns/"+id+"/repository.json"; // let url ="/shixuns/"+id+"/repository.json";
axios.post(url,{ // axios.post(url,{
path: path // path: path
}).then((response) => { // }).then((response) => {
if (response.data.status === 403||response.data.status === 401||response.data.status === 500) { // if (response.data.status === 403||response.data.status === 401||response.data.status === 500) {
}else{ // }else{
setTrees(response.data.trees) // setTrees(response.data.trees)
setPath(path) // setPath(path)
pathArray(newPathArray) // pathArray(newPathArray)
} // }
}).catch((error) => { // }).catch((error) => {
console.log(error) // console.log(error)
}); // });
} // }
const savegetfilepath=(value)=>{ // const savegetfilepath=(value)=>{
let {selectpath,saveshixunfilepath,pathtype} = this.state // const state = {}
// let {selectpath,saveshixunfilepath,pathtype} = state
if(pathtype===1){
let newselectpath; // if(pathtype===1){
// let newselectpath;
if(saveshixunfilepath==="shixunfilepathplay"){
newselectpath=value // if(saveshixunfilepath==="shixunfilepathplay"){
}else{ // newselectpath=value
const type = selectpath.split(''); // }else{
let types=false; // const type = selectpath.split('');
for(var i=0; i<type.length; i++){ // let types=false;
if(type[i]===value){ // for(var i=0; i<type.length; i++){
types=true // if(type[i]===value){
return // types=true
} // return
} // }
// }
if(types===false){
newselectpath=selectpath+value+ "" // if(types===false){
}else{ // newselectpath=selectpath+value+ ""
newselectpath=selectpath // }else{
} // newselectpath=selectpath
} // }
this.setState({ // }
// selectpatharr:newarr, // // this.setState({
selectpath: newselectpath, // // // selectpatharr:newarr,
// // selectpath: newselectpath,
})
} // // })
const goblakepath=(path,key)=>{ // }
} // }
} // const goblakepath=(path,key)=>{
return (
<Modal // }
keyboard={false} // function sendgetfilepath() {
title="文件路径"
visible={modalVisible} // }
closable={false} // return (
footer={false} // <Modal
> // keyboard={false}
<div className="task_popup_con"> // title="文件路径"
<div className="newupload_conbox clearfix"> // visible={modalVisible}
<ul id="directory_file"> // closable={false}
{/*文件导航*/} // footer={false}
{ // >
pathArray.length===0?"":pathArray.map((item,key)=>{ // <div className="task_popup_con">
return( // <div className="newupload_conbox clearfix">
<a className="f14 fb" onClick={()=>goblakepath(item.path,key,item)}>{item.val}</a> // <ul id="directory_file">
) // {/*文件导航*/}
}) // {
} // pathArray.length===0?"":pathArray.map((item,key)=>{
{/*文件*/} // return(
{trees === undefined || trees === null ? "" : trees.map((item, key) => { // <a className="f14 fb" onClick={()=>goblakepath(item.path,key,item)}>{item.val}</a>
return( // )
<li className="entry" key={key}> // })
<div className="filename_no_report hidden">{ // }
item.type==="tree"?<a onClick={()=>sendgetfilepath(item.name,item.type,path+item.name)} data-remote="true"> // {/*文件*/}
<i className="iconfont icon-wenjianjia color-blue mr2"></i> // {trees === undefined || trees === null ? "" : trees.map((item, key) => {
{path+item.name}</a>:<a data-remote="true"> // return(
<i className="iconfont icon-zuoye color-blue mr2"></i> // <li className="entry" key={key}>
<span onClick={()=>savegetfilepath(path+item.name,item.type)}>{path+item.name}</span> // <div className="filename_no_report hidden">{
</a> // item.type==="tree"?<a onClick={()=>sendgetfilepath(item.name,item.type,path+item.name)} data-remote="true">
} // <i className="iconfont icon-wenjianjia color-blue mr2"></i>
</div> // {path+item.name}</a>:<a data-remote="true">
</li> // <i className="iconfont icon-zuoye color-blue mr2"></i>
// <span onClick={()=>savegetfilepath(path+item.name,item.type)}>{path+item.name}</span>
) // </a>
})} // }
// </div>
</ul> // </li>
<div className="clearfix mt20">
<label className="fl mt5 directory_filepath">选中的文件路径</label> // )
<Input id="points_tusi" placeholder="选中的文件路径" className="fl input-60-40" // })}
style={{width:"400px"}}
onInput={(e)=>this.saveselectpath(e)} // </ul>
value={path}/> // <div className="clearfix mt20">
</div> // <label className="fl mt5 directory_filepath">选中的文件路径:</label>
// <Input id="points_tusi" placeholder="选中的文件路径" className="fl input-60-40"
<a className="task-btn task-btn-orange fr" // style={{width:"400px"}}
style={{marginTop: '20px',marginLeft:'20px'}} id="add_path" onClick={()=>onOk()}>确定</a> // onInput={(e)=>saveselectpath(e)}
<a className="pop_close task-btn mb10 fr" // value={path}/>
style={{marginTop: '20px'}} id="back_page" onClick={()=>onCancel()}>取消</a> // </div>
</div>
</div> // <a className="task-btn task-btn-orange fr"
</Modal> // style={{marginTop: '20px',marginLeft:'20px'}} id="add_path" onClick={()=>onOk()}>确定</a>
) // <a className="pop_close task-btn mb10 fr"
// style={{marginTop: '20px'}} id="back_page" onClick={()=>onCancel()}>取消</a>
} // </div>
// </div>
export default RepositoryChooseModal // </Modal>
// )
// }
// export default RepositoryChooseModal

@ -188,7 +188,7 @@ class Repository extends Component {
{commits===undefined?"":commits[0].time} {commits===undefined?"":commits[0].time}
</acronym> {commits===undefined?"":commits[0].title} </acronym> {commits===undefined?"":commits[0].title}
</span> </span>
<a href={`/shixuns/${match.params.shixunId}/repository/${match.params.shixunId}/commits`} <a href={`/shixuns/${match.params.shixunId}/${this.props.secret_repository_tab ? 'secret_repository' : 'repository'}/${match.params.shixunId}/commits`}
className="color-grey-6 fr font-16 "> className="color-grey-6 fr font-16 ">
<i className="iconfont icon-tijiaojilu font-18 fl mr5"></i> <i className="iconfont icon-tijiaojilu font-18 fl mr5"></i>
<span className="fl mt2">提交记录</span> <span className="fl mt2">提交记录</span>

Loading…
Cancel
Save