chromesetting
杨树林 5 years ago
parent 2aaebd38da
commit 0f67014fb7

@ -71,7 +71,7 @@ class TPMDataset extends Component {
},
],
page: 1,
limit: 5,
limit: 10,
selectedRowKeys: [],
mylistansum:30,
collaboratorList:[],
@ -150,6 +150,44 @@ class TPMDataset extends Component {
}
getdatastwo = (page,limit) => {
let id=this.props.match.params.shixunId;
let collaborators=`/shixuns/${id}/jupyter_data_sets.json`;
axios.get(collaborators,{params:{
page:page,
limit:limit,
}}).then((response)=> {
if(response.status===200){
if (response.data.status === 403||response.data.status === 401||response.data.status === 500) {
}else{
let datalists=[];
for(let i=0;i<response.data.data_sets.length;i++){
const datas=response.data.data_sets;
var timedata = moment(datas[i].created_on).format('YYYY-MM-DD HH:mm');
datalists.push({
timedata:timedata,
author:datas[i].author,
filesize:datas[i].filesize,
id:datas[i].id,
title:datas[i].title,
})
}
this.setState({
collaboratorList: response.data,
data_sets_count:response.data.data_sets_count,
datalist:datalists,
});
}
}
}).catch((error)=>{
console.log(error)
});
}
showModal = (id, status) => {
};
@ -166,6 +204,7 @@ class TPMDataset extends Component {
this.setState({
page: pageNumber,
})
this.getdatastwo(pageNumber,10);
}
onSelectChange = (selectedRowKeys, selectedRows) => {
console.log(`selectedRowKeys: ${selectedRowKeys}`, 'selectedRows: ', selectedRows);
@ -233,10 +272,12 @@ class TPMDataset extends Component {
}
deleteRemovedata(){
debugger
console.log("删除");
console.log(this.state.selectedRowKeysdata);
const url = `/attachements/destroy_files.json`;
axios.delete(url, {
id:this.state.mydata,
id:this.state.selectedRowKeysdata,
})
.then((response) => {
if (response.data) {
@ -374,7 +415,7 @@ class TPMDataset extends Component {
上传文件</p> </Upload></div>
{
mylistansum>0?
data_sets_count>0?
<div
className={selectedRowKeys.length > 0 ? "deletebutomtextcode intermediatecenter mr21" : "deletebutom intermediatecenter mr21"} onClick={()=>this.deleteRemovedata()}>
<p className="deletebutomtext" >删除</p></div>
@ -422,7 +463,7 @@ class TPMDataset extends Component {
border-right: 1px solid #eeeeee;
}
`}</style>
{mylistansum===0?
{data_sets_count===0?
<style>
{
`
@ -450,7 +491,7 @@ class TPMDataset extends Component {
/>
</div>
{
mylistansum>5?
data_sets_count>=11?
<div className="edu-txt-center mt40 mb20">
<Pagination showQuickJumper current={page}
onChange={this.paginationonChanges} pageSize={limit}
@ -460,7 +501,7 @@ class TPMDataset extends Component {
:""
}
{ mylistansum===0?
{ data_sets_count===0?
<NoneData style={{width: '100%'}}></NoneData>:""
}

Loading…
Cancel
Save