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

chromesetting
daiao 5 years ago
commit 94c8c89478

@ -529,7 +529,7 @@ class StudentWorksController < ApplicationController
@echart_data = student_efficiency(@homework, @work)
@myself_eff = @echart_data[:efficiency_list].find { |item| item.last == @user.id }
@myself_consume = @echart_data[:consume_list].find { |item| item.last == @user.id }
filename_ = "#{@use&.student_id}_#{@use&.real_name}_#{@shixun&.name}_#{Time.now.strftime('%Y%m%d_%H%M%S')}.pdf"
filename_ = "#{@user&.student_id}_#{@user&.real_name}_#{@shixun&.name}_#{Time.now.strftime('%Y%m%d_%H%M%S')}.pdf"
filename = filename_.strip.tr("+/", "-_")
stylesheets = %w(shixun_work/shixun_work.css shared/codemirror.css)
if params[:export].present? && params[:export]

@ -38,6 +38,7 @@ class ShixunSearchService < ApplicationService
@shixuns = @shixuns.where(trainee: params[:diff])
end
Rails.logger.info("search_shixun_ids: #{@shixuns.pluck(:id)}")
Shixun.search(keyword, search_options)
end

@ -31,6 +31,9 @@ render() {
}
.ant-modal-body {
padding: 20px 40px;
}
.color848282{
color:#848282;
}
`
}
@ -38,8 +41,9 @@ render() {
<Spin indicator={antIcons} spinning={this.props.antIcon===undefined?false:this.props.antIcon} >
<div className="task-popup-content">
<p className="task-popup-text-center font-16">{this.props.modalsTopval}</p>
{this.props.modalsMidval===undefined?"":<p className="task-popup-text-center font-16 mt5">{this.props.modalsMidval}</p>}
<p className="task-popup-text-center font-16 mt5">{this.props.modalsBottomval}</p>
{this.props.modalsMidval===undefined?"":<p className={this.props.modalstyles?"task-popup-text-center font-16 mt5 color848282":"task-popup-text-center font-16 mt5"}>{this.props.modalsMidval}</p>}
<p className={this.props.modalstyles?"task-popup-text-center font-16 mt5 color848282":"task-popup-text-center font-16 mt5"}
>{this.props.modalsBottomval}</p>
{this.props.loadtype===true?
<div className="clearfix edu-txt-center mt20">
<a className="task-btn task-btn-orange pop_close" onClick={this.props.modalSave}>知道啦</a>

@ -347,6 +347,7 @@ class TPMBanner extends Component {
Modalstopval: "",
modalsMidval:undefined,
ModalsBottomval:"",
modalstyles:"",
})
}
ModalSave = () => {
@ -368,15 +369,29 @@ class TPMBanner extends Component {
ModalsBottomval:"卡,学员需要重新体验课程",
ModalCancel: this.ModalCancel,
ModalSave: this.ModalSave,
modalstyles:"848282"
})
}
ModalSaveopenpublic= () => {
this.setState({
Modalstype: true,
Modalstopval: "公开申请已提交,请等待管理员的审核",
modalsMidval:"• 我们将在1-2个工作日内完成审核",
ModalCancel: this.eopenpublicupdatadata,
ModalSave: this.eopenpublicupdatadata,
modalstyles:"848282"
})
}
eopenpublicupdatadata=()=>{
window.location.reload()
}
openpublic=()=>{
let id = this.props.match.params.shixunId;
let url = `/shixuns/${id}/apply_public.json`;
axios.get(url).then((response) => {
if(response.data.status===0){
window.location.reload()
this.ModalSaveopenpublic()
}
}).catch((error) => {
console.log(error)
@ -791,6 +806,7 @@ class TPMBanner extends Component {
modalsBottomval={this.state.ModalsBottomval}
modalsMidval={this.state.modalsMidval}
loadtype={this.state.Loadtype}
modalstyles={this.state.modalstyles}
/> : ""}
<div className="educontent clearfix">
@ -1208,7 +1224,7 @@ class TPMBanner extends Component {
{this.props.identity < 8 && shixunsDetails.shixun_status != -1 && shixunsDetails.shixun_status != 0?
<div className="fr user_default_btn user_blue_btn mr20"
<div className="fr kaike kkbth mr20"
style={{display: shixunsDetails.can_copy === false || shixunsDetails.can_copy === null ? "none" : "flex"}}>
<Tooltip placement="bottom" title={"基于这个实训修改形成新的实训"}>
<span className="flex1 edu-txt-center fl font-18"
@ -1262,7 +1278,7 @@ class TPMBanner extends Component {
</div>
</Modal>
{!!shixunsDetails.fork_num &&
<Link to={"/shixuns/" + shixunId + "/fork_list"} className="forkNum" data-tip-down="Fork实训列表">
<Link to={"/shixuns/" + shixunId + "/fork_list"} className="forkNumst" data-tip-down="Fork实训列表">
{shixunsDetails.fork_num}
</Link>
}

@ -115,14 +115,13 @@ export default class Shixuninformation extends Component {
onChangeTimePicker = (value, dateString) => {
this.setState({
opening_time: dateString === "" ? "" : handleDateStrings(dateString),
opening_timetype:false
opening_timetype:false,
loading: false
})
}
onSubmits = () => {
this.setState({
loading: true
})
let {can_copy, use_scope, scope_partment, opening_time,oldscope_partment} = this.state;
if(this.state.opentime===true){
if(opening_time===null){
@ -133,12 +132,23 @@ export default class Shixuninformation extends Component {
return
}
}
let list=[]
scope_partment.map((item,key)=>{
list.push(item)
})
oldscope_partment.map((item,key)=>{
list.push(item)
})
let id = this.props.match.params.shixunId;
let url = `/shixuns/${id}/update_permission_setting.json`;
this.setState({
loading: true
})
axios.post(url,
{
scope_partment: scope_partment,
scope_partment: list,
shixun: {
can_copy: can_copy,
use_scope: use_scope,
@ -149,16 +159,6 @@ export default class Shixuninformation extends Component {
if (response.data.status === -1) {
} else {
let list=[]
scope_partment.map((item,key)=>{
list.push(item)
})
oldscope_partment.map((item,key)=>{
list.push(item)
})
this.props.showNotification("权限配置保存成功!")
this.setState({
loading: false,
@ -173,7 +173,9 @@ export default class Shixuninformation extends Component {
})
})
this.setState({
loading: false
})
}
CheckboxonChange = (e) => {
this.setState({
@ -292,7 +294,6 @@ export default class Shixuninformation extends Component {
</div>
<div className="edu-back-white mb10 ml30 mt20">
{this.props.data && this.props.data.shixun.use_scope === 0 && this.props.data && this.props.data.shixun.status === 2 ? "" :
<div>
<span className="color-grey-6 mt5 fl font-16" style={{minWidth: '45px'}}>公开程度:</span>
<span className="fl mt8 ml20">
@ -371,7 +372,7 @@ export default class Shixuninformation extends Component {
</span>
</div>}
</div>
<div className="clearfix mt20">
<span className="color-grey-6 mt5 fl font-16" style={{minWidth: '45px'}}>开启时间:</span>

@ -20,7 +20,7 @@ export default class Shixuninformation extends Component {
this.state = {
vnc: false,
hide_code: false,
is_secret_repository: false,
code_edit_permission: false,
code_hidden: false,
forbid_copy: false,
test_set_permission: true,
@ -43,7 +43,7 @@ export default class Shixuninformation extends Component {
hide_code: this.props.data && this.props.data.shixun.hide_code,
task_pass: this.props.data && this.props.data.shixun.task_pass,
test_set_permission: this.props.data && this.props.data.shixun.test_set_permission,
is_secret_repository: this.props.data && this.props.data.shixun.is_secret_repository,
code_edit_permission: this.props.data && this.props.data.shixun.code_edit_permission,
websshshow: this.props.data && this.props.data.shixun.webssh === 0 ? false : true,
multi_webssh: this.props.data && this.props.data.shixun.multi_webssh,
opensshRadio: this.props.data && this.props.data.shixun.webssh === 0 ? null : this.props.data && this.props.data.shixun.webssh,
@ -71,7 +71,7 @@ export default class Shixuninformation extends Component {
hide_code: this.props.data && this.props.data.shixun.hide_code,
task_pass: this.props.data && this.props.data.shixun.task_pass,
test_set_permission: this.props.data && this.props.data.shixun.test_set_permission,
is_secret_repository: this.props.data && this.props.data.shixun.is_secret_repository,
code_edit_permission: this.props.data && this.props.data.shixun.code_edit_permission,
websshshow: this.props.data && this.props.data.shixun.webssh === 0 ? false : true,
multi_webssh: this.props.data && this.props.data.shixun.multi_webssh,
opensshRadio: this.props.data && this.props.data.shixun.webssh === 0 ? null : this.props.data && this.props.data.shixun.webssh,
@ -106,7 +106,7 @@ export default class Shixuninformation extends Component {
test_set_permission: this.state.test_set_permission,
vnc: this.state.vnc,
webssh: this.state.websshshow === false ? 0 : this.state.opensshRadio,
code_edit_permission:this.state.is_secret_repository
code_edit_permission:this.state.code_edit_permission
},
}
).then((response) => {
@ -131,7 +131,7 @@ export default class Shixuninformation extends Component {
if (this.state.vnc === false) {
this.setState({
hide_code: false,
is_secret_repository: false,
code_edit_permission: false,
code_hidden: false,
forbid_copy: false,
multi_webssh: false,
@ -146,7 +146,7 @@ export default class Shixuninformation extends Component {
Checkhide_code = () => {
if (this.state.hide_code === false) {
this.setState({
is_secret_repository: false
code_edit_permission: false
})
}
this.setState({
@ -156,7 +156,7 @@ export default class Shixuninformation extends Component {
Checkis_secret_repository = () => {
this.setState({
is_secret_repository: !this.state.is_secret_repository
code_edit_permission: !this.state.code_edit_permission
})
}
@ -289,7 +289,7 @@ export default class Shixuninformation extends Component {
<span className="color-grey-6 mt5 fl font-16 ml33" style={{minWidth: '45px'}}>公开版本库</span>
<span className="fl mt8">
<Checkbox
checked={this.state.is_secret_repository}
checked={this.state.code_edit_permission}
onChange={this.Checkis_secret_repository}></Checkbox>
<label style={{top: '6px'}} className="color-grey-9 ml10">选中则允许学员修改版本库中的全部文件</label>
</span>

@ -634,7 +634,7 @@ class Collaborators extends Component {
<p className="color-grey-B2 font-12 mb10 sortinxdirection mt14">
<p className="yslwushiwidth90 sortinxdirection">
<p className="mr20 font-16 w70">{item.user.identity}</p>
<p className={item.user.identity===null||item.user.identity===undefined||item.user.identity===""?" font-16 ":"mr20 font-16 w70"}>{item.user.identity}</p>
<p className={item.user.school_name===null||item.user.school_name===""?"":"mr40 font-16 maxnamewidth150"}>{item.user.school_name}</p>
<p className="fabushixunwidth">发布实训项目&nbsp;&nbsp;<span className="fabushixunwidthcolor ml2">{item.user.user_shixuns_count}</span></p>
</p>

@ -156,3 +156,4 @@ a:active{text-decoration:none;}
box-sizing: border-box;
color: #ffffff !important;
}
.forkNumst{display: block;float: left;width: 36px;text-align: center;border-left: 1px solid #ffffff !important;color: #ffffff!important; }

Loading…
Cancel
Save