chromesetting
杨树林 5 years ago
commit 423c8eda47

@ -20,7 +20,7 @@ import TPMRepositoryComponent from './TPMRepositoryComponent';
import TPMRepositoryCommits from './shixunchild/Repository/TPMRepositoryCommits';
import TPMsettings from './TPMsettings/oldTPMsettings';
import TPMsettings from './TPMsettings/TPMsettings';
import TPMChallengeComponent from './TPMChallengeContainer';
import TPMPropaedeuticsComponent from './TPMPropaedeuticsComponent';

@ -43,6 +43,7 @@ class Shixuninformation extends Component {
NAME_COUNT: 60,
shixunmemoMDvalue: "",
language: "java",
testscripttiptype:false
}
}
@ -54,6 +55,144 @@ class Shixuninformation extends Component {
})
}
testscripttip=(val)=>{
if(val===0){
this.setState({
testscripttiptype:true
})
}else if(val===1){
this.setState({
testscripttiptype:false
})
}
}
post_apply = () => {
this.setState({
postapplyvisible: true
})
}
sendhideModaly = () => {
this.setState({
postapplyvisible: false,
})
if (this.state.file !== undefined) {
// this.deleteAttachment(this.state.file);
this.setState({
file: undefined,
deleteisnot: true,
language: "",
runtime: "",
run_method: "",
fileList: []
})
} else {
this.setState({
file: undefined,
deleteisnot: true,
language: "",
runtime: "",
run_method: "",
fileList: []
})
}
}
sendsure_apply = () => {
let {language, runtime, run_method} = this.state;
if (!language || language === "") {
// this.props.showNotification(`请填写该镜像是基于什么语言`);
this.setState({
languagewritetype: true
})
return
}
if (!runtime || runtime === "") {
// this.props.showNotification(`请填写该镜像是基于什么语言系统环境`);
this.setState({
systemenvironmenttype: true
})
return;
}
if (!run_method || run_method === "") {
// this.props.showNotification(`请填写该镜像中测试代码运行方式`);
this.setState({
testcoderunmodetype: true
})
return;
}
var attachment_ids = undefined;
if (this.state.fileList) {
attachment_ids = this.state.fileList.map(item => {
return item.response ? item.response.id : item.id
})
}
if (attachment_ids === undefined || attachment_ids.length === 0) {
this.setState({
attachmentidstype: true
})
return;
}
var data = {
language: language,
runtime: runtime,
run_method: run_method,
attachment_id: attachment_ids[0],
}
var url = `/shixuns/apply_shixun_mirror.json`;
axios.post(url, data
).then((response) => {
try {
if (response.data) {
if (this.state.file !== undefined) {
this.setState({
file: undefined,
deleteisnot: true,
language: "",
runtime: "",
run_method: "",
fileList: []
})
} else {
this.setState({
file: undefined,
deleteisnot: true,
language: "",
runtime: "",
run_method: "",
fileList: []
})
}
notification.open(
{
message: '提示',
description:
'提交成功!',
}
)
this.sendhideModaly()
}
} catch (e) {
}
})
}
render() {
console.log(this.props.data)
@ -105,6 +244,8 @@ class Shixuninformation extends Component {
},
}
return (
<div>
<Form>
@ -179,17 +320,26 @@ class Shixuninformation extends Component {
})(
<div className="width100 fl mr20">
<Select placeholder="请选择主类别"
<Select placeholder="请选择主类别" value={this.props.choice_main_type === "" ? undefined : this.props.choice_main_type}
style={{width: 180}}
onChange={this.selectleft}
defaultOpen={false}
onChange={this.props.operateauthority?this.bigClass:""}
// onMouseEnter={this.bigopen}
// onMouseLeave={this.bigopens}
// disabled={this.props.operateauthority?false:true}
// onMouseEnter={operateauthority?this.bigopen:""}
onSelect={this.props.operateauthority?this.bigopens:""}
// open={opers}
optionFilterProp="children"
filterOption={(input, option) =>
option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0
}
>
{
newshixunlist === undefined ? "" : newshixunlist.main_type.map((item, key) => {
this.props.data === undefined ? "" : this.props.data.shixun.main_type.map((item, key) => {
return (
<Option value={item.id} key={key}>
<Tooltip placement="right"
title={item.description === "" ? "无描述" : item.description}>
<Option value={item.id} key={key} >
<Tooltip placement="right" title={item.description=== ""?"无描述":item.description} >
{item.type_name}
</Tooltip>
</Option>
@ -276,9 +426,47 @@ class Shixuninformation extends Component {
)}
<span className="fl ml20 color-blue">
使用自定义脚本
<span className={"color-grey ml10"}>
<span className={"color-grey ml10"} onClick={()=>this.testscripttip(0)}>
<Icon type="exclamation-circle"/>
</span>
<div className="invite-tip clearfix none " id="test_script_tip"
style={{top: '33px', left: '-15px',width: '450px',zIndex: '10',display: this.state.testscripttiptype===true?'block':"none"}}>
<style>
{
`
.top-black-trangle{
right: auto;
left: 0px;
}
`
}
</style>
<span className="top-black-trangle"></span>
<div className="padding20 invitecontent clearfix">
<p className="font-12 edu-txt-left">
使用自定义模板平台无法自动更新脚本请在关卡创建完后手动更新脚本中的必填参<br/>
数和以下2个数组元素<br/>
challengeProgramNames<br/>
sourceClassNames<br/><br/>
示例有2个关卡的实训<br/><br/>
各关卡的待编译文件为<br/>
src/step1/HelloWorld.java<br/>
src/step2/Other.java<br/><br/>
各关卡的编译后生成的执行文件为<br/>
step1.HelloWorld<br/>
step2.Other<br/><br/>
则数组元素更新如下<br/>
challengeProgramNames=("src/step1/<br/>
HelloWorld.java" "src/step2/Other.java")<br/>
sourceClassNames=("step1.HelloWorld<br/>
" "step2.Other")<br/><br/>
其它参数可按实际需求定制
</p>
</div>
<p className="inviteTipbtn with100 fl">
<a onClick={()=>this.testscripttip(1)}>知道了</a>
</p>
</div>
</span>
</Form.Item>

Loading…
Cancel
Save