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(
实训名称:
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?
服务配置
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 ? "" :