chromesetting
杨树明 5 years ago
parent e2b252637a
commit 49a4838a6f

@ -1,15 +1,16 @@
import React, {Component} from 'react';
import {
Button,
} from 'antd';
class Bottomsubmit extends Component {
constructor(props) {
super(props)
this.state = {
}
this.state = {}
}
cannelfun=()=>{
cannelfun = () => {
// window.location.href=
this.props.history.replace(this.props.url);
}
@ -30,8 +31,11 @@ class Bottomsubmit extends Component {
</style>
<div className="clearfix bor-bottom-greyE edu-back-white orderingbox newshixunbottombtn">
<div className=" edu-txt-center padding13-30">
<button type="button" className="ant-btn mr20 newshixunmode backgroundFFF" onClick={()=>this.cannelfun()}><span> </span></button>
<button type="button" className="ant-btn newshixunmode mr40 ant-btn-primary" type="primary" htmlType="submit" onClick={()=>this.props.onSubmits()}><span> </span></button>
<button type="button" className="ant-btn mr20 newshixunmode backgroundFFF" onClick={() => this.cannelfun()}>
<span> </span></button>
<Button type="button" className="ant-btn newshixunmode mr40 ant-btn-primary" type="primary"
htmlType="submit" onClick={() => this.props.onSubmits()}
loading={this.props.loadings}><span> </span></Button>
</div>
</div>
</div>
@ -41,7 +45,6 @@ class Bottomsubmit extends Component {
}
export default Bottomsubmit;

@ -11,8 +11,6 @@ import {
Button,
} from 'antd';
// import "antd/dist/antd.css";
import locale from 'antd/lib/date-picker/locale/zh_CN';
import moment from 'moment';
@ -21,8 +19,8 @@ import axios from 'axios';
import './css/TPMsettings.css';
import {getImageUrl, toPath, getUrl, appendFileSizeToUploadFileAll, getUploadActionUrl} from 'educoder';
import {handleDateStrings} from "./oldTPMsettings";
import Bottomsubmit from "../../modals/Bottomsubmit";
const $ = window.$;
@ -34,7 +32,6 @@ let currentValue;
const Option = Select.Option;
const RadioGroup = Radio.Group;
const confirm = Modal.confirm;
function range(start, end) {
const result = [];
@ -61,12 +58,13 @@ export default class Shixuninformation extends Component {
constructor(props) {
super(props)
this.state = {
can_copy:false,
use_scope:0,
opening_time:null,
opentime:false,
oldscope_partment:[],
scope_partment:[]
can_copy: false,
use_scope: 0,
opening_time: null,
opentime: false,
oldscope_partment: [],
scope_partment: [],
loading: false
}
}
@ -74,11 +72,11 @@ export default class Shixuninformation extends Component {
if (this.props.data) {
this.setState({
can_copy: this.props.data && this.props.data.shixun.can_copy === undefined ? false :this.props.data.shixun.can_copy,
use_scope:this.props.data && this.props.data.shixun.use_scope,
can_copy: this.props.data && this.props.data.shixun.can_copy === undefined ? false : this.props.data.shixun.can_copy,
use_scope: this.props.data && this.props.data.shixun.use_scope,
opening_time: this.props.data && this.props.data.shixun.opening_time,
opentime:!this.props.data && this.props.data.shixun.opening_time?false:true,
oldscope_partment:this.props.data&&this.props.data.shixun.scope_partment,
opentime: !this.props.data && this.props.data.shixun.opening_time ? false : true,
oldscope_partment: this.props.data && this.props.data.shixun.scope_partment,
})
}
@ -102,11 +100,11 @@ export default class Shixuninformation extends Component {
if (this.props.data) {
this.setState({
can_copy: this.props.data && this.props.data.shixun.can_copy === undefined ? false :this.props.data.shixun.can_copy,
use_scope:this.props.data && this.props.data.shixun.use_scope,
can_copy: this.props.data && this.props.data.shixun.can_copy === undefined ? false : this.props.data.shixun.can_copy,
use_scope: this.props.data && this.props.data.shixun.use_scope,
opening_time: this.props.data && this.props.data.shixun.opening_time,
opentime:!this.props.data && this.props.data.shixun.opening_time?false:true,
oldscope_partment:this.props.data&&this.props.data.shixun.scope_partment,
opentime: !this.props.data && this.props.data.shixun.opening_time ? false : true,
oldscope_partment: this.props.data && this.props.data.shixun.scope_partment,
})
}
@ -115,75 +113,84 @@ export default class Shixuninformation extends Component {
onChangeTimePicker = (value, dateString) => {
this.setState({
opening_time: dateString === "" ? "" :handleDateStrings(dateString)
opening_time: dateString === "" ? "" : handleDateStrings(dateString)
})
}
onSubmits = () => {
let {can_copy,use_scope,scope_partment,opening_time }=this.state;
this.setState({
loading: true
})
let {can_copy, use_scope, scope_partment, opening_time} = this.state;
let id = this.props.match.params.shixunId;
let url=`/shixuns/${id}/update_permission_setting.json`;
let url = `/shixuns/${id}/update_permission_setting.json`;
axios.post(url,
{
scope_partment:scope_partment,
shixun:{
can_copy: can_copy,
use_scope:use_scope,
opening_time:opening_time
scope_partment: scope_partment,
shixun: {
can_copy: can_copy,
use_scope: use_scope,
opening_time: opening_time
}
}
}
).then((response) => {
if(response.data.status===-1){
if (response.data.status === -1) {
}else{
} else {
this.props.getdatas()
this.props.showNotification("保存成功")
this.props.showNotification("权限配置保存成功!")
this.setState({
loading: false
})
}
}).catch((error) => {
console.log(error)
this.setState({
loading: false
})
})
}
CheckboxonChange=(e)=>{
this.setState({
can_copy:e.target.checked
})
}
SelectOpenpublic=(e)=>{
CheckboxonChange = (e) => {
this.setState({
can_copy: e.target.checked
})
}
SelectOpenpublic = (e) => {
this.setState({
use_scope: e.target.value
});
}
shixunScopeInput = (e) => {
let {scope_partment,oldscope_partment} = this.state;
let {scope_partment, oldscope_partment} = this.state;
let datalist = scope_partment;
if (datalist===undefined) {
datalist=[]
if (datalist === undefined) {
datalist = []
}
datalist.push(e)
let scopetype=false;
let scopetype = false;
scope_partment.map((item,key)=>{
if(item===e){
scopetype=true
scope_partment.map((item, key) => {
if (item === e) {
scopetype = true
}
})
oldscope_partment.map((item,key)=>{
if(item===e){
scopetype=true
oldscope_partment.map((item, key) => {
if (item === e) {
scopetype = true
}
})
if(scopetype===false){
if (scopetype === false) {
this.setState({
scope_partment: datalist
});
}else{
} else {
this.props.showNotification("请勿指定相同的单位")
}
@ -221,11 +228,12 @@ export default class Shixuninformation extends Component {
});
}
setopentime=(e)=>{
setopentime = (e) => {
this.setState({
opentime:e.target.checked
opentime: e.target.checked
})
}
render() {
let options;
@ -253,9 +261,10 @@ 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">
{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">
<RadioGroup onChange={this.SelectOpenpublic} value={this.state.use_scope}>
<Radio className="radioStyle" value={0}><span>对所有单位公开</span> <span
className="color-grey-9">实训发布后所有用户可见</span></Radio>
@ -264,7 +273,7 @@ export default class Shixuninformation extends Component {
</RadioGroup>
<div className="clearfix" id="unit-all"
style={{display:this.state.use_scope === 0 ? 'none' : 'block'}}>
style={{display: this.state.use_scope === 0 ? 'none' : 'block'}}>
<div className="fl ml25">
<div className="fl" id="unit-input-part" style={{width: '100%'}}>
<div id="person-unit" className="fl pr mr10">
@ -292,12 +301,12 @@ export default class Shixuninformation extends Component {
<div style={{width: '100%'}}>
<div className="mt20 clearfix" id="task_tag_content">
{
this.state.oldscope_partment.map((item,key)=>{
this.state.oldscope_partment.map((item, key) => {
return (
<li key={key} className={"fl mr20"}>
<Button type="primary" ghost className={"Permanentban "}>
{item}
</Button>
<Button type="primary" ghost className={"Permanentban "}>
{item}
</Button>
</li>
)
})
@ -307,9 +316,9 @@ export default class Shixuninformation extends Component {
return (
<li key={key} className={"fl mr20"}>
<Badge count={"x"} onClick={(key) => this.deleteScopeInput(key)}>
<Badge count={"x"} onClick={(key) => this.deleteScopeInput(key)}>
<Button type="primary" ghost className={"Permanentban "}>
{item}
{item}
</Button>
</Badge>
</li>
@ -331,31 +340,32 @@ 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>
<span className="fl mt8 ml20">
<Checkbox
checked={this.state.opentime=== undefined ? false : this.state.opentime}
checked={this.state.opentime === undefined ? false : this.state.opentime}
onChange={this.setopentime}></Checkbox>
<label style={{top: '6px'}} className="color-grey-9 ml10">选中则学员在指定的开启时间后才能开启学习不选中则学员在实训发布后能立即开启学习</label>
<label style={{top: '6px'}}
className="color-grey-9 ml10">选中则学员在指定的开启时间后才能开启学习不选中则学员在实训发布后能立即开启学习</label>
<div className={"both"}></div>
{this.state.opentime===false?"":<div className="mt20 ml25">
<DatePicker
showToday={false}
showTime={{format: 'HH:mm'}}
format="YYYY-MM-DD HH:mm"
width={178}
locale={locale}
disabledTime={disabledDateTime}
disabledDate={disabledDate}
placeholder="请输入开启时间"
value={this.state.opening_time === null ||this.state.opening_time === "" ? "" : moment(this.state.opening_time, dateFormat)}
onChange={this.onChangeTimePicker}
dropdownClassName="hideDisable"
/>
</div>}
{this.state.opentime === false ? "" : <div className="mt20 ml25">
<DatePicker
showToday={false}
showTime={{format: 'HH:mm'}}
format="YYYY-MM-DD HH:mm"
width={178}
locale={locale}
disabledTime={disabledDateTime}
disabledDate={disabledDate}
placeholder="请输入开启时间"
value={this.state.opening_time === null || this.state.opening_time === "" ? "" : moment(this.state.opening_time, dateFormat)}
onChange={this.onChangeTimePicker}
dropdownClassName="hideDisable"
/>
</div>}
</span>
</div>
@ -365,7 +375,7 @@ export default class Shixuninformation extends Component {
</div>
{this.props.identity < 5 ?
<Bottomsubmit {...this.props} {...this.state} url={`/shixuns/${this.props.match.params.shixunId}/challenges`}
onSubmits={this.onSubmits}/> : ""}
onSubmits={this.onSubmits} loadings={this.state.loading}/> : ""}
</div>
);
}

@ -1,29 +1,14 @@
import React, {Component} from 'react';
import {
Input,
Select,
Radio,
Checkbox,
Popconfirm,
message,
Modal,
Icon,
DatePicker,
Breadcrumb,
Upload,
Button,
notification,
Tooltip,
Tabs
} from 'antd';
import axios from 'axios';
import './css/TPMsettings.css';
import {getImageUrl, toPath, getUrl, appendFileSizeToUploadFileAll, getUploadActionUrl} from 'educoder';
import Bottomsubmit from "../../modals/Bottomsubmit";
const RadioGroup = Radio.Group;
@ -32,7 +17,19 @@ const RadioGroup = Radio.Group;
export default class Shixuninformation extends Component {
constructor(props) {
super(props)
this.state = {}
this.state = {
vnc: false,
hide_code: false,
is_secret_repository: false,
code_hidden: false,
forbid_copy: false,
test_set_permission: true,
task_pass: true,
websshshow: false,
multi_webssh: false,
opensshRadio: null,
loading: false
}
}
@ -41,27 +38,188 @@ export default class Shixuninformation extends Component {
this.setState({
vnc: this.props.data && this.props.data.shixun.vnc,
use_scope: this.props.data && this.props.data.shixun.use_scope,
opening_time: this.props.data && this.props.data.shixun.opening_time,
opentime: !this.props.data && this.props.data.shixun.opening_time ? false : true,
oldscope_partment: this.props.data && this.props.data.shixun.scope_partment,
code_hidden: this.props.data && this.props.data.shixun.code_hidden,
forbid_copy: this.props.data && this.props.data.shixun.forbid_copy,
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,
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,
})
// if(this.props.data && this.props.data.shixun.status===0){
// this.setState({
// task_pass:true
// })
// }
}
}
componentDidUpdate(prevProps, prevState) {
if (prevProps.data != this.props.data) {
if (this.props.data) {
this.setState({
vnc: this.props.data && this.props.data.shixun.vnc,
code_hidden: this.props.data && this.props.data.shixun.code_hidden,
forbid_copy: this.props.data && this.props.data.shixun.forbid_copy,
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,
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,
})
// if(this.props.data && this.props.data.shixun.status===0){
// this.setState({
// task_pass:true
// })
// }
}
}
let departmentsUrl = `/shixuns/departments.json`;
axios.get(departmentsUrl).then((response) => {
if (response.status === 200) {
if (response.data.message === undefined) {
this.setState({
departmentslist: response.data.shools_name
});
}
}
onSubmits = () => {
this.setState({
loading: true
})
let id = this.props.match.params.shixunId;
let url = `/shixuns/${id}/update_permission_setting.json`;
axios.post(url,
{
shixun: {
code_hidden: this.state.code_hidden,
forbid_copy: this.state.forbid_copy,
hide_code: this.state.hide_code,
multi_webssh: this.state.multi_webssh,
task_pass: this.state.task_pass,
test_set_permission: this.state.test_set_permission,
vnc: this.state.vnc,
webssh: this.state.websshshow === false ? 0 : this.state.opensshRadio,
},
is_secret_repository: this.state.is_secret_repository
}
).then((response) => {
if (response.data.status === -1) {
} else {
this.props.getdatas()
this.props.showNotification("学习页面设置保存成功!")
this.setState({
loading: false
})
}
}).catch((error) => {
console.log(error)
});
this.setState({
loading: false
})
})
}
Checkvnc = () => {
console.log(this.state.vnc)
if (this.state.vnc === false) {
this.setState({
hide_code: false,
is_secret_repository: false,
code_hidden: false,
forbid_copy: false,
multi_webssh: false,
websshshow: false,
})
}
this.setState({
vnc: !this.state.vnc
})
}
Checkhide_code = () => {
if (this.state.hide_code === false) {
this.setState({
is_secret_repository: false
})
}
this.setState({
hide_code: !this.state.hide_code
})
}
Checkis_secret_repository = () => {
this.setState({
is_secret_repository: !this.state.is_secret_repository
})
}
Checkcode_hidden = () => {
this.setState({
code_hidden: !this.state.code_hidden
})
}
Checkforbid_copy = () => {
this.setState({
forbid_copy: !this.state.forbid_copy
})
}
Checktask_pass = () => {
this.setState({
task_pass: !this.state.task_pass
})
}
Checktest_set_permission = () => {
this.setState({
test_set_permission: !this.state.test_set_permission
})
}
Checkwebsshshow = () => {
if (this.state.websshshow === false) {
this.setState({
vnc: false,
opensshRadio: 1
})
} else {
this.setState({
multi_webssh: false,
opensshRadio: null
})
}
this.setState({
websshshow: !this.state.websshshow
})
}
Checkmulti_webssh = () => {
this.setState({
multi_webssh: !this.state.multi_webssh
})
}
opensshRadio = (e) => {
if (e.target.value === 1) {
this.setState({
multi_webssh: false
})
} else {
this.setState({
multi_webssh: true
})
}
this.setState({
opensshRadio: e.target.value
});
}
render() {
console.log(this.props)
@ -69,107 +227,107 @@ export default class Shixuninformation extends Component {
<div>
<div className="educontent mb200 edu-back-white padding10-20 pdb30">
<div className="clearfix mb20">
{this.state.websshshow === true ? "" : <div className="clearfix mb20">
<span className="color-grey-6 mt5 fl font-16" style={{minWidth: '45px'}}>开启图形化界面</span>
<span className="fl mt8">
<Checkbox
checked={this.state.can_copy}
onChange={this.CheckboxonChange}></Checkbox>
checked={this.state.vnc}
onChange={this.Checkvnc}></Checkbox>
<label style={{top: '6px'}} className="color-grey-9 ml10">选中则给学员的实践任务启动Ubuntu系统的图形化界面</label>
</span>
</div>
</div>}
<div className="clearfix mb20">
{this.state.vnc === true ? "" : <div className="clearfix mb20">
<span className="color-grey-6 mt5 fl font-16 ml64" style={{minWidth: '45px'}}>命令行</span>
<span className="fl mt8">
<Checkbox
checked={this.state.can_copy}
onChange={this.CheckboxonChange}></Checkbox>
checked={this.state.websshshow}
onChange={this.Checkwebsshshow}></Checkbox>
<label style={{top: '6px'}} className="color-grey-9 ml10">选中则给学员的实践任务提供命令行窗口</label>
</span>
</div>
</div>}
<div>
{this.state.vnc === true ? "" : this.state.websshshow === true ? <div>
<span className="fl ml160">
<RadioGroup onChange={this.SelectOpenpublic} value={this.state.use_scope}>
<Radio className="radioStyle font-14" value={0}><span>命令行练习窗口</span> <span
<RadioGroup onChange={this.opensshRadio} value={this.state.opensshRadio}>
<Radio className="radioStyle font-14" value={1}><span>命令行练习窗口</span> <span
className="color-grey-9">选中则给学员提供用于练习操作的命令行命令行的操作不会对学生的实验环境造成影响</span></Radio>
<Radio className="radioStyle font-14" value={1}><span>命令行评测窗口</span> <span
<Radio className="radioStyle font-14" value={2}><span>命令行评测窗口</span> <span
className="color-grey-9">选中则给学员提供用于评测操作的命令行命令行的操作可以对学生的实验环境产生影响</span></Radio>
</RadioGroup>
</span>
<span className="fl ml180">
{this.state.opensshRadio === 2 ? <span className="fl ml180">
<div className="clearfix mb20">
<span className="fl mt8 ml5">
<Checkbox
checked={this.state.can_copy}
onChange={this.CheckboxonChange}></Checkbox>
checked={this.state.multi_webssh}
onChange={this.Checkmulti_webssh}></Checkbox>
<label style={{top: '6px'}} className="color-grey-9 ml10">
<span className="color-grey-6 font-14" style={{minWidth: '45px'}}>多个命令行窗口</span>
选中则允许学员同时开启多个命令行窗口</label>
</span>
</div>
</span>
</div>
</span> : ""}
</div> : ""}
<div className="clearfix mb20">
{this.state.vnc === true ? "" : <div className="clearfix mb20">
<span className="color-grey-6 mt5 fl font-16 ml17" style={{minWidth: '45px'}}>隐藏代码窗口</span>
<span className="fl mt8">
<Checkbox
checked={this.state.can_copy}
onChange={this.CheckboxonChange}></Checkbox>
checked={this.state.hide_code}
onChange={this.Checkhide_code}></Checkbox>
<label style={{top: '6px'}} className="color-grey-9 ml10">选中则学员页面不显示代码窗口</label>
</span>
</div>
</div>}
<div className="clearfix mb20">
{this.state.vnc === true || this.state.hide_code === true ? "" : <div className="clearfix mb20">
<span className="color-grey-6 mt5 fl font-16 ml33" style={{minWidth: '45px'}}>公开版本库</span>
<span className="fl mt8">
<Checkbox
checked={this.state.can_copy}
onChange={this.CheckboxonChange}></Checkbox>
checked={this.state.is_secret_repository}
onChange={this.Checkis_secret_repository}></Checkbox>
<label style={{top: '6px'}} className="color-grey-9 ml10">选中则允许学员修改版本库中的全部文件</label>
</span>
</div>
</div>}
<div className="clearfix mb20">
<span className="color-grey-6 mt5 fl font-16 ml20" style={{minWidth: '45px'}}>隐藏代码目录</span>
{this.state.vnc === true ? "" : <div className="clearfix mb20">
<span className="color-grey-6 mt5 fl font-16 ml17" style={{minWidth: '45px'}}>隐藏代码目录</span>
<span className="fl mt8">
<Checkbox
checked={this.state.can_copy}
onChange={this.CheckboxonChange}></Checkbox>
checked={this.state.code_hidden}
onChange={this.Checkcode_hidden}></Checkbox>
<label style={{top: '6px'}} className="color-grey-9 ml10">选中则学员页面不显示版本库目录</label>
</span>
</div>
</div>}
<div className="clearfix mb20">
<span className="color-grey-6 mt5 fl font-16 ml20" style={{minWidth: '45px'}}>禁用复制粘贴</span>
{this.state.vnc === true ? "" : <div className="clearfix mb20">
<span className="color-grey-6 mt5 fl font-16 ml17" style={{minWidth: '45px'}}>禁用复制粘贴</span>
<span className="fl mt8">
<Checkbox
checked={this.state.can_copy}
onChange={this.CheckboxonChange}></Checkbox>
checked={this.state.forbid_copy}
onChange={this.Checkforbid_copy}></Checkbox>
<label style={{top: '6px'}} className="color-grey-9 ml10">选中则学员页面不允许使用复制和粘贴功能</label>
</span>
</div>
</div>}
<div className="clearfix mb20">
<span className="color-grey-6 mt5 fl font-16 ml84" style={{minWidth: '45px'}}>跳关</span>
<span className="color-grey-6 mt5 fl font-16 ml80" style={{minWidth: '45px'}}>跳关</span>
<span className="fl mt8">
<Checkbox
checked={this.state.can_copy}
onChange={this.CheckboxonChange}></Checkbox>
checked={this.state.task_pass}
onChange={this.Checktask_pass}></Checkbox>
<label style={{top: '6px'}} className="color-grey-9 ml10">选中则允许学员跳关学习实训关卡任务</label>
</span>
</div>
<div className="clearfix mb20">
<span className="color-grey-6 mt5 fl font-16 ml36s" style={{minWidth: '45px'}}>测试集解锁</span>
<span className="color-grey-6 mt5 fl font-16 ml32s" style={{minWidth: '45px'}}>测试集解锁</span>
<span className="fl mt8">
<Checkbox
checked={this.state.can_copy}
onChange={this.CheckboxonChange}></Checkbox>
checked={this.state.test_set_permission}
onChange={this.Checktest_set_permission}></Checkbox>
<label style={{top: '6px'}} className="color-grey-9 ml10">选中则允许学员允许学员通过金币解锁查看隐藏测试集的内容</label>
</span>
</div>
@ -179,7 +337,7 @@ export default class Shixuninformation extends Component {
{this.props.identity < 5 ?
<Bottomsubmit {...this.props} {...this.state} url={`/shixuns/${this.props.match.params.shixunId}/challenges`}
onSubmits={this.onSubmits}/> : ""}
onSubmits={this.onSubmits} loadings={this.state.loading}/> : ""}
</div>
);
}

@ -44,7 +44,8 @@ class Shixuninformation extends Component {
Executiveordervalue: "",
Compilecommandvalue: "",
shixun_service_configs: undefined,
fileList:[]
fileList:[],
loading:false
}
}
@ -77,6 +78,10 @@ class Shixuninformation extends Component {
selectscripts:this.props.data.shixun.standard_scripts[0].id
})
this.get_mirror_script(this.props.data.shixun.standard_scripts[0].id)
}else{
this.props.form.setFieldsValue({
selectscripts:this.props.data.shixun.choice_standard_scripts
})
}
let newlist = ""
@ -641,6 +646,9 @@ class Shixuninformation extends Component {
}
onSubmits=()=>{
this.setState({
loading:true
})
const mdContnet = this.contentMdRef.current.getValue().trim();
let{choice_standard_scriptssum,choice_standard_scripts}=this.state;
this.props.form.validateFieldsAndScroll((err, values) => {
@ -675,14 +683,22 @@ class Shixuninformation extends Component {
if (result.data) {
this.props.getdatas()
if(result.data.shixun_identifier){
this.props.showNotification("基本信息更新成功")
this.props.showNotification("基本信息更新成功!")
this.setState({
loading:false
})
}
}
}
}).catch((error) => {
// ////console.log(error)
this.setState({
loading:false
})
});
}else{
this.setState({
loading:false
})
}
});
}
@ -997,7 +1013,8 @@ class Shixuninformation extends Component {
{ this.props.shixunsDetails&&this.props.shixunsDetails.is_jupyter===true?"": <span className="ant-form-text mt20">私密版本库
<Checkbox onChange={this.simionChange}
value={this.state.simichecked}>若需要对学员隐藏部分版本库内容时请选中选中保存后表示启用私密版本库请将需要对学员隐藏的文件存储在私密版本库</Checkbox>
value={this.state.simichecked}>
{this.state.simichecked===false?"(若需要对学员隐藏部分版本库内容时,请选中;选中保存后表示启用私密版本库,请将需要对学员隐藏的文件存储在私密版本库)":"已创建的私密版本库及其内容,将在“保存”时被删除"}</Checkbox>
</span>}
{this.props.identity < 3 ? <div className="edu-back-white padding40-20 mb20">
@ -1064,6 +1081,24 @@ class Shixuninformation extends Component {
}
</style> : ""}
{/*<Modal*/}
{/* keyboard={false}*/}
{/* title="提示"*/}
{/* visible={this.state.simicheckedtype}*/}
{/* closable={false}*/}
{/* footer={null}*/}
{/*>*/}
{/* <div className="task-popup-content">*/}
{/* <p className="task-popup-text-center font-16">已创建的私密版本库及其内容,将在“保存”时被删除</p>*/}
{/* <p className="task-popup-text-center font-16">是否确认取消选择?</p>*/}
{/* </div>*/}
{/* <div className="task-popup-submit clearfix mt10">*/}
{/* <a onClick={() => this.hidesimichecked()} className="task-btn fl">取消</a>*/}
{/* <a className="task-btn task-btn-orange fr" onClick={() => this.getsimichecked()}>确定</a>*/}
{/* </div>*/}
{/*</Modal>*/}
<Modal
keyboard={false}
title="提示"
@ -1082,6 +1117,7 @@ class Shixuninformation extends Component {
</div>
</Modal>
<Modal
keyboard={false}
title="提示"
@ -1215,7 +1251,7 @@ class Shixuninformation extends Component {
</div>
{this.props.identity < 5 ?
<Bottomsubmit {...this.props} {...this.state} url={`/shixuns/${this.props.match.params.shixunId}/challenges`}
onSubmits={this.onSubmits}/> : ""}
onSubmits={this.onSubmits} loadings={this.state.loading} /> : ""}
</div>
);

@ -32,7 +32,7 @@ export default class TPMsettings extends Component {
this.getdatas()
}
getdatas=()=>{
getdatas = () => {
let id = this.props.match.params.shixunId;
let Url = `/shixuns/` + id + `/settings.json`;
@ -113,7 +113,14 @@ export default class TPMsettings extends Component {
render() {
let showtabs= this.props.shixunsDetails === undefined ?"":this.props.shixunsDetails.is_jupyter===true?"":"学习页面设置"
let showtabs = this.props.shixunsDetails === undefined ? "" : this.props.shixunsDetails.is_jupyter === true ? "" : "学习页面设置"
// let a="isvnc";
// let b="isVNC";
// console.log(a.indexOf("vnc"))
// console.log(b.indexOf("vnc"))
console.log( this.props.shixunsDetails === undefined ? "" : this.props.shixunsDetails.is_jupyter === false ? "学习页面设置" : "")
return (
<div>
@ -130,6 +137,9 @@ export default class TPMsettings extends Component {
.ant-tabs-nav{
margin-left:20px;
}
.ant-tabs-nav .ant-tabs-tab {
font-size: 16px;
}
`
}
</style>
@ -161,22 +171,24 @@ export default class TPMsettings extends Component {
<TopShixuninformation
{...this.state}
{...this.props}
getdatas={()=>this.getdatas()}
getdatas={() => this.getdatas()}
/>
</TabPane>
<TabPane tab="权限配置" key="2">
<Configuration
{...this.state}
{...this.props}
getdatas={()=>this.getdatas()}
getdatas={() => this.getdatas()}
/>
</TabPane>
{/*{ this.props.shixunsDetails===undefined?"":this.props.shixunsDetails.is_jupyter===true?"":<TabPane tab={showtabs} key="3">*/}
{/* <LearningSettings*/}
{/* {...this.state}*/}
{/* {...this.props}*/}
{/* />*/}
{/*</TabPane>}*/}
{this.props.shixunsDetails === undefined ? "" : this.props.shixunsDetails.is_jupyter === false ?
<TabPane tab={showtabs} key="3">
<LearningSettings
{...this.state}
{...this.props}
getdatas={() => this.getdatas()}
/>
</TabPane>:"" }
</Tabs>
<Modal
keyboard={false}

@ -136,12 +136,12 @@ a.newuse_scope-btn {
display: inline-block;
}
.ml84{
margin-left:84px;
.ml81{
margin-left:81px;
}
.ml36s{
margin-left: 36px;
.ml32s{
margin-left: 32px;
}
.ml64{

@ -88,6 +88,9 @@ class Newshixuns extends Component {
};
handleSubmit = (e) => {
this.setState({
loading: true
})
const mdContnet = this.contentMdRef.current.getValue().trim();
this.props.form.validateFieldsAndScroll((err, values) => {
if (!err) {
@ -110,17 +113,20 @@ class Newshixuns extends Component {
// window.open("/shixuns/"+response.data.shixun_identifier+"/challenges");
} else {
this.setState({
bottonloading: false
loading: true
})
}
}).catch((error) => {
console.log(error)
this.setState({
bottonloading: false
loading: true
})
})
}else{
this.setState({
loading: true
})
}
});
};
@ -703,7 +709,7 @@ class Newshixuns extends Component {
</div>
</div>
</div>
<Bottomsubmit {...this.props} {...this.state} url={"/shixuns"} onSubmits={() => this.handleSubmit()}/>
<Bottomsubmit {...this.props} {...this.state} url={"/shixuns"} onSubmits={() => this.handleSubmit()} loadings={this.state.loading}/>
</div>
);

Loading…
Cancel
Save