Merge remote-tracking branch 'origin/dev_item_bank' into dev_item_bank

yslnewtiku
杨树明 5 years ago
commit c0e2a90454

Binary file not shown.

After

Width:  |  Height:  |  Size: 108 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 148 KiB

@ -524,7 +524,7 @@ li.li-width15{width: 15%;text-align: left}
li.li-width7{width: 7%;text-align: left} li.li-width7{width: 7%;text-align: left}
/*-----------------------------在线课堂动态----------------------------------*/ /*-----------------------------在线课堂动态----------------------------------*/
.courseHead{width: 100%;margin-bottom:40px;background-size: 100% 100%;background-image: url("/images/educoder/course-detail.jpg");height: 240px; .courseHead{width: 100%;margin-bottom:40px;background-size: 100% 100%;background-image: url("/images/educoder/courtailsbdpicture.jpg");height: 240px;
justify-content: center;align-items: center;display: -webkit-flex; justify-content: center;align-items: center;display: -webkit-flex;
background-size: cover; background-size: cover;
background-position: center; background-position: center;

File diff suppressed because one or more lines are too long

@ -27,7 +27,7 @@ function onMessageByLocalStorage(eventName, callback) {
} }
window.addEventListener("storage", function(ev) { window.addEventListener("storage", function(ev) {
const cb = localStorageMap[ev.key]; const cb = localStorageMap[ev.key];
console.log('storage event:', ev) // console.log('storage event:', ev)
if (cb) { if (cb) {
cb(JSON.parse(ev.newValue)) cb(JSON.parse(ev.newValue))
} }

@ -4,7 +4,7 @@
* @Github: * @Github:
* @Date: 2019-12-17 17:35:17 * @Date: 2019-12-17 17:35:17
* @LastEditors : tangjiang * @LastEditors : tangjiang
* @LastEditTime : 2019-12-26 20:00:56 * @LastEditTime : 2019-12-27 11:05:17
*/ */
import './index.scss'; import './index.scss';
import 'quill/dist/quill.core.css'; // 核心样式 import 'quill/dist/quill.core.css'; // 核心样式
@ -88,7 +88,7 @@ function CommentItem ({
}; };
const handleShowUploadImage = (url) => { const handleShowUploadImage = (url) => {
console.log('==============>>>>>>>>>>>>',url); // console.log('==============>>>>>>>>>>>>',url);
setUrl(url); setUrl(url);
} }
// 评论内容 // 评论内容
@ -245,7 +245,9 @@ function CommentItem ({
{/* 显示上传的图片信息 */} {/* 显示上传的图片信息 */}
<div className="show_upload_image" style={{ display: url ? 'block' : 'none'}}> <div className="show_upload_image" style={{ display: url ? 'block' : 'none'}}>
<Icon type="close" className="image_close" onClick={handleClose}/> <Icon type="close" className="image_close" onClick={handleClose}/>
<img className="image_info" src={url} alt=""/> <div className="image_info">
<img className="image" src={url} alt=""/>
</div>
</div> </div>
</div> </div>
</li> </li>

@ -100,16 +100,23 @@ $ml: 20px;
width:100%; width:100%;
content: ''; content: '';
background: #000; background: #000;
opacity: .5; opacity: .7;
} }
.image_info{ .image_info{
display: flex;
position: absolute; position: absolute;
width: 80%; width: 80%;
height: 80%; height: 80%;
left: 10%; left: 10%;
top: 10%; top: 10%;
background: green; justify-content: center;
align-items: center;
// background: green;
.image{
display: block;
width: 100%;
}
} }
.image_close{ .image_close{

@ -4,7 +4,7 @@
* @Github: * @Github:
* @Date: 2019-12-16 15:50:45 * @Date: 2019-12-16 15:50:45
* @LastEditors : tangjiang * @LastEditors : tangjiang
* @LastEditTime : 2019-12-27 08:57:37 * @LastEditTime : 2019-12-27 11:04:43
*/ */
import Quill from "quill"; import Quill from "quill";
@ -17,7 +17,7 @@ export default class ImageBlot extends BlockEmbed {
const node = super.create(); const node = super.create();
node.setAttribute('alt', value.alt); node.setAttribute('alt', value.alt);
node.setAttribute('src', value.url); node.setAttribute('src', value.url);
console.log('~~~~~~~~~~~', node, value); // console.log('~~~~~~~~~~~', node, value);
node.addEventListener('click', function () { node.addEventListener('click', function () {
value.onclick(value.url); value.onclick(value.url);
}, false); }, false);

@ -4,7 +4,7 @@
* @Github: * @Github:
* @Date: 2019-12-18 08:49:30 * @Date: 2019-12-18 08:49:30
* @LastEditors : tangjiang * @LastEditors : tangjiang
* @LastEditTime : 2019-12-26 19:36:00 * @LastEditTime : 2019-12-27 10:36:11
*/ */
import './index.scss'; import './index.scss';
import 'quill/dist/quill.core.css'; // 核心样式 import 'quill/dist/quill.core.css'; // 核心样式
@ -121,7 +121,7 @@ function QuillForEditor ({
const previous = quill.getContents() const previous = quill.getContents()
if (value && value.hasOwnProperty('ops')) { if (value && value.hasOwnProperty('ops')) {
console.log(value.ops); // console.log(value.ops);
const ops = value.ops || []; const ops = value.ops || [];
ops.forEach((item, i) => { ops.forEach((item, i) => {
if (item.insert['image']) { if (item.insert['image']) {
@ -131,7 +131,7 @@ function QuillForEditor ({
} }
const current = value const current = value
console.log('+++++', current); // console.log('+++++', current);
if (!deepEqual(previous, current)) { if (!deepEqual(previous, current)) {
setSelection(quill.getSelection()) setSelection(quill.getSelection())
if (typeof value === 'string') { if (typeof value === 'string') {

@ -728,7 +728,12 @@ class CoursesBanner extends Component {
<Breadcrumb.Item className={"pointer"}> <Breadcrumb.Item className={"pointer"}>
<Tooltip visible={coursedata.teacher_applies_count===undefined?false:coursedata.teacher_applies_count>0?true:false} <Tooltip visible={coursedata.teacher_applies_count===undefined?false:coursedata.teacher_applies_count>0?true:false}
placement="topLeft" placement="topLeft"
title={<pre>{coursedata.teacher_applies_count===undefined?"":coursedata.teacher_applies_count>0?<span>您有{coursedata.teacher_applies_count}条新的加入申请<a className={"daishenp"} onClick={()=>this.setHistoryFun("/courses/"+this.props.match.params.coursesId+"/teachers?tab=2")}>待审批</a></span>:""}</pre>}> title={<pre>{coursedata.teacher_applies_count===undefined?"":coursedata.teacher_applies_count>0?<span>您有{coursedata.teacher_applies_count}条新的加入申请<a className={"daishenp"} onClick={()=>this.setHistoryFun("/courses/"+this.props.match.params.coursesId+"/teachers?tab=2")}>
<span style={{
color:"#FFA804"
}}>
待审批
</span></a></span>:""}</pre>}>
<span className="color-grey-c font-16" onClick={()=>this.setHistoryFun("/courses/"+this.props.match.params.coursesId+"/teachers")}> <span className="color-grey-c font-16" onClick={()=>this.setHistoryFun("/courses/"+this.props.match.params.coursesId+"/teachers")}>
<span className={"mr10"}>教师</span> <span className={"mr10"}>教师</span>
<span className={"mr10"}>{coursedata.teacher_count}</span> <span className={"mr10"}>{coursedata.teacher_count}</span>

@ -34,6 +34,7 @@ class NewShixunModel extends Component{
getdatalist=(page,type,newstatus,keyword,order,diff,limit,pagetype,sorts)=>{ getdatalist=(page,type,newstatus,keyword,order,diff,limit,pagetype,sorts)=>{
let newsort=sorts; let newsort=sorts;
let no_jupyter=undefined;
if(this.props.type==="shixuns"&&type==="mine"){ if(this.props.type==="shixuns"&&type==="mine"){
if(this.props&&this.props.user.course_name===undefined){ if(this.props&&this.props.user.course_name===undefined){
newsort="created_at"; newsort="created_at";
@ -41,6 +42,12 @@ class NewShixunModel extends Component{
newsort="publish_time"; newsort="publish_time";
} }
} }
if(this.props.type==="shixuns"){
if(this.props&&this.props.user.course_name===undefined){
}else{
no_jupyter=1;
}
}
this.setState({ this.setState({
isspinning:true isspinning:true
}) })
@ -51,6 +58,7 @@ class NewShixunModel extends Component{
}else{ }else{
url="/subject_lists.json"; url="/subject_lists.json";
} }
axios.get(url,{params:{ axios.get(url,{params:{
page:page, page:page,
type:type, type:type,
@ -59,7 +67,8 @@ class NewShixunModel extends Component{
order:order, order:order,
diff:diff, diff:diff,
limit:limit, limit:limit,
sort:newsort sort:newsort,
no_jupyter:no_jupyter
}}).then((response) => { }}).then((response) => {
if(response.data){ if(response.data){
if(pagetype===undefined){ if(pagetype===undefined){

@ -254,7 +254,7 @@ class DeveloperHome extends React.PureComponent {
content: `确定要删除${record.name}吗?`, content: `确定要删除${record.name}吗?`,
onOk () { onOk () {
// 调用删除接口 // 调用删除接口
console.log(record.identifier); // console.log(record.identifier);
deleteItem(record.identifier); deleteItem(record.identifier);
} }
}); });

@ -4,7 +4,7 @@
* @Github: * @Github:
* @Date: 2019-11-25 17:50:33 * @Date: 2019-11-25 17:50:33
* @LastEditors : tangjiang * @LastEditors : tangjiang
* @LastEditTime: 2019-12-19 19:32:08 * @LastEditTime : 2019-12-27 10:36:54
*/ */
import React, { useState } from 'react'; import React, { useState } from 'react';
import { fromStore, toStore } from 'educoder'; import { fromStore, toStore } from 'educoder';
@ -68,7 +68,7 @@ const SettingDrawer = (props) => {
); );
} else if (Array.isArray(value)) { } else if (Array.isArray(value)) {
const defaultValue = ctx.type === 'font' ? fontSize : theme; const defaultValue = ctx.type === 'font' ? fontSize : theme;
console.log('++', defaultValue); // console.log('++', defaultValue);
if (type === 'select') { if (type === 'select') {
const child = ctx.value.map((opt, i) => { const child = ctx.value.map((opt, i) => {
return ( return (

@ -4,7 +4,7 @@
* @Github: * @Github:
* @Date: 2019-11-27 15:02:52 * @Date: 2019-11-27 15:02:52
* @LastEditors : tangjiang * @LastEditors : tangjiang
* @LastEditTime : 2019-12-27 09:22:08 * @LastEditTime : 2019-12-27 10:32:25
*/ */
import './index.scss'; import './index.scss';
import React, { useState, useRef, useEffect } from 'react'; import React, { useState, useRef, useEffect } from 'react';
@ -29,6 +29,7 @@ const maps = {
function MyMonacoEditor (props, ref) { function MyMonacoEditor (props, ref) {
const { const {
code,
notice, notice,
language, language,
identifier, identifier,
@ -41,7 +42,7 @@ function MyMonacoEditor (props, ref) {
} = props; } = props;
const [showDrawer, setShowDrawer] = useState(false); // 控制配置滑框 const [showDrawer, setShowDrawer] = useState(false); // 控制配置滑框
const [editCode, setEditCode] = useState(''); // const [editCode, setEditCode] = useState('');
// const [curLang, setCurLang] = useState('C'); // const [curLang, setCurLang] = useState('C');
const [fontSize, setFontSize] = useState(() => { // 字体 const [fontSize, setFontSize] = useState(() => { // 字体
return +fromStore('oj_fontSize') || 14; return +fromStore('oj_fontSize') || 14;
@ -52,9 +53,9 @@ function MyMonacoEditor (props, ref) {
const [ height, setHeight ] = useState('calc(100% - 56px)'); const [ height, setHeight ] = useState('calc(100% - 56px)');
const editorRef = useRef(null); const editorRef = useRef(null);
useEffect(() => { // useEffect(() => {
setEditCode(props.code || ''); // setEditCode(props.code || '');
}, [props]); // }, [props]);
useEffect(() => { useEffect(() => {
setHeight(showOrHideControl ? 'calc(100% - 378px)' : 'calc(100% - 56px)'); setHeight(showOrHideControl ? 'calc(100% - 378px)' : 'calc(100% - 56px)');
@ -80,11 +81,11 @@ function MyMonacoEditor (props, ref) {
// 文本框内容变化时,记录文本框内容 // 文本框内容变化时,记录文本框内容
const handleEditorChange = (origin, monaco) => { const handleEditorChange = (origin, monaco) => {
editorRef.current = monaco; // 获取当前monaco实例 editorRef.current = monaco; // 获取当前monaco实例
setEditCode(origin); // 保存编辑器初始值 // setEditCode(origin); // 保存编辑器初始值
editorRef.current.onDidChangeModelContent(e => { // 监听编辑器内容的变化 editorRef.current.onDidChangeModelContent(e => { // 监听编辑器内容的变化
// TODO 需要优化 节流 // TODO 需要优化 节流
const val = editorRef.current.getValue(); const val = editorRef.current.getValue();
setEditCode(val); // setEditCode(val);
onCodeChange(val); onCodeChange(val);
// 值一变化保存当前代码值 // 值一变化保存当前代码值
// saveUserInputCode(val); // saveUserInputCode(val);
@ -179,7 +180,7 @@ function MyMonacoEditor (props, ref) {
height={height} height={height}
width="100%" width="100%"
language={language && language.toLowerCase()} language={language && language.toLowerCase()}
value={editCode} value={code || ''}
options={editorOptions} options={editorOptions}
theme={theme} // dark || light theme={theme} // dark || light
editorDidMount={handleEditorChange} editorDidMount={handleEditorChange}
@ -210,12 +211,12 @@ const mapStateToProps = (state) => {
} }
}; };
const mapDispatchToProps = (dispatch) => ({ // const mapDispatchToProps = (dispatch) => ({
// saveUserInputCode: (code) => dispatch(actions.saveUserInputCode(code)), // // saveUserInputCode: (code) => dispatch(actions.saveUserInputCode(code)),
}); // });
// MyMonacoEditor = React.forwardRef(MyMonacoEditor); // MyMonacoEditor = React.forwardRef(MyMonacoEditor);
export default connect( export default connect(
mapStateToProps, mapStateToProps,
mapDispatchToProps // mapDispatchToProps
)(CNotificationHOC() (MyMonacoEditor)); )(CNotificationHOC() (MyMonacoEditor));

@ -4,7 +4,7 @@
* @Github: * @Github:
* @Date: 2019-11-21 09:19:38 * @Date: 2019-11-21 09:19:38
* @LastEditors : tangjiang * @LastEditors : tangjiang
* @LastEditTime : 2019-12-26 15:33:01 * @LastEditTime : 2019-12-27 10:37:41
*/ */
import './index.scss'; import './index.scss';
import React from 'react'; import React from 'react';
@ -134,10 +134,10 @@ const AddTestDemo = (props) => {
// }; // };
// const {input = {}, output = {}} = (testCasesValidate[index] = {}); // const {input = {}, output = {}} = (testCasesValidate[index] = {});
const activePane = { // const activePane = {
defaultActiveKey: [isOpen ? '1' : ''] // defaultActiveKey: [isOpen ? '1' : '']
}; // };
console.log(activePane); // console.log(activePane);
// 切换手风琴 // 切换手风琴
const handleChangeCollapse = () => { const handleChangeCollapse = () => {
@ -184,7 +184,7 @@ const AddTestDemo = (props) => {
const mapStateToProps = (state) => { const mapStateToProps = (state) => {
const {identifier, loading} = state.ojFormReducer; const {identifier, loading} = state.ojFormReducer;
console.log(state.ojFormReducer); // console.log(state.ojFormReducer);
return { return {
identifier, identifier,
loading, loading,

@ -4,7 +4,7 @@
* @Github: * @Github:
* @Date: 2019-11-20 10:35:40 * @Date: 2019-11-20 10:35:40
* @LastEditors : tangjiang * @LastEditors : tangjiang
* @LastEditTime : 2019-12-26 16:00:57 * @LastEditTime : 2019-12-27 10:37:58
*/ */
import './index.scss'; import './index.scss';
// import 'katex/dist/katex.css'; // import 'katex/dist/katex.css';
@ -175,11 +175,11 @@ class EditTab extends React.Component {
}; };
// 提交测试用例 // 提交测试用例
const handleSubmitTest = (obj) => { const handleSubmitTest = (obj) => {
console.log('提交的测试用例: ', obj); // console.log('提交的测试用例: ', obj);
}; };
// 删除测试用例 // 删除测试用例
const handleDeleteTest = (obj) => { const handleDeleteTest = (obj) => {
console.log('删除的测试用例: ', obj); // console.log('删除的测试用例: ', obj);
deleteTestCase(obj); deleteTestCase(obj);
}; };
const renderTestCase = () => { const renderTestCase = () => {
@ -223,9 +223,9 @@ class EditTab extends React.Component {
// 描述信息变化时 // 描述信息变化时
const handleContentChange = (content, quill) => { const handleContentChange = (content, quill) => {
console.log('描述信息为: ', content); // console.log('描述信息为: ', content);
// if (quill.getText()) // if (quill.getText())
console.log('========>>>>>', quill.getText().length); // console.log('========>>>>>', quill.getText().length);
if (quill.getText().length === 1) { if (quill.getText().length === 1) {
this.handleChangeDescription(''); this.handleChangeDescription('');
} else { } else {

@ -4,7 +4,7 @@
* @Github: * @Github:
* @Date: 2019-12-01 10:18:35 * @Date: 2019-12-01 10:18:35
* @LastEditors : tangjiang * @LastEditors : tangjiang
* @LastEditTime : 2019-12-26 13:51:40 * @LastEditTime : 2019-12-27 10:17:07
*/ */
import './index.scss'; import './index.scss';
import React from 'react'; import React from 'react';
@ -17,7 +17,8 @@ function RightPane (props, ref) {
const { const {
// identifier, // identifier,
// code, code,
language,
// onSubmitForm, // onSubmitForm,
saveOjFormCode saveOjFormCode
} = props; } = props;
@ -44,8 +45,8 @@ function RightPane (props, ref) {
return ( return (
<div className={'right_pane_code_wrap'}> <div className={'right_pane_code_wrap'}>
<MyMonacoEditor <MyMonacoEditor
language={props.language} language={language}
code={props.code} code={code}
onCodeChange={handleCodeChange}/> onCodeChange={handleCodeChange}/>
{/* <ControlSetting {/* <ControlSetting
@ -65,7 +66,6 @@ const mapStateToProps = (state) => {
identifier, identifier,
language: ojForm.language, language: ojForm.language,
input: (testCases[0] && testCases[0].input) || '', input: (testCases[0] && testCases[0].input) || '',
} }
}; };
const mapDispatchToProps = (dispatch) => ({ const mapDispatchToProps = (dispatch) => ({

@ -4,7 +4,7 @@
* @Github: * @Github:
* @Date: 2019-12-04 08:36:21 * @Date: 2019-12-04 08:36:21
* @LastEditors : tangjiang * @LastEditors : tangjiang
* @LastEditTime : 2019-12-26 14:04:16 * @LastEditTime : 2019-12-27 10:38:42
*/ */
import './index.scss'; import './index.scss';
import React, { useState, useEffect } from 'react'; import React, { useState, useEffect } from 'react';
@ -43,7 +43,7 @@ function RecordDetail (props) {
useEffect(() => { useEffect(() => {
setDetail(recordDetail); setDetail(recordDetail);
console.log('详情: ', recordDetail); // console.log('详情: ', recordDetail);
if (recordDetail) { if (recordDetail) {
const { user, myproblem_identifier, code } = recordDetail; const { user, myproblem_identifier, code } = recordDetail;
setUser(user); setUser(user);

@ -4,7 +4,7 @@
* @Github: * @Github:
* @Date: 2019-11-23 10:53:19 * @Date: 2019-11-23 10:53:19
* @LastEditors : tangjiang * @LastEditors : tangjiang
* @LastEditTime : 2019-12-26 15:02:12 * @LastEditTime : 2019-12-27 10:25:14
*/ */
import './index.scss'; import './index.scss';
import React, { useEffect, useState } from 'react'; import React, { useEffect, useState } from 'react';
@ -90,9 +90,9 @@ function StudentStudy (props) {
const handleClickEditor = (identifier) => { const handleClickEditor = (identifier) => {
if (!identifier) return; if (!identifier) return;
changeShowOrHideControl(false); changeShowOrHideControl(false);
props.saveEditorCodeForDetail(); props.saveEditorCodeForDetail('');
props.history.push(`/problems/${identifier}/edit`);
props.clearOjForUserReducer(); props.clearOjForUserReducer();
props.history.push(`/problems/${identifier}/edit`);
} }
// 处理退出 // 处理退出
const handleClickQuit = () => { const handleClickQuit = () => {
@ -100,7 +100,7 @@ function StudentStudy (props) {
props.clearOjForUserReducer(); props.clearOjForUserReducer();
// 将控制台关闭 // 将控制台关闭
changeShowOrHideControl(false); changeShowOrHideControl(false);
props.saveEditorCodeForDetail(); props.saveEditorCodeForDetail('');
props.history.push('/problems'); props.history.push('/problems');
} }

@ -4,7 +4,7 @@
* @Github: * @Github:
* @Date: 2019-11-27 09:49:33 * @Date: 2019-11-27 09:49:33
* @LastEditors : tangjiang * @LastEditors : tangjiang
* @LastEditTime : 2019-12-25 14:45:20 * @LastEditTime : 2019-12-27 10:39:00
*/ */
import './index.scss'; import './index.scss';
import React, { useState, useEffect } from 'react'; import React, { useState, useEffect } from 'react';
@ -105,7 +105,7 @@ const CommitRecord = (props) => {
// expected_output // expected_output
} = commitRecordDetail; } = commitRecordDetail;
if (Object.keys(commitRecordDetail).length > 0) { if (Object.keys(commitRecordDetail).length > 0) {
console.log('当前状态====》》》', status); // console.log('当前状态====》》》', status);
const classes = status === 0 ? 'record_result_suc' : 'record_result_err'; const classes = status === 0 ? 'record_result_suc' : 'record_result_err';
const showErrorCode = status !== 0 ? `ecord_error_info show_error_code` : `ecord_error_info`; const showErrorCode = status !== 0 ? `ecord_error_info show_error_code` : `ecord_error_info`;
const showErrorCopy = status !== 0 ? `copy_error show_error_copy` : `copy_error`; const showErrorCopy = status !== 0 ? `copy_error show_error_copy` : `copy_error`;

@ -4,7 +4,7 @@
* @Github: * @Github:
* @Date: 2019-11-27 14:59:51 * @Date: 2019-11-27 14:59:51
* @LastEditors : tangjiang * @LastEditors : tangjiang
* @LastEditTime : 2019-12-27 09:23:15 * @LastEditTime : 2019-12-27 10:28:41
*/ */
import React, { useState, useEffect } from 'react'; import React, { useState, useEffect } from 'react';
import {connect} from 'react-redux'; import {connect} from 'react-redux';

@ -569,7 +569,7 @@ class Questionitem_banks extends Component {
"" ""
: :
<Bottomsubmit {...this.props} {...this.state} bottomvalue={item_type === "PROGRAM" ? "创建" : "保存"} <Bottomsubmit {...this.props} {...this.state} bottomvalue={item_type === "PROGRAM" ? "创建" : "保存"}
onSubmits={() => this.preservation()} url={'/question'}></Bottomsubmit> onSubmits={() => this.preservation()} url={item_type === "PROGRAM" ?'/problems':'/question'}></Bottomsubmit>
} }
</div> </div>
) )

@ -968,31 +968,38 @@ submittojoinclass=(value)=>{
) )
}) })
} }
<style> {/*<style>*/}
{ {/* {*/}
` {/* `*/}
.queyppors { {/* .queyppors {*/}
top: 63px !important; {/* top: 63px !important;*/}
} {/* }*/}
{/* .ant-popover-inner-content {*/}
{/* padding:0px !important;*/}
{/* }*/}
{/* `*/}
{/* }*/}
{/*</style>*/}
{/*<li className={`pr `}>*/}
{/* <Popover placement="bottom" content={contents} trigger="click" >*/}
{/* <div className=" sortinxdirection mr10">*/}
{/* <div style={{*/}
{/* color:"#fff"*/}
{/* }}>*/}
{/* 题库*/}
{/* </div>*/}
{/* </div>*/}
{/* </Popover>*/}
{/*</li>*/}
.ant-popover-inner-content {
padding:0px !important;
}
`
}
</style>
<li className={`pr `}> <li className={`pr `}>
<Popover placement="bottom" content={contents} trigger="click" > <Link to={'/question'}>题库</Link>
<div className=" sortinxdirection mr10">
<div style={{
color:"#fff"
}}>
题库
</div>
</div>
</Popover>
</li> </li>
{/*<li><a href={this.props.Headertop===undefined?"":'/courses'}>课堂</a></li>*/} {/*<li><a href={this.props.Headertop===undefined?"":'/courses'}>课堂</a></li>*/}
{/*<li className={`${coursestype === true ? 'pr active' : 'pr'}`}>*/} {/*<li className={`${coursestype === true ? 'pr active' : 'pr'}`}>*/}
{/* /!*<a href={this.props.Headertop===undefined?"":this.props.Headertop.course_url}>课堂</a>*!/*/} {/* /!*<a href={this.props.Headertop===undefined?"":this.props.Headertop.course_url}>课堂</a>*!/*/}

@ -388,7 +388,6 @@ class TPMIndex extends Component {
let url = window.location.href; let url = window.location.href;
let flag = url.indexOf("add_file")>-1; let flag = url.indexOf("add_file")>-1;
return ( return (
<div className="newMain clearfix"> <div className="newMain clearfix">
{/*头部*/} {/*头部*/}

@ -88,6 +88,15 @@ function JupyterTPI (props) {
const [myIdentifier, setMyIdentifier] = useState(''); const [myIdentifier, setMyIdentifier] = useState('');
const [renderCtx, setRenderCtx] = useState(() => (emptyCtx)); const [renderCtx, setRenderCtx] = useState(() => (emptyCtx));
let newHandletype=false
const newHandle = function (event) {
if(newHandletype===false){
newHandletype=true
saveJupyterTpi(event);
setTimeout(()=>{newHandletype=false},500)
}
}
// 保存代码 // 保存代码
const addEventListeners = () => { const addEventListeners = () => {
window.addEventListener('message', (e) => { window.addEventListener('message', (e) => {
@ -95,12 +104,10 @@ function JupyterTPI (props) {
if(e){ if(e){
if(e.data){ if(e.data){
if(e.data==="jupytermessage"){ if(e.data==="jupytermessage"){
saveJupyterTpi(); newHandle()
} }
} }
} }
}) })
} }

@ -430,12 +430,13 @@ class Challengesjupyter extends Component {
` `
.ant-notification{ .ant-notification{
position: fixed; position: fixed !important;
z-index: 3000; z-index: 3000 !important;
} }
.ant-modal-content{ .ant-modal-wrap {
position: fixed; position: fixed !important;
z-index: 3000; z-index: 3000 !important;
margin-top: 100px !important;
} }
` `
} }

@ -4,7 +4,7 @@
* @Github: * @Github:
* @Date: 2019-12-23 10:53:25 * @Date: 2019-12-23 10:53:25
* @LastEditors : tangjiang * @LastEditors : tangjiang
* @LastEditTime : 2019-12-25 17:06:57 * @LastEditTime : 2019-12-27 11:07:02
*/ */
import types from "./actionTypes"; import types from "./actionTypes";
@ -42,7 +42,7 @@ export const getCommentLists = (identifier) => {
limit, limit,
page page
}).then(res => { }).then(res => {
console.log('获取评论列表: ====>>>>', res); // console.log('获取评论列表: ====>>>>', res);
if (res.status === 200) { if (res.status === 200) {
const {data} = res; const {data} = res;
dispatch({ dispatch({

@ -15,7 +15,8 @@ import {
fetchSyncJupyterCode, fetchSyncJupyterCode,
fetchreset_with_tpi, fetchreset_with_tpi,
fetchSaveJupyterTpi, fetchSaveJupyterTpi,
fetactive_with_tpi fetactive_with_tpi,
timeinfo_with_tpis
} from "../../services/jupyterServer"; } from "../../services/jupyterServer";
// 获取 jupyter 相关信息 // 获取 jupyter 相关信息
@ -76,7 +77,9 @@ export const getJupyterTpiUrl = (obj) => {
console.log('获取url', res); console.log('获取url', res);
if (res.status === 200) { if (res.status === 200) {
const { status, url = '', port } = res.data; const { status, url = '', port } = res.data;
addjypertime(Date.now() +3600 * 1000) dispatch(updataspinning(false))
setTimeout(()=>{ dispatch(addjypertime(Date.now() +3600 * 1000))},500)
// timeinfo_with_tpi(id,dispatch)
dispatch({ dispatch({
type: types.GET_JUPYTER_TPI_URL, type: types.GET_JUPYTER_TPI_URL,
payload: { payload: {
@ -106,7 +109,7 @@ export const syncJupyterCode = (identifier, msg) => {
const {status} = res.data const {status} = res.data
if (status === 0) { if (status === 0) {
message.success(msg); message.success(msg);
updataspinning(false) dispatch(updataspinning(false))
setTimeout(() => { setTimeout(() => {
window.location.reload(); window.location.reload();
}, 300); }, 300);
@ -131,7 +134,7 @@ export const reset_with_tpi = (identifier, msg) => {
const {status} = res.data const {status} = res.data
if (status === 0) { if (status === 0) {
message.success(msg); message.success(msg);
updataspinning(false) dispatch(updataspinning(false))
setTimeout(() => { setTimeout(() => {
window.location.reload(); window.location.reload();
}, 300); }, 300);
@ -156,7 +159,7 @@ export const active_with_tpi = (identifier, msg) => {
const {status} = res.data const {status} = res.data
if (status === 0) { if (status === 0) {
message.success(msg); message.success(msg);
addjypertime(Date.now() + 900 * 1000); dispatch(addjypertime(Date.now() + 900 * 1000))
} }
} }
}) })
@ -171,6 +174,7 @@ export const changeGetJupyterUrlState = (status) => {
payload: status payload: status
} }
} }
// 保存 jupyter tpi // 保存 jupyter tpi
export const saveJupyterTpi = () => { export const saveJupyterTpi = () => {
return (dispatch, getState) => { return (dispatch, getState) => {
@ -234,3 +238,29 @@ export const updataspinning=(type)=>{
} }
} }
// 获取重置实训后的时间
export const timeinfo_with_tpi = (identifier, dispatch) => {
debugger
const params = {
identifier: identifier
};
debugger
timeinfo_with_tpis(params).then(res => {
debugger
console.log('同步时间成功: ', res);
if (res.data.status === 401) return;
if (res.status === 200) {
const {status} = res.data
console.log(status)
// dispatch(addjypertime(Date.now() +3600 * 1000))
// setTimeout(()=>{ dispatch(addjypertime(Date.now() +3600 * 1000))},500)
// if (status === 0) {
// message.success(msg);
// dispatch(updataspinning(false))
// setTimeout(() => {
// window.location.reload();
// }, 300);
// }
}
})
}

@ -4,7 +4,7 @@
* @Github: * @Github:
* @Date: 2019-11-27 13:42:11 * @Date: 2019-11-27 13:42:11
* @LastEditors : tangjiang * @LastEditors : tangjiang
* @LastEditTime : 2019-12-27 09:28:38 * @LastEditTime : 2019-12-27 11:06:09
*/ */
import types from "./actionTypes"; import types from "./actionTypes";
import { Base64 } from 'js-base64'; import { Base64 } from 'js-base64';
@ -114,7 +114,7 @@ export const saveUserCodeForInterval = (identifier, code) => {
type: types.AUTO_UPDATE_CODE, type: types.AUTO_UPDATE_CODE,
payload: true payload: true
}); });
console.log('+++', userCode); // console.log('+++', userCode);
fetchUpdateCode(identifier, { fetchUpdateCode(identifier, {
code: userCode code: userCode
}).then(res => { }).then(res => {

@ -16,7 +16,7 @@ const initialState = {
publishLoading: false, // 发布 publishLoading: false, // 发布
isMySource: false, isMySource: false,
drawervisible:false, drawervisible:false,
jupytertime:Date.now() + 3600 * 1000, jupytertime:0,
spinning:false spinning:false
} }

@ -4,7 +4,7 @@
* @Github: * @Github:
* @Date: 2019-11-20 16:40:32 * @Date: 2019-11-20 16:40:32
* @LastEditors : tangjiang * @LastEditors : tangjiang
* @LastEditTime : 2019-12-23 10:12:59 * @LastEditTime : 2019-12-27 10:35:06
*/ */
import { Base64 } from 'js-base64'; import { Base64 } from 'js-base64';
import types from '../actions/actionTypes'; import types from '../actions/actionTypes';
@ -174,10 +174,16 @@ const ojFormReducer = (state = initialState, action) => {
* 7. 添加测试用例验证 * 7. 添加测试用例验证
*/ */
const { code = '', description, language, name, hack_sets = [], time_limit, difficult, category, status } = action.payload; const { code = '', description, language, name, hack_sets = [], time_limit, difficult, category, status } = action.payload;
let desc = null;
try {
desc = JSON.parse(description)
} catch (error) {
desc = description;
}
const currentOjForm = { const currentOjForm = {
name, // 任务名称 name, // 任务名称
language, language,
description: JSON.parse(description), description: desc,
difficult, difficult,
category, category,
openOrNot: 1, openOrNot: 1,

@ -138,8 +138,9 @@ class SearchPage extends Component{
font-size: 16px !important; font-size: 16px !important;
} }
`}</style> `}</style>
<div className="headersear" > <div className="shixunDetail_top " >
<div style={{height:"53px"}}></div> {/*<div style={{height:"53px"}}></div>*/}
<div className="intermediatecenter" style={{ width: "100%"}}>
<Search <Search
style={{ width: "800px", marginTop:"53px"}} style={{ width: "800px", marginTop:"53px"}}
className="packinput" className="packinput"
@ -149,6 +150,8 @@ class SearchPage extends Component{
onSearch={ (value)=>this.setdatafuns(value)} /> onSearch={ (value)=>this.setdatafuns(value)} />
</div> </div>
</div>
<div className="tabtitle"> <div className="tabtitle">
<div className="tabtitles2"> <div className="tabtitles2">
<Menu mode="horizontal" className="tabtitless" selectedKeys={tab} onClick={this.changeTab}> <Menu mode="horizontal" className="tabtitless" selectedKeys={tab} onClick={this.changeTab}>

@ -3,8 +3,6 @@
margin-top: 53px; margin-top: 53px;
} }
.headersear{ .headersear{
height: 160px;
background: #EAF2F9;
display: flex; display: flex;
justify-content: center; justify-content: center;
} }
@ -15,6 +13,12 @@
/*color: #681616 !important;*/ /*color: #681616 !important;*/
border-color: #E1EDF8 !important; border-color: #E1EDF8 !important;
} }
.intermediatecenter{
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}
.packinput .ant-input-group-addon .ant-btn{ .packinput .ant-input-group-addon .ant-btn{
width:137px !important; width:137px !important;
@ -174,3 +178,9 @@
.ml9{ .ml9{
margin-left: 9px; margin-left: 9px;
} }
.shixunDetail_top{width: 100%;background-image: url("/images/educoder/searchforbackres.jpg"); height: 240px;
justify-content: center;align-items: center;display: -webkit-flex;
background-size: cover;
background-position: center;
background-repeat: no-repeat;
}

@ -45,3 +45,10 @@ export async function fetactive_with_tpi(params) {
const url = `/jupyters/active_with_tpi.json`; const url = `/jupyters/active_with_tpi.json`;
return axios.get(url, { params }); return axios.get(url, { params });
} }
//获取tpi重置实训的time
export async function timeinfo_with_tpis(params){
const url = `/jupyters/timeinfo_with_tpi.json`;
return axios.get(url, { params });
}

@ -4,13 +4,13 @@
* @Github: * @Github:
* @Date: 2019-11-20 10:55:38 * @Date: 2019-11-20 10:55:38
* @LastEditors : tangjiang * @LastEditors : tangjiang
* @LastEditTime : 2019-12-26 17:37:38 * @LastEditTime : 2019-12-27 11:06:27
*/ */
import axios from 'axios'; import axios from 'axios';
export async function fetchOJList (params) { export async function fetchOJList (params) {
console.log('传递的参数: ', params); // console.log('传递的参数: ', params);
const obj = {}; const obj = {};
Object.keys(params).forEach(key => { Object.keys(params).forEach(key => {
if (params[key]) { if (params[key]) {

@ -528,7 +528,7 @@ li.li-width15{width: 15%;text-align: left}
li.li-width7{width: 7%;text-align: left} li.li-width7{width: 7%;text-align: left}
/*-----------------------------在线课堂动态----------------------------------*/ /*-----------------------------在线课堂动态----------------------------------*/
.courseHead{width: 100%;margin-bottom:40px;background-size: 100% 100%;background-image: url("/images/educoder/course-detail.jpg");height: 240px; .courseHead{width: 100%;margin-bottom:40px;background-size: 100% 100%;background-image: url("/images/educoder/courtailsbdpicture.jpg");height: 240px;
justify-content: center;align-items: center;display: -webkit-flex; justify-content: center;align-items: center;display: -webkit-flex;
background-size: cover; background-size: cover;
background-position: center; background-position: center;

File diff suppressed because one or more lines are too long
Loading…
Cancel
Save