Merge branch 'dev_jupyter' of http://bdgit.educoder.net/Hjqreturn/educoder into dev_jupyter
commit
6596073b26
@ -0,0 +1,5 @@
|
||||
class AddPublicStatusToShixun < ActiveRecord::Migration[5.2]
|
||||
def change
|
||||
add_column :shixuns, :public, :integer, default: 0
|
||||
end
|
||||
end
|
@ -0,0 +1,9 @@
|
||||
class MigrateShixunStatus < ActiveRecord::Migration[5.2]
|
||||
def change
|
||||
# 平台上所有已发布且未隐藏的实训都设为公开
|
||||
Shixun.unhidden.update_all(public: 2)
|
||||
|
||||
# 所有已申请发布的实训状态都改为已发布,申请发布改为申请公开
|
||||
Shixun.where(status: 1, id: ApplyAction.where(container_type: 'ApplyShixun', status: 0).pluck(:container_id)).update_all(status: 2, public: 1)
|
||||
end
|
||||
end
|
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,84 @@
|
||||
/*
|
||||
* @Description:
|
||||
* @Author: tangjiang
|
||||
* @Github:
|
||||
* @Date: 2019-12-12 10:34:03
|
||||
* @LastEditors: tangjiang
|
||||
* @LastEditTime: 2019-12-12 20:18:46
|
||||
*/
|
||||
import './index.scss';
|
||||
import React, { useState, useEffect } from 'react';
|
||||
import {Icon, Empty} from 'antd';
|
||||
import MyIcon from '../../../../common/components/MyIcon';
|
||||
|
||||
function LeftPane (props) {
|
||||
|
||||
// 获取数据集
|
||||
const { dataSets = [] } = props;
|
||||
|
||||
const emptyCtx = (
|
||||
<div className="jupyter_empty">
|
||||
<Empty />
|
||||
</div>
|
||||
);
|
||||
|
||||
// const listCtx = ;
|
||||
const [renderCtx, setRenderCtx] = useState(() => (emptyCtx));
|
||||
|
||||
useEffect(() => {
|
||||
if (dataSets.length > 0) {
|
||||
console.log('数据集的个数: ', dataSets.length);
|
||||
const oList = dataSets.map((item, i) => {
|
||||
return (
|
||||
<li className="jupyter_item" key={`key_${i}`}>
|
||||
<Icon type="file-text" className="jupyter_icon"/>
|
||||
<span className="jupyter_name">{item.title}</span>
|
||||
</li>
|
||||
);
|
||||
});
|
||||
|
||||
const oUl = (
|
||||
<ul className="jupyter_data_list">
|
||||
{ oList }
|
||||
</ul>
|
||||
);
|
||||
|
||||
setRenderCtx(oUl);
|
||||
}
|
||||
}, [props]);
|
||||
// 渲染数据集
|
||||
// const renderList = () => {
|
||||
// // 空数据
|
||||
// if (dataSets.length === 0) {
|
||||
// return <div className="jupyter_empty">
|
||||
// <Empty />
|
||||
// </div>
|
||||
// } else {
|
||||
// // 渲染列表
|
||||
// const oList = dataSets.map((item, i) => {
|
||||
// return (
|
||||
// <li className="jupyter_item" key={`key_${i}`}>
|
||||
// <Icon type="file-text" className="jupyter_icon"/>
|
||||
// <span className="jupyter_name">{item.title}</span>
|
||||
// </li>
|
||||
// );
|
||||
// });
|
||||
// return (
|
||||
// <ul className="jupyter_data_list">
|
||||
// { oList }
|
||||
// </ul>
|
||||
// );
|
||||
// }
|
||||
// }
|
||||
|
||||
return (
|
||||
<div className="jupyter_data_sets_area">
|
||||
<h2 className="jupyter_h2_title">
|
||||
<MyIcon type="iconwenti" className="jupyter_data_icon"/> 数据集
|
||||
</h2>
|
||||
{ renderCtx }
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
export default LeftPane;
|
@ -0,0 +1,57 @@
|
||||
.jupyter_data_sets_area{
|
||||
height: 100%;
|
||||
.jupyter_h2_title{
|
||||
height: 44px;
|
||||
line-height: 44px;
|
||||
background-color: #EEEEEE;
|
||||
padding: 0 30px;
|
||||
.jupyter_data_icon{
|
||||
// color: #7286ff;
|
||||
color: #1890ff;
|
||||
font-size: 24px;
|
||||
position: relative;
|
||||
top: 2px;
|
||||
transform: scale(1.5);
|
||||
margin-right: 5px;
|
||||
}
|
||||
}
|
||||
|
||||
.jupyter_data_list,
|
||||
.jupyter_empty{
|
||||
height: calc(100vh - 104px);
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
.jupyter_data_list{
|
||||
.jupyter_item{
|
||||
line-height:45px;
|
||||
border-bottom: 1px solid rgba(238,238,238, 1);
|
||||
padding: 0 30px 0 60px;
|
||||
overflow: hidden;
|
||||
text-overflow:ellipsis;
|
||||
white-space: nowrap;
|
||||
cursor: pointer;
|
||||
transition: .3s;
|
||||
&:hover{
|
||||
background-color: rgba(235, 235, 235, .3);
|
||||
}
|
||||
.jupyter_icon{
|
||||
color: rgb(74, 188, 125);
|
||||
font-size: 16px;
|
||||
transform: scale(1.2);
|
||||
margin-right: 5px;
|
||||
}
|
||||
.jupyter_name{
|
||||
color: #000;
|
||||
font-size: 16px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.jupyter_empty{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 100%;
|
||||
}
|
||||
}
|
@ -0,0 +1,74 @@
|
||||
.jupyter_right_pane_area{
|
||||
position: relative;
|
||||
height: calc(100vh - 60px);
|
||||
// background: pink;
|
||||
|
||||
.jupyter_load_url_error,
|
||||
.jupyter_loading_init{
|
||||
display: flex;
|
||||
position: relative;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
height: 100%;
|
||||
&::before{
|
||||
position: absolute;
|
||||
left: 0;
|
||||
right: 0;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
content: '';
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
.jupyter_loading_init{
|
||||
&::before{
|
||||
background-color: rgba(0,0,0,.2);
|
||||
}
|
||||
}
|
||||
|
||||
.jupyter_load_url_error{
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
// &::before{
|
||||
// background-color: rgba(0,0,0,.2);
|
||||
// }
|
||||
.jupyter_error_txt{
|
||||
position: relative;
|
||||
z-index: 1;
|
||||
font-size: 12px;
|
||||
.jupyter_reload{
|
||||
cursor: pointer;
|
||||
color: #1890ff;
|
||||
}
|
||||
}
|
||||
|
||||
.icon-error{
|
||||
position: relative;
|
||||
color: #DCE0E6;
|
||||
transform: scale(5);
|
||||
top: -35px;
|
||||
}
|
||||
}
|
||||
|
||||
.jupyter_result{
|
||||
height: 100%;
|
||||
.jupyter_iframe{
|
||||
height: calc(100% - 56px);
|
||||
// background: pink;
|
||||
.jupyter_iframe_style{
|
||||
border: none;
|
||||
outline: none;
|
||||
}
|
||||
}
|
||||
.jupyter_submit{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
height: 56px;
|
||||
justify-content: flex-end;
|
||||
padding-right: 30px;
|
||||
}
|
||||
}
|
||||
}
|
File diff suppressed because one or more lines are too long
Loading…
Reference in new issue