|
|
|
@ -15,6 +15,7 @@ import axios from 'axios'
|
|
|
|
|
import Modals from '../modals/Modals';
|
|
|
|
|
|
|
|
|
|
import './shixuns/css/TPMBanner.css';
|
|
|
|
|
import types from "../../redux/actions/actionTypes";
|
|
|
|
|
|
|
|
|
|
let $ = window.$;
|
|
|
|
|
|
|
|
|
@ -22,6 +23,8 @@ const Search = Input.Search;
|
|
|
|
|
|
|
|
|
|
const RadioGroup = Radio.Group;
|
|
|
|
|
|
|
|
|
|
const { TextArea } = Input;
|
|
|
|
|
|
|
|
|
|
class TPMBanner extends Component {
|
|
|
|
|
constructor(props) {
|
|
|
|
|
super(props)
|
|
|
|
@ -54,7 +57,9 @@ class TPMBanner extends Component {
|
|
|
|
|
Senttothevcaluetype: false,
|
|
|
|
|
jupyterbool: false,
|
|
|
|
|
openknow:false,
|
|
|
|
|
openshowpublictype:false
|
|
|
|
|
openshowpublictype:false,
|
|
|
|
|
Radiovalue:1,
|
|
|
|
|
TextAreaintshow:false
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -197,13 +202,46 @@ class TPMBanner extends Component {
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
changeTextArea=(e)=>{
|
|
|
|
|
this.setState({
|
|
|
|
|
TextArea:e.target.value
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
addForkvisible = () => {
|
|
|
|
|
let reason;
|
|
|
|
|
switch (this.state.Radiovalue) {
|
|
|
|
|
case 1:
|
|
|
|
|
reason="Shixun";
|
|
|
|
|
break;
|
|
|
|
|
case 2:
|
|
|
|
|
reason="Course";
|
|
|
|
|
break;
|
|
|
|
|
case 3:
|
|
|
|
|
reason="Subject";
|
|
|
|
|
break;
|
|
|
|
|
case 4:
|
|
|
|
|
reason=this.state.TextArea;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(this.state.Radiovalue===4){
|
|
|
|
|
if(this.state.TextArea===null||this.state.TextArea===undefined||this.state.TextArea=== ""){
|
|
|
|
|
this.setState({
|
|
|
|
|
TextAreaintshow:true
|
|
|
|
|
})
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
this.setState({
|
|
|
|
|
Forkvisibletype: true,
|
|
|
|
|
Forkvisibletype:true,
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
let id = this.props.match.params.shixunId;
|
|
|
|
|
let url = "/shixuns/" + id + "/copy.json";
|
|
|
|
|
axios.post(url).then((response) => {
|
|
|
|
|
axios.post(url, {
|
|
|
|
|
reason:reason,
|
|
|
|
|
}).then((response) => {
|
|
|
|
|
if (response.data.status === 401) {
|
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
@ -212,7 +250,7 @@ class TPMBanner extends Component {
|
|
|
|
|
Forkauthentication: false,
|
|
|
|
|
// Forkvisibletype:false
|
|
|
|
|
})
|
|
|
|
|
window.location.href = "/shixuns/" + response.data.shixun + "/challenges";
|
|
|
|
|
// window.location.href = "/shixuns/" + response.data.shixun + "/challenges";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}).catch((error) => {
|
|
|
|
@ -694,17 +732,9 @@ class TPMBanner extends Component {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
showonMouseOver = () => {
|
|
|
|
|
$("#ratePanel").show();
|
|
|
|
|
this.setState({
|
|
|
|
|
showradios: true
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
hideonMouseOut = () => {
|
|
|
|
|
$("#ratePanel").hide();
|
|
|
|
|
onChangeRadiovalue=(e)=>{
|
|
|
|
|
this.setState({
|
|
|
|
|
showradios: false
|
|
|
|
|
Radiovalue:e.target.value
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -1233,9 +1263,34 @@ class TPMBanner extends Component {
|
|
|
|
|
</span>
|
|
|
|
|
</Tooltip>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
{Forkvisible===true?<style>
|
|
|
|
|
{
|
|
|
|
|
`
|
|
|
|
|
.ant-modal-body{
|
|
|
|
|
padding: 10px;
|
|
|
|
|
}
|
|
|
|
|
`
|
|
|
|
|
}
|
|
|
|
|
</style>:""}
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
this.state.TextAreaintshow===true?<style>
|
|
|
|
|
{
|
|
|
|
|
`
|
|
|
|
|
.ant-input:hover {
|
|
|
|
|
border: 1px solid red !important;
|
|
|
|
|
}
|
|
|
|
|
.ant-input:focus {
|
|
|
|
|
border: 1px solid red !important;
|
|
|
|
|
}
|
|
|
|
|
`
|
|
|
|
|
}
|
|
|
|
|
</style>:""
|
|
|
|
|
}
|
|
|
|
|
<Modal
|
|
|
|
|
keyboard={false}
|
|
|
|
|
title="提示"
|
|
|
|
|
title="Fork原因"
|
|
|
|
|
visible={Forkvisible}
|
|
|
|
|
closable={false}
|
|
|
|
|
footer={null}
|
|
|
|
@ -1247,8 +1302,25 @@ class TPMBanner extends Component {
|
|
|
|
|
>
|
|
|
|
|
</Spin> :
|
|
|
|
|
<div>
|
|
|
|
|
<div className="task-popup-content"><p
|
|
|
|
|
className="task-popup-text-center font-16 pb20">复制将在后台执行,平台将为你创建<br/>一个新的同名实训和内容,请问是否继续?</p>
|
|
|
|
|
<div className="task-popup-content">
|
|
|
|
|
<div className={"forkfactors"}>请根据实际情况,填写fork本实训的原因</div>
|
|
|
|
|
<Radio.Group onChange={this.onChangeRadiovalue} value={this.state.Radiovalue} className={"ml20 mt20 mb20"} style={{ width: "100%" }}>
|
|
|
|
|
<Radio style={radioStyle} value={1}>
|
|
|
|
|
实训内容升级
|
|
|
|
|
</Radio>
|
|
|
|
|
<Radio style={radioStyle} value={2}>
|
|
|
|
|
课堂教学使用
|
|
|
|
|
</Radio>
|
|
|
|
|
<Radio style={radioStyle} value={3}>
|
|
|
|
|
实践课程使用
|
|
|
|
|
</Radio>
|
|
|
|
|
<Radio style={radioStyle} value={4}>
|
|
|
|
|
其它原因
|
|
|
|
|
</Radio>
|
|
|
|
|
{this.state.Radiovalue === 4 ?
|
|
|
|
|
<TextArea className={this.state.TextAreaintshow===true?"bor-red mt10":"mt10"} rows={4} style={{ width: '85%', marginLeft: '30px' }} onInput={this.changeTextArea}/>: null}
|
|
|
|
|
{this.state.TextAreaintshow===true?<div className={"color-red ml30"}>不能为空</div>:""}
|
|
|
|
|
</Radio.Group>
|
|
|
|
|
</div>
|
|
|
|
|
<div className="task-popup-submit clearfix">
|
|
|
|
|
<a onClick={this.hideForkvisible} className="task-btn fl">取消</a>
|
|
|
|
|