|
|
|
@ -8,6 +8,7 @@ import TPMNav from './component/TPMNav';
|
|
|
|
|
import axios from 'axios';
|
|
|
|
|
import './tpmmodel/tpmmodel.css'
|
|
|
|
|
import {getUploadActionUrl} from 'educoder';
|
|
|
|
|
import moment from 'moment';
|
|
|
|
|
|
|
|
|
|
const confirm = Modal.confirm;
|
|
|
|
|
|
|
|
|
@ -24,10 +25,10 @@ class TPMDataset extends Component {
|
|
|
|
|
key: 'number',
|
|
|
|
|
align: 'left',
|
|
|
|
|
className: " font-14 wenjiantit",
|
|
|
|
|
width: '300px',
|
|
|
|
|
width: '200px',
|
|
|
|
|
render: (text, record) => (
|
|
|
|
|
<div>
|
|
|
|
|
文件名字
|
|
|
|
|
{record.title}
|
|
|
|
|
</div>
|
|
|
|
|
)
|
|
|
|
|
},
|
|
|
|
@ -37,10 +38,10 @@ class TPMDataset extends Component {
|
|
|
|
|
key: 'number',
|
|
|
|
|
align: 'center',
|
|
|
|
|
className: "edu-txt-center font-14 zuihoushijian",
|
|
|
|
|
width: '125px',
|
|
|
|
|
width: '150px',
|
|
|
|
|
render: (text, record) => (
|
|
|
|
|
<div>
|
|
|
|
|
2019-08-12 12:30
|
|
|
|
|
{record.timedata}
|
|
|
|
|
</div>
|
|
|
|
|
)
|
|
|
|
|
},
|
|
|
|
@ -52,7 +53,7 @@ class TPMDataset extends Component {
|
|
|
|
|
className: "edu-txt-center font-14 ",
|
|
|
|
|
render: (text, record) => (
|
|
|
|
|
<div>
|
|
|
|
|
张大大
|
|
|
|
|
{record.author}
|
|
|
|
|
</div>
|
|
|
|
|
)
|
|
|
|
|
},
|
|
|
|
@ -64,7 +65,7 @@ class TPMDataset extends Component {
|
|
|
|
|
className: "edu-txt-center font-14 ",
|
|
|
|
|
render: (text, record) => (
|
|
|
|
|
<div>
|
|
|
|
|
1.88kb
|
|
|
|
|
{record.filesize}
|
|
|
|
|
</div>
|
|
|
|
|
)
|
|
|
|
|
},
|
|
|
|
@ -76,7 +77,9 @@ class TPMDataset extends Component {
|
|
|
|
|
collaboratorList:[],
|
|
|
|
|
fileList:[],
|
|
|
|
|
file:null,
|
|
|
|
|
|
|
|
|
|
datalist:[],
|
|
|
|
|
data_sets_count:0,
|
|
|
|
|
selectedRowKeysdata:[],
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -88,9 +91,22 @@ class TPMDataset extends Component {
|
|
|
|
|
mysonChange = (e) => {
|
|
|
|
|
console.log(`全选checked = ${e.target.checked}`);
|
|
|
|
|
if (e.target.checked === true) {
|
|
|
|
|
let mydata=[];
|
|
|
|
|
let datas=[];
|
|
|
|
|
for(let i=0;i<this.state.collaboratorList.data_sets.length;i++){
|
|
|
|
|
mydata.push(this.state.collaboratorList.data_sets[i].id);
|
|
|
|
|
datas.push(i);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
this.setState({
|
|
|
|
|
selectedRowKeys: this.state.datas,
|
|
|
|
|
selectedRowKeysdata:mydata,
|
|
|
|
|
selectedRowKeys: datas,
|
|
|
|
|
})
|
|
|
|
|
console.log(mydata);
|
|
|
|
|
console.log(datas);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
this.setState({
|
|
|
|
|
selectedRowKeys: [],
|
|
|
|
@ -108,8 +124,22 @@ class TPMDataset extends Component {
|
|
|
|
|
if (response.data.status === 403||response.data.status === 401||response.data.status === 500) {
|
|
|
|
|
|
|
|
|
|
}else{
|
|
|
|
|
|
|
|
|
|
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');
|
|
|
|
|
this.state.datalist.push({
|
|
|
|
|
timedata:timedata,
|
|
|
|
|
author:datas[i].author,
|
|
|
|
|
filesize:datas[i].filesize,
|
|
|
|
|
id:datas[i].id,
|
|
|
|
|
title:datas[i].title,
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
this.setState({
|
|
|
|
|
collaboratorList: response.data
|
|
|
|
|
collaboratorList: response.data,
|
|
|
|
|
data_sets_count:response.data.data_sets_count,
|
|
|
|
|
datalist:this.state.datalist,
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -144,6 +174,17 @@ class TPMDataset extends Component {
|
|
|
|
|
selectedRowKeys
|
|
|
|
|
}
|
|
|
|
|
);
|
|
|
|
|
let mydata=[];
|
|
|
|
|
for(let i=0;i<selectedRows.length;i++){
|
|
|
|
|
mydata.push(selectedRows[i].id);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
this.setState({
|
|
|
|
|
selectedRowKeysdata:mydata,
|
|
|
|
|
})
|
|
|
|
|
console.log(mydata);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
rowClassName = (record, index) => {
|
|
|
|
@ -191,6 +232,25 @@ class TPMDataset extends Component {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
deleteRemovedata(){
|
|
|
|
|
console.log("删除");
|
|
|
|
|
const url = `/attachements/destroy_files.json`;
|
|
|
|
|
axios.delete(url, {
|
|
|
|
|
id:this.state.mydata,
|
|
|
|
|
})
|
|
|
|
|
.then((response) => {
|
|
|
|
|
if (response.data) {
|
|
|
|
|
const { status } = response.data;
|
|
|
|
|
if (status == 0) {
|
|
|
|
|
this.props.showNotification(`删除成功`);
|
|
|
|
|
this.getdatas()
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
.catch(function (error) {
|
|
|
|
|
console.log(error);
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
deleteAttachment = (file) => {
|
|
|
|
|
console.log(file);
|
|
|
|
|
let id=file.response ==undefined ? file.id : file.response.id
|
|
|
|
@ -226,7 +286,7 @@ class TPMDataset extends Component {
|
|
|
|
|
|
|
|
|
|
render() {
|
|
|
|
|
const {tpmLoading, shixun, user, match} = this.props;
|
|
|
|
|
const {columns, datas, page, limit, selectedRowKeys,mylistansum,fileList} = this.state;
|
|
|
|
|
const {columns, datas, page, limit, selectedRowKeys,mylistansum,fileList,datalist,data_sets_count} = this.state;
|
|
|
|
|
const rowSelection = {
|
|
|
|
|
selectedRowKeys,
|
|
|
|
|
onChange: this.onSelectChange,
|
|
|
|
@ -316,7 +376,7 @@ class TPMDataset extends Component {
|
|
|
|
|
{
|
|
|
|
|
mylistansum>0?
|
|
|
|
|
<div
|
|
|
|
|
className={selectedRowKeys.length > 0 ? "deletebutomtextcode intermediatecenter mr21" : "deletebutom intermediatecenter mr21"}>
|
|
|
|
|
className={selectedRowKeys.length > 0 ? "deletebutomtextcode intermediatecenter mr21" : "deletebutom intermediatecenter mr21"} onClick={()=>this.deleteRemovedata()}>
|
|
|
|
|
<p className="deletebutomtext" >删除</p></div>
|
|
|
|
|
:""
|
|
|
|
|
}
|
|
|
|
@ -381,7 +441,7 @@ class TPMDataset extends Component {
|
|
|
|
|
}
|
|
|
|
|
<div className="edu-table edu-back-white ysltableowss">
|
|
|
|
|
<Table
|
|
|
|
|
dataSource={datas}
|
|
|
|
|
dataSource={datalist}
|
|
|
|
|
columns={columns}
|
|
|
|
|
pagination={false}
|
|
|
|
|
className="mysjysltable4"
|
|
|
|
@ -394,7 +454,7 @@ class TPMDataset extends Component {
|
|
|
|
|
<div className="edu-txt-center mt40 mb20">
|
|
|
|
|
<Pagination showQuickJumper current={page}
|
|
|
|
|
onChange={this.paginationonChanges} pageSize={limit}
|
|
|
|
|
total={mylistansum}
|
|
|
|
|
total={data_sets_count}
|
|
|
|
|
></Pagination>
|
|
|
|
|
</div>
|
|
|
|
|
:""
|
|
|
|
|