Merge branches 'dev_aliyun' and 'dev_newysm' of https://bdgit.educoder.net/Hjqreturn/educoder into dev_newysm

chromesetting
杨树明 5 years ago
commit 181fa8f36a

@ -32,9 +32,9 @@ class CommentsController < ApplicationController
# 列表
def index
disscusses = @hack.disscusses.where(:root_id => nil)
@disscuss_count = disscusses.count
@disscusses= paginate disscusses
discusses = @hack.discusses.where(root_id: nil)
@discusses_count = discusses.count
@discusses= paginate discusses
end
# 删除
@ -46,7 +46,7 @@ class CommentsController < ApplicationController
private
def find_hack
@hack = Hack.find_by_identifier params[:identifier]
@hack = Hack.find_by_identifier(params[:hack_identifier])
end
def comment_params

@ -1,4 +1,4 @@
json.disscuss_count @disscuss_count
json.disscuss_count @discusses_count
json.comments @discusses do |discuss|
json.partial! 'comments/discuss', locals: { discuss: discuss}
json.children discuss.child_discuss(current_user) do |c_d|

@ -1,6 +1,6 @@
import React, {Component} from 'react';
import {Redirect} from 'react-router';
import {List, Typography, Tag, Modal, Radio, Checkbox, Table, Pagination,Upload,notification} from 'antd';
import {List, Typography, Tag, Modal, Radio, Checkbox, Table, Pagination,Upload,Button} from 'antd';
import { NoneData } from 'educoder'
import TPMRightSection from './component/TPMRightSection';
@ -85,6 +85,7 @@ class TPMDataset extends Component {
checked: false,
showmodel:false,
itemtypebool:false,
Buttonloading:false
}
}
@ -296,7 +297,11 @@ class TPMDataset extends Component {
// console.log("handleChange123123");
// console.log(info);
//debugger
this.setState({
Buttonloading:true
})
if(info.file.status == "done" || info.file.status == "uploading" || info.file.status === 'removed'){
let fileList = info.fileList;
this.setState({
fileList: appendFileSizeToUploadFileAll(fileList),
@ -309,7 +314,10 @@ class TPMDataset extends Component {
}else{
this.getdatas();
this.setState({
Buttonloading:false
})
// this.props.showNotification(`上传成功`);
}
}
}
@ -329,9 +337,13 @@ class TPMDataset extends Component {
showmodel:true,
tittest:info.file.response.message,
itemtypebool:itemtype>-1?true:itemtype<=-1?false:false,
Buttonloading:false
})
}else{
}else{
this.setState({
Buttonloading:false
})
}
}
@ -445,7 +457,12 @@ class TPMDataset extends Component {
showmodel: false,
})
}
ButtonloadinghandleChange=()=>{
// this.props.showNotification(`zhzzzzz`);
// this.setState({
// Buttonloading:true
// })
}
render() {
const {tpmLoading, shixun, user, match} = this.props;
const {columns, page, limit, selectedRowKeys,mylistansum,fileList,datalist,data_sets_count,loadingstate} = this.state;
@ -473,11 +490,16 @@ class TPMDataset extends Component {
beforeUpload: (file) => {
//上传前的操作
// console.log('beforeUpload', file.name);
const isLt150M = file.size / 1024 / 1024 < 150;
if (!isLt150M) {
this.props.showNotification('文件大小必须小于150MB!');
this.props.showNotification(`文件上传中`);
const isLt300M = file.size / 1024 / 1024 <= 300;
if (!isLt300M) {
this.setState({
Buttonloading:false
})
this.props.showNotification('文件大小必须小于等于300MB!');
}
return isLt150M;
return isLt300M;
},
};
// console.log("showmodelshowmodel");
@ -514,12 +536,20 @@ class TPMDataset extends Component {
.ant-upload-list{
display:none
}
.deletebuttom{
color: #fff !important;
}
.deletebuttom:hover{
color: #fff !important;
background: #29BD8B !important;
}
`
}
</style>
<div className="deletebuttom intermediatecenter "> <Upload {...uploadProps}><p className="deletebuttomtest" type="upload">
上传文件</p> </Upload></div>
<div className="intermediatecenter deletebuttom">
<Upload {...uploadProps}>
<Button className={"deletebuttom"} loading={this.state.Buttonloading} onClick={ this.ButtonloadinghandleChange}>{this.state.Buttonloading===true?"上传中":"上传文件"}</Button>
</Upload></div>
{
data_sets_count>0?
<div

@ -80,7 +80,7 @@
.deletebuttom{
width:85px;
height:30px;
background:#29BD8B;
background:#29BD8B !important;
border-radius:3px;
cursor:pointer
}

Loading…
Cancel
Save