import React, {Component} from 'react'; import { Button, Tabs, Modal } from 'antd'; import './css/TPMsettings.css'; import TopShixuninformation from './Shixuninformation'; import Configuration from './Configuration'; import LearningSettings from './LearningSettings'; import axios from 'axios'; const {TabPane} = Tabs; // 处理整点 半点 export default class TPMsettings extends Component { constructor(props) { super(props) this.state = { activeKeys:"1" } } componentDidMount() { this.getdatas("1") } getdatas = (key) => { let id = this.props.match.params.shixunId; let Url = `/shixuns/` + id + `/settings.json`; axios.get(Url).then((response) => { // alert(response.data.shixun.choice_standard_scripts) if (response.status === 200) { if(response.data){ if (response.data.shixun&&response.data.shixun.scope_partment.length > 0) { this.setState({ scopetype: true }) } } this.setState({ data: response.data }) } }); if(key==="3"&&this.props.shixunsDetails&&this.props.shixunsDetails.is_jupyter === true){ window.location.href =`/shixuns/${this.props.match.params.shixunId}/challenges`; }else{ if(key){ this.setState({ activeKeys:key }) }else{ window.location.href =`/shixuns/${this.props.match.params.shixunId}/challenges`; } } } operateshixuns = (value) => { this.setState({ operateshixunstype: true, delType: value }) } hideoperateshixuns = () => { this.setState({ operateshixunstype: false }) } shixunsdel = () => { let id = this.props.match.params.shixunId; let cul = `/shixuns/` + id + `.json`; axios.delete(cul).then((response) => { if (response.data.status === 1) { this.props.showSnackbar("操作成功"); this.setState({ operateshixunstype: false, }); window.location.href = "/shixuns"; // this.props.history.replace( "/shixuns/"); } }).catch((error) => { console.log(error) }) } shixunsclose = () => { let id = this.props.match.params.shixunId; let cul = `/shixuns/` + id + `/close.json`; axios.post(cul).then((response) => { if (response.data.status === 1) { this.props.showSnackbar("操作成功"); this.setState({ operateshixunstype: false, }); window.location.href = "/shixuns/" + id + "/challenges"; // this.props.history.replace( "/shixuns/" + id + "/challenges"); } }).catch((error) => { console.log(error) }) } callback = (key) => { this.setState({ activeKeys:key }) } render() { let showtabs = this.props.shixunsDetails === undefined ? "" : this.props.shixunsDetails&&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 (
{ this.props.identity < 5 && this.state.data && this.state.data.shixun.status == 0 ? : "" } { this.props.identity == 1 && this.state.data && this.state.data.shixun.status == 2 ? : "" } { this.props.identity === 1 && this.state.data && this.state.data.shixun.status == 2 ? : "" }
}> this.getdatas(key)} /> this.getdatas(key)} /> {this.props.shixunsDetails === undefined ? "" : this.props.shixunsDetails&&this.props.shixunsDetails.is_jupyter === false ? this.getdatas(key)} /> :"" }
{this.state.delType === 1 ?

是否确认删除 ?

:

关闭后,
用户不能再开始挑战了是否确认关闭 ?

}
取消 {this.state.delType === 1 ? 确定 : 确定}
); } }