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

@ -71,7 +71,7 @@ class TPMDataset extends Component {
}, },
], ],
page: 1, page: 1,
limit: 5, limit: 10,
selectedRowKeys: [], selectedRowKeys: [],
mylistansum:30, mylistansum:30,
collaboratorList:[], 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) => { showModal = (id, status) => {
}; };
@ -166,6 +204,7 @@ class TPMDataset extends Component {
this.setState({ this.setState({
page: pageNumber, page: pageNumber,
}) })
this.getdatastwo(pageNumber,10);
} }
onSelectChange = (selectedRowKeys, selectedRows) => { onSelectChange = (selectedRowKeys, selectedRows) => {
console.log(`selectedRowKeys: ${selectedRowKeys}`, 'selectedRows: ', selectedRows); console.log(`selectedRowKeys: ${selectedRowKeys}`, 'selectedRows: ', selectedRows);
@ -233,10 +272,12 @@ class TPMDataset extends Component {
} }
deleteRemovedata(){ deleteRemovedata(){
debugger
console.log("删除"); console.log("删除");
console.log(this.state.selectedRowKeysdata);
const url = `/attachements/destroy_files.json`; const url = `/attachements/destroy_files.json`;
axios.delete(url, { axios.delete(url, {
id:this.state.mydata, id:this.state.selectedRowKeysdata,
}) })
.then((response) => { .then((response) => {
if (response.data) { if (response.data) {
@ -374,7 +415,7 @@ class TPMDataset extends Component {
上传文件</p> </Upload></div> 上传文件</p> </Upload></div>
{ {
mylistansum>0? data_sets_count>0?
<div <div
className={selectedRowKeys.length > 0 ? "deletebutomtextcode intermediatecenter mr21" : "deletebutom intermediatecenter mr21"} onClick={()=>this.deleteRemovedata()}> className={selectedRowKeys.length > 0 ? "deletebutomtextcode intermediatecenter mr21" : "deletebutom intermediatecenter mr21"} onClick={()=>this.deleteRemovedata()}>
<p className="deletebutomtext" >删除</p></div> <p className="deletebutomtext" >删除</p></div>
@ -422,7 +463,7 @@ class TPMDataset extends Component {
border-right: 1px solid #eeeeee; border-right: 1px solid #eeeeee;
} }
`}</style> `}</style>
{mylistansum===0? {data_sets_count===0?
<style> <style>
{ {
` `
@ -450,7 +491,7 @@ class TPMDataset extends Component {
/> />
</div> </div>
{ {
mylistansum>5? data_sets_count>=11?
<div className="edu-txt-center mt40 mb20"> <div className="edu-txt-center mt40 mb20">
<Pagination showQuickJumper current={page} <Pagination showQuickJumper current={page}
onChange={this.paginationonChanges} pageSize={limit} onChange={this.paginationonChanges} pageSize={limit}
@ -460,7 +501,7 @@ class TPMDataset extends Component {
:"" :""
} }
{ mylistansum===0? { data_sets_count===0?
<NoneData style={{width: '100%'}}></NoneData>:"" <NoneData style={{width: '100%'}}></NoneData>:""
} }

Loading…
Cancel
Save