import React, {Component} from 'react'; import { Button, Tabs, Modal } from 'antd'; import TopShixuninformation from './Shixuninformation'; import Configuration from './Configuration'; import LearningSettings from './LearningSettings'; import axios from 'axios'; import './css/TPMsettings.css'; const {TabPane} = Tabs; // 处理整点 半点 export default class TPMsettings extends Component { constructor(props) { super(props) this.state = {} } componentDidMount() { 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) { this.setState({ data: response.data }) if (response.data.shixun.multi_webssh === true) { this.setState({ SelectTheCommandtype: true }) } else { this.setState({ SelectTheCommandtype: false }) } if (response.data.shixun.scope_partment.length > 0) { this.setState({ scopetype: 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 }); } } }).catch((error) => { console.log(error) }); } 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"; } }).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"; } }).catch((error) => { console.log(error) }) } render() { return (
是否确认删除 ?
:关闭后,
用户不能再开始挑战了是否确认关闭 ?