Merge branch 'dev_jupyter' of https://bdgit.educoder.net/Hjqreturn/educoder into dev_jupyter

chromesetting
daiao 5 years ago
commit 0ae47e424c

@ -31,7 +31,7 @@ export function getUrl(path, goTest) {
// testbdweb.educoder.net testbdweb.trustie.net
// const local = goTest ? 'https://testeduplus2.educoder.net' : 'http://localhost:3000'
// const local = 'https://testeduplus2.educoder.net'
const local = 'https://test-newweb.educoder.net'
const local = 'https://test-jupyterweb.educoder.net'
if (isDev) {
return `${local}${path?path:''}`
}
@ -55,6 +55,10 @@ export function getUrl2(path, goTest) {
export function getUploadActionUrl(path, goTest) {
return `${getUrl()}/api/attachments.json${isDev ? `?debug=${window._debugType || 'admin'}` : ''}`
}
export function getUploadActionUrltwo(id) {
return `${getUrl()}/api/shixuns/${id}/upload_data_sets.json${isDev ? `?debug=${window._debugType || 'admin'}` : ''}`
}
export function getUploadActionUrlOfAuth(id) {
return `${getUrl()}/api/users/accounts/${id}/auth_attachment.json${isDev ? `?debug=${window._debugType || 'admin'}` : ''}`
}

@ -3,10 +3,10 @@
// export { default as OrderStateUtil } from '../routes/Order/components/OrderStateUtil';
export { getImageUrl as getImageUrl, getUrl as getUrl, getUrl2 as getUrl2, setImagesUrl as setImagesUrl
, getUploadActionUrl as getUploadActionUrl, getUploadActionUrlOfAuth as getUploadActionUrlOfAuth
, getUploadActionUrl as getUploadActionUrl,getUploadActionUrltwo as getUploadActionUrltwo , getUploadActionUrlOfAuth as getUploadActionUrlOfAuth
, getTaskUrlById as getTaskUrlById, TEST_HOST ,htmlEncode as htmlEncode } from './UrlTool';
export { default as queryString } from './UrlTool2';
export { SnackbarHOC as SnackbarHOC } from './SnackbarHOC';
export { trigger as trigger, on as on, off as off
@ -31,7 +31,7 @@ export { trace_collapse, trace, debug, info, warn, error, trace_c, debug_c, info
export { EDU_ADMIN, EDU_BUSINESS, EDU_SHIXUN_MANAGER, EDU_SHIXUN_MEMBER, EDU_CERTIFICATION_TEACHER
, EDU_GAME_MANAGER, EDU_TEACHER, EDU_NORMAL} from './Const'
export { default as AttachmentList } from './components/attachment/AttachmentList'
export { themes, ThemeContext } from './context/ThemeContext'

@ -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,

@ -4,7 +4,7 @@
* @Github:
* @Date: 2019-12-12 10:34:03
* @LastEditors: tangjiang
* @LastEditTime: 2019-12-13 15:31:35
* @LastEditTime: 2019-12-13 16:28:33
*/
import './index.scss';
import React, { useState, useEffect } from 'react';
@ -36,7 +36,11 @@ function LeftPane (props) {
const oList = dataSets.map((item, i) => {
return (
<li className="jupyter_item" key={`key_${i}`}>
<Tooltip placement="right" title={'文字提示信息'}>
<Tooltip
placement="right"
title={item.file_path}
mouseLeaveDelay={0.3}
>
<Icon type="file-text" className="jupyter_icon"/>
<span className="jupyter_name">{item.title}</span>
</Tooltip>

@ -4,7 +4,7 @@
* @Github:
* @Date: 2019-12-12 09:07:07
* @LastEditors: tangjiang
* @LastEditTime: 2019-12-13 14:30:51
* @LastEditTime: 2019-12-13 16:00:45
*/
import axios from 'axios';
@ -15,7 +15,7 @@ export async function fetchJupyterInfo (identifier) {
}
// 获取数据集
export async function fetchJupyterTpiDataSet (identifier, params) {
const url = `/shixuns/${identifier}/jupyter_data_sets.json`;
const url = `/shixuns/${identifier}/get_data_sets.json`;
return axios.get(url, { params });
}
// 获取 tpi url

Loading…
Cancel
Save