From d191f0b8174e5a76958ba5a17a81e777677af722 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Tue, 7 Jan 2020 15:09:40 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../RepositoryAddFileupload_file.js | 32 ++++++++++++------- .../shixunchild/Repository/Repositoryfile.js | 15 ++++----- 2 files changed, 28 insertions(+), 19 deletions(-) diff --git a/public/react/src/modules/tpm/shixunchild/Repository/RepositoryAddFileupload_file.js b/public/react/src/modules/tpm/shixunchild/Repository/RepositoryAddFileupload_file.js index 72bc9bf8c..fe060835b 100644 --- a/public/react/src/modules/tpm/shixunchild/Repository/RepositoryAddFileupload_file.js +++ b/public/react/src/modules/tpm/shixunchild/Repository/RepositoryAddFileupload_file.js @@ -29,17 +29,19 @@ class RepositoryAddFileupload_files extends Component { } handleChange = (info) => { - - if (info.file.status === 'done') { + console.log(info) + if (info.file.status === 'done'||info.file.status === "uploading") { let fileList = [...info.fileList]; - if(info.file.response.status===-1){ - notification.open({ - message: '提示', - description:info.file.response.message, - }) - return + if(info.file.response){ + if(info.file.response.status===-1) { + notification.open({ + message: '提示', + description: info.file.response.message, + }) + return + } } fileList = fileList.slice(-2); @@ -74,9 +76,17 @@ class RepositoryAddFileupload_files extends Component { if(matchpath.indexOf("secret_repository")>-1){ Repositoryflag =true; } + + let newfilspath=filspath; + + if(newfilspath===""){ + newfilspath=info.name + }else{ + newfilspath=filspath+"/"+info.name + } const url = `/shixuns//${shixunId}/delete_git_file.json`; axios.delete(url, { data: { - path:filspath+info.name, + path:newfilspath, message:message, secret_repository:Repositoryflag }}) @@ -247,7 +257,7 @@ class RepositoryAddFileupload_files extends Component {

-

当前目录:{this.state.filspath===""?"./":this.state.filspath} 选择文件目录
+
当前目录:{this.state.filspath===""?"/":"/"+this.state.filspath} 选择文件目录

{/*
*/} @@ -278,7 +288,7 @@ class RepositoryAddFileupload_files extends Component {
- + ) } diff --git a/public/react/src/modules/tpm/shixunchild/Repository/Repositoryfile.js b/public/react/src/modules/tpm/shixunchild/Repository/Repositoryfile.js index 195cfea8a..bc58d6cc0 100644 --- a/public/react/src/modules/tpm/shixunchild/Repository/Repositoryfile.js +++ b/public/react/src/modules/tpm/shixunchild/Repository/Repositoryfile.js @@ -85,21 +85,20 @@ class Repositoryfile extends Component{ }) if(paths===""&&type==="tree"){ - newpath=newpath+"/"; + newpath=newpath; paths=""; if(main.length===0){ - ary.push({val:"根目录/",path:""},{val:newpath,path:paths+newpath}) + ary.push({val:"根目录",path:""},{val:"/"+newpath,path:paths+newpath}); }else{ - ary.push({val:newpath,path:paths+newpath}) + ary.push({val:"/"+newpath,path:paths+newpath}); } - }else if(paths!=""&&type==="tree"){ - newpath=newpath+"/"; - ary.push({val:newpath,path:paths+newpath}) + newpath=paths+"/"+newpath; + ary.push({val:"/"+newpath,path:paths+newpath}); } axios.post(url,{ - path: paths+newpath + path: newpath }).then((response) => { if (response.data.status === 403||response.data.status === 401||response.data.status === 500) { @@ -138,7 +137,7 @@ class Repositoryfile extends Component{ this.props.form.validateFieldsAndScroll((err, values) => { if (!err) { console.log('Received values of form: ', values); - let paths=path+values.name; + let paths=path+"/"+values.name; axios.post(url,{ path: paths, secret_repository:flag===false?undefined:flag, From df308ab761b91585b349c68baecf038f7f2b98a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Tue, 7 Jan 2020 15:13:37 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=E5=90=88=E5=B9=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../question/component/Itembankstop.js | 8 +- .../modules/question/component/Listjihe.js | 114 +++++++++--------- 2 files changed, 61 insertions(+), 61 deletions(-) diff --git a/public/react/src/modules/question/component/Itembankstop.js b/public/react/src/modules/question/component/Itembankstop.js index 46668c979..36dff4fc0 100644 --- a/public/react/src/modules/question/component/Itembankstop.js +++ b/public/react/src/modules/question/component/Itembankstop.js @@ -495,7 +495,7 @@ class Itembankstop extends Component { height: 33px !important; } .ant-input-group{ - width:258px !important; + width:270px !important; } .ant-input { height: 33px !important; @@ -530,7 +530,7 @@ class Itembankstop extends Component { )(
- @@ -544,7 +544,7 @@ class Itembankstop extends Component { )(
- diff --git a/public/react/src/modules/question/component/Listjihe.js b/public/react/src/modules/question/component/Listjihe.js index 34506150b..0b1f012f5 100644 --- a/public/react/src/modules/question/component/Listjihe.js +++ b/public/react/src/modules/question/component/Listjihe.js @@ -37,10 +37,10 @@ class Listjihe extends Component { //选用 Selectingpracticaltraining=(id)=>{ - let data={ - item_ids:[id] - } - this.props.getitem_baskets(data); + let data={ + item_ids:[id] + } + this.props.getitem_baskets(data); } //撤销 Selectingpracticaltrainings=(id)=>{ @@ -117,38 +117,38 @@ class Listjihe extends Component { {/*内容*/}
{items.item_type==="JUDGMENT"? -

- { - items === undefined ||items === null? "" : items.choices.map((object, index) => { - return ( -

- - {object.choice_text} - -

- ) - }) - } -

: +

+ { + items === undefined ||items === null? "" : items.choices.map((object, index) => { + return ( +

+ + {object.choice_text} + +

+ ) + }) + } +

: items.item_type==="PROGRAM"?

-

-

+

+

+

+

+ : +

+ { + items === undefined ||items === null? "" : items.choices.map((object, index) => { + return ( +

+ {tagArray[index]} +

+ ) + }) + }

- : -

- { - items === undefined ||items === null? "" : items.choices.map((object, index) => { - return ( -

- {tagArray[index]} -

-

- ) - }) - } -

}
@@ -160,18 +160,18 @@ class Listjihe extends Component { {/*更新时间*/}
-

更新时间:{items.update_time}

+

更新时间:{items.update_time}

{ this.props.defaultActiveKey==="0"||this.props.defaultActiveKey===0? "" :

创建者:{items.author.name}

} - { - items.item_type==="PROGRAM"? -

编程语言:{items.program_attr.language}

- :"" - } + { + items.item_type==="PROGRAM"? +

编程语言:{items.program_attr.language}

+ :"" + } { items.item_type==="PROGRAM"? items.program_attr.status===0? @@ -187,22 +187,22 @@ class Listjihe extends Component { 撤销

: - items.item_type==="PROGRAM"? - items.program_attr.status===0? -

- - 选用 -

- : -

this.Selectingpracticaltraining(items.id)}> + items.item_type==="PROGRAM"? + items.program_attr.status===0? +

选用

: -

this.Selectingpracticaltraining(items.id)}> - - 选用 -

+

this.Selectingpracticaltraining(items.id)}> + + 选用 +

+ : +

this.Selectingpracticaltraining(items.id)}> + + 选用 +

} { defaultActiveKey===0||defaultActiveKey==="0"? @@ -233,17 +233,17 @@ class Listjihe extends Component { items.program_attr.status===0? "" : +

this.props.showmodels(items.id)}> + + 公开 +

+ :

this.props.showmodels(items.id)}> 公开

- : -

this.props.showmodels(items.id)}> - - 公开 -

: - "" + "" }
@@ -251,7 +251,7 @@ class Listjihe extends Component { } { items.item_type==="PROGRAM"? - "" + "" :

this.props.chakanjiexibool(keindex)}> From 5be89686a79b311949345fe766a4cdde3281d9ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Tue, 7 Jan 2020 15:19:37 +0800 Subject: [PATCH 3/4] =?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/config/webpack.config.prod.js | 4 ++-- .../RepositoryAddFileupload_file.js | 20 ++++++------------- 2 files changed, 8 insertions(+), 16 deletions(-) diff --git a/public/react/config/webpack.config.prod.js b/public/react/config/webpack.config.prod.js index 596843f5f..1fe7a6c93 100644 --- a/public/react/config/webpack.config.prod.js +++ b/public/react/config/webpack.config.prod.js @@ -326,8 +326,8 @@ module.exports = { comments: false }, compress: { - drop_debugger: false, - drop_console: false + drop_debugger: true, + drop_console: true } } }), diff --git a/public/react/src/modules/tpm/shixunchild/Repository/RepositoryAddFileupload_file.js b/public/react/src/modules/tpm/shixunchild/Repository/RepositoryAddFileupload_file.js index fe060835b..0df9a77e4 100644 --- a/public/react/src/modules/tpm/shixunchild/Repository/RepositoryAddFileupload_file.js +++ b/public/react/src/modules/tpm/shixunchild/Repository/RepositoryAddFileupload_file.js @@ -1,5 +1,5 @@ import React, { Component } from 'react'; -import { Form , Upload , Input , notification, message } from 'antd'; +import { Form , Upload , Input} from 'antd'; import axios from 'axios'; import { getupload_git_file } from 'educoder'; import Repositoryfile from './Repositoryfile'; @@ -29,17 +29,14 @@ class RepositoryAddFileupload_files extends Component { } handleChange = (info) => { - console.log(info) + if (info.file.status === 'done'||info.file.status === "uploading") { let fileList = [...info.fileList]; if(info.file.response){ if(info.file.response.status===-1) { - notification.open({ - message: '提示', - description: info.file.response.message, - }) + this.props.showNotification(info.file.response.message) return } } @@ -51,6 +48,7 @@ class RepositoryAddFileupload_files extends Component { } return file; }); + this.props.showNotification("上传成功") this.setState({ fileList }); } }; @@ -59,10 +57,7 @@ class RepositoryAddFileupload_files extends Component { let shixunId = this.props.match.params.shixunId; let {message,filspath}=this.state; if(message===""||message===undefined){ - notification.open({ - message: '提示', - description: '删除文件请先填写提交信息', - }); + this.props.showNotification('删除文件请先填写提交信息'); return } @@ -177,10 +172,7 @@ class RepositoryAddFileupload_files extends Component { beforeUpload: (file) => { let {message}=this.state; if(message===""||message===undefined){ - notification.open({ - message: '提示', - description: '上传文件请先填写提交信息', - }); + this.props.showNotification("上传文件请先填写提交信息") return false } }, From 43530f643102551bfa0d5899085b41fc6904d8a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Tue, 7 Jan 2020 15:41:25 +0800 Subject: [PATCH 4/4] =?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/config/webpack.config.prod.js | 4 ++-- .../shixunchild/Repository/RepositoryAddFileupload_file.js | 7 +++++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/public/react/config/webpack.config.prod.js b/public/react/config/webpack.config.prod.js index 1fe7a6c93..596843f5f 100644 --- a/public/react/config/webpack.config.prod.js +++ b/public/react/config/webpack.config.prod.js @@ -326,8 +326,8 @@ module.exports = { comments: false }, compress: { - drop_debugger: true, - drop_console: true + drop_debugger: false, + drop_console: false } } }), diff --git a/public/react/src/modules/tpm/shixunchild/Repository/RepositoryAddFileupload_file.js b/public/react/src/modules/tpm/shixunchild/Repository/RepositoryAddFileupload_file.js index 0df9a77e4..9c4ae4509 100644 --- a/public/react/src/modules/tpm/shixunchild/Repository/RepositoryAddFileupload_file.js +++ b/public/react/src/modules/tpm/shixunchild/Repository/RepositoryAddFileupload_file.js @@ -29,6 +29,7 @@ class RepositoryAddFileupload_files extends Component { } handleChange = (info) => { + console.log(info) if (info.file.status === 'done'||info.file.status === "uploading") { @@ -44,11 +45,13 @@ class RepositoryAddFileupload_files extends Component { fileList = fileList.slice(-2); fileList = fileList.map(file => { if (file.response) { - file.url = file.response.url; + if (file.response.status===0) { + this.props.showNotification("上传成功") + } } return file; }); - this.props.showNotification("上传成功") + this.setState({ fileList }); } };