From 3870df4b79ffed0b3117e48d8b6ae85e30bdaef2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Wed, 11 Dec 2019 13:02:42 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/modules/paths/PathDetail/DetailCardsEditAndEdit.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/react/src/modules/paths/PathDetail/DetailCardsEditAndEdit.js b/public/react/src/modules/paths/PathDetail/DetailCardsEditAndEdit.js index e7701f4b8..20d9ce9ed 100644 --- a/public/react/src/modules/paths/PathDetail/DetailCardsEditAndEdit.js +++ b/public/react/src/modules/paths/PathDetail/DetailCardsEditAndEdit.js @@ -430,7 +430,7 @@ class DetailCardsEditAndEdit extends Component{

- + 新建实训项目

From dded28be5d0b6a68fc5949e3033a039d98ad7360 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Wed, 11 Dec 2019 14:21:35 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modules/paths/PathDetail/Addshixuns.js | 27 ++++++++++++++++--- .../paths/PathDetail/DetailCardsEditAndAdd.js | 7 ++--- .../PathDetail/DetailCardsEditAndEdit.js | 7 ++--- .../src/modules/tpm/newshixuns/Newshixuns.js | 4 +-- 4 files changed, 32 insertions(+), 13 deletions(-) diff --git a/public/react/src/modules/paths/PathDetail/Addshixuns.js b/public/react/src/modules/paths/PathDetail/Addshixuns.js index 48951b5e1..634ce281f 100644 --- a/public/react/src/modules/paths/PathDetail/Addshixuns.js +++ b/public/react/src/modules/paths/PathDetail/Addshixuns.js @@ -1,12 +1,13 @@ import React, { Component } from 'react'; import {getImageUrl} from 'educoder'; -import {Modal,Input} from 'antd'; +import {Modal,Input,Form,Radio} from 'antd'; class Addshixuns extends Component { constructor(props) { super(props); this.state = { shixunname:undefined, - shixunzero:false + shixunzero:false, + is_jupyter:"1" } } @@ -52,12 +53,22 @@ class Addshixuns extends Component { }) return } - this.props.Setaddshixuns(shixunname); + + let is_jupyter=this.state.is_jupyter==="1"?false:true + this.props.Setaddshixuns(shixunname,is_jupyter); this.props.modalCancel(); } + GrouponChange = e => { + this.setState({ + is_jupyter: e.target.value, + }); + }; render() { - + const formItemLayout = { + labelCol: { span: 4 }, + wrapperCol: { span: 14 }, + }; return( :""}
+
+ + + 普通实训 + jupyter实训 + + +

实训名称: diff --git a/public/react/src/modules/paths/PathDetail/DetailCardsEditAndAdd.js b/public/react/src/modules/paths/PathDetail/DetailCardsEditAndAdd.js index c054ac0db..9a4b82fb3 100644 --- a/public/react/src/modules/paths/PathDetail/DetailCardsEditAndAdd.js +++ b/public/react/src/modules/paths/PathDetail/DetailCardsEditAndAdd.js @@ -320,7 +320,7 @@ class DetailCardsEditAndAdd extends Component{ }) } - Getaddshixuns=(value)=>{ + Getaddshixuns=(value,is_jupyter)=>{ let { shixuns_listeditlist, shixuns_listedit, @@ -329,7 +329,8 @@ class DetailCardsEditAndAdd extends Component{ let list=shixuns_listeditlist let url='/paths/add_shixun_to_stage.json'; axios.post(url,{ - name:value + name:value, + is_jupyter:is_jupyter }).then((response) => { if(response){ if(response.data){ @@ -383,7 +384,7 @@ class DetailCardsEditAndAdd extends Component{ {this.state.Addshixunstype===true?this.Getaddshixuns(value)} + Setaddshixuns={(value,is_jupyter)=>this.Getaddshixuns(value,is_jupyter)} {...this.props} {...this.state} />:""} diff --git a/public/react/src/modules/paths/PathDetail/DetailCardsEditAndEdit.js b/public/react/src/modules/paths/PathDetail/DetailCardsEditAndEdit.js index 20d9ce9ed..350c2eb8d 100644 --- a/public/react/src/modules/paths/PathDetail/DetailCardsEditAndEdit.js +++ b/public/react/src/modules/paths/PathDetail/DetailCardsEditAndEdit.js @@ -320,7 +320,7 @@ class DetailCardsEditAndEdit extends Component{ notification.open(data); } - Getaddshixuns=(value)=>{ + Getaddshixuns=(value,is_jupyter)=>{ let { shixuns_listeditlist, shixuns_listedit, @@ -329,7 +329,8 @@ class DetailCardsEditAndEdit extends Component{ let list=shixuns_listeditlist let url='/paths/add_shixun_to_stage.json'; axios.post(url,{ - name:value + name:value, + is_jupyter:is_jupyter }).then((response) => { if(response){ if(response.data){ @@ -383,7 +384,7 @@ class DetailCardsEditAndEdit extends Component{ {this.state.Addshixunstype===true?this.Getaddshixuns(value)} + Setaddshixuns={(value,is_jupyter)=>this.Getaddshixuns(value,is_jupyter)} {...this.props} {...this.state} />:""} diff --git a/public/react/src/modules/tpm/newshixuns/Newshixuns.js b/public/react/src/modules/tpm/newshixuns/Newshixuns.js index 22ac71ec9..82512a0ae 100644 --- a/public/react/src/modules/tpm/newshixuns/Newshixuns.js +++ b/public/react/src/modules/tpm/newshixuns/Newshixuns.js @@ -96,17 +96,15 @@ class Newshixuns extends Component { 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 + is_jupyter: values.is_jupyter === "2" ? true : false, } } ).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 { From 57e2323dbf4334fe247e610775e700ea8506ee95 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Wed, 11 Dec 2019 15:45:32 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/react/src/modules/tpm/TPMIndex.js | 2 +- .../tpm/TPMsettings/Shixuninformation.js | 11 +-- .../modules/tpm/TPMsettings/TPMsettings.js | 13 ---- .../src/modules/tpm/newshixuns/Newshixuns.js | 73 ++++++++++++++++++- 4 files changed, 79 insertions(+), 20 deletions(-) diff --git a/public/react/src/modules/tpm/TPMIndex.js b/public/react/src/modules/tpm/TPMIndex.js index f80691d56..9c82e987d 100644 --- a/public/react/src/modules/tpm/TPMIndex.js +++ b/public/react/src/modules/tpm/TPMIndex.js @@ -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'; diff --git a/public/react/src/modules/tpm/TPMsettings/Shixuninformation.js b/public/react/src/modules/tpm/TPMsettings/Shixuninformation.js index f4e18a6c1..eb7dba596 100644 --- a/public/react/src/modules/tpm/TPMsettings/Shixuninformation.js +++ b/public/react/src/modules/tpm/TPMsettings/Shixuninformation.js @@ -103,9 +103,10 @@ class Shixuninformation extends Component { return isLt150M; }, } + return (

-
+
+ - - (若需要对学员隐藏部分版本库内容时,请选中;选中即启用私密版本库,请将需要对学员隐藏的文件存储在私密版本库) - - + 私密版本库: + (若需要对学员隐藏部分版本库内容时,请选中;选中即启用私密版本库,请将需要对学员隐藏的文件存储在私密版本库) + {this.props.identity<3?

服务配置

diff --git a/public/react/src/modules/tpm/TPMsettings/TPMsettings.js b/public/react/src/modules/tpm/TPMsettings/TPMsettings.js index fe99c8ca7..4540b5e60 100644 --- a/public/react/src/modules/tpm/TPMsettings/TPMsettings.js +++ b/public/react/src/modules/tpm/TPMsettings/TPMsettings.js @@ -1,20 +1,7 @@ import React, {Component} from 'react'; import { - Input, - Select, - Radio, - Checkbox, - Popconfirm, - message, - Modal, - Icon, - DatePicker, - Breadcrumb, - Upload, Button, - notification, - Tooltip, Tabs } from 'antd'; diff --git a/public/react/src/modules/tpm/newshixuns/Newshixuns.js b/public/react/src/modules/tpm/newshixuns/Newshixuns.js index 82512a0ae..df16b2575 100644 --- a/public/react/src/modules/tpm/newshixuns/Newshixuns.js +++ b/public/react/src/modules/tpm/newshixuns/Newshixuns.js @@ -31,6 +31,7 @@ class Newshixuns extends Component { runtime: undefined, run_method: undefined, postapplyvisible: undefined, + fileList: [], } } @@ -312,6 +313,76 @@ class Newshixuns extends Component { } } + + // 附件相关 START + handleChange = (info) => { + if(info.file.status === 'uploading' || info.file.status === 'done' || info.file.status === 'removed') { + let {fileList} = this.state; + + if (info.file.status === 'uploading' || info.file.status === 'done' || info.file.status === 'removed') { + console.log("handleChange1"); + // if(fileList.length===0){ + let fileLists = info.fileList; + this.setState({ + // fileList:appendFileSizeToUploadFileAll(fileList), + fileList: fileLists, + deleteisnot: false + }); + // } + } + } + } + + onAttachmentRemove = (file) => { + if(!file.percent || file.percent == 100){ + confirm({ + title: '确定要删除这个附件吗?', + okText: '确定', + cancelText: '取消', + // content: 'Some descriptions', + onOk: () => { + console.log("665") + this.deleteAttachment(file) + }, + onCancel() { + console.log('Cancel'); + }, + }); + return false; + } + + } + + deleteAttachment = (file) => { + console.log(file); + let id=file.response ==undefined ? file.id : file.response.id + const url = `/attachments/${id}.json` + axios.delete(url, { + }) + .then((response) => { + if (response.data) { + const { status } = response.data; + if (status == 0) { + // console.log('--- success') + + this.setState((state) => { + + const index = state.fileList.indexOf(file); + const newFileList = state.fileList.slice(); + newFileList.splice(index, 1); + return { + fileList: newFileList, + deleteisnot:true + }; + }); + } + } + }) + .catch(function (error) { + console.log(error); + }); + } + render() { const {getFieldDecorator} = this.props.form; const {newshixunlist, fileList, postapplytitle, postapplyvisible} = this.state; @@ -521,7 +592,7 @@ class Newshixuns extends Component { {this.state.mainvalues === undefined && this.state.subvalues === undefined ? "" :
{`已安装软件:${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}`} + {` 说明:添加了${this.state.mainvalues===undefined?"":this.state.mainvalues}${this.state.subvalues===undefined?"":this.state.subvalues}`}
}