chromesetting
杨树林 5 years ago
parent 0439a9a505
commit b9cf999c69

@ -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,8 +376,8 @@ class TPMDataset extends Component {
{
mylistansum>0?
<div
className={selectedRowKeys.length > 0 ? "deletebutomtextcode intermediatecenter mr21" : "deletebutom intermediatecenter mr21"}>
<p className="deletebutomtext">删除</p></div>
className={selectedRowKeys.length > 0 ? "deletebutomtextcode intermediatecenter mr21" : "deletebutom intermediatecenter mr21"} onClick={()=>this.deleteRemovedata()}>
<p className="deletebutomtext" >删除</p></div>
:""
}
</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>
:""

@ -143,12 +143,11 @@ class Challengesjupyter extends Component {
// console.log("domain",parentDomain); //localhost
// document.domain = data;
// document.domain = 'https://47519.test-jupyter.educoder.net';
var ifr = document.getElementById("ifr1");
// window.parent.document.contents().find("#ifr1")[0].contentWindow.iframefunction();
const iframe = document.getElementById('iframe');
console.log("modifyjupyter");
console.log(ifr);
const iframe = document.getElementById('ifr1');
console.log("modifyjupyter");
const frameWindow = iframe.contentWindow;
// const frameWindow = iframe.contentWindow;
const frameWindow = iframe.contentWindow.postMessage('setLocation,' + null + "," + null, '*');
console.log(frameWindow);
const frameDocument = frameWindow.document;
console.log(frameDocument);
@ -344,7 +343,7 @@ class Challengesjupyter extends Component {
{/*https://48888.jupyter.educoder.net/tree?*/}
<div className="pb47">
<iframe src="http://121.41.4.83:48888/notebooks/Untitled.ipynb?kernel_name=python3" sandbox="allow-same-origin allow-scripts allow-top-navigation " scrolling="no" id="ifr1" name="frame" width="100%" height="700" frameborder="0"
<iframe src="https://47524.jupyter.educoder.net/notebooks/data/workspace/myshixun_tpm3575/01.ipynb" sandbox="allow-same-origin allow-scripts allow-top-navigation " scrolling="no" id="frame" name="framename" width="100%" height="700" frameborder="0"
></iframe>

Loading…
Cancel
Save