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

chromesetting
daiao 5 years ago
commit d251f35bd8

@ -23,7 +23,7 @@ class HackUserLastestCodesController < ApplicationController
# 同步代码 # 同步代码
def sync_code def sync_code
@my_hack.update_attributes(code: @hack.code, modify_time: @hack.modify_time) @my_hack.update_attributes(code: @hack.code, modify_time: Time.now)
end end
# 调试代码 # 调试代码

@ -557,7 +557,6 @@ a.user_orangebg_btn{background-color:#FF6800;color: #fff;}
a.user_greybg_btn{background-color:#747A7F;color: #fff;} a.user_greybg_btn{background-color:#747A7F;color: #fff;}
/*.user_white_btn{border: 1px solid #ffffff;color: #ffffff!important;}*/ /*.user_white_btn{border: 1px solid #ffffff;color: #ffffff!important;}*/
.pointer{cursor: pointer} .pointer{cursor: pointer}
.cdefault{cursor: default} .cdefault{cursor: default}

@ -12,4 +12,5 @@ json.homework_type homework.homework_type
if homework.homework_type == "practice" if homework.homework_type == "practice"
json.shixun_identifier homework.shixuns.take.try(:identifier) json.shixun_identifier homework.shixuns.take.try(:identifier)
json.shixun_id homework.shixuns.take.try(:id) json.shixun_id homework.shixuns.take.try(:id)
json.shixun_status homework.shixuns.take.try(:status).to_i
end end

@ -29,6 +29,7 @@ json.homeworks @homework_commons.each do |homework|
if @user_course_identity < Course::STUDENT if @user_course_identity < Course::STUDENT
if homework.homework_type == "practice" if homework.homework_type == "practice"
json.shixun_identifier homework.shixuns.take.try(:identifier) json.shixun_identifier homework.shixuns.take.try(:identifier)
json.shixun_status homework.shixuns.take.try(:status).to_i
end end
elsif @user_course_identity == Course::STUDENT elsif @user_course_identity == Course::STUDENT
if homework.homework_type == "practice" if homework.homework_type == "practice"

@ -326,7 +326,7 @@ module.exports = {
comments: false comments: false
}, },
compress: { compress: {
drop_debugger: true, drop_debugger: false,
drop_console: false drop_console: false
} }
} }

@ -13,7 +13,7 @@ function locationurl(list){
if (window.location.port === "3007") { if (window.location.port === "3007") {
} else { } else {
window.location.href(list) window.location.href=list
} }
} }
let hashTimeout let hashTimeout

@ -493,8 +493,8 @@ class NewShixunModel extends Component{
{this.props.type==='shixuns'? {this.props.type==='shixuns'?
<div className="clearfix sortinxdirection mt30 intermediatecenterysls"> <div className="clearfix sortinxdirection mt30 intermediatecenterysls">
<p className="nandu">筛选</p> <p className="nandu">筛选</p>
<p className={belongtoindex===0?"clickbutstwo ml13":"clickbutstwos ml13"} onClick={()=>this.belongto("all")}>全部实训</p> <p className={type==="all"?"clickbutstwo ml13":"clickbutstwos ml13"} onClick={()=>this.belongto("all")}>全部实训</p>
<p className={belongtoindex===1?"clickbutstwo ml20":"clickbutstwos ml20"} onClick={()=>this.belongto("mine")}>我的实训</p> <p className={type==="mine"?"clickbutstwo ml20":"clickbutstwos ml20"} onClick={()=>this.belongto("mine")}>我的实训</p>
</div>:"" </div>:""
} }
{/*{this.props.type==='shixuns'? <Dropdown overlay={menus}>*/} {/*{this.props.type==='shixuns'? <Dropdown overlay={menus}>*/}

@ -232,9 +232,9 @@ class ShixunHomeworkPage extends Component {
typelist={teacherdatapage === undefined ? [""] : teacherdatapage.homework_status} typelist={teacherdatapage === undefined ? [""] : teacherdatapage.homework_status}
/> />
<a className="color-grey-9 fr font-16 summaryname ml20 mr20" onClick={()=>this.gotohome()}>返回</a> <a className="color-grey-9 fr font-16 summaryname ml20 mr20" onClick={()=>this.gotohome()}>返回</a>
<a className="color-grey-9 fr font-16 mr20" {teacherdatapage&&teacherdatapage.shixun_status>1?<a className="color-grey-9 fr font-16 mr20"
href={`/shixuns/${teacherdatapage === undefined ? "" : teacherdatapage.shixun_identifier}/challenges`} href={`/shixuns/${teacherdatapage === undefined ? "" : teacherdatapage.shixun_identifier}/challenges`}
target={"_blank"}>实训详情</a> target={"_blank"}>实训详情</a>:""}
</div> </div>
@ -336,10 +336,10 @@ class ShixunHomeworkPage extends Component {
<a className="fr color-blue font-16" <a className="fr color-blue font-16"
href={`/courses/${this.props.match.params.coursesId}/${jobsettingsdatapage === undefined ? "" : jobsettingsdatapage.data.category.main === 1 ? "shixun_homeworks" :"shixun_homework"}/${teacherdatapage === undefined ? "" : teacherdatapage.id}/commitsummary/${this.props.match.params.homeworkid}`}>{teacherdatapage.commit_des}</a> href={`/courses/${this.props.match.params.coursesId}/${jobsettingsdatapage === undefined ? "" : jobsettingsdatapage.data.category.main === 1 ? "shixun_homeworks" :"shixun_homework"}/${teacherdatapage === undefined ? "" : teacherdatapage.id}/commitsummary/${this.props.match.params.homeworkid}`}>{teacherdatapage.commit_des}</a>
} }
{teacherdatapage === undefined ? "" : <Startshixuntask {teacherdatapage === undefined ? "" :teacherdatapage&&teacherdatapage.shixun_status>1?<Startshixuntask
{...this.props} {...this.props}
data={teacherdatapage} data={teacherdatapage}
/>} />:""}
{this.props.isStudent() ? {this.props.isStudent() ?
( (
teacherdatapage&&teacherdatapage.redo_work===true? teacherdatapage&&teacherdatapage.redo_work===true?

@ -359,14 +359,14 @@ class ShixunhomeWorkItem extends Component{
} }
</style> </style>
{this.props.isAdmin?<span onClick={(event)=>this.stopPro(event)} className={this.props.isAdminOrCreator()?"homepagePostSetting homepagePostSettingname":"homepagePostSetting homepagePostSettingbox"} style={{"right":"-2px","top":"6px","display":"block"}}> {this.props.isAdmin?<span onClick={(event)=>this.stopPro(event)} className={this.props.isAdminOrCreator()?"homepagePostSetting homepagePostSettingname":"homepagePostSetting homepagePostSettingbox"} style={{"right":"-2px","top":"6px","display":"block"}}>
<Link className="btn colorblue font-16 fontweight400" to={"/shixuns/"+discussMessage.shixun_identifier+"/challenges"} target={"_blank"}>实训详情</Link> {discussMessage&&discussMessage.shixun_status>1?<Link className="btn colorblue font-16 fontweight400" to={"/shixuns/"+discussMessage.shixun_identifier+"/challenges"} target={"_blank"}>实训详情</Link>:""}
{this.props.isAdminOrCreator()?<a onClick={(event)=>this.editname(discussMessage.name,discussMessage.homework_id,event)} className={"btn colorblue ml20 font-16 fontweight400"}>重命名</a>:""} {this.props.isAdminOrCreator()?<a onClick={(event)=>this.editname(discussMessage.name,discussMessage.homework_id,event)} className={"btn colorblue ml20 font-16 fontweight400"}>重命名</a>:""}
{/*<WordsBtn className="btn colorblue ml20 font-16" to={`/courses/${this.props.match.params.coursesId}/${this.state.shixuntypes}/${discussMessage.homework_id}/settings?tab=3`} > 设置</WordsBtn>*/} {/*<WordsBtn className="btn colorblue ml20 font-16" to={`/courses/${this.props.match.params.coursesId}/${this.state.shixuntypes}/${discussMessage.homework_id}/settings?tab=3`} > 设置</WordsBtn>*/}
<WordsBtn className="btn colorblue font-16 ml15 fontweight400" to={`/courses/${this.props.match.params.coursesId}/${this.state.shixuntypes}/${discussMessage.homework_id}/settings?tab=3`} > 设置</WordsBtn> <WordsBtn className="btn colorblue font-16 ml15 fontweight400" to={`/courses/${this.props.match.params.coursesId}/${this.state.shixuntypes}/${discussMessage.homework_id}/settings?tab=3`} > 设置</WordsBtn>
</span>:""} </span>:""}
{this.props.isStudent===true?this.props.course_identity===5? {this.props.isStudent===true?this.props.course_identity===5?discussMessage&&discussMessage.shixun_status>1?
<WordsBtn style="blue" className="colorblue font-16 mr20 fr mt10"> <WordsBtn style="blue" className="colorblue font-16 mr20 fr mt10">
{startbtn===false? {startbtn===false?
(discussMessage.task_operation[0] == '继续挑战' || discussMessage.task_operation[0] == '查看实战' ? (discussMessage.task_operation[0] == '继续挑战' || discussMessage.task_operation[0] == '查看实战' ?
@ -377,7 +377,7 @@ class ShixunhomeWorkItem extends Component{
<a className="btn colorblue" onClick={()=>this.taskoperationId(discussMessage.task_operation[1])}> <a className="btn colorblue" onClick={()=>this.taskoperationId(discussMessage.task_operation[1])}>
{discussMessage.task_operation[0]} {discussMessage.task_operation[0]}
</a>):<a className="btn colorblue" ></a>} </a>):<a className="btn colorblue" ></a>}
</WordsBtn>:"":"" </WordsBtn>:"":"":""
} }
</h6> </h6>

@ -4,7 +4,7 @@
* @Github: * @Github:
* @Date: 2019-11-27 16:02:36 * @Date: 2019-11-27 16:02:36
* @LastEditors: tangjiang * @LastEditors: tangjiang
* @LastEditTime: 2019-12-10 09:30:27 * @LastEditTime: 2019-12-13 17:32:33
*/ */
import './index.scss'; import './index.scss';
import React, { useState, useRef } from 'react'; import React, { useState, useRef } from 'react';
@ -84,7 +84,7 @@ const ControlSetting = (props) => {
<Tabs <Tabs
className={classNames} className={classNames}
activeKey={defaultActiveKey} activeKey={defaultActiveKey}
tabBarStyle={{ backgroundColor: '#000', color: '#fff' }} tabBarStyle={{ backgroundColor: 'rgba(48,48,48,1)', color: '#fff' }}
onChange={handleTabChange} onChange={handleTabChange}
> >
<TabPane tab={'自定义测试用例'} key={'1'} style={{ height: '280px', overflowY: 'auto' }}> <TabPane tab={'自定义测试用例'} key={'1'} style={{ height: '280px', overflowY: 'auto' }}>

@ -2,6 +2,7 @@
position: absolute; position: absolute;
bottom: 0; bottom: 0;
width: 100%; width: 100%;
background:rgba(30,30,30,1);
// height: 56px; // height: 56px;
.control_tab{ .control_tab{
position: absolute; position: absolute;
@ -51,7 +52,8 @@
height: 56px; height: 56px;
padding-right: 30px; padding-right: 30px;
padding-left: 10px; padding-left: 10px;
background: #000; // background: #000;
background:rgba(48,48,48,1);
} }
.setting_drawer{ .setting_drawer{

@ -4,7 +4,7 @@
* @Github: * @Github:
* @Date: 2019-11-27 19:46:14 * @Date: 2019-11-27 19:46:14
* @LastEditors: tangjiang * @LastEditors: tangjiang
* @LastEditTime: 2019-12-10 09:31:00 * @LastEditTime: 2019-12-13 17:38:42
*/ */
import './index.scss'; import './index.scss';
import React, { useState, useEffect, useRef, useImperativeHandle, forwardRef } from 'react'; import React, { useState, useEffect, useRef, useImperativeHandle, forwardRef } from 'react';
@ -50,6 +50,7 @@ function InitTabCtx (props, ref) {
], ],
initialValue: inputValue initialValue: inputValue
})(<TextArea })(<TextArea
className="input_textarea_style"
rows={8} rows={8}
placeholder="请填写测试用例的输入值,点击“调试代码”" placeholder="请填写测试用例的输入值,点击“调试代码”"
/>) />)

@ -47,4 +47,11 @@
.flex_r{ .flex_r{
padding: 0 20px 0 10px; padding: 0 20px 0 10px;
} }
.input_textarea_style{
background:rgba(30,30,30,1) !important;
color: #fff;
border-color: transparent;
outline: none;
}
} }

@ -4,11 +4,11 @@
* @Github: * @Github:
* @Date: 2019-11-27 15:02:52 * @Date: 2019-11-27 15:02:52
* @LastEditors: tangjiang * @LastEditors: tangjiang
* @LastEditTime: 2019-12-10 09:20:42 * @LastEditTime: 2019-12-13 16:16:56
*/ */
import './index.scss'; import './index.scss';
import React, { useState, useRef, useEffect } from 'react'; import React, { useState, useRef, useEffect } from 'react';
import { Icon, Drawer, Modal } from 'antd'; import { Drawer, Modal } from 'antd';
import { fromStore } from 'educoder'; import { fromStore } from 'educoder';
import { connect } from 'react-redux'; import { connect } from 'react-redux';
import MonacoEditor from '@monaco-editor/react'; import MonacoEditor from '@monaco-editor/react';

@ -1,11 +1,13 @@
.monaco_editor_area{ .monaco_editor_area{
height: 100%; height: 100%;
background-color: rgba(30,30,30,1);
.code_title{ .code_title{
display: flex; display: flex;
align-items: center; align-items: center;
// justify-content: space-between; // justify-content: space-between;
// background: #000; // background: #000;
background: #333333; // background: #333333;
background-color: rgba(48,48,48,1);
color: #fff; color: #fff;
height: 56px; height: 56px;
padding: 0 30px; padding: 0 30px;

@ -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-12 19:08:24 * @LastEditTime: 2019-12-13 17:19:15
*/ */
import './index.scss'; import './index.scss';
import React, { useEffect, useState } from 'react'; import React, { useEffect, useState } from 'react';
@ -23,15 +23,15 @@ import { withRouter } from 'react-router';
function StudentStudy (props) { function StudentStudy (props) {
const [hasUpdate, setHasUpdate] = useState(true);
const { const {
// hack,
userInfo, userInfo,
hack_identifier hack_identifier,
// user_program_identifier,
restoreInitialCode
} = props; } = props;
// 是否更新
const [isUpdate, setIsUpdate] = useState(true);
useEffect(() => {
const { const {
match: { params }, match: { params },
getUserProgramDetail, getUserProgramDetail,
@ -39,6 +39,8 @@ function StudentStudy (props) {
} = props; } = props;
let { id } = params; let { id } = params;
useEffect(() => {
// 保存当前的id // 保存当前的id
saveUserProgramIdentifier(id); saveUserProgramIdentifier(id);
// startProgramQuestion(id); // startProgramQuestion(id);
@ -46,10 +48,9 @@ function StudentStudy (props) {
}, []); }, []);
useEffect(() => { useEffect(() => {
console.log('=======>>>>>>>>');
const { hack = {} } = props; const { hack = {} } = props;
if (!hack.modify_code && isUpdate) { // 代码更改,提示是否需要更新代码 if (hack.modify_code && hasUpdate) { // 代码更改,提示是否需要更新代码
setIsUpdate(false); setHasUpdate(false);
Modal.confirm({ Modal.confirm({
title: '提示', title: '提示',
content: ( content: (
@ -61,30 +62,11 @@ function StudentStudy (props) {
okText: '立即更新', okText: '立即更新',
cancelText: '稍后再说', cancelText: '稍后再说',
onOk () { onOk () {
console.log('更新代码....'); restoreInitialCode(id, '更新成功');
} }
}); });
} }
}, [props]); }, [props, hasUpdate, setHasUpdate]);
// useEffect(() => {
// const {hack} = props;
// if (!hack.modify_code) { // 代码更改,提示是否需要更新代码
// Modal.confirm({
// title: '提示',
// content: (
// <p>
// 代码文件有更新啦 <br />
// 还未提交的代码,请自行保存
// </p>
// ),
// okText: '立即更新',
// cancelText: '稍后再说',
// onOk () {
// console.log('更新代码....');
// }
// });
// }
// }, [props]);
const _hack_id = hack_identifier || fromStore('hack_identifier'); const _hack_id = hack_identifier || fromStore('hack_identifier');
@ -110,7 +92,7 @@ function StudentStudy (props) {
</div> */} </div> */}
<UserInfo userInfo={userInfo}/> <UserInfo userInfo={userInfo}/>
<div className={'study_name'}> <div className={'study_name'}>
<span>乘积最大序列</span> <span>乘积最大序列 {hasUpdate}</span>
</div> </div>
<div className={'study_quit'}> <div className={'study_quit'}>
{/* to={`/problems/${_hack_id}/edit`} */} {/* to={`/problems/${_hack_id}/edit`} */}
@ -146,9 +128,11 @@ function StudentStudy (props) {
const mapStateToProps = (state) => { const mapStateToProps = (state) => {
const { userInfo } = state.userReducer; const { userInfo } = state.userReducer;
const { hack_identifier } = state.ojForUserReducer; const { hack_identifier, user_program_identifier, hack } = state.ojForUserReducer;
return { return {
hack,
userInfo, userInfo,
user_program_identifier,
hack_identifier hack_identifier
}; };
}; };
@ -159,7 +143,9 @@ const mapDispatchToProps = (dispatch) => ({
// 调用编程题详情 // 调用编程题详情
getUserProgramDetail: (id) => dispatch(actions.getUserProgramDetail(id)), getUserProgramDetail: (id) => dispatch(actions.getUserProgramDetail(id)),
saveUserProgramIdentifier: (id) => dispatch(actions.saveUserProgramIdentifier(id)), saveUserProgramIdentifier: (id) => dispatch(actions.saveUserProgramIdentifier(id)),
saveEditorCodeForDetail: (code) => dispatch(actions.saveEditorCodeForDetail(code)) saveEditorCodeForDetail: (code) => dispatch(actions.saveEditorCodeForDetail(code)),
// 恢复初始代码
restoreInitialCode: (identifier, msg) => dispatch(actions.restoreInitialCode(identifier, msg)),
}); });
export default withRouter(connect( export default withRouter(connect(

@ -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-10 19:00:30 * @LastEditTime: 2019-12-13 16:50:40
*/ */
import React, { useState, useEffect } from 'react'; import React, { useState, useEffect } from 'react';
import {connect} from 'react-redux'; import {connect} from 'react-redux';
@ -66,7 +66,7 @@ const RightPane = (props) => {
} }
// 恢复初始代码 // 恢复初始代码
const handleRestoreInitialCode = () => { const handleRestoreInitialCode = () => {
restoreInitialCode(identifier); restoreInitialCode(identifier, '恢复初始代码成功');
} }
return ( return (
@ -110,7 +110,7 @@ const mapDispatchToProps = (dispatch) => ({
// 保存用户代码至后台 // 保存用户代码至后台
saveUserCodeForInterval: (identifier, code) => dispatch(actions.saveUserCodeForInterval(identifier, code)), saveUserCodeForInterval: (identifier, code) => dispatch(actions.saveUserCodeForInterval(identifier, code)),
// 恢复初始代码 // 恢复初始代码
restoreInitialCode: (identifier) => dispatch(actions.restoreInitialCode(identifier)), restoreInitialCode: (identifier, msg) => dispatch(actions.restoreInitialCode(identifier, msg)),
}); });
export default connect( export default connect(

@ -840,7 +840,7 @@ class TPMBanner extends Component {
</li> </li>
</ul> </ul>
{ {
this.props.is_jupyter===false? this.props.is_jupyter===true?"":
<div className="pr fl" id="commentsStar" onMouseOver={() => this.showonMouseOver()} <div className="pr fl" id="commentsStar" onMouseOver={() => this.showonMouseOver()}
onMouseOut={() => this.hideonMouseOut()}> onMouseOut={() => this.hideonMouseOut()}>
<div className={"color-grey-c ml15"} style={{color: "#Fff", textAlign: "center"}}>学员评分</div> <div className={"color-grey-c ml15"} style={{color: "#Fff", textAlign: "center"}}>学员评分</div>
@ -916,7 +916,6 @@ class TPMBanner extends Component {
</div> </div>
</div> </div>
:""
} }
@ -986,7 +985,7 @@ class TPMBanner extends Component {
{ {
startbtn === true ? startbtn === true ?
<a className="fr user_default_btn edu-greyback-btn mr15 font-18">开启中</a> : "" <a className="fr kaike kkbths mr15 font-18">开启中</a> : ""
} }
{/*{*/} {/*{*/}
@ -1010,8 +1009,10 @@ class TPMBanner extends Component {
placement="bottom" placement="bottom"
visible={this.state.openknow} visible={this.state.openknow}
> >
<a onClick={this.applyrelease} className="fr user_default_btn user_blue_btn mr20 font-18 height39" <Tooltip placement="bottom" title={"发布后,可以使用到自己的课堂和课程"}>
<a onClick={this.applyrelease} className="fr kaike kkbths mr20 font-18 height39"
id="challenge_begin">发布</a> id="challenge_begin">发布</a>
</Tooltip>
</Popover>: "" </Popover>: ""
} }
@ -1088,26 +1089,33 @@ class TPMBanner extends Component {
placement="bottom" placement="bottom"
visible={this.state.openshowpublictype} visible={this.state.openshowpublictype}
> >
<Button type="primary" ghost id="challenge_begin" onClick={this.openpublic} className="fr user_default_btn user_blue_btn mr20 font-18 height39"> <Tooltip placement="bottom" title={"审核通过后,平台用户可以查看实训"}>
<Button type="primary" ghost id="challenge_begin" onClick={this.openpublic} className="fr kaike kkbths mr20 font-18 height39">
申请公开 申请公开
</Button> </Button>
</Tooltip>
</Popover>: "" </Popover>: ""
} }
{shixunsDetails.shixun_status === 2 && shixunsDetails.public===1 && this.props.identity < 5 ? {shixunsDetails.shixun_status === 2 && shixunsDetails.public===1 && this.props.identity < 5 ?
<Button type="primary" ghost id="challenge_begin" onClick={this.hidenpublic} className="fr user_default_btn user_blue_btn mr20 font-18 height39" style={{'width': '140px'}}> <Tooltip placement="bottom" title={"撤销后,仅可以使用到自己的课堂和课程"}>
<Button type="primary" ghost id="challenge_begin" onClick={this.hidenpublic} className="fr kaike kkbths mr20 font-18 height39" style={{'width': '140px'}}>
撤销申请公开 撤销申请公开
</Button>: "" </Button>
</Tooltip>: ""
} }
{shixunsDetails.shixun_status === 2 && shixunsDetails.public===0 && this.props.identity < 5 ? {shixunsDetails.shixun_status === 2 && shixunsDetails.public===0 && this.props.identity < 5 ?
<a onClick={this.cancel_publish} className="fr user_default_btn user_blue_btn mr20 font-18 height39" <Tooltip placement="bottom" title={"撤销发布后,学员将无法进行练习"}>
id="challenge_begin">撤销发布</a> : "" <a onClick={this.cancel_publish} className="fr kaike kkbths mr20 font-18 height39"
id="challenge_begin">撤销发布</a>
</Tooltip>
: ""
} }
{ {
<a onClick={this.Senttothe} <a onClick={this.Senttothe}
className="fr user_default_btn user_blue_btn mr20 font-18" className="fr kaike kkbths mr20 font-18"
data-tip-down="" data-tip-down=""
style={{display: shixunsDetails.shixun_status === 0 || shixunsDetails.shixun_status === 3 || shixunsDetails.shixun_status === 1 || shixunsDetails.shixun_status === -1 ? "none" : "block"}} style={{display: shixunsDetails.shixun_status === 0 || shixunsDetails.shixun_status === 3 || shixunsDetails.shixun_status === 1 || shixunsDetails.shixun_status === -1 ? "none" : "block"}}
data-remote="true"> data-remote="true">
@ -1191,11 +1199,11 @@ class TPMBanner extends Component {
</Modal> </Modal>
{shixunsDetails.shixun_status === 3 && {shixunsDetails.shixun_status === 3 &&
<a className="fr user_default_btn edu-greyback-btn mr15 font-18">已关闭</a> <a className="fr kaike kkbths mr15 font-18">已关闭</a>
} }
{shixunsDetails.shixun_status === -1 && {shixunsDetails.shixun_status === -1 &&
<a className="fr user_default_btn edu-greyback-btn mr15 font-18">已删除</a> <a className="fr kaike kkbths mr15 font-18">已删除</a>
} }

@ -84,6 +84,7 @@ class TPMDataset extends Component {
loadingstate:false, loadingstate:false,
checked: false, checked: false,
showmodel:false, showmodel:false,
itemtypebool:false,
} }
} }
@ -304,10 +305,18 @@ class TPMDataset extends Component {
if(info.file.response){ if(info.file.response){
if(info.file.response.status===-1||info.file.response.status==="-1"){ if(info.file.response.status===-1||info.file.response.status==="-1"){
// console.log("准备显示弹框了"); // console.log("准备显示弹框了");
// console.log(info); // console.log(info);false
let itemtype=-1;
try {
itemtype=info.file.response.message.indexOf('文件名已经存在'.toLowerCase());
}catch (e) {
}
this.setState({ this.setState({
showmodel:true, showmodel:true,
tittest:info.file.response.message, tittest:info.file.response.message,
itemtypebool:itemtype>-1?true:itemtype<=-1?false:false,
}) })
} }
} }
@ -466,7 +475,7 @@ class TPMDataset extends Component {
<div className="with65 fl edu-back-white commentsDelegateParent"> <div className="with65 fl edu-back-white commentsDelegateParent">
{ {
this.state.showmodel===true? this.state.showmodel===true?
<Tpmdatasetmodel modalCancel={()=>this.ModalSave()} tittest={this.state.tittest} modalsType={this.state.showmodel}></Tpmdatasetmodel> <Tpmdatasetmodel itemtypebool={this.state.itemtypebool} modalCancel={()=>this.ModalSave()} tittest={this.state.tittest} modalsType={this.state.showmodel}></Tpmdatasetmodel>
:"" :""
} }
<TPMNav <TPMNav

@ -64,7 +64,8 @@ export default class Shixuninformation extends Component {
opentime: false, opentime: false,
oldscope_partment: [], oldscope_partment: [],
scope_partment: [], scope_partment: [],
loading: false loading: false,
opening_timetype:false
} }
} }
@ -113,7 +114,8 @@ export default class Shixuninformation extends Component {
onChangeTimePicker = (value, dateString) => { onChangeTimePicker = (value, dateString) => {
this.setState({ this.setState({
opening_time: dateString === "" ? "" : handleDateStrings(dateString) opening_time: dateString === "" ? "" : handleDateStrings(dateString),
opening_timetype:false
}) })
} }
@ -121,7 +123,16 @@ export default class Shixuninformation extends Component {
this.setState({ this.setState({
loading: true loading: true
}) })
let {can_copy, use_scope, scope_partment, opening_time} = this.state; let {can_copy, use_scope, scope_partment, opening_time,oldscope_partment} = this.state;
if(this.state.opentime===true){
if(opening_time===null){
this.setState({
opening_timetype:true
})
return
}
}
let id = this.props.match.params.shixunId; let id = this.props.match.params.shixunId;
let url = `/shixuns/${id}/update_permission_setting.json`; let url = `/shixuns/${id}/update_permission_setting.json`;
@ -138,11 +149,23 @@ export default class Shixuninformation extends Component {
if (response.data.status === -1) { if (response.data.status === -1) {
} else { } else {
this.props.getdatas("3")
let list=[]
scope_partment.map((item,key)=>{
list.push(item)
})
oldscope_partment.map((item,key)=>{
list.push(item)
})
this.props.showNotification("权限配置保存成功!") this.props.showNotification("权限配置保存成功!")
this.setState({ this.setState({
loading: false loading: false,
scope_partment:[],
oldscope_partment:list
}) })
this.props.getdatas("3")
} }
}).catch((error) => { }).catch((error) => {
this.setState({ this.setState({
@ -171,23 +194,30 @@ export default class Shixuninformation extends Component {
datalist = [] datalist = []
} }
datalist.push(e)
let scopetype = false; let scopetype = false;
if(scope_partment.length>0){
scope_partment.map((item, key) => { scope_partment.map((item, key) => {
if (item === e) { if (item === e) {
debugger
scopetype = true scopetype = true
} }
}) })
}
if(oldscope_partment.length>0){
oldscope_partment.map((item, key) => { oldscope_partment.map((item, key) => {
if (item === e) { if (item === e) {
debugger
scopetype = true scopetype = true
} }
}) })
}
if (scopetype === false) { if (scopetype === false) {
datalist.push(e)
this.setState({ this.setState({
scope_partment: datalist scope_partment: datalist
}); });
@ -354,6 +384,7 @@ export default class Shixuninformation extends Component {
<div className={"both"}></div> <div className={"both"}></div>
{this.state.opentime === false ? "" : <div className="mt20 ml25"> {this.state.opentime === false ? "" : <div className="mt20 ml25">
<DatePicker <DatePicker
className={this.state.opening_timetype===true?"bor-red":""}
showToday={false} showToday={false}
showTime={{format: 'HH:mm'}} showTime={{format: 'HH:mm'}}
format="YYYY-MM-DD HH:mm" format="YYYY-MM-DD HH:mm"
@ -367,6 +398,7 @@ export default class Shixuninformation extends Component {
dropdownClassName="hideDisable" dropdownClassName="hideDisable"
/> />
</div>} </div>}
<div className={this.state.opening_timetype===true?"color-red mt10 ml20":"none"}>请选择开启时间</div>
</span> </span>
</div> </div>

@ -106,8 +106,8 @@ export default class Shixuninformation extends Component {
test_set_permission: this.state.test_set_permission, test_set_permission: this.state.test_set_permission,
vnc: this.state.vnc, vnc: this.state.vnc,
webssh: this.state.websshshow === false ? 0 : this.state.opensshRadio, webssh: this.state.websshshow === false ? 0 : this.state.opensshRadio,
code_edit_permission:this.state.is_secret_repository
}, },
is_secret_repository: this.state.is_secret_repository
} }
).then((response) => { ).then((response) => {
if (response.data.status === -1) { if (response.data.status === -1) {

@ -214,7 +214,7 @@ class Challengesjupyter extends Component {
this.state.jupyter_url === null? this.state.jupyter_url === null?
<div className="mt50 intermediatecenter juplbool"> <div className="mt50 intermediatecenter juplbool">
<span className="icon iconfontysl icon-jiazaishibai1"></span> <span className="icon iconfontysl icon-jiazaishibai1"></span>
<p className="intermediatecenter sortinxdirection mt5 juplboolp"><p className="colorbluetest">加载实训出错是否</p><p className="colorbluetwo" onClick={()=>this.updatamakedowns()}></p></p> <p className="intermediatecenter sortinxdirection mt5 juplboolp"><p className="colorbluetest">加载实训失败</p><p className="colorbluetwo" onClick={()=>this.updatamakedowns()}></p></p>
</div> </div>

@ -120,3 +120,39 @@ a:active{text-decoration:none;}
.FF6802{ .FF6802{
color:#FF6802; color:#FF6802;
} }
.xxtjbtn{
width: 103px;
height: 38px;
background: rgba(255,255,255,1);
border-radius: 4px;
border: 1px solid rgba(255,255,255,1);
color: #fff !important;
font-size: 15px !important;
line-height: 36px !important;
}
.kkbths{
width:103px;
height:38px;
border-radius:4px;
line-height: 36px !important;
border:1px solid rgba(255,255,255,1)!important;
color: #ffffff !important;
}
.kaike{
border-radius: 4px;
border: 1px solid #ffffff !important;
padding: 0px 10px;
cursor: pointer;
font-size: 14px;
display: block;
width: 120px;
text-align: center;
height: 40px;
line-height: 40px!important;
border-radius: 4px;
box-sizing: border-box;
color: #ffffff !important;
}

@ -34,7 +34,13 @@ class Tpmdatasetmodel extends Component {
width="530px" width="530px"
> >
<div className="educouddiv intermediatecenter"> <div className="educouddiv intermediatecenter">
{
this.props.itemtypebool===true?
<div className={"tabeltext-alignleftysl mt10"}><p>文件名重复</p></div> <div className={"tabeltext-alignleftysl mt10"}><p>文件名重复</p></div>
:""
}
<div className={"tabeltext-alignleftysltwo mt10"}><p>{this.props.tittest}</p></div> <div className={"tabeltext-alignleftysltwo mt10"}><p>{this.props.tittest}</p></div>
<div className="clearfix mt30 edu-txt-center task-btn-blues"> <div className="clearfix mt30 edu-txt-center task-btn-blues">
{/*<a className="task-btn mr30" onClick={()=>this.modalCancel()}>先试试看</a>*/} {/*<a className="task-btn mr30" onClick={()=>this.modalCancel()}>先试试看</a>*/}

@ -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-10 19:05:36 * @LastEditTime: 2019-12-13 16:49:42
*/ */
import types from "./actionTypes"; import types from "./actionTypes";
import { Base64 } from 'js-base64'; import { Base64 } from 'js-base64';
@ -19,6 +19,7 @@ import {
fetchUserCodeSubmit, fetchUserCodeSubmit,
fetchRestoreInitialCode fetchRestoreInitialCode
} from "../../services/ojService"; } from "../../services/ojService";
import { notification } from "antd";
// 进入编程页面时,首先调用开启编程题接口 // 进入编程页面时,首先调用开启编程题接口
export const startProgramQuestion = (id, props) => { export const startProgramQuestion = (id, props) => {
@ -384,17 +385,21 @@ export const submitUserCode = (identifier, inputValue, type) => {
} }
// 恢复初始代码 // 恢复初始代码
export const restoreInitialCode = (identifier) => { export const restoreInitialCode = (identifier, msg) => {
return (dispatch) => { return (dispatch) => {
fetchRestoreInitialCode(identifier).then(res => { fetchRestoreInitialCode(identifier).then(res => {
if (res.data.status === 401) return; if (res.data.status === 401) return;
console.log('恢复初始代码====》》》》', res); // console.log('恢复初始代码====》》》》', res);
const {status, data} = res; const {status, data} = res;
if (status === 200) { if (status === 200) {
dispatch({ dispatch({
type: types.RESTORE_INITIAL_CODE, type: types.RESTORE_INITIAL_CODE,
payload: data.code payload: data.code
}) });
notification.success({
message: '提示',
description: msg
});
} }
}); });
} }

@ -4,7 +4,7 @@
* @Github: * @Github:
* @Date: 2019-11-20 16:35:46 * @Date: 2019-11-20 16:35:46
* @LastEditors: tangjiang * @LastEditors: tangjiang
* @LastEditTime: 2019-12-13 10:46:15 * @LastEditTime: 2019-12-13 16:56:22
*/ */
import types from './actionTypes'; import types from './actionTypes';
import CONST from '../../constants'; import CONST from '../../constants';
@ -251,7 +251,11 @@ export const validateOjForm = (props, type) => {
// 提示发布信息 // 提示发布信息
publishTask(identifier).then(res => { publishTask(identifier).then(res => {
if (res.data.status === 0) { if (res.data.status === 0) {
message.success('发布成功!'); // message.success('发布成功!');
notification.success({
message: '提示',
description: '发布成功!'
});
linkToDev(dispatch, props); linkToDev(dispatch, props);
} }
dispatch({ dispatch({
@ -269,7 +273,11 @@ export const validateOjForm = (props, type) => {
fetchPostOjForm(paramsObj).then(res => { fetchPostOjForm(paramsObj).then(res => {
if (res.status === 200) { // 保存成功后,重新跳转至列表页 if (res.status === 200) { // 保存成功后,重新跳转至列表页
if (res.data.status === 0) { if (res.data.status === 0) {
message.success(paramsObj['submitType'] === 'update' ? '更新成功' : '保存成功'); // message.success(paramsObj['submitType'] === 'update' ? '更新成功' : '保存成功');
notification.success({
message: '提示',
description: paramsObj['submitType'] === 'update' ? '更新成功' : '保存成功'
});
linkToDev(dispatch, props); linkToDev(dispatch, props);
} }
dispatch({ dispatch({
@ -299,7 +307,11 @@ export const handleClickCancelPublish = (props, identifier) => {
if (res.status = 200) { if (res.status = 200) {
const { data} = res; const { data} = res;
if (data.status === 0) { if (data.status === 0) {
message.success('撤销发布成功!'); // message.success('撤销发布成功!');
notification.success({
message: '提示',
description: '撤销发布成功!'
});
linkToDev(dispatch, props); linkToDev(dispatch, props);
} }
} }

@ -4,7 +4,7 @@
* @Github: * @Github:
* @Date: 2019-11-20 10:55:38 * @Date: 2019-11-20 10:55:38
* @LastEditors: tangjiang * @LastEditors: tangjiang
* @LastEditTime: 2019-12-13 10:09:12 * @LastEditTime: 2019-12-13 17:03:47
*/ */
import axios from 'axios'; import axios from 'axios';
@ -84,10 +84,10 @@ export async function fetchUserCommitRecordDetail (identifier) {
} }
// 恢复初始代码 // 恢复初始代码
export async function restoreInitialCode (identifier) { // export async function restoreInitialCode (identifier) {
const url = `/myproblems/${identifier}/restore_initial_code.json`; // const url = `/myproblems/${identifier}/restore_initial_code.json`;
return axios.get(url); // return axios.get(url);
} // }
// 发布任务 // 发布任务
export async function publishTask (identifier) { export async function publishTask (identifier) {
@ -115,7 +115,8 @@ export async function fetchUserCodeSubmit (identifier) {
// 恢复初始代码 // 恢复初始代码
export async function fetchRestoreInitialCode (identifier) { export async function fetchRestoreInitialCode (identifier) {
const url = `/myproblems/${identifier}/restore_initial_code.json`; // const url = `/myproblems/${identifier}/restore_initial_code.json`;
const url = `/myproblems/${identifier}/sync_code.json`;
return axios.post(url); return axios.post(url);
} }

Loading…
Cancel
Save