|
|
@ -25,9 +25,9 @@ import axios from 'axios';
|
|
|
|
|
|
|
|
|
|
|
|
import TPMMDEditor from "../challengesnew/TPMMDEditor";
|
|
|
|
import TPMMDEditor from "../challengesnew/TPMMDEditor";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import Bottomsubmit from "../../modals/Bottomsubmit";
|
|
|
|
|
|
|
|
|
|
|
|
import {getImageUrl, toPath, getUrl, appendFileSizeToUploadFileAll, getUploadActionUrl} from 'educoder';
|
|
|
|
import {getUploadActionUrl} from 'educoder';
|
|
|
|
import {TPMIndexHOC} from "../TPMIndexHOC";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import './css/TPMsettings.css';
|
|
|
|
import './css/TPMsettings.css';
|
|
|
|
|
|
|
|
|
|
|
@ -43,9 +43,39 @@ class Shixuninformation extends Component {
|
|
|
|
NAME_COUNT: 60,
|
|
|
|
NAME_COUNT: 60,
|
|
|
|
shixunmemoMDvalue: "",
|
|
|
|
shixunmemoMDvalue: "",
|
|
|
|
language: "java",
|
|
|
|
language: "java",
|
|
|
|
|
|
|
|
testscripttiptype:false,
|
|
|
|
|
|
|
|
shixunName:'',
|
|
|
|
|
|
|
|
trainee:undefined,
|
|
|
|
|
|
|
|
choice_small_type:[],
|
|
|
|
|
|
|
|
simichecked:false,
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
componentDidMount() {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
componentDidUpdate(prevProps, prevState) {
|
|
|
|
|
|
|
|
if(prevProps.data!=this.props.data){
|
|
|
|
|
|
|
|
if(this.props.data){
|
|
|
|
|
|
|
|
this.setState({
|
|
|
|
|
|
|
|
shixunName:this.props.data.shixun.name,
|
|
|
|
|
|
|
|
trainee:this.props.data.shixun.trainee,
|
|
|
|
|
|
|
|
choice_main_type:this.props.data.shixun.choice_main_type,
|
|
|
|
|
|
|
|
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({
|
|
|
|
|
|
|
|
name:this.props.data.shixun.name,
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
this.contentMdRef.current.setValue(this.props.data.shixun.description);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
getshixunmemoMDvalue = (value, e) => {
|
|
|
|
getshixunmemoMDvalue = (value, e) => {
|
|
|
|
|
|
|
|
|
|
|
@ -54,13 +84,287 @@ 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) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
bigClass = (value) => {
|
|
|
|
|
|
|
|
let list=[]
|
|
|
|
|
|
|
|
list.push(this.props.data.shixun.choice_main_type)
|
|
|
|
|
|
|
|
this.props.data.shixun.choice_small_type.map((item,key)=>{
|
|
|
|
|
|
|
|
list.push(item)
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
let newshixun_service_configs=this.props.data.shixun.shixun_service_configs;
|
|
|
|
|
|
|
|
let newshixun_service_configsagin=[];
|
|
|
|
|
|
|
|
newshixun_service_configs.map((item,key)=>{
|
|
|
|
|
|
|
|
list.map((its,index)=>{
|
|
|
|
|
|
|
|
if(item.mirror_repository_id===its){
|
|
|
|
|
|
|
|
newshixun_service_configsagin.push(item)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.props.data.shixun.main_type.some((item,key)=> {
|
|
|
|
|
|
|
|
if (item.id === value) {
|
|
|
|
|
|
|
|
newshixun_service_configsagin[0]={
|
|
|
|
|
|
|
|
mirror_repository_id:value,
|
|
|
|
|
|
|
|
name:item.type_name,
|
|
|
|
|
|
|
|
cpu_limit:1,
|
|
|
|
|
|
|
|
lower_cpu_limit:0.1,
|
|
|
|
|
|
|
|
memory_limit:1024,
|
|
|
|
|
|
|
|
request_limit:10
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return true
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
let url = `/shixuns/get_mirror_script.json?mirror_id=`+value;
|
|
|
|
|
|
|
|
axios.get(url).then((response) => {
|
|
|
|
|
|
|
|
if (response.status === 200) {
|
|
|
|
|
|
|
|
// console.log(response.data)
|
|
|
|
|
|
|
|
this.setState({
|
|
|
|
|
|
|
|
choice_main_type: value,
|
|
|
|
|
|
|
|
standard_scripts:response.data,
|
|
|
|
|
|
|
|
choice_standard_scripts:null,
|
|
|
|
|
|
|
|
shixun_service_configs:newshixun_service_configsagin,
|
|
|
|
|
|
|
|
shixun_service_configlist:newshixun_service_configsagin,
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}).catch((error) => {
|
|
|
|
|
|
|
|
console.log(error)
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
littleClass = (value) => {
|
|
|
|
|
|
|
|
let newshixun_service_configs=this.props.data.shixun.shixun_service_configs;
|
|
|
|
|
|
|
|
let newchoice_small_type=this.props.data.shixun.choice_small_type;
|
|
|
|
|
|
|
|
let list=[]
|
|
|
|
|
|
|
|
list.push(this.props.data.shixun.choice_main_type)
|
|
|
|
|
|
|
|
newchoice_small_type.map((item,key)=>{
|
|
|
|
|
|
|
|
list.push(item)
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
let newshixun_service_configsagin=[]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
newshixun_service_configs.map((item,key)=>{
|
|
|
|
|
|
|
|
list.map((its,index)=>{
|
|
|
|
|
|
|
|
if(item.mirror_repository_id===its){
|
|
|
|
|
|
|
|
newshixun_service_configsagin.push(item)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.props.data.shixun.small_type.some((items,keys)=> {
|
|
|
|
|
|
|
|
if (items.id === value) {
|
|
|
|
|
|
|
|
newshixun_service_configsagin.push({
|
|
|
|
|
|
|
|
mirror_repository_id:value,
|
|
|
|
|
|
|
|
name:items.type_name,
|
|
|
|
|
|
|
|
cpu_limit:1,
|
|
|
|
|
|
|
|
lower_cpu_limit:0.1,
|
|
|
|
|
|
|
|
memory_limit:1024,
|
|
|
|
|
|
|
|
request_limit:10
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
return true
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
newchoice_small_type.push(value)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.setState({
|
|
|
|
|
|
|
|
choice_small_type: newchoice_small_type,
|
|
|
|
|
|
|
|
shixun_service_configs:newshixun_service_configsagin,
|
|
|
|
|
|
|
|
shixun_service_configlist:newshixun_service_configsagin,
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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() {
|
|
|
|
render() {
|
|
|
|
console.log(this.props.data)
|
|
|
|
|
|
|
|
|
|
|
|
let operateauthority=this.props.identity===1?true:this.props.identity<5&&this.props.data.shixun.status==0?true:false;
|
|
|
|
|
|
|
|
// console.log(operateauthority)
|
|
|
|
const {getFieldDecorator} = this.props.form;
|
|
|
|
const {getFieldDecorator} = this.props.form;
|
|
|
|
const {newshixunlist, languagewrite, systemenvironment, testcoderunmode, fileList, postapplytitle, postapplyvisible, shixunmemoMDvalue} = this.state;
|
|
|
|
const {languagewrite, systemenvironment, testcoderunmode, fileList, choice_standard_scripts, postapplyvisible, shixunmemoMDvalue} = this.state;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// console.log("1222")
|
|
|
|
|
|
|
|
// console.log(choice_standard_scripts)
|
|
|
|
const {shixun_service_configs}=this.props;
|
|
|
|
const {shixun_service_configs}=this.props;
|
|
|
|
let operateauthority = this.props.identity === 1 ? true : this.props.identity < 5 && this.state.status == 0 ? true : false;
|
|
|
|
|
|
|
|
const uploadProps = {
|
|
|
|
const uploadProps = {
|
|
|
|
width: 600,
|
|
|
|
width: 600,
|
|
|
|
fileList,
|
|
|
|
fileList,
|
|
|
@ -105,8 +409,12 @@ class Shixuninformation extends Component {
|
|
|
|
},
|
|
|
|
},
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
return (
|
|
|
|
<div>
|
|
|
|
<div>
|
|
|
|
|
|
|
|
<div className="educontent mb50 edu-back-white padding10-20">
|
|
|
|
<Form>
|
|
|
|
<Form>
|
|
|
|
<Form.Item
|
|
|
|
<Form.Item
|
|
|
|
label="名称"
|
|
|
|
label="名称"
|
|
|
@ -148,13 +456,14 @@ class Shixuninformation extends Component {
|
|
|
|
style={{"borderBottom": 'none'}}
|
|
|
|
style={{"borderBottom": 'none'}}
|
|
|
|
className="chooseDes pr"
|
|
|
|
className="chooseDes pr"
|
|
|
|
>
|
|
|
|
>
|
|
|
|
{getFieldDecorator('select', {
|
|
|
|
{getFieldDecorator('trainee', {
|
|
|
|
rules: [{required: true, message: '请选择难易度'}],
|
|
|
|
rules: [{required: true, message: '请选择难易度'}],
|
|
|
|
})(
|
|
|
|
})(
|
|
|
|
<div className="with15 fl pr">
|
|
|
|
<div className="with15 fl pr">
|
|
|
|
<Select placeholder="请选择难易度"
|
|
|
|
<Select placeholder="请选择难易度"
|
|
|
|
style={{width: 180}}
|
|
|
|
style={{width: 180}}
|
|
|
|
onChange={this.Selectthestudent}
|
|
|
|
onChange={this.Selectthestudent}
|
|
|
|
|
|
|
|
value={this.state.trainee}
|
|
|
|
>
|
|
|
|
>
|
|
|
|
<Option value={1}>初级</Option>
|
|
|
|
<Option value={1}>初级</Option>
|
|
|
|
<Option value={2}>中级</Option>
|
|
|
|
<Option value={2}>中级</Option>
|
|
|
@ -178,18 +487,20 @@ class Shixuninformation extends Component {
|
|
|
|
rules: [{required: true, message: '请选择主类别'}],
|
|
|
|
rules: [{required: true, message: '请选择主类别'}],
|
|
|
|
})(
|
|
|
|
})(
|
|
|
|
<div className="width100 fl mr20">
|
|
|
|
<div className="width100 fl mr20">
|
|
|
|
|
|
|
|
<Select placeholder="请选择主类别" value={this.state.choice_main_type === "" ? undefined : this.state.choice_main_type}
|
|
|
|
<Select placeholder="请选择主类别"
|
|
|
|
|
|
|
|
style={{width: 180}}
|
|
|
|
style={{width: 180}}
|
|
|
|
onChange={this.selectleft}
|
|
|
|
onChange={operateauthority?this.bigClass:""}
|
|
|
|
defaultOpen={false}
|
|
|
|
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 (
|
|
|
|
return (
|
|
|
|
<Option value={item.id} key={key} >
|
|
|
|
<Option value={item.id} key={key} >
|
|
|
|
<Tooltip placement="right"
|
|
|
|
<Tooltip placement="right" title={item.description=== ""?"无描述":item.description} >
|
|
|
|
title={item.description === "" ? "无描述" : item.description}>
|
|
|
|
|
|
|
|
{item.type_name}
|
|
|
|
{item.type_name}
|
|
|
|
</Tooltip>
|
|
|
|
</Tooltip>
|
|
|
|
</Option>
|
|
|
|
</Option>
|
|
|
@ -214,16 +525,20 @@ class Shixuninformation extends Component {
|
|
|
|
})(
|
|
|
|
})(
|
|
|
|
<div className=" fl pr mr20">
|
|
|
|
<div className=" fl pr mr20">
|
|
|
|
<Select placeholder="请选择小类别"
|
|
|
|
<Select placeholder="请选择小类别"
|
|
|
|
style={{width: 180}}
|
|
|
|
mode="multiple"
|
|
|
|
onChange={this.selectright}
|
|
|
|
onChange={this.selectright}
|
|
|
|
|
|
|
|
value={this.state.choice_small_type.length===0||this.state.choice_small_type[0]===""||this.state.choice_small_type===[]?undefined:this.state.choice_small_type}
|
|
|
|
|
|
|
|
style={{width: 180,height:30}}
|
|
|
|
|
|
|
|
disabled={operateauthority?false:true}
|
|
|
|
|
|
|
|
onDeselect={operateauthority?this.Deselectlittle:""}
|
|
|
|
|
|
|
|
onSelect={operateauthority?this.littleClass:""}
|
|
|
|
defaultOpen={false}
|
|
|
|
defaultOpen={false}
|
|
|
|
>
|
|
|
|
>
|
|
|
|
{
|
|
|
|
{
|
|
|
|
newshixunlist === undefined ? "" : newshixunlist.small_type.map((item, key) => {
|
|
|
|
this.props.data === undefined ? "" : this.props.data.shixun.small_type.map((item, key) => {
|
|
|
|
return(
|
|
|
|
return(
|
|
|
|
<Option value={item.id} key={key}>
|
|
|
|
<Option value={item.id} key={key}>
|
|
|
|
<Tooltip placement="right"
|
|
|
|
<Tooltip placement="right" title={item.description=== ""?"无描述":item.description} >
|
|
|
|
title={item.description === "" ? "无描述" : item.description}>
|
|
|
|
|
|
|
|
{item.type_name}
|
|
|
|
{item.type_name}
|
|
|
|
</Tooltip>
|
|
|
|
</Tooltip>
|
|
|
|
</Option>
|
|
|
|
</Option>
|
|
|
@ -258,27 +573,70 @@ class Shixuninformation extends Component {
|
|
|
|
style={{"borderBottom": 'none'}}
|
|
|
|
style={{"borderBottom": 'none'}}
|
|
|
|
className="chooseDes pr"
|
|
|
|
className="chooseDes pr"
|
|
|
|
>
|
|
|
|
>
|
|
|
|
{getFieldDecorator('select', {
|
|
|
|
{getFieldDecorator('select123', {
|
|
|
|
rules: [{required: true, message: '请选择评测脚本'}],
|
|
|
|
rules: [{required: true, message: '请选择评测脚本'}],
|
|
|
|
})(
|
|
|
|
})(
|
|
|
|
<div className="with15 fl pr">
|
|
|
|
<div className="with15 fl pr">
|
|
|
|
<Select placeholder="请选择评测脚本"
|
|
|
|
<Select placeholder="请选择选择脚本"
|
|
|
|
style={{width: 180}}
|
|
|
|
style={{width: 180}}
|
|
|
|
onChange={this.Selectthestudent}
|
|
|
|
className="fl"
|
|
|
|
>
|
|
|
|
disabled={operateauthority?false:true}
|
|
|
|
<Option value={1}>初级</Option>
|
|
|
|
value={choice_standard_scripts === undefined||choice_standard_scripts === null ? undefined :choice_standard_scripts.id===undefined?choice_standard_scripts:choice_standard_scripts.id}
|
|
|
|
<Option value={2}>中级</Option>
|
|
|
|
onChange={operateauthority?this.SelectScput:""}>
|
|
|
|
<Option value={3}>中高级</Option>
|
|
|
|
{
|
|
|
|
<Option value={4}>高级</Option>
|
|
|
|
this.props.data === undefined ? "" : this.props.data.shixun.standard_scripts.map((item, key) => {
|
|
|
|
</Select>
|
|
|
|
return (
|
|
|
|
|
|
|
|
<Option value={parseInt(item.id)} name={item.scptname} key={key}>{item.scptname}</Option>
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
</Select>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
)}
|
|
|
|
)}
|
|
|
|
<span className="fl ml20 color-blue">
|
|
|
|
<span className="fl ml20 color-blue">
|
|
|
|
使用自定义脚本
|
|
|
|
使用自定义脚本
|
|
|
|
<span className={"color-grey ml10"}>
|
|
|
|
<span className={"color-grey ml10"} onClick={()=>this.testscripttip(0)}>
|
|
|
|
<Icon type="exclamation-circle"/>
|
|
|
|
<Icon type="exclamation-circle"/>
|
|
|
|
</span>
|
|
|
|
</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>
|
|
|
|
</span>
|
|
|
|
</Form.Item>
|
|
|
|
</Form.Item>
|
|
|
|
|
|
|
|
|
|
|
@ -290,7 +648,7 @@ class Shixuninformation extends Component {
|
|
|
|
<div className="fl" style={{border: '1px solid #ccc'}}>
|
|
|
|
<div className="fl" style={{border: '1px solid #ccc'}}>
|
|
|
|
<MonacoEditor
|
|
|
|
<MonacoEditor
|
|
|
|
height="450"
|
|
|
|
height="450"
|
|
|
|
width="1100"
|
|
|
|
width="1150"
|
|
|
|
language={this.state.language}
|
|
|
|
language={this.state.language}
|
|
|
|
value={shixunmemoMDvalue}
|
|
|
|
value={shixunmemoMDvalue}
|
|
|
|
options={{
|
|
|
|
options={{
|
|
|
@ -306,7 +664,7 @@ class Shixuninformation extends Component {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<span className="ant-form-text mt20" >私密版本库:
|
|
|
|
<span className="ant-form-text mt20" >私密版本库:
|
|
|
|
<Checkbox>(若需要对学员隐藏部分版本库内容时,请选中;选中即启用私密版本库,请将需要对学员隐藏的文件存储在私密版本库)</Checkbox>
|
|
|
|
<Checkbox onChange={this.simionChange} value={this.state.simichecked}>(若需要对学员隐藏部分版本库内容时,请选中;选中即启用私密版本库,请将需要对学员隐藏的文件存储在私密版本库)</Checkbox>
|
|
|
|
</span>
|
|
|
|
</span>
|
|
|
|
|
|
|
|
|
|
|
|
{this.props.identity<3?<div className="edu-back-white padding40-20 mb20">
|
|
|
|
{this.props.identity<3?<div className="edu-back-white padding40-20 mb20">
|
|
|
@ -371,6 +729,38 @@ class Shixuninformation extends Component {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</style> : ""}
|
|
|
|
</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
|
|
|
|
<Modal
|
|
|
|
keyboard={false}
|
|
|
|
keyboard={false}
|
|
|
|
title="申请新建"
|
|
|
|
title="申请新建"
|
|
|
@ -449,30 +839,10 @@ class Shixuninformation extends Component {
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
{/*</Form>*/}
|
|
|
|
{/*</Form>*/}
|
|
|
|
</Modal>
|
|
|
|
</Modal>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<Modal
|
|
|
|
|
|
|
|
keyboard={false}
|
|
|
|
|
|
|
|
title="提示"
|
|
|
|
|
|
|
|
visible={postapplytitle}
|
|
|
|
|
|
|
|
closable={false}
|
|
|
|
|
|
|
|
footer={null}
|
|
|
|
|
|
|
|
>
|
|
|
|
|
|
|
|
<div>
|
|
|
|
|
|
|
|
<div className="task-popup-content"><p
|
|
|
|
|
|
|
|
className="task-popup-text-center font-16"><span
|
|
|
|
|
|
|
|
className="font-17 mt10">新建申请已提交,请等待管理员的审核</span></p>
|
|
|
|
|
|
|
|
<li className="font-14 mt15 color-grey-6 edu-txt-center">我们将在1-2个工作日内与您联系
|
|
|
|
|
|
|
|
</li>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div className="task-popup-OK clearfix">
|
|
|
|
<Bottomsubmit url={`/shixuns/${this.props.match.params.shixunId}/challenges`} onSubmits={ this.sendsure_apply}/>
|
|
|
|
<a className="task-btn task-btn-orange"
|
|
|
|
|
|
|
|
onClick={this.yeshidemodel}>知道啦</a>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</Modal>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
);
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|