chromesetting
杨树明 5 years ago
parent b29eb4d619
commit 656a591afe

@ -46,7 +46,9 @@ class Shixuninformation extends Component {
testscripttiptype:false,
shixunName:'',
trainee:undefined,
choice_small_type:[]
choice_small_type:[],
simichecked:false,
}
}
@ -56,7 +58,6 @@ class Shixuninformation extends Component {
componentDidUpdate(prevProps, prevState) {
if(prevProps.data!=this.props.data){
console.log(this.props.data)
if(this.props.data){
this.setState({
shixunName:this.props.data.shixun.name,
@ -65,6 +66,7 @@ class Shixuninformation extends Component {
choice_small_type:this.props.data.shixun.choice_small_type,
choice_standard_scripts:this.props.data.shixun.choice_standard_scripts,
shixunmemoMDvalue:this.props.data.shixun.evaluate_script,
simichecked:this.props.data.shixun.is_secret_repository,
})
this.props.form.setFieldsValue({
@ -312,15 +314,56 @@ class Shixuninformation extends Component {
})
}
SelectScput = (value, e) => {
this.setState({
choice_standard_scriptssum: value,
language:e.props.name,
choice_standard_scripts: {id:e.props.value,value:""},
standard_scriptsModal:true
})
}
hidestandard_scriptsModal=()=>{
this.setState({
standard_scriptsModal:false,
standard_scriptsModals:false
})
}
get_mirror_script=()=>{
let {choice_standard_scriptssum}=this.state;
let id = this.props.match.params.shixunId;
let pul = "/shixuns/" + id + "/get_script_contents.json?script_id=" + choice_standard_scriptssum;
axios.get(pul).then((response) => {
if(response.status===200){
// this.evaluate_scriptMD(response.data.content, "shixunmemoMD");
this.setState({
standard_scriptsModal:false,
standard_scriptsModals:true,
shixunmemoMDvalue:response.data.content
})
}
}).catch((error) => {
console.log(error)
})
}
simionChange=(e)=>{
this.setState({
simichecked:e.target.checked
})
}
render() {
let operateauthority=this.props.identity===1?true:this.props.identity<5&&this.props.data.shixun.status==0?true:false;
console.log(operateauthority)
// console.log(operateauthority)
const {getFieldDecorator} = this.props.form;
const {languagewrite, systemenvironment, testcoderunmode, fileList, choice_standard_scripts, postapplyvisible, shixunmemoMDvalue} = this.state;
console.log("1222")
console.log(choice_standard_scripts)
// console.log("1222")
// console.log(choice_standard_scripts)
const {shixun_service_configs}=this.props;
const uploadProps = {
width: 600,
@ -621,7 +664,7 @@ class Shixuninformation extends Component {
<span className="ant-form-text mt20" >私密版本库
<Checkbox>若需要对学员隐藏部分版本库内容时请选中选中即启用私密版本库请将需要对学员隐藏的文件存储在私密版本库</Checkbox>
<Checkbox onChange={this.simionChange} value={this.state.simichecked}>若需要对学员隐藏部分版本库内容时请选中选中即启用私密版本库请将需要对学员隐藏的文件存储在私密版本库</Checkbox>
</span>
{this.props.identity<3?<div className="edu-back-white padding40-20 mb20">
@ -686,6 +729,38 @@ class Shixuninformation extends Component {
}
</style> : ""}
<Modal
keyboard={false}
title="提示"
visible={this.state.standard_scriptsModal}
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.hidestandard_scriptsModal()} className="task-btn fl">取消</a>
<a className="task-btn task-btn-orange fr" onClick={()=>this.get_mirror_script()}>确定</a>
</div>
</Modal>
<Modal
keyboard={false}
title="提示"
visible={this.state.standard_scriptsModals}
closable={false}
footer={null}
>
<div className="task-popup-content"><p className="task-popup-text-center font-16">评测脚本生成成功</p></div>
<div className="task-popup-sure clearfix">
<a className="task-btn task-btn-orange" onClick={()=>this.hidestandard_scriptsModal()} >确定</a>
</div>
</Modal>
<Modal
keyboard={false}
title="申请新建"

Loading…
Cancel
Save