|
|
|
@ -4,34 +4,20 @@ import {TPMIndexHOC} from '../TPMIndexHOC';
|
|
|
|
|
|
|
|
|
|
import {SnackbarHOC} from 'educoder';
|
|
|
|
|
|
|
|
|
|
import {Select, Radio, Input, Modal, Button, Form, Tooltip, Upload,Icon} from 'antd';
|
|
|
|
|
|
|
|
|
|
import locale from 'antd/lib/date-picker/locale/zh_CN';
|
|
|
|
|
import {Select, Radio, Input, Modal, Button, Form, Tooltip, Upload, Icon} from 'antd';
|
|
|
|
|
|
|
|
|
|
import axios from 'axios';
|
|
|
|
|
|
|
|
|
|
import {getUrl,getUploadActionUrl} from 'educoder';
|
|
|
|
|
|
|
|
|
|
import moment from 'moment';
|
|
|
|
|
import {getUploadActionUrl} from 'educoder';
|
|
|
|
|
|
|
|
|
|
import './css/Newshixuns.css';
|
|
|
|
|
|
|
|
|
|
import TPMMDEditor from "../challengesnew/TPMMDEditor";
|
|
|
|
|
|
|
|
|
|
let path = getUrl("/editormd/lib/");
|
|
|
|
|
|
|
|
|
|
const $ = window.$;
|
|
|
|
|
|
|
|
|
|
let timeout;
|
|
|
|
|
|
|
|
|
|
let currentValue;
|
|
|
|
|
import Bottomsubmit from "../../modals/Bottomsubmit";
|
|
|
|
|
|
|
|
|
|
const Option = Select.Option;
|
|
|
|
|
|
|
|
|
|
const RadioGroup = Radio.Group;
|
|
|
|
|
|
|
|
|
|
const confirm = Modal.confirm;
|
|
|
|
|
|
|
|
|
|
class Newshixuns extends Component {
|
|
|
|
|
constructor(props) {
|
|
|
|
|
super(props)
|
|
|
|
@ -39,20 +25,21 @@ class Newshixuns extends Component {
|
|
|
|
|
this.state = {
|
|
|
|
|
shixunName: undefined,
|
|
|
|
|
NAME_COUNT: 60,
|
|
|
|
|
Radiovalue: "1",
|
|
|
|
|
is_jupyter: "1",
|
|
|
|
|
newshixunlist: undefined,
|
|
|
|
|
languagewrite:undefined,
|
|
|
|
|
systemenvironment:undefined,
|
|
|
|
|
testcoderunmode:undefined,
|
|
|
|
|
postapplyvisible:undefined
|
|
|
|
|
language: undefined,
|
|
|
|
|
runtime: undefined,
|
|
|
|
|
run_method: undefined,
|
|
|
|
|
postapplyvisible: undefined,
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
componentDidMount() {
|
|
|
|
|
this.props.form.setFieldsValue({
|
|
|
|
|
radiogroup: `1`,
|
|
|
|
|
is_jupyter: `1`,
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
let newshixunUrl = `/shixuns/new.json`;
|
|
|
|
|
axios.get(newshixunUrl).then((response) => {
|
|
|
|
|
if (response.status === 200) {
|
|
|
|
@ -60,10 +47,8 @@ class Newshixuns extends Component {
|
|
|
|
|
this.setState({
|
|
|
|
|
newshixunlist: response.data
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
this.contentMdRef.current.setValue(!response.data.sample[0][1] ? "" : response.data.sample[0][1]);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}).catch((error) => {
|
|
|
|
|
console.log(error)
|
|
|
|
@ -82,7 +67,7 @@ class Newshixuns extends Component {
|
|
|
|
|
console.log(error)
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
// const mdContnet = this.contentMdRef.current.getValue().trim();
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
shixunNameInput = (e) => {
|
|
|
|
@ -101,11 +86,42 @@ class Newshixuns extends Component {
|
|
|
|
|
});
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
handleSubmit = e => {
|
|
|
|
|
e.preventDefault();
|
|
|
|
|
handleSubmit = (e) => {
|
|
|
|
|
const mdContnet = this.contentMdRef.current.getValue().trim();
|
|
|
|
|
this.props.form.validateFieldsAndScroll((err, values) => {
|
|
|
|
|
if (!err) {
|
|
|
|
|
console.log('Received values of form: ', values);
|
|
|
|
|
|
|
|
|
|
let Url = `/shixuns.json`;
|
|
|
|
|
axios.post(Url, {
|
|
|
|
|
description: mdContnet,
|
|
|
|
|
main_type: values.main_type,
|
|
|
|
|
is_jupyter: values.is_jupyter === "2" ? true : false,
|
|
|
|
|
sub_type: values.sub_type,
|
|
|
|
|
shixun: {
|
|
|
|
|
name: values.name,
|
|
|
|
|
trainee: values.select,
|
|
|
|
|
task_pass: 1
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
).then((response) => {
|
|
|
|
|
if (response.status === 200) {
|
|
|
|
|
debugger
|
|
|
|
|
window.location.href = "/shixuns/" + response.data.shixun_identifier + "/challenges";
|
|
|
|
|
// window.open("/shixuns/"+response.data.shixun_identifier+"/challenges");
|
|
|
|
|
} else {
|
|
|
|
|
this.setState({
|
|
|
|
|
bottonloading: false
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
}).catch((error) => {
|
|
|
|
|
console.log(error)
|
|
|
|
|
this.setState({
|
|
|
|
|
bottonloading: false
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
};
|
|
|
|
@ -115,16 +131,28 @@ class Newshixuns extends Component {
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
selectleft = (value) => {
|
|
|
|
|
main_type = (value, e) => {
|
|
|
|
|
this.props.form.setFieldsValue({
|
|
|
|
|
selectleft: value,
|
|
|
|
|
main_type: value,
|
|
|
|
|
});
|
|
|
|
|
this.setState({
|
|
|
|
|
mainvalues: e.props.name
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
selectright=(value)=>{
|
|
|
|
|
sub_type = (value, e) => {
|
|
|
|
|
this.props.form.setFieldsValue({
|
|
|
|
|
selectright: value,
|
|
|
|
|
sub_type: value,
|
|
|
|
|
});
|
|
|
|
|
let newlist = ""
|
|
|
|
|
e.map((item, key) => {
|
|
|
|
|
if(item.props.name!=""){
|
|
|
|
|
newlist = newlist + `${item.props.name}`
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
this.setState({
|
|
|
|
|
subvalues: newlist
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
post_apply = () => {
|
|
|
|
@ -134,132 +162,106 @@ class Newshixuns extends Component {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
sendhideModaly = () => {
|
|
|
|
|
this.setState({
|
|
|
|
|
postapplyvisible: false,
|
|
|
|
|
})
|
|
|
|
|
if(this.state.file !== undefined){
|
|
|
|
|
console.log("580");
|
|
|
|
|
if (this.state.file !== undefined) {
|
|
|
|
|
// this.deleteAttachment(this.state.file);
|
|
|
|
|
this.setState({
|
|
|
|
|
file:undefined,
|
|
|
|
|
deleteisnot:true,
|
|
|
|
|
languagewrite:"",
|
|
|
|
|
systemenvironment:"",
|
|
|
|
|
testcoderunmode:"",
|
|
|
|
|
fileList:[]
|
|
|
|
|
file: undefined,
|
|
|
|
|
deleteisnot: true,
|
|
|
|
|
language: "",
|
|
|
|
|
runtime: "",
|
|
|
|
|
run_method: "",
|
|
|
|
|
fileList: []
|
|
|
|
|
})
|
|
|
|
|
}else {
|
|
|
|
|
} else {
|
|
|
|
|
this.setState({
|
|
|
|
|
file:undefined,
|
|
|
|
|
deleteisnot:true,
|
|
|
|
|
languagewrite:"",
|
|
|
|
|
systemenvironment:"",
|
|
|
|
|
testcoderunmode:"",
|
|
|
|
|
fileList:[]
|
|
|
|
|
file: undefined,
|
|
|
|
|
deleteisnot: true,
|
|
|
|
|
language: "",
|
|
|
|
|
runtime: "",
|
|
|
|
|
run_method: "",
|
|
|
|
|
fileList: []
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
sendsure_apply = () => {
|
|
|
|
|
let {languagewrite,systemenvironment,testcoderunmode} = this.state;
|
|
|
|
|
// console.log("点击确定")
|
|
|
|
|
// console.log("languagewrite"+languagewrite);
|
|
|
|
|
// console.log("systemenvironment"+systemenvironment);
|
|
|
|
|
// console.log("testcoderunmode"+testcoderunmode);
|
|
|
|
|
|
|
|
|
|
// let attachment_ids = undefined
|
|
|
|
|
// if (this.state.fileList) {
|
|
|
|
|
// attachment_ids = this.state.fileList.map(item => {
|
|
|
|
|
// return item.response ? item.response.id : item.id
|
|
|
|
|
// })
|
|
|
|
|
// }
|
|
|
|
|
if(languagewrite === undefined || languagewrite === "" ){
|
|
|
|
|
let {language, runtime, run_method} = this.state;
|
|
|
|
|
|
|
|
|
|
if (!language || language === "") {
|
|
|
|
|
// this.props.showNotification(`请填写该镜像是基于什么语言`);
|
|
|
|
|
this.setState({
|
|
|
|
|
languagewritetype:true
|
|
|
|
|
languagewritetype: true
|
|
|
|
|
})
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
if(systemenvironment === undefined || systemenvironment === ""){
|
|
|
|
|
if (!runtime || runtime === "") {
|
|
|
|
|
// this.props.showNotification(`请填写该镜像是基于什么语言系统环境`);
|
|
|
|
|
this.setState({
|
|
|
|
|
systemenvironmenttype:true
|
|
|
|
|
systemenvironmenttype: true
|
|
|
|
|
})
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
if(testcoderunmode === undefined || testcoderunmode === "") {
|
|
|
|
|
if (!run_method || run_method === "") {
|
|
|
|
|
// this.props.showNotification(`请填写该镜像中测试代码运行方式`);
|
|
|
|
|
this.setState({
|
|
|
|
|
testcoderunmodetype:true
|
|
|
|
|
testcoderunmodetype: true
|
|
|
|
|
})
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
var attachment_ids=undefined;
|
|
|
|
|
|
|
|
|
|
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){
|
|
|
|
|
|
|
|
|
|
// notification.open(
|
|
|
|
|
// {
|
|
|
|
|
// message: '提示',
|
|
|
|
|
// description:
|
|
|
|
|
// '请上传附件!',
|
|
|
|
|
//
|
|
|
|
|
// }
|
|
|
|
|
// )
|
|
|
|
|
if (attachment_ids === undefined || attachment_ids.length === 0) {
|
|
|
|
|
this.setState({
|
|
|
|
|
attachmentidstype:true
|
|
|
|
|
attachmentidstype: true
|
|
|
|
|
})
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
// console.log("attachment_ids"+attachment_ids);
|
|
|
|
|
|
|
|
|
|
// alert(languagewrite +" "+systemenvironment +" "+testcoderunmode + " "+attachment_ids);
|
|
|
|
|
|
|
|
|
|
var data={
|
|
|
|
|
language:languagewrite,
|
|
|
|
|
runtime:systemenvironment,
|
|
|
|
|
run_method:testcoderunmode,
|
|
|
|
|
attachment_id:attachment_ids[0],
|
|
|
|
|
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
|
|
|
|
|
var url = `/shixuns/apply_shixun_mirror.json`;
|
|
|
|
|
axios.post(url, data
|
|
|
|
|
).then((response) => {
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
if (response.data) {
|
|
|
|
|
// const { id } = response.data;
|
|
|
|
|
// if (id) {
|
|
|
|
|
if(this.state.file !== undefined){
|
|
|
|
|
console.log("549");
|
|
|
|
|
// this.deleteAttachment(this.state.file);
|
|
|
|
|
|
|
|
|
|
if (this.state.file !== undefined) {
|
|
|
|
|
this.setState({
|
|
|
|
|
file:undefined,
|
|
|
|
|
deleteisnot:true,
|
|
|
|
|
languagewrite:"",
|
|
|
|
|
systemenvironment:"",
|
|
|
|
|
testcoderunmode:"",
|
|
|
|
|
fileList:[]
|
|
|
|
|
file: undefined,
|
|
|
|
|
deleteisnot: true,
|
|
|
|
|
language: "",
|
|
|
|
|
runtime: "",
|
|
|
|
|
run_method: "",
|
|
|
|
|
fileList: []
|
|
|
|
|
})
|
|
|
|
|
}else {
|
|
|
|
|
} else {
|
|
|
|
|
this.setState({
|
|
|
|
|
file:undefined,
|
|
|
|
|
deleteisnot:true,
|
|
|
|
|
languagewrite:"",
|
|
|
|
|
systemenvironment:"",
|
|
|
|
|
testcoderunmode:"",
|
|
|
|
|
fileList:[]
|
|
|
|
|
file: undefined,
|
|
|
|
|
deleteisnot: true,
|
|
|
|
|
language: "",
|
|
|
|
|
runtime: "",
|
|
|
|
|
run_method: "",
|
|
|
|
|
fileList: []
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
// this.props.showNotification('提交成功!');
|
|
|
|
|
|
|
|
|
|
notification.open(
|
|
|
|
|
{
|
|
|
|
|
message: '提示',
|
|
|
|
@ -269,10 +271,9 @@ class Newshixuns extends Component {
|
|
|
|
|
}
|
|
|
|
|
)
|
|
|
|
|
this.sendhideModaly()
|
|
|
|
|
// this.props.history.push(`/courses/${cid}/graduation_topics`);
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}catch (e) {
|
|
|
|
|
} catch (e) {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -280,19 +281,47 @@ class Newshixuns extends Component {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
setlanguage = (e) => {
|
|
|
|
|
this.setState({
|
|
|
|
|
language: e.target.value
|
|
|
|
|
})
|
|
|
|
|
if (e.target.value) {
|
|
|
|
|
this.setState({
|
|
|
|
|
languagewritetype: false
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
setruntime = (e) => {
|
|
|
|
|
this.setState({
|
|
|
|
|
runtime: e.target.value
|
|
|
|
|
})
|
|
|
|
|
if (e.target.value) {
|
|
|
|
|
this.setState({
|
|
|
|
|
systemenvironmenttype: false
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
setrun_method = (e) => {
|
|
|
|
|
this.setState({
|
|
|
|
|
run_method: e.target.value
|
|
|
|
|
})
|
|
|
|
|
if (e.target.value) {
|
|
|
|
|
this.setState({
|
|
|
|
|
testcoderunmodetype: false
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
render() {
|
|
|
|
|
const {getFieldDecorator} = this.props.form;
|
|
|
|
|
const {newshixunlist,languagewrite,systemenvironment,testcoderunmode,fileList,postapplytitle,postapplyvisible} = this.state;
|
|
|
|
|
const {newshixunlist, fileList, postapplytitle, postapplyvisible} = this.state;
|
|
|
|
|
const uploadProps = {
|
|
|
|
|
width: 600,
|
|
|
|
|
fileList,
|
|
|
|
|
multiple: true,
|
|
|
|
|
// https://github.com/ant-design/ant-design/issues/15505
|
|
|
|
|
// showUploadList={false},然后外部拿到 fileList 数组自行渲染列表。
|
|
|
|
|
// showUploadList: false,
|
|
|
|
|
action: `${getUploadActionUrl()}`,
|
|
|
|
|
action: `${getUploadActionUrl()}`,
|
|
|
|
|
onChange: this.handleChange,
|
|
|
|
|
onRemove: this.onAttachmentRemove,
|
|
|
|
|
beforeUpload: (file, fileList) => {
|
|
|
|
@ -300,10 +329,10 @@ class Newshixuns extends Component {
|
|
|
|
|
if (this.state.fileList.length >= 1) {
|
|
|
|
|
return false
|
|
|
|
|
}
|
|
|
|
|
// console.log('beforeUpload', file.name);
|
|
|
|
|
|
|
|
|
|
const isLt150M = file.size / 1024 / 1024 < 50;
|
|
|
|
|
if (!isLt150M) {
|
|
|
|
|
// this.props.showNotification(`文件大小必须小于50MB`);
|
|
|
|
|
|
|
|
|
|
notification.open(
|
|
|
|
|
{
|
|
|
|
|
message: '提示',
|
|
|
|
@ -313,18 +342,15 @@ class Newshixuns extends Component {
|
|
|
|
|
}
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
if(this.state.file !== undefined){
|
|
|
|
|
console.log("763")
|
|
|
|
|
if (this.state.file !== undefined) {
|
|
|
|
|
this.setState({
|
|
|
|
|
file:file
|
|
|
|
|
file: file
|
|
|
|
|
})
|
|
|
|
|
}else {
|
|
|
|
|
} else {
|
|
|
|
|
this.setState({
|
|
|
|
|
file:file
|
|
|
|
|
file: file
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
console.log("handleChange2");
|
|
|
|
|
return isLt150M;
|
|
|
|
|
},
|
|
|
|
|
}
|
|
|
|
@ -333,16 +359,16 @@ class Newshixuns extends Component {
|
|
|
|
|
<style>
|
|
|
|
|
{
|
|
|
|
|
`
|
|
|
|
|
.newFooter{
|
|
|
|
|
display:none;
|
|
|
|
|
}
|
|
|
|
|
.ant-form-item{
|
|
|
|
|
margin-bottom:5px;
|
|
|
|
|
}
|
|
|
|
|
`
|
|
|
|
|
}
|
|
|
|
|
</style>
|
|
|
|
|
<div className="educontent mt20 mb60 clearfix">
|
|
|
|
|
<div className="new_shixun">
|
|
|
|
|
|
|
|
|
|
<div className="mb10 edu-back-white">
|
|
|
|
|
<div className="mb10 edu-back-white pd40px">
|
|
|
|
|
|
|
|
|
|
<div className="padding10-20 bor-bottom-greyE color-grey-3 clearfix">
|
|
|
|
|
<span className="fl font-18 lineh-35">新建实训项目</span>
|
|
|
|
@ -351,9 +377,9 @@ class Newshixuns extends Component {
|
|
|
|
|
target="_blank">实训制作指南</a> : ""}
|
|
|
|
|
</div>
|
|
|
|
|
<div className="padding10-20 color-grey-3 clearfix">
|
|
|
|
|
<Form onSubmit={this.handleSubmit}>
|
|
|
|
|
<Form>
|
|
|
|
|
<Form.Item label="实训类型">
|
|
|
|
|
{getFieldDecorator('radiogroup')(
|
|
|
|
|
{getFieldDecorator('is_jupyter')(
|
|
|
|
|
<Radio.Group onChange={this.RadiovalueonChange}>
|
|
|
|
|
<Radio value="1">普通实训</Radio>
|
|
|
|
|
<Radio value="2">Jupyter实训</Radio>
|
|
|
|
@ -369,8 +395,8 @@ class Newshixuns extends Component {
|
|
|
|
|
required: true, message: '请输入选题名称',
|
|
|
|
|
}, {
|
|
|
|
|
max: 60, message: '请输入名称,最大限制60个字符',
|
|
|
|
|
},{
|
|
|
|
|
whitespace:true,message:'请勿输入空格'
|
|
|
|
|
}, {
|
|
|
|
|
whitespace: true, message: '请勿输入空格'
|
|
|
|
|
}],
|
|
|
|
|
})(
|
|
|
|
|
<Input placeholder="请输入名称,最大限制60个字符"
|
|
|
|
@ -408,8 +434,8 @@ class Newshixuns extends Component {
|
|
|
|
|
>
|
|
|
|
|
<Option value={1}>初级</Option>
|
|
|
|
|
<Option value={2}>中级</Option>
|
|
|
|
|
<Option value={3}>中高级</Option>
|
|
|
|
|
<Option value={4}>高级</Option>
|
|
|
|
|
<Option value={3}>高级</Option>
|
|
|
|
|
<Option value={4}>顶级</Option>
|
|
|
|
|
</Select>
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
@ -418,28 +444,27 @@ class Newshixuns extends Component {
|
|
|
|
|
</Form.Item>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<Form.Item
|
|
|
|
|
<Form.Item
|
|
|
|
|
label={"实验环境"}
|
|
|
|
|
style={{"borderBottom": 'none','width': '18%','float': 'left'}}
|
|
|
|
|
style={{"borderBottom": 'none', 'width': '18%', 'float': 'left'}}
|
|
|
|
|
className="chooseDes pr"
|
|
|
|
|
>
|
|
|
|
|
<div>
|
|
|
|
|
|
|
|
|
|
{getFieldDecorator('selectleft', {
|
|
|
|
|
{getFieldDecorator('main_type', {
|
|
|
|
|
rules: [{required: true, message: '请选择主类别'}],
|
|
|
|
|
})(
|
|
|
|
|
<div className="width100 fl mr20">
|
|
|
|
|
|
|
|
|
|
<Select placeholder="请选择主类别"
|
|
|
|
|
style={{width: 180}}
|
|
|
|
|
onChange={this.selectleft}
|
|
|
|
|
onChange={this.main_type}
|
|
|
|
|
defaultOpen={false}
|
|
|
|
|
>
|
|
|
|
|
{
|
|
|
|
|
newshixunlist === undefined ? "" : newshixunlist.main_type.map((item, key) => {
|
|
|
|
|
return (
|
|
|
|
|
<Option value={item.id} key={key}>
|
|
|
|
|
<Option value={item.id} key={key} name={item.description}>
|
|
|
|
|
<Tooltip placement="right"
|
|
|
|
|
title={item.description === "" ? "无描述" : item.description}>
|
|
|
|
|
{item.type_name}
|
|
|
|
@ -449,33 +474,39 @@ class Newshixuns extends Component {
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
</Select>
|
|
|
|
|
<span className="fl color-grey lineh-20">
|
|
|
|
|
没有实验环境?
|
|
|
|
|
<a className="color-blue" onClick={this.post_apply}> 申请新建</a>
|
|
|
|
|
</span>
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
)}
|
|
|
|
|
</div>
|
|
|
|
|
</Form.Item>
|
|
|
|
|
</Form.Item>
|
|
|
|
|
|
|
|
|
|
<style>
|
|
|
|
|
{
|
|
|
|
|
`
|
|
|
|
|
.Selectlittle .ant-select-selection__rendered{
|
|
|
|
|
line-height:25px;
|
|
|
|
|
}
|
|
|
|
|
`
|
|
|
|
|
}
|
|
|
|
|
</style>
|
|
|
|
|
<Form.Item
|
|
|
|
|
style={{"borderBottom": 'none','width': '61%','float': 'left','margin-top': '40px'}}
|
|
|
|
|
style={{"borderBottom": 'none', 'width': '82%', 'float': 'left', 'marginTop': '40px'}}
|
|
|
|
|
className="chooseDes pr"
|
|
|
|
|
>
|
|
|
|
|
<div className=" fl pr mr20">
|
|
|
|
|
{getFieldDecorator('selectright', {
|
|
|
|
|
rules: [{required: true, message: '请选择小类别'}],
|
|
|
|
|
})(
|
|
|
|
|
>
|
|
|
|
|
<div className=" fl pr mr20">
|
|
|
|
|
{getFieldDecorator('sub_type')(
|
|
|
|
|
<div className=" fl pr mr20">
|
|
|
|
|
<Select placeholder="请选择小类别"
|
|
|
|
|
mode="multiple"
|
|
|
|
|
style={{width: 180}}
|
|
|
|
|
onChange={this.selectright}
|
|
|
|
|
onChange={this.sub_type}
|
|
|
|
|
defaultOpen={false}
|
|
|
|
|
className={"Selectlittle"}
|
|
|
|
|
>
|
|
|
|
|
{
|
|
|
|
|
newshixunlist === undefined ? "" : newshixunlist.small_type.map((item, key) => {
|
|
|
|
|
return (
|
|
|
|
|
<Option value={item.id} key={key}>
|
|
|
|
|
<Option value={item.id} key={key} name={item.description}>
|
|
|
|
|
<Tooltip placement="right"
|
|
|
|
|
title={item.description === "" ? "无描述" : item.description}>
|
|
|
|
|
{item.type_name}
|
|
|
|
@ -486,34 +517,36 @@ class Newshixuns extends Component {
|
|
|
|
|
}
|
|
|
|
|
</Select>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
)}
|
|
|
|
|
<span className="fl ml20 color-grey lineh-20">
|
|
|
|
|
<div>
|
|
|
|
|
<div className={"font-12"}>
|
|
|
|
|
已安装软件:hadoop3.1.0、jdk1.8;
|
|
|
|
|
</div>
|
|
|
|
|
<div className={"font-12"}>
|
|
|
|
|
说明:添加了hadoop3.1.0、jdk1.8的源码包,添加了hadoop3.1.0、jdk1.8的源码包
|
|
|
|
|
</div>
|
|
|
|
|
{this.state.mainvalues === undefined && this.state.subvalues === undefined ? "" :
|
|
|
|
|
<div className={"font-12"} style={{'max-width':'700px'}}>
|
|
|
|
|
{`已安装软件:${this.state.mainvalues===undefined?"":this.state.mainvalues}${this.state.subvalues===undefined?"":this.state.subvalues}`}
|
|
|
|
|
{`说明:添加了${this.state.mainvalues===undefined?"":this.state.mainvalues}${this.state.subvalues===undefined?"":this.state.subvalues}`}
|
|
|
|
|
</div>}
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
</span>
|
|
|
|
|
</div>
|
|
|
|
|
</Form.Item>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</Form>
|
|
|
|
|
|
|
|
|
|
{postapplyvisible===true?<style>
|
|
|
|
|
<div className={"both"}></div>
|
|
|
|
|
<div className=" color-grey lineh-20">
|
|
|
|
|
没有实验环境?
|
|
|
|
|
<a className="color-blue" onClick={this.post_apply}> 申请新建</a>
|
|
|
|
|
</div>
|
|
|
|
|
{postapplyvisible === true ? <style>
|
|
|
|
|
{
|
|
|
|
|
`
|
|
|
|
|
`
|
|
|
|
|
body{
|
|
|
|
|
overflow: hidden !important;
|
|
|
|
|
}
|
|
|
|
|
`
|
|
|
|
|
}
|
|
|
|
|
</style>:""}
|
|
|
|
|
}
|
|
|
|
|
</style> : ""}
|
|
|
|
|
|
|
|
|
|
<Modal
|
|
|
|
|
keyboard={false}
|
|
|
|
@ -525,49 +558,54 @@ class Newshixuns extends Component {
|
|
|
|
|
heigth={720}
|
|
|
|
|
>
|
|
|
|
|
<div>
|
|
|
|
|
<li className="clearfix ml82" >
|
|
|
|
|
<li className="clearfix ml82">
|
|
|
|
|
<label className="fl mt10 "><span
|
|
|
|
|
className="color-red fl mt3">*</span>语言: </label>
|
|
|
|
|
<textarea className={this.state.languagewritetype===true?"fl task-form-80 task-height-150 bor-reds":"fl task-form-80 task-height-150"}
|
|
|
|
|
style={{width:'89%',height:'100px'}}
|
|
|
|
|
onInput={this.setlanguagewrite}
|
|
|
|
|
value={languagewrite}
|
|
|
|
|
placeholder="请填写该镜像是基于什么语言:示例:Python"
|
|
|
|
|
id="demand_info"></textarea>
|
|
|
|
|
<textarea
|
|
|
|
|
className={this.state.languagewritetype === true ? "fl task-form-80 task-height-150 bor-reds" : "fl task-form-80 task-height-150"}
|
|
|
|
|
style={{width: '89%', height: '100px'}}
|
|
|
|
|
onInput={this.setlanguage}
|
|
|
|
|
value={this.state.language}
|
|
|
|
|
placeholder="请填写该镜像是基于什么语言:示例:Python"
|
|
|
|
|
id="demand_info"></textarea>
|
|
|
|
|
</li>
|
|
|
|
|
<div className={"color-red shixunspanred"}>{this.state.languagewritetype===true?"请填写该镜像语言":""}</div>
|
|
|
|
|
<div
|
|
|
|
|
className={"color-red shixunspanred"}>{this.state.languagewritetype === true ? "请填写该镜像语言" : ""}</div>
|
|
|
|
|
<li className="clearfix ml1">
|
|
|
|
|
<label className="panel-form-label fl ml50"><span
|
|
|
|
|
className="color-red fl mt3">*</span>系统环境: </label>
|
|
|
|
|
<textarea className={this.state.systemenvironmenttype===true?"fl task-form-80 task-height-150 bor-reds":"fl task-form-80 task-height-150"}
|
|
|
|
|
onInput={this.setsystemenvironment}
|
|
|
|
|
style={{height:'100px'}}
|
|
|
|
|
value={systemenvironment}
|
|
|
|
|
placeholder="请填写该镜像是基于什么linux系统环境,代码运行环境"
|
|
|
|
|
id="demand_info"></textarea>
|
|
|
|
|
<textarea
|
|
|
|
|
className={this.state.systemenvironmenttype === true ? "fl task-form-80 task-height-150 bor-reds" : "fl task-form-80 task-height-150"}
|
|
|
|
|
onInput={this.setruntime}
|
|
|
|
|
style={{height: '100px'}}
|
|
|
|
|
value={this.state.runtime}
|
|
|
|
|
placeholder="请填写该镜像是基于什么linux系统环境,代码运行环境"
|
|
|
|
|
id="demand_info"></textarea>
|
|
|
|
|
</li>
|
|
|
|
|
<div className={"color-red shixunspanred"}>{this.state.systemenvironmenttype===true?"请填写该镜像语言系统环境":""}</div>
|
|
|
|
|
<div
|
|
|
|
|
className={"color-red shixunspanred"}>{this.state.systemenvironmenttype === true ? "请填写该镜像语言系统环境" : ""}</div>
|
|
|
|
|
<li className="clearfix">
|
|
|
|
|
<label className="fl mt10" ><span
|
|
|
|
|
<label className="fl mt10"><span
|
|
|
|
|
className="color-red fl mt3">*</span>测试代码运行方式: </label>
|
|
|
|
|
|
|
|
|
|
<textarea
|
|
|
|
|
className={this.state.testcoderunmodetype===true?"fl task-form-80 task-height-150 bor-reds":"fl task-form-80 task-height-150"}
|
|
|
|
|
onInput={this.settestcoderunmode}
|
|
|
|
|
value={testcoderunmode}
|
|
|
|
|
style={{height:'100px'}}
|
|
|
|
|
placeholder="请填写该镜像中测试代码运行方式"
|
|
|
|
|
id="demand_info"></textarea>
|
|
|
|
|
className={this.state.testcoderunmodetype === true ? "fl task-form-80 task-height-150 bor-reds" : "fl task-form-80 task-height-150"}
|
|
|
|
|
onInput={this.setrun_method}
|
|
|
|
|
value={this.state.run_method}
|
|
|
|
|
style={{height: '100px'}}
|
|
|
|
|
placeholder="请填写该镜像中测试代码运行方式"
|
|
|
|
|
id="demand_info"></textarea>
|
|
|
|
|
</li>
|
|
|
|
|
<div className={"color-red shixunspanred"}>{this.state.testcoderunmodetype===true?"请填写该镜像测试代码运行方式":""}</div>
|
|
|
|
|
<div
|
|
|
|
|
className={"color-red shixunspanred"}>{this.state.testcoderunmodetype === true ? "请填写该镜像测试代码运行方式" : ""}</div>
|
|
|
|
|
<li className="clearfix ml50">
|
|
|
|
|
<label className="panel-form-label fl mt-5"><span
|
|
|
|
|
className="color-red fl">*</span>测试代码: </label>
|
|
|
|
|
<div className="mt10" style={{
|
|
|
|
|
<div className="mt10" style={{
|
|
|
|
|
display: "inline-block"
|
|
|
|
|
}}>
|
|
|
|
|
<Upload {...uploadProps}>
|
|
|
|
|
<Icon type="upload" className="fl mt3" > </Icon>
|
|
|
|
|
<Icon type="upload" className="fl mt3"> </Icon>
|
|
|
|
|
<span className="color-blue fl cdefault">上传附件</span>
|
|
|
|
|
<span className="color-grey-c fl ml10 ">(单个文件50M以内)</span>
|
|
|
|
|
|
|
|
|
@ -576,13 +614,13 @@ class Newshixuns extends Component {
|
|
|
|
|
|
|
|
|
|
</li>
|
|
|
|
|
<div className={"color-red shixunspanred"}>
|
|
|
|
|
{this.state.attachmentidstype===true?"请上传附件":""}
|
|
|
|
|
{this.state.attachmentidstype === true ? "请上传附件" : ""}
|
|
|
|
|
</div>
|
|
|
|
|
<li className="edu-txt-center clearfix ">
|
|
|
|
|
<a className="pop_close task-btn mr30"
|
|
|
|
|
onClick={() => this.sendhideModaly()}
|
|
|
|
|
>取消</a>
|
|
|
|
|
<Button type="primary" onClick={()=>this.sendsure_apply()}
|
|
|
|
|
<Button type="primary" onClick={() => this.sendsure_apply()}
|
|
|
|
|
className="task-btn task-btn-orange">确定</Button>
|
|
|
|
|
</li>
|
|
|
|
|
<div className="cl"></div>
|
|
|
|
@ -591,7 +629,6 @@ class Newshixuns extends Component {
|
|
|
|
|
</Modal>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<Modal
|
|
|
|
|
keyboard={false}
|
|
|
|
|
title="提示"
|
|
|
|
@ -617,14 +654,7 @@ class Newshixuns extends Component {
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div className="clearfix bor-bottom-greyE edu-back-white orderingbox newshixunbottombtn">
|
|
|
|
|
<div className=" edu-txt-center padding13-30">
|
|
|
|
|
<button type="button" className="ant-btn mr20 newshixunmode `backgroundFFF`" ><span>取 消</span></button>
|
|
|
|
|
<button type="button" className="ant-btn newshixunmode mr40 ant-btn-primary" type="primary" htmlType="submit" onClick={this.handleSubmit}><span>确 定</span></button>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<Bottomsubmit url={"/shixuns"} onSubmits={() => this.handleSubmit()}/>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
);
|
|
|
|
|