From 070aa17b450a3ea4f79f6214da12e80742710fbd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Sat, 7 Sep 2019 15:05:49 +0800 Subject: [PATCH 01/73] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../shixunHomework/Listofworksstudentone.js | 97 +------------------ 1 file changed, 5 insertions(+), 92 deletions(-) diff --git a/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js b/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js index 2253cc1f3..272cdcd50 100644 --- a/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js +++ b/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js @@ -2553,9 +2553,9 @@ class Listofworksstudentone extends Component { let course_is_end = this.props.current_user&&this.props.current_user.course_is_end; // if(this.props.isAdmin() === false){ - // if(teacherdata.student_works!==undefined){ - // if(teacherdata.student_works.length>0){ - // + // if(teacherdata&&teacherdata.student_works){ + // if(teacherdata&&teacherdata.student_works.length>0){ + // console.log("这是双层页面。。。。"); // // } // } @@ -3243,42 +3243,9 @@ class Listofworksstudentone extends Component { </div>:"") } </span>} - {/* {teacherdata&&teacherdata.task_operation&&teacherdata.task_operation[0]==="开启挑战"?"":<span>*/} - {/*{computeTimetype===true?*/} - {/* (this.props.isNotMember()===false?<div className={"computeTime font-16"} onClick={this.setComputeTime}>*/} - {/* 查看最新成绩*/} - {/* </div>:""):*/} - {/* teacherdata&&teacherdata.homework_status!==undefined&&teacherdata.homework_status[0]=== "未发布"? "":*/} - {/* (this.props.isNotMember()===false?<div className="computeTimes font-16">*/} - {/* 查看最新成绩*/} - {/* </div>:"")*/} - {/*}*/} - {/*</span>}*/} - </div> - {/*因为计算按钮占了和这个位置,和设计沟通学生视角取消这个按钮*/} - {/*<div className="fr edu-menu-panel">*/} - {/*<ul>*/} - {/*<li className="edu-position edu-position-hidebox">*/} - {/*<a className="font-12 ">*/} - {/*{order === "updated_at" ? "时间" : order === "work_score" ? "成绩" : order === "student_id" ? "学号" : ""}排序</a>*/} - {/*<i className="iconfont icon-xiajiantou ml5 font-12 "></i>*/} - {/*<ul className="edu-position-hide undis mt10">*/} - {/*<li><a onClick={(e) => this.funorder("updated_at")} data-remote="true"*/} - {/*className="color-grey-6 font-12" style={{"text-align": "center "}}>更新时间</a></li>*/} - {/*<li><a onClick={(e) => this.funorder("work_score")} data-remote="true"*/} - {/*className="color-grey-6 font-12" style={{"text-align": "center "}}>最终成绩</a></li>*/} - {/*<li><a onClick={(e) => this.funorder("student_id")} data-remote="true"*/} - {/*className="color-grey-6 font-12" style={{"text-align": "center "}}>学生学号</a></li>*/} - {/*</ul>*/} - {/*</li>*/} - {/*</ul>*/} - {/*</div>*/} - - </div> - +s </div> </div> - <div className={"justify break_full_word new_li"} style={{minHeight: "480px"}}> <style>{` @@ -3309,7 +3276,6 @@ class Listofworksstudentone extends Component { loading={loadingstate} />} </div> - </div> { teacherdata && teacherdata.work_count && teacherdata.work_count > limit ? @@ -3330,18 +3296,10 @@ class Listofworksstudentone extends Component { <p className="edu-nodata-p mb30">暂时还没有相关数据哦!</p> </div> </div> - </div> } - - - {/*///*/} - - </div> - </div> - </div> } </div> @@ -3351,49 +3309,4 @@ class Listofworksstudentone extends Component { } } -export default Listofworksstudentone; -{/*<div className="stud-class-set bor-bottom-greyE ">*/} -{/* <div className=" clearfix edu-back-white poll_list">*/} -{/* <a className="active" onClick={(e)=>this.ChangeTab(0)}>作品列表</a>*/} -{/* <a onClick={(e)=>this.ChangeTab(1)}>作业问答</a>*/} -{/* <a*/} -{/* onClick={(e)=>this.ChangeTab(3)}*/} -{/* >设置</a>*/} -{/* {this.state.view_report===true?<a className="fr color-blue font-16" target={"_blank"}*/} -{/* href={`/courses/${this.state.props.match.params.coursesId}/${this.state.shixuntypes}/${teacherdata === undefined ? "" : teacherdata.id}/shixun_work_report`}>*/} -{/* 查看实训报告*/} -{/* </a>:""}*/} -{/* /!*<a className="fr color-blue font-16">查看实训报告</a>*!/*/} -{/* {*/} -{/* teacherdata === undefined ? ""*/} -{/* : teacherdata.commit_des === null || teacherdata.commit_des === undefined ? "" :*/} -{/* <a className="fr color-blue font-16"*/} -{/* href={`/courses/${this.state.props.match.params.coursesId}/${this.state.shixuntypes}/${teacherdata === undefined ? "" : teacherdata.id}/commitsummary/${this.state.props.match.params.homeworkid}`}>{teacherdata.commit_des}</a>*/} -{/* }*/} -{/* {teacherdata === undefined ? "" : <Startshixuntask*/} -{/* {...this.props}*/} -{/* data={teacherdata}*/} -{/* />}*/} -{/* </div>*/} -{/*</div>*/} -{/*<div className="stud-class-set bor-bottom-greyE ">*/} -{/* <div className=" clearfix edu-back-white poll_list">*/} -{/* <Link className="active" onClick={(e)=>this.ChangeTab(0)}>作品列表</Link>*/} -{/* <Link onClick={(e)=>this.ChangeTab(1)}>作业问答</Link>*/} -{/* <Link onClick={(e)=>this.ChangeTab(3)}>设置</Link>*/} -{/* {this.state.view_report===true?<Link className="fr color-blue font-16" target={"_blank"}*/} -{/* to={`/courses/${this.state.props.match.params.coursesId}/${this.state.shixuntypes}/${this.state.props.match.params.homeworkid}/shixun_work_report`}>*/} -{/* 查看实训报告*/} -{/* </Link>:""}*/} -{/* {*/} -{/* teacherdata === undefined ? ""*/} -{/* : teacherdata.commit_des === null || teacherdata.commit_des === undefined ? "" :*/} -{/* <a className="fr color-blue font-16"*/} -{/* href={`/courses/${this.state.props.match.params.coursesId}/${this.state.shixuntypes}/${teacherdata === undefined ? "" : teacherdata.id}/commitsummary/${this.state.props.match.params.homeworkid}`}>{teacherdata.commit_des}</a>*/} -{/* }*/} -{/* {teacherdata === undefined ? "" : <Startshixuntask*/} -{/* {...this.props}*/} -{/* data={teacherdata}*/} -{/* />}*/} -{/* </div>*/} -{/*</div>*/} \ No newline at end of file +export default Listofworksstudentone; \ No newline at end of file From f5b4cc0c54f7adfc689ec7bfa04c10d58e24ea63 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Sat, 7 Sep 2019 15:37:01 +0800 Subject: [PATCH 02/73] =?UTF-8?q?=E6=B5=8B=E8=AF=95=E7=89=88=E8=B0=83?= =?UTF-8?q?=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../shixunHomework/Listofworksstudentone.js | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js b/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js index 272cdcd50..7d2a9ec39 100644 --- a/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js +++ b/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js @@ -2552,15 +2552,21 @@ class Listofworksstudentone extends Component { // console.log(this.props.isAdmin()); let course_is_end = this.props.current_user&&this.props.current_user.course_is_end; - // if(this.props.isAdmin() === false){ - // if(teacherdata&&teacherdata.student_works){ - // if(teacherdata&&teacherdata.student_works.length>0){ - // console.log("这是双层页面。。。。"); + // try { + // if(this.props.isAdmin() === false){ + // if(teacherdata&&teacherdata.student_works){ + // if(teacherdata&&teacherdata.student_works.length>0){ + // console.log("这是双层页面。。。。"); // - // } - // } + // } + // } // + // } + // }catch (e) { + // console.log("Listofworksstudentone123"); + // console.log(e); // } + return ( this.props.isAdmin() === true ? ( From 671e05622d79554a3351855ef3bb3e9cd0af56db Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Sat, 7 Sep 2019 16:23:28 +0800 Subject: [PATCH 03/73] =?UTF-8?q?=E8=87=AA=E5=B7=B1=E5=88=86=E6=94=AF?= =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../shixunHomework/Listofworksstudentone.js | 30 +++++++++---------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js b/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js index 7d2a9ec39..0887cfbec 100644 --- a/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js +++ b/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js @@ -2552,20 +2552,20 @@ class Listofworksstudentone extends Component { // console.log(this.props.isAdmin()); let course_is_end = this.props.current_user&&this.props.current_user.course_is_end; - // try { - // if(this.props.isAdmin() === false){ - // if(teacherdata&&teacherdata.student_works){ - // if(teacherdata&&teacherdata.student_works.length>0){ - // console.log("这是双层页面。。。。"); - // - // } - // } - // - // } - // }catch (e) { - // console.log("Listofworksstudentone123"); - // console.log(e); - // } + try { + if(this.props.isAdmin() === false){ + if(teacherdata&&teacherdata.student_works){ + if(teacherdata&&teacherdata.student_works.length>0){ + console.log("这是双层页面。。。。"); + + } + } + + } + }catch (e) { + console.log("Listofworksstudentone123"); + console.log(e); + } return ( this.props.isAdmin() === true ? @@ -3250,7 +3250,7 @@ class Listofworksstudentone extends Component { } </span>} </div> -s </div> + </div> </div> <div className={"justify break_full_word new_li"} style={{minHeight: "480px"}}> From 6be83e182d853696b78fbc47dbb99fe6a24f56d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Sat, 7 Sep 2019 17:01:20 +0800 Subject: [PATCH 04/73] =?UTF-8?q?=E8=87=AA=E5=B7=B1=E5=88=86=E6=94=AF?= =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../shixunHomework/Listofworksstudentone.js | 230 ++++++++++-------- .../modules/courses/shixunHomework/style.css | 16 +- 2 files changed, 149 insertions(+), 97 deletions(-) diff --git a/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js b/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js index 0887cfbec..285836c8f 100644 --- a/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js +++ b/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js @@ -93,27 +93,32 @@ class Listofworksstudentone extends Component { key: 'number', align: "center", className:'font-14', + width:'100px', render: (text, record) => ( - <span> + <span style={{width:'100px'}}> {record.number === undefined ? <span style={{ color: '#9A9A9A', - textAlign: "center" + textAlign: "center", + width:'100px' }}> --</span> : record.number === "" ? <span style={{ color: '#9A9A9A', - textAlign: "center" + textAlign: "center", + width:'100px' }}>--</span> : record.number === "--" ? <span style={{ color: '#9A9A9A', - textAlign: "center" + textAlign: "center", + width:'100px' }}>--</span> : <span style={{ color: '#07111B', - textAlign: "center" + textAlign: "center", + width:'100px' }}> {record.number}</span> } </span> @@ -124,37 +129,42 @@ class Listofworksstudentone extends Component { dataIndex: 'name', key: 'name', align: "center", - className:'font-14 maxnamewidth100', + className:'font-14 maxnamewidth110', width:'100px', render: (text, record) => ( - <span className="maxnamewidth100"> + <span className="maxnamewidth110"> {record.name === undefined ? <span style={{ - "color": '#9A9A9A', - textAlign: "center" + color: '#9A9A9A', + textAlign: "center", + width:'100px' }}>--</span> : record.name === "" ? <span style={{ - "color": '#9A9A9A', - textAlign: "center" + color: '#9A9A9A', + textAlign: "center", + width:'100px' }}>--</span> : record.name === null ? <span style={{ - "color": '#9A9A9A', - textAlign: "center" + color: '#9A9A9A', + textAlign: "center", + width:'100px' }}>--</span> : record.name === "--" ? <span style={{ - "color": '#9A9A9A', - textAlign: "center" + color: '#9A9A9A', + textAlign: "center", + width:'100px' }}>--</span> : - <a className="maxnamewidth100" title={record.name} style={{ - "color": '#07111B', - textAlign: "center" + <a className="maxnamewidth110" title={record.name} style={{ + color: '#07111B', + textAlign: "center", + width:'100px' }}>{record.name}</a> } @@ -166,34 +176,41 @@ class Listofworksstudentone extends Component { dataIndex: 'stduynumber', key: 'stduynumber', align: "center", - className:'font-14 maxnamewidth110', + className:'font-14 maxnamewidth145', + width:'145px', render: (text, record) => ( - <span className="maxnamewidth110"> + <span className="maxnamewidth145" style={{ + width:'145px', + }}> {record.stduynumber === undefined ? <span style={{ - "color": '#9A9A9A', - textAlign: "center" + color: '#9A9A9A', + textAlign: "center", + width:'145px', }}>-- </span> : record.stduynumber === null ? <span style={{ - "color": '#9A9A9A', - textAlign: "center" + color: '#9A9A9A', + textAlign: "center", + width:'145px', }}>-- </span> : record.stduynumber === "" ? <span style={{ - "color": '#9A9A9A', - textAlign: "center" + color: '#9A9A9A', + textAlign: "center", + width:'145px', }}>-- </span> : <a title={record.stduynumber} - className="maxnamewidth110" + className="maxnamewidth145" style={{ - "color": '#9A9A9A', - textAlign: "center" + color:'#9A9A9A', + textAlign: "center", + width:'145px', }}>{ record.stduynumber } @@ -210,11 +227,13 @@ class Listofworksstudentone extends Component { dataIndex: 'classroom', align: "center", className:'font-14', + width:'145px', render: (text, record) => ( - <span> - <span className="ysltable" style={{ - "color": '#9A9A9A', - textAlign: "center" + <span className="font-14 maxnamewidth145" style={{width:'145px'}}> + <span className=" font-14 maxnamewidth145" style={{ + color: '#9A9A9A', + textAlign: "center", + width:'145px', }}>{record.classroom === undefined ? "--" : record.classroom === "" ? "--" : record.classroom === null ? "--" : record.classroom}</span> </span> ), @@ -225,14 +244,17 @@ class Listofworksstudentone extends Component { key: 'submitstate', align: "center", className:'font-14', + width:'98px', render: (text, record) => ( - <span> + <span style={{width:'98px',}}> <span style={record.submitstate === "延时提交" ? { - "color": '#DD1717', - textAlign: "center" - } : record.submitstate === "按时提交" ? {"color": '#29BD8B', textAlign: "center"} : { - "color": '#747A7F', - textAlign: "center" + color: '#DD1717', + textAlign: "center", + width:'98px', + } : record.submitstate === "按时提交" ? {color: '#29BD8B', textAlign: "center",width:'98px',} : { + color: '#747A7F', + textAlign: "center", + width:'98px', }}>{record.submitstate === undefined ? "--" : record.submitstate === "" ? "--" : record.submitstate === null ? "--" : record.submitstate}</span> </span> @@ -244,11 +266,13 @@ class Listofworksstudentone extends Component { key: 'cost_time', align: 'center', className:'font-14', + width:'145px', render: (text, record) => ( <span style={ { color: '#747A7F', - textAlign: "center" + textAlign: "center", + width:'145px', } }> {record.cost_time === null? "--":record.cost_time === undefined?"--":record.cost_time === "--"?"--": @@ -258,7 +282,8 @@ class Listofworksstudentone extends Component { <span style={ { color: '#747A7F', - textAlign: "center" + textAlign: "center", + width:'145px', } } >{record.cost_time === null ? "--":record.cost_time === undefined ?"--":record.cost_time} @@ -278,7 +303,7 @@ class Listofworksstudentone extends Component { // render: (text, record) => ( // <span> // <span style={{ - // "color": '#9A9A9A', + // color: '#9A9A9A', // "text-align": "center" // }}>{record.updatetime === undefined ? "--" : record.updatetime === "" ? "--" : record.updatetime}</span> // </span> @@ -290,9 +315,12 @@ class Listofworksstudentone extends Component { key: 'completion', align: "center", className:'font-14', + width:'99px', render: (text, record) => ( - <span> - <span style={{color: '#07111B',textAlign: "center"}}>{record.completion+"/"+this.state.challenges_count}</span> + <span style={{ + width:'99px', + }}> + <span style={{color: '#07111B',textAlign: "center", width:'99px'}}>{record.completion+"/"+this.state.challenges_count}</span> </span> ), }, @@ -302,17 +330,23 @@ class Listofworksstudentone extends Component { key: 'levelscore', align: 'center', className:'font-14', + width:'99px', render: (text, record) => ( - <span> + <span style={{ + width:'99px', + }}> <span style={parseInt(record.levelscore) <= 60 ? { color: '#747A7F', - textAlign: "center" + textAlign: "center", + width:'99px', } : parseInt(record.levelscore) < 90 ? { color: '#FF6800', - textAlign: "center" - } : parseInt(record.levelscore) >= 90 ? {color: '#DD1717', textAlign: "center"} : { + textAlign: "center", + width:'99px', + } : parseInt(record.levelscore) >= 90 ? {color: '#DD1717', textAlign: "center", width:'99px',} : { color: '#747A7F', - textAlign: "center" + textAlign: "center", + width:'99px', }}>{record.levelscore}</span> </span> ) @@ -323,25 +357,31 @@ class Listofworksstudentone extends Component { key: 'efficiencyscore', align: 'center', className:'font-14', + width:'80px', render: (text, record) => ( - <span> + <span style={{ + width:'80px', + }}> { record.efficiencyscore&& record.efficiencyscore=== "--"?( - <span style={{color:"#9A9A9A"}}> + <span style={{color:"#9A9A9A", width:'80px',}}> -- </span> ) : <span style={parseInt(record.efficiencyscore) <= 60 ? { color: '#747A7F', - textAlign: "center" + textAlign: "center", + width:'80px', } : parseInt(record.efficiencyscore) < 90 ? { color: '#FF6800', - textAlign: "center" + textAlign: "center", + width:'80px', } : parseInt(record.efficiencyscore) >= 90 ? { color: '#DD1717', - textAlign: "center" - } : {color: '#747A7F', textAlign: "center"}}>{record.efficiencyscore}</span> + textAlign: "center", + width:'80px', + } : {color: '#747A7F', textAlign: "center", width:'80px',}}>{record.efficiencyscore}</span> } </span> @@ -353,19 +393,22 @@ class Listofworksstudentone extends Component { key: 'levelscore', align: "center", className:'font-14', + width:'99px', render: (text, record) => ( - <span> + <span style={{width:'99px',}}> { record.levelscore && record.levelscore === "--"? - <span style={{color: '#9A9A9A', textAlign: "center"}}>{record.levelscore}</span> + <span style={{color: '#9A9A9A', textAlign: "center",width:'99px',}}>{record.levelscore}</span> : <span style={parseInt(record.levelscore) >=90 ? { color: '#DD1717', - textAlign: "center" + textAlign: "center", + width:'99px', } : parseInt(record.levelscore) <= 60?{ color: '#FF6800', textAlign: "center", - }: {color: '#747A7F', textAlign: "center"}}>{record.levelscore}</span> + width:'99px', + }: {color: '#747A7F', textAlign: "center",width:'99px',}}>{record.levelscore}</span> } </span> @@ -391,7 +434,6 @@ class Listofworksstudentone extends Component { ), }, ], - orders: "", b_order:"desc", allow_late:false, @@ -408,8 +450,8 @@ class Listofworksstudentone extends Component { course_group: null, publish_immediately: undefined, end_immediately: undefined, - mystyle: {"display": "block", "color": '#07111B', textAlign: "center"}, - mystyles: {"display": "none", "color": '#07111B', textAlign: "center"}, + mystyle: {"display": "block", color: '#07111B', textAlign: "center"}, + mystyles: {"display": "none", color: '#07111B', textAlign: "center"}, mystyle1: {"display": "block"}, mystyles1: {"display": "none"}, unlimited: 0, @@ -426,7 +468,7 @@ class Listofworksstudentone extends Component { align: 'center', className:'font-14', render: (text, record) => ( - <span style={{"color": '#07111B', textAlign: "center"}}>{record.number} + <span style={{color: '#07111B', textAlign: "center"}}>{record.number} </span> ) }, @@ -438,7 +480,7 @@ class Listofworksstudentone extends Component { className:'font-14 maxnamewidth100', width:'100px', render: (text, record) => ( - <a className="maxnamewidth100" title={record.name} style={{"color": '#07111B', textAlign: "center"}}>{record.name}</a> + <a className="maxnamewidth100" title={record.name} style={{color: '#07111B', textAlign: "center"}}>{record.name}</a> ) }, { @@ -492,7 +534,7 @@ class Listofworksstudentone extends Component { className:'font-14', render: (text, record) => ( <span> - {record.classroom === undefined ?<span className="ysltable" style={{"color": '#07111B', textAlign: "center"}}> --</span> : record.classroom === "" ? <span className="ysltable" style={{"color": '#07111B',textAlign: "center"}}>--</span>: record.classroom === null ? <span className="ysltable" style={{"color": '#07111B', textAlign: "center"}}>--</span> : <span className="ysltable" style={{"color": '#07111B',textAlign: "center"}}>{record.classroom}</span>} + {record.classroom === undefined ?<span className="ysltable" style={{color: '#07111B', textAlign: "center"}}> --</span> : record.classroom === "" ? <span className="ysltable" style={{color: '#07111B',textAlign: "center"}}>--</span>: record.classroom === null ? <span className="ysltable" style={{color: '#07111B', textAlign: "center"}}>--</span> : <span className="ysltable" style={{color: '#07111B',textAlign: "center"}}>{record.classroom}</span>} </span> ) }, @@ -544,7 +586,7 @@ class Listofworksstudentone extends Component { </span> // <a style={ // { - // "color": '#747A7F', + // color: '#747A7F', // "text-align": "center" // } // } @@ -561,7 +603,7 @@ class Listofworksstudentone extends Component { // align: 'center', // className:'font-14', // render: (text, record) => ( - // <span style={{"color": '#9A9A9A', "text-align": "center"}}>{record.updatetime}</span> + // <span style={{color: '#9A9A9A', "text-align": "center"}}>{record.updatetime}</span> // ), // }, { @@ -576,7 +618,7 @@ class Listofworksstudentone extends Component { <Tooltip placement="bottom" title={<div> <div>已通过{record.completion}关,共{this.state.challenges_count}关</div> </div>}> - <span style={{"color": '#07111B', "text-align": "center"}}>{record.completion+"/"+this.state.challenges_count} </span> + <span style={{color: '#07111B', "text-align": "center"}}>{record.completion+"/"+this.state.challenges_count} </span> </Tooltip> </span> @@ -591,13 +633,13 @@ class Listofworksstudentone extends Component { render: (text, record) => ( <span> <span style={parseInt(record.levelscore) <= 60 ? { - "color": '#747A7F', + color: '#747A7F', "text-align": "center" } : parseInt(record.levelscore) < 90 ? { - "color": '#FF6800', + color: '#FF6800', "text-align": "center" - } : parseInt(record.levelscore) >= 90 ? {"color": '#DD1717', "text-align": "center"} : { - "color": '#747A7F', + } : parseInt(record.levelscore) >= 90 ? {color: '#DD1717', "text-align": "center"} : { + color: '#747A7F', "text-align": "center" }}>{record.levelscore}</span> </span> @@ -637,15 +679,15 @@ class Listofworksstudentone extends Component { ) : <span style={parseInt(record.efficiencyscore) <= 60 ? { - "color": '#747A7F', + color: '#747A7F', "text-align": "center" } : parseInt(record.efficiencyscore) < 90 ? { - "color": '#FF6800', + color: '#FF6800', "text-align": "center" } : parseInt(record.efficiencyscore) >= 90 ? { - "color": '#DD1717', + color: '#DD1717', "text-align": "center" - } : {"color": '#747A7F', "text-align": "center"}}>{record.efficiencyscore}</span> + } : {color: '#747A7F', "text-align": "center"}}>{record.efficiencyscore}</span> } </span> @@ -669,18 +711,18 @@ class Listofworksstudentone extends Component { record.finalscore&&record.finalscore==="--"? <span style= {{ - "color": '#9A9A9A', + color: '#9A9A9A', "text-align": "center" }}>{record.finalscore}</span> : <span style={parseInt(record.finalscore) <= 60 ? { - "color": '#747A7F', + color: '#747A7F', "text-align": "center" } : parseInt(record.finalscore) < 90 ? { - "color": '#FF6800', + color: '#FF6800', "text-align": "center" - } : parseInt(record.finalscore) >= 90 ? {"color": '#DD1717', "text-align": "center"} : { - "color": '#747A7F', + } : parseInt(record.finalscore) >= 90 ? {color: '#DD1717', "text-align": "center"} : { + color: '#747A7F', "text-align": "center" }}>{record.finalscore}</span> } @@ -697,18 +739,18 @@ class Listofworksstudentone extends Component { record.finalscore&&record.finalscore==="--"? <span style= {{ - "color": '#9A9A9A', + color: '#9A9A9A', "text-align": "center" }}>{record.finalscore}</span> : <span style={parseInt(record.finalscore) <= 60 ? { - "color": '#747A7F', + color: '#747A7F', "text-align": "center" } : parseInt(record.finalscore) < 90 ? { - "color": '#FF6800', + color: '#FF6800', "text-align": "center" - } : parseInt(record.finalscore) >= 90 ? {"color": '#DD1717', "text-align": "center"} : { - "color": '#747A7F', + } : parseInt(record.finalscore) >= 90 ? {color: '#DD1717', "text-align": "center"} : { + color: '#747A7F', "text-align": "center" }}>{record.finalscore}</span> } @@ -742,7 +784,7 @@ class Listofworksstudentone extends Component { align: 'center', className:'font-14', render: (text, record) => ( - <span style={{"color": '#07111B', "text-align": "center"}}>{record.number} + <span style={{color: '#07111B', "text-align": "center"}}>{record.number} </span> ) }, @@ -754,7 +796,7 @@ class Listofworksstudentone extends Component { className:'font-14 maxnamewidth100', width:'100px', render: (text, record) => ( - <a className="maxnamewidth100" title={record.name} style={{"color": '#07111B', "text-align": "center"}}>{record.name}</a> + <a className="maxnamewidth100" title={record.name} style={{color: '#07111B', "text-align": "center"}}>{record.name}</a> ) }, { @@ -767,19 +809,19 @@ class Listofworksstudentone extends Component { <span className="maxnamewidth110"> {record.stduynumber === undefined ? <span style={{ - "color": '#9A9A9A', + color: '#9A9A9A', "text-align": "center" }}>-- </span> : record.stduynumber === null ? <span style={{ - "color": '#9A9A9A', + color: '#9A9A9A', "text-align": "center" }}>-- </span> : record.stduynumber === "" ? <span style={{ - "color": '#9A9A9A', + color: '#9A9A9A', "text-align": "center" }}>-- </span> @@ -837,7 +879,7 @@ class Listofworksstudentone extends Component { // align: 'center', // className:'font-14', // render: (text, record) => ( - // <span style={{"color": '#9A9A9A', "text-align": "center"}}>{record.updatetime}</span> + // <span style={{color: '#9A9A9A', "text-align": "center"}}>{record.updatetime}</span> // ), // }, { @@ -1044,10 +1086,6 @@ class Listofworksstudentone extends Component { datajs:[], } - // console.log("902"); - // console.log("902"); - // console.log(this.props); - } componentDidCatch(error, info){ console.log("-----------------------------905错误信息"); diff --git a/public/react/src/modules/courses/shixunHomework/style.css b/public/react/src/modules/courses/shixunHomework/style.css index c2affa32c..0ad96345e 100644 --- a/public/react/src/modules/courses/shixunHomework/style.css +++ b/public/react/src/modules/courses/shixunHomework/style.css @@ -38,13 +38,27 @@ .TopicDetailTable .bottomBody li:last-child{border-bottom: none;} .maxnamewidth100{ - max-width: 145px; + 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; +} +.maxnamewidth145{ + max-width: 145px; + overflow:hidden; + text-overflow:ellipsis; + white-space:nowrap; + cursor: default; +} +.maxnamewidth145{ max-width: 145px; overflow:hidden; text-overflow:ellipsis; From e82e1c0ed279666d1e1ea04e3d4a58ff331fc8d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Sat, 7 Sep 2019 17:04:36 +0800 Subject: [PATCH 05/73] =?UTF-8?q?=E8=AF=BE=E5=A0=82=E7=AE=A1=E7=90=86?= =?UTF-8?q?=E8=80=85=E6=89=8D=E6=9C=89=E6=9D=83=E5=88=A9=E8=BF=9B=E8=A1=8C?= =?UTF-8?q?=E7=AE=A1=E7=90=86=E5=85=AC=E5=91=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../react/src/modules/courses/gradinforms/Bullsubdirectory.js | 4 ++-- public/react/src/modules/courses/gradinforms/Eduinforms.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/public/react/src/modules/courses/gradinforms/Bullsubdirectory.js b/public/react/src/modules/courses/gradinforms/Bullsubdirectory.js index ae77b0cf3..933044cfb 100644 --- a/public/react/src/modules/courses/gradinforms/Bullsubdirectory.js +++ b/public/react/src/modules/courses/gradinforms/Bullsubdirectory.js @@ -241,7 +241,7 @@ class Bullsubdirectory extends Component{ <div> <span className="fr yslbianji" style={{marginRight:"17px"}}> { - this.props.isAdmin() === true ? + this.props.isClassManagement() === true ? (this.props.yslbool===false? <Tooltip placement="bottom" title={<div> 编辑 @@ -256,7 +256,7 @@ class Bullsubdirectory extends Component{ </span> <span className="fr yslbianji" style={{marginRight:"22px"}}> { - this.props.isAdmin() === true ? + this.props.isClassManagement() === true ? (this.props.yslbool===false? <Tooltip placement="bottom" title={<div> 删除 diff --git a/public/react/src/modules/courses/gradinforms/Eduinforms.js b/public/react/src/modules/courses/gradinforms/Eduinforms.js index 14bcfa11a..6b375fccf 100644 --- a/public/react/src/modules/courses/gradinforms/Eduinforms.js +++ b/public/react/src/modules/courses/gradinforms/Eduinforms.js @@ -231,7 +231,7 @@ class Eduinforms extends Component{ <p style={{height: '20px'}}> <span className="font-18 fl color-dark-21">公告栏</span> { - this.props.isAdmin()===true? + this.props.isClassManagement() === true? (this.state.yslbool===false? <li className="btn colorblue font-16 fr bluebkbk pointer" onClick={() => this.bianji(true)}> From 4a53d1a5aa74836b5decc9077028d4e2e526686d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Sat, 7 Sep 2019 17:52:39 +0800 Subject: [PATCH 06/73] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../shixunHomework/Listofworksstudentone.js | 436 +++++++++++++++++- .../modules/courses/shixunHomework/style.css | 7 + 2 files changed, 419 insertions(+), 24 deletions(-) diff --git a/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js b/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js index 285836c8f..534078e74 100644 --- a/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js +++ b/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js @@ -226,15 +226,38 @@ class Listofworksstudentone extends Component { key: 'classroom', dataIndex: 'classroom', align: "center", - className:'font-14', + className:'font-14 maxnamewidth145', width:'145px', render: (text, record) => ( <span className="font-14 maxnamewidth145" style={{width:'145px'}}> - <span className=" font-14 maxnamewidth145" style={{ - color: '#9A9A9A', - textAlign: "center", - width:'145px', - }}>{record.classroom === undefined ? "--" : record.classroom === "" ? "--" : record.classroom === null ? "--" : record.classroom}</span> + {record.classroom === undefined ? + <a className=" font-14 maxnamewidth145" + style={{ + color: '#9A9A9A', + textAlign: "center", + width:'145px', + }}>--</a> : record.classroom === "" ? + <a className=" font-14 maxnamewidth145" + style={{ + color: '#9A9A9A', + textAlign: "center", + width:'145px', + }}>--</a> : record.classroom === null ? + <a className=" font-14 maxnamewidth145" + style={{ + color: '#9A9A9A', + textAlign: "center", + width:'145px', + }}>--</a> + : + <a className=" font-14 maxnamewidth145" + title={record.classroom} + style={{ + color: '#9A9A9A', + textAlign: "center", + width:'145px', + }}>{record.classroom}</a> + } </span> ), }, @@ -430,6 +453,373 @@ class Listofworksstudentone extends Component { onClick={() => this.Viewstudenttraininginformation(record)}>{record.operating}</a> } + </span> + ), + }, + ], + columnsstu2: [ + // { + // title: '序号', + // dataIndex: 'number', + // key: 'number', + // align: "center", + // className:'font-14', + // width:'100px', + // render: (text, record) => ( + // <span style={{width:'100px'}}> + // {record.number === undefined ? + // <span style={{ + // color: '#9A9A9A', + // textAlign: "center", + // width:'100px' + // }}> --</span> + // : record.number === "" ? + // <span style={{ + // color: '#9A9A9A', + // textAlign: "center", + // width:'100px' + // }}>--</span> + // : record.number === "--" ? + // <span style={{ + // color: '#9A9A9A', + // textAlign: "center", + // width:'100px' + // }}>--</span> + // : + // <span style={{ + // color: '#07111B', + // textAlign: "center", + // width:'100px' + // }}> {record.number}</span> + // } + // </span> + // ), + // }, + { + title: '姓名', + dataIndex: 'name', + key: 'name', + align: "center", + className:'font-14 maxnamewidth200', + width:'200px', + render: (text, record) => ( + <span className="maxnamewidth200"> + {record.name === undefined ? + <span style={{ + color: '#9A9A9A', + textAlign: "center", + width:'200px' + }}>--</span> + : + record.name === "" ? + <span style={{ + color: '#9A9A9A', + textAlign: "center", + width:'200px' + }}>--</span> + : + record.name === null ? + <span style={{ + color: '#9A9A9A', + textAlign: "center", + width:'200px' + }}>--</span> + : + record.name === "--" ? + <span style={{ + color: '#9A9A9A', + textAlign: "center", + width:'200px' + }}>--</span> + : + <a className="maxnamewidth200" title={record.name} style={{ + color: '#07111B', + textAlign: "center", + width:'200px' + }}>{record.name}</a> + } + + </span> + ), + }, + { + title: '学号', + dataIndex: 'stduynumber', + key: 'stduynumber', + align: "center", + className:'font-14 maxnamewidth145', + width:'145px', + render: (text, record) => ( + <span className="maxnamewidth145" style={{ + width:'145px', + }}> + {record.stduynumber === undefined ? + <span style={{ + color: '#9A9A9A', + textAlign: "center", + width:'145px', + }}>-- + </span> + : record.stduynumber === null ? + <span style={{ + color: '#9A9A9A', + textAlign: "center", + width:'145px', + }}>-- + </span> + : record.stduynumber === "" ? + <span style={{ + color: '#9A9A9A', + textAlign: "center", + width:'145px', + }}>-- + </span> + : + <a + title={record.stduynumber} + className="maxnamewidth145" + style={{ + color:'#9A9A9A', + textAlign: "center", + width:'145px', + }}>{ + record.stduynumber + } + </a> + + } + + </span> + ), + }, + { + title: '分班', + key: 'classroom', + dataIndex: 'classroom', + align: "center", + className:'font-14 maxnamewidth145', + width:'145px', + render: (text, record) => ( + <span className="font-14 maxnamewidth145" style={{width:'145px'}}> + {record.classroom === undefined ? + <a className=" font-14 maxnamewidth145" + style={{ + color: '#9A9A9A', + textAlign: "center", + width:'145px', + }}>--</a> : record.classroom === "" ? + <a className=" font-14 maxnamewidth145" + style={{ + color: '#9A9A9A', + textAlign: "center", + width:'145px', + }}>--</a> : record.classroom === null ? + <a className=" font-14 maxnamewidth145" + style={{ + color: '#9A9A9A', + textAlign: "center", + width:'145px', + }}>--</a> + : + <a className=" font-14 maxnamewidth145" + title={record.classroom} + style={{ + color: '#9A9A9A', + textAlign: "center", + width:'145px', + }}>{record.classroom}</a> + } + </span> + ), + }, + { + title: '提交状态', + dataIndex: 'submitstate', + key: 'submitstate', + align: "center", + className:'font-14', + width:'98px', + render: (text, record) => ( + <span style={{width:'98px',}}> + <span style={record.submitstate === "延时提交" ? { + color: '#DD1717', + textAlign: "center", + width:'98px', + } : record.submitstate === "按时提交" ? {color: '#29BD8B', textAlign: "center",width:'98px',} : { + color: '#747A7F', + textAlign: "center", + width:'98px', + }}>{record.submitstate === undefined ? "--" : record.submitstate === "" ? "--" : record.submitstate === null ? "--" : record.submitstate}</span> + + </span> + ), + }, + { + title: '实战耗时', + dataIndex: 'cost_time', + key: 'cost_time', + align: 'center', + className:'font-14', + width:'145px', + render: (text, record) => ( + <span style={ + { + color: '#747A7F', + textAlign: "center", + width:'145px', + } + }> + {record.cost_time === null? "--":record.cost_time === undefined?"--":record.cost_time === "--"?"--": + <span style={ + { + color: '#747A7F', + textAlign: "center", + width:'145px', + } + } + >{record.cost_time === null ? "--":record.cost_time === undefined ?"--":record.cost_time} + </span> + } + </span> + ) + + }, + // { + // title: '更新时间', + // dataIndex: 'updatetime', + // key: 'updatetime', + // align: "center", + // className:'font-14', + // render: (text, record) => ( + // <span> + // <span style={{ + // color: '#9A9A9A', + // "text-align": "center" + // }}>{record.updatetime === undefined ? "--" : record.updatetime === "" ? "--" : record.updatetime}</span> + // </span> + // ), + // }, + { + title: '完成情况', + dataIndex: 'completion', + key: 'completion', + align: "center", + className:'font-14', + width:'99px', + render: (text, record) => ( + <span style={{ + width:'99px', + }}> + <span style={{color: '#07111B',textAlign: "center", width:'99px'}}>{record.completion+"/"+this.state.challenges_count}</span> + </span> + ), + }, + { + title: '关卡得分', + dataIndex: 'levelscore', + key: 'levelscore', + align: 'center', + className:'font-14', + width:'99px', + render: (text, record) => ( + <span style={{ + width:'99px', + }}> + <span style={parseInt(record.levelscore) <= 60 ? { + color: '#747A7F', + textAlign: "center", + width:'99px', + } : parseInt(record.levelscore) < 90 ? { + color: '#FF6800', + textAlign: "center", + width:'99px', + } : parseInt(record.levelscore) >= 90 ? {color: '#DD1717', textAlign: "center", width:'99px',} : { + color: '#747A7F', + textAlign: "center", + width:'99px', + }}>{record.levelscore}</span> + </span> + ) + }, + { + title: '效率分', + dataIndex: 'efficiencyscore', + key: 'efficiencyscore', + align: 'center', + className:'font-14', + width:'80px', + render: (text, record) => ( + <span style={{ + width:'80px', + }}> + { + record.efficiencyscore&& record.efficiencyscore=== "--"?( + <span style={{color:"#9A9A9A", width:'80px',}}> + -- + </span> + ) + : + <span style={parseInt(record.efficiencyscore) <= 60 ? { + color: '#747A7F', + textAlign: "center", + width:'80px', + } : parseInt(record.efficiencyscore) < 90 ? { + color: '#FF6800', + textAlign: "center", + width:'80px', + } : parseInt(record.efficiencyscore) >= 90 ? { + color: '#DD1717', + textAlign: "center", + width:'80px', + } : {color: '#747A7F', textAlign: "center", width:'80px',}}>{record.efficiencyscore}</span> + } + + </span> + ) + }, + { + title: '最终成绩', + dataIndex: 'levelscore', + key: 'levelscore', + align: "center", + className:'font-14', + width:'99px', + render: (text, record) => ( + <span style={{width:'99px',}}> + { + record.levelscore && record.levelscore === "--"? + <span style={{color: '#9A9A9A', textAlign: "center",width:'99px',}}>{record.levelscore}</span> + : + <span style={parseInt(record.levelscore) >=90 ? { + color: '#DD1717', + textAlign: "center", + width:'99px', + } : parseInt(record.levelscore) <= 60?{ + color: '#FF6800', + textAlign: "center", + width:'99px', + }: {color: '#747A7F', textAlign: "center",width:'99px',}}>{record.levelscore}</span> + } + + </span> + ), + }, + { + title: '操作', + dataIndex: 'operating', + key: 'operating', + align: "center", + className:'font-14', + render: (text, record) => ( + <span> + { + record.submitstate === "未提交" ?<span style={{ color: '#9A9A9A'}}>--</span> + : + <a style={{textAlign: "center"}} + className="color-blue" + onClick={() => this.Viewstudenttraininginformation(record)}>{record.operating}</a> + } + </span> ), }, @@ -570,9 +960,7 @@ class Listofworksstudentone extends Component { } }> {record.cost_time === null? "--":record.cost_time === undefined?"--":record.cost_time === "--"?"--": - <Tooltip placement="bottom" title={<div> - 学员在EduCoder做实训花费的时间 - </div>}> + <a style={ { color: '#747A7F', @@ -581,7 +969,6 @@ class Listofworksstudentone extends Component { } >{record.cost_time === null ? "--":record.cost_time === undefined ?"--":record.cost_time} </a> - </Tooltip> } </span> // <a style={ @@ -2575,7 +2962,7 @@ class Listofworksstudentone extends Component { }) } render() { - let {columns,course_groupysls,datajs,isAdmin, course_groupyslstwo, unlimited, unlimitedtwo, course_group_info, orders, task_status, checkedValuesine, searchtext, teacherlist, visible,visibles, game_list,columnsstu, limit,experience, boolgalist,viewtrainingdata, teacherdata, page, data, jobsettingsdata, styletable, datas, order, loadingstate,computeTimetype} = this.state; + let {columns,course_groupysls,datajs,isAdmin, course_groupyslstwo, unlimited, unlimitedtwo, course_group_info, orders, task_status, checkedValuesine, searchtext, teacherlist, visible,visibles, game_list,columnsstu,columnsstu2, limit,experience, boolgalist,viewtrainingdata, teacherdata, page, data, jobsettingsdata, styletable, datas, order, loadingstate,computeTimetype} = this.state; const antIcon = <Icon type="loading" style={{ fontSize: 24 }} spin />; // console.log(this.state.student_works); @@ -3202,8 +3589,9 @@ class Listofworksstudentone extends Component { {data === undefined ? "" : <Table style={styletable} dataSource={data} - columns={columnsstu} + columns={columnsstu2} pagination={false} + showHeader={false} loading={false} />} </div> @@ -3245,18 +3633,18 @@ class Listofworksstudentone extends Component { font-weight:400; color:rgba(255,104,0,1); } - .computeTime { - width: 122px; - height: 31px; - display: inline-block; - padding: 5px; - text-align: center; - line-height: 20px; - color: #FE6B21; - border: 1px solid #FE6B21; - cursor: pointer; - border-radius: 4px; - } + .computeTime { + width: 122px; + height: 31px; + display: inline-block; + padding: 5px; + text-align: center; + line-height: 20px; + color: #FE6B21; + border: 1px solid #FE6B21; + cursor: pointer; + border-radius: 4px; + } .computeTimes{ width: 122px; diff --git a/public/react/src/modules/courses/shixunHomework/style.css b/public/react/src/modules/courses/shixunHomework/style.css index 0ad96345e..7fda90b59 100644 --- a/public/react/src/modules/courses/shixunHomework/style.css +++ b/public/react/src/modules/courses/shixunHomework/style.css @@ -51,6 +51,13 @@ 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; From 67e9fa5e23bd3195aa622cff6a19852f20359c7b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Mon, 9 Sep 2019 11:12:35 +0800 Subject: [PATCH 07/73] =?UTF-8?q?=E5=AD=A6=E7=94=9F=E5=AE=9E=E7=8E=B0?= =?UTF-8?q?=E4=BD=9C=E5=93=81=E5=88=97=E8=A1=A8=E6=A0=B7=E5=BC=8F=E8=B0=83?= =?UTF-8?q?=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../shixunHomework/Listofworksstudentone.js | 159 ++++++++++++------ 1 file changed, 112 insertions(+), 47 deletions(-) diff --git a/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js b/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js index 534078e74..36ec72276 100644 --- a/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js +++ b/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js @@ -458,84 +458,64 @@ class Listofworksstudentone extends Component { }, ], columnsstu2: [ - // { - // title: '序号', - // dataIndex: 'number', - // key: 'number', - // align: "center", - // className:'font-14', - // width:'100px', - // render: (text, record) => ( - // <span style={{width:'100px'}}> - // {record.number === undefined ? - // <span style={{ - // color: '#9A9A9A', - // textAlign: "center", - // width:'100px' - // }}> --</span> - // : record.number === "" ? - // <span style={{ - // color: '#9A9A9A', - // textAlign: "center", - // width:'100px' - // }}>--</span> - // : record.number === "--" ? - // <span style={{ - // color: '#9A9A9A', - // textAlign: "center", - // width:'100px' - // }}>--</span> - // : - // <span style={{ - // color: '#07111B', - // textAlign: "center", - // width:'100px' - // }}> {record.number}</span> - // } - // </span> - // ), - // }, + { + title: '序号', + dataIndex: 'number', + key: 'number', + align: "center", + className:'font-14', + width:'100px', + render: (text, record) => ( + <span style={{width:'100px'}}> + <span style={{ + color: '#07111B', + textAlign: "center", + width:'100px' + }}> 我</span> + </span> + ), + }, { title: '姓名', dataIndex: 'name', key: 'name', align: "center", - className:'font-14 maxnamewidth200', - width:'200px', + className:'font-14 maxnamewidth110', + width:'100px', render: (text, record) => ( - <span className="maxnamewidth200"> + <span className="maxnamewidth110"> {record.name === undefined ? <span style={{ color: '#9A9A9A', textAlign: "center", - width:'200px' + width:'100px' }}>--</span> : record.name === "" ? <span style={{ color: '#9A9A9A', textAlign: "center", - width:'200px' + width:'100px' }}>--</span> : record.name === null ? <span style={{ color: '#9A9A9A', textAlign: "center", - width:'200px' + width:'100px' }}>--</span> : record.name === "--" ? <span style={{ color: '#9A9A9A', textAlign: "center", - width:'200px' + width:'100px' }}>--</span> : - <a className="maxnamewidth200" title={record.name} style={{ + <a className="maxnamewidth110" title={record.name} style={{ color: '#07111B', textAlign: "center", - width:'200px' + width:'100px' }}>{record.name}</a> } @@ -1673,6 +1653,7 @@ class Listofworksstudentone extends Component { let datalists = []; var styletable = {"display": "none"} var arr =[]; + var arr2=[]; for(var i=0;i<this.state.columnsstu.length;i++){ var item = this.state.columnsstu[i]; if(this.props.isNotMember()===true){ @@ -1709,7 +1690,48 @@ class Listofworksstudentone extends Component { } } + try { + for(var i=0;i<this.state.columnsstu2.length;i++){ + var item = this.state.columnsstu2[i]; + if(this.props.isNotMember()===true){ + if(item.title==="关卡得分") { + continue + } + if(item.title==="效率分") { + continue + } + if(item.title==="最终成绩") { + continue + } + if(item.title==="学号") { + continue + } + else{ + arr2.push(item); + } + } + else{ + if (work_efficiency === false) { + if(item.title==="关卡得分"){ + continue + } + else if(item.title==="效率分"){ + continue + + }else{ + arr2.push(item); + } + }else{ + arr2.push(item); + } + + } + } + }catch (e) { + arr2=this.state.columnsstu2; + } let columns2= arr; + let columns3= arr2; var teacherlists = undefined; if (teacherdata !== undefined) { // console.log("seacthdata设置数据") @@ -1803,6 +1825,8 @@ class Listofworksstudentone extends Component { loadingstate: false, styletable: styletable, columnsstu:columns2, + columnsstu2:columns3, + }) } // 设置数据 @@ -1813,6 +1837,7 @@ class Listofworksstudentone extends Component { var arr =[]; + var arr2 =[]; for(var i=0;i<this.state.columnsstu.length;i++){ var item = this.state.columnsstu[i]; @@ -1847,8 +1872,47 @@ class Listofworksstudentone extends Component { } } - let columns2= arr; + try { + for(var i=0;i<this.state.columnsstu2.length;i++){ + var item = this.state.columnsstu2[i]; + if(this.props.isNotMember()===true){ + if(item.title==="关卡得分") { + continue + } + if(item.title==="效率分") { + continue + } + if(item.title==="最终成绩") { + continue + } + if(item.title==="学号") { + continue + }else{ + arr.push(item); + } + }else{ + if (this.state.work_efficiency === false) { + if (item.title === "关卡得分") { + continue + } else if (item.title === "效率分") { + continue + }else{ + arr.push(item); + + } + }else{ + arr.push(item); + } + + } + } + + }catch (e) { + arr2=this.state.columnsstu2; + } + let columns2= arr; + let columns3= arr2; if (teacherdata !== undefined) { // console.log("seacthdata设置数据") // console.log(this.state.teacherdata.id ) @@ -1912,6 +1976,7 @@ class Listofworksstudentone extends Component { teacherlist: teacherlist, loadingstate: false, columnsstu:columns2, + columnsstu2:columns3, }) } // 查看学员实训信息 From 5af40aff1a01878de908b4253e73a8b25f89af89 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Mon, 9 Sep 2019 14:32:12 +0800 Subject: [PATCH 08/73] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../exercise/Studentshavecompletedthelist.js | 638 ++++++++++-------- .../courses/exercise/yslexercisetable.css | 35 + 2 files changed, 398 insertions(+), 275 deletions(-) diff --git a/public/react/src/modules/courses/exercise/Studentshavecompletedthelist.js b/public/react/src/modules/courses/exercise/Studentshavecompletedthelist.js index 33fd0a748..84ee5eb56 100644 --- a/public/react/src/modules/courses/exercise/Studentshavecompletedthelist.js +++ b/public/react/src/modules/courses/exercise/Studentshavecompletedthelist.js @@ -19,6 +19,7 @@ import '../css/busyWork.css' import '../poll/pollStyle.css' import moment from 'moment'; import 'moment/locale/zh-cn'; +import './yslexercisetable.css'; import {getImageUrl, toPath} from 'educoder'; import CheckBoxGroup from "../../page/component/CheckBoxGroup"; @@ -70,12 +71,13 @@ class Studentshavecompletedthelist extends Component { key: 'number', align: 'center', className: "edu-txt-center font-14", + width:'100px', render: (text, record) => ( <span> {record.number === "--" ? - <span style={{"color": '#999999', "text-align": "center"}}>{record.number}</span> + <span style={{color: '#999999', textAlign: "center",width:'100px'}}>{record.number}</span> : - <span style={{"color": '#07111B', "text-align": "center" }}>{record.number}</span> + <span style={{color: '#07111B', textAlign: "center",width:'100px'}}>{record.number}</span> } </span> @@ -86,13 +88,16 @@ class Studentshavecompletedthelist extends Component { dataIndex: 'name', key: 'name', align: 'center', - className: "edu-txt-center font-14", + className: "edu-txt-center font-14 maxnamewidth110", + width:'100px', render: (text, record) => ( - <span> + <span className="maxnamewidth110 font-14" style={{ + width:'100px' + }}> {record.name === "--" ? - <span style={{"color": '#999999', "text-align": "center" }}>{record.name}</span> + <span style={{color: '#999999', textAlign: "center",width:'100px'}}>{record.name}</span> : - <span style={{"color": '#07111B', "text-align": "center" }}>{record.name}</span> + <span className="maxnamewidth110" style={{color: '#07111B', textAlign: "center",width:'100px'}}>{record.name}</span> } </span> @@ -103,23 +108,29 @@ class Studentshavecompletedthelist extends Component { dataIndex: 'stduynumber', key: 'stduynumber', align: 'center', - className: "edu-txt-center font-14", + className: "edu-txt-center font-14 maxnamewidth145", + width:'145px', render: (text, record) => ( - <span> + <span className="maxnamewidth145" style={{ + width:'145px', + }}> {record.stduynumber === null ? <span style={{ - "color": '#999999', - "text-align": "center" + color: '#999999', + textAlign: "center", + width:'145px', }}>--</span> : record.stduynumber === "" ? <span style={{ - "color": '#999999', - "text-align": "center" + color: '#999999', + textAlign: "center", + width:'145px', }}>--</span> : - <span style={{ - "color": '#9A9A9A', - "text-align": "center" + <span className="maxnamewidth145" style={{ + color: '#9A9A9A', + textAlign: "center", + width:'145px', }}>{record.stduynumber}</span> } @@ -131,24 +142,27 @@ class Studentshavecompletedthelist extends Component { key: 'classroom', dataIndex: 'classroom', align: 'center', - className: "edu-txt-center font-14", - width:"260px", + className: "edu-txt-center font-14 maxnamewidth145", + width:'145px', render: (text, record) => ( - <span> + <span className="maxnamewidth145" style={{width:'145px'}}> {record.classroom === null ? <span style={{ - "color": '#999999', - "text-align": "center" + color: '#999999', + textAlign: "center", + width:'145px', }}>--</span> : record.classroom === "" ? <span style={{ - "color": '#999999', - "text-align": "center" + color: '#999999', + textAlign: "center", + width:'145px', }}>--</span> : - <span style={{ - "color": '#07111B', - "text-align": "center" + <span className="maxnamewidth145" style={{ + color: '#07111B', + textAlign: "center", + width:'145px', }}>{record.classroom}</span> } @@ -161,14 +175,19 @@ class Studentshavecompletedthelist extends Component { key: 'submitstate', align: 'center', className: "edu-txt-center font-14", + width:'98px', render: (text, record) => ( - <span> + <span style={{ + width:'98px', + }}> <span style={record.submitstate === "未提交" ? { - "color": '#999999', - "text-align": "center", - } : record.submitstate === "已提交" ? {"color": '#29BD8B', "text-align": "center"} : { - "color": '#29BD8B', - "text-align": "center", + color: '#999999', + textAlign: "center", + width:'98px', + } : record.submitstate === "已提交" ? {color: '#29BD8B', textAlign: "center", width:'98px'} : { + color: '#29BD8B', + textAlign: "center", + width:'98px', }}>{record.submitstate}</span> </span> ) @@ -180,12 +199,15 @@ class Studentshavecompletedthelist extends Component { key: 'updatetime', align: 'center', className: "edu-txt-center font-14", + width:'175px', render: (text, record) => ( - <span> + <span style={{ + width:'175px', + }}> {record.updatetime === "--" ? - <span style={{"color": '#999999', "text-align": "center" }}>{record.updatetime}</span> + <span style={{color: '#999999', textAlign: "center",width:'175px'}}>{record.updatetime}</span> : - <span style={{"color": '#9A9A9A', "text-align": "center" }}>{record.updatetime}</span> + <span style={{color: '#9A9A9A', textAlign: "center",width:'175px'}}>{record.updatetime}</span> } </span> ), @@ -196,29 +218,35 @@ class Studentshavecompletedthelist extends Component { key: 'completion', align: 'center', className: "edu-txt-center font-14", + width:'98px', render: (text, record) => ( <span> { record.completion === "--" ? <span style={{ - "color": '#999999', - "text-align": "center" + color: '#999999', + textAlign: "center", + width:'98px', }}> {record.completion} </span> : <span style={parseInt(record.completion) > 90 ? { - "color": '#DD1717', - "text-align": "center" + color: '#DD1717', + textAlign: "center", + width:'98px', } : parseInt(record.completion) <= 90 ? { - "color": '#FF6800', - "text-align": "center" + color: '#FF6800', + textAlign: "center", + width:'98px', } : parseInt(record.completion) <= 60 ? { - "color": '#747A7F', - "text-align": "center" + color: '#747A7F', + textAlign: "center", + width:'98px', } : { - "color": '#747A7F', - "text-align": "center" + color: '#747A7F', + textAlign: "center", + width:'98px', }}>{record.completion}</span> } @@ -231,26 +259,31 @@ class Studentshavecompletedthelist extends Component { key: 'levelscore', align: 'center', className: "edu-txt-center font-14", + width:'99px', render: (text, record) => ( <span> {record.levelscore === "--" ? <span style={{ - "color": '#999999', - "text-align": "center" + color: '#999999', + textAlign: "center", + width:'99px', }}> {record.levelscore} </span> : <span style={parseInt(record.levelscore) > 90 ? { - "color": '#DD1717', - "text-align": "center" + color: '#DD1717', + textAlign: "center", + width:'99px', } : parseInt(record.levelscore) <= 90 ? { - "color": '#FF6800', - "text-align": "center" + color: '#FF6800', + textAlign: "center", + width:'99px', } : parseInt(record.levelscore) <= 60 ? { - "color": '#747A7F', - "text-align": "center" - } : {"color": '#747A7F', "text-align": "center"}}>{record.levelscore}</span> + color: '#747A7F', + textAlign: "center", + width:'99px', + } : {color: '#747A7F', textAlign: "center",width:'99px'}}>{record.levelscore}</span> } </span> ) @@ -268,25 +301,25 @@ class Studentshavecompletedthelist extends Component { <div>未评分</div> </div>}> <a style={{ - "color": '#999999', - "text-align": "center" + color: '#999999', + textAlign: "center" }}> {record.efficiencyscore} </a> </Tooltip> : <span style={parseInt(record.efficiencyscore) > 90 ? { - "color": '#DD1717', - "text-align": "center" + color: '#DD1717', + textAlign: "center" } : parseInt(record.efficiencyscore) <= 90 ? { - "color": '#FF6800', - "text-align": "center" + color: '#FF6800', + textAlign: "center" } : parseInt(record.efficiencyscore) <= 60 ? { - "color": '#747A7F', - "text-align": "center", + color: '#747A7F', + textAlign: "center", } : { - "color": '#747A7F', - "text-align": "center" + color: '#747A7F', + textAlign: "center" }}>{record.efficiencyscore}</span> } </span> @@ -300,15 +333,11 @@ class Studentshavecompletedthelist extends Component { key: 'number', align: 'center', className: "edu-txt-center tabletd font-14", + width:'100px', render: (text, record) => ( <span> { - record.number === "--" ? - <span style={{"color": '#999999', "text-align": "center" }}>{record.number}</span> - - : - <span style={{"color": '#07111B', "text-align": "center"}}>{record.number}</span> - + <span style={{color: '#999999', textAlign: "center",width:'100px'}}>我</span> } </span> ) @@ -318,14 +347,15 @@ class Studentshavecompletedthelist extends Component { dataIndex: 'name', key: 'name', align: 'center', - className: "edu-txt-center tabletd font-14", + className: "edu-txt-center tabletd font-14 maxnamewidth110", + width:'100px', render: (text, record) => ( - <span> + <span className="maxnamewidth110 font-14"> { record.name === "--" ? - <span style={{"color": '#999999', "text-align": "center" }}>{record.name}</span> + <span className="maxnamewidth110" style={{color: '#999999', textAlign: "center",width:'100px'}}>{record.name}</span> : - <span style={{"color": '#07111B', "text-align": "center" }}>{record.name}</span> + <span className="maxnamewidth110" style={{color: '#07111B', textAlign: "center",width:'100px'}}>{record.name}</span> } </span> @@ -336,24 +366,30 @@ class Studentshavecompletedthelist extends Component { dataIndex: 'stduynumber', key: 'stduynumber', align: 'center', - className: "edu-txt-center tabletd font-14", + className: "edu-txt-center tabletd font-14 maxnamewidth145", + width:'145px', render: (text, record) => ( - <span> + <span className="maxnamewidth145" style={{ + width:'145px', + }}> {record.stduynumber === null ? <span style={{ - "color": '#999999', - "text-align": "center" + color: '#999999', + textAlign: "center", + width:'145px', }}>--</span> : record.stduynumber === "" ? <span style={{ - "color": '#999999', - "text-align": "center" + color: '#999999', + textAlign: "center", + width:'145px', }}>--</span> : - <span style={{ - "color": '#9A9A9A', - "text-align": "center" + <span className="maxnamewidth145 font-14" style={{ + color: '#9A9A9A', + textAlign: "center", + width:'145px', }}>{record.stduynumber}</span> } @@ -365,22 +401,27 @@ class Studentshavecompletedthelist extends Component { key: 'classroom', dataIndex: 'classroom', align: 'center', - className: "edu-txt-center tabletd font-14", - width:"260px", + className: "edu-txt-center tabletd font-14 maxnamewidth145", + width:'145px', render: (text, record) => ( - <span> + <span className="font-14 maxnamewidth145" style={{ + width:'145px', + }}> {record.classroom === null ? <span style={{ - "color": '#999999', - "text-align": "center" + color: '#999999', + textAlign: "center", + width:'145px', }}>--</span>: record.classroom === "" ? <span style={{ - "color": '#999999', - "text-align": "center" + color: '#999999', + textAlign: "center", + width:'145px', }}>--</span>: - <span tyle={{ - "color": '#07111B', - "text-align": "center" + <span className="maxnamewidth145" tyle={{ + color: '#07111B', + textAlign: "center", + width:'145px', }}>{record.classroom}</span> } @@ -393,14 +434,17 @@ class Studentshavecompletedthelist extends Component { key: 'submitstate', align: 'center', className: "edu-txt-center tabletd font-14", + width:'98px', render: (text, record) => ( - <span> + <span style={{width:'98px',}}> <span style={record.submitstate === "未提交" ? { - "color": '#999999', - "text-align": "center", - } : record.submitstate === "已提交" ? {"color": '#29BD8B', "text-align": "center"} : { - "color": '#29BD8B', - "text-align": "center", + color: '#999999', + textAlign: "center", + width:'98px', + } : record.submitstate === "已提交" ? {color: '#29BD8B', textAlign: "center", width:'98px',} : { + color: '#29BD8B', + textAlign: "center", + width:'98px', }}>{record.submitstate}</span> </span> ) @@ -412,12 +456,15 @@ class Studentshavecompletedthelist extends Component { key: 'updatetime', align: 'center', className: "edu-txt-center tabletd font-14", + width:'175px', render: (text, record) => ( - <span> + <span style={{ + width:'175px', + }}> {record.updatetime === "--"? - <span style={{"color": '#999999', "text-align": "center", }}>--</span> + <span style={{color: '#999999', textAlign: "center",width:'175px'}}>--</span> : - <span style={{"color": '#9A9A9A', "text-align": "center", }}>{record.updatetime}</span> + <span style={{color: '#9A9A9A', textAlign: "center",width:'175px'}}>{record.updatetime}</span> } </span> ), @@ -428,29 +475,35 @@ class Studentshavecompletedthelist extends Component { key: 'completion', align: 'center', className: "edu-txt-center tabletd font-14", + width:'98px', render: (text, record) => ( <span> {record.completion === "--" ? <span style={{ - "color": '#999999', - "text-align": "center" + color: '#999999', + textAlign: "center", + width:'98px', }}> -- </span> : <span style={parseInt(record.completion) > 90 ? { - "color": '#DD1717', - "text-align": "center" + color: '#DD1717', + textAlign: "center", + width:'98px', } : parseInt(record.completion) <= 90 ? { - "color": '#FF6800', - "text-align": "center" + color: '#FF6800', + textAlign: "center", + width:'98px', } : parseInt(record.completion) <= 60 ? { - "color": '#747A7F', - "text-align": "center" + color: '#747A7F', + textAlign: "center", + width:'98px', } : { - "color": '#747A7F', - "text-align": "center" + color: '#747A7F', + textAlign: "center", + width:'98px', }}>{record.completion}</span> } </span> @@ -462,26 +515,31 @@ class Studentshavecompletedthelist extends Component { key: 'levelscore', align: 'center', className: "edu-txt-center tabletd font-14", + width:'99px', render: (text, record) => ( <span> {record.levelscore === "--"? <span style={{ - "color": '#999999', - "text-align": "center" + color: '#999999', + textAlign: "center", + width:'99px', }}> -- </span> : <span style={parseInt(record.levelscore) > 90 ? { - "color": '#DD1717', - "text-align": "center" + color: '#DD1717', + textAlign: "center", + width:'99px' } : parseInt(record.levelscore) <= 90 ? { - "color": '#FF6800', - "text-align": "center" + color: '#FF6800', + textAlign: "center", + width:'99px' } : parseInt(record.levelscore) <= 60 ? { - "color": '#747A7F', - "text-align": "center" - } : {"color": '#747A7F', "text-align": "center"}}>{record.levelscore}</span> + color: '#747A7F', + textAlign: "center", + width:'99px' + } : {color: '#747A7F', textAlign: "center", width:'99px'}}>{record.levelscore}</span> } </span> ) @@ -500,23 +558,23 @@ class Studentshavecompletedthelist extends Component { <div>未评分</div> </div>}> <a style={{ - "color": '#DD1717', - "text-align": "center" + color: '#DD1717', + textAlign: "center", }}>--</a> </Tooltip> : <span style={parseInt(record.efficiencyscore) > 90 ? { - "color": '#DD1717', - "text-align": "center" + color: '#DD1717', + textAlign: "center", } : parseInt(record.efficiencyscore) <= 90 ? { - "color": '#FF6800', - "text-align": "center" + color: '#FF6800', + textAlign: "center", } : parseInt(record.efficiencyscore) <= 60 ? { - "color": '#747A7F', - "text-align": "center", + color: '#747A7F', + textAlign: "center", } : { - "color": '#747A7F', - "text-align": "center" + color: '#747A7F', + textAlign: "center", }}>{record.efficiencyscore}</span> } @@ -535,9 +593,9 @@ class Studentshavecompletedthelist extends Component { <span> { record.number=== "--"? - <span style={{"color": '#999999', "text-align": "center"}}>--</span> + <span style={{color: '#999999', textAlign: "center"}}>--</span> : - <span style={{"color": '#07111B', "text-align": "center"}}>{record.number}</span> + <span style={{color: '#07111B', textAlign: "center"}}>{record.number}</span> } </span> @@ -553,9 +611,9 @@ class Studentshavecompletedthelist extends Component { <span> { record.name === "--" ? - <span style={{"color": '#999999', "text-align": "center"}}>--</span> + <span style={{color: '#999999', textAlign: "center"}}>--</span> : - <span style={{"color": '#07111B', "text-align": "center"}}>{record.name}</span> + <span style={{color: '#07111B', textAlign: "center"}}>{record.name}</span> } </span> ) @@ -570,18 +628,18 @@ class Studentshavecompletedthelist extends Component { <span> {record.stduynumber === null ? <span style={{ - "color": '#999999', - "text-align": "center" + color: '#999999', + textAlign: "center" }}>--</span> : record.stduynumber === "" ? <span style={{ - "color": '#999999', - "text-align": "center" + color: '#999999', + textAlign: "center" }}>--</span> : <span style={{ - "color": '#9A9A9A', - "text-align": "center" + color: '#9A9A9A', + textAlign: "center" }}>{record.stduynumber}</span> } @@ -599,16 +657,16 @@ class Studentshavecompletedthelist extends Component { <span> {record.classroom === null ? <span style={{ - "color": '#999999', - "text-align": "center" + color: '#999999', + textAlign: "center" }}>--</span> : record.classroom === "" ? <span style={{ - "color": '#999999', - "text-align": "center" + color: '#999999', + textAlign: "center" }}>--</span> : <span style={{ - "color": '#07111B', - "text-align": "center" + color: '#07111B', + textAlign: "center" }}>{record.classroom}</span> } @@ -624,11 +682,11 @@ class Studentshavecompletedthelist extends Component { render: (text, record) => ( <span> <span style={record.submitstate === "未提交" ? { - "color": '#999999', - "text-align": "center" - } : record.submitstate === "已提交" ? {"color": '#29BD8B', "text-align": "center"} : { - "color": '#29BD8B', - "text-align": "center" + color: '#999999', + textAlign: "center" + } : record.submitstate === "已提交" ? {color: '#29BD8B', textAlign: "center"} : { + color: '#29BD8B', + textAlign: "center" }}>{record.submitstate}</span> </span> ) @@ -644,10 +702,10 @@ class Studentshavecompletedthelist extends Component { <span> { record.updatetime === "--" ? - <span style={{"color": '#999999', "text-align": "center"}}>--</span> + <span style={{color: '#999999', textAlign: "center"}}>--</span> : - <span style={{"color": '#9A9A9A', "text-align": "center"}}>{record.updatetime}</span> + <span style={{color: '#9A9A9A', textAlign: "center"}}>{record.updatetime}</span> } </span> @@ -664,22 +722,22 @@ class Studentshavecompletedthelist extends Component { { record.completion === "--"? <span style={{ - "color": '#999999', - "text-align": "center", + color: '#999999', + textAlign: "center", }}>--</span> : <span style={parseInt(record.completion) > 90 ? { - "color": '#DD1717', - "text-align": "center", + color: '#DD1717', + textAlign: "center", } : parseInt(record.completion) <= 90 ? { - "color": '#FF6800', - "text-align": "center", + color: '#FF6800', + textAlign: "center", } : parseInt(record.completion) <= 60 ? { - "color": '#747A7F', - "text-align": "center", + color: '#747A7F', + textAlign: "center", } : { - "color": '#747A7F', - "text-align": "center", + color: '#747A7F', + textAlign: "center", }}>{record.completion}</span> } @@ -697,19 +755,19 @@ class Studentshavecompletedthelist extends Component { { record.levelscore === "--" ? <span style={{ - "color": '#999999', - "text-align": "center", + color: '#999999', + textAlign: "center", }}>--</span> : <span style={parseInt(record.levelscore) > 90 ? { - "color": '#DD1717', - "text-align": "center", + color: '#DD1717', + textAlign: "center", } : parseInt(record.levelscore) <= 90 ? { - "color": '#FF6800', - "text-align": "center", + color: '#FF6800', + textAlign: "center", } : parseInt(record.levelscore) <= 60 ? { - "color": '#747A7F', - "text-align": "center", - } : {"color": '#747A7F', "text-align": "center"}}>{record.levelscore}</span> + color: '#747A7F', + textAlign: "center", + } : {color: '#747A7F', textAlign: "center"}}>{record.levelscore}</span> } </span> @@ -729,23 +787,23 @@ class Studentshavecompletedthelist extends Component { <div>未评分</div> </div>}> <a style={{ - "color": '#999999', - "text-align": "center", + color: '#999999', + textAlign: "center", }}>--</a> </Tooltip> : <span style={parseInt(record.efficiencyscore) > 90 ? { - "color": '#DD1717', - "text-align": "center", + color: '#DD1717', + textAlign: "center", } : parseInt(record.efficiencyscore) <= 90 ? { - "color": '#FF6800', - "text-align": "center", + color: '#FF6800', + textAlign: "center", } : parseInt(record.efficiencyscore) <= 60 ? { - "color": '#747A7F', - "text-align": "center", + color: '#747A7F', + textAlign: "center", } : { - "color": '#747A7F', - "text-align": "center", + color: '#747A7F', + textAlign: "center", }}>{record.efficiencyscore}</span> } </span> @@ -760,11 +818,11 @@ class Studentshavecompletedthelist extends Component { render: (text, record) => ( <span> {record.operating==="--"? - <span style={{"text-align": "center","color": '#999999',}}>{record.operating}</span> + <span style={{textAlign: "center",color: '#999999',}}>{record.operating}</span> :record.submitstate === "未提交"? - <span style={{"text-align": "center","color": '#999999',}}>--</span> + <span style={{textAlign: "center",color: '#999999',}}>--</span> : - <a style={{"text-align": "center"}} className="color-blue" + <a style={{textAlign: "center"}} className="color-blue" href={`/courses/${this.props.match.params.coursesId}/exercises/${this.props.match.params.Id}/users/${record.myid}`}>{record.operating}</a> } @@ -789,9 +847,9 @@ class Studentshavecompletedthelist extends Component { render: (text, record) => ( <span> {record.number === "--" ? - <span style={{"color": '#999999', "text-align": "center"}}>--</span> + <span style={{color: '#999999', textAlign: "center"}}>--</span> : - <span style={{"color": '#07111B', "text-align": "center"}}>{record.number}</span> + <span style={{color: '#07111B', textAlign: "center"}}>{record.number}</span> } </span> ) @@ -805,9 +863,9 @@ class Studentshavecompletedthelist extends Component { render: (text, record) => ( <span> {record.name==="--"? - <span style={{"color": '#999999', "text-align": "center"}}>{record.name}</span> + <span style={{color: '#999999', textAlign: "center"}}>{record.name}</span> : - <span style={{"color": '#07111B', "text-align": "center"}}>{record.name}</span> + <span style={{color: '#07111B', textAlign: "center"}}>{record.name}</span> } </span> ) @@ -821,9 +879,9 @@ class Studentshavecompletedthelist extends Component { render: (text, record) => ( <span> {record.stduynumber === "--" ? - <span style={{"color": '#999999', "text-align": "center"}}>{record.stduynumber}</span> + <span style={{color: '#999999', textAlign: "center"}}>{record.stduynumber}</span> : - <span style={{"color": '#9A9A9A', "text-align": "center"}}>{record.stduynumber}</span> + <span style={{color: '#9A9A9A', textAlign: "center"}}>{record.stduynumber}</span> } </span> ), @@ -838,9 +896,9 @@ class Studentshavecompletedthelist extends Component { render: (text, record) => ( <span> {record.classroom==="--"? - <span style={{"color": '#999999', "text-align": "center"}}>{record.classroom}</span> + <span style={{color: '#999999', textAlign: "center"}}>{record.classroom}</span> : - <span style={{"color": '#07111B', "text-align": "center"}}>{record.classroom}</span> + <span style={{color: '#07111B', textAlign: "center"}}>{record.classroom}</span> } </span> ) @@ -854,11 +912,11 @@ class Studentshavecompletedthelist extends Component { render: (text, record) => ( <span> <span style={record.submitstate === "未提交" ? { - "color": '#999999', - "text-align": "center" - } : record.submitstate === "已提交" ? {"color": '#29BD8B', "text-align": "center"} : { - "color": '#29BD8B', - "text-align": "center" + color: '#999999', + textAlign: "center" + } : record.submitstate === "已提交" ? {color: '#29BD8B', textAlign: "center"} : { + color: '#29BD8B', + textAlign: "center" }}>{record.submitstate}</span> </span> @@ -874,9 +932,9 @@ class Studentshavecompletedthelist extends Component { render: (text, record) => ( <span> {record.updatetime==="--"? - <span style={{"color": '#999999', "text-align": "center"}}>--</span> + <span style={{color: '#999999', textAlign: "center"}}>--</span> : - <span style={{"color": '#9A9A9A', "text-align": "center"}}>{record.updatetime}</span> + <span style={{color: '#9A9A9A', textAlign: "center"}}>{record.updatetime}</span> } </span> ), @@ -890,9 +948,9 @@ class Studentshavecompletedthelist extends Component { render: (text, record) => ( <span> {record.completion=== "--"? - <span style={{"color": '#999999', "text-align": "center"}}>--</span> + <span style={{color: '#999999', textAlign: "center"}}>--</span> : - <span style={{"color": '#07111B', "text-align": "center"}}>{record.completion}</span> + <span style={{color: '#07111B', textAlign: "center"}}>{record.completion}</span> } </span> ) @@ -906,9 +964,9 @@ class Studentshavecompletedthelist extends Component { render: (text, record) => ( <span> {record.levelscore==="--"? - <span style={{"color": '#999999', "text-align": "center"}}>--</span> + <span style={{color: '#999999', textAlign: "center"}}>--</span> : - <span style={{"color": '#FF6800', "text-align": "center"}}>{record.levelscore}</span> + <span style={{color: '#FF6800', textAlign: "center"}}>{record.levelscore}</span> } </span> ) @@ -925,22 +983,22 @@ class Studentshavecompletedthelist extends Component { <Tooltip placement="bottom" title={<div> <div>未评分</div> </div>}> - <a style={{"color": '#999999', - "text-align": "center",}}>--</a> + <a style={{color: '#999999', + textAlign: "center",}}>--</a> </Tooltip> : <span style={parseInt(record.efficiencyscore) > 90 ? { - "color": '#DD1717', - "text-align": "center", + color: '#DD1717', + textAlign: "center", } : parseInt(record.efficiencyscore) <= 90 ? { - "color": '#FF6800', - "text-align": "center", + color: '#FF6800', + textAlign: "center", } : parseInt(record.efficiencyscore) <= 60 ? { - "color": '#747A7F', - "text-align": "center", + color: '#747A7F', + textAlign: "center", } : { - "color": '#747A7F', - "text-align": "center", + color: '#747A7F', + textAlign: "center", }}>{record.efficiencyscore}</span> } </span> @@ -955,13 +1013,13 @@ class Studentshavecompletedthelist extends Component { render: (text, record) => ( <span> {record.finalscore==="--"? - <span style={{"text-align": "center","color": '#999999'}} + <span style={{textAlign: "center",color: '#999999'}} >--</span> :record.submitstate === "未提交"? - <span style={{"text-align": "center","color": '#999999'}} + <span style={{textAlign: "center",color: '#999999'}} >--</span> : - <a style={{"text-align": "center"}} className="color-blue" + <a style={{textAlign: "center"}} className="color-blue" href={`/courses/${this.props.match.params.coursesId}/exercises/${this.props.match.params.Id}/users/${record.myid}`}>{record.finalscore}</a> } @@ -979,9 +1037,9 @@ class Studentshavecompletedthelist extends Component { render: (text, record) => ( <span> {record.number === "--" ? - <span style={{"color": '#999999', "text-align": "center"}}>--</span> + <span style={{color: '#999999', textAlign: "center"}}>--</span> : - <span style={{"color": '#07111B', "text-align": "center"}}>{record.number}</span> + <span style={{color: '#07111B', textAlign: "center"}}>{record.number}</span> } </span> ) @@ -995,9 +1053,9 @@ class Studentshavecompletedthelist extends Component { render: (text, record) => ( <span> {record.name==="--"? - <span style={{"color": '#999999', "text-align": "center"}}>{record.name}</span> + <span style={{color: '#999999', textAlign: "center"}}>{record.name}</span> : - <span style={{"color": '#07111B', "text-align": "center"}}>{record.name}</span> + <span style={{color: '#07111B', textAlign: "center"}}>{record.name}</span> } </span> ) @@ -1011,9 +1069,9 @@ class Studentshavecompletedthelist extends Component { render: (text, record) => ( <span> {record.stduynumber === "--" ? - <span style={{"color": '#999999', "text-align": "center"}}>{record.stduynumber}</span> + <span style={{color: '#999999', textAlign: "center"}}>{record.stduynumber}</span> : - <span style={{"color": '#9A9A9A', "text-align": "center"}}>{record.stduynumber}</span> + <span style={{color: '#9A9A9A', textAlign: "center"}}>{record.stduynumber}</span> } </span> ), @@ -1028,9 +1086,9 @@ class Studentshavecompletedthelist extends Component { render: (text, record) => ( <span> {record.classroom==="--"? - <span style={{"color": '#999999', "text-align": "center"}}>{record.classroom}</span> + <span style={{color: '#999999', textAlign: "center"}}>{record.classroom}</span> : - <span style={{"color": '#07111B', "text-align": "center"}}>{record.classroom}</span> + <span style={{color: '#07111B', textAlign: "center"}}>{record.classroom}</span> } </span> ) @@ -1044,11 +1102,11 @@ class Studentshavecompletedthelist extends Component { render: (text, record) => ( <span> <span style={record.submitstate === "未提交" ? { - "color": '#999999', - "text-align": "center" - } : record.submitstate === "已提交" ? {"color": '#29BD8B', "text-align": "center"} : { - "color": '#29BD8B', - "text-align": "center" + color: '#999999', + textAlign: "center" + } : record.submitstate === "已提交" ? {color: '#29BD8B', textAlign: "center"} : { + color: '#29BD8B', + textAlign: "center" }}>{record.submitstate}</span> </span> @@ -1064,9 +1122,9 @@ class Studentshavecompletedthelist extends Component { render: (text, record) => ( <span> {record.updatetime==="--"? - <span style={{"color": '#999999', "text-align": "center"}}>--</span> + <span style={{color: '#999999', textAlign: "center"}}>--</span> : - <span style={{"color": '#9A9A9A', "text-align": "center"}}>{record.updatetime}</span> + <span style={{color: '#9A9A9A', textAlign: "center"}}>{record.updatetime}</span> } </span> ), @@ -1080,9 +1138,9 @@ class Studentshavecompletedthelist extends Component { render: (text, record) => ( <span> {record.completion=== "--"? - <span style={{"color": '#999999', "text-align": "center"}}>--</span> + <span style={{color: '#999999', textAlign: "center"}}>--</span> : - <span style={{"color": '#07111B', "text-align": "center"}}>{record.completion}</span> + <span style={{color: '#07111B', textAlign: "center"}}>{record.completion}</span> } </span> ) @@ -1096,9 +1154,9 @@ class Studentshavecompletedthelist extends Component { render: (text, record) => ( <span> {record.levelscore==="--"? - <span style={{"color": '#999999', "text-align": "center"}}>--</span> + <span style={{color: '#999999', textAlign: "center"}}>--</span> : - <span style={{"color": '#FF6800', "text-align": "center"}}>{record.levelscore}</span> + <span style={{color: '#FF6800', textAlign: "center"}}>{record.levelscore}</span> } </span> ) @@ -1115,22 +1173,22 @@ class Studentshavecompletedthelist extends Component { <Tooltip placement="bottom" title={<div> <div>未评分</div> </div>}> - <a style={{"color": '#999999', - "text-align": "center",}}>--</a> + <a style={{color: '#999999', + textAlign: "center",}}>--</a> </Tooltip> : <span style={parseInt(record.efficiencyscore) > 90 ? { - "color": '#DD1717', - "text-align": "center", + color: '#DD1717', + textAlign: "center", } : parseInt(record.efficiencyscore) <= 90 ? { - "color": '#FF6800', - "text-align": "center", + color: '#FF6800', + textAlign: "center", } : parseInt(record.efficiencyscore) <= 60 ? { - "color": '#747A7F', - "text-align": "center", + color: '#747A7F', + textAlign: "center", } : { - "color": '#747A7F', - "text-align": "center", + color: '#747A7F', + textAlign: "center", }}>{record.efficiencyscore}</span> } </span> @@ -1145,13 +1203,13 @@ class Studentshavecompletedthelist extends Component { render: (text, record) => ( <span> {record.finalscore==="--"? - <span style={{"text-align": "center","color": '#999999'}} + <span style={{textAlign: "center",color: '#999999'}} >--</span> :record.submitstate === "未提交"? - <span style={{"text-align": "center","color": '#999999'}} + <span style={{textAlign: "center",color: '#999999'}} >--</span> : - <a style={{"text-align": "center"}} className="color-blue" + <a style={{textAlign: "center"}} className="color-blue" href={`/courses/${this.props.match.params.coursesId}/exercises/${this.props.match.params.Id}/users/${record.myid}`}>{record.finalscore}</a> } @@ -2554,7 +2612,7 @@ class Studentshavecompletedthelist extends Component { <div className="clearfix"> <span className="fl color-grey-6 font-12"><span - style={{"color": '#FF6800'}}>{Teacherliststudentlist === undefined ? "0" : Teacherliststudentlist.exercise_types.total_users}</span><span + style={{color: '#FF6800'}}>{Teacherliststudentlist === undefined ? "0" : Teacherliststudentlist.exercise_types.total_users}</span><span className="color-orange-tip"></span>个检索结果({Teacherliststudentlist === undefined ? "0" : Teacherliststudentlist.exercise_types.exercise_all_users}学生) </span> <div className="fr color-grey-6 edu-menu-panel"> @@ -2565,11 +2623,11 @@ class Studentshavecompletedthelist extends Component { <i className="iconfont icon-xiajiantou ml5 font-12"></i> <ul className="edu-position-hide undis mt10"> <li><a onClick={(e) => this.funordersy("end_at")} data-remote="true" - className=" font-12" style={{"text-align": "center "}}>提交时间</a></li> + className=" font-12" style={{textAlign: "center "}}>提交时间</a></li> <li><a onClick={(e) => this.funordersy("score")} data-remote="true" - className=" font-12" style={{"text-align": "center "}}>最终成绩</a></li> + className=" font-12" style={{textAlign: "center "}}>最终成绩</a></li> <li><a onClick={(e) => this.funordersy("student_id")} data-remote="true" - className=" font-12" style={{"text-align": "center "}}>学生学号</a></li> + className=" font-12" style={{textAlign: "center "}}>学生学号</a></li> </ul> </li> </ul> @@ -2645,15 +2703,15 @@ class Studentshavecompletedthelist extends Component { <div className="clearfix "> <span className="fl color-grey-6 font-12 mt10"> <span className="color-orange-tip" - style={{"color": '#FF6800'}}>{Teacherliststudentlist === undefined ? "0" : Teacherliststudentlist.exercise_types.answer_users}</span><span - style={{"color": "#666666"}}>已交</span> + style={{color: '#FF6800'}}>{Teacherliststudentlist === undefined ? "0" : Teacherliststudentlist.exercise_types.answer_users}</span><span + style={{color: "#666666"}}>已交</span> <span className="ml10"></span><span - style={{"color": "#666666"}}> {Teacherliststudentlist === undefined ? "0" : Teacherliststudentlist.exercise_types.unanswer_users}未交</span> + style={{color: "#666666"}}> {Teacherliststudentlist === undefined ? "0" : Teacherliststudentlist.exercise_types.unanswer_users}未交</span> {Teacherliststudentlist && Teacherliststudentlist.exercise_types.exercise_end_time === "--" ? "" : - <span className="ml20" style={{"color": "#9A9A9A"}}> 剩余提交时间:</span>} + <span className="ml20" style={{color: "#9A9A9A"}}> 剩余提交时间:</span>} {Teacherliststudentlist && Teacherliststudentlist.exercise_types.exercise_end_time === "--" ? "" : - <span style={{"color": '#FF6800'}}> + <span style={{color: '#FF6800'}}> {Teacherliststudentlist === undefined ? "0" : Teacherliststudentlist.exercise_types.exercise_end_time} </span>} </span> @@ -2709,21 +2767,36 @@ class Studentshavecompletedthelist extends Component { " min-width": " 1200px" }}> <div className={"educontent mb20 edu-back-white"}> - <div className={"justify break_full_word new_li edu-back-white"} + <style> + { + ` + .edu-table .ant-table-tbody > tr > td { + height: 58px; + } + .edu-table .ant-table-thead > tr > th{ + height: 58px; + } + .ysltableows .ant-table-thead > tr > th{ + height: 58px; + } + .ysltableows .ant-table-tbody > tr > td{ + height: 58px; + } + .ysltableows .ant-table-thead > tr > th, .ant-table-tbody > tr > td { + padding: 9px; + } + ` + } + </style> + <div className={"justify break_full_word new_li edu-back-white ysltableows"} > - <style>{` - .ant-spin-nested-loading > div > .ant-spin .ant-spin-dot { - top: 72%;} - } - `}</style> {data === undefined ? "" : <Table dataSource={data} columns={columnstwo} - // showHeader={false} className="mysjysltable3" pagination={false} loading={false} - + showHeader={false} />} </div> {JSON.stringify(datas) === "[]" ? @@ -2749,15 +2822,15 @@ class Studentshavecompletedthelist extends Component { <div className="clearfix"> <span className="fl color-grey-6 font-12"><span className="color-orange-tip" - style={{"color": '#FF6800'}}>{Teacherliststudentlist === undefined ? "0" : Teacherliststudentlist.exercise_types.answer_users}</span><span - style={{"color": "#666666"}}>已交</span><span + style={{color: '#FF6800'}}>{Teacherliststudentlist === undefined ? "0" : Teacherliststudentlist.exercise_types.answer_users}</span><span + style={{color: "#666666"}}>已交</span><span className="ml10"></span> <span - style={{"color": "#666666"}}>{Teacherliststudentlist === undefined ? "0" : Teacherliststudentlist.exercise_types.unanswer_users}未交</span> + style={{color: "#666666"}}>{Teacherliststudentlist === undefined ? "0" : Teacherliststudentlist.exercise_types.unanswer_users}未交</span> {Teacherliststudentlist && Teacherliststudentlist.exercise_types.exercise_end_time === "--" ? "" : - <span className="ml20" style={{"color": "#9A9A9A"}}> 剩余提交时间:</span>} + <span className="ml20" style={{color: "#9A9A9A"}}> 剩余提交时间:</span>} {Teacherliststudentlist && Teacherliststudentlist.exercise_types.exercise_end_time === "--" ? "" : <span - style={{"color": '#FF6800'}}> {Teacherliststudentlist === undefined ? "0" : Teacherliststudentlist.exercise_types.exercise_end_time}</span>} + style={{color: '#FF6800'}}> {Teacherliststudentlist === undefined ? "0" : Teacherliststudentlist.exercise_types.exercise_end_time}</span>} </span> <div className="fr color-grey-6 edu-menu-panel"> <ul> @@ -2767,13 +2840,13 @@ class Studentshavecompletedthelist extends Component { <i className="iconfont icon-xiajiantou ml5 font-12 color-grey-6"></i> <ul className="edu-position-hide undis mt10"> <li><a onClick={(e) => this.funorder("end_at")} data-remote="true" - className=" font-12" style={{"text-align": "center "}}>提交时间</a> + className=" font-12" style={{textAlign: "center "}}>提交时间</a> </li> <li><a onClick={(e) => this.funorder("score")} data-remote="true" - className=" font-12" style={{"text-align": "center "}}>最终成绩</a> + className=" font-12" style={{textAlign: "center "}}>最终成绩</a> </li> <li><a onClick={(e) => this.funorder("student_id")} data-remote="true" - className=" font-12" style={{"text-align": "center "}}>学生学号</a> + className=" font-12" style={{textAlign: "center "}}>学生学号</a> </li> </ul> </li> @@ -2788,8 +2861,23 @@ class Studentshavecompletedthelist extends Component { .ant-spin-nested-loading > div > .ant-spin .ant-spin-dot { top: 72%;} } + .edu-table .ant-table-tbody > tr > td { + height: 58px; + } + .edu-table .ant-table-thead > tr > th{ + height: 58px; + } + .ysltableowss .ant-table-thead > tr > th{ + height: 58px; + } + .ysltableowss .ant-table-tbody > tr > td{ + height: 58px; + } + .ysltableowss .ant-table-thead > tr > th, .ant-table-tbody > tr > td { + padding: 9px; + } `}</style> - <div className="edu-table edu-back-white minH-560"> + <div className="edu-table edu-back-white minH-560 ysltableowss"> {datas === undefined ? "" : <Table dataSource={datas} columns={columns} diff --git a/public/react/src/modules/courses/exercise/yslexercisetable.css b/public/react/src/modules/courses/exercise/yslexercisetable.css index e69de29bb..42810b7de 100644 --- a/public/react/src/modules/courses/exercise/yslexercisetable.css +++ b/public/react/src/modules/courses/exercise/yslexercisetable.css @@ -0,0 +1,35 @@ +.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; +} +.maxnamewidth145{ + max-width: 145px; + overflow:hidden; + text-overflow:ellipsis; + white-space:nowrap; + cursor: default; +} \ No newline at end of file From 8ca2efa74c19875c190784c9b141cd4178eb692c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Mon, 9 Sep 2019 14:45:35 +0800 Subject: [PATCH 09/73] =?UTF-8?q?=E8=B0=83=E6=95=B4=E8=AF=95=E5=8D=B7?= =?UTF-8?q?=E5=88=97=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../exercise/Studentshavecompletedthelist.js | 62 +++++++++---------- .../courses/exercise/yslexercisetable.css | 18 +++++- 2 files changed, 47 insertions(+), 33 deletions(-) diff --git a/public/react/src/modules/courses/exercise/Studentshavecompletedthelist.js b/public/react/src/modules/courses/exercise/Studentshavecompletedthelist.js index 84ee5eb56..1e2c9702b 100644 --- a/public/react/src/modules/courses/exercise/Studentshavecompletedthelist.js +++ b/public/react/src/modules/courses/exercise/Studentshavecompletedthelist.js @@ -108,29 +108,29 @@ class Studentshavecompletedthelist extends Component { dataIndex: 'stduynumber', key: 'stduynumber', align: 'center', - className: "edu-txt-center font-14 maxnamewidth145", - width:'145px', + className: "edu-txt-center font-14 maxnamewidth175", + width:'175px', render: (text, record) => ( - <span className="maxnamewidth145" style={{ - width:'145px', + <span className="maxnamewidth175" style={{ + width:'175px', }}> {record.stduynumber === null ? <span style={{ color: '#999999', textAlign: "center", - width:'145px', + width:'175px', }}>--</span> : record.stduynumber === "" ? <span style={{ color: '#999999', textAlign: "center", - width:'145px', + width:'175px', }}>--</span> : - <span className="maxnamewidth145" style={{ + <span className="maxnamewidth175" style={{ color: '#9A9A9A', textAlign: "center", - width:'145px', + width:'175px', }}>{record.stduynumber}</span> } @@ -142,27 +142,27 @@ class Studentshavecompletedthelist extends Component { key: 'classroom', dataIndex: 'classroom', align: 'center', - className: "edu-txt-center font-14 maxnamewidth145", - width:'145px', + className: "edu-txt-center font-14 maxnamewidth255", + width:'255px', render: (text, record) => ( - <span className="maxnamewidth145" style={{width:'145px'}}> + <span className="maxnamewidth255" style={{width:'255px'}}> {record.classroom === null ? <span style={{ color: '#999999', textAlign: "center", - width:'145px', + width:'255px', }}>--</span> : record.classroom === "" ? <span style={{ color: '#999999', textAlign: "center", - width:'145px', + width:'255px', }}>--</span> : - <span className="maxnamewidth145" style={{ + <span className="maxnamewidth255" style={{ color: '#07111B', textAlign: "center", - width:'145px', + width:'255px', }}>{record.classroom}</span> } @@ -366,30 +366,30 @@ class Studentshavecompletedthelist extends Component { dataIndex: 'stduynumber', key: 'stduynumber', align: 'center', - className: "edu-txt-center tabletd font-14 maxnamewidth145", - width:'145px', + className: "edu-txt-center tabletd font-14 maxnamewidth175", + width:'175px', render: (text, record) => ( - <span className="maxnamewidth145" style={{ - width:'145px', + <span className="maxnamewidth175" style={{ + width:'175px', }}> {record.stduynumber === null ? <span style={{ color: '#999999', textAlign: "center", - width:'145px', + width:'175px', }}>--</span> : record.stduynumber === "" ? <span style={{ color: '#999999', textAlign: "center", - width:'145px', + width:'175px', }}>--</span> : - <span className="maxnamewidth145 font-14" style={{ + <span className="maxnamewidth175 font-14" style={{ color: '#9A9A9A', textAlign: "center", - width:'145px', + width:'175px', }}>{record.stduynumber}</span> } @@ -401,27 +401,27 @@ class Studentshavecompletedthelist extends Component { key: 'classroom', dataIndex: 'classroom', align: 'center', - className: "edu-txt-center tabletd font-14 maxnamewidth145", - width:'145px', + className: "edu-txt-center tabletd font-14 maxnamewidth255", + width:'255px', render: (text, record) => ( - <span className="font-14 maxnamewidth145" style={{ - width:'145px', + <span className="font-14 maxnamewidth255" style={{ + width:'255px', }}> {record.classroom === null ? <span style={{ color: '#999999', textAlign: "center", - width:'145px', + width:'255px', }}>--</span>: record.classroom === "" ? <span style={{ color: '#999999', textAlign: "center", - width:'145px', + width:'255px', }}>--</span>: - <span className="maxnamewidth145" tyle={{ + <span className="maxnamewidth255" tyle={{ color: '#07111B', textAlign: "center", - width:'145px', + width:'255px', }}>{record.classroom}</span> } diff --git a/public/react/src/modules/courses/exercise/yslexercisetable.css b/public/react/src/modules/courses/exercise/yslexercisetable.css index 42810b7de..2727ca2ff 100644 --- a/public/react/src/modules/courses/exercise/yslexercisetable.css +++ b/public/react/src/modules/courses/exercise/yslexercisetable.css @@ -26,8 +26,22 @@ white-space:nowrap; cursor: default; } -.maxnamewidth145{ - max-width: 145px; +.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; From bd46760cba016b0f9f4c7cda4387bc85ba08cbd6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Mon, 9 Sep 2019 15:03:44 +0800 Subject: [PATCH 10/73] =?UTF-8?q?=E8=B0=83=E6=95=B4=E8=AF=95=E5=8D=B7?= =?UTF-8?q?=E5=88=97=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../exercise/Studentshavecompletedthelist.js | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/public/react/src/modules/courses/exercise/Studentshavecompletedthelist.js b/public/react/src/modules/courses/exercise/Studentshavecompletedthelist.js index 1e2c9702b..60065f43e 100644 --- a/public/react/src/modules/courses/exercise/Studentshavecompletedthelist.js +++ b/public/react/src/modules/courses/exercise/Studentshavecompletedthelist.js @@ -97,7 +97,7 @@ class Studentshavecompletedthelist extends Component { {record.name === "--" ? <span style={{color: '#999999', textAlign: "center",width:'100px'}}>{record.name}</span> : - <span className="maxnamewidth110" style={{color: '#07111B', textAlign: "center",width:'100px'}}>{record.name}</span> + <a className="maxnamewidth110" style={{color: '#07111B', textAlign: "center",width:'100px'}} title={record.name}>{record.name}</a> } </span> @@ -127,11 +127,11 @@ class Studentshavecompletedthelist extends Component { textAlign: "center", width:'175px', }}>--</span> : - <span className="maxnamewidth175" style={{ + <a className="maxnamewidth175" style={{ color: '#9A9A9A', textAlign: "center", width:'175px', - }}>{record.stduynumber}</span> + }} title={record.stduynumber}>{record.stduynumber}</a> } </span> @@ -159,11 +159,11 @@ class Studentshavecompletedthelist extends Component { textAlign: "center", width:'255px', }}>--</span> : - <span className="maxnamewidth255" style={{ + <a className="maxnamewidth255" style={{ color: '#07111B', textAlign: "center", width:'255px', - }}>{record.classroom}</span> + }} title={record.classroom}>{record.classroom}</a> } </span> @@ -386,11 +386,11 @@ class Studentshavecompletedthelist extends Component { width:'175px', }}>--</span> : - <span className="maxnamewidth175 font-14" style={{ + <a className="maxnamewidth175 font-14" style={{ color: '#9A9A9A', textAlign: "center", width:'175px', - }}>{record.stduynumber}</span> + }} title={record.stduynumber}>{record.stduynumber}</a> } </span> @@ -418,11 +418,11 @@ class Studentshavecompletedthelist extends Component { textAlign: "center", width:'255px', }}>--</span>: - <span className="maxnamewidth255" tyle={{ + <a className="maxnamewidth255" tyle={{ color: '#07111B', textAlign: "center", width:'255px', - }}>{record.classroom}</span> + }} title={record.classroom}>{record.classroom}</a> } </span> From 2e5eba9ce2584dbbe272d91b5d783960eea8b87a Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Mon, 9 Sep 2019 16:53:16 +0800 Subject: [PATCH 11/73] =?UTF-8?q?=E7=AC=AC=E4=BA=8C=E4=BB=93=E5=BA=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/challenges_controller.rb | 19 ++++---- app/controllers/games_controller.rb | 9 +++- app/controllers/shixuns_controller.rb | 43 +++++++++++++++++++ app/models/shixun.rb | 3 ++ app/models/shixun_secret_repository.rb | 11 +++++ app/models/test_set.rb | 1 + .../shixuns/secret_repository.json.jbuilder | 7 +++ config/routes.rb | 2 + ...61930_create_shixun_secret_repositories.rb | 10 +++++ ...0909072626_add_match_rule_for_test_sets.rb | 7 +++ spec/models/shixun_secret_repository_spec.rb | 5 +++ 11 files changed, 108 insertions(+), 9 deletions(-) create mode 100644 app/models/shixun_secret_repository.rb create mode 100644 app/views/shixuns/secret_repository.json.jbuilder create mode 100644 db/migrate/20190909061930_create_shixun_secret_repositories.rb create mode 100644 db/migrate/20190909072626_add_match_rule_for_test_sets.rb create mode 100644 spec/models/shixun_secret_repository_spec.rb diff --git a/app/controllers/challenges_controller.rb b/app/controllers/challenges_controller.rb index 8cb68b1d4..7a5675b4f 100644 --- a/app/controllers/challenges_controller.rb +++ b/app/controllers/challenges_controller.rb @@ -198,14 +198,17 @@ class ChallengesController < ApplicationController # 测试集变化则需要更新(输入、 输出、 是否隐藏) if sets_output != params_output || sets_open != params_hidden || sets_input != params_input || set_score != params_score test_set.delete_all unless test_set.blank? - params[:test_set].each_with_index do |set, index| - TestSet.create(:challenge_id => @challenge.id, - :input => "#{set[:input]}", - :output => "#{set[:output]}", - :is_public => params_hidden[index], - :score => set[:score], - :position => (index + 1)) - end + params[:test_set].each_with_index do |set, index| + # last: 末尾匹配, full: 全完匹配 + match_rule = params[:match_rule] == 'last' ? 'last' : 'full' + TestSet.create(:challenge_id => @challenge.id, + :input => "#{set[:input]}", + :output => "#{set[:output]}", + :is_public => params_hidden[index], + :score => set[:score], + :match_rule => "#{match_rule}", + :position => (index + 1)) + end @challenge.update_column(:modify_time, Time.now) # 测试集的 @shixun.myshixuns.update_all(:system_tip => 0) diff --git a/app/controllers/games_controller.rb b/app/controllers/games_controller.rb index 916f09430..26a7ff8db 100644 --- a/app/controllers/games_controller.rb +++ b/app/controllers/games_controller.rb @@ -537,7 +537,7 @@ class GamesController < ApplicationController game_challenge.test_sets.each do |test_set| input = test_set.input.nil? ? "" : test_set.input.gsub("\r\n", "\n") output = test_set.output.nil? ? "" : test_set.output.gsub("\r\n", "\n") - test_cases = {:input => input, :output => output} + test_cases = {:input => input, :output => output, :matchRule => test_set.match_rule} testSet << test_cases end @@ -560,6 +560,13 @@ class GamesController < ApplicationController # needPortMapping: web类型需要pod端口映射 br_params[:needPortMapping] = 8080 if @myshixun.mirror_name.include?("Web") + # 私密仓库的设置 + secret_rep = @shixun.shixun_secret_repository + if secret_rep&.repo_name + secretGitUrl = repo_url secret_rep.repo_path + br_params.merge({secretGitUrl: secretGitUrl, secretDir: secret_rep.secret_dir_path}) + end + # 中间层交互 uri = "#{shixun_tomcat}/bridge/game/gameEvaluate" res = interface_post uri, br_params, 502, "gameEvaluate failed" diff --git a/app/controllers/shixuns_controller.rb b/app/controllers/shixuns_controller.rb index 79e182fef..ad74b97db 100644 --- a/app/controllers/shixuns_controller.rb +++ b/app/controllers/shixuns_controller.rb @@ -473,6 +473,17 @@ class ShixunsController < ApplicationController @shixun.shixun_service_configs.create!(config) if name.present? end end + # 添加第二仓库 + if params[:is_secret_repository] + add_secret_repositoy + else + # 如果有仓库,就要删 + if @shixun.shixun_secret_repository&.repo_name + GitService.delete_repository(repo_path: @shixun.shixun_secret_repository.repo_path) + @shixun.shixun_secret_repository.destroy + end + end + rescue Exception => e uid_logger_error(e.message) tip_exception("实训保存失败") @@ -819,6 +830,29 @@ class ShixunsController < ApplicationController end end + # 设置私密版本库的在tpm中的目录 + def set_secret_dir + raise("设置路径不能为空") if params[:secret_dir_path].blank? + @shixun.shixun_secret_repository.update_attribute(:secret_dir_path, params[:secret_dir_path]) + normal_status("设置成功") + end + + def secret_repository + begin + @repo_path = @shixun.shixun_secret_repository&.repo_path + @repo_url = repo_url @repo_path + @trees = GitService.file_tree(repo_path: @repo_path, path: params[:path]) + logger.info("#11@@#@#@#@111#@@@@###{@trees}") + if @trees + logger.info("#@@#@#@#@#@@@@###{@trees.try(:count)}") + @latest_commit = [GitService.commits(repo_path: @repo_path).first] + Rails.logger.info("########## #{@latest_commit}") + end + rescue Exception => e + logger.error(e.message) + end + end + include GitCommon def update_file @@ -990,4 +1024,13 @@ private modify_shixun = ShixunModify.exists?(:myshixun_id => current_myshixun.id, :shixun_id => @shixun.id, :status => 1) games.size != min_challenges.size || modify_shixun end + + # 添加私密仓库 + def add_secret_repositoy + # 防止跟tpm版本库重名,加了前缀secret + repo_path = repo_namespace(current_user.login, "secret_#{@shixun.identifier}") + GitService.add_repository(repo_path: repo_path) + @shixun.shixun_secret_repository.create!(repo_name: repo_path.split(".")[0]) + end + end diff --git a/app/models/shixun.rb b/app/models/shixun.rb index 9ad3cbcdf..83d97f822 100644 --- a/app/models/shixun.rb +++ b/app/models/shixun.rb @@ -38,6 +38,9 @@ class Shixun < ApplicationRecord has_one :shixun_info, dependent: :destroy + # 第二版本库 + has_one :shixun_secret_repository, dependent: :destroy + belongs_to :user # 实训服务配置 has_many :shixun_service_configs, :dependent => :destroy diff --git a/app/models/shixun_secret_repository.rb b/app/models/shixun_secret_repository.rb new file mode 100644 index 000000000..699c6dd30 --- /dev/null +++ b/app/models/shixun_secret_repository.rb @@ -0,0 +1,11 @@ +class ShixunSecretRepository < ApplicationRecord + # repo_name: 仓库名 + # secret_dir_name: 在tpm仓库的那个目录下 + + belongs_to :shixun + + def repo_path + "#{repo_name}.git" + end + +end diff --git a/app/models/test_set.rb b/app/models/test_set.rb index 148cb8720..7772a3a00 100644 --- a/app/models/test_set.rb +++ b/app/models/test_set.rb @@ -1,2 +1,3 @@ class TestSet < ApplicationRecord + # match_rule: 匹配规则: full: 完全匹配, last: 末尾匹配 end diff --git a/app/views/shixuns/secret_repository.json.jbuilder b/app/views/shixuns/secret_repository.json.jbuilder new file mode 100644 index 000000000..51f774fd8 --- /dev/null +++ b/app/views/shixuns/secret_repository.json.jbuilder @@ -0,0 +1,7 @@ +json.trees @trees + +if @trees.present? + json.partial! 'shixuns/commit', locals: { commits: @latest_commit } +end + +json.git_url @repo_url \ No newline at end of file diff --git a/config/routes.rb b/config/routes.rb index 5cf74c29a..0d6e108ad 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -197,6 +197,8 @@ Rails.application.routes.draw do get :get_script_contents get :get_custom_script post :repository + post :secret_repository + post :set_secret_dir post :commits post :file_content post :update_file diff --git a/db/migrate/20190909061930_create_shixun_secret_repositories.rb b/db/migrate/20190909061930_create_shixun_secret_repositories.rb new file mode 100644 index 000000000..5526869f8 --- /dev/null +++ b/db/migrate/20190909061930_create_shixun_secret_repositories.rb @@ -0,0 +1,10 @@ +class CreateShixunSecretRepositories < ActiveRecord::Migration[5.2] + def change + create_table :shixun_secret_repositories do |t| + t.references :shixun + t.string :repo_name + t.string :secret_dir_path + t.timestamps + end + end +end diff --git a/db/migrate/20190909072626_add_match_rule_for_test_sets.rb b/db/migrate/20190909072626_add_match_rule_for_test_sets.rb new file mode 100644 index 000000000..2d9d53f0f --- /dev/null +++ b/db/migrate/20190909072626_add_match_rule_for_test_sets.rb @@ -0,0 +1,7 @@ +class AddMatchRuleForTestSets < ActiveRecord::Migration[5.2] + def change + add_column :test_sets, :match_rule, :string + TestSet.update_all(match_rule: 'full') + + end +end diff --git a/spec/models/shixun_secret_repository_spec.rb b/spec/models/shixun_secret_repository_spec.rb new file mode 100644 index 000000000..ed06914ae --- /dev/null +++ b/spec/models/shixun_secret_repository_spec.rb @@ -0,0 +1,5 @@ +require 'rails_helper' + +RSpec.describe ShixunSecretRepository, type: :model do + pending "add some examples to (or delete) #{__FILE__}" +end From af4c899b9d580fbbdb45d0daaa4ec79c0ab9c1b5 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Mon, 9 Sep 2019 17:40:24 +0800 Subject: [PATCH 12/73] =?UTF-8?q?=E5=8F=82=E6=95=B0=E6=B7=BB=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/challenges/edit.json.jbuilder | 2 +- app/views/shixuns/settings.json.jbuilder | 2 ++ app/views/shixuns/show.json.jbuilder | 1 + 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/app/views/challenges/edit.json.jbuilder b/app/views/challenges/edit.json.jbuilder index 5ae15cf67..3e7f5b425 100644 --- a/app/views/challenges/edit.json.jbuilder +++ b/app/views/challenges/edit.json.jbuilder @@ -16,7 +16,7 @@ elsif @tab == 1 json.has_web_route @shixun.has_web_route? json.test_sets @challenge.test_sets do |set| json.hidden (set.is_public ? 0 : 1) - json.(set, :input, :output, :score) + json.(set, :input, :output, :score, :match_rule) end elsif @tab == 2 # 参考答案 diff --git a/app/views/shixuns/settings.json.jbuilder b/app/views/shixuns/settings.json.jbuilder index ad29f4176..c9142dab0 100644 --- a/app/views/shixuns/settings.json.jbuilder +++ b/app/views/shixuns/settings.json.jbuilder @@ -30,6 +30,8 @@ json.shixun do json.scope_partment @shixun.schools.map(&:name) # 公开范围 json.opening_time @shixun.opening_time json.forbid_copy @shixun.forbid_copy + # 私密仓库 + json.is_secret_repository @shixun.shixun_secret_repository.present? # 实训服务配置 json.shixun_service_configs do diff --git a/app/views/shixuns/show.json.jbuilder b/app/views/shixuns/show.json.jbuilder index 8e49a99f4..57ea305ed 100644 --- a/app/views/shixuns/show.json.jbuilder +++ b/app/views/shixuns/show.json.jbuilder @@ -2,3 +2,4 @@ json.fork_from @fork_from json.identity User.current.shixun_identity(@shixun) json.power @power json.partial! 'shixuns/top', locals: { shixun: @shixun, current_myshixun: @current_myshixun } +json.secret_repositoy @shixun.shixun_secret_repository.present? From 4f9e07d3d0406b2ac188c7eb770a5be5da3d7dec Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Mon, 9 Sep 2019 17:48:26 +0800 Subject: [PATCH 13/73] =?UTF-8?q?=E6=B5=8B=E8=AF=95=E9=9B=86=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/challenges_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/challenges_controller.rb b/app/controllers/challenges_controller.rb index 7a5675b4f..0008e470d 100644 --- a/app/controllers/challenges_controller.rb +++ b/app/controllers/challenges_controller.rb @@ -200,7 +200,7 @@ class ChallengesController < ApplicationController test_set.delete_all unless test_set.blank? params[:test_set].each_with_index do |set, index| # last: 末尾匹配, full: 全完匹配 - match_rule = params[:match_rule] == 'last' ? 'last' : 'full' + match_rule = set[:match_rule] == 'last' ? 'last' : 'full' TestSet.create(:challenge_id => @challenge.id, :input => "#{set[:input]}", :output => "#{set[:output]}", From 4de92bc87dd559c1e2f3272843ccc564599e7c92 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Mon, 9 Sep 2019 17:55:27 +0800 Subject: [PATCH 14/73] 1 --- app/controllers/shixuns_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/shixuns_controller.rb b/app/controllers/shixuns_controller.rb index ad74b97db..a558af444 100644 --- a/app/controllers/shixuns_controller.rb +++ b/app/controllers/shixuns_controller.rb @@ -833,7 +833,7 @@ class ShixunsController < ApplicationController # 设置私密版本库的在tpm中的目录 def set_secret_dir raise("设置路径不能为空") if params[:secret_dir_path].blank? - @shixun.shixun_secret_repository.update_attribute(:secret_dir_path, params[:secret_dir_path]) + @shixun.shixun_secret_repository.update_attributes(:secret_dir_path => params[:secret_dir_path]) normal_status("设置成功") end From 28e8a1161992ad57a0dfce3aa57d7b93f40b2a8d Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Mon, 9 Sep 2019 17:58:50 +0800 Subject: [PATCH 15/73] 1 --- app/controllers/challenges_controller.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/app/controllers/challenges_controller.rb b/app/controllers/challenges_controller.rb index 0008e470d..e2f5f7078 100644 --- a/app/controllers/challenges_controller.rb +++ b/app/controllers/challenges_controller.rb @@ -200,6 +200,7 @@ class ChallengesController < ApplicationController test_set.delete_all unless test_set.blank? params[:test_set].each_with_index do |set, index| # last: 末尾匹配, full: 全完匹配 + logger.info("set: #{set}; match_rule : #{set[:match_rule]}") match_rule = set[:match_rule] == 'last' ? 'last' : 'full' TestSet.create(:challenge_id => @challenge.id, :input => "#{set[:input]}", From fd158b9bf0f00a7d94c0cd38458c25210c4ec868 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Mon, 9 Sep 2019 18:07:48 +0800 Subject: [PATCH 16/73] =?UTF-8?q?=20=E6=B5=8B=E8=AF=95=E9=9B=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/challenges_controller.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/controllers/challenges_controller.rb b/app/controllers/challenges_controller.rb index e2f5f7078..c21a493e0 100644 --- a/app/controllers/challenges_controller.rb +++ b/app/controllers/challenges_controller.rb @@ -191,12 +191,15 @@ class ChallengesController < ApplicationController sets_input = test_set.map(&:input) sets_open = test_set.map(&:is_public) set_score = test_set.map(&:score) + set_match_rule = test_set.map(&:match_rule) params_hidden = params[:test_set].map{|set| set[:hidden].to_i == 0} params_output = params[:test_set].map{|set| set[:output] } params_input = params[:test_set].map{|set| set[:input] } params_score = params[:test_set].map{|set| set[:score]} + params_test_set = params[:test_set].map{|set| set[:match_rule]} # 测试集变化则需要更新(输入、 输出、 是否隐藏) - if sets_output != params_output || sets_open != params_hidden || sets_input != params_input || set_score != params_score + if sets_output != params_output || sets_open != params_hidden || sets_input != params_input || + set_score != params_score || params_test_set != set_match_rule test_set.delete_all unless test_set.blank? params[:test_set].each_with_index do |set, index| # last: 末尾匹配, full: 全完匹配 From adf50268f5b6e260767f691b0563fe9152f461c4 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Mon, 9 Sep 2019 18:11:35 +0800 Subject: [PATCH 17/73] =?UTF-8?q?=E4=BB=93=E5=BA=93=E4=BF=9D=E5=AD=98?= =?UTF-8?q?=E5=A4=B1=E8=B4=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/shixuns_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/shixuns_controller.rb b/app/controllers/shixuns_controller.rb index a558af444..8eb1573ca 100644 --- a/app/controllers/shixuns_controller.rb +++ b/app/controllers/shixuns_controller.rb @@ -485,7 +485,7 @@ class ShixunsController < ApplicationController end rescue Exception => e - uid_logger_error(e.message) + uid_logger_error("实训保存失败--------#{e.message}") tip_exception("实训保存失败") raise ActiveRecord::Rollback end From 071d155d4cd9b6eba00dbf7c9a63b5e457e12f6d Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Mon, 9 Sep 2019 18:14:03 +0800 Subject: [PATCH 18/73] =?UTF-8?q?=E5=88=9B=E5=BB=BA=E7=A7=81=E5=AF=86?= =?UTF-8?q?=E4=BB=93=E5=BA=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/shixuns_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/shixuns_controller.rb b/app/controllers/shixuns_controller.rb index 8eb1573ca..00c018cbd 100644 --- a/app/controllers/shixuns_controller.rb +++ b/app/controllers/shixuns_controller.rb @@ -1030,7 +1030,7 @@ private # 防止跟tpm版本库重名,加了前缀secret repo_path = repo_namespace(current_user.login, "secret_#{@shixun.identifier}") GitService.add_repository(repo_path: repo_path) - @shixun.shixun_secret_repository.create!(repo_name: repo_path.split(".")[0]) + @shixun.shixun_secret_repository.create(repo_name: repo_path.split(".")[0]) end end From 156fd6c19e57c95825f6427f0242f305248b0182 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Mon, 9 Sep 2019 18:15:45 +0800 Subject: [PATCH 19/73] =?UTF-8?q?=E7=A7=81=E5=AF=86=E4=BB=93=E5=BA=93?= =?UTF-8?q?=E5=88=9B=E5=BB=BA=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/shixuns_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/shixuns_controller.rb b/app/controllers/shixuns_controller.rb index 00c018cbd..7fbf2fa47 100644 --- a/app/controllers/shixuns_controller.rb +++ b/app/controllers/shixuns_controller.rb @@ -1030,7 +1030,7 @@ private # 防止跟tpm版本库重名,加了前缀secret repo_path = repo_namespace(current_user.login, "secret_#{@shixun.identifier}") GitService.add_repository(repo_path: repo_path) - @shixun.shixun_secret_repository.create(repo_name: repo_path.split(".")[0]) + ShixunSecretRepository.create!(repo_name: repo_path.split(".")[0], shixun_id: @shixun.id``) end end From a50e50028119997913deb07318c4526d553bfe36 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Mon, 9 Sep 2019 18:19:17 +0800 Subject: [PATCH 20/73] 1 --- app/controllers/shixuns_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/shixuns_controller.rb b/app/controllers/shixuns_controller.rb index 7fbf2fa47..748b4c1f3 100644 --- a/app/controllers/shixuns_controller.rb +++ b/app/controllers/shixuns_controller.rb @@ -1030,7 +1030,7 @@ private # 防止跟tpm版本库重名,加了前缀secret repo_path = repo_namespace(current_user.login, "secret_#{@shixun.identifier}") GitService.add_repository(repo_path: repo_path) - ShixunSecretRepository.create!(repo_name: repo_path.split(".")[0], shixun_id: @shixun.id``) + ShixunSecretRepository.create!(repo_name: repo_path.split(".")[0], shixun_id: @shixun.id) end end From d4cc93f0c373c1fed3770b3066ac2f86db3286ec Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Mon, 9 Sep 2019 18:24:42 +0800 Subject: [PATCH 21/73] 1 --- app/controllers/shixuns_controller.rb | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/app/controllers/shixuns_controller.rb b/app/controllers/shixuns_controller.rb index 748b4c1f3..b8f5774ef 100644 --- a/app/controllers/shixuns_controller.rb +++ b/app/controllers/shixuns_controller.rb @@ -989,7 +989,12 @@ private end def find_repo_name - @repo_path = @shixun.try(:repo_path) + # 有私密版本库的参数时,需要拿私密仓库 + @repo_path = if params[:secret_repositoy] + @shixun.shixun_secret_repository&.repo_path + else + @shixun.try(:repo_path) + end @path = params[:path] end From a39329f3bbc3bdc72635daaaa191243ded618a24 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Mon, 9 Sep 2019 18:29:21 +0800 Subject: [PATCH 22/73] 1 --- app/controllers/shixuns_controller.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/app/controllers/shixuns_controller.rb b/app/controllers/shixuns_controller.rb index b8f5774ef..5e3a58c3d 100644 --- a/app/controllers/shixuns_controller.rb +++ b/app/controllers/shixuns_controller.rb @@ -833,6 +833,7 @@ class ShixunsController < ApplicationController # 设置私密版本库的在tpm中的目录 def set_secret_dir raise("设置路径不能为空") if params[:secret_dir_path].blank? + raise("请先配置私密版本库") if @shixun.shixun_secret_repository.blank? @shixun.shixun_secret_repository.update_attributes(:secret_dir_path => params[:secret_dir_path]) normal_status("设置成功") end From 4ead30cbec4774c5494be00ac140ef01d2bdf99a Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Mon, 9 Sep 2019 18:36:04 +0800 Subject: [PATCH 23/73] =?UTF-8?q?=E5=8F=82=E6=95=B0=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/shixuns_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/shixuns_controller.rb b/app/controllers/shixuns_controller.rb index 5e3a58c3d..eebcf470c 100644 --- a/app/controllers/shixuns_controller.rb +++ b/app/controllers/shixuns_controller.rb @@ -991,7 +991,7 @@ private def find_repo_name # 有私密版本库的参数时,需要拿私密仓库 - @repo_path = if params[:secret_repositoy] + @repo_path = if params[:secret_repositroy] @shixun.shixun_secret_repository&.repo_path else @shixun.try(:repo_path) From 563a7b3854666b3e1a7b670490a470ad71909579 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Mon, 9 Sep 2019 18:41:48 +0800 Subject: [PATCH 24/73] =?UTF-8?q?1=EF=BC=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/shixuns_controller.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/controllers/shixuns_controller.rb b/app/controllers/shixuns_controller.rb index eebcf470c..08eeaab7b 100644 --- a/app/controllers/shixuns_controller.rb +++ b/app/controllers/shixuns_controller.rb @@ -991,11 +991,13 @@ private def find_repo_name # 有私密版本库的参数时,需要拿私密仓库 + logger.info("######{params[:secret_repositroy]}") @repo_path = if params[:secret_repositroy] @shixun.shixun_secret_repository&.repo_path else @shixun.try(:repo_path) - end + end + logger.info("######{@repo_path}") @path = params[:path] end From 8dd0a34bf75182d0aeb11aea3957b35721213de1 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Mon, 9 Sep 2019 18:43:34 +0800 Subject: [PATCH 25/73] 1 --- app/controllers/shixuns_controller.rb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app/controllers/shixuns_controller.rb b/app/controllers/shixuns_controller.rb index 08eeaab7b..330718474 100644 --- a/app/controllers/shixuns_controller.rb +++ b/app/controllers/shixuns_controller.rb @@ -991,8 +991,7 @@ private def find_repo_name # 有私密版本库的参数时,需要拿私密仓库 - logger.info("######{params[:secret_repositroy]}") - @repo_path = if params[:secret_repositroy] + @repo_path = if params[:secret_repository] @shixun.shixun_secret_repository&.repo_path else @shixun.try(:repo_path) From abeb700d21ea9a5bf754651ba25482721989ebc3 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Mon, 9 Sep 2019 18:45:26 +0800 Subject: [PATCH 26/73] 1 --- app/views/shixuns/secret_repository.json.jbuilder | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/views/shixuns/secret_repository.json.jbuilder b/app/views/shixuns/secret_repository.json.jbuilder index 51f774fd8..40751b4f3 100644 --- a/app/views/shixuns/secret_repository.json.jbuilder +++ b/app/views/shixuns/secret_repository.json.jbuilder @@ -4,4 +4,5 @@ if @trees.present? json.partial! 'shixuns/commit', locals: { commits: @latest_commit } end -json.git_url @repo_url \ No newline at end of file +json.git_url @repo_url +json.secret_repository @shixun.shixun_secret_repository&.secret_dir_path \ No newline at end of file From 354287282abaf57fbc51dd4309e971f249028db6 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Mon, 9 Sep 2019 18:46:38 +0800 Subject: [PATCH 27/73] 1 --- app/views/shixuns/secret_repository.json.jbuilder | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/shixuns/secret_repository.json.jbuilder b/app/views/shixuns/secret_repository.json.jbuilder index 40751b4f3..482a683a8 100644 --- a/app/views/shixuns/secret_repository.json.jbuilder +++ b/app/views/shixuns/secret_repository.json.jbuilder @@ -5,4 +5,4 @@ if @trees.present? end json.git_url @repo_url -json.secret_repository @shixun.shixun_secret_repository&.secret_dir_path \ No newline at end of file +json.secret_dir_path @shixun.shixun_secret_repository&.secret_dir_path \ No newline at end of file From 2201c2be64744b8e42981b52187b303bba196f7d Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Mon, 9 Sep 2019 18:50:55 +0800 Subject: [PATCH 28/73] =?UTF-8?q?=E7=A7=81=E5=AF=86=E7=89=88=E6=9C=AC?= =?UTF-8?q?=E5=BA=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/shixuns_controller.rb | 4 ++-- app/views/shixuns/show.json.jbuilder | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/controllers/shixuns_controller.rb b/app/controllers/shixuns_controller.rb index 330718474..3f415f706 100644 --- a/app/controllers/shixuns_controller.rb +++ b/app/controllers/shixuns_controller.rb @@ -475,7 +475,7 @@ class ShixunsController < ApplicationController end # 添加第二仓库 if params[:is_secret_repository] - add_secret_repositoy + add_secret_repository else # 如果有仓库,就要删 if @shixun.shixun_secret_repository&.repo_name @@ -1033,7 +1033,7 @@ private end # 添加私密仓库 - def add_secret_repositoy + def add_secret_repository # 防止跟tpm版本库重名,加了前缀secret repo_path = repo_namespace(current_user.login, "secret_#{@shixun.identifier}") GitService.add_repository(repo_path: repo_path) diff --git a/app/views/shixuns/show.json.jbuilder b/app/views/shixuns/show.json.jbuilder index 57ea305ed..4a0c3ebd6 100644 --- a/app/views/shixuns/show.json.jbuilder +++ b/app/views/shixuns/show.json.jbuilder @@ -2,4 +2,4 @@ json.fork_from @fork_from json.identity User.current.shixun_identity(@shixun) json.power @power json.partial! 'shixuns/top', locals: { shixun: @shixun, current_myshixun: @current_myshixun } -json.secret_repositoy @shixun.shixun_secret_repository.present? +json.secret_repository @shixun.shixun_secret_repository.present? From a83dfb9f9e04cf211239c93f43310d540b5427a7 Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Mon, 9 Sep 2019 18:51:16 +0800 Subject: [PATCH 29/73] =?UTF-8?q?=E7=A7=81=E5=AF=86=E7=89=88=E6=9C=AC?= =?UTF-8?q?=E5=BA=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/react/src/modules/tpm/TPMIndex.js | 7 + public/react/src/modules/tpm/TPMRepository.js | 3 + .../src/modules/tpm/TPMRepositoryComponent.js | 11 +- .../modules/tpm/TPMsettings/TPMsettings.js | 140 ++++++++++++++--- .../react/src/modules/tpm/component/TPMNav.js | 7 +- .../component/modal/RepositoryChooseModal.js | 148 ++++++++++++++++++ .../tpm/shixunchild/Repository/Repository.js | 11 +- .../Repository/RepositoryCodeEditor.js | 1 + .../Repository/RepositoryCombinePath.js | 82 ++++++++++ 9 files changed, 383 insertions(+), 27 deletions(-) create mode 100644 public/react/src/modules/tpm/component/modal/RepositoryChooseModal.js create mode 100644 public/react/src/modules/tpm/shixunchild/Repository/RepositoryCombinePath.js diff --git a/public/react/src/modules/tpm/TPMIndex.js b/public/react/src/modules/tpm/TPMIndex.js index 00a88cd21..2b77181e8 100644 --- a/public/react/src/modules/tpm/TPMIndex.js +++ b/public/react/src/modules/tpm/TPMIndex.js @@ -190,6 +190,8 @@ class TPMIndex extends Component { identity: response.data.identity, propaedeutics:response.data.propaedeutics, status: response.data.shixun_status, + secret_repository: response.data.secret_repository, + }); } }).catch((error) => { @@ -300,6 +302,11 @@ class TPMIndex extends Component { (props) => (<TPMRepositoryComponent {...this.props} {...this.state} {...props} />) }></Route> + <Route path="/shixuns/:shixunId/secret_repository" render={ + (props) => (<TPMRepositoryComponent {...this.props} {...this.state} {...props} secret_repository={true} + />) + }></Route> + {/* <Route exact path="/shixuns/:shixunId/propaedeutics" component={TPMPropaedeuticsComponent}></Route> */} <Route exact path="/shixuns/:shixunId/propaedeutics" render={ diff --git a/public/react/src/modules/tpm/TPMRepository.js b/public/react/src/modules/tpm/TPMRepository.js index e9bfbf51d..c4d0dce67 100644 --- a/public/react/src/modules/tpm/TPMRepository.js +++ b/public/react/src/modules/tpm/TPMRepository.js @@ -11,6 +11,8 @@ import Repository from './shixunchild/Repository/Repository' import TPMRightSection from './component/TPMRightSection' import TPMNav from './component/TPMNav' +import RepositoryChooseModal from './component/modal/RepositoryChooseModal' + class TPMRepository extends Component { constructor(props) { super(props) @@ -34,6 +36,7 @@ class TPMRepository extends Component { shixun={shixun} {...this.props} ></TPMNav> + {/* <RepositoryChooseModal {...this.props}></RepositoryChooseModal> */} { loadingContent ? <CircularProgress size={40} thickness={3} style={{ marginLeft: 'auto', marginRight: 'auto', marginTop: '200px', display: 'block' }}/> : <Repository diff --git a/public/react/src/modules/tpm/TPMRepositoryComponent.js b/public/react/src/modules/tpm/TPMRepositoryComponent.js index a9c2e6854..70e208126 100644 --- a/public/react/src/modules/tpm/TPMRepositoryComponent.js +++ b/public/react/src/modules/tpm/TPMRepositoryComponent.js @@ -30,6 +30,12 @@ class TPMRepositoryComponent extends Component { isContentWidth100: this._isFileInPathArray(pathArray) } } + componentDidUpdate(prevProps, prevState) { + if (this.props.secret_repository != prevProps.secret_repository) { + this.fetchRepo() + } + } + componentDidMount = () => { this.fetchRepo() @@ -72,7 +78,8 @@ class TPMRepositoryComponent extends Component { let id = this.props.match.params.shixunId; let url = `/shixuns/${id}/file_content.json`; axios.post(url, { - path: path + path: path, + secret_repository: this.props.secret_repository }).then((response) => { trace_collapse('repository res: ', response) @@ -138,7 +145,7 @@ class TPMRepositoryComponent extends Component { const path = urlNewPathArray.join('/') let id = this.props.match.params.shixunId; - let url = `/shixuns/${id}/repository.json`; + let url = `/shixuns/${id}/${this.props.secret_repository ? 'secret_repository' : 'repository'}.json`; // this.props.setLoadingContent(true) axios.post(url, { path: path ? path : '' diff --git a/public/react/src/modules/tpm/TPMsettings/TPMsettings.js b/public/react/src/modules/tpm/TPMsettings/TPMsettings.js index a8917fd02..5e27cb41c 100644 --- a/public/react/src/modules/tpm/TPMsettings/TPMsettings.js +++ b/public/react/src/modules/tpm/TPMsettings/TPMsettings.js @@ -353,6 +353,8 @@ export default class TPMsettings extends Component { test_set_permission: response.data.shixun.test_set_permission, hide_code: response.data.shixun.hide_code, code_hidden: response.data.shixun.code_hidden, + is_secret_repository: response.data.shixun.is_secret_repository, + init_is_secret_repository: response.data.shixun.is_secret_repository, forbid_copy: response.data.shixun.forbid_copy, vnc: response.data.shixun.vnc, vnc_evaluate: response.data.shixun.vnc_evaluate, @@ -439,20 +441,52 @@ export default class TPMsettings extends Component { SelectshixunCommand=(e)=>{ // console.log( e.target.value) - this.setState({ - webssh: e.target.value, - }); - if(e.target.value===2){ - this.setState({ - SelectTheCommandtype: true, - multi_webssh:false - }); - }else{ - this.setState({ - SelectTheCommandtype: false, - multi_webssh:false - }); - } + const webssh = e.target.value + if (webssh == 2) { + this.setState({ + webssh: webssh, + SelectTheCommandtype: true, + multi_webssh:false + }); + } else { + if (this.state.init_is_secret_repository && !this.state.vnc) { + this.confirmDeleteSecretRepo({ + onOk: () => { + this.setState({ + webssh: webssh, + SelectTheCommandtype: false, + multi_webssh:false + }); + } + }) + } else { + if (!this.state.vnc) { + this.setState({ + is_secret_repository: false, + }) + } + this.setState({ + webssh: webssh, + SelectTheCommandtype: false, + multi_webssh:false + }); + } + } + + // this.setState({ + // webssh: webssh, + // }); + // if(webssh===2){ + // this.setState({ + // SelectTheCommandtype: true, + // multi_webssh:false + // }); + // }else{ + // this.setState({ + // SelectTheCommandtype: false, + // multi_webssh:false + // }); + // } } SelectOpenpublic=(e)=>{ @@ -525,6 +559,35 @@ export default class TPMsettings extends Component { }); } + confirmDeleteSecretRepo = ({title, onOk}) => { + confirm({ + title: title || <div> + <div>已创建的私密版本库及其内容,将在“保存”时被删除。</div> + <div>是否确认取消勾选?</div> + </div>, + okText: '确定', + cancelText: '取消', + onOk: () => { + this.setState({ is_secret_repository: false }) + onOk && onOk() + }, + onCancel() { + }, + }); + } + is_secret_repository = (e) => { + const checked = e.target.checked + if (!checked) { + if (this.state.init_is_secret_repository) { + this.confirmDeleteSecretRepo({ + }) + } else { + this.setState({ is_secret_repository: false }) + } + } else { + this.setState({ is_secret_repository: true }) + } + } forbid_copy = (e) => { let sum = "" if (e.target.checked === false) { @@ -550,11 +613,34 @@ export default class TPMsettings extends Component { // } else if (e.target.checked === true) { // sum = 1 // } - this.setState({ - vnc: e.target.checked, - vnc_evaluate: false, - }); - + const vnc = e.target.checked; + if (!vnc) { + if (this.state.init_is_secret_repository && this.state.webssh != 2) { + this.confirmDeleteSecretRepo({ + onOk: () => { + this.setState({ + vnc: e.target.checked, + vnc_evaluate: false, + }); + } + }) + } else { + if (this.state.webssh != 2) { + this.setState({ + is_secret_repository: false + }) + } + this.setState({ + vnc: e.target.checked, + vnc_evaluate: false, + }); + } + } else { + this.setState({ + vnc: e.target.checked, + vnc_evaluate: false, + }); + } } shixunsname = (e) => { // let {shixunsstatus}=this.state; @@ -782,7 +868,7 @@ export default class TPMsettings extends Component { let { name, choice_main_type, choice_small_type, choice_standard_scripts, scope_partment, choice_standard_scriptssum, vnc_evaluate, evaluate_script, webssh, use_scope, trainee, can_copy, task_pass, test_set_permission, hide_code, code_hidden, forbid_copy, vnc,multi_webssh, - opening_time,shixunmemoMDvalue,shixun_service_configlist + opening_time,shixunmemoMDvalue,shixun_service_configlist, is_secret_repository } = this.state; let newshixun_service_configlist = shixun_service_configlist.map(v => { @@ -886,6 +972,7 @@ export default class TPMsettings extends Component { let Url = `/shixuns/` + id + `.json`; let data = { shixun:{ + name: name, webssh: webssh, use_scope: use_scope, @@ -906,6 +993,7 @@ export default class TPMsettings extends Component { description: description_editormd, evaluate_script: evaluate_script_editormd, }, + is_secret_repository: is_secret_repository, main_type: choice_main_type, small_type: choice_small_type, scope_partment: scope_partment, @@ -1460,6 +1548,7 @@ export default class TPMsettings extends Component { name, settingsData, webssh, + is_secret_repository, use_scope, shixunsID, can_copy, @@ -2199,6 +2288,15 @@ export default class TPMsettings extends Component { </span> </div> + { (vnc || webssh == 2) && <div className="clearfix mt20 ml30"> + <span className="color-grey-6 mt5 fl" style={{minWidth: '95px'}}>私密版本库:</span> + <span className="fl mt5"> + <Checkbox checked={is_secret_repository === undefined ? false : is_secret_repository} + onChange={this.is_secret_repository}></Checkbox> + <label style={{top:'6px'}} className="color-grey-9 ml10" >勾选则启用私密版本库,学员页面不能查看该版本库目录</label> + </span> + </div>} + <div className="clearfix mt20 ml30"> <span className="color-grey-6 mt5 fl" style={{minWidth: '95px'}}>禁用复制粘贴:</span> <span className="fl mt5"> @@ -2239,7 +2337,7 @@ export default class TPMsettings extends Component { <span className="color-grey-6 mt5 fl" style={{minWidth: '95px'}}>VNC图形化评测:</span> <span className="fl mt5 ml5"> <Checkbox checked={vnc_evaluate === undefined ? false : vnc_evaluate} onChange={this.shixun_vnc_evaluate}></Checkbox> - <label style={{top:'6px'}} className="color-grey-9 ml10" >勾选则在VNC图形化实训中,给学员开启评测</label> + <label style={{top:'6px'}} className="color-grey-9 ml10" >勾选则在学员的VNC图形化页面中,开启评测功能</label> </span> </div>:""} diff --git a/public/react/src/modules/tpm/component/TPMNav.js b/public/react/src/modules/tpm/component/TPMNav.js index 1683c59a0..ce74be13b 100644 --- a/public/react/src/modules/tpm/component/TPMNav.js +++ b/public/react/src/modules/tpm/component/TPMNav.js @@ -5,7 +5,7 @@ import { BrowserRouter as Router, Route, Link } from "react-router-dom"; class TPMNav extends Component { render() { - const { user, match, shixun } = this.props; + const { user, match, shixun, secret_repository } = this.props; let isAdminOrCreator = false; if (user) { isAdminOrCreator = user.admin || user.manager @@ -30,7 +30,10 @@ class TPMNav extends Component { <Link to={`/shixuns/${shixunId}/repository`} style={{display: this.props.identity >4||this.props.identity===undefined ? "none" : 'block'}} - className={`${match.url.indexOf('repository') != -1 ? 'active' : ''} fl mr40`}>版本库</Link> + className={`${match.url.indexOf('/repository') != -1 ? 'active' : ''} fl mr40`}>版本库</Link> + {secret_repository && <Link to={`/shixuns/${shixunId}/secret_repository`} + style={{display: this.props.identity >4||this.props.identity===undefined ? "none" : 'block'}} + className={`${match.url.indexOf('secret_repository') != -1 ? 'active' : ''} fl mr40`}>私密版本库</Link>} <Link to={`/shixuns/${shixunId}/collaborators`} className={`${match.url.indexOf('collaborators') != -1 ? 'active' : ''} fl mr40`}>合作者</Link> diff --git a/public/react/src/modules/tpm/component/modal/RepositoryChooseModal.js b/public/react/src/modules/tpm/component/modal/RepositoryChooseModal.js new file mode 100644 index 000000000..0f1043ef9 --- /dev/null +++ b/public/react/src/modules/tpm/component/modal/RepositoryChooseModal.js @@ -0,0 +1,148 @@ +import React, { useState, useEffect, memo } from 'react'; +import axios from 'axios' +import { Modal, Input } from 'antd'; + +function RepositoryChooseModal(props) { + const [trees, setTrees] = useState([]) + const [path, setPath] = useState('') + const [pathArray, setPathArray] = useState([{val: "根目录/", path: ""}]) + const [modalVisible, setModalVisible] = useState(true) + + useEffect(() => { + repository('') + }, []) + function onOk() { + + } + function onCancel() { + + } + /** + 点nav 会传入key + 点item 会传入 newPath + + item => name, type type tree/leaf + */ + const repository=(item, key, newPath)=>{ + let newPathArray = [] // + // + if (key) { + for(var i=0; i<=key; i++){ + newPathArray.push(pathArray[i]) + } + } else if (item) { + newPathArray = pathArray.slice(0) + newPathArray.push({val: item.name, path: pathArray[pathArray.length - 1] + "/" + item.name}) + } + + const path = item || key ? newPathArray[newPathArray.length - 1] : '' + + let id = this.props.match.params.shixunId; + let url ="/shixuns/"+id+"/repository.json"; + axios.post(url,{ + path: path + }).then((response) => { + if (response.data.status === 403||response.data.status === 401||response.data.status === 500) { + + }else{ + setTrees(response.data.trees) + setPath(path) + pathArray(newPathArray) + } + + }).catch((error) => { + console.log(error) + }); + } + const savegetfilepath=(value)=>{ + let {selectpath,saveshixunfilepath,pathtype} = this.state + + if(pathtype===1){ + let newselectpath; + + if(saveshixunfilepath==="shixunfilepathplay"){ + newselectpath=value + }else{ + const type = selectpath.split(';'); + let types=false; + for(var i=0; i<type.length; i++){ + if(type[i]===value){ + types=true + return + } + } + + if(types===false){ + newselectpath=selectpath+value+ ";" + }else{ + newselectpath=selectpath + } + } + this.setState({ + // selectpatharr:newarr, + selectpath: newselectpath, + + }) + } + const goblakepath=(path,key)=>{ + + } + } + return ( + <Modal + keyboard={false} + title="文件路径" + visible={modalVisible} + closable={false} + footer={false} + > + <div className="task_popup_con"> + <div className="newupload_conbox clearfix"> + <ul id="directory_file"> + {/*文件导航*/} + { + pathArray.length===0?"":pathArray.map((item,key)=>{ + return( + <a className="f14 fb" onClick={()=>goblakepath(item.path,key,item)}>{item.val}</a> + ) + }) + } + {/*文件*/} + {trees === undefined || trees === null ? "" : trees.map((item, key) => { + 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> + {path+item.name}</a>:<a data-remote="true"> + <i className="iconfont icon-zuoye color-blue mr2"></i> + <span onClick={()=>savegetfilepath(path+item.name,item.type)}>{path+item.name}</span> + </a> + } + </div> + </li> + + ) + })} + + </ul> + <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)} + value={path}/> + </div> + + <a className="task-btn task-btn-orange fr" + 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> + </Modal> + ) + +} + +export default RepositoryChooseModal \ No newline at end of file diff --git a/public/react/src/modules/tpm/shixunchild/Repository/Repository.js b/public/react/src/modules/tpm/shixunchild/Repository/Repository.js index a62151126..9075375da 100644 --- a/public/react/src/modules/tpm/shixunchild/Repository/Repository.js +++ b/public/react/src/modules/tpm/shixunchild/Repository/Repository.js @@ -15,7 +15,7 @@ import { trace, trace_collapse ,getImageUrl, toPath} from "educoder"; import RepositoryDirectories from './RepositoryDirectories' import { ActionBtn , NoneData } from 'educoder' - +import RepositoryCombinePath from './RepositoryCombinePath' const $ = window.$; // 点击按钮复制功能 @@ -85,10 +85,13 @@ class Repository extends Component { className=" guideBtn" >Git使用指南</a> { this.props.current_user && (this.props.current_user.admin ==true || (TPMRightSectionData && TPMRightSectionData.creator && TPMRightSectionData.creator.login == this.props.current_user.login)) ? - <ActionBtn style="orangeLine" className="ml20" to={`/shixuns/${match.params.shixunId}/repository/add_file`}>+添加文件</ActionBtn>:"" + !this.props.secret_repository && + <ActionBtn style="orangeLine" className="ml20" to={`/shixuns/${match.params.shixunId}/repository/add_file`}>+添加文件</ActionBtn> + :"" } + <div className="fr font-12 color-grey-9 pr"> <label className="fl mt2">网址克隆:</label> <input type="text" id="copy_rep_content" className="fl url-input mt2" @@ -155,6 +158,10 @@ class Repository extends Component { </div> </div> + {this.props.secret_repository && <RepositoryCombinePath {...this.props}> + + </RepositoryCombinePath>} + </div> </div> diff --git a/public/react/src/modules/tpm/shixunchild/Repository/RepositoryCodeEditor.js b/public/react/src/modules/tpm/shixunchild/Repository/RepositoryCodeEditor.js index bd7c8355b..3b05bcb50 100644 --- a/public/react/src/modules/tpm/shixunchild/Repository/RepositoryCodeEditor.js +++ b/public/react/src/modules/tpm/shixunchild/Repository/RepositoryCodeEditor.js @@ -121,6 +121,7 @@ class RepositoryCodeEditor extends Component { const path = pathArray.join('/') this.setState({ codeSaving: true }) axios.post(url, { + secret_repository: this.props.secret_repository, content: this.extend_editor.getValue(), // type: forTest === true ? 1 : 0, path: path diff --git a/public/react/src/modules/tpm/shixunchild/Repository/RepositoryCombinePath.js b/public/react/src/modules/tpm/shixunchild/Repository/RepositoryCombinePath.js new file mode 100644 index 000000000..aba008e20 --- /dev/null +++ b/public/react/src/modules/tpm/shixunchild/Repository/RepositoryCombinePath.js @@ -0,0 +1,82 @@ +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_collapse, WordsBtn } from 'educoder' + +import { message, Input } from 'antd'; + + +const $ = window.$; + + +class RepositoryCombinePath extends Component { + constructor(props) { + super(props) + this.state = { + value: this.props.secret_dir_path || '', + isEdit: false, + } + } + + onSave = () => { + const { shixunId, pathArray } = this.props; + const url = `/shixuns/${shixunId}/set_secret_dir.json` + + this.setState({ codeSaving: true }) + axios.post(url, { + secret_dir_path: this.state.value + } + ).then((response) => { + if (response.data) { + message.success('保存成功'); + this.setState({isEdit: false}) + } + }) + } + onChange = (e) => { + const { value } = e.target; + this.setState({ value }) + } + onEdit = () => { + this.setState({isEdit: true}, () => { + window.$('.combinePathEditRow input')[0].focus() + }); + } + render() { + const { fileContent, match, saveCode } = this.props; + const { isEdit, value } = this.state; + return ( + + <div className="df combinePathEditRow"> + <style>{` + .combinePathEditRow { + margin: 4px 0; + } + .combinePathEditRow input { + flex: 0 0 300px; + border: none; + } + .combinePathEditRow .wordsBtn { + margin-left: 24px; + } + `}</style> + <span>第一版本库合并路径:</span> + <Input disabled={!isEdit} value={value} onChange={this.onChange}></Input> + {!isEdit && <WordsBtn className="wordsBtn" onClick={this.onEdit} style="blue">修改</WordsBtn>} + {isEdit && <WordsBtn className="wordsBtn" onClick={this.onSave} style="blue">保存</WordsBtn>} + </div> + + + ); + } +} +export default RepositoryCombinePath; From 29e31216c7f1e7dac3e81b163fcd0801714826ce Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Mon, 9 Sep 2019 18:55:27 +0800 Subject: [PATCH 30/73] secret_repository_tab --- public/react/src/modules/tpm/TPMIndex.js | 2 +- public/react/src/modules/tpm/TPMRepositoryComponent.js | 2 +- .../src/modules/tpm/shixunchild/Repository/Repository.js | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/public/react/src/modules/tpm/TPMIndex.js b/public/react/src/modules/tpm/TPMIndex.js index 2b77181e8..2cbcd8cb4 100644 --- a/public/react/src/modules/tpm/TPMIndex.js +++ b/public/react/src/modules/tpm/TPMIndex.js @@ -303,7 +303,7 @@ class TPMIndex extends Component { />) }></Route> <Route path="/shixuns/:shixunId/secret_repository" render={ - (props) => (<TPMRepositoryComponent {...this.props} {...this.state} {...props} secret_repository={true} + (props) => (<TPMRepositoryComponent {...this.props} {...this.state} {...props} secret_repository_tab={true} />) }></Route> diff --git a/public/react/src/modules/tpm/TPMRepositoryComponent.js b/public/react/src/modules/tpm/TPMRepositoryComponent.js index 70e208126..629209b70 100644 --- a/public/react/src/modules/tpm/TPMRepositoryComponent.js +++ b/public/react/src/modules/tpm/TPMRepositoryComponent.js @@ -31,7 +31,7 @@ class TPMRepositoryComponent extends Component { } } componentDidUpdate(prevProps, prevState) { - if (this.props.secret_repository != prevProps.secret_repository) { + if (this.props.secret_repository_tab != prevProps.secret_repository_tab) { this.fetchRepo() } } diff --git a/public/react/src/modules/tpm/shixunchild/Repository/Repository.js b/public/react/src/modules/tpm/shixunchild/Repository/Repository.js index 9075375da..e80b06b21 100644 --- a/public/react/src/modules/tpm/shixunchild/Repository/Repository.js +++ b/public/react/src/modules/tpm/shixunchild/Repository/Repository.js @@ -85,7 +85,7 @@ class Repository extends Component { className=" guideBtn" >Git使用指南</a> { this.props.current_user && (this.props.current_user.admin ==true || (TPMRightSectionData && TPMRightSectionData.creator && TPMRightSectionData.creator.login == this.props.current_user.login)) ? - !this.props.secret_repository && + !this.props.secret_repository_tab && <ActionBtn style="orangeLine" className="ml20" to={`/shixuns/${match.params.shixunId}/repository/add_file`}>+添加文件</ActionBtn> :"" } @@ -158,7 +158,7 @@ class Repository extends Component { </div> </div> - {this.props.secret_repository && <RepositoryCombinePath {...this.props}> + {this.props.secret_repository_tab && <RepositoryCombinePath {...this.props}> </RepositoryCombinePath>} From c9582775ed6bb48ebbb211d5ad8a0c7813b27133 Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Mon, 9 Sep 2019 18:56:32 +0800 Subject: [PATCH 31/73] secret_repository_tab --- public/react/src/modules/tpm/TPMRepositoryComponent.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/react/src/modules/tpm/TPMRepositoryComponent.js b/public/react/src/modules/tpm/TPMRepositoryComponent.js index 629209b70..97e5f1e85 100644 --- a/public/react/src/modules/tpm/TPMRepositoryComponent.js +++ b/public/react/src/modules/tpm/TPMRepositoryComponent.js @@ -145,7 +145,7 @@ class TPMRepositoryComponent extends Component { const path = urlNewPathArray.join('/') let id = this.props.match.params.shixunId; - let url = `/shixuns/${id}/${this.props.secret_repository ? 'secret_repository' : 'repository'}.json`; + let url = `/shixuns/${id}/${this.props.secret_repository_tab ? 'secret_repository' : 'repository'}.json`; // this.props.setLoadingContent(true) axios.post(url, { path: path ? path : '' From 1e888ae3595a645e789034c68ed4a396e0b1b601 Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Mon, 9 Sep 2019 19:01:07 +0800 Subject: [PATCH 32/73] secret_repository_tab --- public/react/src/modules/tpm/TPMRepositoryComponent.js | 2 +- .../tpm/shixunchild/Repository/RepositoryCodeEditor.js | 2 +- .../tpm/shixunchild/Repository/TPMRepositoryCommits.js | 4 +++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/public/react/src/modules/tpm/TPMRepositoryComponent.js b/public/react/src/modules/tpm/TPMRepositoryComponent.js index 97e5f1e85..f4c90b3b4 100644 --- a/public/react/src/modules/tpm/TPMRepositoryComponent.js +++ b/public/react/src/modules/tpm/TPMRepositoryComponent.js @@ -79,7 +79,7 @@ class TPMRepositoryComponent extends Component { let url = `/shixuns/${id}/file_content.json`; axios.post(url, { path: path, - secret_repository: this.props.secret_repository + secret_repository: this.props.secret_repository_tab }).then((response) => { trace_collapse('repository res: ', response) diff --git a/public/react/src/modules/tpm/shixunchild/Repository/RepositoryCodeEditor.js b/public/react/src/modules/tpm/shixunchild/Repository/RepositoryCodeEditor.js index 3b05bcb50..51f6e35f2 100644 --- a/public/react/src/modules/tpm/shixunchild/Repository/RepositoryCodeEditor.js +++ b/public/react/src/modules/tpm/shixunchild/Repository/RepositoryCodeEditor.js @@ -121,7 +121,7 @@ class RepositoryCodeEditor extends Component { const path = pathArray.join('/') this.setState({ codeSaving: true }) axios.post(url, { - secret_repository: this.props.secret_repository, + secret_repository: this.props.secret_repository_tab, content: this.extend_editor.getValue(), // type: forTest === true ? 1 : 0, path: path diff --git a/public/react/src/modules/tpm/shixunchild/Repository/TPMRepositoryCommits.js b/public/react/src/modules/tpm/shixunchild/Repository/TPMRepositoryCommits.js index d0499a76c..663c5fcf3 100644 --- a/public/react/src/modules/tpm/shixunchild/Repository/TPMRepositoryCommits.js +++ b/public/react/src/modules/tpm/shixunchild/Repository/TPMRepositoryCommits.js @@ -34,7 +34,9 @@ class TPMRepositoryCommits extends Component { let id = this.props.match.params.shixunId; let collaborators=`/shixuns/`+id+`/commits.json`; - axios.post(collaborators).then((response)=> { + axios.post(collaborators, { + secret_repository: this.props.secret_repository_tab + }).then((response)=> { if(response.status===200){ this.setState({ From be407764951fca7924eff3711d1342f17d8eff86 Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Mon, 9 Sep 2019 19:01:47 +0800 Subject: [PATCH 33/73] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/student_works_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/student_works_controller.rb b/app/controllers/student_works_controller.rb index 63dd509fe..39401d079 100644 --- a/app/controllers/student_works_controller.rb +++ b/app/controllers/student_works_controller.rb @@ -494,7 +494,7 @@ class StudentWorksController < ApplicationController # 删除实训作品评阅 def destroy_work_comment ActiveRecord::Base.transaction do - tip_exception("visible_comment参数有误") if params[:visible_comment].blank? + tip_exception("visible_comment参数有误") if params[:visible_comment].nil? comment = @work.shixun_work_comments.find_by!(id: params[:comment_id]) params[:visible_comment] ? comment.comment = nil : comment.hidden_comment = nil From 56da2248633346a300e22e8189bb4770a489ee43 Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Mon, 9 Sep 2019 19:12:43 +0800 Subject: [PATCH 34/73] secret_repository_tab={true} --- public/react/src/modules/tpm/TPMIndex.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/public/react/src/modules/tpm/TPMIndex.js b/public/react/src/modules/tpm/TPMIndex.js index 2cbcd8cb4..67779af8d 100644 --- a/public/react/src/modules/tpm/TPMIndex.js +++ b/public/react/src/modules/tpm/TPMIndex.js @@ -287,6 +287,10 @@ class TPMIndex extends Component { (props) => (<TPMRepositoryCommits {...this.props} {...this.state} {...props} />) }></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={ (props) => (<TPMChallengeComponent {...this.props} {...this.state} {...props} From c11d30a4f455734fc3dc1f569babcb5d3fdff46f Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Mon, 9 Sep 2019 19:15:23 +0800 Subject: [PATCH 35/73] sendgetfilepath --- .../src/modules/tpm/component/modal/RepositoryChooseModal.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/public/react/src/modules/tpm/component/modal/RepositoryChooseModal.js b/public/react/src/modules/tpm/component/modal/RepositoryChooseModal.js index 0f1043ef9..e37cc3cf0 100644 --- a/public/react/src/modules/tpm/component/modal/RepositoryChooseModal.js +++ b/public/react/src/modules/tpm/component/modal/RepositoryChooseModal.js @@ -87,6 +87,9 @@ function RepositoryChooseModal(props) { const goblakepath=(path,key)=>{ } + } + function sendgetfilepath() { + } return ( <Modal @@ -103,7 +106,7 @@ function RepositoryChooseModal(props) { { pathArray.length===0?"":pathArray.map((item,key)=>{ return( - <a className="f14 fb" onClick={()=>goblakepath(item.path,key,item)}>{item.val}</a> + // <a className="f14 fb" onClick={()=>goblakepath(item.path,key,item)}>{item.val}</a> ) }) } From ebd05488d1ce5ef034911242058abfd4d0acf422 Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Mon, 9 Sep 2019 19:17:22 +0800 Subject: [PATCH 36/73] goblakepath --- .../component/modal/RepositoryChooseModal.js | 24 ++++++++++--------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/public/react/src/modules/tpm/component/modal/RepositoryChooseModal.js b/public/react/src/modules/tpm/component/modal/RepositoryChooseModal.js index e37cc3cf0..58839f334 100644 --- a/public/react/src/modules/tpm/component/modal/RepositoryChooseModal.js +++ b/public/react/src/modules/tpm/component/modal/RepositoryChooseModal.js @@ -37,7 +37,7 @@ function RepositoryChooseModal(props) { 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"; axios.post(url,{ path: path @@ -55,7 +55,8 @@ function RepositoryChooseModal(props) { }); } const savegetfilepath=(value)=>{ - let {selectpath,saveshixunfilepath,pathtype} = this.state + const state = {} + let {selectpath,saveshixunfilepath,pathtype} = state if(pathtype===1){ let newselectpath; @@ -78,18 +79,19 @@ function RepositoryChooseModal(props) { newselectpath=selectpath } } - this.setState({ - // selectpatharr:newarr, - selectpath: newselectpath, + // this.setState({ + // // selectpatharr:newarr, + // selectpath: newselectpath, - }) + // }) } - const goblakepath=(path,key)=>{ + + } + const goblakepath=(path,key)=>{ - } } function sendgetfilepath() { - + } return ( <Modal @@ -106,7 +108,7 @@ function RepositoryChooseModal(props) { { pathArray.length===0?"":pathArray.map((item,key)=>{ return( - // <a className="f14 fb" onClick={()=>goblakepath(item.path,key,item)}>{item.val}</a> + <a className="f14 fb" onClick={()=>goblakepath(item.path,key,item)}>{item.val}</a> ) }) } @@ -133,7 +135,7 @@ function RepositoryChooseModal(props) { <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)} + onInput={(e)=>saveselectpath(e)} value={path}/> </div> From 7529f1c2bcd103779ea3ece670081bd31419b1da Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Mon, 9 Sep 2019 19:23:18 +0800 Subject: [PATCH 37/73] secret_repository --- .../react/src/modules/tpm/shixunchild/Repository/Repository.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/react/src/modules/tpm/shixunchild/Repository/Repository.js b/public/react/src/modules/tpm/shixunchild/Repository/Repository.js index e80b06b21..807eeaaf9 100644 --- a/public/react/src/modules/tpm/shixunchild/Repository/Repository.js +++ b/public/react/src/modules/tpm/shixunchild/Repository/Repository.js @@ -188,7 +188,7 @@ class Repository extends Component { {commits===undefined?"":commits[0].time} </acronym> :{commits===undefined?"":commits[0].title} </span> - <a href={`/shixuns/${match.params.shixunId}/repository/${match.params.shixunId}/commits`} + <a href={`/shixuns/${match.params.shixunId}/${this.secret_repository_tab ? 'secret_repository' : 'repository'}/${match.params.shixunId}/commits`} className="color-grey-6 fr font-16 "> <i className="iconfont icon-tijiaojilu font-18 fl mr5"></i> <span className="fl mt2">提交记录</span> From b3c3c0f148eabf3ca78f625896758bfd6bc83afe Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Mon, 9 Sep 2019 19:23:31 +0800 Subject: [PATCH 38/73] secret_repository --- .../react/src/modules/tpm/shixunchild/Repository/Repository.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/react/src/modules/tpm/shixunchild/Repository/Repository.js b/public/react/src/modules/tpm/shixunchild/Repository/Repository.js index 807eeaaf9..58379b1e8 100644 --- a/public/react/src/modules/tpm/shixunchild/Repository/Repository.js +++ b/public/react/src/modules/tpm/shixunchild/Repository/Repository.js @@ -188,7 +188,7 @@ class Repository extends Component { {commits===undefined?"":commits[0].time} </acronym> :{commits===undefined?"":commits[0].title} </span> - <a href={`/shixuns/${match.params.shixunId}/${this.secret_repository_tab ? 'secret_repository' : '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 "> <i className="iconfont icon-tijiaojilu font-18 fl mr5"></i> <span className="fl mt2">提交记录</span> From c71e1a99648ba274731bc4ec142b6c7ab0b5f4e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Mon, 9 Sep 2019 19:27:53 +0800 Subject: [PATCH 39/73] =?UTF-8?q?=E8=AF=84=E9=98=85=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../courses/coursesPublic/AppraiseModal.js | 36 ++-- .../shixunHomework/ShixunWorkReport.js | 191 +++++++++++------- .../shixunHomework/ShowAppraiseList.js | 172 ++++++++++++++++ .../OfficialAcademicTranscript.js | 2 +- 4 files changed, 315 insertions(+), 86 deletions(-) create mode 100644 public/react/src/modules/courses/shixunHomework/ShowAppraiseList.js diff --git a/public/react/src/modules/courses/coursesPublic/AppraiseModal.js b/public/react/src/modules/courses/coursesPublic/AppraiseModal.js index 1a8c6cc75..9d1efa5b0 100644 --- a/public/react/src/modules/courses/coursesPublic/AppraiseModal.js +++ b/public/react/src/modules/courses/coursesPublic/AppraiseModal.js @@ -10,7 +10,6 @@ class AppraiseModal extends Component{ group_ids:[], fileList:[], Inputsval:undefined, - valuetype:0, textareavaltype:false, comment:undefined, hidden_comment:undefined @@ -18,11 +17,23 @@ class AppraiseModal extends Component{ } componentDidMount() { - - this.setState({ - valuetype:this.props.work_type===undefined?0:this.props.work_type, - textareaval:this.props.work_comment, - }) + let{data,work_comment,work_comment_hidden}=this.props; + + if(this.props.showAppraisetype==="child"){ + 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=()=>{ - let{textareaval,valuetype,comment,hidden_comment}=this.state; + let{comment,hidden_comment}=this.state; let commenttype=comment===undefined||comment===null||comment===""; let hidden_commenttype=hidden_comment===undefined||hidden_comment===null||hidden_comment===""; - if(commenttype===true&&hidden_commenttype===true){ this.setState({ textareavaltype:true @@ -50,20 +60,20 @@ class AppraiseModal extends Component{ return } - //comment 是 text 可见的评阅内容 // hidden_comment 是 text 不可见的评阅内容 // 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` axios.post(url, { - comment:textareaval, - hidden_comment:valuetype + comment:comment, + hidden_comment:hidden_comment, + challenge_id:challenge_id }).then((response) => { if(response.data.status===0){ this.props.showNotification(response.data.message) - this.props.showCancel(textareaval,valuetype) + this.props.showCancel(comment,hidden_comment,challenge_id) }else{ this.props.showNotification(response.data.message) } diff --git a/public/react/src/modules/courses/shixunHomework/ShixunWorkReport.js b/public/react/src/modules/courses/shixunHomework/ShixunWorkReport.js index 31e749867..374aef8d4 100644 --- a/public/react/src/modules/courses/shixunHomework/ShixunWorkReport.js +++ b/public/react/src/modules/courses/shixunHomework/ShixunWorkReport.js @@ -11,6 +11,7 @@ import Coursesshixundetails from './shixunreport/Coursesshixundetails'; import Shixunechart from './shixunreport/Shixunechart'; import DownloadMessageysl from "../../modals/DownloadMessageysl" import AppraiseModal from "../coursesPublic/AppraiseModal"; +import ShowAppraiseList from './ShowAppraiseList'; import {UnControlled as CodeMirror} from 'react-codemirror2'; import 'codemirror/mode/cmake/cmake'; import 'codemirror/mode/xml/xml'; @@ -34,9 +35,8 @@ class ShixunWorkReport extends Component { DownloadMessageval:undefined, isspinning:false, showAppraiseModaltype:false, - work_comment_hidden:false, - showAppraiseModalsshow:true, - work_comment:null + work_comment_hidden:undefined, + work_comment:undefined, } } @@ -102,7 +102,7 @@ class ShixunWorkReport extends Component { let homeworkid=this.props.match.params.homeworkid; let url = `/student_works/${homeworkid}/shixun_work_report.json` 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{ this.setState({ @@ -155,76 +155,138 @@ class ShixunWorkReport extends Component { }) } - showAppraiseModal=(type,id)=>{ + showAppraiseModal=(type,id,show,hidden)=>{ + let{data}=this.state; + debugger 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({ + showAppraiseModaltype:true, showAppraisetype:type, - challenge_id:id + challenge_id:id, + data:data }) }else{ this.setState({ + showAppraiseModaltype:true, 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=()=>{ - let{work_comment,work_comment_hidden}=this.state; this.setState({ 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)=>{ + + let{data,showAppraisetype}=this.state; + + debugger + if(showAppraisetype==="child"){ + data.stage_list.forEach((item,key)=>{ + if(item.challenge_id===id){ + item.challenge_comment=show; + item.challenge_comment_hidden=hidden; + } + }) + this.setState({ + showAppraiseModaltype:false, + data:data + }) + }else{ + this.setState({ + showAppraiseModaltype:false, + work_comment:show, + work_comment_hidden:hidden + }) + } - 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)=>{ this.setState({ modalsType: true, modalsTopval:"是否确认删除?", - modalSave: ()=>this.isdeleteModals(), - modalCancel:()=>this.hideisdeleteModal(), + modalSave: ()=>this.isdeleteModals(comment_id,visible_comment), + modalCancel:()=>this.hideisdeleteModals(), }) } - hideisdeleteModal=()=>{ + hideisdeleteModals=()=>{ this.setState({ - modalsType: false, + modalsType:false, modalsTopval:"是否确认删除?", - modalSave: ()=>this.isdeleteModals(), - modalCancel:()=>this.hideisdeleteModal(), + modalSave: "", + modalCancel:"", }) } - isdeleteModals=()=>{ + + hideisdeleteModal=(comment_id,visible_comment)=>{ + + + let{data,work_comment,work_comment_hidden,showAppraisetype}=this.state; + if(showAppraisetype==="child"){ + data.stage_list.forEach((item,key)=>{ + if(item.comment_id===comment_id){ + if(visible_comment===true){ + item.challenge_comment=null; + }else{ + item.challenge_comment_hidden=null; + } + } + }) + this.setState({ + modalsType:false, + modalsTopval:"是否确认删除?", + modalSave: "", + modalCancel:"", + data:data + }) + }else{ + if(visible_comment===true){ + this.setState({ + modalsType:false, + modalsTopval:"是否确认删除?", + modalSave: "", + modalCancel:"", + work_comment:visible_comment===true?null:work_comment, + }) + }else{ + this.setState({ + modalsType:false, + modalsTopval:"是否确认删除?", + modalSave: "", + modalCancel:"", + work_comment_hidden:visible_comment===false?null:work_comment_hidden + }) + } + + } + + } + + isdeleteModals=(comment_id,visible_comment)=>{ let url =`/student_works/${this.props.match.params.homeworkid}/destroy_work_comment.json` - axios.delete(url).then((response) => { + axios.delete(url, { data: { + comment_id:comment_id, + visible_comment:visible_comment + }}).then((response) => { // const { status } = response.data; if(response.data.status===0){ this.props.showNotification(response.data.message) - this.setState({ - showAppraiseModalsshow:false, - work_comment_hidden:false, - work_comment:undefined, - work_type:0, - }) - this.hideisdeleteModal() + + this.hideisdeleteModal(comment_id,visible_comment) }else{ this.props.showNotification(response.data.message) } @@ -234,7 +296,7 @@ class ShixunWorkReport extends Component { }); } 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 homework_common_id=data===undefined?"":data.homework_common_id; @@ -243,7 +305,9 @@ 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=work_comment===null||work_comment===undefined?false:true; - console.log(showAppraiseModals) + console.log(data) + console.log(work_comment_hidden) + console.log(work_comment) return ( data===undefined?"":<Spin indicator={antIcon} spinning={this.state.spinning}> @@ -262,10 +326,12 @@ class ShixunWorkReport extends Component { {...this.state} visible={showAppraiseModaltype} Cancel={()=>this.hideAppraiseModal()} - showCancel={(list,type)=>this.showAppraiseModals(list,type)} + showCancel={(show,hidden,id)=>this.showAppraiseModals(show,hidden,id)} work_comment={this.state.work_comment} work_type={work_comment===null||work_comment===undefined?this.state.work_type:work_comment_hidden===true?1:0} />:""} + + <div className="newMain clearfix "> <div className={"educontent mb20" }> <div className="educontent"> @@ -303,9 +369,11 @@ class ShixunWorkReport extends Component { {/*>评阅</a> : ""}*/} {this.props.isAdmin() ?<a className=" color-blue font-14 fr ml20 mt15" - onClick={()=>this.showAppraiseModal("main")} + onClick={()=>this.showAppraiseModal("main",undefined,work_comment,work_comment_hidden)} >评阅</a>:""} </div> + + {/*{work_comment===null||work_comment===undefined?"评阅":"编辑评阅"}*/} <style>{ ` @@ -425,7 +493,7 @@ class ShixunWorkReport extends Component { jumptopic={this.jumptopic} getdatalist={()=>this.getdatalist()} 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> @@ -477,33 +545,12 @@ class ShixunWorkReport extends Component { </div> - {showAppraiseModals===true&&showAppraiseModalsshow===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>{work_comment_hidden===true||this.state.work_type===1?"(仅对课堂老师可见)":""}</span> - - {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>:""} + <ShowAppraiseList + {...this.props} + {...this.state} + isdeleteModal={(comment_id,visible_comment)=>this.isdeleteModal(comment_id,visible_comment)} + showAppraiseModal={(type,id,show,hidden)=>this.showAppraiseModal(type,id,show,hidden)} + /> <div className="stud-class-set bor-bottom-greyE mt17"> diff --git a/public/react/src/modules/courses/shixunHomework/ShowAppraiseList.js b/public/react/src/modules/courses/shixunHomework/ShowAppraiseList.js new file mode 100644 index 000000000..66ac56a63 --- /dev/null +++ b/public/react/src/modules/courses/shixunHomework/ShowAppraiseList.js @@ -0,0 +1,172 @@ +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'; + +class ShowAppraiseList extends Component{ + constructor(props){ + super(props); + this.state={ + + } + } + + componentDidMount() { + + + } + + + + render(){ + let {data,work_comment,work_comment_hidden}=this.props; + console.log(data) + 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; + } + ` + } + </style> + {data===undefined?"":work_comment===undefined||work_comment===null||work_comment===""?"": + <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.isAdminOrTeacher()===true?<a className="color-blue font-14 fr ml20" + onClick={()=>this.props.isdeleteModal(data.comment_id,true)} + >删除</a>:""} + + {this.props&&this.props.isAdminOrTeacher()===true?<a className="color-blue font-14 fr" + onClick={()=>this.props.showAppraiseModal("main",undefined,work_comment,work_comment_hidden)} + >编辑</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>} + + + + {data===undefined?"":work_comment_hidden===undefined||work_comment_hidden===null||work_comment_hidden===""?"":this.props&&this.props.isAdminOrTeacher()===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>评阅内容<span>(仅对课堂老师可见)</span> + + {this.props&&this.props.isAdminOrTeacher()===true?<a className="color-blue font-14 fr ml20" + onClick={()=>this.props.isdeleteModal(data.comment_id,false)} + >删除</a>:""} + + {this.props&&this.props.isAdminOrTeacher()===true?<a className="color-blue font-14 fr" + onClick={()=>this.props.showAppraiseModal("main",undefined,work_comment,work_comment_hidden)} + >编辑</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_hidden).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> + {challenge_comment===false?<div className="stud-class-set mt17" key={key}> + <div className="clearfix edu-back-white poll_list"> + + <div className="font-16 color-dark-21 shixunreporttitleboxtop pd20 color333"> + <span className={"appraisebox"}>第{key+1}关</span>评阅内容 + {this.props&&this.props.isAdminOrTeacher()===true?<a className="color-blue font-14 fr ml20" + onClick={()=>this.props.isdeleteModal(item.comment_id,true)} + >删除</a>:""} + + {this.props&&this.props.isAdminOrTeacher()===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> + <div className="font-16 color-dark-21 shixunreporttitleboxbom pd30"> + <div style={{minHeight:'50px'}}> + <div className={"personalsummary"}> + <div className={"markdown-body"} + dangerouslySetInnerHTML={{__html: markdownToHTML(item.challenge_comment).replace(/▁/g, "▁▁▁")}}></div> + </div> + </div> + </div> + + </div> + </div>:""} + + + {challenge_comment_hidden===false&&this.props&&this.props.isAdminOrTeacher()===true?<div className="stud-class-set mt17" key={key}> + <div className="clearfix edu-back-white poll_list"> + <div className="font-16 color-dark-21 shixunreporttitleboxtop pd20 color333"> + <span className={"appraisebox"}>第{key+1}关</span>评阅内容<span>(仅对课堂老师可见)</span> + + {this.props&&this.props.isAdminOrTeacher()===true?<a className="color-blue font-14 fr ml20" + onClick={()=>this.props.isdeleteModal(item.comment_id,false)} + >删除</a>:""} + + {this.props&&this.props.isAdminOrTeacher()===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> + <div className="font-16 color-dark-21 shixunreporttitleboxbom pd30"> + <div style={{minHeight:'50px'}}> + <div className={"personalsummary"}> + <div className={"markdown-body"} + dangerouslySetInnerHTML={{__html: markdownToHTML(item.challenge_comment_hidden).replace(/▁/g, "▁▁▁")}}></div> + </div> + </div> + </div> + + </div> + </div>:""} + + </div>) + }) + } + + + </div> + ) + } +} +export default ShowAppraiseList; + diff --git a/public/react/src/modules/courses/shixunHomework/shixunreport/OfficialAcademicTranscript.js b/public/react/src/modules/courses/shixunHomework/shixunreport/OfficialAcademicTranscript.js index fe88ef87d..0cb75dee3 100644 --- a/public/react/src/modules/courses/shixunHomework/shixunreport/OfficialAcademicTranscript.js +++ b/public/react/src/modules/courses/shixunHomework/shixunreport/OfficialAcademicTranscript.js @@ -207,7 +207,7 @@ class OfficialAcademicTranscript extends Component { render: (text, record) => ( <span> - {console.log(record)} + <a className=" color-blue font-14 fr mr22" onClick={()=>this.props.showAppraiseModal("child",record.challenge_id.id,record.challenge_comment,record.challenge_comment_hidden)} From 971276504b2c559b55b614aac7acfccda92f1afc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Mon, 9 Sep 2019 19:29:19 +0800 Subject: [PATCH 40/73] bd --- .../paths/PathDetail/PathDetailIndex.js | 832 +++++++++--------- .../modules/tpm/component/TPMRightSection.js | 368 ++++---- 2 files changed, 600 insertions(+), 600 deletions(-) diff --git a/public/react/src/modules/paths/PathDetail/PathDetailIndex.js b/public/react/src/modules/paths/PathDetail/PathDetailIndex.js index f432c18b2..bd7b02e7d 100644 --- a/public/react/src/modules/paths/PathDetail/PathDetailIndex.js +++ b/public/react/src/modules/paths/PathDetail/PathDetailIndex.js @@ -14,24 +14,24 @@ import TPMRightSection from "../../tpm/component/TPMRightSection"; import styled from "styled-components"; const getItemStyle = (isDragging, draggableStyle) => ({ - // change background colour if dragging - background: isDragging ? '#dceeff' : '', - // styles we need to apply on draggables - ...draggableStyle, + // change background colour if dragging + background: isDragging ? '#dceeff' : '', + // styles we need to apply on draggables + ...draggableStyle, }); const getItems = count => - Array.from({ length: count }, (v, k) => k).map(k => ({ - id: `item-${k}`, - content: `item ${k}` - })); + Array.from({ length: count }, (v, k) => k).map(k => ({ + id: `item-${k}`, + content: `item ${k}` + })); // a little function to help us with reordering the result const reorder = (list, startIndex, endIndex) => { - const result = Array.from(list); - const [removed] = result.splice(startIndex, 1); - result.splice(endIndex, 0, removed); + const result = Array.from(list); + const [removed] = result.splice(startIndex, 1); + result.splice(endIndex, 0, removed); - return result; + return result; }; const List = styled.div` @@ -66,90 +66,90 @@ const DragHandle = styled.div` `; const $ =window.$ class PathDetailIndex extends Component{ - constructor(props){ - super(props) - this.state={ + constructor(props){ + super(props) + this.state={ progress:undefined, tags:undefined, members:undefined, - detailInfoList:undefined, - clickdetailInfoListtype:false, - Modalstype:false, - Modalstopval:undefined, - Modalsbottomval:undefined, - cardsModalcancel:this.cardsModalcancel, - cardsModalsave:this.cardsModalsave, - user_id:undefined, - loadtype:false, + detailInfoList:undefined, + clickdetailInfoListtype:false, + Modalstype:false, + Modalstopval:undefined, + Modalsbottomval:undefined, + cardsModalcancel:this.cardsModalcancel, + cardsModalsave:this.cardsModalsave, + user_id:undefined, + loadtype:false, courses:undefined, - items: getItems(10), + items: getItems(10), pathtopskey:1 - } - this.onDragEnd = this.onDragEnd.bind(this); + } + this.onDragEnd = this.onDragEnd.bind(this); - } - onDragEnd(result) { - // dropped outside the list - if (!result.destination) { - return; - } + } + onDragEnd(result) { + // dropped outside the list + if (!result.destination) { + return; + } - try { + try { - }catch (e) { + }catch (e) { - } - const items = reorder( - this.state.members, - result.source.index, - result.destination.index - ); + } + const items = reorder( + this.state.members, + result.source.index, + result.destination.index + ); - this.setState({ - detailInfoList:this.state.detailInfoList, + this.setState({ + detailInfoList:this.state.detailInfoList, members:items, - items - }); - console.log(this.state.members) - console.log("items 数组数组数组数组") - console.log(items) - } - cardsModalcancel=()=>{ - this.setState({ - Modalstype:false, - }) - // TODO 这个是临时处理,还需要优化,这里要看怎么区分处理 - if (this.state.Modalstopval == '你确定要删除该成员吗?') { - return; - } + items + }); + console.log(this.state.members) + console.log("items 数组数组数组数组") + console.log(items) + } + cardsModalcancel=()=>{ + this.setState({ + Modalstype:false, + }) + // TODO 这个是临时处理,还需要优化,这里要看怎么区分处理 + if (this.state.Modalstopval == '你确定要删除该成员吗?') { + return; + } this.props.history.goBack() - } + } - cardsModalsave=()=>{ - this.setState({ - Modalstype:false, - }) + cardsModalsave=()=>{ + this.setState({ + Modalstype:false, + }) this.props.history.goBack() - } - // 加载markdown - 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"); - }, 200) - } + } + // 加载markdown + 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"); + }, 200) + } - componentDidMount(){ - this.getdatasindex() - } + componentDidMount(){ + this.getdatasindex() + } - getdatasindex=(key)=>{ + getdatasindex=(key)=>{ let pathid=this.props.match.params.pathId; let url="/paths/"+pathid+".json"; @@ -168,7 +168,7 @@ class PathDetailIndex extends Component{ if(result.data.allow_visit===true){ this.setState({ detailInfoList:result.data, - courses:result.data.courses, + courses:result.data.courses, pathtopskey:key===undefined?1:key, // items: getItems(result.data.members.length), }) @@ -205,157 +205,157 @@ class PathDetailIndex extends Component{ }) } - updatadetailInfoList=()=>{ - this.getdatasindex(); - } - - clickNewsubscript=(val)=>{ - if(val===0){ - this.setState({ - clickdetailInfoListtype:true - }) - }else{ - this.setState({ - clickdetailInfoListtype:false - }) - } + updatadetailInfoList=()=>{ + this.getdatasindex(); + } - } + 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=()=>{ - let{user_id}=this.state; - let pathid=this.props.match.params.pathId; - let url="/paths/"+pathid+"/delete_member.json"; - let param={user_id:user_id}; - axios.delete(url,{data:param}).then((response) => { - if(response.data.status===1){ - 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) - }) - } + shanchuallow=(id)=>{ + this.setState({ + user_id:id, + Modalstype:true, + Modalstopval:"你确定要删除该成员吗?", + cardsModalsave:this.delectshanchuallow, + loadtype:false + }) + } - //上移 - 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, + delectshanchuallow=()=>{ + let{user_id}=this.state; + let pathid=this.props.match.params.pathId; + let url="/paths/"+pathid+"/delete_member.json"; + let param={user_id:user_id}; + axios.delete(url,{data:param}).then((response) => { + if(response.data.status===1){ + 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) + }) + } + + //上移 + 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 - }); - // console.log(this.state.detailInfoList.members); + }); + // console.log(this.state.detailInfoList.members); - } + } - }).catch((error) => { - console.log(error) - }) - } + }).catch((error) => { + console.log(error) + }) + } - //下移 - movedown =(data) => { - // console.log(data); - let pathid=this.props.match.params.pathId; - let url=`/paths/${pathid}/down_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 - }); - // console.log(this.state.detailInfoList.members); - } - - }).catch((error) => { - console.log(error) - }) - } - render(){ - - this.updatamakedown("shixuns_propaedeutics"); - this.updatamakedown("subject_learning_notes"); - let {detailInfoList, - clickdetailInfoListtype, - Modalstype, - Modalstopval, - Modalsbottomval, - cardsModalcancel, - cardsModalsave, - loadtype, + //下移 + movedown =(data) => { + // console.log(data); + let pathid=this.props.match.params.pathId; + let url=`/paths/${pathid}/down_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 + }); + // console.log(this.state.detailInfoList.members); + } + + }).catch((error) => { + console.log(error) + }) + } + render(){ + + this.updatamakedown("shixuns_propaedeutics"); + this.updatamakedown("subject_learning_notes"); + let {detailInfoList, + clickdetailInfoListtype, + Modalstype, + Modalstopval, + Modalsbottomval, + cardsModalcancel, + cardsModalsave, + loadtype, progress, members, tags, courses, - } = this.state + } = this.state - return( - <div className="newContainer"> + return( + <div className="newContainer"> <style> { ` @@ -365,206 +365,206 @@ class PathDetailIndex extends Component{ ` } </style> - <Modals - modalsType={Modalstype} - modalsTopval={Modalstopval} - modalsBottomval={Modalsbottomval} - modalCancel={cardsModalcancel} - modalSave={cardsModalsave} - loadtype={loadtype} - > - </Modals> - <div className="newMain clearfix"> - <DetailTop {...this.state} {...this.props} getdatasindex={(key)=>this.getdatasindex(key)}></DetailTop> - <div className="educontent clearfix mb80"> - <div className="with65 fl"> - <div className="produce-content mb10"> - <p className="clearfix mb20"> - <span className="fl font-18 font-bd">简介</span> - {/*{detailInfoList===undefined?"":detailInfoList.allow_statistics===true?*/} - {/*<Tooltip placement="bottom" title={"编辑"}>*/} - {/*<Link className="fr" to={"/paths/"+this.props.match.params.pathId+"/edit"}>*/} - {/*<i className="iconfont icon-bianjidaibeijing font-20 color-green"></i>*/} - {/*</Link>*/} - {/*</Tooltip>*/} - {/*:""*/} - {/*}*/} - </p> - <div className="color-grey-6 clearfix"> - <div id="shixuns_propaedeutics" className="new_li fl" style={{"padding":" 0px","textAlign": "justify;"}}> - {detailInfoList === undefined ? "" :detailInfoList.description===null?"": - <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> + <Modals + modalsType={Modalstype} + modalsTopval={Modalstopval} + modalsBottomval={Modalsbottomval} + modalCancel={cardsModalcancel} + modalSave={cardsModalsave} + loadtype={loadtype} + > + </Modals> + <div className="newMain clearfix"> + <DetailTop {...this.state} {...this.props} getdatasindex={(key)=>this.getdatasindex(key)}></DetailTop> + <div className="educontent clearfix mb80"> + <div className="with65 fl"> + <div className="produce-content mb10"> + <p className="clearfix mb20"> + <span className="fl font-18 font-bd">简介</span> + {/*{detailInfoList===undefined?"":detailInfoList.allow_statistics===true?*/} + {/*<Tooltip placement="bottom" title={"编辑"}>*/} + {/*<Link className="fr" to={"/paths/"+this.props.match.params.pathId+"/edit"}>*/} + {/*<i className="iconfont icon-bianjidaibeijing font-20 color-green"></i>*/} + {/*</Link>*/} + {/*</Tooltip>*/} + {/*:""*/} + {/*}*/} + </p> + <div className="color-grey-6 clearfix"> + <div id="shixuns_propaedeutics" className="new_li fl" style={{"padding":" 0px","textAlign": "justify;"}}> + {detailInfoList === undefined ? "" :detailInfoList.description===null?"": + <div className={"markdown-body font-14"} dangerouslySetInnerHTML={{__html: markdownToHTML(detailInfoList.description).replace(/▁/g,"▁▁▁")}}></div> } - </div> - </div> - {tags === undefined ? "" :tags === null ? "": - <div className="edu-back-white padding40-20 mb10 relative"> - <p className="font-16 mb20">技能标签 <span className="color-grey-c">{tags.length}</span></p> - - <div className={clickdetailInfoListtype===false?"newedbox newedboxheight":"newedbox newminheight"}> - <div className="clearfix" id="boxheight"> - { - tags && tags.map((item,key)=>{ - return( - <span value={key} className = {item.status == true ? "edu-filter-btn29BD8B fl" : "newedu-filter-btn fl"}>{item.tag_name}</span> - ) - }) - } - </div> - </div> - - <Tooltip placement="bottom" title={"显示全部"}> - <div className={tags.length>20&&clickdetailInfoListtype===false?"newsubscript mb9 color-grey-9 fr":"newsubscript mb9 color-grey-9 none"} - onClick={()=>this.clickNewsubscript(0)} - ><span className="mr8">...</span><Icon type="caret-down" /> - </div> - </Tooltip> - - <Tooltip placement="bottom" title={"收起"}> - <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> - </Tooltip> - - </div> - } - { - this.props.checkIfLogin()===false?"":progress === undefined ? "" : progress === null ? "" : - <div className="edu-back-white myProgress padding40-20 mb10"> - <p className="mb20"> - <span className="font-16 mr10">关卡数</span> - <Tooltip placement="bottom" title="已通过关卡数/总关卡数"> - <span className="color-green" >{progress.my_score} / {progress.all_score}</span> - </Tooltip> - </p> - <p className="clearfix mb10"> - <span className="fl color-green">已学 {progress.learned}%</span> - <span className="fr color-grey-9" id="time-consuming">学习耗时{this.timeStamp(progress.time)} </span> - </p> - <div className="myProgressNav"><div className="myProgressGreen" style={{"width":`${progress.learned+"%"}`}}></div></div> - </div> - } - - { - members ===undefined ?"":members === null ?"": - <div className="teacherTeam edu-back-white clearfix" id="subject_members"> - <p className="font-16 clearfix">教学团队</p> - - { members===undefined? - members && members.map((item,key)=>{ - return( - <div className="teacherTeamItem clearfix df" key={key}> - <a href={item.user_url} target="_blank" className="fl"> - <img alt="头像" className="radius" height="80" src={getImageUrl(`${"images/"+item.image_url}`)} width="80"/> - </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> - ) - }) - :detailInfoList===undefined?"":detailInfoList.allow_add_member===true? - members && members.map((item,key)=>{ - return( - <div className="teacherTeamItem clearfix df" key={key}> - <a href={item.user_url} target="_blank" className="fl"> - <img alt="头像" className="radius" height="80" src={getImageUrl(`${"images/"+item.image_url}`)} width="80"/> - </a> - - <div className="fl ml15 flex1"> - <p className="mb10 mt5">{item.name} - {/* 新增role 判断是否能删除 1 管理员 2 合作者 */} - - { - 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>:"" - } - </p> - <div className="clearfix"> - <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> - {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>:""} - {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> - ) - }) - : members && members.map((item,key)=>{ - return( - <div className="teacherTeamItem clearfix df" key={key}> - <a href={item.user_url} target="_blank" className="fl"> - <img alt="头像" className="radius" height="80" src={getImageUrl(`${"images/"+item.image_url}`)} width="80"/> - </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> - ) - } + </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> + {tags === undefined ? "" :tags === null ? "": + <div className="edu-back-white padding40-20 mb10 relative"> + <p className="font-16 mb20">技能标签 <span className="color-grey-c">{tags.length}</span></p> + + <div className={clickdetailInfoListtype===false?"newedbox newedboxheight":"newedbox newminheight"}> + <div className="clearfix" id="boxheight"> + { + tags && tags.map((item,key)=>{ + return( + <span value={key} className = {item.status == true ? "edu-filter-btn29BD8B fl" : "newedu-filter-btn fl"}>{item.tag_name}</span> + ) + }) + } + </div> + </div> + + <Tooltip placement="bottom" title={"显示全部"}> + <div className={tags.length>20&&clickdetailInfoListtype===false?"newsubscript mb9 color-grey-9 fr":"newsubscript mb9 color-grey-9 none"} + onClick={()=>this.clickNewsubscript(0)} + ><span className="mr8">...</span><Icon type="caret-down" /> + </div> + </Tooltip> + + <Tooltip placement="bottom" title={"收起"}> + <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> + </Tooltip> + + </div> + } + { + this.props.checkIfLogin()===false?"":progress === undefined ? "" : progress === null ? "" : + <div className="edu-back-white myProgress padding40-20 mb10"> + <p className="mb20"> + <span className="font-16 mr10">我的进展</span> + <Tooltip placement="bottom" title="获得经验值/总经验值"> + <span className="color-green" >{progress.my_score} / {progress.all_score}</span> + </Tooltip> + </p> + <p className="clearfix mb10"> + <span className="fl color-green">已学 {progress.learned}%</span> + <span className="fr color-grey-9" id="time-consuming">学习耗时{this.timeStamp(progress.time)} </span> + </p> + <div className="myProgressNav"><div className="myProgressGreen" style={{"width":`${progress.learned+"%"}`}}></div></div> + </div> + } + + { + members ===undefined ?"":members === null ?"": + <div className="teacherTeam edu-back-white clearfix" id="subject_members"> + <p className="font-16 clearfix">教学团队</p> + + { members===undefined? + members && members.map((item,key)=>{ + return( + <div className="teacherTeamItem clearfix df" key={key}> + <a href={item.user_url} target="_blank" className="fl"> + <img alt="头像" className="radius" height="80" src={getImageUrl(`${"images/"+item.image_url}`)} width="80"/> + </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> + ) + }) + :detailInfoList===undefined?"":detailInfoList.allow_add_member===true? + members && members.map((item,key)=>{ + return( + <div className="teacherTeamItem clearfix df" key={key}> + <a href={item.user_url} target="_blank" className="fl"> + <img alt="头像" className="radius" height="80" src={getImageUrl(`${"images/"+item.image_url}`)} width="80"/> + </a> + + <div className="fl ml15 flex1"> + <p className="mb10 mt5">{item.name} + {/* 新增role 判断是否能删除 1 管理员 2 合作者 */} + + { + 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>:"" + } + </p> + <div className="clearfix"> + <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> + {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>:""} + {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> + ) + }) + : members && members.map((item,key)=>{ + return( + <div className="teacherTeamItem clearfix df" key={key}> + <a href={item.user_url} target="_blank" className="fl"> + <img alt="头像" className="radius" height="80" src={getImageUrl(`${"images/"+item.image_url}`)} width="80"/> + </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; \ No newline at end of file diff --git a/public/react/src/modules/tpm/component/TPMRightSection.js b/public/react/src/modules/tpm/component/TPMRightSection.js index f824e7d83..904ef40b8 100644 --- a/public/react/src/modules/tpm/component/TPMRightSection.js +++ b/public/react/src/modules/tpm/component/TPMRightSection.js @@ -13,192 +13,192 @@ import {Icon,Tooltip} from 'antd'; // import "antd/dist/antd.css"; class TPMRightSection extends Component { - constructor(props) { - super(props) - this.state = { - - TPMRightSection:false, - clickNewsubscripttype:false - } - } - - // componentDidMount() { - // let id=this.props.match.params.shixunId; - // - // let shixunsDetailsURL=`/shixuns/`+id+`/show_right.json`; - // - // axios.get(shixunsDetailsURL).then((response)=> { - // if(response.status===200){ - // this.setState({ - // TPMRightSectionData: response.data - // }); - // } - // }).catch((error)=>{ - // console.log(error) - // }); - // } - - // shouldComponentUpdate(nextProps, nextState) { - // return nextProps.TPMRightSectionData !== this.state.TPMRightSectionData - // } - clickNewsubscript=(val)=>{ - if(val===0){ - this.setState({ - TPMRightSection:true, - clickNewsubscripttype:true - }) - }else{ - this.setState({ - TPMRightSection:false, - clickNewsubscripttype:false - }) - } - - } - render() { - let {TPMRightSection,clickNewsubscripttype}=this.state; - let {TPMRightSectionData}=this.props - - return ( - <div> - { - TPMRightSectionData===undefined?"": - <div> - <div className="edu-back-white padding40-20 mb10"> - <p className="font-16 mb20">创建者</p> - <div className="df"> - <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" /> - </a> - <div className="flex1"> - - <p className="mb20">{TPMRightSectionData===undefined?"":TPMRightSectionData.creator===undefined?"":TPMRightSectionData.creator.name}</p> - <div className="clearfix"> - <span>发布 {TPMRightSectionData.user_shixuns_count}</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&object_id=3039&object_type=user&shixun_id=61&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> - { - TPMRightSectionData === undefined ? "" :TPMRightSectionData.tags===undefined?"": TPMRightSectionData.tags.length === 0 ? "" : - <div className="edu-back-white padding40-20 mb10 relative"> - <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="clearfix" id="boxheight"> - { TPMRightSectionData.tags.map((item,key)=>{ - return( - <span className={item.status===false?"newedu-filter-btn fl":"edu-filter-btn29BD8B fl"} - style={{display:item.tag_name===" "||item.tag_name===""?"none":""}} - key={key}>{item.tag_name}</span> - )}) - } - </div> - </div> - - - <div className={TPMRightSectionData.tags.length>15&&clickNewsubscripttype===false?"newsubscript mb9 color-grey-9":"newsubscript mb9 color-grey-9 none"} - - data-tip-down="显示全部" - onClick={()=>this.clickNewsubscript(0)}><span className="mr8">...</span><Icon type="caret-down" /> - </div> - - - <div className={clickNewsubscripttype===false?"newsubscript mb9 color-grey-9 none":"newsubscript mb9 color-grey-9"} - - data-tip-down="显示全部" - onClick={()=>this.clickNewsubscript(1)}><Icon type="caret-up" /> - </div> - - </div> - - - } - - - <div className="padding20 edu-back-white mb10 mt10" style={{ - display: TPMRightSectionData === undefined?"none":TPMRightSectionData.paths===undefined?"":TPMRightSectionData.paths.length === 0 ? "none" : "block" - }}> - <p className="mb20 font-16 clearfix">所属课程</p> - <div className="recommend-list" > - { - TPMRightSectionData===undefined?"":TPMRightSectionData.paths===undefined?"":TPMRightSectionData.paths.map((i,k)=>{ - - return( - - <div className="recomments clearfix df" key={k}> - - <a href={"/paths/"+i.id} height="96" width="128" target="_blank"> - <img alt="实训" height="96" src={"/"+i.image_url} width="128" /> - </a> - - <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> - <p className="clearfix mt8 font-12 color-grey-B4"> - - <Tooltip placement="bottom" title={"章节"}> - <span className="mr10 fl squareIconSpan"><i className="iconfont icon-shixun fl mr3"></i>{i.stages_count}</span> - </Tooltip> - - {/*<Tooltip placement="bottom" title={"经验值"}>*/} - {/*<span className="mr10 fl squareIconSpan"><i className="iconfont icon-jingyan fl mr3"></i>{i.score_count}</span>*/} - {/*</Tooltip>*/} - - <Tooltip placement="bottom" title={"学习人数"}> - <span className="mr10 fl squareIconSpan"><i className="iconfont icon-chengyuan fl mr3"></i>{i.members_count}</span> - </Tooltip> - - </p> - </div> - - </div> - - ) - }) - } - </div> - </div> - - <div className="padding20 edu-back-white" - style={{ - display: - TPMRightSectionData === undefined?"none":TPMRightSectionData.recommands===undefined?"none":TPMRightSectionData.recommands.length === 0 ||TPMRightSectionData.paths===undefined?"":TPMRightSectionData.paths.length === 0 ? "none" : "block" - }} - > - <p className="mb20 font-16 clearfix">推荐实训</p> - <div className="recommend-list"> - { - TPMRightSectionData===undefined?"":TPMRightSectionData.recommands===undefined?"":TPMRightSectionData.recommands.map((item,key)=>{ - return( - <div className="recomments clearfix df" key={key}> - <a href={"/shixuns/"+item.identifier+"/challenges"} target="_blank"> - <img alt="69?1526971094" height="96" src={"/"+item.pic} width="128"/> - </a> - <div className="ml10 flex1"> - <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> - </Tooltip> - <p className="clearfix mt8 font-12 color-grey-B4"> - {item.stu_num} 人学习 - </p> - <p className="edu-txt-right color-orange pr10">{item.level}</p> - </div> - </div> - ) - }) - } - </div> - </div> - - </div> - } - </div> - ) + constructor(props) { + super(props) + this.state = { + + TPMRightSection:false, + clickNewsubscripttype:false + } + } + + // componentDidMount() { + // let id=this.props.match.params.shixunId; + // + // let shixunsDetailsURL=`/shixuns/`+id+`/show_right.json`; + // + // axios.get(shixunsDetailsURL).then((response)=> { + // if(response.status===200){ + // this.setState({ + // TPMRightSectionData: response.data + // }); + // } + // }).catch((error)=>{ + // console.log(error) + // }); + // } + + // shouldComponentUpdate(nextProps, nextState) { + // return nextProps.TPMRightSectionData !== this.state.TPMRightSectionData + // } + clickNewsubscript=(val)=>{ + if(val===0){ + this.setState({ + TPMRightSection:true, + clickNewsubscripttype:true + }) + }else{ + this.setState({ + TPMRightSection:false, + clickNewsubscripttype:false + }) + } + + } + render() { + let {TPMRightSection,clickNewsubscripttype}=this.state; + let {TPMRightSectionData}=this.props + + return ( + <div> + { + TPMRightSectionData===undefined?"": + <div> + <div className="edu-back-white padding40-20 mb10"> + <p className="font-16 mb20">创建者</p> + <div className="df"> + <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" /> + </a> + <div className="flex1"> + + <p className="mb20">{TPMRightSectionData===undefined?"":TPMRightSectionData.creator===undefined?"":TPMRightSectionData.creator.name}</p> + <div className="clearfix"> + <span>发布 {TPMRightSectionData.user_shixuns_count}</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&object_id=3039&object_type=user&shixun_id=61&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> + { + TPMRightSectionData === undefined ? "" :TPMRightSectionData.tags===undefined?"": TPMRightSectionData.tags.length === 0 ? "" : + <div className="edu-back-white padding40-20 mb10 relative"> + <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="clearfix" id="boxheight"> + { TPMRightSectionData.tags.map((item,key)=>{ + return( + <span className={item.status===false?"newedu-filter-btn fl":"edu-filter-btn29BD8B fl"} + style={{display:item.tag_name===" "||item.tag_name===""?"none":""}} + key={key}>{item.tag_name}</span> + )}) + } + </div> + </div> + + + <div className={TPMRightSectionData.tags.length>15&&clickNewsubscripttype===false?"newsubscript mb9 color-grey-9":"newsubscript mb9 color-grey-9 none"} + + data-tip-down="显示全部" + onClick={()=>this.clickNewsubscript(0)}><span className="mr8">...</span><Icon type="caret-down" /> + </div> + + + <div className={clickNewsubscripttype===false?"newsubscript mb9 color-grey-9 none":"newsubscript mb9 color-grey-9"} + + data-tip-down="显示全部" + onClick={()=>this.clickNewsubscript(1)}><Icon type="caret-up" /> + </div> + + </div> + + + } + + + <div className="padding20 edu-back-white mb10 mt10" style={{ + display: TPMRightSectionData === undefined?"none":TPMRightSectionData.paths===undefined?"":TPMRightSectionData.paths.length === 0 ? "none" : "block" + }}> + <p className="mb20 font-16 clearfix">相关实践课程</p> + <div className="recommend-list" > + { + TPMRightSectionData===undefined?"":TPMRightSectionData.paths===undefined?"":TPMRightSectionData.paths.map((i,k)=>{ + + return( + + <div className="recomments clearfix df" key={k}> + + <a href={"/paths/"+i.id} height="96" width="128" target="_blank"> + <img alt="实训" height="96" src={"/"+i.image_url} width="128" /> + </a> + + <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> + <p className="clearfix mt8 font-12 color-grey-B4"> + + <Tooltip placement="bottom" title={"章节"}> + <span className="mr10 fl squareIconSpan"><i className="iconfont icon-shixun fl mr3"></i>{i.stages_count}</span> + </Tooltip> + + {/*<Tooltip placement="bottom" title={"经验值"}>*/} + {/*<span className="mr10 fl squareIconSpan"><i className="iconfont icon-jingyan fl mr3"></i>{i.score_count}</span>*/} + {/*</Tooltip>*/} + + <Tooltip placement="bottom" title={"学习人数"}> + <span className="mr10 fl squareIconSpan"><i className="iconfont icon-chengyuan fl mr3"></i>{i.members_count}</span> + </Tooltip> + + </p> + </div> + + </div> + + ) + }) + } + </div> + </div> + + <div className="padding20 edu-back-white" + style={{ + display: + TPMRightSectionData === undefined?"none":TPMRightSectionData.recommands===undefined?"none":TPMRightSectionData.recommands.length === 0 ? "none" : "block" + }} + > + <p className="mb20 font-16 clearfix">推荐实训</p> + <div className="recommend-list"> + { + TPMRightSectionData===undefined?"":TPMRightSectionData.recommands===undefined?"":TPMRightSectionData.recommands.map((item,key)=>{ + return( + <div className="recomments clearfix df" key={key}> + <a href={"/shixuns/"+item.identifier+"/challenges"} target="_blank"> + <img alt="69?1526971094" height="96" src={"/"+item.pic} width="128"/> + </a> + <div className="ml10 flex1"> + <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> + </Tooltip> + <p className="clearfix mt8 font-12 color-grey-B4"> + {item.stu_num} 人学习 + </p> + <p className="edu-txt-right color-orange pr10">{item.level}</p> + </div> + </div> + ) + }) + } + </div> + </div> + + </div> + } + </div> + ) - } + } } export default TPMRightSection; From 43106e48cf53e7a060665c09d56177405e8dc757 Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Mon, 9 Sep 2019 19:32:52 +0800 Subject: [PATCH 41/73] RepositoryChooseModal --- .../component/modal/RepositoryChooseModal.js | 300 +++++++++--------- 1 file changed, 150 insertions(+), 150 deletions(-) diff --git a/public/react/src/modules/tpm/component/modal/RepositoryChooseModal.js b/public/react/src/modules/tpm/component/modal/RepositoryChooseModal.js index 58839f334..4b72ae2bd 100644 --- a/public/react/src/modules/tpm/component/modal/RepositoryChooseModal.js +++ b/public/react/src/modules/tpm/component/modal/RepositoryChooseModal.js @@ -1,153 +1,153 @@ -import React, { useState, useEffect, memo } from 'react'; -import axios from 'axios' -import { Modal, Input } from 'antd'; - -function RepositoryChooseModal(props) { - const [trees, setTrees] = useState([]) - const [path, setPath] = useState('') - const [pathArray, setPathArray] = useState([{val: "根目录/", path: ""}]) - const [modalVisible, setModalVisible] = useState(true) - - useEffect(() => { - repository('') - }, []) - function onOk() { - - } - function onCancel() { - - } - /** - 点nav 会传入key - 点item 会传入 newPath - - item => name, type type tree/leaf - */ - const repository=(item, key, newPath)=>{ - let newPathArray = [] // - // - if (key) { - for(var i=0; i<=key; i++){ - newPathArray.push(pathArray[i]) - } - } else if (item) { - newPathArray = pathArray.slice(0) - newPathArray.push({val: item.name, path: pathArray[pathArray.length - 1] + "/" + item.name}) - } +// import React, { useState, useEffect, memo } from 'react'; +// import axios from 'axios' +// import { Modal, Input } from 'antd'; + +// function RepositoryChooseModal(props) { +// const [trees, setTrees] = useState([]) +// const [path, setPath] = useState('') +// const [pathArray, setPathArray] = useState([{val: "根目录/", path: ""}]) +// const [modalVisible, setModalVisible] = useState(true) + +// useEffect(() => { +// repository('') +// }, []) +// function onOk() { + +// } +// function onCancel() { + +// } +// /** +// 点nav 会传入key +// 点item 会传入 newPath + +// item => name, type type tree/leaf +// */ +// const repository=(item, key, newPath)=>{ +// let newPathArray = [] // +// // +// if (key) { +// for(var i=0; i<=key; i++){ +// newPathArray.push(pathArray[i]) +// } +// } else if (item) { +// newPathArray = pathArray.slice(0) +// 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 = props.match.params.shixunId; - let url ="/shixuns/"+id+"/repository.json"; - axios.post(url,{ - path: path - }).then((response) => { - if (response.data.status === 403||response.data.status === 401||response.data.status === 500) { - - }else{ - setTrees(response.data.trees) - setPath(path) - pathArray(newPathArray) - } - - }).catch((error) => { - console.log(error) - }); - } - const savegetfilepath=(value)=>{ - const state = {} - let {selectpath,saveshixunfilepath,pathtype} = state - - if(pathtype===1){ - let newselectpath; - - if(saveshixunfilepath==="shixunfilepathplay"){ - newselectpath=value - }else{ - const type = selectpath.split(';'); - let types=false; - for(var i=0; i<type.length; i++){ - if(type[i]===value){ - types=true - return - } - } - - if(types===false){ - newselectpath=selectpath+value+ ";" - }else{ - newselectpath=selectpath - } - } - // this.setState({ - // // selectpatharr:newarr, - // selectpath: newselectpath, - - // }) - } +// let id = props.match.params.shixunId; +// let url ="/shixuns/"+id+"/repository.json"; +// axios.post(url,{ +// path: path +// }).then((response) => { +// if (response.data.status === 403||response.data.status === 401||response.data.status === 500) { + +// }else{ +// setTrees(response.data.trees) +// setPath(path) +// pathArray(newPathArray) +// } + +// }).catch((error) => { +// console.log(error) +// }); +// } +// const savegetfilepath=(value)=>{ +// const state = {} +// let {selectpath,saveshixunfilepath,pathtype} = state + +// if(pathtype===1){ +// let newselectpath; + +// if(saveshixunfilepath==="shixunfilepathplay"){ +// newselectpath=value +// }else{ +// const type = selectpath.split(';'); +// let types=false; +// for(var i=0; i<type.length; i++){ +// if(type[i]===value){ +// types=true +// return +// } +// } + +// if(types===false){ +// newselectpath=selectpath+value+ ";" +// }else{ +// newselectpath=selectpath +// } +// } +// // this.setState({ +// // // selectpatharr:newarr, +// // selectpath: newselectpath, + +// // }) +// } - } - const goblakepath=(path,key)=>{ - - } - function sendgetfilepath() { - - } - return ( - <Modal - keyboard={false} - title="文件路径" - visible={modalVisible} - closable={false} - footer={false} - > - <div className="task_popup_con"> - <div className="newupload_conbox clearfix"> - <ul id="directory_file"> - {/*文件导航*/} - { - pathArray.length===0?"":pathArray.map((item,key)=>{ - return( - <a className="f14 fb" onClick={()=>goblakepath(item.path,key,item)}>{item.val}</a> - ) - }) - } - {/*文件*/} - {trees === undefined || trees === null ? "" : trees.map((item, key) => { - 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> - {path+item.name}</a>:<a data-remote="true"> - <i className="iconfont icon-zuoye color-blue mr2"></i> - <span onClick={()=>savegetfilepath(path+item.name,item.type)}>{path+item.name}</span> - </a> - } - </div> - </li> - - ) - })} - - </ul> - <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)=>saveselectpath(e)} - value={path}/> - </div> - - <a className="task-btn task-btn-orange fr" - 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> - </Modal> - ) - -} - -export default RepositoryChooseModal \ No newline at end of file +// } +// const goblakepath=(path,key)=>{ + +// } +// function sendgetfilepath() { + +// } +// return ( +// <Modal +// keyboard={false} +// title="文件路径" +// visible={modalVisible} +// closable={false} +// footer={false} +// > +// <div className="task_popup_con"> +// <div className="newupload_conbox clearfix"> +// <ul id="directory_file"> +// {/*文件导航*/} +// { +// pathArray.length===0?"":pathArray.map((item,key)=>{ +// return( +// <a className="f14 fb" onClick={()=>goblakepath(item.path,key,item)}>{item.val}</a> +// ) +// }) +// } +// {/*文件*/} +// {trees === undefined || trees === null ? "" : trees.map((item, key) => { +// 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> +// {path+item.name}</a>:<a data-remote="true"> +// <i className="iconfont icon-zuoye color-blue mr2"></i> +// <span onClick={()=>savegetfilepath(path+item.name,item.type)}>{path+item.name}</span> +// </a> +// } +// </div> +// </li> + +// ) +// })} + +// </ul> +// <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)=>saveselectpath(e)} +// value={path}/> +// </div> + +// <a className="task-btn task-btn-orange fr" +// 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> +// </Modal> +// ) + +// } + +// export default RepositoryChooseModal \ No newline at end of file From 776352ab5225bc4a70be3cd151cabc4553a6e8ef Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Mon, 9 Sep 2019 19:33:18 +0800 Subject: [PATCH 42/73] RepositoryChooseModal --- public/react/src/modules/tpm/TPMRepository.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/react/src/modules/tpm/TPMRepository.js b/public/react/src/modules/tpm/TPMRepository.js index c4d0dce67..0f8e31258 100644 --- a/public/react/src/modules/tpm/TPMRepository.js +++ b/public/react/src/modules/tpm/TPMRepository.js @@ -11,7 +11,7 @@ import Repository from './shixunchild/Repository/Repository' import TPMRightSection from './component/TPMRightSection' import TPMNav from './component/TPMNav' -import RepositoryChooseModal from './component/modal/RepositoryChooseModal' +// import RepositoryChooseModal from './component/modal/RepositoryChooseModal' class TPMRepository extends Component { constructor(props) { From 63ff1be3428fc721261f22a54cf09ec33b34a506 Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Mon, 9 Sep 2019 19:39:03 +0800 Subject: [PATCH 43/73] is_secret_repository --- public/react/src/modules/tpm/TPMsettings/TPMsettings.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/public/react/src/modules/tpm/TPMsettings/TPMsettings.js b/public/react/src/modules/tpm/TPMsettings/TPMsettings.js index 5e27cb41c..0887c4d18 100644 --- a/public/react/src/modules/tpm/TPMsettings/TPMsettings.js +++ b/public/react/src/modules/tpm/TPMsettings/TPMsettings.js @@ -449,7 +449,7 @@ export default class TPMsettings extends Component { multi_webssh:false }); } 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({ onOk: () => { this.setState({ @@ -615,7 +615,7 @@ export default class TPMsettings extends Component { // } const vnc = e.target.checked; 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({ onOk: () => { this.setState({ From 0a2bf3f79cc80a71d4145a00ef56abb99a664f80 Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Mon, 9 Sep 2019 19:51:25 +0800 Subject: [PATCH 44/73] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/student_works_controller.rb | 11 +++++------ .../student_works/shixun_work_comment.json.jbuilder | 3 +++ 2 files changed, 8 insertions(+), 6 deletions(-) create mode 100644 app/views/student_works/shixun_work_comment.json.jbuilder diff --git a/app/controllers/student_works_controller.rb b/app/controllers/student_works_controller.rb index 39401d079..6dcbea254 100644 --- a/app/controllers/student_works_controller.rb +++ b/app/controllers/student_works_controller.rb @@ -478,16 +478,15 @@ class StudentWorksController < ApplicationController ActiveRecord::Base.transaction do challenge = @homework.shixuns.first&.challenges.find_by(id: params[:challenge_id]) unless params[:challenge_id].blank? if challenge.present? - comment = @work.shixun_work_comments.find_by(challenge_id: challenge.id) || + @comment = @work.shixun_work_comments.find_by(challenge_id: challenge.id) || ShixunWorkComment.new(student_work_id: @work.id, user_id: current_user.id, challenge_id: challenge.id) else - comment = @work.shixun_work_comments.find_by(challenge_id: 0) || + @comment = @work.shixun_work_comments.find_by(challenge_id: 0) || ShixunWorkComment.new(student_work_id: @work.id, user_id: current_user.id, challenge_id: 0) end - comment.comment = params[:comment] - comment.hidden_comment = params[:hidden_comment] - comment.save! - normal_status("评阅成功") + @comment.comment = params[:comment] + @comment.hidden_comment = params[:hidden_comment] + @comment.save! end end diff --git a/app/views/student_works/shixun_work_comment.json.jbuilder b/app/views/student_works/shixun_work_comment.json.jbuilder new file mode 100644 index 000000000..f9f47cba5 --- /dev/null +++ b/app/views/student_works/shixun_work_comment.json.jbuilder @@ -0,0 +1,3 @@ +json.comment_id @comment.id +json.status 0 +json.message "评阅成功" \ No newline at end of file From 7b5966b2e2c1235265f94580f0cfcc49cac76533 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Mon, 9 Sep 2019 20:00:46 +0800 Subject: [PATCH 45/73] =?UTF-8?q?=E8=B0=83=E6=95=B4=E4=BC=A0=E5=8F=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../courses/coursesPublic/AppraiseModal.js | 3 +- .../shixunHomework/ShixunWorkReport.js | 9 ++-- .../OfficialAcademicTranscript.js | 47 +++++++++---------- 3 files changed, 30 insertions(+), 29 deletions(-) diff --git a/public/react/src/modules/courses/coursesPublic/AppraiseModal.js b/public/react/src/modules/courses/coursesPublic/AppraiseModal.js index 9d1efa5b0..a78e5be62 100644 --- a/public/react/src/modules/courses/coursesPublic/AppraiseModal.js +++ b/public/react/src/modules/courses/coursesPublic/AppraiseModal.js @@ -72,8 +72,9 @@ class AppraiseModal extends Component{ challenge_id:challenge_id }).then((response) => { if(response.data.status===0){ + debugger this.props.showNotification(response.data.message) - this.props.showCancel(comment,hidden_comment,challenge_id) + this.props.showCancel(comment,hidden_comment,response.data.comment_id) }else{ this.props.showNotification(response.data.message) } diff --git a/public/react/src/modules/courses/shixunHomework/ShixunWorkReport.js b/public/react/src/modules/courses/shixunHomework/ShixunWorkReport.js index 374aef8d4..e1b6590b5 100644 --- a/public/react/src/modules/courses/shixunHomework/ShixunWorkReport.js +++ b/public/react/src/modules/courses/shixunHomework/ShixunWorkReport.js @@ -157,7 +157,7 @@ class ShixunWorkReport extends Component { showAppraiseModal=(type,id,show,hidden)=>{ let{data}=this.state; - debugger + if(type==="child"){ data.stage_list.forEach((item,key)=>{ if(item.challenge_id===id){ @@ -192,12 +192,13 @@ class ShixunWorkReport extends Component { let{data,showAppraisetype}=this.state; - debugger + if(showAppraisetype==="child"){ data.stage_list.forEach((item,key)=>{ if(item.challenge_id===id){ item.challenge_comment=show; item.challenge_comment_hidden=hidden; + item.challenge_id=id; } }) this.setState({ @@ -205,10 +206,12 @@ class ShixunWorkReport extends Component { data:data }) }else{ + data.comment_id=id this.setState({ showAppraiseModaltype:false, work_comment:show, - work_comment_hidden:hidden + work_comment_hidden:hidden, + data:data }) } diff --git a/public/react/src/modules/courses/shixunHomework/shixunreport/OfficialAcademicTranscript.js b/public/react/src/modules/courses/shixunHomework/shixunreport/OfficialAcademicTranscript.js index 0cb75dee3..be99c7035 100644 --- a/public/react/src/modules/courses/shixunHomework/shixunreport/OfficialAcademicTranscript.js +++ b/public/react/src/modules/courses/shixunHomework/shixunreport/OfficialAcademicTranscript.js @@ -15,31 +15,7 @@ class OfficialAcademicTranscript extends Component { } componentDidMount() { - let {data}=this.props; - - let datas=[]; - if(data!=undefined){ - data.stage_list===undefined?"":data.stage_list.forEach((item,key)=>{ - datas.push({ - customs: key+1, - taskname:{name:item.name,complete_status:item.complete_status}, - openingtime:item.open_time, - evaluating: item.evaluate_count, - finishtime:item.finished_time, - elapsedtime:item.time_consuming, - empvalue:{myself:item.myself_experience,experience:item.experience}, - game_scores:{game_score:item.game_score,game_score_full:item.game_score_full}, - challenge_id:{id:item.challenge_id}, - challenge_comment: item.challenge_comment, - challenge_comment_hidden: item.challenge_comment_hidden, - // adjustmentminute:asdasd - }) - }) - this.setState({ - datas:datas - }) - } } myjumptopic=(e)=>{ console.log("获取到值"); @@ -98,7 +74,28 @@ class OfficialAcademicTranscript extends Component { } render() { - let {datas,customsids}=this.state; + let {customsids}=this.state; + let {data}=this.props; + + let datas=[]; + if(data!=undefined){ + data.stage_list===undefined?"":data.stage_list.forEach((item,key)=>{ + datas.push({ + customs: key+1, + taskname:{name:item.name,complete_status:item.complete_status}, + openingtime:item.open_time, + evaluating: item.evaluate_count, + finishtime:item.finished_time, + elapsedtime:item.time_consuming, + empvalue:{myself:item.myself_experience,experience:item.experience}, + game_scores:{game_score:item.game_score,game_score_full:item.game_score_full}, + challenge_id:{id:item.challenge_id}, + challenge_comment: item.challenge_comment, + challenge_comment_hidden: item.challenge_comment_hidden, + // adjustmentminute:asdasd + }) + }) + } let columns=[{ title: '关卡', From f3434a1d005177a4ad457fcddac29bd3e5750871 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Mon, 9 Sep 2019 20:07:29 +0800 Subject: [PATCH 46/73] 1 --- app/controllers/games_controller.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/controllers/games_controller.rb b/app/controllers/games_controller.rb index 26a7ff8db..a0edd01c3 100644 --- a/app/controllers/games_controller.rb +++ b/app/controllers/games_controller.rb @@ -541,6 +541,8 @@ class GamesController < ApplicationController testSet << test_cases end + logger.info("##############testSet: #{testSet}") + testCases = Base64.urlsafe_encode64(testSet.to_json) unless testSet.blank? # 评测类型: 0,1,2 用于webssh的评测, 3用于vnc podType = @shixun.vnc_evaluate ? 3 : @shixun.webssh From 75c5b3425c0e8578fecbc8d3b7748f9e13c052cf Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Mon, 9 Sep 2019 20:20:20 +0800 Subject: [PATCH 47/73] 1 --- app/controllers/games_controller.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/app/controllers/games_controller.rb b/app/controllers/games_controller.rb index a0edd01c3..28ea599b1 100644 --- a/app/controllers/games_controller.rb +++ b/app/controllers/games_controller.rb @@ -564,6 +564,7 @@ class GamesController < ApplicationController # 私密仓库的设置 secret_rep = @shixun.shixun_secret_repository + logger.info("############secret_rep: #{secret_rep}") if secret_rep&.repo_name secretGitUrl = repo_url secret_rep.repo_path br_params.merge({secretGitUrl: secretGitUrl, secretDir: secret_rep.secret_dir_path}) From cd63277f3d6108a4963c51b436b0869fbcefe3f3 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Mon, 9 Sep 2019 20:23:26 +0800 Subject: [PATCH 48/73] 1 --- app/controllers/games_controller.rb | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/controllers/games_controller.rb b/app/controllers/games_controller.rb index 28ea599b1..434846ea1 100644 --- a/app/controllers/games_controller.rb +++ b/app/controllers/games_controller.rb @@ -566,7 +566,10 @@ class GamesController < ApplicationController secret_rep = @shixun.shixun_secret_repository logger.info("############secret_rep: #{secret_rep}") if secret_rep&.repo_name + logger.info("############repo_path: #{secret_rep.repo_path}") secretGitUrl = repo_url secret_rep.repo_path + logger.info("############secretGitUrl: #{secretGitUrl}") + logger.info("############secret_dir_path: #{secret_rep.secret_dir_path}") br_params.merge({secretGitUrl: secretGitUrl, secretDir: secret_rep.secret_dir_path}) end From 6b451e1200b66dd13b311a70324544ccdad7e807 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Mon, 9 Sep 2019 20:24:21 +0800 Subject: [PATCH 49/73] 1 --- app/controllers/games_controller.rb | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/app/controllers/games_controller.rb b/app/controllers/games_controller.rb index 434846ea1..33a7b6fcb 100644 --- a/app/controllers/games_controller.rb +++ b/app/controllers/games_controller.rb @@ -566,11 +566,8 @@ class GamesController < ApplicationController secret_rep = @shixun.shixun_secret_repository logger.info("############secret_rep: #{secret_rep}") if secret_rep&.repo_name - logger.info("############repo_path: #{secret_rep.repo_path}") secretGitUrl = repo_url secret_rep.repo_path - logger.info("############secretGitUrl: #{secretGitUrl}") - logger.info("############secret_dir_path: #{secret_rep.secret_dir_path}") - br_params.merge({secretGitUrl: secretGitUrl, secretDir: secret_rep.secret_dir_path}) + br_params.merge!({secretGitUrl: secretGitUrl, secretDir: secret_rep.secret_dir_path}) end # 中间层交互 From f9eef7af3463886e3cb5dc86fdd26a53b8c0015e Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Mon, 9 Sep 2019 20:24:47 +0800 Subject: [PATCH 50/73] 1 --- app/controllers/games_controller.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/app/controllers/games_controller.rb b/app/controllers/games_controller.rb index 33a7b6fcb..cb798b4c9 100644 --- a/app/controllers/games_controller.rb +++ b/app/controllers/games_controller.rb @@ -568,6 +568,7 @@ class GamesController < ApplicationController if secret_rep&.repo_name secretGitUrl = repo_url secret_rep.repo_path br_params.merge!({secretGitUrl: secretGitUrl, secretDir: secret_rep.secret_dir_path}) + logger.info("#######br_params:#{br_params}") end # 中间层交互 From 064acfc443575944129ba95e14b2b86153bc6ccb Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Mon, 9 Sep 2019 20:37:38 +0800 Subject: [PATCH 51/73] 1 --- app/controllers/games_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/games_controller.rb b/app/controllers/games_controller.rb index cb798b4c9..b35f2996f 100644 --- a/app/controllers/games_controller.rb +++ b/app/controllers/games_controller.rb @@ -567,7 +567,7 @@ class GamesController < ApplicationController logger.info("############secret_rep: #{secret_rep}") if secret_rep&.repo_name 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 From 83b29bc1d6030f9f3eee972e040adc4bca7eac61 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Mon, 9 Sep 2019 21:00:17 +0800 Subject: [PATCH 52/73] =?UTF-8?q?=E5=8A=A0=E9=94=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/shixuns_controller.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/app/controllers/shixuns_controller.rb b/app/controllers/shixuns_controller.rb index 3f415f706..24a11cb3b 100644 --- a/app/controllers/shixuns_controller.rb +++ b/app/controllers/shixuns_controller.rb @@ -479,6 +479,7 @@ class ShixunsController < ApplicationController else # 如果有仓库,就要删 if @shixun.shixun_secret_repository&.repo_name + @shixun.shixun_secret_repository.lock! GitService.delete_repository(repo_path: @shixun.shixun_secret_repository.repo_path) @shixun.shixun_secret_repository.destroy end From b96465c06d4c261363719d36a44964c263de42a5 Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Mon, 9 Sep 2019 21:03:21 +0800 Subject: [PATCH 53/73] saving --- public/react/src/modules/tpm/TPMsettings/TPMsettings.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/public/react/src/modules/tpm/TPMsettings/TPMsettings.js b/public/react/src/modules/tpm/TPMsettings/TPMsettings.js index 0887c4d18..a46654fe6 100644 --- a/public/react/src/modules/tpm/TPMsettings/TPMsettings.js +++ b/public/react/src/modules/tpm/TPMsettings/TPMsettings.js @@ -859,7 +859,8 @@ export default class TPMsettings extends Component { // }); // } submit_edit_shixun = () => { - + if (this.saving == true) return; + this.saving = true; if(this.state.status===-1){ this.props.showSnackbar("该实训已被删除,保存失败!"); return @@ -1002,6 +1003,7 @@ export default class TPMsettings extends Component { axios.put(Url, data).then((response) => { // console.log(response) + this.saving = false; if(response.status){ if (response.data.status === -1) { this.props.showSnackbar(response.data.message); @@ -1013,6 +1015,7 @@ export default class TPMsettings extends Component { }).catch((error) => { console.log(error) + this.saving = false; }) From 3a3a956ef7fe25ae65a64893134eeb63adbd9555 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Mon, 9 Sep 2019 21:23:25 +0800 Subject: [PATCH 54/73] =?UTF-8?q?fork=E7=A7=81=E5=AF=86=E4=BB=93=E5=BA=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/shixuns_controller.rb | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/app/controllers/shixuns_controller.rb b/app/controllers/shixuns_controller.rb index 24a11cb3b..8d735c25e 100644 --- a/app/controllers/shixuns_controller.rb +++ b/app/controllers/shixuns_controller.rb @@ -220,6 +220,16 @@ class ShixunsController < ApplicationController evaluate_script: @shixun.evaluate_script) end + # 同步私密版本库 + if @shixun.shixun_secret_repository + repo_name = "#{current_user.login}/secret_#{@shixun.identifier}" + secret_repo = "#{current_user.login}/secret_#{@new_shixun.identifier}" + ShixunSecretRepository.create!(shixun_id: @new_shixun.id, + repo_name: "#{repo_name}", + secret_dir_path: @shixun.secret_dir_path) + GitService.fork_repository(repo_path: "#{repo_name}.git", fork_repository_path: (secret_repo + ".git")) + end + # 同步镜像 if @shixun.mirror_repositories.present? @shixun.mirror_repositories.each do |mirror| From 641c6c4dddc682b12df49b267964b520012e9beb Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Mon, 9 Sep 2019 21:24:51 +0800 Subject: [PATCH 55/73] =?UTF-8?q?=E7=A7=81=E5=AF=86=E4=BB=93=E5=BA=93?= =?UTF-8?q?=E5=AE=9E=E8=AE=ADfork=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/shixuns_controller.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/shixuns_controller.rb b/app/controllers/shixuns_controller.rb index 8d735c25e..85b724ca9 100644 --- a/app/controllers/shixuns_controller.rb +++ b/app/controllers/shixuns_controller.rb @@ -223,11 +223,11 @@ class ShixunsController < ApplicationController # 同步私密版本库 if @shixun.shixun_secret_repository repo_name = "#{current_user.login}/secret_#{@shixun.identifier}" - secret_repo = "#{current_user.login}/secret_#{@new_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.secret_dir_path) - GitService.fork_repository(repo_path: "#{repo_name}.git", fork_repository_path: (secret_repo + ".git")) + GitService.fork_repository(repo_path: "#{repo_name}.git", fork_repository_path: (fork_repository_name + ".git")) end # 同步镜像 From 8242a058abdac000b38d4579be301f009137b72b Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Mon, 9 Sep 2019 21:32:20 +0800 Subject: [PATCH 56/73] =?UTF-8?q?=E7=89=88=E6=9C=AC=E5=BA=93=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/shixuns_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/shixuns_controller.rb b/app/controllers/shixuns_controller.rb index 85b724ca9..5f69f1b91 100644 --- a/app/controllers/shixuns_controller.rb +++ b/app/controllers/shixuns_controller.rb @@ -226,7 +226,7 @@ class ShixunsController < ApplicationController 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.secret_dir_path) + 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 From 7493d798622e0e1de469a8b5cbd07f4fd4571ebd Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Mon, 9 Sep 2019 21:36:24 +0800 Subject: [PATCH 57/73] =?UTF-8?q?=E5=88=A0=E9=99=A4=E7=9A=84=E8=B0=83?= =?UTF-8?q?=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/student_works_controller.rb | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/app/controllers/student_works_controller.rb b/app/controllers/student_works_controller.rb index 6dcbea254..ab62cbd45 100644 --- a/app/controllers/student_works_controller.rb +++ b/app/controllers/student_works_controller.rb @@ -493,15 +493,16 @@ class StudentWorksController < ApplicationController # 删除实训作品评阅 def destroy_work_comment 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]) - params[:visible_comment] ? comment.comment = nil : comment.hidden_comment = nil - if comment.comment.nil? && comment.hidden_comment.nil? - comment.destroy! - else - comment.save! - end + comment.destroy! + # params[:visible_comment] ? comment.comment = nil : comment.hidden_comment = nil + # if comment.comment.nil? && comment.hidden_comment.nil? + # comment.destroy! + # else + # comment.save! + # end normal_status("删除成功") end end From 7b28dc0cbc1a879b06ef07a48a82b258928dccf3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Mon, 9 Sep 2019 21:59:32 +0800 Subject: [PATCH 58/73] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../courses/coursesPublic/AppraiseModal.js | 2 +- .../shixunHomework/ShixunWorkReport.js | 71 +++++---- .../shixunHomework/ShowAppraiseList.js | 141 +++++++++--------- 3 files changed, 103 insertions(+), 111 deletions(-) diff --git a/public/react/src/modules/courses/coursesPublic/AppraiseModal.js b/public/react/src/modules/courses/coursesPublic/AppraiseModal.js index a78e5be62..f1ee18bb7 100644 --- a/public/react/src/modules/courses/coursesPublic/AppraiseModal.js +++ b/public/react/src/modules/courses/coursesPublic/AppraiseModal.js @@ -74,7 +74,7 @@ class AppraiseModal extends Component{ if(response.data.status===0){ debugger this.props.showNotification(response.data.message) - this.props.showCancel(comment,hidden_comment,response.data.comment_id) + this.props.showCancel(comment,hidden_comment,challenge_id,response.data.comment_id) }else{ this.props.showNotification(response.data.message) } diff --git a/public/react/src/modules/courses/shixunHomework/ShixunWorkReport.js b/public/react/src/modules/courses/shixunHomework/ShixunWorkReport.js index e1b6590b5..a8efd3060 100644 --- a/public/react/src/modules/courses/shixunHomework/ShixunWorkReport.js +++ b/public/react/src/modules/courses/shixunHomework/ShixunWorkReport.js @@ -157,7 +157,7 @@ class ShixunWorkReport extends Component { showAppraiseModal=(type,id,show,hidden)=>{ let{data}=this.state; - + debugger if(type==="child"){ data.stage_list.forEach((item,key)=>{ if(item.challenge_id===id){ @@ -188,17 +188,17 @@ class ShixunWorkReport extends Component { showAppraiseModaltype:false, }) } - showAppraiseModals=(show,hidden,id)=>{ + showAppraiseModals=(show,hidden,id,comment_id)=>{ let{data,showAppraisetype}=this.state; - + debugger if(showAppraisetype==="child"){ data.stage_list.forEach((item,key)=>{ if(item.challenge_id===id){ item.challenge_comment=show; item.challenge_comment_hidden=hidden; - item.challenge_id=id; + item.comment_id=comment_id } }) this.setState({ @@ -206,7 +206,7 @@ class ShixunWorkReport extends Component { data:data }) }else{ - data.comment_id=id + data.comment_id=comment_id; this.setState({ showAppraiseModaltype:false, work_comment:show, @@ -216,11 +216,11 @@ class ShixunWorkReport extends Component { } } - isdeleteModal=(comment_id,visible_comment)=>{ + isdeleteModal=(comment_id,visible_comment,type)=>{ this.setState({ modalsType: true, modalsTopval:"是否确认删除?", - modalSave: ()=>this.isdeleteModals(comment_id,visible_comment), + modalSave: ()=>this.isdeleteModals(comment_id,visible_comment,type), modalCancel:()=>this.hideisdeleteModals(), }) } @@ -235,20 +235,25 @@ class ShixunWorkReport extends Component { } - hideisdeleteModal=(comment_id,visible_comment)=>{ + hideisdeleteModal=(comment_id,visible_comment,type)=>{ - let{data,work_comment,work_comment_hidden,showAppraisetype}=this.state; - if(showAppraisetype==="child"){ - data.stage_list.forEach((item,key)=>{ - if(item.comment_id===comment_id){ - if(visible_comment===true){ - item.challenge_comment=null; - }else{ - item.challenge_comment_hidden=null; + let{data,work_comment,work_comment_hidden}=this.state; + + if(type==="child"){ + data.stage_list.map((item,key)=>{ + console.log(item) + if(item.comment_id!=null){ + if(item.comment_id===comment_id){ + if(visible_comment===true){ + item.challenge_comment=null; + }else{ + item.challenge_comment_hidden=null; + } } } }) + this.setState({ modalsType:false, modalsTopval:"是否确认删除?", @@ -256,40 +261,36 @@ class ShixunWorkReport extends Component { modalCancel:"", data:data }) + }else{ - if(visible_comment===true){ - this.setState({ - modalsType:false, - modalsTopval:"是否确认删除?", - modalSave: "", - modalCancel:"", - work_comment:visible_comment===true?null:work_comment, - }) - }else{ + this.setState({ modalsType:false, modalsTopval:"是否确认删除?", modalSave: "", modalCancel:"", - work_comment_hidden:visible_comment===false?null:work_comment_hidden + work_comment:null, + work_comment_hidden:null }) - } + } } - isdeleteModals=(comment_id,visible_comment)=>{ + isdeleteModals=(comment_id,visible_comment,type)=>{ + let newcomment_id=comment_id; + let newvisible_comment=visible_comment; + let newtype=type; + let url =`/student_works/${this.props.match.params.homeworkid}/destroy_work_comment.json` axios.delete(url, { data: { comment_id:comment_id, - visible_comment:visible_comment }}).then((response) => { // const { status } = response.data; if(response.data.status===0){ this.props.showNotification(response.data.message) - - this.hideisdeleteModal(comment_id,visible_comment) + this.hideisdeleteModal(newcomment_id,newvisible_comment,newtype) }else{ this.props.showNotification(response.data.message) } @@ -308,9 +309,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=work_comment===null||work_comment===undefined?false:true; - console.log(data) - console.log(work_comment_hidden) - console.log(work_comment) + return ( data===undefined?"":<Spin indicator={antIcon} spinning={this.state.spinning}> @@ -329,7 +328,7 @@ class ShixunWorkReport extends Component { {...this.state} visible={showAppraiseModaltype} Cancel={()=>this.hideAppraiseModal()} - showCancel={(show,hidden,id)=>this.showAppraiseModals(show,hidden,id)} + showCancel={(show,hidden,id,comment_id)=>this.showAppraiseModals(show,hidden,id,comment_id)} work_comment={this.state.work_comment} work_type={work_comment===null||work_comment===undefined?this.state.work_type:work_comment_hidden===true?1:0} />:""} @@ -551,7 +550,7 @@ class ShixunWorkReport extends Component { <ShowAppraiseList {...this.props} {...this.state} - isdeleteModal={(comment_id,visible_comment)=>this.isdeleteModal(comment_id,visible_comment)} + isdeleteModal={(comment_id,visible_comment,type)=>this.isdeleteModal(comment_id,visible_comment,type)} showAppraiseModal={(type,id,show,hidden)=>this.showAppraiseModal(type,id,show,hidden)} /> diff --git a/public/react/src/modules/courses/shixunHomework/ShowAppraiseList.js b/public/react/src/modules/courses/shixunHomework/ShowAppraiseList.js index 66ac56a63..f53ad2cd9 100644 --- a/public/react/src/modules/courses/shixunHomework/ShowAppraiseList.js +++ b/public/react/src/modules/courses/shixunHomework/ShowAppraiseList.js @@ -11,16 +11,12 @@ class ShowAppraiseList extends Component{ } } - componentDidMount() { - - - } - render(){ - let {data,work_comment,work_comment_hidden}=this.props; - console.log(data) + 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===undefined||work_comment===null||work_comment===""; return( <div> <style> @@ -38,10 +34,18 @@ class ShowAppraiseList extends Component{ text-align: center; line-height: 22px; } + .666w{ + color: #666; + font-size:14px; + } + .000w{ + color: #000; + font-size:15px; + } ` } </style> - {data===undefined?"":work_comment===undefined||work_comment===null||work_comment===""?"": + {data===undefined?"":work_commenttype===true&&work_comment_hiddentype===true?"": <div className="stud-class-set mt17"> <div className="clearfix edu-back-white poll_list"> @@ -49,7 +53,7 @@ class ShowAppraiseList extends Component{ <span className={"appraisebox"}>总体评阅</span>评阅内容 {this.props&&this.props.isAdminOrTeacher()===true?<a className="color-blue font-14 fr ml20" - onClick={()=>this.props.isdeleteModal(data.comment_id,true)} + onClick={()=>this.props.isdeleteModal(data.comment_id,true,"main")} >删除</a>:""} {this.props&&this.props.isAdminOrTeacher()===true?<a className="color-blue font-14 fr" @@ -58,103 +62,92 @@ class ShowAppraiseList extends Component{ </div> - <div className="font-16 color-dark-21 shixunreporttitleboxbom pd30"> + {this.props&&this.props.isAdminOrTeacher()===true? + <div className="font-16 color-dark-21 shixunreporttitleboxbom pd30"> + <div> + <span className={"000w"}>学生不可见<span className={"666w"}>(仅对课堂老师可见)</span></span> + </div> + <div style={{minHeight:'50px'}}> + {work_comment_hidden===true?"":<div className={"personalsummary"}> + <div className={"markdown-body"} + dangerouslySetInnerHTML={{__html: markdownToHTML(work_comment_hidden).replace(/▁/g, "▁▁▁")}}></div> + </div>} + </div> + <div> + <span className={"000w"}>学生可见<span className={"666w"}>(学生可查看老师的评阅内容)</span></span> + </div> <div style={{minHeight:'50px'}}> - <div className={"personalsummary"}> + {work_comment===true?"":<div className={"personalsummary"}> <div className={"markdown-body"} dangerouslySetInnerHTML={{__html: markdownToHTML(work_comment).replace(/▁/g, "▁▁▁")}}></div> - </div> + </div>} </div> - </div> - - </div> - </div>} - - - - {data===undefined?"":work_comment_hidden===undefined||work_comment_hidden===null||work_comment_hidden===""?"":this.props&&this.props.isAdminOrTeacher()===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>评阅内容<span>(仅对课堂老师可见)</span> - - {this.props&&this.props.isAdminOrTeacher()===true?<a className="color-blue font-14 fr ml20" - onClick={()=>this.props.isdeleteModal(data.comment_id,false)} - >删除</a>:""} - - {this.props&&this.props.isAdminOrTeacher()===true?<a className="color-blue font-14 fr" - onClick={()=>this.props.showAppraiseModal("main",undefined,work_comment,work_comment_hidden)} - >编辑</a>:""} - - </div> - <div className="font-16 color-dark-21 shixunreporttitleboxbom pd30"> + </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_hidden).replace(/▁/g, "▁▁▁")}}></div> + dangerouslySetInnerHTML={{__html: markdownToHTML(work_comment).replace(/▁/g, "▁▁▁")}}></div> </div> </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> - {challenge_comment===false?<div className="stud-class-set mt17" key={key}> + <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>评阅内容 + <span className={"appraisebox"}>第{key+1}关</span>{item.name} {this.props&&this.props.isAdminOrTeacher()===true?<a className="color-blue font-14 fr ml20" - onClick={()=>this.props.isdeleteModal(item.comment_id,true)} + onClick={()=>this.props.isdeleteModal(item.comment_id,true,"child")} >删除</a>:""} {this.props&&this.props.isAdminOrTeacher()===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> - <div className="font-16 color-dark-21 shixunreporttitleboxbom pd30"> - <div style={{minHeight:'50px'}}> - <div className={"personalsummary"}> - <div className={"markdown-body"} - dangerouslySetInnerHTML={{__html: markdownToHTML(item.challenge_comment).replace(/▁/g, "▁▁▁")}}></div> - </div> - </div> - </div> - - </div> - </div>:""} - - {challenge_comment_hidden===false&&this.props&&this.props.isAdminOrTeacher()===true?<div className="stud-class-set mt17" key={key}> - <div className="clearfix edu-back-white poll_list"> - <div className="font-16 color-dark-21 shixunreporttitleboxtop pd20 color333"> - <span className={"appraisebox"}>第{key+1}关</span>评阅内容<span>(仅对课堂老师可见)</span> - - {this.props&&this.props.isAdminOrTeacher()===true?<a className="color-blue font-14 fr ml20" - onClick={()=>this.props.isdeleteModal(item.comment_id,false)} - >删除</a>:""} + {this.props&&this.props.isAdminOrTeacher()===true? + <div className="font-16 color-dark-21 shixunreporttitleboxbom pd30"> + <div> + <span className={"000w"}>学生不可见<span className={"666w"}>(仅对课堂老师可见)</span></span> + </div> + <div style={{minHeight:'50px'}}> + {challenge_comment_hidden===true?"":<div className={"personalsummary"}> + <div className={"markdown-body"} + dangerouslySetInnerHTML={{__html: markdownToHTML(item.challenge_comment_hidden).replace(/▁/g, "▁▁▁")}}></div> + </div>} + </div> + <div> + <span className={"000w"}>学生可见<span className={"666w"}>(学生可查看老师的评阅内容)</span></span> + </div> + <div style={{minHeight:'50px'}}> + {challenge_comment===true?"":<div className={"personalsummary"}> + <div className={"markdown-body"} + dangerouslySetInnerHTML={{__html: markdownToHTML(item.challenge_comment).replace(/▁/g, "▁▁▁")}}></div> + </div>} + </div> - {this.props&&this.props.isAdminOrTeacher()===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> - <div className="font-16 color-dark-21 shixunreporttitleboxbom pd30"> - <div style={{minHeight:'50px'}}> - <div className={"personalsummary"}> - <div className={"markdown-body"} - dangerouslySetInnerHTML={{__html: markdownToHTML(item.challenge_comment_hidden).replace(/▁/g, "▁▁▁")}}></div> + </div>: <div className="font-16 color-dark-21 shixunreporttitleboxbom pd30"> + <div style={{minHeight:'50px'}}> + <div className={"personalsummary"}> + <div className={"markdown-body"} + dangerouslySetInnerHTML={{__html: markdownToHTML(item.challenge_comment).replace(/▁/g, "▁▁▁")}}></div> + </div> </div> - </div> - </div> + </div>} </div> </div>:""} From 06c750162b7c4bf0e376e0a3161598568a0bb485 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Mon, 9 Sep 2019 22:02:58 +0800 Subject: [PATCH 59/73] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/modules/courses/shixunHomework/ShixunWorkReport.js | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/public/react/src/modules/courses/shixunHomework/ShixunWorkReport.js b/public/react/src/modules/courses/shixunHomework/ShixunWorkReport.js index a8efd3060..ab801fe40 100644 --- a/public/react/src/modules/courses/shixunHomework/ShixunWorkReport.js +++ b/public/react/src/modules/courses/shixunHomework/ShixunWorkReport.js @@ -245,11 +245,8 @@ class ShixunWorkReport extends Component { console.log(item) if(item.comment_id!=null){ if(item.comment_id===comment_id){ - if(visible_comment===true){ - item.challenge_comment=null; - }else{ - item.challenge_comment_hidden=null; - } + item.challenge_comment=null; + item.challenge_comment_hidden=null; } } }) From bcfbca145175c9ac7d4f802e9d5befbd7d508c07 Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Mon, 9 Sep 2019 22:03:15 +0800 Subject: [PATCH 60/73] absolute --- public/react/src/modules/page/VNCContainer.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/public/react/src/modules/page/VNCContainer.js b/public/react/src/modules/page/VNCContainer.js index d8e5a0b1f..85532dad1 100644 --- a/public/react/src/modules/page/VNCContainer.js +++ b/public/react/src/modules/page/VNCContainer.js @@ -144,6 +144,11 @@ class VNCContainer extends Component { .codeEvaluateDrawer .ant-drawer-body { padding: 0px; } + .codeEvaluateDrawer .ant-drawer-content-wrapper, .codeEvaluateDrawer .ant-drawer-mask { + position: absolute; + } + + .codeEvaluateFloatButton { bottom: 180px !important; left: unset; From 8722cbf36da24a7c7529332e41e94ed84a77331c Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Mon, 9 Sep 2019 22:09:19 +0800 Subject: [PATCH 61/73] closable={false} --- public/react/src/modules/page/VNCContainer.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/react/src/modules/page/VNCContainer.js b/public/react/src/modules/page/VNCContainer.js index 85532dad1..ecc2c8a41 100644 --- a/public/react/src/modules/page/VNCContainer.js +++ b/public/react/src/modules/page/VNCContainer.js @@ -216,7 +216,7 @@ class VNCContainer extends Component { mask={true} title="" width={firstDrawerWidth} - // closable={false} + closable={false} onClose={this.onBottomDrawerClose} visible={this.state.bottomDrawer} className={'codeEvaluateDrawer'} From ab146018c8633eb1d12822e96bc6d69dbe311dfa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Mon, 9 Sep 2019 22:11:03 +0800 Subject: [PATCH 62/73] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modules/courses/shixunHomework/ShixunWorkReport.js | 3 +-- .../modules/courses/shixunHomework/ShowAppraiseList.js | 9 +++++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/public/react/src/modules/courses/shixunHomework/ShixunWorkReport.js b/public/react/src/modules/courses/shixunHomework/ShixunWorkReport.js index ab801fe40..0f1264865 100644 --- a/public/react/src/modules/courses/shixunHomework/ShixunWorkReport.js +++ b/public/react/src/modules/courses/shixunHomework/ShixunWorkReport.js @@ -157,7 +157,7 @@ class ShixunWorkReport extends Component { showAppraiseModal=(type,id,show,hidden)=>{ let{data}=this.state; - debugger + if(type==="child"){ data.stage_list.forEach((item,key)=>{ if(item.challenge_id===id){ @@ -192,7 +192,6 @@ class ShixunWorkReport extends Component { let{data,showAppraisetype}=this.state; - debugger if(showAppraisetype==="child"){ data.stage_list.forEach((item,key)=>{ if(item.challenge_id===id){ diff --git a/public/react/src/modules/courses/shixunHomework/ShowAppraiseList.js b/public/react/src/modules/courses/shixunHomework/ShowAppraiseList.js index f53ad2cd9..05fdacfed 100644 --- a/public/react/src/modules/courses/shixunHomework/ShowAppraiseList.js +++ b/public/react/src/modules/courses/shixunHomework/ShowAppraiseList.js @@ -42,6 +42,11 @@ class ShowAppraiseList extends Component{ color: #000; font-size:15px; } + + .borderbom{ + margin-bottom: 20px; + border-bottom: 2px solid #fafafa; + } ` } </style> @@ -67,7 +72,7 @@ class ShowAppraiseList extends Component{ <div> <span className={"000w"}>学生不可见<span className={"666w"}>(仅对课堂老师可见)</span></span> </div> - <div style={{minHeight:'50px'}}> + <div className={"borderbom"} style={{minHeight:'50px'}}> {work_comment_hidden===true?"":<div className={"personalsummary"}> <div className={"markdown-body"} dangerouslySetInnerHTML={{__html: markdownToHTML(work_comment_hidden).replace(/▁/g, "▁▁▁")}}></div> @@ -124,7 +129,7 @@ class ShowAppraiseList extends Component{ <div> <span className={"000w"}>学生不可见<span className={"666w"}>(仅对课堂老师可见)</span></span> </div> - <div style={{minHeight:'50px'}}> + <div className={"borderbom"} style={{minHeight:'50px'}}> {challenge_comment_hidden===true?"":<div className={"personalsummary"}> <div className={"markdown-body"} dangerouslySetInnerHTML={{__html: markdownToHTML(item.challenge_comment_hidden).replace(/▁/g, "▁▁▁")}}></div> From d1e9c861244501da9440b68a034921aeeb13a941 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Mon, 9 Sep 2019 22:13:13 +0800 Subject: [PATCH 63/73] b --- .../src/modules/courses/shixunHomework/ShowAppraiseList.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/react/src/modules/courses/shixunHomework/ShowAppraiseList.js b/public/react/src/modules/courses/shixunHomework/ShowAppraiseList.js index 05fdacfed..b32d6a0e6 100644 --- a/public/react/src/modules/courses/shixunHomework/ShowAppraiseList.js +++ b/public/react/src/modules/courses/shixunHomework/ShowAppraiseList.js @@ -40,7 +40,7 @@ class ShowAppraiseList extends Component{ } .000w{ color: #000; - font-size:15px; + font-size:16px; } .borderbom{ From c583ef53471ee1b6c811f3a31fe94ea75b722e79 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Mon, 9 Sep 2019 22:15:04 +0800 Subject: [PATCH 64/73] b --- .../courses/shixunHomework/ShowAppraiseList.js | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/public/react/src/modules/courses/shixunHomework/ShowAppraiseList.js b/public/react/src/modules/courses/shixunHomework/ShowAppraiseList.js index b32d6a0e6..34e978bef 100644 --- a/public/react/src/modules/courses/shixunHomework/ShowAppraiseList.js +++ b/public/react/src/modules/courses/shixunHomework/ShowAppraiseList.js @@ -34,11 +34,11 @@ class ShowAppraiseList extends Component{ text-align: center; line-height: 22px; } - .666w{ + .666{ color: #666; font-size:14px; } - .000w{ + .000{ color: #000; font-size:16px; } @@ -47,6 +47,9 @@ class ShowAppraiseList extends Component{ margin-bottom: 20px; border-bottom: 2px solid #fafafa; } + pd30bt{ + padding: 30px 30px 0px 30px; + } ` } </style> @@ -70,7 +73,7 @@ class ShowAppraiseList extends Component{ {this.props&&this.props.isAdminOrTeacher()===true? <div className="font-16 color-dark-21 shixunreporttitleboxbom pd30"> <div> - <span className={"000w"}>学生不可见<span className={"666w"}>(仅对课堂老师可见)</span></span> + <span className={"000"}>学生不可见<span className={"666"}>(仅对课堂老师可见)</span></span> </div> <div className={"borderbom"} style={{minHeight:'50px'}}> {work_comment_hidden===true?"":<div className={"personalsummary"}> @@ -79,7 +82,7 @@ class ShowAppraiseList extends Component{ </div>} </div> <div> - <span className={"000w"}>学生可见<span className={"666w"}>(学生可查看老师的评阅内容)</span></span> + <span className={"000"}>学生可见<span className={"666"}>(学生可查看老师的评阅内容)</span></span> </div> <div style={{minHeight:'50px'}}> {work_comment===true?"":<div className={"personalsummary"}> @@ -127,7 +130,7 @@ class ShowAppraiseList extends Component{ {this.props&&this.props.isAdminOrTeacher()===true? <div className="font-16 color-dark-21 shixunreporttitleboxbom pd30"> <div> - <span className={"000w"}>学生不可见<span className={"666w"}>(仅对课堂老师可见)</span></span> + <span className={"000"}>学生不可见<span className={"666"}>(仅对课堂老师可见)</span></span> </div> <div className={"borderbom"} style={{minHeight:'50px'}}> {challenge_comment_hidden===true?"":<div className={"personalsummary"}> @@ -136,7 +139,7 @@ class ShowAppraiseList extends Component{ </div>} </div> <div> - <span className={"000w"}>学生可见<span className={"666w"}>(学生可查看老师的评阅内容)</span></span> + <span className={"000"}>学生可见<span className={"666"}>(学生可查看老师的评阅内容)</span></span> </div> <div style={{minHeight:'50px'}}> {challenge_comment===true?"":<div className={"personalsummary"}> From 51a534823756c31e1c26b08d034a18bd793beeb8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Mon, 9 Sep 2019 22:27:44 +0800 Subject: [PATCH 65/73] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../shixunHomework/ShowAppraiseList.js | 87 +++++++++---------- .../modules/courses/shixunHomework/style.css | 13 +++ 2 files changed, 55 insertions(+), 45 deletions(-) diff --git a/public/react/src/modules/courses/shixunHomework/ShowAppraiseList.js b/public/react/src/modules/courses/shixunHomework/ShowAppraiseList.js index 34e978bef..1a5b4a136 100644 --- a/public/react/src/modules/courses/shixunHomework/ShowAppraiseList.js +++ b/public/react/src/modules/courses/shixunHomework/ShowAppraiseList.js @@ -2,6 +2,7 @@ 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){ @@ -15,8 +16,8 @@ class ShowAppraiseList extends Component{ 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===undefined||work_comment===null||work_comment===""; + let work_commenttype=this.props&&this.props.isAdmin()===true?false:work_comment===undefined||work_comment===null||work_comment===""; + let work_comment_hiddentype=this.props&&this.props.isAdmin()===true?false:work_comment===undefined||work_comment===null||work_comment===""; return( <div> <style> @@ -34,22 +35,15 @@ class ShowAppraiseList extends Component{ text-align: center; line-height: 22px; } - .666{ - color: #666; - font-size:14px; - } - .000{ - color: #000; - font-size:16px; - } + .markdown-body{ + padding-bottom: 10px; + } .borderbom{ - margin-bottom: 20px; + margin-bottom: 15px; border-bottom: 2px solid #fafafa; } - pd30bt{ - padding: 30px 30px 0px 30px; - } + ` } </style> @@ -60,39 +54,41 @@ class ShowAppraiseList extends Component{ <div className="font-16 color-dark-21 shixunreporttitleboxtop pd20 color333"> <span className={"appraisebox"}>总体评阅</span>评阅内容 - {this.props&&this.props.isAdminOrTeacher()===true?<a className="color-blue font-14 fr ml20" + {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.isAdminOrTeacher()===true?<a className="color-blue font-14 fr" + {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.isAdminOrTeacher()===true? - <div className="font-16 color-dark-21 shixunreporttitleboxbom pd30"> + {this.props&&this.props.isAdmin()===true? + <div className="font-16 color-dark-21 shixunreporttitleboxbom pd30bt"> + <div> + <span className={"z000"}>学生可见<span className={"z666"}>(学生可查看老师的评阅内容)</span></span> + </div> + <div className={"borderbom"} style={{minHeight:'40px'}}> + {work_comment===true?"":<div className={"personalsummary"}> + <div className={"markdown-body"} + dangerouslySetInnerHTML={{__html: markdownToHTML(work_comment).replace(/▁/g, "▁▁▁")}}></div> + </div>} + </div> + <div> - <span className={"000"}>学生不可见<span className={"666"}>(仅对课堂老师可见)</span></span> + <span className={"z000"}>学生不可见<span className={"z666"}>(仅对课堂老师可见)</span></span> </div> - <div className={"borderbom"} style={{minHeight:'50px'}}> + <div style={{minHeight:'40px'}}> {work_comment_hidden===true?"":<div className={"personalsummary"}> <div className={"markdown-body"} dangerouslySetInnerHTML={{__html: markdownToHTML(work_comment_hidden).replace(/▁/g, "▁▁▁")}}></div> </div>} </div> - <div> - <span className={"000"}>学生可见<span className={"666"}>(学生可查看老师的评阅内容)</span></span> - </div> - <div style={{minHeight:'50px'}}> - {work_comment===true?"":<div className={"personalsummary"}> - <div className={"markdown-body"} - dangerouslySetInnerHTML={{__html: markdownToHTML(work_comment).replace(/▁/g, "▁▁▁")}}></div> - </div>} - </div> + </div>:<div className="font-16 color-dark-21 shixunreporttitleboxbom pd30"> - <div style={{minHeight:'50px'}}> + <div style={{minHeight:'40px'}}> <div className={"personalsummary"}> <div className={"markdown-body"} dangerouslySetInnerHTML={{__html: markdownToHTML(work_comment).replace(/▁/g, "▁▁▁")}}></div> @@ -108,8 +104,8 @@ class ShowAppraiseList extends Component{ {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===""; + let challenge_comment_hidden=this.props&&this.props.isAdmin()===true?false:item.challenge_comment_hidden===undefined||item.challenge_comment_hidden===null||item.challenge_comment_hidden===""; + let challenge_comment=this.props&&this.props.isAdmin()===true?false:item.challenge_comment===undefined||item.challenge_comment===null||item.challenge_comment===""; return( <div key={key}> @@ -118,38 +114,39 @@ class ShowAppraiseList extends Component{ <div className="font-16 color-dark-21 shixunreporttitleboxtop pd20 color333"> <span className={"appraisebox"}>第{key+1}关</span>{item.name} - {this.props&&this.props.isAdminOrTeacher()===true?<a className="color-blue font-14 fr ml20" + {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.isAdminOrTeacher()===true?<a className="color-blue font-14 fr" + {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.isAdminOrTeacher()===true? - <div className="font-16 color-dark-21 shixunreporttitleboxbom pd30"> + {this.props&&this.props.isAdmin()===true? + <div className="font-16 color-dark-21 shixunreporttitleboxbom pd30bt"> <div> - <span className={"000"}>学生不可见<span className={"666"}>(仅对课堂老师可见)</span></span> + <span className={"z000"}>学生可见<span className={"z666"}>(学生可查看老师的评阅内容)</span></span> </div> - <div className={"borderbom"} style={{minHeight:'50px'}}> - {challenge_comment_hidden===true?"":<div className={"personalsummary"}> + <div className={"borderbom"} style={{minHeight:'40px'}}> + {challenge_comment===true?"":<div className={"personalsummary"}> <div className={"markdown-body"} - dangerouslySetInnerHTML={{__html: markdownToHTML(item.challenge_comment_hidden).replace(/▁/g, "▁▁▁")}}></div> + dangerouslySetInnerHTML={{__html: markdownToHTML(item.challenge_comment).replace(/▁/g, "▁▁▁")}}></div> </div>} </div> + <div> - <span className={"000"}>学生可见<span className={"666"}>(学生可查看老师的评阅内容)</span></span> + <span className={"z000"}>学生不可见<span className={"z666"}>(仅对课堂老师可见)</span></span> </div> - <div style={{minHeight:'50px'}}> - {challenge_comment===true?"":<div className={"personalsummary"}> + <div style={{minHeight:'40px'}}> + {challenge_comment_hidden===true?"":<div className={"personalsummary"}> <div className={"markdown-body"} - dangerouslySetInnerHTML={{__html: markdownToHTML(item.challenge_comment).replace(/▁/g, "▁▁▁")}}></div> + 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:'50px'}}> + <div style={{minHeight:'40px'}}> <div className={"personalsummary"}> <div className={"markdown-body"} dangerouslySetInnerHTML={{__html: markdownToHTML(item.challenge_comment).replace(/▁/g, "▁▁▁")}}></div> diff --git a/public/react/src/modules/courses/shixunHomework/style.css b/public/react/src/modules/courses/shixunHomework/style.css index c2affa32c..c3976515b 100644 --- a/public/react/src/modules/courses/shixunHomework/style.css +++ b/public/react/src/modules/courses/shixunHomework/style.css @@ -53,4 +53,17 @@ } .ysyslxh{ background: #fafafa; +} + +.z666{ + color: #666; + font-size:14px; +} +.z000{ + color: #000; + font-size:16px; +} + +.pd30bt{ + padding: 10px 30px 0px 30px; } \ No newline at end of file From ccb64e8b3f8739d09ca2034124a30dac81905cc0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Mon, 9 Sep 2019 22:39:01 +0800 Subject: [PATCH 66/73] b --- .../courses/coursesPublic/AppraiseModal.js | 3 +- .../shixunHomework/ShixunWorkReport.js | 37 +++++++++++-------- 2 files changed, 22 insertions(+), 18 deletions(-) diff --git a/public/react/src/modules/courses/coursesPublic/AppraiseModal.js b/public/react/src/modules/courses/coursesPublic/AppraiseModal.js index f1ee18bb7..120e57b2b 100644 --- a/public/react/src/modules/courses/coursesPublic/AppraiseModal.js +++ b/public/react/src/modules/courses/coursesPublic/AppraiseModal.js @@ -72,9 +72,8 @@ class AppraiseModal extends Component{ challenge_id:challenge_id }).then((response) => { if(response.data.status===0){ - debugger - this.props.showNotification(response.data.message) this.props.showCancel(comment,hidden_comment,challenge_id,response.data.comment_id) + this.props.showNotification(response.data.message) }else{ this.props.showNotification(response.data.message) } diff --git a/public/react/src/modules/courses/shixunHomework/ShixunWorkReport.js b/public/react/src/modules/courses/shixunHomework/ShixunWorkReport.js index 0f1264865..bb8ccae4a 100644 --- a/public/react/src/modules/courses/shixunHomework/ShixunWorkReport.js +++ b/public/react/src/modules/courses/shixunHomework/ShixunWorkReport.js @@ -216,10 +216,13 @@ class ShixunWorkReport extends Component { } isdeleteModal=(comment_id,visible_comment,type)=>{ + let newcomment_id=comment_id; + let newvisible_comment=visible_comment; + let newtype=type; this.setState({ modalsType: true, modalsTopval:"是否确认删除?", - modalSave: ()=>this.isdeleteModals(comment_id,visible_comment,type), + modalSave: ()=>this.isdeleteModals(newcomment_id,newvisible_comment,newtype), modalCancel:()=>this.hideisdeleteModals(), }) } @@ -278,22 +281,24 @@ class ShixunWorkReport extends Component { 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); + }); + } - 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() { let{data,showAppraiseModaltype,work_comment_hidden,work_comment} =this.state; From e6caa48ff7b91dd0ff00943a9e6df947cac7cbb0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Mon, 9 Sep 2019 22:44:00 +0800 Subject: [PATCH 67/73] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modules/courses/shixunHomework/ShowAppraiseList.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/public/react/src/modules/courses/shixunHomework/ShowAppraiseList.js b/public/react/src/modules/courses/shixunHomework/ShowAppraiseList.js index 1a5b4a136..660c8e796 100644 --- a/public/react/src/modules/courses/shixunHomework/ShowAppraiseList.js +++ b/public/react/src/modules/courses/shixunHomework/ShowAppraiseList.js @@ -16,8 +16,8 @@ class ShowAppraiseList extends Component{ render(){ let {data, work_comment,work_comment_hidden}=this.props; - let work_commenttype=this.props&&this.props.isAdmin()===true?false:work_comment===undefined||work_comment===null||work_comment===""; - let work_comment_hiddentype=this.props&&this.props.isAdmin()===true?false:work_comment===undefined||work_comment===null||work_comment===""; + let work_commenttype=work_comment===undefined||work_comment===null||work_comment===""; + let work_comment_hiddentype=work_comment===undefined||work_comment===null||work_comment===""; return( <div> <style> @@ -104,8 +104,8 @@ class ShowAppraiseList extends Component{ {data===undefined?"":data.stage_list.map((item,key)=>{ - let challenge_comment_hidden=this.props&&this.props.isAdmin()===true?false:item.challenge_comment_hidden===undefined||item.challenge_comment_hidden===null||item.challenge_comment_hidden===""; - let challenge_comment=this.props&&this.props.isAdmin()===true?false:item.challenge_comment===undefined||item.challenge_comment===null||item.challenge_comment===""; + 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}> From a5811981b5d6e3b061fd4a786c8d889fa3c872e8 Mon Sep 17 00:00:00 2001 From: p31729568 <winse.wang@foxmail.com> Date: Tue, 10 Sep 2019 08:36:23 +0800 Subject: [PATCH 68/73] search api modify --- app/views/searchs/index.json.jbuilder | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/views/searchs/index.json.jbuilder b/app/views/searchs/index.json.jbuilder index 5fa0c2744..42c90ae40 100644 --- a/app/views/searchs/index.json.jbuilder +++ b/app/views/searchs/index.json.jbuilder @@ -6,6 +6,9 @@ json.results do 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/>') + + # 去除开头标点符号 + highlights&.[](highlights.keys.first)&.sub!(/^[,。?:;‘’!“”—……、]/, '') json.content highlights end end \ No newline at end of file From c705d92351c928889da7d4afe18fd942ab1c9cb8 Mon Sep 17 00:00:00 2001 From: p31729568 <winse.wang@foxmail.com> Date: Tue, 10 Sep 2019 08:38:32 +0800 Subject: [PATCH 69/73] modify --- app/views/searchs/index.json.jbuilder | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/views/searchs/index.json.jbuilder b/app/views/searchs/index.json.jbuilder index 42c90ae40..e12ebbca8 100644 --- a/app/views/searchs/index.json.jbuilder +++ b/app/views/searchs/index.json.jbuilder @@ -8,7 +8,10 @@ json.results do # json.description highlights.values[0,5].each { |arr| arr.is_a?(Array) ? arr.join('...') : arr }.join('<br/>') # 去除开头标点符号 - highlights&.[](highlights.keys.first)&.sub!(/^[,。?:;‘’!“”—……、]/, '') + reg = /^[,。?:;‘’!“”—……、]/ + highlights[:description]&.first&.sub!(reg, '') + highlights[:content]&.first&.sub!(reg, '') + json.content highlights end end \ No newline at end of file From 3737b438745f533d6c58bd9b40c7c08516058eab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Tue, 10 Sep 2019 10:27:10 +0800 Subject: [PATCH 70/73] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=95=99=E5=B8=88?= =?UTF-8?q?=E7=AE=A1=E7=90=86=E6=9D=83=E9=99=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../react/src/modules/courses/gradinforms/Bullsubdirectory.js | 4 ++-- public/react/src/modules/courses/gradinforms/Eduinforms.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/public/react/src/modules/courses/gradinforms/Bullsubdirectory.js b/public/react/src/modules/courses/gradinforms/Bullsubdirectory.js index ae1ed40de..496423f73 100644 --- a/public/react/src/modules/courses/gradinforms/Bullsubdirectory.js +++ b/public/react/src/modules/courses/gradinforms/Bullsubdirectory.js @@ -241,7 +241,7 @@ class Bullsubdirectory extends Component{ <div> <span className="fr yslbianji" style={{marginRight:"17px"}}> { - this.props.isClassManagement() === true ? + this.props.isAdmin() === true ? (this.props.yslbool===false? <Tooltip placement="bottom" title={<div> 编辑 @@ -256,7 +256,7 @@ class Bullsubdirectory extends Component{ </span> <span className="fr yslbianji" style={{marginRight:"22px"}}> { - this.props.isClassManagement() === true ? + this.props.isAdmin() === true ? (this.props.yslbool===false? <Tooltip placement="bottom" title={<div> 删除 diff --git a/public/react/src/modules/courses/gradinforms/Eduinforms.js b/public/react/src/modules/courses/gradinforms/Eduinforms.js index 32a7c8677..14bcfa11a 100644 --- a/public/react/src/modules/courses/gradinforms/Eduinforms.js +++ b/public/react/src/modules/courses/gradinforms/Eduinforms.js @@ -231,7 +231,7 @@ class Eduinforms extends Component{ <p style={{height: '20px'}}> <span className="font-18 fl color-dark-21">公告栏</span> { - this.props.isClassManagement()===true? + this.props.isAdmin()===true? (this.state.yslbool===false? <li className="btn colorblue font-16 fr bluebkbk pointer" onClick={() => this.bianji(true)}> From 39f0a0bb7c474f5baf8deb239ec0fed44e669d31 Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Tue, 10 Sep 2019 10:49:13 +0800 Subject: [PATCH 71/73] =?UTF-8?q?=E5=85=AC=E5=91=8A=E6=A0=8F=E7=9A=84?= =?UTF-8?q?=E6=9D=83=E9=99=90=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/courses_controller.rb | 7 ++++--- app/controllers/graduation_topics_controller.rb | 4 ++-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/app/controllers/courses_controller.rb b/app/controllers/courses_controller.rb index 2039dbc6f..f6fae91db 100644 --- a/app/controllers/courses_controller.rb +++ b/app/controllers/courses_controller.rb @@ -33,10 +33,11 @@ class CoursesController < ApplicationController before_action :teacher_allowed, only: [:update, :destroy, :settings, :search_teacher_candidate, :transfer_to_course_group, :delete_from_course, :export_member_scores_excel, :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, - :set_course_group, :create_group_by_importing_file, :update_informs, :new_informs, - :update_task_position, :tasks_list, :delete_informs] + :set_course_group, :create_group_by_importing_file, + :update_task_position, :tasks_list] before_action :teacher_or_admin_allowed, only: [:graduation_group_list, :create_graduation_group, :join_graduation_group, :change_course_teacher, :course_group_list, :teacher_application_review, :apply_teachers, :delete_course_teacher] diff --git a/app/controllers/graduation_topics_controller.rb b/app/controllers/graduation_topics_controller.rb index 0242bff21..86d0ab2b5 100644 --- a/app/controllers/graduation_topics_controller.rb +++ b/app/controllers/graduation_topics_controller.rb @@ -109,8 +109,8 @@ class GraduationTopicsController < ApplicationController @attachments = @graduation_topic.attachments left_banner_content = @course.course_modules.search_by_module_type("graduation") if left_banner_content.present? - @left_banner_id = left_banner_content.first.course_second_categories.first.id - @left_banner_name = left_banner_content.first.course_second_categories.first.name + @left_banner_id = left_banner_content.first.id + @left_banner_name = left_banner_content.first.name end end From 3d8e0050eeff9d3d90f6b450c0cb21f65e36b167 Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Tue, 10 Sep 2019 11:08:54 +0800 Subject: [PATCH 72/73] =?UTF-8?q?=E6=AF=95=E8=AE=BE=E9=80=89=E9=A2=98?= =?UTF-8?q?=E7=9A=84=E7=BC=96=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/graduation_topics_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/graduation_topics_controller.rb b/app/controllers/graduation_topics_controller.rb index 86d0ab2b5..0e6135e8c 100644 --- a/app/controllers/graduation_topics_controller.rb +++ b/app/controllers/graduation_topics_controller.rb @@ -110,7 +110,7 @@ class GraduationTopicsController < ApplicationController left_banner_content = @course.course_modules.search_by_module_type("graduation") if left_banner_content.present? @left_banner_id = left_banner_content.first.id - @left_banner_name = left_banner_content.first.name + @left_banner_name = "毕设选题" end end From d782e2acded3434dc3fe61db413e57f719094d71 Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Tue, 10 Sep 2019 11:09:56 +0800 Subject: [PATCH 73/73] configShareForPaths --- public/react/src/App.js | 19 ++--------- public/react/src/common/educoder.js | 2 +- public/react/src/common/util/ShareUtil.js | 33 +++++++++---------- public/react/src/modules/home/shixunsHome.js | 3 +- public/react/src/modules/paths/ShixunPaths.js | 6 +++- 5 files changed, 26 insertions(+), 37 deletions(-) diff --git a/public/react/src/App.js b/public/react/src/App.js index 942316bde..194d8f22f 100644 --- a/public/react/src/App.js +++ b/public/react/src/App.js @@ -37,7 +37,7 @@ import {MuiThemeProvider, createMuiTheme} from 'material-ui/styles'; import history from './history'; -import {SnackbarHOC} from 'educoder' +import {SnackbarHOC, configShareForIndex} from 'educoder' import {initAxiosInterceptors} from './AppConfig' @@ -326,22 +326,7 @@ class App extends Component { }); wx.ready(function () { console.log('wx is ready') - var shareData = { - 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空间 - - - + configShareForIndex() }); wx.error(function (res) { console.log('wx is error') diff --git a/public/react/src/common/educoder.js b/public/react/src/common/educoder.js index 356a2f370..fcd0ba7e4 100644 --- a/public/react/src/common/educoder.js +++ b/public/react/src/common/educoder.js @@ -20,7 +20,7 @@ export { markdownToHTML, uploadNameSizeSeperator, appendFileSizeToUploadFile, ap downloadFile, sortDirections } from './TextUtil' 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' diff --git a/public/react/src/common/util/ShareUtil.js b/public/react/src/common/util/ShareUtil.js index 5b78b42e3..845297899 100644 --- a/public/react/src/common/util/ShareUtil.js +++ b/public/react/src/common/util/ShareUtil.js @@ -1,12 +1,17 @@ const host = window.location.host const wx = window.wx function share(shareData) { - wx.onMenuShareAppMessage(shareData);//分享给好友 - wx.onMenuShareTimeline(shareData);//分享到朋友圈 - wx.onMenuShareQQ(shareData);//分享给手机QQ - wx.onMenuShareWeibo(shareData);//分享腾讯微博 - wx.onMenuShareQZone(shareData);//分享到QQ空间 + try { + wx.onMenuShareAppMessage(shareData);//分享给好友 + wx.onMenuShareTimeline(shareData);//分享到朋友圈 + wx.onMenuShareQQ(shareData);//分享给手机QQ + wx.onMenuShareWeibo(shareData);//分享腾讯微博 + wx.onMenuShareQZone(shareData);//分享到QQ空间 + } catch(e) { + console.log(e) + } } + /** 实践课程 平台提供涵盖基础入门、案例实践和创新应用的完整实训项目体系,通过由浅入深的实训路径,帮助学生快速提升实战能力。 实训项目 覆盖不同专业的IT实验和实训,每周更新,无需配置本机实验环境,随时随地开启企业级真实实训。 @@ -15,6 +20,7 @@ function share(shareData) { */ export function configShareForIndex () { + if (!wx) return; var shareData = { title: 'EduCoder - 首页', desc: 'Educoder是一个面向计算机类的互联网IT教育和实战平台,提供企业级工程实训,以实现工程化专业教学的自动化和智能化。高校和企业人员可以在此开展计算机实践性教学活动,将传统的知识传授和时兴的工程实战一体化。', @@ -25,6 +31,7 @@ export function configShareForIndex () { share(shareData) } export function configShareForPaths () { + if (!wx) return; var shareData = { title: 'EduCoder - 实践课程', desc: '平台提供涵盖基础入门、案例实践和创新应用的完整实训项目体系,通过由浅入深的实训路径,帮助学生快速提升实战能力。', @@ -35,6 +42,7 @@ export function configShareForPaths () { share(shareData) } export function configShareForShixuns () { + if (!wx) return; var shareData = { title: 'EduCoder - 实训项目', desc: '覆盖不同专业的IT实验和实训,每周更新,无需配置本机实验环境,随时随地开启企业级真实实训。', @@ -45,6 +53,7 @@ export function configShareForShixuns () { share(shareData) } export function configShareForCourses () { + if (!wx) return; var shareData = { title: 'EduCoder - 翻转课堂', desc: '自动评测实训任务,支持技能统计,提供教学活动分析报告,减轻教师和助教的辅导压力,免去作业发布和批改的困扰,实时了解学生学习情况,全面提升教师施教效率和水平。', @@ -56,7 +65,8 @@ export function configShareForCourses () { } // detail -export function configShareForSinglePath (title, desc, path, imgUrl) { +export function configShareForCustom (title, desc, path, imgUrl) { + if (!wx) return; var shareData = { title: title, desc: desc, @@ -66,14 +76,3 @@ export function configShareForSinglePath (title, desc, path, imgUrl) { }; 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) -} \ No newline at end of file diff --git a/public/react/src/modules/home/shixunsHome.js b/public/react/src/modules/home/shixunsHome.js index 690baf28b..a60080379 100644 --- a/public/react/src/modules/home/shixunsHome.js +++ b/public/react/src/modules/home/shixunsHome.js @@ -12,7 +12,7 @@ import SiderBar from '../tpm/SiderBar'; import UpgradeModals from '../modals/UpgradeModals'; -import { SnackbarHOC , getImageUrl} from 'educoder'; +import { SnackbarHOC , getImageUrl, configShareForIndex} from 'educoder'; import Slider from '@icedesign/base/lib/slider'; @@ -37,6 +37,7 @@ class ShixunsHome extends Component { } } componentDidMount(){ + configShareForIndex() const upsystem=`/users/system_update.json`; axios.get(upsystem).then((response)=>{ let updata=response.data; diff --git a/public/react/src/modules/paths/ShixunPaths.js b/public/react/src/modules/paths/ShixunPaths.js index 3d20c86eb..c2bc0d869 100644 --- a/public/react/src/modules/paths/ShixunPaths.js +++ b/public/react/src/modules/paths/ShixunPaths.js @@ -1,12 +1,16 @@ import React, { Component } from 'react'; import PathSearch from './ShixunPathSearch.js'; - +import { configShareForPaths } from 'educoder' class ShixunPath extends Component{ constructor(props) { super(props) } + componentDidMount() { + configShareForPaths() + } + render(){ return( <div>