You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
135 lines
2.8 KiB
135 lines
2.8 KiB
import React, {Component} from 'react';
|
|
|
|
import {
|
|
Button,
|
|
Tabs
|
|
} from 'antd';
|
|
|
|
import TopShixuninformation from './Shixuninformation';
|
|
|
|
import Configuration from './Configuration';
|
|
|
|
import LearningSettings from './LearningSettings';
|
|
|
|
import Bottomsubmit from "../../modals/Bottomsubmit";
|
|
|
|
import moment from 'moment';
|
|
|
|
import axios from 'axios';
|
|
|
|
import './css/TPMsettings.css';
|
|
|
|
import {getImageUrl, toPath, getUrl, appendFileSizeToUploadFileAll, getUploadActionUrl} from 'educoder';
|
|
|
|
|
|
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)
|
|
});
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
render() {
|
|
return (
|
|
<div>
|
|
|
|
<div className="educontent mt30 mb50 edu-back-white padding10-20">
|
|
<Tabs tabBarExtraContent={
|
|
<div className={"mb20"}>
|
|
<Button type="primary" ghost className={"Permanentban"}>
|
|
永久关闭
|
|
</Button>
|
|
<Button type="primary" ghost className={"Permanentban ml20"}>
|
|
删除实训
|
|
</Button>
|
|
</div>
|
|
}>
|
|
<TabPane tab="基本信息" key="1">
|
|
<TopShixuninformation
|
|
{...this.state}
|
|
{...this.props}
|
|
/>
|
|
</TabPane>
|
|
<TabPane tab="权限配置" key="2">
|
|
<Configuration
|
|
{...this.state}
|
|
{...this.props}
|
|
/>
|
|
</TabPane>
|
|
<TabPane tab="学习页面设置" key="3">
|
|
<LearningSettings
|
|
{...this.state}
|
|
{...this.props}
|
|
/>
|
|
</TabPane>
|
|
</Tabs>
|
|
</div>
|
|
|
|
<Bottomsubmit/>
|
|
|
|
</div>
|
|
);
|
|
}
|
|
}
|
|
|
|
|