杨树林 5 years ago
commit 572dd32fee

@ -125,7 +125,7 @@ $(window).resize(function() {
rightSlider(); rightSlider();
}); });
function rightSlider() { function rightSlider() {
var poi = parseInt((parseInt($(window).width()) - 1200) / 2) - 60; var poi = parseInt((parseInt($(window).width()) - 1200) / 2) - 81;
// console.log(parseInt($(window).width())+" "+poi); // console.log(parseInt($(window).width())+" "+poi);
if (poi > 0) { if (poi > 0) {
$(".-task-sidebar").css("right", poi); $(".-task-sidebar").css("right", poi);

@ -114,21 +114,21 @@ module.exports = {
// First, run the linter. // First, run the linter.
// It's important to do this before Babel processes the JS. // It's important to do this before Babel processes the JS.
// 上线然后要注释回来 // 上线然后要注释回来
// { {
// test: /\.(js|jsx|mjs)$/, test: /\.(js|jsx|mjs)$/,
// enforce: 'pre', enforce: 'pre',
// use: [ use: [
// { {
// options: { options: {
// formatter: eslintFormatter, formatter: eslintFormatter,
// eslintPath: require.resolve('eslint'), eslintPath: require.resolve('eslint'),
//
// }, },
// loader: require.resolve('eslint-loader'), loader: require.resolve('eslint-loader'),
// }, },
// ], ],
// include: paths.appSrc, include: paths.appSrc,
// }, },
{ {
// "oneOf" will traverse all following loaders until one will // "oneOf" will traverse all following loaders until one will
// match the requirements. When no loader matches it will fall // match the requirements. When no loader matches it will fall

@ -56,8 +56,8 @@ module.exports = {
bail: true, bail: true,
// We generate sourcemaps in production. This is slow but gives good results. // We generate sourcemaps in production. This is slow but gives good results.
// You can exclude the *.map files from the build during deployment. // You can exclude the *.map files from the build during deployment.
// devtool: shouldUseSourceMap ? 'nosources-source-map' : false, //正式版 devtool: shouldUseSourceMap ? 'nosources-source-map' : false, //正式版
devtool: shouldUseSourceMap ? 'source-map' : false,//测试版 // devtool: shouldUseSourceMap ? 'source-map' : false,//测试版
// In production, we only want to load the polyfills and the app code. // In production, we only want to load the polyfills and the app code.
entry: [require.resolve('./polyfills'), paths.appIndexJs], entry: [require.resolve('./polyfills'), paths.appIndexJs],
output: { output: {

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -2,12 +2,23 @@ import React, { Component } from 'react';
import { BrowserRouter as Router, Route, Link } from "react-router-dom"; import { BrowserRouter as Router, Route, Link } from "react-router-dom";
import { Spin } from 'antd';
class Loading extends Component { class Loading extends Component {
render() { render() {
// Loading // Loading
return ( return (
<div className="App" style={{minHeight: '800px'}}> <div className="App" style={{minHeight: '800px'}}>
<style>
{
`
.margintop{
margin-top:20%;
}
`
}
</style>
<Spin size="large" className={"margintop"}/>
</div> </div>
); );
} }

@ -1,4 +1,8 @@
import { bytesToSize } from 'educoder'; import { bytesToSize } from 'educoder';
export function isImageExtension(fileName) {
return fileName ? !!(fileName.match(/.(jpg|jpeg|png|gif)$/i)) : false
}
export function markdownToHTML(oldContent, selector) { export function markdownToHTML(oldContent, selector) {
window.$('#md_div').html('') window.$('#md_div').html('')
// markdown to html // markdown to html

@ -14,7 +14,7 @@ export { updatePageParams as updatePageParams } from './RouterUti
export { bytesToSize as bytesToSize } from './UnitUtil'; export { bytesToSize as bytesToSize } from './UnitUtil';
export { markdownToHTML, uploadNameSizeSeperator, appendFileSizeToUploadFile, appendFileSizeToUploadFileAll } from './TextUtil' export { markdownToHTML, uploadNameSizeSeperator, appendFileSizeToUploadFile, appendFileSizeToUploadFileAll, isImageExtension } from './TextUtil'
export { handleDateString, getNextHalfHourOfMoment,formatDuring } from './DateUtil' export { handleDateString, getNextHalfHourOfMoment,formatDuring } from './DateUtil'

@ -6,6 +6,8 @@ import Loading from '../../Loading';
import axios from 'axios'; import axios from 'axios';
import { TPMIndexHOC } from '../tpm/TPMIndexHOC'; import { TPMIndexHOC } from '../tpm/TPMIndexHOC';
import { CNotificationHOC } from './common/CNotificationHOC' import { CNotificationHOC } from './common/CNotificationHOC'
import {ImageLayerOfCommentHOC} from '../page/layers/ImageLayerOfCommentHOC'
import "./css/Courses.css" import "./css/Courses.css"
//引入对应跳转的组件 //引入对应跳转的组件
@ -862,4 +864,4 @@ class CoursesIndex extends Component{
} }
} }
export default CNotificationHOC() ( SnackbarHOC() ( TPMIndexHOC(CoursesIndex) )); export default ImageLayerOfCommentHOC({imgSelector: '.imageLayerParent img, .imageLayerParent .imageTarget', parentSelector: '.newMain'}) (CNotificationHOC() ( SnackbarHOC() ( TPMIndexHOC(CoursesIndex) )));

@ -26,7 +26,8 @@ class BoardsNew extends Component{
this.state = { this.state = {
fileList: [], fileList: [],
boards: [] boards: [],
title_num: 60
} }
} }
addSuccess = () => { addSuccess = () => {
@ -93,7 +94,8 @@ class BoardsNew extends Component{
status: 'done' status: 'done'
} }
}) })
this.setState({ fileList: _fileList, board_name: data.board_name })
this.setState({ fileList: _fileList, board_name: data.board_name, title_num: 60 - parseInt(data.subject.length) })
} }
} }
}) })
@ -228,8 +230,14 @@ class BoardsNew extends Component{
}); });
} }
// 附件相关 ------------ END // 附件相关 ------------ END
changeTitle=(e)=>{
console.log(e.target.value.length);
this.setState({
title_num: 60 - parseInt(e.target.value.length)
})
}
render() { render() {
let { addGroup, fileList, course_id } = this.state; let { addGroup, fileList, course_id, title_num } = this.state;
const { getFieldDecorator } = this.props.form; const { getFieldDecorator } = this.props.form;
const formItemLayout = { const formItemLayout = {
@ -303,21 +311,27 @@ class BoardsNew extends Component{
返回 返回
</a> </a>
</p> </p>
{/* notRequired */}
<Form {...formItemLayout} onSubmit={this.handleSubmit}> <Form {...formItemLayout} onSubmit={this.handleSubmit}>
<div className="formBlock" style={{paddingBottom: '0px'}}> <div className="formBlock" style={{paddingBottom: '0px'}}>
<Form.Item <Form.Item
label="标题" label="标题"
className="topicTitle " className="topicTitle "
> >
{getFieldDecorator('sticky', { { isAdmin &&
valuePropName: 'checked', <React.Fragment>
})( {getFieldDecorator('sticky', {
<Checkbox style={{ right: '0px', valuePropName: 'checked',
top: '-50px', })(
position: 'absolute' isAdmin && <Checkbox style={{ right: '0px',
}}>置顶</Checkbox> top: '-50px',
)} position: 'absolute'
}}>置顶</Checkbox>
)}
{/* checkbox 有个边距样式 .ant-checkbox-wrapper + span, */}
<span style={{ "padding-left": 0, "padding-right": 0 }}></span>
</React.Fragment>
}
{getFieldDecorator('subject', { {getFieldDecorator('subject', {
rules: [{ rules: [{
required: true, message: '请输入标题', required: true, message: '请输入标题',
@ -325,7 +339,8 @@ class BoardsNew extends Component{
max: 60, message: '最大限制为60个字符', max: 60, message: '最大限制为60个字符',
}], }],
})( })(
<Input placeholder="请输入帖子标题最大限制60个字符" className="searchViewAfter"/> <Input placeholder="请输入帖子标题最大限制60个字符" className="searchViewAfter" maxLength="60"
onInput={this.changeTitle} addonAfter={String(title_num)} />
)} )}
</Form.Item> </Form.Item>

@ -237,16 +237,16 @@ class TopicDetail extends Component {
// </a> // </a>
// </p> // </p>
<div className="color-grey" key={index}> <div className="color-grey df" key={index}>
<a className="color-grey ml20"> <a className="color-grey ">
<i className="font-14 color-green iconfont icon-fujian mr8" aria-hidden="true"></i> <i className="font-14 color-green iconfont icon-fujian mr8" aria-hidden="true"></i>
</a> </a>
{fileName && <ConditionToolTip title={fileName} condition={fileName.length > 30 }> {/* {fileName && <ConditionToolTip title={fileName} condition={fileName.length > 30 }> </ConditionToolTip>} */}
<a href={item.url} <a href={item.url} title={fileName.length > 30 ? fileName : ''}
className="mr12 color9B9B" length="58"> className="mr12 color9B9B overflowHidden1" length="58" style={{maxWidth: '480px'}}>
{fileName} {fileName}
</a> </a>
</ConditionToolTip>}
<span className="color656565 mt2 color-grey-6 font-12 mr8">{item.filesize}</span> <span className="color656565 mt2 color-grey-6 font-12 mr8">{item.filesize}</span>
@ -416,7 +416,7 @@ class TopicDetail extends Component {
const user = this._getUser(); const user = this._getUser();
this.setState({ this.setState({
comments: addNewComment(comments, _id, content, user, this) comments: addNewComment(comments, _id, content, user, this.props.isSuperAdmin(), this)
}) })
const newMemo2 = Object.assign({}, this.state.memo); const newMemo2 = Object.assign({}, this.state.memo);
newMemo2.total_replies_count = newMemo2.total_replies_count + 1; newMemo2.total_replies_count = newMemo2.total_replies_count + 1;
@ -540,6 +540,10 @@ class TopicDetail extends Component {
padding-bottom: 20px; padding-bottom: 20px;
margin-bottom: 0px !important; margin-bottom: 0px !important;
} }
.course-message.topicDetail .panel-comment_item .comment_orig_content {
width: 1072px;
}
`}</style> `}</style>
<CBreadcrumb className={'independent'} items={[ <CBreadcrumb className={'independent'} items={[
{ to: `/courses/${courseId}`, name: this.props.coursedata.name}, { to: `/courses/${courseId}`, name: this.props.coursedata.name},
@ -646,7 +650,7 @@ class TopicDetail extends Component {
<div className="padding30 memoContent new_li" style={{ paddingBottom: '10px'}}> <div className="padding30 memoContent new_li" style={{ paddingBottom: '10px'}}>
<MarkdownToHtml content={memo.content}></MarkdownToHtml> <MarkdownToHtml content={memo.content}></MarkdownToHtml>
</div> </div>
<div className="padding40 bor-bottom-greyE" style={{paddingTop: '2px'}}> <div className="padding30 bor-bottom-greyE" style={{paddingTop: '2px'}}>
<div className="mt10 mb20"> <div className="mt10 mb20">
{/* ${memo.user_praise ? '' : ''} */} {/* ${memo.user_praise ? '' : ''} */}
<Tooltip title={`${memo.liked ? '取消点赞' : '点赞'}`}> <Tooltip title={`${memo.liked ? '取消点赞' : '点赞'}`}>
@ -701,11 +705,13 @@ class TopicDetail extends Component {
</div>} */} </div>} */}
</div> </div>
{ total_count > REPLY_PAGE_COUNT &&
<div className="memoMore"> <div className="memoMore" style={{'margin-top': '20px'}}>
<Pagination showQuickJumper onChange={this.onPaginationChange} current={pageCount} total={total_count} pageSize={10}/> { total_count > REPLY_PAGE_COUNT &&
<Pagination showQuickJumper onChange={this.onPaginationChange} current={pageCount} total={total_count} pageSize={10}/>
}
<div className="writeCommentBtn" onClick={this.showCommentInput}>写评论</div> <div className="writeCommentBtn" onClick={this.showCommentInput}>写评论</div>
</div> } </div>
</div> </div>
</div> </div>

@ -218,6 +218,9 @@ class Boards extends Component{
} }
onPressEnter = (e) => { onPressEnter = (e) => {
clearTimeout(this.timeoutHandler)
this.timeoutHandler = null;
this.fetchAll(this.state.searchValue, 1) this.fetchAll(this.state.searchValue, 1)
} }
onInputSearchChange = (e) => { onInputSearchChange = (e) => {
@ -227,6 +230,7 @@ class Boards extends Component{
if (this.timeoutHandler) { if (this.timeoutHandler) {
clearTimeout(this.timeoutHandler) clearTimeout(this.timeoutHandler)
this.timeoutHandler = null;
} }
this.timeoutHandler = setTimeout(() => { this.timeoutHandler = setTimeout(() => {
this.fetchAll(this.state.searchValue, 1) this.fetchAll(this.state.searchValue, 1)
@ -359,7 +363,7 @@ class Boards extends Component{
<FilesListItem></FilesListItem> */} <FilesListItem></FilesListItem> */}
<div className="mt20 edu-back-white padding20-30"> {isAdmin && <div className="mt20 edu-back-white padding20-30">
<div className="clearfix"> <div className="clearfix">
{isAdmin && <Checkbox className="fl" onChange={this.onCheckAll} checked={checkAllValue}>已选 {checkBoxValues.length} </Checkbox>} {isAdmin && <Checkbox className="fl" onChange={this.onCheckAll} checked={checkAllValue}>已选 {checkBoxValues.length} </Checkbox>}
<div className="studentList_operation_ul"> <div className="studentList_operation_ul">
@ -406,6 +410,7 @@ class Boards extends Component{
</div> </div>
</div> </div>
</div> </div>
}
<style>{` <style>{`
.panel-inner-fourm { .panel-inner-fourm {
border-bottom: none; border-bottom: none;

@ -179,7 +179,7 @@ class CommonWorkAppraise extends Component{
{/* <div className="padding40 memoContent new_li"> {/* <div className="padding40 memoContent new_li">
</div> */} </div> */}
<div className={"appraise "} style={{}}> <div className={"appraise imageLayerParent "} style={{}}>
<style>{` <style>{`
.workAppraise>div:last-child { .workAppraise>div:last-child {
border-bottom: none !important; border-bottom: none !important;
@ -199,8 +199,9 @@ class CommonWorkAppraise extends Component{
<a className="color-grey ml20"> <a className="color-grey ml20">
<i className="font-14 color-green iconfont icon-fujian mr8" aria-hidden="true"></i> <i className="font-14 color-green iconfont icon-fujian mr8" aria-hidden="true"></i>
</a> </a>
<a href={item.url} <a href={item.url}
className="mr12 color9B9B" length="58" title={`${item.title && item.title.length > 40 ? item.title : ''}`}> className="mr12 color9B9B imageTarget" length="58" title={`${item.title && item.title.length > 40 ? item.title : ''}`}>
{item.title} {item.title}
</a> </a>
<span className="color656565 mt2 color-grey-6 font-12 mr8">{item.filesize}</span> <span className="color656565 mt2 color-grey-6 font-12 mr8">{item.filesize}</span>
@ -253,7 +254,7 @@ class CommonWorkAppraise extends Component{
<i className="font-14 color-green iconfont icon-fujian mr8" aria-hidden="true"></i> <i className="font-14 color-green iconfont icon-fujian mr8" aria-hidden="true"></i>
</a> </a>
<a href={item.url} <a href={item.url}
className="mr12 color9B9B" length="58"> className="mr12 color9B9B imageTarget" length="58">
{item.title} {item.title}
</a> </a>
<span className="color656565 mt2 color-grey-6 font-12 mr8">{item.filesize}</span> <span className="color656565 mt2 color-grey-6 font-12 mr8">{item.filesize}</span>

@ -103,7 +103,14 @@ class UseBank extends Component{
} }
closeSelectBank=()=>{ closeSelectBank=()=>{
this.setState({ this.setState({
flag:false flag:false,
nav_my: 'myself',
search: '',
page: 1,
checkBoxValues: [],
isChecked:'',
is_teacher:undefined,
hometypepvisible:false
}) })
} }
@ -190,7 +197,7 @@ class UseBank extends Component{
width:218px !important; width:218px !important;
} }
.bankwidth{ .bankwidth{
width:29% !important; width:24% !important;
overflow:hidden; overflow:hidden;
text-overflow:ellipsis; text-overflow:ellipsis;
white-space:nowrap white-space:nowrap
@ -245,7 +252,7 @@ class UseBank extends Component{
<div style={{"height":"230px"}} className="d_middle edu-txt-center"> <div style={{"height":"230px"}} className="d_middle edu-txt-center">
<div> <div>
<p className="font-16 mb20 color-grey-3">通过职业认证的教师才能访问公共题库</p> <p className="font-16 mb20 color-grey-3">通过职业认证的教师才能访问公共题库</p>
<a className="white-btn edu-orangeback-btn" target="_blank" href="https://www.educoder.net/account/professional_certification">立即认证</a> <a className="white-btn edu-orangeback-btn" target="_blank" href="/account/professional_certification">立即认证</a>
</div> </div>
</div> </div>
: :
@ -275,7 +282,7 @@ class UseBank extends Component{
<span className="fl with65"> <span className="fl with65">
<label className="task-hide fl" title={item.name && item.name.length > 30 ? item.name:""} style={{"maxWidth":"100%"}}>{item.name}</label> <label className="task-hide fl" title={item.name && item.name.length > 30 ? item.name:""} style={{"maxWidth":"100%"}}>{item.name}</label>
</span> </span>
<span title={item.course_list_name && item.course_list_name.length > 14 && item.course_list_name} <span title={item.course_list_name && item.course_list_name.length > 10 && item.course_list_name}
className={nav_my==='myself'?"fl with30 color-grey-6 task-hide pl5 bankwidth":"fl with30 color-grey-6 task-hide pl5 bankwidth"} className={nav_my==='myself'?"fl with30 color-grey-6 task-hide pl5 bankwidth":"fl with30 color-grey-6 task-hide pl5 bankwidth"}
>{item.course_list_name}</span> >{item.course_list_name}</span>

@ -18,6 +18,10 @@
.courseForm .ant-form-item-label { .courseForm .ant-form-item-label {
margin-left: -10px; margin-left: -10px;
} }
.courseForm .notRequired .ant-form-item-label {
margin-left: 0px;
}
/* 不知道被哪个样式影响,这里需要重置 */ /* 不知道被哪个样式影响,这里需要重置 */
.courseForm .ant-input:focus { .courseForm .ant-input:focus {

@ -825,9 +825,9 @@ class Coursesleftnav extends Component{
{ is_teacher===true? { is_teacher===true?
course_modules===undefined?"":course_modules.map((item,key)=>{ course_modules===undefined?"":course_modules.map((item,key)=>{
return( return(
<div key={key} > <div key={key} >
<a> <a>
<li onClick={(e)=>this.showsandians(e,key,item.category_url,1)} className={this.props.mainurl===item.category_url&&key===this.props.indexs?"liactive":"clearfix active"} onMouseLeave={(e)=>this.hidesandian(e,key)} onMouseEnter={(e)=>this.showsandian(e,key)}> <li title={item.name.length<7?"":item.name} onClick={(e)=>this.showsandians(e,key,item.category_url,1)} className={this.props.mainurl===item.category_url&&key===this.props.indexs?"liactive":"clearfix active"} onMouseLeave={(e)=>this.hidesandian(e,key)} onMouseEnter={(e)=>this.showsandian(e,key)}>
<a onClick={(e)=>this.showsandians(e,key,item.category_url,1)} className={ item.second_category===undefined?"fl ml20 pd0":item.second_category.length===0?"fl ml20 pd0":this.state.sandiantypes===key?"fl ml20 pd0 ebebeb":"fl ml20 pd0"}> <a onClick={(e)=>this.showsandians(e,key,item.category_url,1)} className={ item.second_category===undefined?"fl ml20 pd0":item.second_category.length===0?"fl ml20 pd0":this.state.sandiantypes===key?"fl ml20 pd0 ebebeb":"fl ml20 pd0"}>
{ {
item.type==="shixun_homework"?<i className={this.props.location.pathname===item.category_url?"color-blue iconfont icon-daima mr10 fl":"iconfont icon-daima mr10 fl"}></i>: item.type==="shixun_homework"?<i className={this.props.location.pathname===item.category_url?"color-blue iconfont icon-daima mr10 fl":"iconfont icon-daima mr10 fl"}></i>:
@ -844,7 +844,6 @@ class Coursesleftnav extends Component{
{/*||this.props.location.pathname===this.state.url&&key===this.state.indexs*/} {/*||this.props.location.pathname===this.state.url&&key===this.state.indexs*/}
<span className={this.props.location.pathname===item.category_url?"color-blue task-hide activity-left-name":"task-hide activity-left-name"} <span className={this.props.location.pathname===item.category_url?"color-blue task-hide activity-left-name":"task-hide activity-left-name"}
title={item.name.length<6?"":item.name}
onClick={(e)=>this.selectnavid(e,key,item.id,item.type,item.category_url)} onClick={(e)=>this.selectnavid(e,key,item.id,item.type,item.category_url)}
>{item.name}</span> >{item.name}</span>
@ -901,6 +900,7 @@ class Coursesleftnav extends Component{
ref={provided.innerRef} ref={provided.innerRef}
{...provided.draggableProps} {...provided.draggableProps}
{...provided.dragHandleProps} {...provided.dragHandleProps}
title={iem.category_name.length<10?"":iem.category_name}
> >
<a className="fl pl46 pd0 Draggablelichild"> <a className="fl pl46 pd0 Draggablelichild">
@ -940,6 +940,7 @@ class Coursesleftnav extends Component{
<a > <a >
<li className={this.props.mainurl===item.category_url&&key===this.props.indexs?"liactive":"clearfix active"} <li className={this.props.mainurl===item.category_url&&key===this.props.indexs?"liactive":"clearfix active"}
onClick={(e)=>this.setnavid(e,key,item.id,item.type,item.category_url)} onMouseEnter={(e)=>this.showsandian(e,key)} onClick={(e)=>this.setnavid(e,key,item.id,item.type,item.category_url)} onMouseEnter={(e)=>this.showsandian(e,key)}
title={item.name.length<7?"":item.name}
> >
<a className={ item.second_category===undefined?"fl ml20 pd0":item.second_category.length===0?"fl ml20 pd0":this.state.sandiantypes===key?"fl ml20 pd0 ebebeb":"fl ml20 pd0"}> <a className={ item.second_category===undefined?"fl ml20 pd0":item.second_category.length===0?"fl ml20 pd0":this.state.sandiantypes===key?"fl ml20 pd0 ebebeb":"fl ml20 pd0"}>
{ {
@ -977,7 +978,7 @@ class Coursesleftnav extends Component{
} }
return( return(
<a > <a >
<li className="clearfix Draggableli" key={index} style={{ width: '244px'}}> <li className="clearfix Draggableli" key={index} style={{ width: '244px'}} title={iem.category_name.length<10?"":iem.category_name}>
<a className="fl pl46 pd0 Draggablelichild" onClick={(e)=>this.selectnavids(e,key,iem.category_id,item.type+"child",iem.second_category_url,key)} > <a className="fl pl46 pd0 Draggablelichild" onClick={(e)=>this.selectnavids(e,key,iem.category_id,item.type+"child",iem.second_category_url,key)} >
{/*<span className="fl ml38 maxwidth155 task-hide">{iem.category_name}</span>*/} {/*<span className="fl ml38 maxwidth155 task-hide">{iem.category_name}</span>*/}

@ -1,11 +1,7 @@
import React,{ Component } from "react"; import React,{ Component } from "react";
import { Modal,Checkbox,Select,Input,Tooltip } from "antd"; import { Modal,Checkbox,Select,Input,Tooltip,Spin,Icon } from "antd";
import axios from'axios'; import axios from'axios';
import Loading from '@icedesign/base/lib/loading';
import '@icedesign/base/lib/loading/style.js';
import Modals from '../../modals/Modals'; import Modals from '../../modals/Modals';
const Option = Select.Option;
const Search = Input.Search; const Search = Input.Search;
class PathModal extends Component{ class PathModal extends Component{
constructor(props){ constructor(props){
@ -126,7 +122,7 @@ class PathModal extends Component{
render(){ render(){
let {Searchvalue,type,Modalstype}=this.state; let {Searchvalue,type,Modalstype}=this.state;
let {visible,shixunmodallist,hometypepvisible,newshixunmodallist}=this.props; let {visible,shixunmodallist,hometypepvisible,newshixunmodallist}=this.props;
const antIcon = <Icon type="loading" style={{ fontSize: 24 }} spin />;
return( return(
<div> <div>
@ -148,8 +144,7 @@ class PathModal extends Component{
width="840px" width="840px"
destroyOnClose={true} destroyOnClose={true}
> >
<Loading visible={false} shape="dot-circle" color='#4AC7FF'> <Spin indicator={antIcon} spinning={hometypepvisible} size="large" style={{marginTop:'15%'}}>
<div className="newupload_conbox"> <div className="newupload_conbox">
{ shixunmodallist && shixunmodallist.tags.length===0?"":<div className="clearfix mb20 shixun_work_div newshixun_tab_div cdefault" style={{"marginRight":"4px"}} id="shixun_tab_div"> { shixunmodallist && shixunmodallist.tags.length===0?"":<div className="clearfix mb20 shixun_work_div newshixun_tab_div cdefault" style={{"marginRight":"4px"}} id="shixun_tab_div">
@ -203,7 +198,6 @@ class PathModal extends Component{
<div className="over210 pl20 pr20" <div className="over210 pl20 pr20"
onScroll={this.contentViewScrolledit} onScroll={this.contentViewScrolledit}
style={{"Height":"204px"}}> style={{"Height":"204px"}}>
<Loading visible={hometypepvisible} shape="dot-circle" className="newnext-loading" color='#4AC7FF'>
<Checkbox.Group style={{ width: '100%' }} onChange={this.shixunhomeworkedit}> <Checkbox.Group style={{ width: '100%' }} onChange={this.shixunhomeworkedit}>
{ {
newshixunmodallist&&newshixunmodallist.map((item,key)=>{ newshixunmodallist&&newshixunmodallist.map((item,key)=>{
@ -229,7 +223,6 @@ class PathModal extends Component{
}) })
} }
</Checkbox.Group> </Checkbox.Group>
</Loading>
</div> </div>
{ this.state.patheditarrytype===true?<span className={"color-red"}>{this.state.patheditarryvalue}</span>:""} { this.state.patheditarrytype===true?<span className={"color-red"}>{this.state.patheditarryvalue}</span>:""}
<div className="mt20 marginauto clearfix edu-txt-center"> <div className="mt20 marginauto clearfix edu-txt-center">
@ -237,7 +230,7 @@ class PathModal extends Component{
<a className="task-btn task-btn-orange margin-tp26" id="submit_send_shixun" onClick={this.savecouseShixunModal}>确定</a> <a className="task-btn task-btn-orange margin-tp26" id="submit_send_shixun" onClick={this.savecouseShixunModal}>确定</a>
</div> </div>
</div> </div>
</Loading> </Spin>
</Modal> </Modal>
</div> </div>
) )

@ -1,9 +1,7 @@
import React,{ Component } from "react"; import React,{ Component } from "react";
import { Modal,Checkbox,Select,Input} from "antd"; import { Modal,Checkbox,Select,Input,Spin,Icon} from "antd";
import axios from'axios'; import axios from'axios';
import NoneData from "../coursesPublic/NoneData"; import NoneData from "../coursesPublic/NoneData";
import Loading from '@icedesign/base/lib/loading';
import '@icedesign/base/lib/loading/style.js';
import Modals from '../../modals/Modals'; import Modals from '../../modals/Modals';
const Option = Select.Option; const Option = Select.Option;
@ -244,7 +242,7 @@ class Selectresource extends Component{
render(){ render(){
let {Searchvalue,type,category_id,Resourcelist,hometypepvisible,patheditarry}=this.state; let {Searchvalue,type,category_id,Resourcelist,hometypepvisible,patheditarry}=this.state;
let {visible,shixunmodallist}=this.props; let {visible,shixunmodallist}=this.props;
const antIcon = <Icon type="loading" style={{ fontSize: 24 }} spin />;
return( return(
<div> <div>
{/*提示*/} {/*提示*/}
@ -275,8 +273,8 @@ class Selectresource extends Component{
` `
} }
</style> </style>
<Loading visible={false} shape="dot-circle" color='#4AC7FF'>
<Spin indicator={antIcon} spinning={hometypepvisible} size="large" style={{marginTop:'15%'}}>
<style>{` <style>{`
.newupload_conboxtop{ .newupload_conboxtop{
margin-top: -30px; margin-top: -30px;
@ -343,8 +341,8 @@ class Selectresource extends Component{
> >
{ {
Resourcelist === undefined ? "": Resourcelist === undefined ?Resourcelist.files.length===0?<NoneData/>:
<Loading visible={hometypepvisible} shape="dot-circle" className="newnext-loading" color='#4AC7FF'>
<Checkbox.Group style={{ width: '100%' }} value={patheditarry} onChange={this.shixunhomeworkedit}> <Checkbox.Group style={{ width: '100%' }} value={patheditarry} onChange={this.shixunhomeworkedit}>
{ {
Resourcelist.files.map((item,key)=>{ Resourcelist.files.map((item,key)=>{
@ -367,9 +365,8 @@ class Selectresource extends Component{
) )
}) })
} }
</Checkbox.Group> </Checkbox.Group>:""
{ Resourcelist.files.length===0?<NoneData/>:""}
</Loading>
} }
</div> </div>
@ -382,7 +379,7 @@ class Selectresource extends Component{
<a className="task-btn task-btn-orange margin-tp26" id="submit_send_shixun" onClick={this.savecouseShixunModal}>确定</a> <a className="task-btn task-btn-orange margin-tp26" id="submit_send_shixun" onClick={this.savecouseShixunModal}>确定</a>
</div> </div>
</div> </div>
</Loading> </Spin>
</Modal>:""} </Modal>:""}
</div> </div>
) )

@ -1,8 +1,7 @@
import React,{ Component } from "react"; import React,{ Component } from "react";
import { Modal,Checkbox,Select,Input} from "antd"; import { Modal,Checkbox,Select,Input} from "antd";
import axios from'axios'; import axios from'axios';
import Loading from '@icedesign/base/lib/loading';
import '@icedesign/base/lib/loading/style.js';
import Modals from '../../modals/Modals'; import Modals from '../../modals/Modals';
const Option = Select.Option; const Option = Select.Option;
@ -77,7 +76,6 @@ class Showoldfiles extends Component{
` `
} }
</style> </style>
<Loading visible={false} shape="dot-circle" color='#4AC7FF'>
<style>{` <style>{`
.newupload_conboxtop{ .newupload_conboxtop{
@ -209,7 +207,7 @@ class Showoldfiles extends Component{
</div> </div>
</div> </div>
</Loading>
</Modal>:""} </Modal>:""}
</div> </div>
) )

@ -1,8 +1,6 @@
import React,{ Component } from "react"; import React,{ Component } from "react";
import { Modal,Checkbox,Select,Input,Tooltip,Spin,Icon} from "antd"; import { Modal,Checkbox,Select,Input,Tooltip,Spin,Icon} from "antd";
import axios from'axios'; import axios from'axios';
// import Loading from '@icedesign/base/lib/loading';
// import '@icedesign/base/lib/loading/style.js';
const Option = Select.Option; const Option = Select.Option;
const Search = Input.Search; const Search = Input.Search;
@ -276,7 +274,7 @@ class ShixunModal extends Component{
` `
} }
</style> </style>
{/*<Loading visible={hometypepvisible} shape="dot-circle" className="newnext-loading" color='#4AC7FF'>*/}
<Checkbox.Group style={{ width: '100%' }} value={patheditarry} onChange={this.shixunhomeworkedit}> <Checkbox.Group style={{ width: '100%' }} value={patheditarry} onChange={this.shixunhomeworkedit}>
{ {
newshixunmodallist === undefined ? "": newshixunmodallist.map((item,key)=>{ newshixunmodallist === undefined ? "": newshixunmodallist.map((item,key)=>{
@ -303,7 +301,6 @@ class ShixunModal extends Component{
}) })
} }
</Checkbox.Group> </Checkbox.Group>
{/*</Loading>*/}
</div> </div>
</div> </div>
</Spin> </Spin>

@ -193,7 +193,7 @@ class Exercise extends Component{
} }
// 题库选用成功后刷新页面 // 题库选用成功后刷新页面
useBankSuccess=(checkValue,value)=>{ useBankSuccess=(checkValue,value)=>{
debugger
let{type,StudentList_value,page,limit}=this.state; let{type,StudentList_value,page,limit}=this.state;
let coursesId=this.props.match.params.coursesId; let coursesId=this.props.match.params.coursesId;
let url=`/courses/${coursesId}/exercises/publish_modal.json`; let url=`/courses/${coursesId}/exercises/publish_modal.json`;

@ -116,7 +116,7 @@ class ExerciseListItem extends Component{
{ {
item.lock_status === 0 ? item.lock_status === 0 ?
<Tooltip title={ this.props.isNotMember()?"私有属性,非课堂成员不能访问":"私有属性"} placement="bottom"> <Tooltip title={ this.props.isNotMember()===true?"私有属性,非课堂成员不能访问":"私有属性"} placement="bottom">
<i className="iconfont icon-guansuo color-grey-c ml10 font-16 fl"></i> <i className="iconfont icon-guansuo color-grey-c ml10 font-16 fl"></i>
</Tooltip> </Tooltip>
:"" :""

@ -197,18 +197,18 @@ class Exercisestatisticalresult extends Component {
item.ques_details.map((ite,k)=>{ item.ques_details.map((ite,k)=>{
return( return(
<div> <div className={"mt20"}>
<div className="clearfix edu-back-white poll_list" style={{padding: '0px 20px'}}> <div className="clearfix edu-back-white poll_list" style={{padding: '0px 20px'}}>
<div className="font-16 shixunreporttitle fl" > <div className="font-16 shixunreporttitle fl" >
<span> {ite.challenge_position}{ite.challenge_name}</span> <span> {ite.challenge_position}{ite.challenge_name}</span>
</div>
</div> </div>
</div> <Exercisetablesmubu
<Exercisetablesmubu data={ite.challenge_details}
data={ite.challenge_details} type={item.ques_type}
type={item.ques_type} effictive_counts={item.effictive_counts}
effictive_counts={item.effictive_counts} choicetype={choicetype}
choicetype={choicetype} />
/>
</div> </div>
) )
}): }):

@ -613,7 +613,7 @@ class GraduationTasksSubmitedit extends Component{
{item.delete===true? {item.delete===true?
<i className="font-14 iconfont icon-guanbi " <i className="font-14 iconfont icon-guanbi "
id={item.id} id={item.id}
onClick={()=>this.onAttachmentRemove(item)} onClick={()=>this.onAttachmentRemove(item.id)}
aria-hidden="true"> aria-hidden="true">
</i>:""} </i>:""}
</div> </div>

@ -2,7 +2,7 @@ import React,{Component} from "React";
import { Form, Select, Input, Button,Checkbox,Upload,Icon,message,Modal} from "antd"; import { Form, Select, Input, Button,Checkbox,Upload,Icon,message,Modal} from "antd";
import {Link} from 'react-router-dom'; import {Link} from 'react-router-dom';
import TPMMDEditor from '../../../tpm/challengesnew/TPMMDEditor'; import TPMMDEditor from '../../../tpm/challengesnew/TPMMDEditor';
import { WordsBtn,getUrl } from 'educoder'; import { WordsBtn,getUrl ,bytesToSize} from 'educoder';
import axios from 'axios'; import axios from 'axios';
import Modals from '../../../modals/Modals'; import Modals from '../../../modals/Modals';
import '../../css/Courses.css'; import '../../css/Courses.css';
@ -40,27 +40,28 @@ class GraduationTasksedit extends Component{
axios.get(url).then((result)=>{ axios.get(url).then((result)=>{
// console.log(result) // console.log(result)
let newfilelist=[]; // let newfilelist=[];
if(result.data.attachments.length!=0){ // if(result.data.attachments.length!=0){
for(var list of result.data.attachments){ // for(var list of result.data.attachments){
newfilelist.push({ // newfilelist.push({
uid:list.id, // uid:list.id,
name:list.title, // name:list.title,
status: 'done', // status: 'done',
url:list.url, // url:list.url,
}) // })
} // }
//
} // }
let namelength=result.data.task_name.length; let namelength=result.data.task_name.length;
let sixlength=title_num-namelength let sixlength=title_num-namelength
this.setState({ this.setState({
fileList:newfilelist, // fileList:newfilelist,
description:result.data.description, description:result.data.description,
tasktype:result.data.task_type, tasktype:result.data.task_type,
name:result.data.task_name, name:result.data.task_name,
data:result.data, data:result.data,
title_num:sixlength title_num:sixlength,
attachments:result.data.attachments,
}) })
@ -100,36 +101,36 @@ class GraduationTasksedit extends Component{
// 附件相关 START // 附件相关 START
handleChange = (info) => { handleChange = (info) => {
let fileList = info.fileList; let fileList = info.fileList;
console.log(fileList) // console.log(fileList)
// for(var list of fileList ){ // for(var list of fileList ){
// console.log(fileList) // console.log(fileList)
// } // }
this.setState({ fileList }); this.setState({ fileList });
} }
onAttachmentRemove = (file) => { // onAttachmentRemove = (file) => {
// confirm({ // // confirm({
// title: '确定要删除这个附件吗?', // // title: '确定要删除这个附件吗?',
// okText: '确定', // // okText: '确定',
// cancelText: '取消', // // cancelText: '取消',
// // content: 'Some descriptions', // // // content: 'Some descriptions',
// onOk: () => { // // onOk: () => {
// this.deleteAttachment(file) // // this.deleteAttachment(file)
// }, // // },
// onCancel() { // // onCancel() {
// console.log('Cancel'); // // console.log('Cancel');
// }, // // },
// }); // // });
// return false; // // return false;
//
this.setState({ // this.setState({
Modalstype:true, // Modalstype:true,
Modalstopval:'确定要删除这个附件吗?', // Modalstopval:'确定要删除这个附件吗?',
ModalSave: ()=>this.deleteAttachment(file), // ModalSave: ()=>this.deleteAttachment(file),
ModalCancel:this.cancelAttachment // ModalCancel:this.cancelAttachment
}) // })
return false; // return false;
} // }
cancelAttachment=()=>{ cancelAttachment=()=>{
this.setState({ this.setState({
@ -141,10 +142,11 @@ class GraduationTasksedit extends Component{
}) })
} }
deleteAttachment = (file) => { onAttachmentRemove = (file) => {
this.cancelAttachment(); this.cancelAttachment();
const url = `/attachments/${file.response ? file.response.id : file.uid}.json` // const url = `/attachments/${file.response ? file.response.id : file.uid}.json`
const url = `/attachments/${file}.json`
axios.delete(url, { axios.delete(url, {
}) })
.then((response) => { .then((response) => {
@ -268,7 +270,7 @@ class GraduationTasksedit extends Component{
} }
render(){ render(){
const { getFieldDecorator } = this.props.form; const { getFieldDecorator } = this.props.form;
let {title_num,pageType,name,description,Loadtype, let {title_num,pageType,name,description,Loadtype,attachments,
Modalstype,Modalstopval,ModalCancel,ModalSave,shixunsreplace} =this.state; Modalstype,Modalstopval,ModalCancel,ModalSave,shixunsreplace} =this.state;
let {coursedata}=this.props; let {coursedata}=this.props;
@ -279,7 +281,7 @@ class GraduationTasksedit extends Component{
width: 600, width: 600,
// https://github.com/ant-design/ant-design/issues/15505 // https://github.com/ant-design/ant-design/issues/15505
// showUploadList={false},然后外部拿到 fileList 数组自行渲染列表。 // showUploadList={false},然后外部拿到 fileList 数组自行渲染列表。
// showUploadList: false, showUploadList: false,
action: `${getUrl()}/api/attachments.json`, action: `${getUrl()}/api/attachments.json`,
onChange: this.handleChange, onChange: this.handleChange,
onRemove: this.onAttachmentRemove, onRemove: this.onAttachmentRemove,
@ -418,8 +420,65 @@ class GraduationTasksedit extends Component{
</Button> </Button>
(单个文件150M以内) (单个文件150M以内)
</Upload> </Upload>
{attachments&&attachments.map((item,key)=>{
return(
<div className="color-grey mt5"
key={key}
>
<a className="color-grey ml3">
<i className="font-14 color-green iconfont icon-fujian mr8" aria-hidden="true"></i>
</a>
<a
href={item.url}
className="mr12 color9B9B" length="58">
{item.title}
</a>
<span className="color656565 mt2 color-grey-6 font-12 mr8">
{item.filesize}
</span>
{item.delete===true?
<i className="font-14 iconfont icon-guanbi "
id={item.id}
onClick={()=>this.onAttachmentRemove(item.id)}
aria-hidden="true">
</i>:""}
</div>
)
})}
<style>
{
`
.maxwidth500{
max-width:500px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
color: #05101a;
}
`
}
</style>
{this.state.fileList.length===0?"":this.state.fileList.map((item,key)=>{
return(
<p className="color-grey mt10" key={key} >
<a className="color-grey fl">
<i className="font-14 color-green iconfont icon-fujian mr8" aria-hidden="true"></i>
</a>
<span className="mr12 color9B9B maxwidth500 fl" length="58">
{item.name}
</span>
<span className="color656565 mt2 color-grey-6 font-12 mr8">
{item.response===undefined?"":bytesToSize(item.size)}
</span>
<i className="font-14 iconfont icon-guanbi "
id={item.response===undefined?"":item.response.id}
aria-hidden="true" onClick={()=>this.onAttachmentRemove(item.response===undefined?"":item.response.id&&item.response.id)}></i>
</p>
)
})}
{/*{attachments&&attachments.map((item,key)=>{*/} {/*{attachments&&attachments.map((item,key)=>{*/}
{/*return(*/} {/*return(*/}

@ -2,7 +2,7 @@ import React, {Component} from "React";
import {Form, Select, Input, Button, Checkbox, Upload, Icon, message, Modal} from "antd"; import {Form, Select, Input, Button, Checkbox, Upload, Icon, message, Modal} from "antd";
import {Link} from 'react-router-dom'; import {Link} from 'react-router-dom';
import TPMMDEditor from '../../../tpm/challengesnew/TPMMDEditor'; import TPMMDEditor from '../../../tpm/challengesnew/TPMMDEditor';
import {WordsBtn, getUrl} from 'educoder'; import {WordsBtn, getUrl,bytesToSize} from 'educoder';
import axios from 'axios'; import axios from 'axios';
import Modals from '../../../modals/Modals'; import Modals from '../../../modals/Modals';
import '../../css/Courses.css'; import '../../css/Courses.css';
@ -133,29 +133,29 @@ class GraduationTasksnew extends Component {
this.setState({fileList}); this.setState({fileList});
} }
onAttachmentRemove = (file) => { // onAttachmentRemove = (file) => {
// confirm({ // // confirm({
// title: '确定要删除这个附件吗?', // // title: '确定要删除这个附件吗?',
// okText: '确定', // // okText: '确定',
// cancelText: '取消', // // cancelText: '取消',
// // content: 'Some descriptions', // // // content: 'Some descriptions',
// onOk: () => { // // onOk: () => {
// this.deleteAttachment(file) // // this.deleteAttachment(file)
// }, // // },
// onCancel() { // // onCancel() {
// console.log('Cancel'); // // console.log('Cancel');
// }, // // },
// }); // // });
// return false; // // return false;
//
this.setState({ // this.setState({
Modalstype: true, // Modalstype: true,
Modalstopval: '确定要删除这个附件吗?', // Modalstopval: '确定要删除这个附件吗?',
ModalSave: () => this.deleteAttachment(file), // ModalSave: () => this.deleteAttachment(file),
ModalCancel: this.cancelAttachment // ModalCancel: this.cancelAttachment
}) // })
return false; // return false;
} // }
cancelAttachment = () => { cancelAttachment = () => {
this.setState({ this.setState({
@ -166,8 +166,9 @@ class GraduationTasksnew extends Component {
}) })
} }
deleteAttachment = (file) => { onAttachmentRemove = (file) => {
const url = `/attachments/${file.response ? file.response.id : file.uid}.json` // const url = `/attachments/${file.response ? file.response.id : file.uid}.json`
const url = `/attachments/${file}.json`
axios.delete(url, {}) axios.delete(url, {})
.then((response) => { .then((response) => {
if (response.data) { if (response.data) {
@ -256,7 +257,7 @@ class GraduationTasksnew extends Component {
multiple: true, multiple: true,
// https://github.com/ant-design/ant-design/issues/15505 // https://github.com/ant-design/ant-design/issues/15505
// showUploadList={false},然后外部拿到 fileList 数组自行渲染列表。 // showUploadList={false},然后外部拿到 fileList 数组自行渲染列表。
// showUploadList: false, showUploadList: false,
action: `${getUrl()}/api/attachments.json`, action: `${getUrl()}/api/attachments.json`,
onChange: this.handleChange, onChange: this.handleChange,
onRemove: this.onAttachmentRemove, onRemove: this.onAttachmentRemove,
@ -385,7 +386,7 @@ class GraduationTasksnew extends Component {
</div> </div>
<div className="stud-class-set pt20 pl20 pr20 coursenavbox edu-back-white"> <div className="stud-class-set pd20 coursenavbox edu-back-white">
<style>{` <style>{`
.uploadBtn.ant-btn { .uploadBtn.ant-btn {
border: none; border: none;
@ -428,6 +429,39 @@ class GraduationTasksnew extends Component {
</Button> </Button>
(单个文件150M以内) (单个文件150M以内)
</Upload> </Upload>
<style>
{
`
.maxwidth500{
max-width:500px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
color: #05101a;
}
`
}
</style>
{this.state.fileList.length===0?"":this.state.fileList.map((item,key)=>{
return(
<p className="color-grey mt10" key={key} >
<a className="color-grey fl">
<i className="font-14 color-green iconfont icon-fujian mr8" aria-hidden="true"></i>
</a>
<span className="mr12 color9B9B maxwidth500 fl" length="58">
{item.name}
</span>
<span className="color656565 mt2 color-grey-6 font-12 mr8">
{item.response===undefined?"":bytesToSize(item.size)}
</span>
<i className="font-14 iconfont icon-guanbi "
id={item.response===undefined?"":item.response.id}
aria-hidden="true" onClick={()=>this.onAttachmentRemove(item.response===undefined?"":item.response.id&&item.response.id)}></i>
</p>
)
})}
</div> </div>

@ -316,6 +316,30 @@ class GraduationTaskssettingapp extends Component{
}) })
} }
updatesfuncrosscomment=(types,checked,newlatetime,newcommenttime)=>{
let {endtimetype}=this.state;
if(types===1){
this.setState({
latetime:newlatetime,
crosscomment:checked,
commenttime:newcommenttime
})
}else{
if(endtimetype===true){
this.setState({
crosscomment:checked,
commenttime:newcommenttime
})
}else{
this.setState({
end_time:newlatetime,
crosscomment:checked,
commenttime:newcommenttime
})
}
}
}
funcrosscomment=(e)=>{ funcrosscomment=(e)=>{
let {latetime,end_time,allowlate}=this.state; let {latetime,end_time,allowlate}=this.state;
@ -325,41 +349,23 @@ class GraduationTaskssettingapp extends Component{
if(latetime===null||latetime===""){ if(latetime===null||latetime===""){
let newlatetime=moment(new Date()).add(7, 'days').format("YYYY-MM-DD HH:mm"); let newlatetime=moment(new Date()).add(7, 'days').format("YYYY-MM-DD HH:mm");
let newcommenttime=moment(new Date()).format("YYYY-MM-DD HH:mm"); let newcommenttime=moment(new Date()).format("YYYY-MM-DD HH:mm");
this.setState({ this.updatesfuncrosscomment=(1,e.target.checked,newlatetime,newcommenttime)
latetime:newlatetime,
crosscomment:e.target.checked,
commenttime:newcommenttime
})
}else{ }else{
let newlatetime=moment(latetime).add(7, 'days').format("YYYY-MM-DD HH:mm"); let newlatetime=moment(latetime).add(7, 'days').format("YYYY-MM-DD HH:mm");
let newcommenttime=moment(latetime).format("YYYY-MM-DD HH:mm"); let newcommenttime=moment(latetime).format("YYYY-MM-DD HH:mm");
this.setState({ this.updatesfuncrosscomment=(1,e.target.checked,newlatetime,newcommenttime)
latetime:newlatetime,
crosscomment:e.target.checked,
commenttime:newcommenttime
})
} }
}else{ }else{
if(end_time===null||end_time===""){ if(end_time===null||end_time===""){
let newend_time=moment(new Date()).add(7, 'days').format("YYYY-MM-DD HH:mm"); let newend_time=moment(new Date()).add(7, 'days').format("YYYY-MM-DD HH:mm");
let newcommenttime=moment(new Date()).add(8, 'days').format("YYYY-MM-DD HH:mm"); let newcommenttime=moment(new Date()).add(8, 'days').format("YYYY-MM-DD HH:mm");
this.setState({ this.updatesfuncrosscomment=(2,e.target.checked,newend_time,newcommenttime)
end_time:newend_time,
crosscomment:e.target.checked,
commenttime:newcommenttime
})
}else{ }else{
let newend_time=moment(end_time).add(7, 'days').format("YYYY-MM-DD HH:mm"); let newend_time=moment(end_time).add(7, 'days').format("YYYY-MM-DD HH:mm");
let newcommenttime=moment(end_time).add(8, 'days').format("YYYY-MM-DD HH:mm"); let newcommenttime=moment(end_time).add(8, 'days').format("YYYY-MM-DD HH:mm");
this.setState({ this.updatesfuncrosscomment=(2,e.target.checked,newend_time,newcommenttime)
end_time:newend_time,
crosscomment:e.target.checked,
commenttime:newcommenttime
})
} }
} }

@ -86,7 +86,7 @@ class GraduateTopicItem extends Component{
{ {
discussMessage.private_icon===true? discussMessage.private_icon===true?
<Tooltip title={ this.props.isNotMember?"私有属性,非课堂成员不能访问":"私有属性"} placement="bottom"> <Tooltip title={ this.props.isNotMember()===true?"私有属性,非课堂成员不能访问":"私有属性"} placement="bottom">
<i className="iconfont icon-guansuo color-grey-c ml10 font-16 fl mt4"></i> <i className="iconfont icon-guansuo color-grey-c ml10 font-16 fl mt4"></i>
</Tooltip> </Tooltip>
:"" :""

@ -500,8 +500,8 @@ class studentsList extends Component{
firstRowRight={ firstRowRight={
<React.Fragment> <React.Fragment>
{ isSuperAdmin && <React.Fragment> { isSuperAdmin && <React.Fragment>
{/* <CreateGroupByImportModal ref="createGroupByImportModal" {...this.props}></CreateGroupByImportModal> */} <CreateGroupByImportModal ref="createGroupByImportModal" {...this.props}></CreateGroupByImportModal>
{/* <WordsBtn style="blue" className="mr30" onClick={()=> this.refs['createGroupByImportModal'].setVisible(true)}>导入创建分班</WordsBtn> */} <WordsBtn style="blue" className="mr30" onClick={()=> this.refs['createGroupByImportModal'].setVisible(true)}>导入创建分班</WordsBtn>
</React.Fragment> } </React.Fragment> }
{ isAdmin && isParent && <WordsBtn style="blue" className="mr30" onClick={()=>this.addDir()}>新建分班</WordsBtn> } { isAdmin && isParent && <WordsBtn style="blue" className="mr30" onClick={()=>this.addDir()}>新建分班</WordsBtn> }
{ isAdmin && !isParent && course_group_id != 0 && <WordsBtn style="blue" className="mr30" onClick={()=>this.deleteDir()}>删除分班</WordsBtn> } { isAdmin && !isParent && course_group_id != 0 && <WordsBtn style="blue" className="mr30" onClick={()=>this.deleteDir()}>删除分班</WordsBtn> }

@ -61,6 +61,7 @@ class Listofworks extends Component {
props: props, props: props,
data: [], data: [],
page: 1, page: 1,
computeTimetype:true,
limit: 20, limit: 20,
loadingstate: true, loadingstate: true,
order: "update_time", order: "update_time",
@ -1182,8 +1183,6 @@ class Listofworks extends Component {
}).catch((error) => { }).catch((error) => {
console.log(error) console.log(error)
}); });
} }
// 立即发布 // 立即发布
homeworkstartend = (ds,endtime) => { homeworkstartend = (ds,endtime) => {
@ -1313,10 +1312,24 @@ class Listofworks extends Component {
} }
setComputeTime=()=>{
this.setState({
computeTimetype:false
})
let homeworkid = this.props.match.params.homeworkid;
let url = "/homework_commons/"+homeworkid+"/update_score.json";
axios.get(url).then((response) => {
this.props.showNotification(`${response.data.message}`);
}).catch((error) => {
console.log(error)
});
}
render() { render() {
// console.log("Listofworks.js000") // console.log("Listofworks.js000")
let {columns, page, boolgalist,limit,experience,course_groupysls, course_groupyslstwo, unlimited, unlimitedtwo, loadingstate, viewtrainingdata, game_list, data, course_group_info, order, teacherdata, task_status, checkedValuesine, searchtext, teacherlist, visible, visibles, jobsettingsdata} = this.state; let {columns,computeTimetype, page, boolgalist,limit,experience,course_groupysls, course_groupyslstwo, unlimited, unlimitedtwo, loadingstate, viewtrainingdata, game_list, data, course_group_info, order, teacherdata, task_status, checkedValuesine, searchtext, teacherlist, visible, visibles, jobsettingsdata} = this.state;
// //
// console.log(teacherdata&&teacherdata.shixun_identifier) // console.log(teacherdata&&teacherdata.shixun_identifier)
// console.log(course_group_info) // console.log(course_group_info)
@ -1345,8 +1358,8 @@ class Listofworks extends Component {
{ {
` `
body { body {
overflow: hidden !important; overflow: hidden !important;
} }
` `
} }
</style> </style>
@ -1418,6 +1431,7 @@ class Listofworks extends Component {
</div> </div>
<div className="edu-back-white"> <div className="edu-back-white">
<div className="stud-class-set bor-bottom-greyE "> <div className="stud-class-set bor-bottom-greyE ">
<div className=" clearfix edu-back-white poll_list"> <div className=" clearfix edu-back-white poll_list">
@ -1481,10 +1495,83 @@ class Listofworks extends Component {
</div> </div>
</div> </div>
<style>
{`
.startbox{
height: 48px;
background: rgba(255,104,0,0.1);
line-height: 48px;
text-align: center;
}
.startfont{
font-size:14px;
font-family:MicrosoftYaHei;
font-weight:400;
color:rgba(255,104,0,1);
}
.computeTime{
width: 73px;
height: 24px;
display: inline-block;
padding: 5px;
text-align: center;
line-height: 13px;
color: #4CACFF;
border: 1px solid #4CACFF;
cursor: pointer;
}
.computeTimes{
width: 73px;
height: 24px;
display: inline-block;
padding: 5px;
text-align: center;
line-height: 13px;
color: #C5C5C5;
border: 1px solid #EDEDED;
background:#EDEDED;
cursor: pointer;
}
`}
</style>
{computeTimetype===false?<li className="clearfix startbox">
<span className={"startfont"}>
正在执行成绩计算请稍后刷新页面查看结果
温馨提示执行时间因作品数量而异
</span>
</li>:""}
{/*作品状态GraduationTaskssettinglist*/} {/*作品状态GraduationTaskssettinglist*/}
<ul className="clearfix" style={{padding: '20px 15px 10px 20px'}}> <ul className="clearfix" style={{padding: '20px 15px 10px 20px'}}>
<li className="clearfix "> <li className="clearfix ">
<span className="fl mr10 color-grey-6 ">计算成绩时间{teacherdata&&teacherdata.calculation_time==null?"--": moment(teacherdata&&teacherdata.calculation_time).format('YYYY-MM-DD HH:mm')}</span>
<span>
{computeTimetype===true?<div className={"computeTime font-13"} onClick={this.setComputeTime}>
计算成绩
</div>:<div className={"computeTimes font-13"} onClick={this.setComputeTime}>
计算成绩
</div>}
</span>
<div className="fr mr5 search-newysl" style={{marginBottom: '1px'}}>
<Search
placeholder="请输入姓名或学号搜索"
id="subject_search_input"
autoComplete="off"
value={searchtext}
onKeyUp={(e) => this.onSearchKeywordKeyUp(e)}
onInput={this.inputSearchValues}
onSearch={this.searchValues}
></Search>
</div>
</li>
<li className="clearfix mt10">
<span className="fl mr10 color-grey-8 ">作品状态</span> <span className="fl mr10 color-grey-8 ">作品状态</span>
<span className="fl "><a id="graduation_comment_no_limit" <span className="fl "><a id="graduation_comment_no_limit"
@ -1508,17 +1595,7 @@ class Listofworks extends Component {
</CheckboxGroup> </CheckboxGroup>
{/*请输入姓名或学号搜索*/} {/*请输入姓名或学号搜索*/}
<div className="fr mr5 search-newysl" style={{marginBottom: '1px'}}>
<Search
placeholder="请输入姓名或学号搜索"
id="subject_search_input"
autoComplete="off"
value={searchtext}
onKeyUp={(e) => this.onSearchKeywordKeyUp(e)}
onInput={this.inputSearchValues}
onSearch={this.searchValues}
></Search>
</div>
</li> </li>

@ -40,6 +40,8 @@ class Listofworksstudentone extends Component {
props: props, props: props,
data: [], data: [],
datas: [], datas: [],
view_report:false,
computeTimetype:true,
page: 1, page: 1,
pages: 1, pages: 1,
limit: 20, limit: 20,
@ -305,6 +307,7 @@ class Listofworksstudentone extends Component {
work_efficiency: result.data.work_efficiency, work_efficiency: result.data.work_efficiency,
code_review: result.data.code_review, code_review: result.data.code_review,
challenges_count:result.data.challenges_count, challenges_count:result.data.challenges_count,
view_report:result.data.view_report,
}) })
if (result.data.student_works === undefined || result.data.student_works === null || JSON.stringify(result.data.student_works) === "[]") { if (result.data.student_works === undefined || result.data.student_works === null || JSON.stringify(result.data.student_works) === "[]") {
this.seacthdata(result.data); this.seacthdata(result.data);
@ -359,6 +362,7 @@ class Listofworksstudentone extends Component {
end_immediately: result.data.end_immediately, end_immediately: result.data.end_immediately,
code_review: result.data.code_review, code_review: result.data.code_review,
challenges_count:result.data.challenges_count, challenges_count:result.data.challenges_count,
view_report:result.data.view_report,
}) })
if (result.data.student_works === undefined || result.data.student_works === null || JSON.stringify(result.data.student_works) === "[]") { if (result.data.student_works === undefined || result.data.student_works === null || JSON.stringify(result.data.student_works) === "[]") {
this.seacthdata(result.data); this.seacthdata(result.data);
@ -707,6 +711,7 @@ class Listofworksstudentone extends Component {
end_immediately: result.data.end_immediately, end_immediately: result.data.end_immediately,
code_review: result.data.code_review, code_review: result.data.code_review,
challenges_count:result.data.challenges_count, challenges_count:result.data.challenges_count,
view_report:result.data.view_report,
}) })
this.seacthdata(result.data); this.seacthdata(result.data);
} }
@ -742,21 +747,77 @@ class Listofworksstudentone extends Component {
this.Getalistofworkstwo(this.state.order, "", "", "", pageNumber, this.state.limit); this.Getalistofworkstwo(this.state.order, "", "", "", pageNumber, this.state.limit);
} }
setComputeTime=()=>{
this.setState({
computeTimetype:false
})
let homeworkid = this.props.match.params.homeworkid;
let url = "/homework_commons/"+homeworkid+"/update_student_score.json";
axios.get(url).then((response) => {
this.props.showNotification(`${response.data.message}`);
}).catch((error) => {
console.log(error)
});
}
render() { render() {
let {visibles, game_list,columns, limit,experience, boolgalist,viewtrainingdata, teacherdata, page, data, jobsettingsdata, styletable, datas, order, loadingstate} = this.state; let {visibles, game_list,columns, limit,experience, boolgalist,viewtrainingdata, teacherdata, page, data, jobsettingsdata, styletable, datas, order, loadingstate,computeTimetype} = this.state;
return ( return (
teacherdata === undefined || teacherdata.student_works === undefined || teacherdata.student_works === null || JSON.stringify(teacherdata.student_works) === "[]" ? teacherdata === undefined || teacherdata.student_works === undefined || teacherdata.student_works === null || JSON.stringify(teacherdata.student_works) === "[]" ?
// 学生不能查看别人的 // 学生不能查看别人的
<div className="newMain clearfix "> <div className="newMain clearfix ">
<style>
{`
.startbox{
height: 48px;
background: rgba(255,104,0,0.1);
line-height: 48px;
text-align: center;
}
.startfont{
font-size:14px;
font-family:MicrosoftYaHei;
font-weight:400;
color:rgba(255,104,0,1);
}
.computeTime{
width: 73px;
height: 24px;
display: inline-block;
padding: 5px;
text-align: center;
line-height: 13px;
color: #4CACFF;
border: 1px solid #4CACFF;
cursor: pointer;
}
.computeTimes{
width: 73px;
height: 24px;
display: inline-block;
padding: 5px;
text-align: center;
line-height: 13px;
color: #C5C5C5;
border: 1px solid #EDEDED;
background:#EDEDED;
cursor: pointer;
}
`}
</style>
{visibles === true ? {visibles === true ?
<div> <div>
<style> <style>
{ {
` `
body { body {
overflow: hidden !important; overflow: hidden !important;
} }
` `
} }
</style> </style>
@ -810,10 +871,10 @@ class Listofworksstudentone extends Component {
<Link <Link
to={`/courses/${this.state.props.match.params.coursesId}/${this.state.shixuntypes}/${this.state.props.match.params.homeworkid}/settings`} to={`/courses/${this.state.props.match.params.coursesId}/${this.state.shixuntypes}/${this.state.props.match.params.homeworkid}/settings`}
>设置</Link> >设置</Link>
<Link className="fr color-blue font-16" target={"_blank"} {this.state.view_report===true?<Link className="fr color-blue font-16" target={"_blank"}
to={`/courses/${this.state.props.match.params.coursesId}/${this.state.shixuntypes}/${teacherdata === undefined ? "" : teacherdata.id}/shixun_work_report`}> to={`/courses/${this.state.props.match.params.coursesId}/${this.state.shixuntypes}/${teacherdata === undefined ? "" : teacherdata.id}/shixun_work_report`}>
查看实训报告 查看实训报告
</Link> </Link>:""}
{/*<a className="fr color-blue font-16">查看实训报告</a>*/} {/*<a className="fr color-blue font-16">查看实训报告</a>*/}
{ {
teacherdata === undefined ? "" teacherdata === undefined ? ""
@ -829,6 +890,14 @@ class Listofworksstudentone extends Component {
</div> </div>
{computeTimetype===false?<li className="clearfix startbox mb20">
<span className={"startfont"}>
正在执行成绩计算请稍后刷新页面查看结果
温馨提示执行时间因作品数量而异
</span>
</li>:""}
{JSON.stringify(data) !== "[]" ? {JSON.stringify(data) !== "[]" ?
<div> <div>
<div id="graduation_work_list" <div id="graduation_work_list"
@ -839,17 +908,32 @@ class Listofworksstudentone extends Component {
}}> }}>
<div className="clearfix"> <div className="clearfix">
<span className="fl color-grey-6 font-12"><span
className="color-orange-tip">{teacherdata === undefined ? "" : teacherdata.commit_count === undefined ? "" : teacherdata.commit_count}</span><span <span className="fl color-grey-6 font-12">
className="ml10">{teacherdata === undefined ? "" : teacherdata.uncommit_count}</span><span></span> <span
{teacherdata === undefined ? "" : teacherdata.left_time === undefined ? "" : teacherdata.left_time === null ? "" : className="color-orange-tip">{teacherdata === undefined ? "" : teacherdata.commit_count === undefined ? "" : teacherdata.commit_count}</span><span
<span className="ml20">{teacherdata.left_time.status}</span> className="ml10">{teacherdata === undefined ? "" : teacherdata.uncommit_count}</span><span></span>
} {teacherdata === undefined ? "" : teacherdata.left_time === undefined ? "" : teacherdata.left_time === null ? "" :
{teacherdata === undefined ? "0" : teacherdata.left_time === undefined ? "0" : teacherdata.left_time === null ? "0" : <span className="ml20">{teacherdata.left_time.status}</span>
<span className="ml20" }
style={{"color": '#FF6800'}}>{teacherdata.left_time.time}</span> {teacherdata === undefined ? "0" : teacherdata.left_time === undefined ? "0" : teacherdata.left_time === null ? "0" :
} <span className="ml20"
</span> style={{"color": '#FF6800'}}>{teacherdata.left_time.time}</span>
}
</span>
<div className="fr">
<span className="fl mr10 color-grey-6 ">计算成绩时间{teacherdata&&teacherdata.calculation_time==null?"--": moment(teacherdata&&teacherdata.calculation_time).format('YYYY-MM-DD HH:mm')}</span>
<span>
{computeTimetype===true?<div className={"computeTime font-13"} onClick={this.setComputeTime}>
计算成绩
</div>:<div className={"computeTimes font-13"} onClick={this.setComputeTime}>
计算成绩
</div>}
</span>
</div>
</div> </div>
@ -941,10 +1025,10 @@ class Listofworksstudentone extends Component {
<Link <Link
to={`/courses/${this.state.props.match.params.coursesId}/${this.state.shixuntypes}/${this.state.props.match.params.homeworkid}/settings`} to={`/courses/${this.state.props.match.params.coursesId}/${this.state.shixuntypes}/${this.state.props.match.params.homeworkid}/settings`}
>设置</Link> >设置</Link>
<Link className="fr color-blue font-16" target={"_blank"} {this.state.view_report===true?<Link className="fr color-blue font-16" target={"_blank"}
to={`/courses/${this.state.props.match.params.coursesId}/${this.state.shixuntypes}/${this.state.props.match.params.homeworkid}/shixun_work_report`}> to={`/courses/${this.state.props.match.params.coursesId}/${this.state.shixuntypes}/${this.state.props.match.params.homeworkid}/shixun_work_report`}>
查看实训报告 查看实训报告
</Link> </Link>:""}
{ {
teacherdata === undefined ? "" teacherdata === undefined ? ""
: teacherdata.commit_des === null || teacherdata.commit_des === undefined ? "" : : teacherdata.commit_des === null || teacherdata.commit_des === undefined ? "" :
@ -958,17 +1042,14 @@ class Listofworksstudentone extends Component {
</div> </div>
</div> </div>
{computeTimetype===false?<li className="clearfix startbox mb20">
<span className={"startfont"}>
正在执行成绩计算请稍后刷新页面查看结果
温馨提示执行时间因作品数量而异
</span>
</li>:""}
{/*<div id="graduation_work_list" style={{padding: '0px 40px 10px 40px'}}>*/}
{/* <div className="clearfix">*/}
{/* <span className="fl color-grey-6 font-12"><span className="color-orange-tip">89</span>已交<span*/}
{/* className="ml10">9000</span><span>未交</span> <span className="ml20">剩余提交时间:</span><span*/}
{/* className="ml20">{this.state.day}天 {this.state.hour}:{this.state.minute}:{this.state.second}</span></span>*/}
{/* </div>*/}
{/*</div>*/}
<div className="edu-table edu-back-white "> <div className="edu-table edu-back-white ">
{data === undefined ? "" : <Table {data === undefined ? "" : <Table
style={styletable} style={styletable}
@ -987,33 +1068,51 @@ class Listofworksstudentone extends Component {
"margin-bottom": "10px" "margin-bottom": "10px"
}}> }}>
<div className="clearfix"> <div className="clearfix">
<span className="fl color-grey-6 font-12"><span <span className="fl color-grey-6 font-12">
className="color-orange-tip">{teacherdata === undefined ? "" : teacherdata.commit_count === undefined ? "" : teacherdata.commit_count}</span><span <span className="color-orange-tip">
className="ml10">{teacherdata === undefined ? "" : teacherdata.uncommit_count}</span><span></span> {teacherdata === undefined ? "" : teacherdata.commit_count === undefined ? "" : teacherdata.commit_count}
{teacherdata === undefined ? "" : teacherdata.left_time === undefined ? "" : teacherdata.left_time === null ? "" : </span>
<span className="ml20">{teacherdata.left_time.status}</span>} <span className="ml10">{teacherdata === undefined ? "" : teacherdata.uncommit_count}</span><span></span>
{teacherdata === undefined ? "0" : teacherdata.left_time === undefined ? "0" : teacherdata.left_time === null ? "0" : {teacherdata === undefined ? "" : teacherdata.left_time === undefined ? "" : teacherdata.left_time === null ? "" :
<span className="ml20" <span className="ml20">{teacherdata.left_time.status}</span>}
style={{"color": '#FF6800'}}>{teacherdata.left_time.time}</span>} {teacherdata === undefined ? "0" : teacherdata.left_time === undefined ? "0" : teacherdata.left_time === null ? "0" :
<span className="ml20"
</span> style={{"color": '#FF6800'}}>{teacherdata.left_time.time}</span>}
<div className="fr edu-menu-panel">
<ul>
<li className="edu-position edu-position-hidebox"> <div className="fr">
<a className="font-12 ">
{order === "updated_at" ? "时间" : order === "work_score" ? "成绩" : order === "student_id" ? "学号" : ""}排序</a> <span className="fl mr10 color-grey-6 ">计算成绩时间{teacherdata&&teacherdata.calculation_time==null?"--": moment(teacherdata&&teacherdata.calculation_time).format('YYYY-MM-DD HH:mm')}</span>
<i className="iconfont icon-xiajiantou ml5 font-12 "></i> <span>
<ul className="edu-position-hide undis mt10"> {computeTimetype===true?<div className={"computeTime font-13"} onClick={this.setComputeTime}>
<li><a onClick={(e) => this.funorder("updated_at")} data-remote="true" 计算成绩
className="color-grey-6 font-12" style={{"text-align": "center "}}>更新时间</a></li> </div>:<div className={"computeTimes font-13"} onClick={this.setComputeTime}>
<li><a onClick={(e) => this.funorder("work_score")} data-remote="true" 计算成绩
className="color-grey-6 font-12" style={{"text-align": "center "}}>最终成绩</a></li> </div>}
<li><a onClick={(e) => this.funorder("student_id")} data-remote="true" </span>
className="color-grey-6 font-12" style={{"text-align": "center "}}>学生学号</a></li>
</ul> </div>
</li>
</ul> </span>
</div>
{/*因为计算按钮占了和这个位置,和设计沟通学生视角取消这个按钮*/}
{/*<div className="fr edu-menu-panel">*/}
{/*<ul>*/}
{/*<li className="edu-position edu-position-hidebox">*/}
{/*<a className="font-12 ">*/}
{/*{order === "updated_at" ? "时间" : order === "work_score" ? "成绩" : order === "student_id" ? "学号" : ""}排序</a>*/}
{/*<i className="iconfont icon-xiajiantou ml5 font-12 "></i>*/}
{/*<ul className="edu-position-hide undis mt10">*/}
{/*<li><a onClick={(e) => this.funorder("updated_at")} data-remote="true"*/}
{/*className="color-grey-6 font-12" style={{"text-align": "center "}}>更新时间</a></li>*/}
{/*<li><a onClick={(e) => this.funorder("work_score")} data-remote="true"*/}
{/*className="color-grey-6 font-12" style={{"text-align": "center "}}>最终成绩</a></li>*/}
{/*<li><a onClick={(e) => this.funorder("student_id")} data-remote="true"*/}
{/*className="color-grey-6 font-12" style={{"text-align": "center "}}>学生学号</a></li>*/}
{/*</ul>*/}
{/*</li>*/}
{/*</ul>*/}
{/*</div>*/}
</div> </div>

@ -80,7 +80,7 @@ function startechart(data){
{ {
name:'', name:'',
type:'scatter', type:'scatter',
data:data.echart_data.efficiency_list, data:data.echart_data===undefined?"":data.echart_data.efficiency_list,
itemStyle:{ itemStyle:{
normal:{color:'#2e65ad'} normal:{color:'#2e65ad'}
}, },
@ -106,9 +106,9 @@ function startechart(data){
data : [ data : [
{ {
name: data.username, name: data.username,
xAxis:data.echart_data.myself_eff[0], xAxis:data.echart_data===undefined?"":data.echart_data.myself_eff[0],
yAxis:data.echart_data.myself_eff[1], yAxis:data.echart_data===undefined?"":data.echart_data.myself_eff[1],
value:data.echart_data.myself_eff[1], value:data.echart_data===undefined?"":data.echart_data.myself_eff[1],
} }
], ],
itemStyle: { itemStyle: {
@ -132,7 +132,7 @@ function startechart(data){
{ {
name:'二班', name:'二班',
type:'scatter', type:'scatter',
data: data.echart_data.myself_eff, data: data.echart_data===undefined?"":data.echart_data.myself_eff,
itemStyle:{ itemStyle:{
color:'#c23531' color:'#c23531'
}} }}
@ -141,7 +141,7 @@ function startechart(data){
var ablChart = echarts.init(document.getElementById('shixun_overall_ablility_chart')); var ablChart = echarts.init(document.getElementById('shixun_overall_ablility_chart'));
var dataBJ = data.echart_data.consume_list; var dataBJ = data.echart_data===undefined?"":data.echart_data.consume_list;
var itemStyle = { var itemStyle = {
@ -188,7 +188,7 @@ function startechart(data){
formatter: function (obj) { formatter: function (obj) {
var value = obj.value; var value = obj.value;
if(obj.name ==data.username){ if(obj.name ==data.username){
return "姓名:"+data.username + "<br/>"+'学号: '+data.user_id + "<br/>"+'得分:'+ data.echart_data.myself_object[1]; return "姓名:"+data.username + "<br/>"+'学号: '+data.user_id + "<br/>"+'得分:'+ data.echart_data===undefined?"":data.echart_data.myself_object[1];
} }
} }
@ -241,9 +241,9 @@ function startechart(data){
data : [ data : [
{ {
name: data.username, name: data.username,
xAxis: data.echart_data.myself_object[0], xAxis: data.echart_data===undefined?"":data.echart_data.myself_object[0],
yAxis:data.echart_data.myself_object[1], yAxis:data.echart_data===undefined?"":data.echart_data.myself_object[1],
value:data.echart_data.myself_object[1] value:data.echart_data===undefined?"":data.echart_data.myself_object[1]
} }
], ],
itemStyle: { itemStyle: {
@ -256,7 +256,7 @@ function startechart(data){
{ {
name: '能力1', name: '能力1',
type: 'scatter', type: 'scatter',
data: data.echart_data.myself_object, data: data.echart_data===undefined?"":data.echart_data.myself_object,
itemStyle:itemStyle1, itemStyle:itemStyle1,
symbolSize: function (val){ symbolSize: function (val){
return Math.round(val[2]); return Math.round(val[2]);
@ -367,8 +367,8 @@ class Shixunechart extends Component {
<div className="fl with65" style={{paddingLeft: "5%"}}> <div className="fl with65" style={{paddingLeft: "5%"}}>
<li className="mt5 mb5">{data&&data.username}</li> <li className="mt5 mb5">{data&&data.username}</li>
<li className="mt5 mb5">{data&&data.user_id}</li> <li className="mt5 mb5">{data&&data.user_id}</li>
<li className="mt5 mb5 color-orange03"><span className="color-orange03">{data&&data.echart_data.myself_eff[1]}</span></li> <li className="mt5 mb5 color-orange03"><span className="color-orange03">{data&&data.echart_data===undefined?"":data&&data.echart_data.myself_eff[1]}</span></li>
<li className="mt5 mb5 color-orange03"><span className="color-orange03">{data&&data.echart_data.myself_eff[0]}</span></li> <li className="mt5 mb5 color-orange03"><span className="color-orange03">{data&&data.echart_data===undefined?"":data&&data.echart_data.myself_eff[0]}</span></li>
</div> </div>
</div> </div>
<div className="pr mt20 with100"> <div className="pr mt20 with100">
@ -393,7 +393,7 @@ class Shixunechart extends Component {
<div className="fl with65" style={{paddingLeft: "5%"}}> <div className="fl with65" style={{paddingLeft: "5%"}}>
<li className="mt5 mb5">{data&&data.username}</li> <li className="mt5 mb5">{data&&data.username}</li>
<li className="mt5 mb5">{data&&data.user_id}</li> <li className="mt5 mb5">{data&&data.user_id}</li>
<li className="mt5 mb5 color-orange03"><span className="color-orange03">{data&&data.echart_data.myself_object[1]}</span></li> <li className="mt5 mb5 color-orange03"><span className="color-orange03">{data&&data.echart_data===undefined?"":data&&data.echart_data.myself_object[1]}</span></li>
</div> </div>
</div> </div>
<div className="popup_tip_box fontGrey2 with100 disc mt20" <div className="popup_tip_box fontGrey2 with100 disc mt20"

@ -32,6 +32,7 @@ class MemoDetailMDEditor extends Component {
} }
initMDEditor = () => { initMDEditor = () => {
// 因为props.memo不存在时本组件不会被加载这里直接在didMount里初始化即可 // 因为props.memo不存在时本组件不会被加载这里直接在didMount里初始化即可
const placeholder = '我要回复...' const placeholder = '我要回复...'
// const imageUrl = `/upload_with_markdown?container_id=${this.props.memo.id}&container_type=Memo`; // const imageUrl = `/upload_with_markdown?container_id=${this.props.memo.id}&container_type=Memo`;
@ -42,7 +43,7 @@ class MemoDetailMDEditor extends Component {
setTimeout(() => { setTimeout(() => {
var commentMDEditor = window.create_editorMD_4comment("memo_comment_editorMd", '', this.props.height || 240, placeholder, imageUrl, () => { var commentMDEditor = window.create_editorMD_4comment("memo_comment_editorMd", '', this.props.height || 240, placeholder, imageUrl, () => {
commentMDEditor.focus() commentMDEditor.focus()
this.isMDInited = true
this.initDrag() this.initDrag()
commentMDEditor.cm.on("change", (_cm, changeObj) => { commentMDEditor.cm.on("change", (_cm, changeObj) => {
@ -114,7 +115,13 @@ class MemoDetailMDEditor extends Component {
} }
onMockInputClick = () => { onMockInputClick = () => {
this.setState({isInited: true}) this.setState({isInited: true})
this.initMDEditor() if (!this.isMDInited) {
this.initMDEditor()
} else {
setTimeout(() => {
this.commentMDEditor.focus()
}, 10)
}
} }
render() { render() {
const { match, history, memo, placeholder, className } = this.props const { match, history, memo, placeholder, className } = this.props

@ -1,6 +1,6 @@
.slider-img-wrapper img { .slider-img-wrapper img {
width: 100%; width: 100%;
border-radius: 15px; /*border-radius: 15px;*/
height: 350px; height: 350px;
} }
.next-slick-list{ .next-slick-list{

@ -10,8 +10,6 @@ import { TPMIndexHOC } from '../tpm/TPMIndexHOC';
import SiderBar from '../tpm/SiderBar'; import SiderBar from '../tpm/SiderBar';
import Loading from '@icedesign/base/lib/loading';
import { SnackbarHOC , getImageUrl} from 'educoder'; import { SnackbarHOC , getImageUrl} from 'educoder';
import Slider from '@icedesign/base/lib/slider'; import Slider from '@icedesign/base/lib/slider';
@ -24,9 +22,7 @@ import '@icedesign/base/lib/rating/style.js';
import './home.css'; import './home.css';
import '@icedesign/base/lib/loading/style.js'; import {Tooltip,Spin} from 'antd';
import {Tooltip} from 'antd';
const $ = window.$; const $ = window.$;
@ -110,7 +106,7 @@ class ShixunsHome extends Component {
return ( return (
<div className="newMain clearfix backFAFAFA"> <div className="newMain clearfix backFAFAFA">
<Loading visible={hometypepvisible} shape="dot-circle" className="newnext-loading" color='#4AC7FF'> <Spin spinning={hometypepvisible} size="large" style={{marginTop:'15%'}}>
{/*懒加载*/} {/*懒加载*/}
<SiderBar/> <SiderBar/>
@ -198,13 +194,13 @@ class ShixunsHome extends Component {
</div> </div>
<Link to={"/paths"} className="moreitem">更多<i className="fa fa-angle-right ml5"></i></Link> <Link to={"/paths"} className="moreitem">更多<i className="fa fa-angle-right ml5"></i></Link>
<div className="square-list clearfix"> <div className="square-list clearfix" style={{width:'102%'}}>
{homedatalist===undefined?"":homedatalist.subjects.map((item,key)=>{ {homedatalist===undefined?"":homedatalist.subjects.map((item,key)=>{
if(key<8) if(key<8)
return( return(
<div className="square-Item" key={key} id={item.id}> <div className="square-Item" key={key} id={item.id} style={{width:'286px'}}>
<div className="tag-green"> <div className="tag-green">
<span className="tag-name"> {item.name}</span> <span className="tag-name"> {item.name}</span>
@ -272,10 +268,10 @@ class ShixunsHome extends Component {
</div> </div>
<Link to={"/shixuns"} className="moreitem">更多<i className="fa fa-angle-right ml5"></i></Link> <Link to={"/shixuns"} className="moreitem">更多<i className="fa fa-angle-right ml5"></i></Link>
<div className="square-list clearfix"> <div className="square-list clearfix" style={{width:'102%'}}>
{homedatalist===undefined?"":homedatalist.shixuns.map((item,key)=>{ {homedatalist===undefined?"":homedatalist.shixuns.map((item,key)=>{
return( return(
<div className="square-Item" key={key} id={item.id}> <div className="square-Item" key={key} id={item.id} style={{width:'286px'}}>
<div className="tag-green"> <div className="tag-green">
<span className="tag-name"> {item.tag_name}</span> <span className="tag-name"> {item.tag_name}</span>
@ -498,8 +494,7 @@ class ShixunsHome extends Component {
</div> </div>
</div> </div>
</div> </div>
</Spin>
</Loading>
</div> </div>
); );
} }

@ -1,5 +1,6 @@
import React, { Component } from 'react'; import React, { Component } from 'react';
import ImageLayer from './ImageLayer' import ImageLayer from './ImageLayer'
import { isImageExtension } from 'educoder'
const $ = window.$; const $ = window.$;
export function ImageLayerOfCommentHOC(options = {}) { export function ImageLayerOfCommentHOC(options = {}) {
return function wrap(WrappedComponent) { return function wrap(WrappedComponent) {
@ -16,18 +17,29 @@ export function ImageLayerOfCommentHOC(options = {}) {
componentDidMount() { componentDidMount() {
// commentsDelegateParent #game_left_contents #tab_con_4 // commentsDelegateParent #game_left_contents #tab_con_4
setTimeout(() => { setTimeout(() => {
$(".commentsDelegateParent") $(options.parentSelector || ".commentsDelegateParent")
.delegate(".J_Comment_Reply .comment_content img, .J_Comment_Reply .childrenCommentsView img","click", (event) => { .delegate(options.imgSelector || ".J_Comment_Reply .comment_content img, .J_Comment_Reply .childrenCommentsView img","click", (event) => {
const imageSrc = event.target.src const imageSrc = event.target.src || event.target.getAttribute('src') || event.target.getAttribute('href')
// 非回复里的头像图片; 非emoticons // 判断imageSrc是否是图片
if (imageSrc.indexOf('/images/avatars/User') === -1 && const fileName = event.target.innerHTML.trim()
imageSrc.indexOf('kindeditor/plugins/emoticons') === -1 ) { if (isImageExtension(imageSrc.trim()) || isImageExtension(fileName)) {
this.setState({ // 非回复里的头像图片; 非emoticons
showImage: true, if (imageSrc.indexOf('/images/avatars/User') === -1 &&
imageSrc, imageSrc.indexOf('kindeditor/plugins/emoticons') === -1 ) {
}) this.setState({
showImage: true,
imageSrc,
})
}
event.stopPropagation()
event.preventDefault && event.preventDefault()
event.originalEvent.preventDefault()
// event.originalEvent.stopPropagation()
// event.originalEvent.cancelBubble = true
return false;
} }
}); });
}, 3000) }, 3000)

@ -1,10 +1,8 @@
import React, { Component } from 'react'; import React, { Component } from 'react';
import {getImageUrl} from 'educoder'; import {getImageUrl} from 'educoder';
import {Modal,Input,Checkbox,Tooltip} from "antd"; import {Modal,Input,Checkbox,Tooltip,Spin} from "antd";
import { DragDropContext , Draggable, Droppable} from 'react-beautiful-dnd'; import { DragDropContext , Draggable, Droppable} from 'react-beautiful-dnd';
import Modals from '../../modals/Modals'; import Modals from '../../modals/Modals';
import Loading from '@icedesign/base/lib/loading';
import '@icedesign/base/lib/loading/style.js';
import '../ShixunPaths.css'; import '../ShixunPaths.css';
import axios from 'axios'; import axios from 'axios';
const $ = window.$; const $ = window.$;
@ -437,7 +435,7 @@ class DetailCardsEditAndAdd extends Component{
width="840px" width="840px"
destroyOnClose={true} destroyOnClose={true}
> >
<Loading visible={hometypepvisible} shape="dot-circle" color='#4AC7FF'> <Spin spinning={hometypepvisible} size="large" style={{marginTop:'15%'}}>
<div className="newupload_conbox"> <div className="newupload_conbox">
<div className="clearfix mb20 shixun_work_div newshixun_tab_div cdefault" style={{"marginRight":"4px"}} id="shixun_tab_div"> <div className="clearfix mb20 shixun_work_div newshixun_tab_div cdefault" style={{"marginRight":"4px"}} id="shixun_tab_div">
<li className="fl mr5 mt5"> <a onClick={()=>this.changeTag(0,`${search}`)} className={ type===0 ? "active edu-filter-cir-grey font-12":"edu-filter-cir-grey font-12"}>全部</a></li> <li className="fl mr5 mt5"> <a onClick={()=>this.changeTag(0,`${search}`)} className={ type===0 ? "active edu-filter-cir-grey font-12":"edu-filter-cir-grey font-12"}>全部</a></li>
@ -516,7 +514,7 @@ class DetailCardsEditAndAdd extends Component{
<a className="task-btn task-btn-orange margin-tp26" id="submit_send_shixun" onClick={this.clickShixunchoose}>确定</a> <a className="task-btn task-btn-orange margin-tp26" id="submit_send_shixun" onClick={this.clickShixunchoose}>确定</a>
</div> </div>
</div> </div>
</Loading> </Spin>
</Modal> </Modal>
</div> </div>

@ -1,10 +1,8 @@
import React, { Component } from 'react'; import React, { Component } from 'react';
import {getImageUrl} from 'educoder'; import {getImageUrl} from 'educoder';
import {Modal,Input,Checkbox,Tooltip} from "antd"; import {Modal,Input,Checkbox,Tooltip,Spin} from "antd";
import { DragDropContext,Draggable, Droppable} from 'react-beautiful-dnd'; import { DragDropContext,Draggable, Droppable} from 'react-beautiful-dnd';
import Modals from '../../modals/Modals'; import Modals from '../../modals/Modals';
import Loading from '@icedesign/base/lib/loading';
import '@icedesign/base/lib/loading/style.js';
import '../ShixunPaths.css'; import '../ShixunPaths.css';
import axios from 'axios'; import axios from 'axios';
const $ = window.$; const $ = window.$;
@ -478,8 +476,8 @@ class DetailCardsEditAndEdit extends Component{
footer={null} footer={null}
width="840px" width="840px"
destroyOnClose={true} destroyOnClose={true}
> >Z
<Loading visible={hometypepvisible} shape="dot-circle" color='#4AC7FF'> <Spin spinning={hometypepvisible} size="large" style={{marginTop:'15%'}}>
<div className="newupload_conbox"> <div className="newupload_conbox">
<div className="clearfix mb20 shixun_work_div newshixun_tab_div cdefault" style={{"marginRight":"4px"}} id="shixun_tab_div"> <div className="clearfix mb20 shixun_work_div newshixun_tab_div cdefault" style={{"marginRight":"4px"}} id="shixun_tab_div">
<li className="fl mr5 mt5"> <a onClick={()=>this.changeTag(0,`${search}`)} className={ type===0 ? "active edu-filter-cir-grey font-12":"edu-filter-cir-grey font-12"}>全部</a></li> <li className="fl mr5 mt5"> <a onClick={()=>this.changeTag(0,`${search}`)} className={ type===0 ? "active edu-filter-cir-grey font-12":"edu-filter-cir-grey font-12"}>全部</a></li>
@ -558,7 +556,7 @@ class DetailCardsEditAndEdit extends Component{
<a className="task-btn task-btn-orange margin-tp26" id="submit_send_shixun" onClick={this.clickShixunchoose}>确定</a> <a className="task-btn task-btn-orange margin-tp26" id="submit_send_shixun" onClick={this.clickShixunchoose}>确定</a>
</div> </div>
</div> </div>
</Loading> </Spin>
</Modal> </Modal>
</div> </div>

@ -16,7 +16,7 @@ class NewFooter extends Component {
render() { render() {
return ( return (
<div className="newFooter edu-txt-center"> <div className="newFooter edu-txt-center newContainers">
<div className="inner-footer_con"> <div className="inner-footer_con">
<div className="footercon"> <div className="footercon">
<div className="inline mt40 mb5"> <div className="inline mt40 mb5">

@ -638,7 +638,7 @@ submittojoinclass=(value)=>{
{/*<li><a href={this.props.Headertop===undefined?"":this.props.Headertop.shixun_paths_url}>实训路径</a></li>*/} {/*<li><a href={this.props.Headertop===undefined?"":this.props.Headertop.shixun_paths_url}>实训路径</a></li>*/}
<li className={`${activePaths === true ? 'pr active' : 'pr'}`}> <li className={`${activePaths === true ? 'pr active' : 'pr'}`}>
<a href={this.props.Headertop===undefined?"":'/paths'}>课程</a></li> <a href={this.props.Headertop===undefined?"":'/paths'}>课程</a></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'}`}>
@ -671,13 +671,13 @@ submittojoinclass=(value)=>{
</div> </div>
</li> </li>
{/*<li className=""><a href={"/libraries"}>教学案例</a></li>*/}
<li className=""><a href={this.props.Headertop===undefined?"":this.props.Headertop.competitions_url}>在线竞赛</a></li>
<li className=""><a href={this.props.Headertop===undefined?"":this.props.Headertop.competitions_url}>竞赛</a></li> <li className={`${activeForums === true ? 'active' : ''}`}><a href={this.props.Headertop===undefined?"":this.props.Headertop.topic_url}>交流问答</a></li>
<li className={`${activeForums === true ? 'active' : ''}`}><a href={this.props.Headertop===undefined?"":this.props.Headertop.topic_url}>问答</a></li>
<li <li
style={{display: this.props.Headertop === undefined ? 'none' : this.props.Headertop.auth===null? 'none' : 'block'}} style={{display: this.props.Headertop === undefined ? 'none' : this.props.Headertop.auth===null? 'none' : 'block'}}
><a href={this.props.Headertop===undefined?"":this.props.Headertop.auth}>认证</a></li> ><a href={this.props.Headertop===undefined?"":this.props.Headertop.auth}>工程认证</a></li>
</ul> </ul>

@ -23,7 +23,7 @@ $(window).scroll(function(){
}); });
function rightSlider(){ function rightSlider(){
var poi=parseInt((parseInt($(window).width())- 1200 )/2)-60; var poi=parseInt((parseInt($(window).width())- 1200 )/2)-81;
// console.log(parseInt($(window).width())+" "+poi); // console.log(parseInt($(window).width())+" "+poi);
if(poi>0){ if(poi>0){
$(".-task-sidebar").css("right",poi); $(".-task-sidebar").css("right",poi);

@ -1,6 +1,6 @@
import React, {Component} from 'react'; import React, {Component} from 'react';
import {Input, Select, Radio, Checkbox, Popconfirm, message, Modal,Pagination,Tooltip} from 'antd'; import {Input, Select, Radio, Checkbox, Popconfirm, message, Modal,Pagination,Tooltip,Spin} from 'antd';
import {BrowserRouter as Router, Route, Link, Switch} from "react-router-dom"; import {BrowserRouter as Router, Route, Link, Switch} from "react-router-dom";
@ -8,8 +8,6 @@ import {BrowserRouter as Router, Route, Link, Switch} from "react-router-dom";
import Rating from '@icedesign/base/lib/rating'; import Rating from '@icedesign/base/lib/rating';
import Loading from '@icedesign/base/lib/loading';
import axios from 'axios'; import axios from 'axios';
import {getImageUrl, toPath, getUrl} from 'educoder' import {getImageUrl, toPath, getUrl} from 'educoder'
@ -99,7 +97,8 @@ export default class TPMFork_listComponent extends Component {
<span className="fl font-16">Fork实训列表</span> <span className="fl font-16">Fork实训列表</span>
<a href={"/shixuns/"+shixunsID+"/challenges"} className="font-16 color-grey-9 fr">返回</a> <a href={"/shixuns/"+shixunsID+"/challenges"} className="font-16 color-grey-9 fr">返回</a>
</div> </div>
<Loading visible={Forkvisible} shape="dot-circle" style={{width:'100%'}}color='#4AC7FF'> {/*<Loading visible={Forkvisible} shape="dot-circle" style={{width:'100%'}}color='#4AC7FF'>*/}
<Spin spinning={Forkvisible} size="large" style={{marginTop:'15%'}}>
<div className="mt30 square-list clearfix mh320"> <div className="mt30 square-list clearfix mh320">
{ shixuns===undefined?" ":shixuns.map((item,key)=>{ { shixuns===undefined?" ":shixuns.map((item,key)=>{
@ -182,8 +181,8 @@ export default class TPMFork_listComponent extends Component {
} }
onChange={this.TPMForkonChange}/> onChange={this.TPMForkonChange}/>
</div> </div>
</Spin>
</Loading> {/*</Loading>*/}
</div> </div>
</React.Fragment> </React.Fragment>
) )

@ -180,7 +180,7 @@ class TPMIndex extends Component {
power: response.data.power, power: response.data.power,
identity: response.data.identity, identity: response.data.identity,
propaedeutics:response.data.propaedeutics, propaedeutics:response.data.propaedeutics,
status: response.data.status, status: response.data.shixun_status,
}); });
} }
}).catch((error) => { }).catch((error) => {
@ -365,10 +365,10 @@ class TPMIndex extends Component {
(props) => (<TPMquestion {...this.props} {...props} {...this.state}/>) (props) => (<TPMquestion {...this.props} {...props} {...this.state}/>)
}></Route> }></Route>
<Route exact path="/shixuns/:shixunId" render={ <Route exact path="/shixuns/:shixunId" render={
(props) => (<TPMChallengeComponent {...this.props} {...this.state} {...props} (props) => (<TPMChallengeComponent {...this.props} {...this.state} {...props}
/>) />)
}></Route> }></Route>
{/*<Route exact path="/shixuns/:shixunId" component={TPMChallengeComponent}></Route>*/} {/*<Route exact path="/shixuns/:shixunId" component={TPMChallengeComponent}></Route>*/}

@ -131,7 +131,7 @@ export function TPMIndexHOC(WrappedComponent) {
}else if(this.props.match.path==="/shixuns"){ }else if(this.props.match.path==="/shixuns"){
document.title="开发社区"; document.title="开发社区";
}else if(this.props.match.path==="/paths"){ }else if(this.props.match.path==="/paths"){
document.title="实课程"; document.title="实课程";
}else if(this.props.match.path==="/courses"){ }else if(this.props.match.path==="/courses"){
document.title="翻转课堂"; document.title="翻转课堂";
} }
@ -294,23 +294,34 @@ export function TPMIndexHOC(WrappedComponent) {
return ( return (
<div> <div>
<SiderBar Headertop={Headertop}/>
<SiderBar <style>{
Headertop={Headertop} `
/> .newContainers{
<NewHeader {...this.state} {...this.props}></NewHeader> width: 100%;
<div className="newContainer"> min-width: 1440px;
<WrappedComponent initCommonState={(user)=>this.initCommonState(user)} max-width: unset;
{...this.props} {...this.state} }
showShixun={this.showShixun} aboutFocus={this.aboutFocus} // .-task-sidebar{
{...common} // right: 270px !important;
> // }
</WrappedComponent> `
}</style>
</div> <NewHeader {...this.state} {...this.props}></NewHeader>
<NewFooter <div className="newContainer newContainers">
Footerdown={Footerdown} <WrappedComponent initCommonState={(user)=>this.initCommonState(user)}
/> {...this.props} {...this.state}
showShixun={this.showShixun} aboutFocus={this.aboutFocus}
{...common}
>
</WrappedComponent>
</div>
<NewFooter
Footerdown={Footerdown}
/>
</div> </div>
); );
} }

@ -190,7 +190,7 @@ export default class TPMsettings extends Component {
evaluate_script:undefined, evaluate_script:undefined,
standard_scripts: undefined, standard_scripts: undefined,
choice_main_type: "", choice_main_type: "",
choice_small_type: [""], choice_small_type: [],
choice_standard_scripts:undefined, choice_standard_scripts:undefined,
editordescriptios: undefined, editordescriptios: undefined,
editorevaluate_scripts: undefined, editorevaluate_scripts: undefined,
@ -222,7 +222,8 @@ export default class TPMsettings extends Component {
scope_partmenttype:false, scope_partmenttype:false,
newuse_scope:undefined, newuse_scope:undefined,
scope_partments:0, scope_partments:0,
shixun_service_configs:undefined,
shixun_service_configlist:undefined,
pod_exist_time: undefined, pod_exist_time: undefined,
pod_exist_timetype: false, pod_exist_timetype: false,
shixunmemoMDvalue:"", shixunmemoMDvalue:"",
@ -325,6 +326,8 @@ export default class TPMsettings extends Component {
newuse_scope:response.data.shixun.use_scope, newuse_scope:response.data.shixun.use_scope,
scope_partments: response.data.shixun.scope_partment.length, scope_partments: response.data.shixun.scope_partment.length,
shixunmemoMDvalue:response.data.shixun.evaluate_script, shixunmemoMDvalue:response.data.shixun.evaluate_script,
shixun_service_configs:response.data.shixun.shixun_service_configs,
shixun_service_configlist:response.data.shixun.shixun_service_configs,
}) })
// if(response.data.status===403){ // if(response.data.status===403){
@ -489,14 +492,14 @@ export default class TPMsettings extends Component {
} }
shixun_vnc=(e)=>{ shixun_vnc=(e)=>{
let sum = "" // let sum = ""
if (e.target.checked === false) { // if (e.target.checked === false) {
sum = 0 // sum = 0
} else if (e.target.checked === true) { // } else if (e.target.checked === true) {
sum = 1 // sum = 1
} // }
this.setState({ this.setState({
vnc: sum, vnc: e.target.checked,
}); });
} }
@ -513,6 +516,23 @@ export default class TPMsettings extends Component {
bigClass = (value) => { bigClass = (value) => {
let {settingsData,shixun_service_configs}=this.state;
let newshixun_service_configs=shixun_service_configs;
settingsData.shixun.main_type.some((item,key)=> {
if (item.id === value) {
newshixun_service_configs[0]={
mirror_repository_id:value,
name:item.type_name,
cpu_limit:1,
lower_cpu_limit:0.1,
memory_limit:1024,
request_limit:10
}
return true
}
}
)
let url = `/shixuns/get_mirror_script.json?mirror_id=`+value; let url = `/shixuns/get_mirror_script.json?mirror_id=`+value;
axios.get(url).then((response) => { axios.get(url).then((response) => {
if (response.status === 200) { if (response.status === 200) {
@ -520,7 +540,9 @@ export default class TPMsettings extends Component {
this.setState({ this.setState({
choice_main_type: value, choice_main_type: value,
standard_scripts:response.data, standard_scripts:response.data,
choice_standard_scripts:null choice_standard_scripts:null,
shixun_service_configs:newshixun_service_configs,
shixun_service_configlist:newshixun_service_configs,
}) })
} }
}).catch((error) => { }).catch((error) => {
@ -530,10 +552,80 @@ export default class TPMsettings extends Component {
} }
Deselectlittle=(value)=>{
let {settingsData,shixun_service_configs,choice_small_type}=this.state;
let newshixun_service_configs=shixun_service_configs;
let newchoice_small_type=choice_small_type;
newchoice_small_type.some((items,keys)=> {
if (items === value) {
newchoice_small_type.splice(keys, 1)
return true
}
}
)
settingsData.shixun.small_type.some((items,keys)=> {
if (items.id === value) {
newshixun_service_configs.splice(keys+1, 1)
return true
}
}
)
this.setState({
choice_small_type: newchoice_small_type,
shixun_service_configs:newshixun_service_configs,
shixun_service_configlist:newshixun_service_configs,
})
}
littleClass = (value) => { littleClass = (value) => {
let {settingsData,shixun_service_configs,choice_small_type}=this.state;
let newshixun_service_configs=shixun_service_configs;
let newchoice_small_type=choice_small_type;
// if(Array.isArray(value)===true){
// value.map((item,key)=>{
// settingsData.shixun.small_type.some((items,keys)=> {
// if (items.id === item) {
// newshixun_service_configs.push({
// mirror_repository_id:value,
// name:items.type_name,
// cpu_limit:1,
// lower_cpu_limit:0.1,
// memory_limit:1024,
// request_limit:10
// })
// return true
// }
// }
// )
// })
// }
settingsData.shixun.small_type.some((items,keys)=> {
if (items.id === value) {
newshixun_service_configs.push({
mirror_repository_id:value,
name:items.type_name,
cpu_limit:1,
lower_cpu_limit:0.1,
memory_limit:1024,
request_limit:10
})
return true
}
}
)
newchoice_small_type.push(value)
this.setState({ this.setState({
choice_small_type: value choice_small_type: newchoice_small_type,
shixun_service_configs:newshixun_service_configs,
shixun_service_configlist:newshixun_service_configs,
}) })
} }
onPodExistTimeChange = (e) => { onPodExistTimeChange = (e) => {
@ -594,10 +686,15 @@ export default class TPMsettings extends Component {
// } // }
submit_edit_shixun = () => { submit_edit_shixun = () => {
let { let {
name, description, choice_main_type, choice_small_type, choice_standard_scripts, scope_partment, choice_standard_scriptssum, name, choice_main_type, choice_small_type, choice_standard_scripts, scope_partment, choice_standard_scriptssum,
evaluate_script, exec_time, webssh, use_scope, trainee, can_copy, task_pass, test_set_permission, hide_code, code_hidden, forbid_copy, vnc,multi_webssh, evaluate_script, webssh, use_scope, trainee, can_copy, task_pass, test_set_permission, hide_code, code_hidden, forbid_copy, vnc,multi_webssh,
opening_time, pod_exist_time,shixunmemoMDvalue opening_time,shixunmemoMDvalue,shixun_service_configlist
} = this.state; } = this.state;
shixun_service_configlist.map((item,key)=>{
delete item.name;
})
let operateauthority=this.props.identity<5&&this.state.status==0||this.props.identity===1&&this.state.status==2||this.props.identity===1&&this.state.status==1; let operateauthority=this.props.identity<5&&this.state.status==0||this.props.identity===1&&this.state.status==2||this.props.identity===1&&this.state.status==1;
const description_editormd = this.description_editormd.getValue(); const description_editormd = this.description_editormd.getValue();
@ -652,15 +749,15 @@ export default class TPMsettings extends Component {
return return
} }
} }
if (exec_time === "") { // if (exec_time === "") {
this.setState({ // this.setState({
exec_timetype: true // exec_timetype: true
}) // })
$('html').animate({ // $('html').animate({
scrollTop: 1500 // scrollTop: 1500
}, 1000); // }, 1000);
return // return
} // }
// if (!pod_exist_time) { // if (!pod_exist_time) {
// this.setState({ // this.setState({
@ -680,40 +777,38 @@ export default class TPMsettings extends Component {
let id = this.props.match.params.shixunId; let id = this.props.match.params.shixunId;
let newmulti_webssh=multi_webssh; let newmulti_webssh=multi_webssh;
if(newmulti_webssh===true){
newmulti_webssh=1
}else{
newmulti_webssh=0
}
if(newmulti_webssh===null){ if(newmulti_webssh===null){
newmulti_webssh=0 newmulti_webssh=false
} }
//exec_time: exec_time,
let Url = `/shixuns/` + id + `.json`; let Url = `/shixuns/` + id + `.json`;
let data = { let data = {
name: name, shixun:{
description: description_editormd, name: name,
main_type: choice_main_type, webssh: webssh,
small_type: choice_small_type, user_scope: use_scope,
webssh: webssh, can_copy: can_copy,
user_scope: use_scope, vnc: vnc===null?undefined:vnc,
scope_partment: scope_partment, test_set_permission: test_set_permission,
can_copy: can_copy, code_hidden: code_hidden,
vnc: vnc, trainee: trainee,
test_set_permission: test_set_permission, task_pass: task_pass,
code_hidden: code_hidden, hide_code: hide_code,
trainee: trainee, forbid_copy: forbid_copy,
task_pass: task_pass, multi_webssh:newmulti_webssh,
standard_scripts: choice_standard_scripts, opening_time:opening_time,
hide_code: hide_code, mirror_script_id:choice_standard_scriptssum,
forbid_copy: forbid_copy, },
exec_time: exec_time, shixun_info:{
evaluate_script: evaluate_script_editormd, description: description_editormd,
multi_webssh:newmulti_webssh, evaluate_script: evaluate_script_editormd,
opening_time:opening_time, },
mirror_script_id:choice_standard_scriptssum, main_type: choice_main_type,
delType:1 small_type: choice_small_type,
scope_partment: scope_partment,
shixun_service_configs:shixun_service_configlist
} }
axios.put(Url, data).then((response) => { axios.put(Url, data).then((response) => {
@ -941,6 +1036,7 @@ export default class TPMsettings extends Component {
this.setState({ this.setState({
opers:true opers:true
}) })
} }
bigopens=()=>{ bigopens=()=>{
@ -950,16 +1046,19 @@ export default class TPMsettings extends Component {
opersss:false, opersss:false,
opensmail:false opensmail:false
}) })
} }
bigopensmal=()=>{ bigopensmal=(e)=>{
this.setState({ this.setState({
opensmail:true opensmail:true
}) })
} }
sbigopen=()=>{ sbigopen=(e)=>{
this.setState({ this.setState({
operss:true operss:true
}) })
} }
sbigopens=()=>{ sbigopens=()=>{
@ -967,10 +1066,11 @@ export default class TPMsettings extends Component {
operss:false operss:false
}) })
} }
sbigopenss=()=>{ sbigopenss=(e)=>{
this.setState({ this.setState({
opersss:true opersss:true
}) })
} }
sbigopensss=()=>{ sbigopensss=()=>{
@ -1015,7 +1115,9 @@ export default class TPMsettings extends Component {
}) })
} }
inputs=()=>{
}
render() { render() {
let { let {
@ -1070,7 +1172,8 @@ export default class TPMsettings extends Component {
scope_partmenttype, scope_partmenttype,
newuse_scope, newuse_scope,
scope_partments, scope_partments,
shixunmemoMDvalue,delType shixunmemoMDvalue,delType,
shixun_service_configs
} = this.state; } = this.state;
let options; let options;
@ -1087,7 +1190,7 @@ export default class TPMsettings extends Component {
let operateauthority=this.props.identity===1?true:this.props.identity<5&&this.state.status==0?true:false; let operateauthority=this.props.identity===1?true:this.props.identity<5&&this.state.status==0?true:false;
return ( return (
<div className="educontent mt30 mb50" id="shixun_settings_show" onClick={this.bigopens} onMouseEnter={this.bigopens}> <div className="educontent mt30 mb50" id="shixun_settings_show" onClick={this.bigopens} >
<div className="edu-back-white mb10"> <div className="edu-back-white mb10">
<div className="padding30 bor-bottom-greyE clearfix"> <div className="padding30 bor-bottom-greyE clearfix">
<span className="fl font-16">配置</span> <span className="fl font-16">配置</span>
@ -1254,9 +1357,10 @@ export default class TPMsettings extends Component {
value={choice_small_type.length===0||choice_small_type[0]===""||choice_small_type===[]?undefined:choice_small_type} value={choice_small_type.length===0||choice_small_type[0]===""||choice_small_type===[]?undefined:choice_small_type}
style={{width: 180}} style={{width: 180}}
disabled={operateauthority?false:true} disabled={operateauthority?false:true}
onChange={operateauthority?this.littleClass:""} // onChange={operateauthority?this.littleClass:""}
onDeselect={operateauthority?this.Deselectlittle:""}
onMouseEnter={operateauthority?this.bigopensmal:""} onMouseEnter={operateauthority?this.bigopensmal:""}
onSelect={operateauthority?this.bigopens:""} onSelect={operateauthority?this.littleClass:""}
defaultOpen={false} defaultOpen={false}
open={opensmail} open={opensmail}
> >
@ -1468,21 +1572,21 @@ export default class TPMsettings extends Component {
</div> </div>
</div> </div>
<div className="edu-back-white mb10 padding40-20 clearfix"> {/*<div className="edu-back-white mb10 padding40-20 clearfix">*/}
<span className="color-orange fl mr20">*</span> {/*<span className="color-orange fl mr20">*</span>*/}
<p className="color-grey-6 font-16 mb30">程序最大执行时间</p> {/*<p className="color-grey-6 font-16 mb30">程序最大执行时间</p>*/}
<Input className="mr10 fl" placeholder="请输入程序最大执行时间" maxLength="60" style={{width: '20%'}} {/*<Input className="mr10 fl" placeholder="请输入程序最大执行时间" maxLength="60" style={{width: '20%'}}*/}
onInput={this.Timevalue} value={exec_time === undefined ? "" : exec_time}/> <span {/*onInput={this.Timevalue} value={exec_time === undefined ? "" : exec_time}/> <span*/}
className="fl mr10 ml20"></span> {/*className="fl mr10 ml20">秒</span>*/}
<div style={{width: ' 57px '}} className="fl"> {/*<div style={{width: ' 57px '}} className="fl">*/}
<span className={exec_timetype === true ? "color-orange mt8" : "color-orange mt8 none"} {/*<span className={exec_timetype === true ? "color-orange mt8" : "color-orange mt8 none"}*/}
id="shixun_name_notice"><i {/*id="shixun_name_notice"><i*/}
className="fa fa-exclamation-circle mr3"></i></span> {/*className="fa fa-exclamation-circle mr3"></i>必填项</span>*/}
</div> {/*</div>*/}
</div> {/*</div>*/}
{/* <div className="edu-back-white mb10 padding40-20 clearfix" id="pod_exist_time"> {/* <div className="edu-back-white mb10 padding40-20 clearfix" id="pod_exist_time">
<span className="color-orange fl mr20">*</span> <span className="color-orange fl mr20">*</span>
@ -1675,8 +1779,9 @@ export default class TPMsettings extends Component {
<span className="color-grey-6 mt5 fl" style={{minWidth: '95px'}}>开启时间:</span> <span className="color-grey-6 mt5 fl" style={{minWidth: '95px'}}>开启时间:</span>
<span className="fl mt5"> <span className="fl mt5">
<DatePicker <DatePicker
showToday={false} showToday={false}
showTime showTime
width={178}
locale={locale} locale={locale}
format={dateFormat} format={dateFormat}
placeholder="请选择开启时间" placeholder="请选择开启时间"
@ -1686,15 +1791,67 @@ export default class TPMsettings extends Component {
<label style={{top:'6px'}} className="color-grey-9 ml10" >为空则学员在实训发布后能随时开启实训挑战否则学员在开启时间后才能开启实训挑战</label> <label style={{top:'6px'}} className="color-grey-9 ml10" >为空则学员在实训发布后能随时开启实训挑战否则学员在开启时间后才能开启实训挑战</label>
</span> </span>
</div> </div>
{/*<div className="clearfix mt20">*/} <div className="clearfix mt20 ml30">
{/*<span className="color-grey-6 mt5 fl" style={{minWidth: '95px'}}>VNC图形化:</span>*/} <span className="color-grey-6 mt5 fl" style={{minWidth: '95px'}}>VNC图形化:</span>
{/*<span className="fl mt5">*/} <span className="fl mt5">
{/*<Checkbox checked={vnc === undefined ? false : vnc} onChange={this.shixun_vnc}></Checkbox>*/} <Checkbox checked={vnc === undefined ? false : vnc} onChange={this.shixun_vnc}></Checkbox>
{/*<label style={{top:'6px'}} className="color-grey-9 ml10" >勾选则给学员的实践任务提供Ubuntu系统图形化实践窗口否则不提供</label>*/} <label style={{top:'6px'}} className="color-grey-9 ml10" >勾选则给学员的实践任务提供Ubuntu系统图形化实践窗口否则不提供</label>
{/*</span>*/} </span>
{/*</div>*/} </div>
</div> </div>
{/*"name": "我是镜像名", # 镜像名称*/}
{/*"cpu_limit": 1, # cpu核*/}
{/*"lower_cpu_limit": 0.1, # 最低cpu核 浮点数*/}
{/*"memory_limit": 1024 ,#内存限制*/}
{/*"request_limit": 10, # 内存要求*/}
{/*"mirror_repository_id": 12, # 镜像id*/}
<div className="edu-back-white padding40-20 mb20">
{this.props.identity<2?shixun_service_configs&&shixun_service_configs.map((item,key)=>{
return(
<div key={key}>
<p className="color-grey-6 font-16 mb30">服务配置</p>
<div id="5">
<p className="color-grey-6 font-16 mt30 mb20" id="shixun_scenario_type_name">{item.name}</p>
<div className="clearfix mb5">
<label className="panel-form-label fl">CPU()</label>
<div className="pr fl with80 status_con">
<input type="text" name="cpu_limit[]" value={item.cpu_limit} onInput={this.inputs}
className="panel-box-sizing task-form-100 task-height-40" placeholder="请输入类别名称" />
</div>
<div className="cl"></div>
</div>
<div className="clearfix mb5">
<label className="panel-form-label fl">最低CPU()</label>
<div className="pr fl with80 status_con">
<input type="text" name="lower_cpu_limit[]" value={item.lower_cpu_limit} onInput={this.inputs}
className="panel-box-sizing task-form-100 task-height-40" placeholder="请输入类别名称" />
</div>
<div className="cl"></div>
</div>
<div className="clearfix mb5">
<label className="panel-form-label fl">内存限制(M)</label>
<div className="pr fl with80 status_con">
<input type="text" name="memory_limit[]" value={item.memory_limit} onInput={this.inputs}
className="panel-box-sizing task-form-100 task-height-40" placeholder="请输入类别名称" />
</div>
<div className="cl"></div>
</div>
<div className="clearfix mb5">
<label className="panel-form-label fl">内存要求(M)</label>
<div className="pr fl with20 status_con">
<input type="text" name="request_limit[]" value={item.request_limit} onInput={this.inputs}
className="panel-box-sizing task-form-100 task-height-40" placeholder="请输入类别名称" />
</div>
<label className="panel-form-label fl" style={{width: '48%'}}>温馨提示纯编程类型实训建议使用默认值对于大数据等建议使用最大内存的30%</label>
<div className="cl"></div>
</div>
</div>
</div>
)
}) :""}
</div>
<p> <p>
{ {
@ -1706,49 +1863,7 @@ export default class TPMsettings extends Component {
<a href={"/shixuns/" + shixunsID + "/challenges"} className="defalutCancelbtn fl">取消</a> <a href={"/shixuns/" + shixunsID + "/challenges"} className="defalutCancelbtn fl">取消</a>
</div> :"" </div> :""
} }
{/*{*/}
{/*this.props.identity===1&&this.props.status==2?*/}
{/*<div className="clearfix mt30">*/}
{/*<a className="defalutSubmitbtn fl mr20"*/}
{/*onClick={this.submit_edit_shixun}>保存</a>*/}
{/*<a href={"/shixuns/" + shixunsID + "/challenges"} className="defalutCancelbtn fl">取消</a>*/}
{/*/!*<a className="edu-default-btn edu-blueline-btn fl ml20"*!/*/}
{/*/!*id="challenge_begin"*!/*/}
{/*/!*onClick={this.operateshixuns}>*!/*/}
{/*/!*永久关闭*!/*/}
{/*/!*</a>*!/*/}
{/*</div> :""*/}
{/*}*/}
{/*{*/}
{/*this.props.identity===1||this.props.power==true?*/}
{/*<div className="clearfix mt30">*/}
{/*<a className="defalutSubmitbtn fl mr20"*/}
{/*onClick={this.submit_edit_shixun}>保存</a>*/}
{/*<a href={"/shixuns/" + shixunsID + "/challenges"} className="defalutCancelbtn fl">取消</a>*/}
{/*<Popconfirm title={status===0?"删除实训后,用户不能再开始挑战了是否确认删除?":"关闭实训后,用户不能再开始挑战了是否确认关闭?"} onConfirm={this.shixunsclose} okText="确定"*/}
{/*cancelText="取消"*/}
{/*style={{display:status===0?"none":"block"}}*/}
{/*>*/}
{/*<a*/}
{/*className="edu-default-btn edu-blueline-btn fl ml20"*/}
{/*id="challenge_begin"*/}
{/*style={{display:status===0?"none":"block"}}*/}
{/*>*/}
{/*{status===0?"":"永久关闭"}*/}
{/*</a>*/}
{/*</Popconfirm>*/}
{/*</div> :""*/}
{/*}*/}
{/*<div className="clearfix mt30">*/}
{/*<a className="defalutSubmitbtn fl mr20"*/}
{/*onClick={this.submit_edit_shixun}>保存</a>*/}
{/*<a href={"/shixuns/" + shixunsID + "/challenges"} className="defalutCancelbtn fl">取消</a>*/}
{/*</div>*/}
</p> </p>
</div> </div>

@ -299,14 +299,14 @@ export default class TPManswer extends Component {
</span> </span>
<span className="font-16 task-hide fl TPMtaskName">{position}</span> <span className="font-16 task-hide fl TPMtaskName">{position}</span>
<Link to={go_back_url === undefined ? "" : go_back_url} <Link to={go_back_url === undefined ? "" : go_back_url}
className="color-grey-6 fr font-16 ml30">返回</Link> className="color-grey-6 fr font-15 mt3">返回</Link>
{prev_challenge === undefined ? "" : {prev_challenge === undefined ? "" :
<a href={prev_challenge} className="fr color-blue mr15 mt3">上一关</a> <a href={prev_challenge} className="fr color-blue mr15 mt4">上一关</a>
} }
{next_challenge === undefined ? "" : {next_challenge === undefined ? "" :
<a href={next_challenge} className="fr color-blue mr15 mt3">下一关</a> <a href={next_challenge} className="fr color-blue mr15 mt4">下一关</a>
} }
<Link to={practice_url === undefined ? "" : practice_url} <Link to={practice_url === undefined ? "" : practice_url}

@ -241,14 +241,14 @@ export default class TPManswer extends Component {
</span> </span>
<span className="font-16 task-hide fl TPMtaskName">{position}</span> <span className="font-16 task-hide fl TPMtaskName">{position}</span>
<Link to={go_back_url === undefined ? "" : go_back_url} <Link to={go_back_url === undefined ? "" : go_back_url}
className="color-grey-6 fr font-16 ml30">返回</Link> className="color-grey-6 fr font-15 mt3">返回</Link>
{prev_challenge === undefined ? "" : {prev_challenge === undefined ? "" :
<a href={prev_challenge} className="fr color-blue mr15 mt3">上一关</a> <a href={prev_challenge} className="fr color-blue mr15 mt4">上一关</a>
} }
{next_challenge === undefined ? "" : {next_challenge === undefined ? "" :
<a href={next_challenge} className="fr color-blue mr15 mt3">下一关</a> <a href={next_challenge} className="fr color-blue mr15 mt4">下一关</a>
} }
<Link to={practice_url === undefined ? "" : practice_url} <Link to={practice_url === undefined ? "" : practice_url}

@ -174,7 +174,8 @@ export default class TPMchallengesnew extends Component {
shixunsskillvaluelisttype: false, shixunsskillvaluelisttype: false,
marktype:false, marktype:false,
editPracticesendtype:false, editPracticesendtype:false,
CreatePracticesendtype:false CreatePracticesendtype:false,
exec_time:undefined
} }
} }
@ -292,6 +293,7 @@ export default class TPMchallengesnew extends Component {
onshixunsmarkvalue:response.data.score, onshixunsmarkvalue:response.data.score,
shixunsskillvaluelist:response.data.tags, shixunsskillvaluelist:response.data.tags,
checkpointId:checkpointId, checkpointId:checkpointId,
exec_time:response.data.exec_time,
tab2url: "/shixuns/" + id + "/challenges/"+checkpointId+"/tab=2", tab2url: "/shixuns/" + id + "/challenges/"+checkpointId+"/tab=2",
tab3url: "/shixuns/" + id + "/challenges/"+checkpointId+"/tab=3", tab3url: "/shixuns/" + id + "/challenges/"+checkpointId+"/tab=3",
}) })
@ -345,7 +347,7 @@ export default class TPMchallengesnew extends Component {
}) })
return return
} }
let {shixunCreatePractice, shixunCreatePracticeGroup, onshixunsmarkvalue, shixunsskillvaluelist} = this.state; let {shixunCreatePractice, shixunCreatePracticeGroup, onshixunsmarkvalue, shixunsskillvaluelist,exec_time} = this.state;
if (shixunCreatePractice === undefined||shixunCreatePractice=="") { if (shixunCreatePractice === undefined||shixunCreatePractice=="") {
this.setState({ this.setState({
shixunCreatePracticetype: true shixunCreatePracticetype: true
@ -383,7 +385,8 @@ export default class TPMchallengesnew extends Component {
difficulty: shixunCreatePracticeGroup, difficulty: shixunCreatePracticeGroup,
score: onshixunsmarkvalue, score: onshixunsmarkvalue,
challenge_tag: shixunsskillvaluelist, challenge_tag: shixunsskillvaluelist,
st: 0 st: 0,
exec_time:exec_time
}).then((response) => { }).then((response) => {
this.props.showSnackbar(response.data.messages); this.props.showSnackbar(response.data.messages);
if (response.data.status === 1) { if (response.data.status === 1) {
@ -392,7 +395,7 @@ export default class TPMchallengesnew extends Component {
tab2url: "/shixuns/" + id + "/challenges/"+response.data.challenge_id+"/tab=2", tab2url: "/shixuns/" + id + "/challenges/"+response.data.challenge_id+"/tab=2",
tab3url: "/shixuns/" + id + "/challenges/"+response.data.challenge_id+"/tab=3", tab3url: "/shixuns/" + id + "/challenges/"+response.data.challenge_id+"/tab=3",
}) })
window.location.href = "/shixuns/" + id + "/challenges/"+response.data.challenge_id+"/tab=2" // window.location.href = "/shixuns/" + id + "/challenges/"+response.data.challenge_id+"/tab=2"
} }
}).catch((error) => { }).catch((error) => {
@ -452,7 +455,7 @@ export default class TPMchallengesnew extends Component {
editPracticesendtype:true editPracticesendtype:true
}) })
let {shixunCreatePractice, shixunCreatePracticeGroup, onshixunsmarkvalue, shixunsskillvaluelist,checkpointId} = this.state; let {shixunCreatePractice, shixunCreatePracticeGroup, onshixunsmarkvalue, shixunsskillvaluelist,checkpointId,exec_time} = this.state;
const exercise_editormdvalue = this.exercise_editormd.getValue(); const exercise_editormdvalue = this.exercise_editormd.getValue();
@ -493,6 +496,7 @@ export default class TPMchallengesnew extends Component {
task_pass: exercise_editormdvalue, task_pass: exercise_editormdvalue,
difficulty: shixunCreatePracticeGroup, difficulty: shixunCreatePracticeGroup,
score: onshixunsmarkvalue, score: onshixunsmarkvalue,
exec_time:exec_time
}, },
challenge_tag:shixunsskillvaluelist challenge_tag:shixunsskillvaluelist
}).then((response) => { }).then((response) => {
@ -503,7 +507,7 @@ export default class TPMchallengesnew extends Component {
tab2url: "/shixuns/" + id + "/challenges/"+checkpointId+"/tab=2", tab2url: "/shixuns/" + id + "/challenges/"+checkpointId+"/tab=2",
tab3url: "/shixuns/" + id + "/challenges/"+checkpointId+"/tab=3", tab3url: "/shixuns/" + id + "/challenges/"+checkpointId+"/tab=3",
}) })
window.location.href = "/shixuns/" + id + "/challenges/"+response.data.challenge_id+"/tab=2" // window.location.href = "/shixuns/" + id + "/challenges/"+response.data.challenge_id+"/tab=2"
} }
}).catch((error) => { }).catch((error) => {
console.log(error) console.log(error)
@ -523,6 +527,12 @@ export default class TPMchallengesnew extends Component {
marktype:false marktype:false
}) })
} }
setexec_time=(e)=>{
this.setState({
exec_time:e.target.value
})
}
render() { render() {
let shixuntype = this.props.match.params.type; let shixuntype = this.props.match.params.type;
@ -552,14 +562,14 @@ export default class TPMchallengesnew extends Component {
<span className="font-16 task-hide fl TPMtaskName">{position}</span> <span className="font-16 task-hide fl TPMtaskName">{position}</span>
<Link to={go_back_url === undefined ? "" : go_back_url} <Link to={go_back_url === undefined ? "" : go_back_url}
className="color-grey-6 fr font-16 ml30">返回</Link> className="color-grey-6 fr font-15 mt3">返回</Link>
{ prev_challenge===undefined?"": { prev_challenge===undefined?"":
<a href={prev_challenge} className="fr color-blue mr15 mt3">上一关</a> <a href={prev_challenge} className="fr color-blue mr15 mt4">上一关</a>
} }
{ next_challenge===undefined?"": { next_challenge===undefined?"":
<a href={next_challenge}className="fr color-blue mr15 mt3">下一关</a> <a href={next_challenge}className="fr color-blue mr15 mt4">下一关</a>
} }
@ -717,6 +727,17 @@ export default class TPMchallengesnew extends Component {
</div> </div>
</div> </div>
<div className="edu-back-white padding40-20 mb20">
<p className="color-grey-6 font-16 mb30">服务配置</p>
<div className="clearfix mb5">
<label className="panel-form-label fl">评测时限(S)</label>
<div className="pr fl with80 status_con">
<input value={this.state.exec_time} className="panel-box-sizing task-form-100 task-height-40" placeholder="请输入类别名称" onInput={this.setexec_time}/>
</div>
<div className="cl"></div>
</div>
</div>
<div className="clearfix mt30" <div className="clearfix mt30"
style={{display:this.props.identity>3||this.props.identity===undefined?"none":'block'}} style={{display:this.props.identity>3||this.props.identity===undefined?"none":'block'}}
> >

@ -765,14 +765,14 @@ export default class TPMevaluation extends Component {
</span> </span>
<span className="font-16 task-hide fl TPMtaskName">{position}</span> <span className="font-16 task-hide fl TPMtaskName">{position}</span>
<Link to={go_back_url === undefined ? "" : go_back_url} <Link to={go_back_url === undefined ? "" : go_back_url}
className="color-grey-6 fr font-16 ml30">返回</Link> className="color-grey-6 fr font-15 mt3">返回</Link>
{prev_challenge === undefined ? "" : {prev_challenge === undefined ? "" :
<a href={prev_challenge} className="fr color-blue mr15 mt3">上一关</a> <a href={prev_challenge} className="fr color-blue mr15 mt4">上一关</a>
} }
{next_challenge === undefined ? "" : {next_challenge === undefined ? "" :
<a href={next_challenge} className="fr color-blue mr15 mt3">下一关</a> <a href={next_challenge} className="fr color-blue mr15 mt4">下一关</a>
} }
<Link to={practice_url === undefined ? "" : practice_url} <Link to={practice_url === undefined ? "" : practice_url}

@ -1240,13 +1240,13 @@ editanswersMD=(initValue, id)=> {
</span> </span>
<span className="font-16 task-hide fl TPMtaskName">{position}</span> <span className="font-16 task-hide fl TPMtaskName">{position}</span>
<Link to={go_back_url === undefined ? "" : go_back_url} <Link to={go_back_url === undefined ? "" : go_back_url}
className="color-grey-6 fr font-16 ml30">返回</Link> className="color-grey-6 fr font-15 mt3">返回</Link>
{ prev_challenge===undefined?"": { prev_challenge===undefined?"":
<a href={prev_challenge} className="fr color-blue mr15 mt3">上一关</a> <a href={prev_challenge} className="fr color-blue mr15 mt4">上一关</a>
} }
{ next_challenge===undefined?"": { next_challenge===undefined?"":
<a href={next_challenge}className="fr color-blue mr15 mt3">下一关</a> <a href={next_challenge}className="fr color-blue mr15 mt4">下一关</a>
} }
<a href={practice_url === undefined ? "" : practice_url} <a href={practice_url === undefined ? "" : practice_url}

@ -15,14 +15,14 @@
/*flex-wrap: wrap;*/ /*flex-wrap: wrap;*/
/*display: -webkit-flex; !* Safari *!*/ /*display: -webkit-flex; !* Safari *!*/
/*display: flex;*/ /*display: flex;*/
width: 340px; width: 360px;
position:relative; position:relative;
overflow: hidden; overflow: hidden;
} }
.newsubscript{ .newsubscript{
position: absolute; position: absolute;
right: 23px; right: 23px;
bottom: 38px; bottom: 16px;
cursor: pointer; cursor: pointer;
} }
.newsubscript:hover{ .newsubscript:hover{

@ -631,13 +631,14 @@ class Newshixuns extends Component {
} }
bigopen = () => { bigopen = (e) => {
this.setState({ this.setState({
opers: true opers: true
}) })
} }
bigopens = () => { bigopens = (e) => {
this.setState({ this.setState({
opers: false, opers: false,
operss: false, operss: false,
@ -646,16 +647,18 @@ class Newshixuns extends Component {
} }
bigopensmal = () => { bigopensmal = (e) => {
this.setState({ this.setState({
opensmail: true opensmail: true
}) })
} }
sbigopen = () => { sbigopen = (e) => {
this.setState({ this.setState({
operss: true operss: true
}) })
} }
// sbigopens=()=>{ // sbigopens=()=>{
@ -1193,6 +1196,7 @@ class Newshixuns extends Component {
showToday={false} showToday={false}
showTime showTime
locale={locale} locale={locale}
style={{"width": "184px"}}
format="YYYY-MM-DD HH:mm:ss" format="YYYY-MM-DD HH:mm:ss"
placeholder="请选择开启时间" placeholder="请选择开启时间"
onChange={this.onChangeTimePicker} onChange={this.onChangeTimePicker}

@ -7,11 +7,9 @@ import PropTypes from 'prop-types';
import classNames from 'classnames'; import classNames from 'classnames';
// import { Rating,Loading} from '@icedesign/base';
import {getImageUrl,setImagesUrl, toPath} from 'educoder'; import {getImageUrl,setImagesUrl, toPath} from 'educoder';
// import { Pagination,Row,Col } from 'antd'; import { Spin,Icon } from 'antd';
import 'antd/lib/pagination/style/index.css'; import 'antd/lib/pagination/style/index.css';
@ -21,8 +19,6 @@ import Rating from '@icedesign/base/lib/rating';
import Pagination from '@icedesign/base/lib/pagination'; import Pagination from '@icedesign/base/lib/pagination';
// import Loading from '@icedesign/base/lib/loading';
// 引入业务组件样式 // 引入业务组件样式
import '@icedesign/base/lib/pagination/style.js'; import '@icedesign/base/lib/pagination/style.js';
@ -30,8 +26,6 @@ import '@icedesign/base/lib/rating/style.js';
import { Tooltip } from 'antd'; import { Tooltip } from 'antd';
// import '@icedesign/base/lib/loading/style.js';
import axios from 'axios'; import axios from 'axios';
const $ = window.$; const $ = window.$;
@ -63,8 +57,8 @@ class ShixunCard extends Component {
let {middleshixundata, pagination, typepvisible, pages, totalcount} = this.props; let {middleshixundata, pagination, typepvisible, pages, totalcount} = this.props;
return ( return (
<div className="educontent mb80"> <div className="educontent mb80">
{/*<Loading visible={typepvisible} shape="dot-circle" color='#4AC7FF'>*/}
<Spin spinning={typepvisible} size="large" style={{marginTop:'15%'}}>
<div id="shixun_list_content" <div id="shixun_list_content"
style={{display: middleshixundata === undefined || middleshixundata.length === 0 ? "block" : "none"}}> style={{display: middleshixundata === undefined || middleshixundata.length === 0 ? "block" : "none"}}>
<div className="square-list clearfix"> <div className="square-list clearfix">
@ -168,7 +162,7 @@ class ShixunCard extends Component {
</div> </div>
</div> </div>
{/*</Loading>*/} </Spin>
</div> </div>
) )
} }

@ -6,6 +6,8 @@ import { BrowserRouter as Router, Route, Link, Switch } from "react-router-dom";
import axios from 'axios'; import axios from 'axios';
import { Spin } from 'antd';
import { TPMIndexHOC } from '../TPMIndexHOC'; import { TPMIndexHOC } from '../TPMIndexHOC';
import { SnackbarHOC } from 'educoder'; import { SnackbarHOC } from 'educoder';
@ -16,10 +18,6 @@ import ShixunSearchBar from './ShixunSearchBar';
import ShixunCard from './ShixunCard'; import ShixunCard from './ShixunCard';
import Loading from '@icedesign/base/lib/loading';
import '@icedesign/base/lib/loading/style.js';
const queryString = require('query-string'); const queryString = require('query-string');
const $ = window.$; const $ = window.$;
@ -362,9 +360,7 @@ class ShixunsIndex extends Component {
return ( return (
<div className="newMain clearfix backFAFAFA"> <div className="newMain clearfix backFAFAFA">
<Loading visible={typepvisible} shape="dot-circle" color='#4AC7FF'> {/*<Spin spinning={typepvisible} size="large" style={{marginTop:'15%'}}>*/}
{/*懒加载*/}
<ShixunSearchBar <ShixunSearchBar
Updatasearchlist={this.Updatasearchlist.bind(this)} Updatasearchlist={this.Updatasearchlist.bind(this)}
allUpdatashixunlist={this.allUpdatashixunlist} allUpdatashixunlist={this.allUpdatashixunlist}
@ -393,8 +389,7 @@ class ShixunsIndex extends Component {
pages={pages} pages={pages}
shixunsPage={this.shixunsPage.bind(this)} shixunsPage={this.shixunsPage.bind(this)}
/> />
{/*</Spin>*/}
</Loading>
</div> </div>
); );
} }

@ -115,6 +115,9 @@ return;
Raphaël 2.1.3 - JavaScript Vector Library Raphaël 2.1.3 - JavaScript Vector Library
flowchart, v1.3.4 flowchart, v1.3.4
editormd.js editormd.js
// Codemirror单独放置哪些地方还在使用Codemirror
// 新版使用了Monaco 无需一些Codemirror插件了
CodeMirror CodeMirror
cm active-line.js cm active-line.js
cm mode javascript cm mode javascript
@ -126,7 +129,24 @@ return;
CodeMirror c-like(java) CodeMirror c-like(java)
CodeMirror matchbrackets CodeMirror matchbrackets
余下
CodeMirror
diff
merge
移除的在js_min_cm.js
/**
active-line.js
mode javascript
fuzzysort
showHint
javascript-hint
anyword-hint
CodeMirror python
CodeMirror c-like(java)
CodeMirror matchbrackets
/
> >
// Copyright (C) 2006 Google Inc. // Copyright (C) 2006 Google Inc.
@ -144,4 +164,6 @@ return;
// limitations under the License. // limitations under the License.
去掉了
marked v0.3.3 去不了去掉后 这句代码会报错window.editormd.markdownToHTML TODO 看能否去掉单独加载marked的地方
*/ */
Loading…
Cancel
Save