|
|
|
@ -7,7 +7,7 @@ import TPMRightSection from './component/TPMRightSection';
|
|
|
|
|
import TPMNav from './component/TPMNav';
|
|
|
|
|
import axios from 'axios';
|
|
|
|
|
import './tpmmodel/tpmmodel.css'
|
|
|
|
|
import {getUploadActionUrl,appendFileSizeToUploadFileAll} from 'educoder';
|
|
|
|
|
import {getUploadActionUrltwo,appendFileSizeToUploadFileAll} from 'educoder';
|
|
|
|
|
import moment from 'moment';
|
|
|
|
|
|
|
|
|
|
const confirm = Modal.confirm;
|
|
|
|
@ -125,7 +125,7 @@ class TPMDataset extends Component {
|
|
|
|
|
getdatas = () => {
|
|
|
|
|
let id=this.props.match.params.shixunId;
|
|
|
|
|
|
|
|
|
|
let collaborators=`/shixuns/${id}/jupyter_data_sets.json`;
|
|
|
|
|
let collaborators=`/shixuns/${id}/get_data_sets.json`;
|
|
|
|
|
axios.get(collaborators,{params:{
|
|
|
|
|
page:1,
|
|
|
|
|
limit:10,
|
|
|
|
@ -289,31 +289,12 @@ class TPMDataset extends Component {
|
|
|
|
|
handleChange = (info) => {
|
|
|
|
|
if(info.file.status == "done" || info.file.status == "uploading" || info.file.status === 'removed'){
|
|
|
|
|
let fileList = info.fileList;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.setState({
|
|
|
|
|
fileList: appendFileSizeToUploadFileAll(fileList),
|
|
|
|
|
});
|
|
|
|
|
if(info.file.status === 'done'){
|
|
|
|
|
console.log("handleChange");
|
|
|
|
|
console.log(info);
|
|
|
|
|
//done 成功就会调用这个方法
|
|
|
|
|
this.getdatas();
|
|
|
|
|
try {
|
|
|
|
|
// let datas=this.state.fileListimgs;
|
|
|
|
|
// for(var i=0;i<info.fileList.length;i++){
|
|
|
|
|
// datas.push(info.fileList[i].originFileObj);
|
|
|
|
|
// }
|
|
|
|
|
// this.setState({
|
|
|
|
|
// fileListimgs:datas,
|
|
|
|
|
// })
|
|
|
|
|
// console.log("datasdatasdatasdatasdatas");
|
|
|
|
|
// console.log(datas);
|
|
|
|
|
}catch (e) {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
// this.props.showNotification(`上传文件成功`);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -348,6 +329,7 @@ class TPMDataset extends Component {
|
|
|
|
|
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
let id=this.props.match.params.shixunId;
|
|
|
|
|
|
|
|
|
|
confirm({
|
|
|
|
|
title: '确定要删除文件吗?',
|
|
|
|
@ -355,7 +337,7 @@ class TPMDataset extends Component {
|
|
|
|
|
cancelText: '取消',
|
|
|
|
|
// content: 'Some descriptions',
|
|
|
|
|
onOk: () => {
|
|
|
|
|
const url = `/attachments/destroy_files.json`;
|
|
|
|
|
const url = `/shixuns/${id}/destroy_data_sets.json`;
|
|
|
|
|
axios.delete(url,
|
|
|
|
|
{ params: {
|
|
|
|
|
id:this.state.selectedRowKeysdata,
|
|
|
|
@ -434,11 +416,12 @@ class TPMDataset extends Component {
|
|
|
|
|
container_id:this.props.match.params.shixunId,
|
|
|
|
|
container_type: "Shixun",
|
|
|
|
|
},
|
|
|
|
|
multiple: true,
|
|
|
|
|
multiple: false,
|
|
|
|
|
//multiple 是否支持多选 查重的时候不能多选 不然弹许多框出来
|
|
|
|
|
// https://github.com/ant-design/ant-design/issues/15505
|
|
|
|
|
// showUploadList={false},然后外部拿到 fileList 数组自行渲染列表。
|
|
|
|
|
// showUploadList: false,
|
|
|
|
|
action: `${getUploadActionUrl()}`,
|
|
|
|
|
action: `${getUploadActionUrltwo(id)}`,
|
|
|
|
|
showUploadList:false,
|
|
|
|
|
onChange: this.handleChange,
|
|
|
|
|
onRemove: this.onAttachmentRemove,
|
|
|
|
|