diff --git a/public/react/config/webpack.config.dev.js b/public/react/config/webpack.config.dev.js index dfd54f38b..ceddbd81b 100644 --- a/public/react/config/webpack.config.dev.js +++ b/public/react/config/webpack.config.dev.js @@ -114,21 +114,21 @@ module.exports = { // First, run the linter. // It's important to do this before Babel processes the JS. // 上线然后要注释回来 - { - test: /\.(js|jsx|mjs)$/, - enforce: 'pre', - use: [ - { - options: { - formatter: eslintFormatter, - eslintPath: require.resolve('eslint'), - - }, - loader: require.resolve('eslint-loader'), - }, - ], - include: paths.appSrc, - }, + // { + // test: /\.(js|jsx|mjs)$/, + // enforce: 'pre', + // use: [ + // { + // options: { + // formatter: eslintFormatter, + // eslintPath: require.resolve('eslint'), + // + // }, + // loader: require.resolve('eslint-loader'), + // }, + // ], + // include: paths.appSrc, + // }, { // "oneOf" will traverse all following loaders until one will // match the requirements. When no loader matches it will fall diff --git a/public/react/src/AppConfig.js b/public/react/src/AppConfig.js index a164828ef..8f93f780b 100644 --- a/public/react/src/AppConfig.js +++ b/public/react/src/AppConfig.js @@ -30,9 +30,10 @@ export function initAxiosInterceptors(props) { var proxy = "http://localhost:3000" // proxy = "http://testbdweb.trustie.net" // proxy = "http://testbdweb.educoder.net" - //proxy = "https://testeduplus2.educoder.net" + // proxy = "https://testeduplus2.educoder.net" proxy="http://47.96.87.25:48080" + // 在这里使用requestMap控制,避免用户通过双击等操作发出重复的请求; // 如果需要支持重复的请求,考虑config里面自定义一个allowRepeat参考来控制 const requestMap = {}; @@ -145,6 +146,11 @@ export function initAxiosInterceptors(props) { if (response.data.status === 402) { locationurl(response.data.url); } + + + if (response.data.status === 401) { + return config; + } // if (response.data.status === 407) { // 在app js 中解决 Trialapplication // // diff --git a/public/react/src/context/TPIContextProvider.js b/public/react/src/context/TPIContextProvider.js index 0b764202f..b332c50a8 100644 --- a/public/react/src/context/TPIContextProvider.js +++ b/public/react/src/context/TPIContextProvider.js @@ -478,10 +478,10 @@ pop_box_new(htmlvalue, 480, 182); resData.myshixun_manager = true } else if (resData.user.identity === EDU_CERTIFICATION_TEACHER) { resData.power = 1 - resData.is_teacher = true + // resData.is_teacher = true } else if (resData.user.identity === EDU_TEACHER) { - resData.is_teacher = true + // resData.is_teacher = true } else if (resData.user.identity === EDU_NORMAL) { } diff --git a/public/react/src/modules/courses/busyWork/CommonWorkList.js b/public/react/src/modules/courses/busyWork/CommonWorkList.js index 2243310a2..34c2d6154 100644 --- a/public/react/src/modules/courses/busyWork/CommonWorkList.js +++ b/public/react/src/modules/courses/busyWork/CommonWorkList.js @@ -234,7 +234,7 @@ function buildColumns(that, student_works) { + that.state.is_evaluation ? `你的评阅分数:${record.student_score}分` :
{record.student_comment_count &&
{`${record.student_comment_count}名学生进行了匿评`}
}
有效平均分:{record.student_score}分
@@ -334,7 +334,7 @@ const orderMap = { work_score: 'asc', student_id: 'asc', } -const PAGE_SIZE = 50 +const PAGE_SIZE = 20 // 类似页面 http://localhost:3007/courses/1309/graduation/graduation_tasks/48/76/setting class CommonWorkList extends Component{ @@ -564,6 +564,19 @@ class CommonWorkList extends Component{ } }) + // time_status int 时间对应的状态: 0:未发布,1:提交中,2:补交中,3:匿评中,4:申诉中,5:评阅中,6:已结束 + + let timeMsg = '提交剩余时间' + if (time_status === 1) { + + } else if (time_status === 2) { + timeMsg = '补交剩余时间' + } else if (time_status === 3) { + timeMsg = '匿评剩余时间' + } else if (time_status === 4) { + timeMsg = '申诉剩余时间' + } + // console.log(StudentData) // console.log(student_works) return( @@ -638,7 +651,7 @@ class CommonWorkList extends Component{ (!!commit_count || !!uncommit_count) && {commit_count}已交 {uncommit_count}未交  - {time_status===5?"":"剩余提交时间"} + {timeMsg || ''} {left_time.time} } diff --git a/public/react/src/modules/courses/busyWork/CommonWorkSetting.js b/public/react/src/modules/courses/busyWork/CommonWorkSetting.js index 177d3929d..3f7e5f3ad 100644 --- a/public/react/src/modules/courses/busyWork/CommonWorkSetting.js +++ b/public/react/src/modules/courses/busyWork/CommonWorkSetting.js @@ -1213,7 +1213,9 @@ class CommonWorkSetting extends Component{
结束时间: - + {/* + */} + (学生匿评TA人作品的时间截点) -
diff --git a/public/react/src/modules/courses/busyWork/UseBank.js b/public/react/src/modules/courses/busyWork/UseBank.js index a6ea333c6..7bddb9979 100644 --- a/public/react/src/modules/courses/busyWork/UseBank.js +++ b/public/react/src/modules/courses/busyWork/UseBank.js @@ -121,9 +121,7 @@ class UseBank extends Component{ }) } onSave = () => { - this.setState({ - hometypepvisible:true - }) + const { checkBoxValues } = this.state; const { object_type } = this.props if(checkBoxValues.length==0){ @@ -132,6 +130,9 @@ class UseBank extends Component{ }) return; } + this.setState({ + hometypepvisible:true + }) const courseId = this.props.match.params.coursesId let url = `/question_banks/save_banks.json` this.setState({ loading: true }) @@ -290,7 +291,7 @@ class UseBank extends Component{ } -

+

{ isChecked !="" ? {isChecked}:"" } diff --git a/public/react/src/modules/courses/graduation/tasks/GraduationTasksappraiseReply.js b/public/react/src/modules/courses/graduation/tasks/GraduationTasksappraiseReply.js index 1c733868e..ec685c39f 100644 --- a/public/react/src/modules/courses/graduation/tasks/GraduationTasksappraiseReply.js +++ b/public/react/src/modules/courses/graduation/tasks/GraduationTasksappraiseReply.js @@ -153,22 +153,13 @@ class GraduationTasksappraiseReply extends Component{ const { current_user, memo } = this.props const isAdmin = this.props.isAdmin(); const isStudent=this.props.isStudent(); + const isNotMember=this.props.isNotMember(); return( -

- {isStudent===true?comment_scores.length===0? -
-
-
- -

没有数据可以显示!

-
-
-
: + {comment_scores.length===0&&isStudent===true||comment_scores.length===0&&isNotMember===true? "":
+ {isStudent===true? - : - this.showModulationtype(id)} saveModulationModal={(value,num)=>this.saveModulationModal(value,num)} addSuccess={this.addSuccess} onDelete={this.onDelete} /> - } + }
+ } ) } } -export default ImageLayerOfCommentHOC() (GraduationTasksappraiseReply); \ No newline at end of file +export default ImageLayerOfCommentHOC() (GraduationTasksappraiseReply); +{/*
*/} + {/*
*/} + {/**/} + {/**/} + {/*

没有数据可以显示!

*/} + {/*
*/} + {/*
*/} +{/*
*/} \ No newline at end of file diff --git a/public/react/src/modules/courses/graduation/tasks/GraduationTasksnew.js b/public/react/src/modules/courses/graduation/tasks/GraduationTasksnew.js index d1a5ae1d7..ae7d0aad8 100644 --- a/public/react/src/modules/courses/graduation/tasks/GraduationTasksnew.js +++ b/public/react/src/modules/courses/graduation/tasks/GraduationTasksnew.js @@ -278,20 +278,20 @@ class GraduationTasksnew extends Component { {/*内容*/} diff --git a/public/react/src/modules/courses/graduation/tasks/GraduationTaskssetting.js b/public/react/src/modules/courses/graduation/tasks/GraduationTaskssetting.js index b4aec1355..c2ec26282 100644 --- a/public/react/src/modules/courses/graduation/tasks/GraduationTaskssetting.js +++ b/public/react/src/modules/courses/graduation/tasks/GraduationTaskssetting.js @@ -989,6 +989,9 @@ class GraduationTaskssettingapp extends Component{ .ant-input{ height:40px; } + .linbox{ + height: 26px; + } ` }
@@ -1010,14 +1013,14 @@ class GraduationTaskssettingapp extends Component{ 任务详情

-
+

- {taskname} + {taskname}

- 返回 + 返回
diff --git a/public/react/src/modules/courses/graduation/tasks/GraduationTaskssettinglist.js b/public/react/src/modules/courses/graduation/tasks/GraduationTaskssettinglist.js index fe53c347c..63bc79e91 100644 --- a/public/react/src/modules/courses/graduation/tasks/GraduationTaskssettinglist.js +++ b/public/react/src/modules/courses/graduation/tasks/GraduationTaskssettinglist.js @@ -101,7 +101,7 @@ class GraduationTaskssettinglist extends Component{ grouping: result.data.have_grouping === true ? worklists[i].grouping_name : null, submitstate: worklists[i].status === 0 ? "未提交" : worklists[i].status === 1 ? "按时提交" : worklists[i].status === 2 ? "延时提交" : "", turnovertime:worklists[i].update_time, - associationitems:result.data.have_grouping==false?"": {name:worklists[i].project_info === undefined ?"--": worklists[i].project_info.name,id:worklists[i].project_info.id}, + associationitems:result.data.have_grouping==false?"": {name:worklists[i].project_info === undefined ?"--": worklists[i].project_info.name,id:worklists[i].project_info===undefined?"":worklists[i].project_info.id}, teacherrating: worklists[i].teacher_comment_score, crossrating: {cross_comment_score:worklists[i].cross_comment_score,cross_comment_num:worklists[i].cross_comment_num}, finalscore: {work_score:worklists[i].final_score.work_score === null ? "--" : worklists[i].final_score.work_score, @@ -754,6 +754,7 @@ class GraduationTaskssettinglist extends Component{ }, { title: '操作', key: 'operation', + width:'100px', dataIndex: 'operation', className:'edu-txt-center', render: operation => ( @@ -861,6 +862,9 @@ class GraduationTaskssettinglist extends Component{ text-overflow: ellipsis; white-space: nowrap; } + .linbox{ + height: 26px; + } ` } @@ -959,12 +963,12 @@ class GraduationTaskssettinglist extends Component{ 任务详情

-
-

{taskslistdata.task_name}

+
+

{taskslistdata.task_name}

- 返回 + 返回
diff --git a/public/react/src/modules/courses/graduation/tasks/GraduationTaskssettingquestions.js b/public/react/src/modules/courses/graduation/tasks/GraduationTaskssettingquestions.js index cdaf90ea4..f1a06808c 100644 --- a/public/react/src/modules/courses/graduation/tasks/GraduationTaskssettingquestions.js +++ b/public/react/src/modules/courses/graduation/tasks/GraduationTaskssettingquestions.js @@ -238,7 +238,15 @@ class GraduationTasksquestions extends Component{ modaltype={this.state.modaltype} getcourse_groupslist={(id) => this.getcourse_groupslist(id)} /> - + {questionslist&&questionslist?
@@ -250,14 +258,14 @@ class GraduationTasksquestions extends Component{ 任务详情

-
+

- {questionslist.task_name} + {questionslist.task_name}

- 返回 + 返回
diff --git a/public/react/src/modules/courses/graduation/tasks/index.js b/public/react/src/modules/courses/graduation/tasks/index.js index 10d71afe4..ae7494d9a 100644 --- a/public/react/src/modules/courses/graduation/tasks/index.js +++ b/public/react/src/modules/courses/graduation/tasks/index.js @@ -209,12 +209,14 @@ class GraduationTasks extends Component{ if (response.data.status == 0) { // {"status":1,"message":"删除成功"} this.fetchAll(search,page,order) + this.props.showNotification(response.data.message); + this.cancelmodel() this.setState({ - Modalstype:true, + Modalstype:false, Modalstopval:response.data.message, ModalsBottomval:"", ModalSave:this.cancelmodel, - Loadtype:true, + Loadtype:false, checkBoxValues:[], checkAllValue:false }) diff --git a/public/react/src/modules/courses/shixunHomework/TraineetraininginformationModal.js b/public/react/src/modules/courses/shixunHomework/TraineetraininginformationModal.js index 10db61e1b..bc51a273d 100644 --- a/public/react/src/modules/courses/shixunHomework/TraineetraininginformationModal.js +++ b/public/react/src/modules/courses/shixunHomework/TraineetraininginformationModal.js @@ -79,9 +79,9 @@ class TraineetraininginformationModal extends Component { return str; } render() { - var columns; - if(this.props.boolgalist&&this.props.boolgalist === true) { - columns = [ + console.log(83); + console.log(this.props.boolgalist); + const columns = [ { title: '关卡', dataIndex: 'number', @@ -148,9 +148,8 @@ class TraineetraininginformationModal extends Component { ), } ] - } - else { - columns = [ + + const columnss = [ { title: '关卡', dataIndex: 'number', @@ -200,7 +199,7 @@ class TraineetraininginformationModal extends Component { ), } ] - } + return (
- { - this.props.game_list === undefined?"" : this.props.game_list.length<4? -
- +
+ {this.props.game_list === undefined ? "" : } + + : +
+
+ {this.props.game_list === undefined ? "" :
} + + } + + + + + + + : + + +
+ { + this.props.game_list === undefined?"" : this.props.game_list.length<4? +
+ -
- {this.props.game_list === undefined ? "" :
+
+ {this.props.game_list === undefined ? "" :
} - - : -
-
- {this.props.game_list === undefined ? "" :
} + + : +
+
+ {this.props.game_list === undefined ? "" :
} - - } + />} + + } + + + + + + + + } + + diff --git a/public/react/src/modules/courses/shixunHomework/Trainingjobsetting.js b/public/react/src/modules/courses/shixunHomework/Trainingjobsetting.js index bece9862f..12d21fb53 100644 --- a/public/react/src/modules/courses/shixunHomework/Trainingjobsetting.js +++ b/public/react/src/modules/courses/shixunHomework/Trainingjobsetting.js @@ -1747,7 +1747,7 @@ class Trainingjobsetting extends Component {
发布时间: - +
+
(学生收到作业的时间)
截止时间: - +
+
(学生“按时”提交作品的时间截点)
@@ -1924,7 +1926,7 @@ class Trainingjobsetting extends Component { checked={this.state.completionefficiencyscore} style={{"color":"#666666"}}>效率分(选中,则学生最终成绩包含效率分) -
+
分值 - + { needUpdateScript ?
diff --git a/public/react/src/modules/page/main/LeftView.js b/public/react/src/modules/page/main/LeftView.js index c198f488b..b2469ec44 100644 --- a/public/react/src/modules/page/main/LeftView.js +++ b/public/react/src/modules/page/main/LeftView.js @@ -73,7 +73,7 @@ class LeftView extends Component { // /shixuns/mnf6b7z3/shixun_discuss?challenge_id=88 render() { let { challenge, shixun, tabIndex, tabIndexChange, loading, discusses_count - , dialogOpen, handleDialogClose, handleDialogReadAnswer, gameAnswer, loadingComments, st, is_teacher, + , dialogOpen, handleDialogClose, handleDialogReadAnswer, gameAnswer, loadingComments, st, user, classes, onDrawerButtonClick, lockedAnswers, unlockedAnswers, isMultiLevelAnswer } = this.props let propaedeutics = shixun ? shixun.propaedeutics : null; @@ -95,7 +95,7 @@ class LeftView extends Component { // TODO TEST // isMultiLevelAnswer = true - // is_teacher = true; + const is_teacher = user.is_teacher let contentText = is_teacher ? @@ -113,24 +113,25 @@ class LeftView extends Component { if (isMultiLevelAnswer) { // power === 0 && contentText = ( is_teacher ) ? -            -            

{`已经过职业认证的教师可以免金币查看答案哟~`}

this.goToCertification()}>立即认证

- - -           
+            +             

{`已经过职业认证的教师可以免金币查看答案哟~`}

+

this.goToCertification()} + style={{ color: '#1890ff', 'margin-top': '6px', display: 'inline-block'}}>立即认证

+ + +           
              :              -

{`先查看参考答案,再通过评测的学生,实训作业将被扣分`}

- {/* { MultiLevelUnlockTable } */} - - +

{`先查看参考答案,再通过评测的学生,实训作业将被扣分`}

+ {/* { MultiLevelUnlockTable } */} + +             
; } @@ -300,7 +301,7 @@ class LeftView extends Component { { lockedAnswers && lockedAnswers.map((item, index) => { return
-
级别{index + 1}:
+
级别{index + 1 + (unlockedAnswers ? unlockedAnswers.length : 0)}:
{item.name}
{ this.props.showUnlockAnswerDialog(item) } } diff --git a/public/react/src/modules/page/main/LeftViewContainer.js b/public/react/src/modules/page/main/LeftViewContainer.js index f96c8e55b..2462872f2 100644 --- a/public/react/src/modules/page/main/LeftViewContainer.js +++ b/public/react/src/modules/page/main/LeftViewContainer.js @@ -46,7 +46,6 @@ class LeftViewContainer extends Component { dialogOpen: false, gameAnswer: '', - is_teacher: false, // 评论 // comments: [], @@ -316,10 +315,8 @@ class LeftViewContainer extends Component { lockedAnswers.push(item) } }) - const is_teacher = this.props.user.identity === EDU_TEACHER this.setState({ - is_teacher, tabIndex: 2, lockedAnswers, unlockedAnswers, @@ -360,9 +357,6 @@ class LeftViewContainer extends Component { 继续查看 立即认证(新开页) */ - const is_teacher = response.data.is_teacher - // this.props.user.identity === EDU_TEACHER - // response.data.is_teacher; // 答案测试 TODO // if (false && response.data.view_answer === true) { @@ -370,15 +364,6 @@ class LeftViewContainer extends Component { this.showAnswer(response.data.answer) } else { // 三个角色 普通用户、未认证教师、已认证教师,这里要区分普通用户和未认证教师用户 - if (is_teacher) { - this.setState({ - is_teacher: true - }) - } else { - this.setState({ - is_teacher: false - }) - } this.setState({ dialogOpen: true, }) diff --git a/public/react/src/modules/page/tpiPage.css b/public/react/src/modules/page/tpiPage.css index 4fc4e3062..55e75059d 100644 --- a/public/react/src/modules/page/tpiPage.css +++ b/public/react/src/modules/page/tpiPage.css @@ -130,7 +130,7 @@ button.buttonHoverColor:hover a { right: inherit; margin-left: 24px; display: inline-block; - top: 10px; + top: 12px; height: 32px; padding: 3px 15px } @@ -229,6 +229,9 @@ body>div[role=dialog]>div { /* padding-bottom: 10px; */ } /* tpi 窗口宽度*/ +body>div[role=dialog]>div[role=document] { + border-radius: 10px; +} #tpi-dialog>div[role=document] { border-radius: 10px; } diff --git a/public/react/src/modules/tpm/NewHeader.js b/public/react/src/modules/tpm/NewHeader.js index 294339b54..f43991599 100644 --- a/public/react/src/modules/tpm/NewHeader.js +++ b/public/react/src/modules/tpm/NewHeader.js @@ -625,7 +625,7 @@ submittojoinclass=(value)=>{ {/* />*/} {/* :""*/} {/*}*/} - + this.cancelModulationModels()} >
{/*<%= link_to image_tag("/images/educoder/logo.png", alt:"高校智能化教学与实训平台", className:"logoimg"), home_path %>*/} diff --git a/public/react/src/modules/tpm/TPMBanner.js b/public/react/src/modules/tpm/TPMBanner.js index 64c2b39dd..f28f982b7 100644 --- a/public/react/src/modules/tpm/TPMBanner.js +++ b/public/react/src/modules/tpm/TPMBanner.js @@ -731,7 +731,7 @@ class TPMBanner extends Component { {/*>{shixunsDetails.task_operation===undefined?"":shixunsDetails.task_operation[0]}:""*/} {/*}*/} - {shixunsDetails.shixun_status === 0 && this.props.identity < 4 ? + {shixunsDetails.shixun_status === 0 && this.props.identity < 5 ? 申请发布 : "" } @@ -796,7 +796,7 @@ class TPMBanner extends Component { - {shixunsDetails.shixun_status === 1 && this.props.identity < 4 ? + {shixunsDetails.shixun_status === 1 && this.props.identity < 5 ? 撤销发布 : "" } @@ -875,9 +875,9 @@ class TPMBanner extends Component { 已关闭 } -
- + - } -
+
:""}
diff --git a/public/react/src/modules/tpm/TPMsettings/TPMsettings.js b/public/react/src/modules/tpm/TPMsettings/TPMsettings.js index b60b641e0..0e3abb947 100644 --- a/public/react/src/modules/tpm/TPMsettings/TPMsettings.js +++ b/public/react/src/modules/tpm/TPMsettings/TPMsettings.js @@ -598,7 +598,7 @@ export default class TPMsettings extends Component { evaluate_script, exec_time, webssh, use_scope, trainee, can_copy, task_pass, test_set_permission, hide_code, code_hidden, forbid_copy, vnc,multi_webssh, opening_time, pod_exist_time,shixunmemoMDvalue } = this.state; - let operateauthority=this.props.identity<4&&this.state.status==0||this.props.identity===1&&this.state.status==2||this.props.identity===1&&this.state.status==1; + let operateauthority=this.props.identity<5&&this.state.status==0||this.props.identity===1&&this.state.status==2||this.props.identity===1&&this.state.status==1; const description_editormd = this.description_editormd.getValue(); @@ -1084,7 +1084,7 @@ export default class TPMsettings extends Component { } const dateFormat = 'YYYY-MM-DD HH:mm:ss'; - let operateauthority=this.props.identity===1?true:this.props.identity<4&&this.state.status==0?true:false; + let operateauthority=this.props.identity===1?true:this.props.identity<5&&this.state.status==0?true:false; return (
@@ -1099,7 +1099,7 @@ export default class TPMsettings extends Component { :"" } { - this.props.identity < 4 && this.state.status==0? + this.props.identity < 5 && this.state.status==0? this.operateshixuns(1)}> 删除实训 @@ -1332,7 +1332,7 @@ export default class TPMsettings extends Component { { - this.props.identity<4||this.props.power==true? + this.props.identity<5||this.props.power==true? 使用自定义脚本 : "" } diff --git a/public/react/src/modules/tpm/component/TPMright.css b/public/react/src/modules/tpm/component/TPMright.css index 63f718f26..9f2622eda 100644 --- a/public/react/src/modules/tpm/component/TPMright.css +++ b/public/react/src/modules/tpm/component/TPMright.css @@ -44,7 +44,8 @@ position:relative; } .newedboxheight{ - max-height:181px; + max-height:204px; + overflow-y: auto; } .newminheight{ /*max-height: 670px;*/ diff --git a/public/react/src/modules/tpm/newshixuns/Newshixuns.js b/public/react/src/modules/tpm/newshixuns/Newshixuns.js index aa5b62a0a..8d38ac24d 100644 --- a/public/react/src/modules/tpm/newshixuns/Newshixuns.js +++ b/public/react/src/modules/tpm/newshixuns/Newshixuns.js @@ -181,6 +181,7 @@ class Newshixuns extends Component { systemenvironment:undefined, testcoderunmode:undefined, file:undefined, + deleteisnot:true, } } @@ -547,7 +548,7 @@ class Newshixuns extends Component { // if (id) { if(this.state.file !== undefined){ console.log("549"); - this.deleteAttachment(this.state.file); + // this.deleteAttachment(this.state.file); this.setState({ file:undefined, languagewrite:"", @@ -579,7 +580,7 @@ class Newshixuns extends Component { }) if(this.state.file !== undefined){ console.log("580"); - this.deleteAttachment(this.state.file); + // this.deleteAttachment(this.state.file); this.setState({ file:undefined, languagewrite:"", @@ -655,7 +656,8 @@ class Newshixuns extends Component { handleChange = (info) => { console.log("handleChange1"); let fileList = info.fileList; - this.setState({ fileList }); + this.setState({ fileList:fileList, + deleteisnot:false}); } onAttachmentRemove = (file) => { confirm({ @@ -686,11 +688,13 @@ class Newshixuns extends Component { // console.log('--- success') this.setState((state) => { + const index = state.fileList.indexOf(file); const newFileList = state.fileList.slice(); newFileList.splice(index, 1); return { fileList: newFileList, + deleteisnot:true }; }); } @@ -736,7 +740,7 @@ class Newshixuns extends Component { render() { const { getFieldDecorator } = this.props.form; const thiss=this; - let {testcoderunmode ,systemenvironment,languagewrite, fileList,TimePickervalue, scope_partmenttype, opensmail, newshixunlist, name, scope_partment, departmentslist, postapplyvisible, sendsure_applyvalue, postapplytitle, shixun_nametype, main_types, trainee_types, SelectTheCommandtype, opers, operss, onSearchvalue} = this.state; + let {testcoderunmode ,systemenvironment,languagewrite,deleteisnot, fileList,TimePickervalue, scope_partmenttype, opensmail, newshixunlist, name, scope_partment, departmentslist, postapplyvisible, sendsure_applyvalue, postapplytitle, shixun_nametype, main_types, trainee_types, SelectTheCommandtype, opers, operss, onSearchvalue} = this.state; let options if (departmentslist != undefined) { options = this.state.departmentslist.map((d, k) => { @@ -764,7 +768,7 @@ class Newshixuns extends Component { } if(thiss.state.file !== undefined){ console.log("763") - thiss.deleteAttachment(thiss.state.file); + // thiss.deleteAttachment(thiss.state.file); thiss.setState({ file:file }) @@ -797,6 +801,7 @@ class Newshixuns extends Component { // return isLt50M; // }, // }; + return (
@@ -934,12 +939,23 @@ class Newshixuns extends Component { {/* rules:[{*/} {/* }]*/} {/* })(*/} - - - 上传附件 - (单个文件50M以内) + { + deleteisnot=== true? + + + 上传附件 + (单个文件50M以内) + + + : + + + 上传附件 + (单个文件50M以内) + + + } - {/* )*/} {/* }*/} {/**/} diff --git a/public/react/src/modules/tpm/shixunchild/Challenges/Challenges.js b/public/react/src/modules/tpm/shixunchild/Challenges/Challenges.js index ecc94e905..a0f354e4a 100644 --- a/public/react/src/modules/tpm/shixunchild/Challenges/Challenges.js +++ b/public/react/src/modules/tpm/shixunchild/Challenges/Challenges.js @@ -239,7 +239,7 @@ class Challenges extends Component {

简介 - @@ -262,7 +262,7 @@ class Challenges extends Component {

全部任务 - {this.props.identity < 4 && ChallengesDataList&&ChallengesDataList.shixun_status=== 0 ? + {this.props.identity < 5 && ChallengesDataList&&ChallengesDataList.shixun_status=== 0 ? : "" } - {this.props.identity < 4 && ChallengesDataList&&ChallengesDataList.shixun_status=== 0 ? + {this.props.identity < 5 && ChallengesDataList&&ChallengesDataList.shixun_status=== 0 ? 第{key+1}关 - {this.props.identity<4? + {this.props.identity<5? item.st === 1 ? this.startshixunCombat(this.props.identity, item.challenge_id, "/editquestion")} className="font-16 color05101a">{item.name} @@ -359,7 +359,7 @@ class Challenges extends Component { {item.delete_url != undefined && this.delOperations(item.challenge_id)} - style={{ display:this.props.user.admin===true?"block":this.props.identity < 4 && ChallengesDataList.shixun_status === 0 ? "block" : 'none' }} + style={{ display:this.props.user.admin===true?"block":this.props.identity < 5 && ChallengesDataList.shixun_status === 0 ? "block" : 'none' }} className="fl ring-op-green mr25"> @@ -371,7 +371,7 @@ class Challenges extends Component { {item.up_url != undefined && this.operations(item.challenge_id, "up")} - style={{ display:this.props.user.admin===true?"block":this.props.identity < 4 && ChallengesDataList.shixun_status === 0 ? "block" : 'none' }} + style={{ display:this.props.user.admin===true?"block":this.props.identity < 5 && ChallengesDataList.shixun_status === 0 ? "block" : 'none' }} className="fl ring-op-green mr25"> @@ -381,7 +381,7 @@ class Challenges extends Component { {item.down_url != undefined && this.operations(item.challenge_id, "down")} - style={{ display: this.props.user.admin===true?"block":this.props.identity < 4 && ChallengesDataList.shixun_status=== 0 ? "block" : 'none' }} + style={{ display: this.props.user.admin===true?"block":this.props.identity < 5 && ChallengesDataList.shixun_status=== 0 ? "block" : 'none' }} className="fl ring-op-green mr25"> @@ -393,7 +393,7 @@ class Challenges extends Component { item.st === 1 ? : item.status === 1 && newstatus === 1 ? - - this.startshixunCombat(false,undefined, item.open_game):""} + + this.startshixunCombat(false,undefined, item.open_game):""} style={{marginTop: '-2px'}}>直接挑战 : "" : "" @@ -462,9 +462,9 @@ class Challenges extends Component { { item.status === 0 ? - - this.startshixunCombat(false,undefined, item.open_game):""} + + this.startshixunCombat(false,undefined, item.open_game):""} style={{marginTop: '-2px'}}>直接挑战 : "" } diff --git a/public/react/src/modules/tpm/shixunchild/Collaborators/Collaborators.js b/public/react/src/modules/tpm/shixunchild/Collaborators/Collaborators.js index d4c8db05b..94036f5c0 100644 --- a/public/react/src/modules/tpm/shixunchild/Collaborators/Collaborators.js +++ b/public/react/src/modules/tpm/shixunchild/Collaborators/Collaborators.js @@ -1,546 +1,546 @@ -import React, { Component } from 'react'; - -import { Redirect } from 'react-router'; - -import {Modal, Button, Radio, Input, Checkbox,message} from 'antd'; - -import { BrowserRouter as Router, Route, Link, Switch } from "react-router-dom"; - -import PropTypes from 'prop-types'; - -import classNames from 'classnames'; - -import { CircularProgress } from 'material-ui/Progress'; - -import { getImageUrl, toPath } from 'educoder' - -import axios from 'axios'; - -import './Collaborators.css'; - -const $ = window.$; - -const RadioGroup = Radio.Group; - -const Search = Input.Search; - -class Collaborators extends Component { - constructor(props) { - super(props) - this.state = { - collaboratorList: [], - Collaboratorsvisible: false, - Collaboratorsvisibleadmin: false, - value: 1, - Searchadmin: [], - allChangechecked: false, - Collaboratorslist: [], - Collaboratorslisttype: false, - collaborators_deletetype: false, - collaborators_deletevalue: null, - onSearchcalue:"", - collaboratorListsum:10, - collaboratorListsumtype:true - } - } - componentDidMount() { - let id=this.props.match.params.shixunId; - - let collaborators=`/shixuns/`+id+`/collaborators.json`; - axios.get(collaborators).then((response)=> { - if(response.status===200){ - if (response.data.status === 403||response.data.status === 401||response.data.status === 500) { - - }else{ - this.setState({ - collaboratorList: response.data - }); - } - - } - }).catch((error)=>{ - console.log(error) - }); - } - - updatacomponentDiddata = () => { - let id = this.props.match.params.shixunId; - - let collaborators = `/shixuns/` + id + `/collaborators.json`; - axios.get(collaborators).then((response) => { - if (response.status === 200) { - if (response.data.status === 403||response.data.status === 401||response.data.status === 500) { - - }else{ - this.setState({ - collaboratorList: response.data - }); - } - } - }).catch((error) => { - console.log(error) - }); - } - CollaboratorsshowModal = (type) => { - if (type === "cooperation") { - this.setState({ - Collaboratorsvisibleadmin: false, - Collaboratorslist:[], - Searchadmin:[] - }); - } else if (type === "admin") { - this.setState({ - Collaboratorsvisible: false, - Collaboratorslist:[], - Searchadmin:[] - }); - } else if (type === "collaborators_deletetype") { - this.setState({ - collaborators_deletetype: false, - }); - } - } - - showCollaboratorsvisible = (type) => { - this.setState({ - Collaboratorslist: [], - Searchadmin:[], - onSearchcalue:"" - }) - let admintype = this.props.identity; - if (admintype>3) { - this.props.showSnackbar("您没有权限"); - return - } - if (type === "cooperation") { - this.setState({ - Collaboratorsvisibleadmin: true, - }); - } else if ("admin") { - let id = this.props.match.params.shixunId; - let url = "/shixuns/" + id + "/change_manager.json"; - axios.get(url).then((response) => { - if (response.status === 200) { - // this.setState({ - // Collaboratorsvisible: true - // }) - if (response.data.status === 403||response.data.status === 401||response.data.status === 500) { - - }else{ - this.setState({ - Collaboratorsvisible: true, - Collaboratorslist: response.data - }) - } - } - }).catch((error) => { - console.log(error) - }); - - } - } - - onChange = (e) => { - this.setState({ - value: e.target.value, - }); - } - onSearchadmins=(e)=>{ - this.setState({ - onSearchcalue:e.target.value - }) - } - onSearchadmin = (value) => { - let {collaboratorList} = this.state; - if (value === "") { - this.setState({ - Searchadmin: [], - collaboratorList: collaboratorList - }) - } else { - let id = this.props.match.params.shixunId; - let url = "/shixuns/" + id + "/add_collaborators.json?search=" + value; - axios.get(url).then((response) => { - if (response.data.status === 403||response.data.status === 401||response.data.status === 500) { - - }else{ - let newlist = response.data; - for (var i = 0; i < newlist.length; i++) { - newlist[i].checked = false - } - this.setState({ - Searchadmin: newlist, - collaboratorList: collaboratorList - }) - } - - }).catch((error) => { - console.log(error) - }); - } - - } - - selectChangenickname = (e, key) => { - let {Searchadmin} = this.state; - let newlist = Searchadmin; - for (var i = 0; i < newlist.length; i++) { - newlist[key].checked = e.target.checked - } - - let arrlist = []; - let alltype = false; - for (var z = 0; z < newlist.length; z++) { - if (newlist[z].checked === true) { - arrlist.push(newlist[z]) - } - } - - if (Searchadmin.length === arrlist.length) { - alltype = true - } else { - alltype = false - } - this.setState({ - Searchadmin: newlist, - allChangechecked: alltype - }) - - } - allChange = (e) => { - let {Searchadmin} = this.state; - let newlist = Searchadmin; - for (var i = 0; i < newlist.length; i++) { - newlist[i].checked = e.target.checked - } - this.setState({ - Searchadmin: newlist, - allChangechecked: e.target.checked - }) - } - submit_add_collaborators_form = () => { - let id = this.props.match.params.shixunId; - let {Searchadmin,collaboratorList} = this.state; - let newlist = Searchadmin; - let user_ids = [] - if (newlist.length === 0) { - this.setState({ - Collaboratorslisttype: true - }) - return - } - for (var i = 0; i < newlist.length; i++) { - if (newlist[i].checked === true) { - user_ids.push(newlist[i].user_id) - } - } - - for(var i=0; i { - this.updatacomponentDiddata(); - this.props.showSnackbar(response.data.message); - this.setState({ - Collaboratorsvisibleadmin: false, - Collaboratorslist:[], - Searchadmin:[] - }) - }).catch((error) => { - console.log(error) - }); - } - addadminredio = (e) => { - this.setState({ - addadminrediovalue: e - }) - - } - submit_addadminredio = () => { - let {addadminrediovalue} = this.state; - - let id = this.props.match.params.shixunId; - - let url = "/shixuns/" + id + "/change_manager.json"; - if(addadminrediovalue===undefined){ - this.setState({ - Collaboratorsvisible: false, - Collaboratorslist:[], - Searchadmin:[] - }); - this.props.showSnackbar("所选人员为空,没有更换成功"); - this.CollaboratorsshowModal("admin") - return - } - - - axios.post(url, { - user_id: addadminrediovalue - }).then((response) => { - this.setState({ - Collaboratorsvisible: false, - Collaboratorslist:[], - Searchadmin:[] - }); - this.updatacomponentDiddata(); - this.props.showSnackbar(response.data.message); - }).catch((error) => { - console.log(error) - }); - } - - collaborators_delete = (value) => { - this.setState({ - collaborators_deletetype: true, - collaborators_deletevalue: value - }) - - } - collaborators_deletes = () => { - let {collaborators_deletevalue} = this.state; - if (collaborators_deletevalue === null) { - return - } - let id = this.props.match.params.shixunId; - let url = "/shixuns/" + id + "/collaborators_delete.json?user_id=" + collaborators_deletevalue; - axios.delete(url).then((response) => { - this.props.showSnackbar(response.data.message); - this.updatacomponentDiddata(); - this.setState({ - collaborators_deletetype: false - }) - }).catch((error) => { - console.log(error) - }); - } - - loadMore=()=>{ - let {collaboratorList}=this.state; - this.setState({ - collaboratorListsum:collaboratorList.length, - collaboratorListsumtype:false - }) - } - render() { - let { - collaboratorList, - Collaboratorsvisible, - Collaboratorsvisibleadmin, - Searchadmin, - allChangechecked, - Collaboratorslist, - Collaboratorslisttype, - collaborators_deletetype, - onSearchcalue, - collaboratorListsum, - collaboratorListsumtype - } = this.state; - let {loadingContent} = this.props; - const radioStyle = { - display: 'block', - height: '30px', - lineHeight: '30px', - }; - // console.log(collaboratorList) - return ( - -

- this.showCollaboratorsvisible("cooperation")} - className="edu-default-btn edu-greenback-btn fr mr20 height40" - data-remote="true"> - + 添加合作者 - - this.showCollaboratorsvisible("admin")} - style={{display:this.props.identity===1?"block":"none"}} - data-remote="true" - className="edu-default-btn edu-greenback-btn fr mr20 height40">更换管理员 -

- - - -
- 选择的成员将会成为新的管理员
您将不再拥有管理员的权限,但您仍是合作团队的一员 -
- - -
-
    -
  • - - - { - Collaboratorslist.length === 0 ? "" : Collaboratorslist.map((item, key) => { - return ( - this.addadminredio(item.user_id)}>{item.name} - ) - }) - } - - -
  • -
-
- - - -
- - - this.onSearchadmin(value)} - onInput={this.onSearchadmins} - style={{width: '100%'}} - /> - -
-

- 姓名 - 职位 - 单位 -

-
-
    - {Searchadmin.length === 0 ?
  • - 请试试搜索一下 -
  • : Searchadmin.map((item, key) => { - return ( -
  • - this.selectChangenickname(e, key)} - id={item.user_id}> - {item.nickname} - {item.identify} - {item.school_name} -
  • - ) - }) - - } -
-
-
- -
- - - 全选 -
- 请至少选择一个用户 -
-
- - -
- - -
- -
- { - collaboratorList===undefined?"":collaboratorList.map((item,key)=>{ - if(key - - 用户头像 -
-

- {item.user.name} - - {item.user.shixun_manager === true ? "(管理员)" : ""} -

- -

{item.user.identity}{item.user.school_name}

- -

- 发布  {item.user.user_shixuns_count} - {/*粉丝  */} - {/*{item.user.fans_count}*/} - {/**/} -

- -

{item.user.brief_introduction}

- - -
- - {item.user.shixun_manager === true ? "" : this.collaborators_delete(item.user.user_id)}>删除} - {/*取消关注*/} -
- - ) - } - }) - } - -
-
确定要删除吗?
-
- - -
-
- -
10&&collaboratorListsumtype===true?"":"none"} - style={{textAlign:'center',borderTop:'1px solid #eee'}}> - 加载更多 -
- - - - ); - } -} - -export default Collaborators; +import React, { Component } from 'react'; + +import { Redirect } from 'react-router'; + +import {Modal, Button, Radio, Input, Checkbox,message} from 'antd'; + +import { BrowserRouter as Router, Route, Link, Switch } from "react-router-dom"; + +import PropTypes from 'prop-types'; + +import classNames from 'classnames'; + +import { CircularProgress } from 'material-ui/Progress'; + +import { getImageUrl, toPath } from 'educoder' + +import axios from 'axios'; + +import './Collaborators.css'; + +const $ = window.$; + +const RadioGroup = Radio.Group; + +const Search = Input.Search; + +class Collaborators extends Component { + constructor(props) { + super(props) + this.state = { + collaboratorList: [], + Collaboratorsvisible: false, + Collaboratorsvisibleadmin: false, + value: 1, + Searchadmin: [], + allChangechecked: false, + Collaboratorslist: [], + Collaboratorslisttype: false, + collaborators_deletetype: false, + collaborators_deletevalue: null, + onSearchcalue:"", + collaboratorListsum:10, + collaboratorListsumtype:true + } + } + componentDidMount() { + let id=this.props.match.params.shixunId; + + let collaborators=`/shixuns/`+id+`/collaborators.json`; + axios.get(collaborators).then((response)=> { + if(response.status===200){ + if (response.data.status === 403||response.data.status === 401||response.data.status === 500) { + + }else{ + this.setState({ + collaboratorList: response.data + }); + } + + } + }).catch((error)=>{ + console.log(error) + }); + } + + updatacomponentDiddata = () => { + let id = this.props.match.params.shixunId; + + let collaborators = `/shixuns/` + id + `/collaborators.json`; + axios.get(collaborators).then((response) => { + if (response.status === 200) { + if (response.data.status === 403||response.data.status === 401||response.data.status === 500) { + + }else{ + this.setState({ + collaboratorList: response.data + }); + } + } + }).catch((error) => { + console.log(error) + }); + } + CollaboratorsshowModal = (type) => { + if (type === "cooperation") { + this.setState({ + Collaboratorsvisibleadmin: false, + Collaboratorslist:[], + Searchadmin:[] + }); + } else if (type === "admin") { + this.setState({ + Collaboratorsvisible: false, + Collaboratorslist:[], + Searchadmin:[] + }); + } else if (type === "collaborators_deletetype") { + this.setState({ + collaborators_deletetype: false, + }); + } + } + + showCollaboratorsvisible = (type) => { + this.setState({ + Collaboratorslist: [], + Searchadmin:[], + onSearchcalue:"" + }) + let admintype = this.props.identity; + if (admintype>3) { + this.props.showSnackbar("您没有权限"); + return + } + if (type === "cooperation") { + this.setState({ + Collaboratorsvisibleadmin: true, + }); + } else if ("admin") { + let id = this.props.match.params.shixunId; + let url = "/shixuns/" + id + "/change_manager.json"; + axios.get(url).then((response) => { + if (response.status === 200) { + // this.setState({ + // Collaboratorsvisible: true + // }) + if (response.data.status === 403||response.data.status === 401||response.data.status === 500) { + + }else{ + this.setState({ + Collaboratorsvisible: true, + Collaboratorslist: response.data + }) + } + } + }).catch((error) => { + console.log(error) + }); + + } + } + + onChange = (e) => { + this.setState({ + value: e.target.value, + }); + } + onSearchadmins=(e)=>{ + this.setState({ + onSearchcalue:e.target.value + }) + } + onSearchadmin = (value) => { + let {collaboratorList} = this.state; + if (value === "") { + this.setState({ + Searchadmin: [], + collaboratorList: collaboratorList + }) + } else { + let id = this.props.match.params.shixunId; + let url = "/shixuns/" + id + "/add_collaborators.json?search=" + value; + axios.get(url).then((response) => { + if (response.data.status === 403||response.data.status === 401||response.data.status === 500) { + + }else{ + let newlist = response.data; + for (var i = 0; i < newlist.length; i++) { + newlist[i].checked = false + } + this.setState({ + Searchadmin: newlist, + collaboratorList: collaboratorList + }) + } + + }).catch((error) => { + console.log(error) + }); + } + + } + + selectChangenickname = (e, key) => { + let {Searchadmin} = this.state; + let newlist = Searchadmin; + for (var i = 0; i < newlist.length; i++) { + newlist[key].checked = e.target.checked + } + + let arrlist = []; + let alltype = false; + for (var z = 0; z < newlist.length; z++) { + if (newlist[z].checked === true) { + arrlist.push(newlist[z]) + } + } + + if (Searchadmin.length === arrlist.length) { + alltype = true + } else { + alltype = false + } + this.setState({ + Searchadmin: newlist, + allChangechecked: alltype + }) + + } + allChange = (e) => { + let {Searchadmin} = this.state; + let newlist = Searchadmin; + for (var i = 0; i < newlist.length; i++) { + newlist[i].checked = e.target.checked + } + this.setState({ + Searchadmin: newlist, + allChangechecked: e.target.checked + }) + } + submit_add_collaborators_form = () => { + let id = this.props.match.params.shixunId; + let {Searchadmin,collaboratorList} = this.state; + let newlist = Searchadmin; + let user_ids = [] + if (newlist.length === 0) { + this.setState({ + Collaboratorslisttype: true + }) + return + } + for (var i = 0; i < newlist.length; i++) { + if (newlist[i].checked === true) { + user_ids.push(newlist[i].user_id) + } + } + + for(var i=0; i { + this.updatacomponentDiddata(); + this.props.showSnackbar(response.data.message); + this.setState({ + Collaboratorsvisibleadmin: false, + Collaboratorslist:[], + Searchadmin:[] + }) + }).catch((error) => { + console.log(error) + }); + } + addadminredio = (e) => { + this.setState({ + addadminrediovalue: e + }) + + } + submit_addadminredio = () => { + let {addadminrediovalue} = this.state; + + let id = this.props.match.params.shixunId; + + let url = "/shixuns/" + id + "/change_manager.json"; + if(addadminrediovalue===undefined){ + this.setState({ + Collaboratorsvisible: false, + Collaboratorslist:[], + Searchadmin:[] + }); + this.props.showSnackbar("所选人员为空,没有更换成功"); + this.CollaboratorsshowModal("admin") + return + } + + + axios.post(url, { + user_id: addadminrediovalue + }).then((response) => { + this.setState({ + Collaboratorsvisible: false, + Collaboratorslist:[], + Searchadmin:[] + }); + this.updatacomponentDiddata(); + this.props.showSnackbar(response.data.message); + }).catch((error) => { + console.log(error) + }); + } + + collaborators_delete = (value) => { + this.setState({ + collaborators_deletetype: true, + collaborators_deletevalue: value + }) + + } + collaborators_deletes = () => { + let {collaborators_deletevalue} = this.state; + if (collaborators_deletevalue === null) { + return + } + let id = this.props.match.params.shixunId; + let url = "/shixuns/" + id + "/collaborators_delete.json?user_id=" + collaborators_deletevalue; + axios.delete(url).then((response) => { + this.props.showSnackbar(response.data.message); + this.updatacomponentDiddata(); + this.setState({ + collaborators_deletetype: false + }) + }).catch((error) => { + console.log(error) + }); + } + + loadMore=()=>{ + let {collaboratorList}=this.state; + this.setState({ + collaboratorListsum:collaboratorList.length, + collaboratorListsumtype:false + }) + } + render() { + let { + collaboratorList, + Collaboratorsvisible, + Collaboratorsvisibleadmin, + Searchadmin, + allChangechecked, + Collaboratorslist, + Collaboratorslisttype, + collaborators_deletetype, + onSearchcalue, + collaboratorListsum, + collaboratorListsumtype + } = this.state; + let {loadingContent} = this.props; + const radioStyle = { + display: 'block', + height: '30px', + lineHeight: '30px', + }; + // console.log(collaboratorList) + return ( + +

+ this.showCollaboratorsvisible("cooperation")} + className="edu-default-btn edu-greenback-btn fr mr20 height40" + data-remote="true"> + + 添加合作者 + + this.showCollaboratorsvisible("admin")} + style={{display:this.props.identity===1?"block":"none"}} + data-remote="true" + className="edu-default-btn edu-greenback-btn fr mr20 height40">更换管理员 +

+ + + +
+ 选择的成员将会成为新的管理员
您将不再拥有管理员的权限,但您仍是合作团队的一员 +
+ + +
+
    +
  • + + + { + Collaboratorslist.length === 0 ? "" : Collaboratorslist.map((item, key) => { + return ( + this.addadminredio(item.user_id)}>{item.name} + ) + }) + } + + +
  • +
+
+ + + +
+ + + this.onSearchadmin(value)} + onInput={this.onSearchadmins} + style={{width: '100%'}} + /> + +
+

+ 姓名 + 职位 + 单位 +

+
+
    + {Searchadmin.length === 0 ?
  • + 请试试搜索一下 +
  • : Searchadmin.map((item, key) => { + return ( +
  • + this.selectChangenickname(e, key)} + id={item.user_id}> + {item.nickname} + {item.identify} + {item.school_name} +
  • + ) + }) + + } +
+
+
+ +
+ + + 全选 +
+ 请至少选择一个用户 +
+
+ + +
+ + +
+ +
+ { + collaboratorList===undefined?"":collaboratorList.map((item,key)=>{ + if(key + + 用户头像 +
+

+ {item.user.name} + + {item.user.shixun_manager === true ? "(管理员)" : ""} +

+ +

{item.user.identity}{item.user.school_name}

+ +

+ 发布  {item.user.user_shixuns_count} + {/*粉丝  */} + {/*{item.user.fans_count}*/} + {/**/} +

+ +

{item.user.brief_introduction}

+ + +
+ + {item.user.shixun_manager === true ? "" : this.collaborators_delete(item.user.user_id)}>删除} + {/*取消关注*/} +
+ + ) + } + }) + } + +
+
确定要删除吗?
+
+ + +
+
+ +
10&&collaboratorListsumtype===true?"":"none"} + style={{textAlign:'center',borderTop:'1px solid #eee'}}> + 加载更多 +
+ + + + ); + } +} + +export default Collaborators; diff --git a/public/react/src/modules/tpm/shixunchild/Propaedeutics/Propaedeu_tics.js b/public/react/src/modules/tpm/shixunchild/Propaedeutics/Propaedeu_tics.js index dc4ef6fb2..c90f151c5 100644 --- a/public/react/src/modules/tpm/shixunchild/Propaedeutics/Propaedeu_tics.js +++ b/public/react/src/modules/tpm/shixunchild/Propaedeutics/Propaedeu_tics.js @@ -1,110 +1,110 @@ -import React, { Component } from 'react'; - -import { Redirect } from 'react-router'; - -import { BrowserRouter as Router, Route, Link, Switch } from "react-router-dom"; - -import PropTypes from 'prop-types'; - -import classNames from 'classnames'; - -import { getImageUrl, toPath } from 'educoder'; - -import axios from 'axios'; - -import { CircularProgress } from 'material-ui/Progress'; - -const $ = window.$; - -class Propaedeutics extends Component { - constructor(props) { - super(props) - this.state={ - PropaedeuticsListcontent:undefined, - shixunId:undefined - } - } - - componentDidMount() { - let id = this.props.match.params.shixunId; - this.setState({ - shixunId:id - }) - let url="/shixuns/"+id+"/propaedeutics.json"; - axios.get(url).then((response) => { - - if (response.data.status === 403||response.data.status === 401||response.data.status === 500) { - - }else{ - if(response.data.content[0]!=null){ - this.setState({ - PropaedeuticsListcontent:response.data.content[0] - }) - }else{ - this.setState({ - PropaedeuticsListcontent:"" - }) - } - } - }).catch((error) => { - console.log(error) - }); - - } - - updatamakedown=(id)=>{ - setTimeout(()=>{ - var shixunDescr = window.editormd.markdownToHTML(id, { - htmlDecode: "style,script,iframe", - taskList: true, - tex: true, - flowChart: true, - sequenceDiagram: true - }); - $("#"+id+" p:first").addClass("ReactMarkdown"); - $('#collaborators_list_info').show() - }, 200) - } - render() { - let {loadingContent} = this.props; - let {PropaedeuticsListcontent,shixunId}=this.state - - if(PropaedeuticsListcontent!=undefined){ - this.updatamakedown("ReactMarkdown") - } - - return ( - -

- -

- { - loadingContent ? - : -
- {PropaedeuticsListcontent===undefined?"": -

- - {PropaedeuticsListcontent === undefined ||PropaedeuticsListcontent === ""? -

-
-
- -

暂无数据哦~

-
-
-
- :} - -

- } -
- } -
- ); - } -} - -export default Propaedeutics; +import React, { Component } from 'react'; + +import { Redirect } from 'react-router'; + +import { BrowserRouter as Router, Route, Link, Switch } from "react-router-dom"; + +import PropTypes from 'prop-types'; + +import classNames from 'classnames'; + +import { getImageUrl, toPath } from 'educoder'; + +import axios from 'axios'; + +import { CircularProgress } from 'material-ui/Progress'; + +const $ = window.$; + +class Propaedeutics extends Component { + constructor(props) { + super(props) + this.state={ + PropaedeuticsListcontent:undefined, + shixunId:undefined + } + } + + componentDidMount() { + let id = this.props.match.params.shixunId; + this.setState({ + shixunId:id + }) + let url="/shixuns/"+id+"/propaedeutics.json"; + axios.get(url).then((response) => { + + if (response.data.status === 403||response.data.status === 401||response.data.status === 500) { + + }else{ + if(response.data.content[0]!=null){ + this.setState({ + PropaedeuticsListcontent:response.data.content[0] + }) + }else{ + this.setState({ + PropaedeuticsListcontent:"" + }) + } + } + }).catch((error) => { + console.log(error) + }); + + } + + updatamakedown=(id)=>{ + setTimeout(()=>{ + var shixunDescr = window.editormd.markdownToHTML(id, { + htmlDecode: "style,script,iframe", + taskList: true, + tex: true, + flowChart: true, + sequenceDiagram: true + }); + $("#"+id+" p:first").addClass("ReactMarkdown"); + $('#collaborators_list_info').show() + }, 200) + } + render() { + let {loadingContent} = this.props; + let {PropaedeuticsListcontent,shixunId}=this.state + + if(PropaedeuticsListcontent!=undefined){ + this.updatamakedown("ReactMarkdown") + } + + return ( + +

+ +

+ { + loadingContent ? + : +
+ {PropaedeuticsListcontent===undefined?"": +

+ + {PropaedeuticsListcontent === undefined ||PropaedeuticsListcontent === ""? +

+
+
+ +

暂无数据哦~

+
+
+
+ :} + +

+ } +
+ } +
+ ); + } +} + +export default Propaedeutics; diff --git a/public/react/src/modules/tpm/shixunchild/Repository/Repository.js b/public/react/src/modules/tpm/shixunchild/Repository/Repository.js index 2e38e0143..617681d5f 100644 --- a/public/react/src/modules/tpm/shixunchild/Repository/Repository.js +++ b/public/react/src/modules/tpm/shixunchild/Repository/Repository.js @@ -1,247 +1,255 @@ -import React, { Component } from 'react'; - -import { Redirect } from 'react-router'; - -import { BrowserRouter as Router, Route, Link, Switch } from "react-router-dom"; - -import PropTypes from 'prop-types'; - -import classNames from 'classnames'; - -import axios from 'axios'; - -import { trace, trace_collapse ,getImageUrl, toPath} from "educoder"; - -import RepositoryDirectories from './RepositoryDirectories' -const $ = window.$; - -// 点击按钮复制功能 -function jsCopy(){ - var e = document.getElementById("copy_rep_content"); - e.select(); - document.execCommand("Copy"); -} -/** - 提交记录 - 使用指南 - */ -class Repository extends Component { - constructor(props) { - super(props); - - } - componentDidMount() { - } - onRepoFileClick = (item) => { - - this.props.fetchRepo(item) - - } - render() { - let { match, author, git_url, lastest_commit, trees, commits,repositoryLoading, pathArray } = this.props; - if (!author) { - author = {} - } - let userauthority=false; - if(this.props.author!=undefined){ - userauthority=this.props.author.login===""||this.props.author.user_id===""||this.props.author.login===null||this.props.author.user_id===null; - } - - // console.log(commits) - return ( - - {/* jfinalshop/WebRoot */} - {/*
- - - 分支 1 - - Git使用指南 -
*/} - - { repositoryLoading ?
: - -
-
-
-
-
- {/*
- -
- -
- - - - */} - - Git使用指南 - -
- - - { - jsCopy() - }} data-tip-down="点击复制版本库地址" - className="fl ml5"> - - - - - {/* Git使用指南 */} - - - { $('#repository_url_tip').css('display') === 'none' - ? $('#repository_url_tip').show() - : $('#repository_url_tip').hide() }} - className="fl ml6 mt1"> - - -
- -
-

请上传当前实训中各个关卡涉及的所有文件
- 包括任务文件、执行文件,以及其他的必须文件

- 提交代码的方法:
- 1、在电脑上安装Git tortoise客户端,
-      或者其它熟悉的Git客户端
- 2、在Git客户端上向左侧的地址提交代码

- 注意:
- 请在Git客户端要求填写时,按照如下说明填写:
- * 用户名:使用您在本平台绑定的邮箱
- * 口令:使用您在本平台的登录口令 -

-
-

{ $('#repository_url_tip').hide(); }}>知道了

-
-
-
- -
-
- - - {/* 用户、最近提交时间 */} - { - trees === undefined || trees === null ?
-
- -

暂无数据哦~

-
-
: -
-
- {author.name} - {commits[0].author.name} - 提交于 - - {commits===undefined?"":commits[0].time} - :{commits===undefined?"":commits[0].title} - - - - 提交记录 - -
- -
-
- {/* 当前目录位置 */} - - -
- {trees.map((item, index) => { - return ( -
  • - - - this.onRepoFileClick(item)}> -  {item.name} - - -
  • - ) - })} -
    -
    -
    -
    - } - - {/* 当前分支的文件 */} - -
    -
    - } -
    - - ); - } -} -/* - 提交记录 -
    - { RepositoryList===undefined?"":RepositoryList.commits.map((item,key)=>{ - // {"email":"李暾","title":"2\n","id":"80cb6fc55a14bdd64a9c99913f416966238ed3de","time":"49年前"} - return( -
    -
    {item.email}
    -
    {item.title}
    -
    {item.id}
    -
    {item.time}
    -
    - ) - }) } -
    - - - -
  • - - - 1-1.py - -
  • - - - -*/ - -export default Repository; +import React, { Component } from 'react'; + +import { Redirect } from 'react-router'; + +import { BrowserRouter as Router, Route, Link, Switch } from "react-router-dom"; + +import PropTypes from 'prop-types'; + +import classNames from 'classnames'; + +import axios from 'axios'; + +import { trace, trace_collapse ,getImageUrl, toPath} from "educoder"; + +import RepositoryDirectories from './RepositoryDirectories' +const $ = window.$; + +// 点击按钮复制功能 +function jsCopy(){ + var e = document.getElementById("copy_rep_content"); + e.select(); + document.execCommand("Copy"); +} +/** + 提交记录 + 使用指南 + */ +class Repository extends Component { + constructor(props) { + super(props); + + } + componentDidMount() { + } + onRepoFileClick = (item) => { + + this.props.fetchRepo(item) + + } + render() { + let { match, author, git_url, lastest_commit, trees, commits,repositoryLoading, pathArray } = this.props; + if (!author) { + author = {} + } + let userauthority=false; + if(this.props.author!=undefined){ + userauthority=this.props.author.login===""||this.props.author.user_id===""||this.props.author.login===null||this.props.author.user_id===null; + } + + // console.log(commits) + return ( + + {/* jfinalshop/WebRoot */} + {/*
    + + + 分支 1 + + Git使用指南 +
    */} + + { repositoryLoading ?
    : + +
    +
    +
    +
    +
    + {/*
    + +
    + +
    + + + + */} + + Git使用指南 + +
    + + + { + jsCopy() + }} data-tip-down="点击复制版本库地址" + className="fl ml5"> + + + + + {/* Git使用指南 */} + + + { $('#repository_url_tip').css('display') === 'none' + ? $('#repository_url_tip').show() + : $('#repository_url_tip').hide() }} + className="fl ml6 mt1"> + + + + +
    +
    + +
    +
    + + + {/* 用户、最近提交时间 */} + { + trees === undefined || trees === null ?
    +
    + +

    暂无数据哦~

    +
    +
    : +
    +
    + {author.name} + {commits[0].author.name} + 提交于 + + {commits===undefined?"":commits[0].time} + :{commits===undefined?"":commits[0].title} + + + + 提交记录 + +
    + +
    +
    + {/* 当前目录位置 */} + + +
    + {trees.map((item, index) => { + return ( +
  • + + + this.onRepoFileClick(item)}> +  {item.name} + + +
  • + ) + })} +
    +
    +
    +
    + } + + {/* 当前分支的文件 */} + +
    +
    + } +
    + + ); + } +} +/* + 提交记录 +
    + { RepositoryList===undefined?"":RepositoryList.commits.map((item,key)=>{ + // {"email":"李暾","title":"2\n","id":"80cb6fc55a14bdd64a9c99913f416966238ed3de","time":"49年前"} + return( +
    +
    {item.email}
    +
    {item.title}
    +
    {item.id}
    +
    {item.time}
    +
    + ) + }) } +
    + + + +
  • + + + 1-1.py + +
  • + + + +*/ + +export default Repository;