杨树林 5 years ago
commit 572dd32fee

File diff suppressed because it is too large Load Diff

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

@ -1,16 +1,27 @@
import React, { Component } from 'react'; 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";
class Loading extends Component { import { Spin } from 'antd';
render() {
// Loading class Loading extends Component {
return ( render() {
<div className="App" style={{minHeight: '800px'}}> // Loading
return (
</div> <div className="App" style={{minHeight: '800px'}}>
); <style>
} {
} `
.margintop{
export default Loading; margin-top:20%;
}
`
}
</style>
<Spin size="large" className={"margintop"}/>
</div>
);
}
}
export default Loading;

@ -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,218 +1,216 @@
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; const Search = Input.Search;
const Search = Input.Search;
function formatDate(date) {
function formatDate(date) { var dateee = new Date(date).toJSON();
var dateee = new Date(date).toJSON(); return new Date(+new Date(dateee) + 8 * 3600 * 1000).toISOString().replace(/T/g, ' ').replace(/\.[\d]{3}Z/, '')
return new Date(+new Date(dateee) + 8 * 3600 * 1000).toISOString().replace(/T/g, ' ').replace(/\.[\d]{3}Z/, '') }
}
class Showoldfiles extends Component{
class Showoldfiles extends Component{ constructor(props){
constructor(props){ super(props);
super(props); this.state={
this.state={ Searchvalue:undefined,
Searchvalue:undefined, type:'all',
type:'all', category_id:0,
category_id:0, page:1,
page:1, Resourcelist:undefined,
Resourcelist:undefined,
getallfiles:false,
getallfiles:false, searchtype:'getallfiles'
searchtype:'getallfiles' }
} }
} componentDidMount() {
componentDidMount() {
}
}
componentDidUpdate = (prevProps) => {
componentDidUpdate = (prevProps) => {
if ( prevProps.visible != this.props.visible ) {
if ( prevProps.visible != this.props.visible ) {
}
}
}
}
cloasshanchudiao=()=>{
cloasshanchudiao=()=>{ this.props.closaoldfilesprops()
this.props.closaoldfilesprops() }
}
render(){
render(){ let {visible,allfiles}=this.props;
let {visible,allfiles}=this.props;
return(
return( <div>
<div> {/*提示*/}
{/*提示*/} <Modals
<Modals modalsType={this.state.Modalstype}
modalsType={this.state.Modalstype} modalsTopval={this.state.Modalstopval}
modalsTopval={this.state.Modalstopval} modalCancel={this.state.ModalCancel}
modalCancel={this.state.ModalCancel} modalSave={this.state.ModalSave}
modalSave={this.state.ModalSave} loadtype= {this.state.loadtype}
loadtype= {this.state.loadtype}
/>
/> {visible===true?
{visible===true? <Modal
<Modal title="选择版本"
title="选择版本" visible={visible}
visible={visible} closable={false}
closable={false} footer={null}
footer={null} width="600px"
width="600px" destroyOnClose={true}
destroyOnClose={true} keyboard={false}
keyboard={false} >
> <a id='closeIcon' onClick={this.cloasshanchudiao}><i className='iconfont icon-shanchudiao'></i></a>
<a id='closeIcon' onClick={this.cloasshanchudiao}><i className='iconfont icon-shanchudiao'></i></a> <style>
<style> {
{ `
` .ant-modal-body{
.ant-modal-body{ padding: 30px 0px;
padding: 30px 0px; }
} `
` }
} </style>
</style>
<Loading visible={false} shape="dot-circle" color='#4AC7FF'> <style>{`
.newupload_conboxtop{
<style>{` margin-top: -30px;
.newupload_conboxtop{ }
margin-top: -30px; #shixun_tab_div{
} padding: 0 30px;
#shixun_tab_div{ padding-top:30px;
padding: 0 30px; }
padding-top:30px;
} .selectfiles{
width: 600px;
.selectfiles{ height: 48px;
width: 600px; background: rgba(255,104,0,0.1);
height: 48px; line-height: 48px;
background: rgba(255,104,0,0.1); text-align: center;
line-height: 48px; }
text-align: center;
} .selectfilesfont{
font-size:14px;
.selectfilesfont{ font-family:Microsoft YaHei;
font-size:14px; font-weight:400;
font-family:Microsoft YaHei; line-height:25px;
font-weight:400; color:rgba(255,104,0,1);
line-height:25px; }
color:rgba(255,104,0,1); `}</style>
}
`}</style> <div className="newupload_conbox newupload_conboxtop">
<div className="clearfix cdefault" style={{"marginRight":"4px"}}>
<div className="newupload_conbox newupload_conboxtop">
<div className="clearfix cdefault" style={{"marginRight":"4px"}}> <div className={"selectfiles"}>
<span className={"selectfilesfont"}>
<div className={"selectfiles"}> 该文件有历史版本请选择您需要的文件点击文件名 下载
<span className={"selectfilesfont"}> </span>
该文件有历史版本请选择您需要的文件点击文件名 下载 </div>
</span> </div>
</div>
</div>
<style>{`
.greybackHead{
<style>{` padding:0px 30px;
.greybackHead{ }
padding:0px 30px; .fontlefts{
} width: 300px;
.fontlefts{ text-align: center;
width: 300px; }
text-align: center;
} .filesves{
width: 220px;
.filesves{ text-align: center;
width: 220px; }
text-align: center; `}</style>
} <ul className="clearfix greybackHead edu-txt-center">
`}</style> <li className="fl paddingleft22 fontlefts">资源名称</li>
<ul className="clearfix greybackHead edu-txt-center"> <li className="fl filesves" >版本</li>
<li className="fl paddingleft22 fontlefts">资源名称</li> </ul>
<li className="fl filesves" >版本</li>
</ul>
<div className="over210 pl20 pr20"
onScroll={this.contentViewScroll}
<div className="over210 pl20 pr20" style={{"Height":"204px"}}>
onScroll={this.contentViewScroll}
style={{"Height":"204px"}}> <style>{`
.color-grey-9a{color: #9A9A9A !important;}
<style>{` .datastyle{
.color-grey-9a{color: #9A9A9A !important;} width: 120px;
.datastyle{ overflow: hidden;
width: 120px; height: 37px;
overflow: hidden; }
height: 37px; `}</style>
}
`}</style> <style>{`
<style>{` .fontlefts{
width: 340px;
.fontlefts{ text-align: center;
width: 340px; }
text-align: center;
} .filesves{
width: 200px;
.filesves{ text-align: center;
width: 200px; }
text-align: center; .isabox{
} max-width: 280px;
.isabox{ overflow: hidden;
max-width: 280px; text-overflow: ellipsis;
overflow: hidden; white-space: nowrap;
text-overflow: ellipsis; display: inline-block;
white-space: nowrap; float: left;
display: inline-block; }
float: left; `}</style>
} {
`}</style> allfiles === undefined ? "":
{ <div>
allfiles === undefined ? "":
<div> <div className="clearfix edu-txt-center lineh-40 bor-bottom-greyE" id={allfiles.id}>
<div className="clearfix edu-txt-center lineh-40 bor-bottom-greyE" id={allfiles.id}> <li className="fl fontlefts">
<a className={"isabox"} href={allfiles.url}>{allfiles.title}</a>
<li className="fl fontlefts"> <span className={"newcolor-orange fl"}>当前版本</span>
<a className={"isabox"} href={allfiles.url}>{allfiles.title}</a> </li>
<span className={"newcolor-orange fl"}>当前版本</span>
</li> <li className="fl filesves ">
{formatDate(allfiles.created_on)}
<li className="fl filesves "> </li>
{formatDate(allfiles.created_on)}
</li> </div>
{
</div> allfiles.attachment_histories.length===0?"":allfiles.attachment_histories.map((item,key)=>{
{ return(
allfiles.attachment_histories.length===0?"":allfiles.attachment_histories.map((item,key)=>{
return( <div className="clearfix edu-txt-center lineh-40 bor-bottom-greyE" id={item.id} key={key}>
<div className="clearfix edu-txt-center lineh-40 bor-bottom-greyE" id={item.id} key={key}> <li className="fl fontlefts">
<a className={"isabox"} href={item.url}>{item.title}</a>
<li className="fl fontlefts"> </li>
<a className={"isabox"} href={item.url}>{item.title}</a>
</li> <li className="fl filesves ">
{formatDate(item.created_on)}
<li className="fl filesves "> </li>
{formatDate(item.created_on)}
</li> </div>
)
</div> })
) }
}) </div>
} }
</div> </div>
}
</div> </div>
</div> </Modal>:""}
</Loading> </div>
</Modal>:""} )
</div> }
) }
}
}
export default Showoldfiles; export default Showoldfiles;

@ -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>
:"" :""

@ -498,10 +498,10 @@ class studentsList extends Component{
showSearchInput={total_count >= 10} showSearchInput={total_count >= 10}
searchPlaceholder={ '请输入姓名、学号进行搜索' } searchPlaceholder={ '请输入姓名、学号进行搜索' }
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,75 +1,75 @@
.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{
width: 100%; width: 100%;
position: relative; position: relative;
overflow: hidden; overflow: hidden;
border-radius: 10px; border-radius: 10px;
} }
.user_navlist{ .user_navlist{
margin-left: 40px; margin-left: 40px;
} }
.next-slick-list{ .next-slick-list{
margin-left: 12px; margin-left: 12px;
} }
.black_nav_span{ .black_nav_span{
display: block; display: block;
margin: 0px 20px; margin: 0px 20px;
border-bottom: 1px solid #4B4B4B; border-bottom: 1px solid #4B4B4B;
padding-left: 8px; padding-left: 8px;
color: #FAFAFA; color: #FAFAFA;
} }
.user_navlist_white{ .user_navlist_white{
z-index: 100 !important; z-index: 100 !important;
} }
.next-slick.next-slick-horizontal.next-slick-outer{ .next-slick.next-slick-horizontal.next-slick-outer{
height: 350px; height: 350px;
} }
.black_nav_list li span a{ .black_nav_list li span a{
color:#fff; color:#fff;
} }
.black_nav_list li span a:hover{ .black_nav_list li span a:hover{
color:#000; color:#000;
} }
.black_nav_list li:hover span a{ .black_nav_list li:hover span a{
color:#000; color:#000;
} }
.little-titles{ .little-titles{
height: 22px !important; height: 22px !important;
} }
.user_navlist_white a{ .user_navlist_white a{
color: #989898 !important; color: #989898 !important;
} }
.user_navlist_white .navlistpanel-line .little-titles a{ .user_navlist_white .navlistpanel-line .little-titles a{
color: #000 !important; color: #000 !important;
} }
.newnext-loading{ .newnext-loading{
display:block; display:block;
} }
.educontentSlider{ .educontentSlider{
width: 1282px !important; width: 1282px !important;
} }
.user_navlist_white{ .user_navlist_white{
max-height:350px !important; max-height:350px !important;
overflow-y: auto; overflow-y: auto;
} }
.iconfontzhangjie{ .iconfontzhangjie{
font-size: 10px !important; font-size: 10px !important;
line-height: 23px; line-height: 23px;
} }
.iconfontshixundaibeijing{ .iconfontshixundaibeijing{
font-size: 18px !important; font-size: 18px !important;
line-height: 24px; line-height: 24px;
} }

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

@ -1,49 +1,49 @@
import React, { Component } from 'react'; import React, { Component } from 'react';
import { Redirect } from 'react-router'; import { Redirect } from 'react-router';
import { getImageUrl, toPath } from 'educoder' import { getImageUrl, toPath } from 'educoder'
import PropTypes from 'prop-types'; import PropTypes from 'prop-types';
class NewFooter extends Component { class NewFooter extends Component {
constructor(props) { constructor(props) {
super(props) super(props)
} }
componentWillReceiveProps(newProps, newContext) { componentWillReceiveProps(newProps, newContext) {
} }
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">
<a href="/" className="fl" style={{height:'70px'}}> <a href="/" className="fl" style={{height:'70px'}}>
<img alt="高校智能化教学与实训平台" src={getImageUrl(`images/educoder/headNavLogo.png?1526520218`)} width="70px"> <img alt="高校智能化教学与实训平台" src={getImageUrl(`images/educoder/headNavLogo.png?1526520218`)} width="70px">
</img> </img>
</a> </a>
<span className="fl color-grey-c cdefault font-28 ml22" style={{lineHeight:'74px'}}>EduCoder.net</span> <span className="fl color-grey-c cdefault font-28 ml22" style={{lineHeight:'74px'}}>EduCoder.net</span>
</div> </div>
<ul className="clearfix inner-footernav"> <ul className="clearfix inner-footernav">
<li><a href="/" className="fl" target="_blank">网站首页</a></li> <li><a href="/" className="fl" target="_blank">网站首页</a></li>
<li><a href={this.props.Footerdown===undefined?"":this.props.Footerdown.about_us} className="fl" target="_blank">关于我们</a></li> <li><a href={this.props.Footerdown===undefined?"":this.props.Footerdown.about_us} className="fl" target="_blank">关于我们</a></li>
<li><a href={this.props.Footerdown===undefined?"":this.props.Footerdown.connect_us} className="fl" target="_blank">联系我们</a></li> <li><a href={this.props.Footerdown===undefined?"":this.props.Footerdown.connect_us} className="fl" target="_blank">联系我们</a></li>
<li><a href={this.props.Footerdown===undefined?"":this.props.Footerdown.cooperation_partner} className="fl" target="_blank">合作伙伴</a></li> <li><a href={this.props.Footerdown===undefined?"":this.props.Footerdown.cooperation_partner} className="fl" target="_blank">合作伙伴</a></li>
<li><a href={this.props.Footerdown===undefined?"":this.props.Footerdown.service_agreement} className="fl" target="_blank">服务协议</a></li> <li><a href={this.props.Footerdown===undefined?"":this.props.Footerdown.service_agreement} className="fl" target="_blank">服务协议</a></li>
<li><a href={this.props.Footerdown===undefined?"":this.props.Footerdown.help_center} className="fl" target="_blank">帮助中心</a></li> <li><a href={this.props.Footerdown===undefined?"":this.props.Footerdown.help_center} className="fl" target="_blank">帮助中心</a></li>
<li><a href={this.props.Footerdown===undefined?"":this.props.Footerdown.feedback} className="fl" target="_blank">意见反馈</a></li> <li><a href={this.props.Footerdown===undefined?"":this.props.Footerdown.feedback} className="fl" target="_blank">意见反馈</a></li>
</ul> </ul>
</div> </div>
<div> <div>
<p className="footer_con-p inline lineh-30 font-14"><span className="font-18 fl">©</span>&nbsp;2019&nbsp;EduCoder<span className="ml15 mr15">ICP17009477</span><a href="https://team.trustie.net" style={{"color":"#888"}} target="_blank">Trustie</a>&nbsp;&nbsp;&nbsp;&amp;&nbsp;&nbsp;&nbsp;IntelliDE inside.</p> <p className="footer_con-p inline lineh-30 font-14"><span className="font-18 fl">©</span>&nbsp;2019&nbsp;EduCoder<span className="ml15 mr15">ICP17009477</span><a href="https://team.trustie.net" style={{"color":"#888"}} target="_blank">Trustie</a>&nbsp;&nbsp;&nbsp;&amp;&nbsp;&nbsp;&nbsp;IntelliDE inside.</p>
</div> </div>
<div className="cl"></div> <div className="cl"></div>
</div> </div>
</div> </div>
); );
} }
} }
export default NewFooter; export default NewFooter;

@ -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,193 +1,192 @@
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";
// import "antd/dist/antd.css"; // import "antd/dist/antd.css";
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' import './shixunCss/fork.css';
import './shixunCss/fork.css'; let origin = getUrl();
let origin = getUrl(); let path = getUrl("/editormd/lib/")
let path = getUrl("/editormd/lib/") const $ = window.$;
const $ = window.$; let timeout;
let timeout; let currentValue;
let currentValue;
export default class TPMFork_listComponent extends Component {
constructor(props) {
export default class TPMFork_listComponent extends Component { super(props)
constructor(props) { this.state = {
super(props) shixuns:undefined,
this.state = { total_count:0,
shixuns:undefined, shixunsID:undefined,
total_count:0, Forkvisible: true,
shixunsID:undefined, Forkcurrent: 1
Forkvisible: true, }
Forkcurrent: 1 }
}
}
componentDidMount() {
let id = this.props.match.params.shixunId;
componentDidMount() {
let id = this.props.match.params.shixunId; let Url="/shixuns/"+id+"/fork_list.json";
axios.get(Url, {
let Url="/shixuns/"+id+"/fork_list.json"; params: {
axios.get(Url, { page:1,
params: { limit:8
page:1, }
limit:8 }).then((response)=> {
} this.setState({
}).then((response)=> { shixunsID:id,
this.setState({ shixuns:response.data.shixuns,
shixunsID:id, total_count:response.data.total_count,
shixuns:response.data.shixuns, Forkvisible:false
total_count:response.data.total_count, })
Forkvisible:false }).catch((error)=>{
}) console.log(error)
}).catch((error)=>{ });
console.log(error) }
});
}
TPMForkonChange=(pageNumber)=>{
let id = this.props.match.params.shixunId;
TPMForkonChange=(pageNumber)=>{ this.setState({
let id = this.props.match.params.shixunId; Forkvisible:true
this.setState({ })
Forkvisible:true let Url="/shixuns/"+id+"/fork_list.json";
}) axios.get(Url, {
let Url="/shixuns/"+id+"/fork_list.json"; params: {
axios.get(Url, { page:pageNumber,
params: { limit:8
page:pageNumber, }
limit:8 }).then((response)=> {
} this.setState({
}).then((response)=> { shixunsID:id,
this.setState({ shixuns:response.data.shixuns,
shixunsID:id, total_count:response.data.total_count,
shixuns:response.data.shixuns, Forkvisible: false,
total_count:response.data.total_count, Forkcurrent: pageNumber
Forkvisible: false, })
Forkcurrent: pageNumber }).catch((error)=>{
}) console.log(error)
}).catch((error)=>{ });
console.log(error) }
}); render() {
}
render() { let {shixuns, total_count, shixunsID, Forkvisible, Forkcurrent} = this.state;
let {shixuns, total_count, shixunsID, Forkvisible, Forkcurrent} = this.state;
return (
<React.Fragment>
return ( <div className="educontent mb20">
<React.Fragment>
<div className="educontent mb20"> <div className="edu-back-white padding20 clearfix mt30">
<span className="fl font-16">Fork实训列表</span>
<div className="edu-back-white padding20 clearfix mt30"> <a href={"/shixuns/"+shixunsID+"/challenges"} className="font-16 color-grey-9 fr">返回</a>
<span className="fl font-16">Fork实训列表</span> </div>
<a href={"/shixuns/"+shixunsID+"/challenges"} className="font-16 color-grey-9 fr">返回</a> {/*<Loading visible={Forkvisible} shape="dot-circle" style={{width:'100%'}}color='#4AC7FF'>*/}
</div> <Spin spinning={Forkvisible} size="large" style={{marginTop:'15%'}}>
<Loading visible={Forkvisible} shape="dot-circle" style={{width:'100%'}}color='#4AC7FF'> <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)=>{ return(
return( <div className="square-Item" key={key} id={item.id}>
<div className="square-Item" key={key} id={item.id}>
<div className="tag-green">
<div className="tag-green"> <span className="tag-name"> {item.tag_name}</span>
<span className="tag-name"> {item.tag_name}</span> <img src={require(`./shixunCss/tag2.png`)}/>
<img src={require(`./shixunCss/tag2.png`)}/> </div>
</div>
<div className={item.power === false ? "closeSquare" : "none"}>
<div className={item.power === false ? "closeSquare" : "none"}> <img src={getImageUrl("images/educoder/icon/lockclose.svg")}
<img src={getImageUrl("images/educoder/icon/lockclose.svg")} className="mt80 mb25"/>
className="mt80 mb25"/> <p className="font-14 color-white">非试用内容需要授权</p>
<p className="font-14 color-white">非试用内容需要授权</p> </div>
</div>
<a href={"/shixuns/"+item.identifier+"/challenges"} className="square-img" target="_blank">
<a href={"/shixuns/"+item.identifier+"/challenges"} className="square-img" target="_blank"> <img src={'/'+item.pic}/>
<img src={'/'+item.pic}/> </a>
</a>
<div className="square-main">
<div className="square-main"> <p className="task-hide">
<p className="task-hide"> <a href={"/shixuns/"+item.identifier+"/challenges"} target="_blank" className="justify color-grey-name">
<a href={"/shixuns/"+item.identifier+"/challenges"} target="_blank" className="justify color-grey-name"> {item.name}
{item.name} </a>
</a> </p>
</p>
<p className="clearfix mt8 ml-3">
<p className="clearfix mt8 ml-3"> <span className="rateYoStar fl" style={{padding: '0px',height: '20px',lineHeight: '19px',cursor: 'default'}} title="">
<span className="rateYoStar fl" style={{padding: '0px',height: '20px',lineHeight: '19px',cursor: 'default'}} title=""> <Rating key={key} value={item.score_info===null?5:item.score_info} disabled allowHalf />
<Rating key={key} value={item.score_info===null?5:item.score_info} disabled allowHalf /> </span>
</span> <span className="fl ml25 font-12 color-grey-9 lineh-12 mt4">{item.score_info===null?"5分":item.score_info+"分"}</span>
<span className="fl ml25 font-12 color-grey-9 lineh-12 mt4">{item.score_info===null?"5分":item.score_info+"分"}</span> </p>
</p>
<p className="clearfix mt8 font-12 color-grey-B4">
<p className="clearfix mt8 font-12 color-grey-B4">
<Tooltip placement="bottom" title={"关卡"}>
<Tooltip placement="bottom" title={"关卡"}> <span className="mr10 fl squareIconSpan">
<span className="mr10 fl squareIconSpan"> <i className="iconfont icon-shixunguanqia fl mr3"></i>{item.challenges_count}
<i className="iconfont icon-shixunguanqia fl mr3"></i>{item.challenges_count} </span>
</span> </Tooltip>
</Tooltip>
{/*<Tooltip placement="bottom" title={"经验值"}>*/}
{/*<Tooltip placement="bottom" title={"经验值"}>*/} {/*<span className="mr10 fl squareIconSpan">*/}
{/*<span className="mr10 fl squareIconSpan">*/} {/*<i className="iconfont icon-jingyan fl mr3"></i>{item.exp}*/}
{/*<i className="iconfont icon-jingyan fl mr3"></i>{item.exp}*/} {/*</span>*/}
{/*</span>*/} {/*</Tooltip>*/}
{/*</Tooltip>*/}
<Tooltip placement="bottom" title={"学习人数"}>
<Tooltip placement="bottom" title={"学习人数"}> <span className="mr10 fl squareIconSpan" style={{display:item.stu_num===0?"none":'block'}}>
<span className="mr10 fl squareIconSpan" style={{display:item.stu_num===0?"none":'block'}}> <i className="iconfont icon-chengyuan fl mr3"></i>{item.stu_num}
<i className="iconfont icon-chengyuan fl mr3"></i>{item.stu_num} </span>
</span> </Tooltip>
</Tooltip>
<span className="fr color-grey-B3 squareIconSpan">{item.level}</span>
<span className="fr color-grey-B3 squareIconSpan">{item.level}</span> </p>
</p>
</div>
</div> </div>
</div> )
) })
}) }
} </div>
</div>
{/*<div>{total_count}</div>*/}
{/*<div>{total_count}</div>*/} <div className="educontent mb80 edu-txt-center mt10" style={{display: total_count > 8 ? "block" : "none"}}>
<div className="educontent mb80 edu-txt-center mt10" style={{display: total_count > 8 ? "block" : "none"}}> {/*<div className={total_count < 9 ? " ml32" : "ml105"}>*/}
{/*<div className={total_count < 9 ? " ml32" : "ml105"}>*/} <Pagination
<Pagination showQuickJumper
showQuickJumper defaultCurrent={1}
defaultCurrent={1} pageSize={8}
pageSize={8} total={total_count}
total={total_count} current={Forkcurrent}
current={Forkcurrent} style={
style={ {
{ display: total_count < 9 ? 'none' : 'block'
display: total_count < 9 ? 'none' : 'block' }
} }
} onChange={this.TPMForkonChange}/>
onChange={this.TPMForkonChange}/> </div>
</div> </Spin>
{/*</Loading>*/}
</Loading> </div>
</div> </React.Fragment>
</React.Fragment> )
) }
} }
}

@ -1,382 +1,382 @@
import React, { Component } from 'react'; import React, { Component } from 'react';
import { BrowserRouter as Router, Route, Link, Switch } from "react-router-dom"; import { BrowserRouter as Router, Route, Link, Switch } from "react-router-dom";
import Loading from '../../Loading'; import Loading from '../../Loading';
import Loadable from 'react-loadable'; import Loadable from 'react-loadable';
import { TPMIndexHOC } from './TPMIndexHOC'; import { TPMIndexHOC } from './TPMIndexHOC';
import { SnackbarHOC } from 'educoder'; import { SnackbarHOC } from 'educoder';
import TPMBanner from './TPMBanner'; import TPMBanner from './TPMBanner';
import axios from 'axios'; import axios from 'axios';
import TPMShixunDiscussContainer from './TPMShixunDiscussContainer'; import TPMShixunDiscussContainer from './TPMShixunDiscussContainer';
import TPMRepositoryComponent from './TPMRepositoryComponent'; import TPMRepositoryComponent from './TPMRepositoryComponent';
import TPMRepositoryCommits from './shixunchild/Repository/TPMRepositoryCommits'; import TPMRepositoryCommits from './shixunchild/Repository/TPMRepositoryCommits';
import TPMsettings from './TPMsettings/TPMsettings'; import TPMsettings from './TPMsettings/TPMsettings';
import TPMChallengeComponent from './TPMChallengeContainer' import TPMChallengeComponent from './TPMChallengeContainer'
import TPMPropaedeuticsComponent from './TPMPropaedeuticsComponent' import TPMPropaedeuticsComponent from './TPMPropaedeuticsComponent'
import TPMRanking_listComponent from './TPMRanking_listContainer' import TPMRanking_listComponent from './TPMRanking_listContainer'
import TPMCollaboratorsComponent from './TPMCollaboratorsContainer' import TPMCollaboratorsComponent from './TPMCollaboratorsContainer'
import '../page/tpiPage.css' import '../page/tpiPage.css'
//任务 //任务
// const TPMChallengeComponent = Loadable({ // const TPMChallengeComponent = Loadable({
// loader: () => import('./TPMChallengeContainer'), // loader: () => import('./TPMChallengeContainer'),
// loading: Loading, // loading: Loading,
// }) // })
//背景知识 //背景知识
// const TPMPropaedeuticsComponent = Loadable({ // const TPMPropaedeuticsComponent = Loadable({
// loader: () => import('./TPMPropaedeuticsComponent'), // loader: () => import('./TPMPropaedeuticsComponent'),
// loading: Loading, // loading: Loading,
// }) // })
//版本库 //版本库
// const TPMRepositoryComponent = Loadable({ // const TPMRepositoryComponent = Loadable({
// loader: () => import('./TPMRepositoryComponent'), // loader: () => import('./TPMRepositoryComponent'),
// loading: Loading, // loading: Loading,
// }) // })
// const TPMRepositoryComponent = Loadable({ // const TPMRepositoryComponent = Loadable({
// loader: () => import('./TPMRepositoryComponent'), // loader: () => import('./TPMRepositoryComponent'),
// loading: Loading, // loading: Loading,
// }) // })
//合作 //合作
// const TPMCollaboratorsComponent = Loadable({ // const TPMCollaboratorsComponent = Loadable({
// loader: () => import('./TPMCollaboratorsContainer'), // loader: () => import('./TPMCollaboratorsContainer'),
// loading: Loading, // loading: Loading,
// }) // })
//评论 //评论
// const TPMShixunDiscussComponent = Loadable({ // const TPMShixunDiscussComponent = Loadable({
// loader: () => import('./TPMShixunDiscussContainer'), // loader: () => import('./TPMShixunDiscussContainer'),
// loading: Loading, // loading: Loading,
// }) // })
//排行版 //排行版
// const TPMRanking_listComponent = Loadable({ // const TPMRanking_listComponent = Loadable({
// loader: () => import('./TPMRanking_listContainer'), // loader: () => import('./TPMRanking_listContainer'),
// loading: Loading, // loading: Loading,
// }) // })
// //编辑实训 // //编辑实训
// const TPMModifysettings = Loadable({ // const TPMModifysettings = Loadable({
// loader: () =>import('./modules/tpm/TPMsettings/TPMsettings'), // loader: () =>import('./modules/tpm/TPMsettings/TPMsettings'),
// loading: Loading, // loading: Loading,
// }) // })
//新建实训 //新建实训
const TPMchallengesnew = Loadable({ const TPMchallengesnew = Loadable({
loader: () => import('./challengesnew/TPMchallengesnew'), loader: () => import('./challengesnew/TPMchallengesnew'),
loading: Loading, loading: Loading,
}) })
//新建tab2 //新建tab2
const TPMevaluation = Loadable({ const TPMevaluation = Loadable({
loader: () => import('./challengesnew/TPMevaluation'), loader: () => import('./challengesnew/TPMevaluation'),
loading: Loading, loading: Loading,
}) })
//新建tab3答案 //新建tab3答案
// const TPManswer = Loadable({ // const TPManswer = Loadable({
// loader: () => import('./challengesnew/TPManswer'), // loader: () => import('./challengesnew/TPManswer'),
// loading: Loading, // loading: Loading,
// }) // })
const TPManswer = Loadable({ const TPManswer = Loadable({
loader: () => import('./challengesnew/TPManswer2'), loader: () => import('./challengesnew/TPManswer2'),
loading: Loading, loading: Loading,
}) })
//选择题 //选择题
const TPMquestion = Loadable({ const TPMquestion = Loadable({
loader: () => import('./challengesnew/TPMquestion'), loader: () => import('./challengesnew/TPMquestion'),
loading: Loading, loading: Loading,
}) })
//fork列表 //fork列表
const TPMFork_listComponent = Loadable({ const TPMFork_listComponent = Loadable({
loader: () => import('./TPMFork/TPMForklist'), loader: () => import('./TPMFork/TPMForklist'),
loading: Loading, loading: Loading,
}) })
//背景知识修改 //背景知识修改
const TPMUpdatepropaede = Loadable({ const TPMUpdatepropaede = Loadable({
loader: () => import('./TPMUpdatepropaede/TPMUpdatepropaede'), loader: () => import('./TPMUpdatepropaede/TPMUpdatepropaede'),
loading: Loading, loading: Loading,
}) })
const interceptorUrlArray = ['repository.json', 'commits.json', 'propaedeutics.json' const interceptorUrlArray = ['repository.json', 'commits.json', 'propaedeutics.json'
, 'challenges.json', 'discusses.json', 'ranking_list.json', 'collaborators.json'] , 'challenges.json', 'discusses.json', 'ranking_list.json', 'collaborators.json']
const cacheInterceptorUrlMap = {} const cacheInterceptorUrlMap = {}
class TPMIndex extends Component { class TPMIndex extends Component {
constructor(props) { constructor(props) {
super(props) super(props)
this.state = { this.state = {
loadingContent: false, loadingContent: false,
power: false, power: false,
shixunsDetails: {}, shixunsDetails: {},
shixunId: undefined, shixunId: undefined,
star_info: [0, 0, 0, 0, 0, 0], star_info: [0, 0, 0, 0, 0, 0],
star_infos: [0, 0, 0, 0, 0, 0], star_infos: [0, 0, 0, 0, 0, 0],
identity:undefined, identity:undefined,
TPMRightSectionData:undefined, TPMRightSectionData:undefined,
PropaedeuticsList: undefined, PropaedeuticsList: undefined,
} }
} }
componentDidMount = () => { componentDidMount = () => {
let id = this.props.match.params.shixunId; let id = this.props.match.params.shixunId;
// let collaborators = `/shixuns/` + id + `/propaedeutics.json`; // let collaborators = `/shixuns/` + id + `/propaedeutics.json`;
// //
// axios.get(collaborators).then((response) => { // axios.get(collaborators).then((response) => {
// if (response.status === 200) { // if (response.status === 200) {
// if (response.data.status === 403||response.data.status === 401||response.data.status === 500) { // if (response.data.status === 403||response.data.status === 401||response.data.status === 500) {
// //
// }else{ // }else{
// this.setState({ // this.setState({
// PropaedeuticsList: response.data, // PropaedeuticsList: response.data,
// shixunId: id // shixunId: id
// }); // });
// } // }
// //
// } // }
// }).catch((error) => { // }).catch((error) => {
// console.log(error) // console.log(error)
// }); // });
let Url = `/shixuns/` + id + `.json`; let Url = `/shixuns/` + id + `.json`;
axios.get(Url).then((response) => { axios.get(Url).then((response) => {
if (response.status === 200) { if (response.status === 200) {
document.title=response.data.name; document.title=response.data.name;
let newstar_info = []; let newstar_info = [];
// let start1= // let start1=
for (var i = 0; i < response.data.score_info.length; i++) { for (var i = 0; i < response.data.score_info.length; i++) {
if (i === 0) { if (i === 0) {
newstar_info.push(response.data.score_info[i]) newstar_info.push(response.data.score_info[i])
} else { } else {
newstar_info.push((response.data.score_info[i] / 100) * 5) newstar_info.push((response.data.score_info[i] / 100) * 5)
} }
} }
let newstar_infos = response.data.score_info; let newstar_infos = response.data.score_info;
this.setState({ this.setState({
shixunsDetails: response.data, shixunsDetails: response.data,
shixunId: id, shixunId: id,
star_info: newstar_info, star_info: newstar_info,
star_infos: newstar_infos, star_infos: newstar_infos,
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) => {
this.setState({ this.setState({
shixunsDetails: undefined, shixunsDetails: undefined,
shixunId: undefined, shixunId: undefined,
star_info: undefined, star_info: undefined,
star_infos: undefined, star_infos: undefined,
power: undefined, power: undefined,
identity: undefined, identity: undefined,
status: undefined, status: undefined,
propaedeutics:undefined propaedeutics:undefined
}); });
}); });
this.tpmContentRequestInterceptor = axios.interceptors.request.use((config) => { this.tpmContentRequestInterceptor = axios.interceptors.request.use((config) => {
let url = config.url; let url = config.url;
// console.log('tpmContentRequestInterceptor:', url) // console.log('tpmContentRequestInterceptor:', url)
for ( let i = 0; i < interceptorUrlArray.length; i++ ) { for ( let i = 0; i < interceptorUrlArray.length; i++ ) {
if (url.indexOf(interceptorUrlArray[i]) != -1) { if (url.indexOf(interceptorUrlArray[i]) != -1) {
url = url.split('?')[0] url = url.split('?')[0]
console.log('loadingContent, url:', url) console.log('loadingContent, url:', url)
this.setState({ loadingContent: true }) this.setState({ loadingContent: true })
cacheInterceptorUrlMap[url] = true cacheInterceptorUrlMap[url] = true
} }
} }
return config; return config;
}, function (error) { }, function (error) {
return Promise.reject(error); return Promise.reject(error);
}); });
// Add a response interceptor // Add a response interceptor
this.tpmContentResponseInterceptor = axios.interceptors.response.use((response) => { this.tpmContentResponseInterceptor = axios.interceptors.response.use((response) => {
// console.log('loadingContent finished, url:', response.config.url) // console.log('loadingContent finished, url:', response.config.url)
// TODO 依赖了api这个前缀 // TODO 依赖了api这个前缀
let url = response.config.url.split('api')[1]; let url = response.config.url.split('api')[1];
url = url.split('?')[0] url = url.split('?')[0]
if (cacheInterceptorUrlMap[url]) { if (cacheInterceptorUrlMap[url]) {
this.setState({ loadingContent: false }) this.setState({ loadingContent: false })
delete cacheInterceptorUrlMap[response.url] delete cacheInterceptorUrlMap[response.url]
} }
return response; return response;
}, function (error) { }, function (error) {
// Do something with response error // Do something with response error
return Promise.reject(error); return Promise.reject(error);
}); });
//右侧数据 //右侧数据
let shixunsDetailsURL=`/shixuns/`+id+`/show_right.json`; let shixunsDetailsURL=`/shixuns/`+id+`/show_right.json`;
axios.get(shixunsDetailsURL).then((response)=> { axios.get(shixunsDetailsURL).then((response)=> {
this.setState({ this.setState({
TPMRightSectionData: response.data TPMRightSectionData: response.data
}); });
}) })
} }
componentWillUnmount = () => { componentWillUnmount = () => {
axios.interceptors.request.eject(this.tpmContentRequestInterceptor); axios.interceptors.request.eject(this.tpmContentRequestInterceptor);
this.tpmContentRequestInterceptor = null; this.tpmContentRequestInterceptor = null;
axios.interceptors.request.eject(this.tpmContentResponseInterceptor); axios.interceptors.request.eject(this.tpmContentResponseInterceptor);
this.tpmContentResponseInterceptor = null; this.tpmContentResponseInterceptor = null;
} }
setLoadingContent = (isLoadingContent) => { setLoadingContent = (isLoadingContent) => {
this.setState({ loadingContent: isLoadingContent }) this.setState({ loadingContent: isLoadingContent })
} }
// TpmTPMBannertype(type){ // TpmTPMBannertype(type){
// //
// } // }
render() { render() {
return ( return (
<div className="newMain clearfix"> <div className="newMain clearfix">
<TPMBanner <TPMBanner
{...this.props} {...this.props}
{...this.state} {...this.state}
></TPMBanner> ></TPMBanner>
<Switch {...this.props}> <Switch {...this.props}>
<Route path="/shixuns/:shixunId/repository/:repoId/commits" render={ <Route path="/shixuns/:shixunId/repository/:repoId/commits" render={
(props) => (<TPMRepositoryCommits {...this.props} {...this.state} {...props} (props) => (<TPMRepositoryCommits {...this.props} {...this.state} {...props}
/>) />)
}></Route> }></Route>
<Route exact path="/shixuns/:shixunId/challenges" render={ <Route exact path="/shixuns/:shixunId/challenges" render={
(props) => (<TPMChallengeComponent {...this.props} {...this.state} {...props} (props) => (<TPMChallengeComponent {...this.props} {...this.state} {...props}
/>) />)
}></Route> }></Route>
<Route path="/shixuns/:shixunId/repository" render={ <Route path="/shixuns/:shixunId/repository" render={
(props) => (<TPMRepositoryComponent {...this.props} {...this.state} {...props} (props) => (<TPMRepositoryComponent {...this.props} {...this.state} {...props}
/>) />)
}></Route> }></Route>
{/* <Route exact path="/shixuns/:shixunId/propaedeutics" component={TPMPropaedeuticsComponent}></Route> */} {/* <Route exact path="/shixuns/:shixunId/propaedeutics" component={TPMPropaedeuticsComponent}></Route> */}
<Route exact path="/shixuns/:shixunId/propaedeutics" render={ <Route exact path="/shixuns/:shixunId/propaedeutics" render={
(props) => (<TPMPropaedeuticsComponent {...this.props} {...this.state} {...props} (props) => (<TPMPropaedeuticsComponent {...this.props} {...this.state} {...props}
/>) />)
}></Route> }></Route>
<Route exact path="/shixuns/:shixunId/collaborators" render={ <Route exact path="/shixuns/:shixunId/collaborators" render={
(props) => (<TPMCollaboratorsComponent {...this.props} {...this.state} {...props} (props) => (<TPMCollaboratorsComponent {...this.props} {...this.state} {...props}
/>) />)
}></Route> }></Route>
{/* <Route exact path="/shixuns/:shixunId/repository/:shixunId/" component={TPMRepositoryComponent}></Route> */} {/* <Route exact path="/shixuns/:shixunId/repository/:shixunId/" component={TPMRepositoryComponent}></Route> */}
<Route path="/shixuns/:shixunId/shixun_discuss" render={ <Route path="/shixuns/:shixunId/shixun_discuss" render={
(props) => (<TPMShixunDiscussContainer {...this.props} {...this.state} {...props} (props) => (<TPMShixunDiscussContainer {...this.props} {...this.state} {...props}
initForumState={(data)=>this.initForumState(data)} initForumState={(data)=>this.initForumState(data)}
setSearchValue={this.setSearchValue} setSearchValue={this.setSearchValue}
setHotLabelIndex={this.setHotLabelIndex} setHotLabelIndex={this.setHotLabelIndex}
/>) />)
}></Route> }></Route>
<Route path="/shixuns/:shixunId/settings" render={ <Route path="/shixuns/:shixunId/settings" render={
(props) => (<TPMsettings {...this.props} {...this.state} {...props} />) (props) => (<TPMsettings {...this.props} {...this.state} {...props} />)
}></Route> }></Route>
<Route exact path="/shixuns/:shixunId/ranking_list" render={ <Route exact path="/shixuns/:shixunId/ranking_list" render={
(props) => (<TPMRanking_listComponent {...this.props} {...this.state} {...props} (props) => (<TPMRanking_listComponent {...this.props} {...this.state} {...props}
/>) />)
}></Route> }></Route>
<Route exact path="/shixuns/:shixunId/fork_list" render={ <Route exact path="/shixuns/:shixunId/fork_list" render={
(props) => (<TPMFork_listComponent {...this.props} {...props} (props) => (<TPMFork_listComponent {...this.props} {...props}
/>) />)
}></Route> }></Route>
<Route exact path="/shixuns/:shixunId/update_propaedeutics" render={ <Route exact path="/shixuns/:shixunId/update_propaedeutics" render={
(props) => (<TPMUpdatepropaede {...this.props} {...props} (props) => (<TPMUpdatepropaede {...this.props} {...props}
/>) />)
}></Route> }></Route>
{/*评测设置*/} {/*评测设置*/}
<Route path="/shixuns/:shixunId/challenges/:checkpointId/tab=2" render={ <Route path="/shixuns/:shixunId/challenges/:checkpointId/tab=2" render={
(props) => (<TPMevaluation {...this.props} {...props} {...this.state}/>) (props) => (<TPMevaluation {...this.props} {...props} {...this.state}/>)
}></Route> }></Route>
{/*参考答案*/} {/*参考答案*/}
<Route path="/shixuns/:shixunId/challenges/:checkpointId/tab=3" render={ <Route path="/shixuns/:shixunId/challenges/:checkpointId/tab=3" render={
(props) => (<TPManswer {...this.props} {...props} {...this.state}/>) (props) => (<TPManswer {...this.props} {...props} {...this.state}/>)
}></Route> }></Route>
{/*新建关卡*/} {/*新建关卡*/}
<Route path="/shixuns/:shixunId/challenges/new" render={ <Route path="/shixuns/:shixunId/challenges/new" render={
(props) => (<TPMchallengesnew {...this.props} {...props} {...this.state}/>) (props) => (<TPMchallengesnew {...this.props} {...props} {...this.state}/>)
}></Route> }></Route>
{/*编辑关卡*/} {/*编辑关卡*/}
<Route path="/shixuns/:shixunId/challenges/:checkpointId/editcheckpoint" render={ <Route path="/shixuns/:shixunId/challenges/:checkpointId/editcheckpoint" render={
(props) => (<TPMchallengesnew {...this.props} {...props} {...this.state} />) (props) => (<TPMchallengesnew {...this.props} {...props} {...this.state} />)
}></Route> }></Route>
{/*新建选择题*/} {/*新建选择题*/}
<Route path="/shixuns/:shixunId/challenges/newquestion" render={ <Route path="/shixuns/:shixunId/challenges/newquestion" render={
(props) => (<TPMquestion {...this.props} {...props} {...this.state} />) (props) => (<TPMquestion {...this.props} {...props} {...this.state} />)
}></Route> }></Route>
{/*修改选择题*/} {/*修改选择题*/}
<Route path="/shixuns/:shixunId/challenges/:checkpointId/editquestion/:choose_id" render={ <Route path="/shixuns/:shixunId/challenges/:checkpointId/editquestion/:choose_id" render={
(props) => (<TPMquestion {...this.props} {...props} {...this.state}/>) (props) => (<TPMquestion {...this.props} {...props} {...this.state}/>)
}></Route> }></Route>
{/*修改选择题*/} {/*修改选择题*/}
<Route path="/shixuns/:shixunId/challenges/:checkpointId/editquestion" render={ <Route path="/shixuns/:shixunId/challenges/:checkpointId/editquestion" render={
(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>*/}
</Switch> </Switch>
</div> </div>
); );
} }
} }
export default SnackbarHOC() (TPMIndexHOC ( TPMIndex )); export default SnackbarHOC() (TPMIndexHOC ( TPMIndex ));

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

@ -1,366 +1,366 @@
import React, {Component} from 'react'; import React, {Component} from 'react';
import {Input, Select, Radio, Checkbox, Popconfirm, message, Modal} from 'antd'; import {Input, Select, Radio, Checkbox, Popconfirm, message, Modal} from 'antd';
import {BrowserRouter as Router, Route, Link, Switch} from "react-router-dom"; import {BrowserRouter as Router, Route, Link, Switch} from "react-router-dom";
// import "antd/dist/antd.css"; // import "antd/dist/antd.css";
import { getImageUrl, toPath, getUrl } from 'educoder'; import { getImageUrl, toPath, getUrl } from 'educoder';
import axios from 'axios'; import axios from 'axios';
import './css/TPMchallengesnew.css'; import './css/TPMchallengesnew.css';
let origin = getUrl(); let origin = getUrl();
let path = getUrl("/editormd/lib/") let path = getUrl("/editormd/lib/")
const $ = window.$; const $ = window.$;
let timeout; let timeout;
let currentValue; let currentValue;
const Option = Select.Option; const Option = Select.Option;
const RadioGroup = Radio.Group; const RadioGroup = Radio.Group;
// 恢复数据 // 恢复数据
function md_rec_data(k,mdu,id, editor){ function md_rec_data(k,mdu,id, editor){
if(window.sessionStorage.getItem(k+mdu) !== null){ if(window.sessionStorage.getItem(k+mdu) !== null){
editor.setValue(window.sessionStorage.getItem(k+mdu)); editor.setValue(window.sessionStorage.getItem(k+mdu));
md_clear_data(k,mdu,id); md_clear_data(k,mdu,id);
} }
} }
// 保存数据 // 保存数据
function md_add_data(k,mdu,d){ function md_add_data(k,mdu,d){
window.sessionStorage.setItem(k+mdu,d); window.sessionStorage.setItem(k+mdu,d);
} }
// 清空保存的数据 // 清空保存的数据
function md_clear_data(k,mdu,id){ function md_clear_data(k,mdu,id){
window.sessionStorage.removeItem(k+mdu); window.sessionStorage.removeItem(k+mdu);
var id1 = "#e_tip_"+id; var id1 = "#e_tip_"+id;
var id2 = "#e_tips_"+id; var id2 = "#e_tips_"+id;
if(k == 'content'){ if(k == 'content'){
$(id2).html(""); $(id2).html("");
}else{ }else{
$(id1).html(""); $(id1).html("");
} }
} }
function md_elocalStorage(editor,mdu,id){ function md_elocalStorage(editor,mdu,id){
if (window.sessionStorage){ if (window.sessionStorage){
var oc = window.sessionStorage.getItem('content'+mdu); var oc = window.sessionStorage.getItem('content'+mdu);
if(oc !== null ){ if(oc !== null ){
console.log("#e_tips_"+id) console.log("#e_tips_"+id)
$("#e_tips_"+id).data('editor', editor); $("#e_tips_"+id).data('editor', editor);
var h = '您上次有已保存的数据,是否<a style="cursor: pointer;" class="link-color-blue" onclick="md_rec_data(\'content\',\''+ mdu + '\',\'' + id + '\')">恢复</a> ? / <a style="cursor: pointer;" class="link-color-blue" onclick="md_clear_data(\'content\',\''+ mdu + '\',\'' + id + '\')">不恢复</a>'; var h = '您上次有已保存的数据,是否<a style="cursor: pointer;" class="link-color-blue" onclick="md_rec_data(\'content\',\''+ mdu + '\',\'' + id + '\')">恢复</a> ? / <a style="cursor: pointer;" class="link-color-blue" onclick="md_clear_data(\'content\',\''+ mdu + '\',\'' + id + '\')">不恢复</a>';
$("#e_tips_"+id).html(h); $("#e_tips_"+id).html(h);
} }
setInterval(function() { setInterval(function() {
var d = new Date(); var d = new Date();
var h = d.getHours(); var h = d.getHours();
var m = d.getMinutes(); var m = d.getMinutes();
var s = d.getSeconds(); var s = d.getSeconds();
h = h < 10 ? '0' + h : h; h = h < 10 ? '0' + h : h;
m = m < 10 ? '0' + m : m; m = m < 10 ? '0' + m : m;
s = s < 10 ? '0' + s : s; s = s < 10 ? '0' + s : s;
if(editor.getValue().trim() != ""){ if(editor.getValue().trim() != ""){
md_add_data("content",mdu,editor.getValue()); md_add_data("content",mdu,editor.getValue());
var id1 = "#e_tip_"+id; var id1 = "#e_tip_"+id;
var id2 = "#e_tips_"+id; var id2 = "#e_tips_"+id;
$(id1).html(" 数据已于 " + h + ':' + m + ':' + s +" 保存 "); $(id1).html(" 数据已于 " + h + ':' + m + ':' + s +" 保存 ");
$(id2).html(""); $(id2).html("");
} }
},10000); },10000);
}else{ }else{
$("#e_tip_"+id).after('您的浏览器不支持localStorage.无法开启自动保存草稿服务,请升级浏览器!'); $("#e_tip_"+id).after('您的浏览器不支持localStorage.无法开启自动保存草稿服务,请升级浏览器!');
} }
} }
function create_editorMD(id, width, high, placeholder, imageUrl, callback) { function create_editorMD(id, width, high, placeholder, imageUrl, callback) {
var editorName = window.editormd(id, { var editorName = window.editormd(id, {
width: width, width: width,
height: high, height: high,
path: path, // "/editormd/lib/" path: path, // "/editormd/lib/"
syncScrolling: "single", syncScrolling: "single",
tex: true, tex: true,
tocm: true, tocm: true,
emoji: true, emoji: true,
taskList: true, taskList: true,
codeFold: true, codeFold: true,
searchReplace: true, searchReplace: true,
htmlDecode: "style,script,iframe", htmlDecode: "style,script,iframe",
sequenceDiagram: true, sequenceDiagram: true,
autoFocus: false, autoFocus: false,
toolbarIcons: function () { toolbarIcons: function () {
// Or return editormd.toolbarModes[name]; // full, simple, mini // Or return editormd.toolbarModes[name]; // full, simple, mini
// Using "||" set icons align right. // Using "||" set icons align right.
return ["bold", "italic", "|", "list-ul", "list-ol", "|", "code", "code-block", "|", "testIcon", "testIcon1", '|', "image", "table", '|', "watch", "clear"] return ["bold", "italic", "|", "list-ul", "list-ol", "|", "code", "code-block", "|", "testIcon", "testIcon1", '|', "image", "table", '|', "watch", "clear"]
}, },
toolbarCustomIcons: { toolbarCustomIcons: {
testIcon: "<a type=\"inline\" class=\"latex\" ><div class='zbg'></div></a>", testIcon: "<a type=\"inline\" class=\"latex\" ><div class='zbg'></div></a>",
testIcon1: "<a type=\"latex\" class=\"latex\" ><div class='zbg_latex'></div></a>" testIcon1: "<a type=\"latex\" class=\"latex\" ><div class='zbg_latex'></div></a>"
}, },
//这个配置在simple.html中并没有但是为了能够提交表单使用这个配置可以让构造出来的HTML代码直接在第二个隐藏的textarea域中方便post提交表单。 //这个配置在simple.html中并没有但是为了能够提交表单使用这个配置可以让构造出来的HTML代码直接在第二个隐藏的textarea域中方便post提交表单。
saveHTMLToTextarea: true, saveHTMLToTextarea: true,
// 用于增加自定义工具栏的功能可以直接插入HTML标签不使用默认的元素创建图标 // 用于增加自定义工具栏的功能可以直接插入HTML标签不使用默认的元素创建图标
dialogMaskOpacity: 0.6, dialogMaskOpacity: 0.6,
placeholder: placeholder, placeholder: placeholder,
imageUpload: true, imageUpload: true,
imageFormats: ["jpg", "jpeg", "gif", "png", "bmp", "webp", "JPG", "JPEG", "GIF", "PNG", "BMP", "WEBP"], imageFormats: ["jpg", "jpeg", "gif", "png", "bmp", "webp", "JPG", "JPEG", "GIF", "PNG", "BMP", "WEBP"],
imageUploadURL: imageUrl,//url imageUploadURL: imageUrl,//url
onload: function () { onload: function () {
// this.previewing(); // this.previewing();
$("#" + id + " [type=\"latex\"]").bind("click", function () { $("#" + id + " [type=\"latex\"]").bind("click", function () {
editorName.cm.replaceSelection("```latex"); editorName.cm.replaceSelection("```latex");
editorName.cm.replaceSelection("\n"); editorName.cm.replaceSelection("\n");
editorName.cm.replaceSelection("\n"); editorName.cm.replaceSelection("\n");
editorName.cm.replaceSelection("```"); editorName.cm.replaceSelection("```");
var __Cursor = editorName.cm.getDoc().getCursor(); var __Cursor = editorName.cm.getDoc().getCursor();
editorName.cm.setCursor(__Cursor.line - 1, 0); editorName.cm.setCursor(__Cursor.line - 1, 0);
}); });
$("#" + id + " [type=\"inline\"]").bind("click", function () { $("#" + id + " [type=\"inline\"]").bind("click", function () {
editorName.cm.replaceSelection("$$$$"); editorName.cm.replaceSelection("$$$$");
var __Cursor = editorName.cm.getDoc().getCursor(); var __Cursor = editorName.cm.getDoc().getCursor();
editorName.cm.setCursor(__Cursor.line, __Cursor.ch - 2); editorName.cm.setCursor(__Cursor.line, __Cursor.ch - 2);
editorName.cm.focus(); editorName.cm.focus();
}); });
$("[type=\"inline\"]").attr("title", "行内公式"); $("[type=\"inline\"]").attr("title", "行内公式");
$("[type=\"latex\"]").attr("title", "多行公式"); $("[type=\"latex\"]").attr("title", "多行公式");
md_elocalStorage(editorName, `answers__${id}`, "Memoanswers"); md_elocalStorage(editorName, `answers__${id}`, "Memoanswers");
callback && callback() callback && callback()
} }
}); });
return editorName; return editorName;
} }
export default class TPManswer extends Component { export default class TPManswer extends Component {
constructor(props) { constructor(props) {
super(props) super(props)
this.state = { this.state = {
choice_url: undefined, choice_url: undefined,
practice_url: undefined, practice_url: undefined,
go_back_url: undefined, go_back_url: undefined,
value: 1, value: 1,
answer:"", answer:"",
id:undefined, id:undefined,
checkpointId:undefined, checkpointId:undefined,
power: false, power: false,
prev_challenge: undefined, prev_challenge: undefined,
next_challenge: undefined, next_challenge: undefined,
} }
} }
answerMD(initValue, id) { answerMD(initValue, id) {
this.contentChanged = false; this.contentChanged = false;
const placeholder = ""; const placeholder = "";
// amp; // amp;
// 编辑时要传memoId // 编辑时要传memoId
const imageUrl = `/api/attachments.json`; const imageUrl = `/api/attachments.json`;
// 创建editorMd // 创建editorMd
const answers_editormd = create_editorMD(id, '100%', 400, placeholder, imageUrl, () => { const answers_editormd = create_editorMD(id, '100%', 400, placeholder, imageUrl, () => {
setTimeout(() => { setTimeout(() => {
answers_editormd.resize() answers_editormd.resize()
answers_editormd.cm && answers_editormd.cm.refresh() answers_editormd.cm && answers_editormd.cm.refresh()
}, 500) }, 500)
if (initValue != undefined) { if (initValue != undefined) {
answers_editormd.setValue(initValue) answers_editormd.setValue(initValue)
} }
answers_editormd.cm.on("change", (_cm, changeObj) => { answers_editormd.cm.on("change", (_cm, changeObj) => {
console.log('....contentChanged') console.log('....contentChanged')
this.contentChanged = true; this.contentChanged = true;
}) })
}); });
this.answers_editormd = answers_editormd; this.answers_editormd = answers_editormd;
window.answers_editormd = answers_editormd; window.answers_editormd = answers_editormd;
} }
componentDidMount() { componentDidMount() {
let id = this.props.match.params.shixunId; let id = this.props.match.params.shixunId;
let checkpointId=this.props.match.params.checkpointId; let checkpointId=this.props.match.params.checkpointId;
let newchoice_url= "/shixuns/"+id+"/challenges/newquestion"; let newchoice_url= "/shixuns/"+id+"/challenges/newquestion";
let newpractice_url= "/shixuns/"+id+"/challenges/new"; let newpractice_url= "/shixuns/"+id+"/challenges/new";
let newgo_back_url="/shixuns/"+id+"/challenges"; let newgo_back_url="/shixuns/"+id+"/challenges";
this.setState({ this.setState({
shixunId:id, shixunId:id,
checkpointId:checkpointId checkpointId:checkpointId
}) })
let url = "/shixuns/" + id + "/challenges/" + checkpointId + "/edit.json?tab=2"; let url = "/shixuns/" + id + "/challenges/" + checkpointId + "/edit.json?tab=2";
axios.get(url).then((response) => { axios.get(url).then((response) => {
let newprev_challenge = response.data.prev_challenge; let newprev_challenge = response.data.prev_challenge;
let next_challenge = response.data.next_challenge; let next_challenge = response.data.next_challenge;
if (newprev_challenge != undefined) { if (newprev_challenge != undefined) {
if(newprev_challenge.st===0){ if(newprev_challenge.st===0){
newprev_challenge = "/shixuns/" + id + "/challenges/" + newprev_challenge.id + "/editcheckpoint"; newprev_challenge = "/shixuns/" + id + "/challenges/" + newprev_challenge.id + "/editcheckpoint";
}else{ }else{
newprev_challenge = "/shixuns/" + id + "/challenges/" + newprev_challenge.id + "/editquestion"; newprev_challenge = "/shixuns/" + id + "/challenges/" + newprev_challenge.id + "/editquestion";
} }
} }
if (next_challenge != undefined) { if (next_challenge != undefined) {
if(next_challenge.st===0){ if(next_challenge.st===0){
next_challenge = "/shixuns/" + id + "/challenges/" + next_challenge.id+ "/editcheckpoint"; next_challenge = "/shixuns/" + id + "/challenges/" + next_challenge.id+ "/editcheckpoint";
}else{ }else{
next_challenge = "/shixuns/" + id + "/challenges/" + next_challenge.id+ "/editquestion"; next_challenge = "/shixuns/" + id + "/challenges/" + next_challenge.id+ "/editquestion";
} }
} }
this.setState({ this.setState({
answer:response.data.answer, answer:response.data.answer,
power: response.data.power, power: response.data.power,
choice_url: newchoice_url, // 导航中的新建选择题url choice_url: newchoice_url, // 导航中的新建选择题url
practice_url: newpractice_url, //string 导航中新建实践题url practice_url: newpractice_url, //string 导航中新建实践题url
go_back_url: newgo_back_url, //string 导航中的返回url go_back_url: newgo_back_url, //string 导航中的返回url
position: response.data.position, //int 关卡位置,导航栏中的第几关 position: response.data.position, //int 关卡位置,导航栏中的第几关
prev_challenge: newprev_challenge, prev_challenge: newprev_challenge,
next_challenge: next_challenge, next_challenge: next_challenge,
}) })
if(response.data.power===false){ if(response.data.power===false){
this.props.showSnackbar("没有权限修改"); this.props.showSnackbar("没有权限修改");
} }
if(response.data.answer===undefined||response.data.answer===null){ if(response.data.answer===undefined||response.data.answer===null){
this.answerMD("", "answerMD"); this.answerMD("", "answerMD");
}else{ }else{
this.answerMD(response.data.answer, "answerMD"); this.answerMD(response.data.answer, "answerMD");
} }
}).catch((error) => { }).catch((error) => {
console.log(error) console.log(error)
}); });
} }
challenge_answer_submit=()=> { challenge_answer_submit=()=> {
let id = this.props.match.params.shixunId; let id = this.props.match.params.shixunId;
let{checkpointId}=this.state; let{checkpointId}=this.state;
let url = "/shixuns/"+id+"/challenges/"+checkpointId+".json"; let url = "/shixuns/"+id+"/challenges/"+checkpointId+".json";
const answer_editormdvalue = this.answers_editormd.getValue(); const answer_editormdvalue = this.answers_editormd.getValue();
axios.put(url,{ axios.put(url,{
tab:2, tab:2,
identifier:id, identifier:id,
id:checkpointId, id:checkpointId,
challenge:{ challenge:{
answer:answer_editormdvalue answer:answer_editormdvalue
} }
} }
).then((response) => { ).then((response) => {
this.props.showSnackbar(response.data.messages); this.props.showSnackbar(response.data.messages);
}).catch((error) => { }).catch((error) => {
console.log(error) console.log(error)
}); });
} }
render() { render() {
let { let {
choice_url, choice_url,
practice_url, practice_url,
go_back_url, go_back_url,
position, position,
task_pass_default, task_pass_default,
submit_url, submit_url,
shixunId, shixunId,
checkpointId, checkpointId,
power, power,
prev_challenge, prev_challenge,
next_challenge, next_challenge,
} = this.state; } = this.state;
let tab1url="/shixuns/" + shixunId + "/challenges/"+checkpointId+"/editcheckpoint"; let tab1url="/shixuns/" + shixunId + "/challenges/"+checkpointId+"/editcheckpoint";
let tab2url="/shixuns/" + shixunId + "/challenges/"+checkpointId+"/tab=2"; let tab2url="/shixuns/" + shixunId + "/challenges/"+checkpointId+"/tab=2";
let tab3url="/shixuns/" + shixunId + "/challenges/"+checkpointId+"/tab=3"; let tab3url="/shixuns/" + shixunId + "/challenges/"+checkpointId+"/tab=3";
// console.log(this.props) // console.log(this.props)
return ( return (
<React.Fragment> <React.Fragment>
<div className="educontent mt30 mb30"> <div className="educontent mt30 mb30">
<div className="padding10-20 mb10 edu-back-white clearfix"> <div className="padding10-20 mb10 edu-back-white clearfix">
<span className="fl ring-blue mr10 mt7"> <span className="fl ring-blue mr10 mt7">
<img src={getImageUrl("images/educoder/icon/code.svg")} data-tip-down="实训任务" className="fl mt2 ml2"/> <img src={getImageUrl("images/educoder/icon/code.svg")} data-tip-down="实训任务" className="fl mt2 ml2"/>
</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}
className="fr color-blue mr15 mt4" className="fr color-blue mr15 mt4"
style={{display:this.props.status===2||this.props.status===1?'none':'block'}} style={{display:this.props.status===2||this.props.status===1?'none':'block'}}
data-tip-down="新增代码编辑类型的任务">+&nbsp;实践类型</Link> data-tip-down="新增代码编辑类型的任务">+&nbsp;实践类型</Link>
<Link to={choice_url === undefined ? "" : choice_url} <Link to={choice_url === undefined ? "" : choice_url}
className="fr color-blue mr15 mt4" className="fr color-blue mr15 mt4"
style={{display:this.props.status===2||this.props.status===1?'none':'block'}} style={{display:this.props.status===2||this.props.status===1?'none':'block'}}
data-tip-down="新增选择题类型的任务">+&nbsp;选择题类型</Link> data-tip-down="新增选择题类型的任务">+&nbsp;选择题类型</Link>
</div> </div>
<div className="challenge_nav clearfix edu-back-white"> <div className="challenge_nav clearfix edu-back-white">
<li> <li>
<Link to={tab1url}>本关任务</Link> <Link to={tab1url}>本关任务</Link>
</li> </li>
<li > <li >
<Link to={tab2url}>评测设置</Link> <Link to={tab2url}>评测设置</Link>
</li> </li>
<li className="active"> <li className="active">
<Link to={tab3url}>参考答案</Link> <Link to={tab3url}>参考答案</Link>
</li> </li>
</div> </div>
<div className="edu-back-white mb10 clearfix"> <div className="edu-back-white mb10 clearfix">
<div className="padding40-20"> <div className="padding40-20">
<p className="color-grey-6 font-16 mb30">参考答案</p> <p className="color-grey-6 font-16 mb30">参考答案</p>
<div className="df"> <div className="df">
<div className="padding10-20 edu-back-greyf5 radius4" id="answerMD"> <div className="padding10-20 edu-back-greyf5 radius4" id="answerMD">
<textarea style={{display: 'none'}} id="evaluate_script_show" name="content"> </textarea> <textarea style={{display: 'none'}} id="evaluate_script_show" name="content"> </textarea>
<div className="CodeMirror cm-s-defualt"> <div className="CodeMirror cm-s-defualt">
</div> </div>
</div> </div>
</div> </div>
<p id="e_tip_Memoanswers" className="edu-txt-right color-grey-cd font-12"></p> <p id="e_tip_Memoanswers" className="edu-txt-right color-grey-cd font-12"></p>
<p id="e_tips_Memoanswers" className="edu-txt-right color-grey-cd font-12"></p> <p id="e_tips_Memoanswers" className="edu-txt-right color-grey-cd font-12"></p>
</div> </div>
</div> </div>
<div className="clearfix mt20" style={{display:this.props.identity>3||this.props.identity===undefined||power===false?"none":"block"}}> <div className="clearfix mt20" style={{display:this.props.identity>3||this.props.identity===undefined||power===false?"none":"block"}}>
<a className="defalutSubmitbtn fl mr20" <a className="defalutSubmitbtn fl mr20"
onClick={this.challenge_answer_submit}>提交</a> onClick={this.challenge_answer_submit}>提交</a>
<a href={"/shixuns/" + shixunId + "/challenges"} className="defalutCancelbtn fl">取消</a> <a href={"/shixuns/" + shixunId + "/challenges"} className="defalutCancelbtn fl">取消</a>
</div> </div>
</div> </div>
</React.Fragment> </React.Fragment>
) )
} }
} }

@ -1,345 +1,345 @@
import React, {Component} from 'react'; import React, {Component} from 'react';
import {Input, InputNumber, Select, Radio, Checkbox, Popconfirm, message, Modal} from 'antd'; import {Input, InputNumber, Select, Radio, Checkbox, Popconfirm, message, Modal} from 'antd';
import {BrowserRouter as Router, Route, Link, Switch} from "react-router-dom"; import {BrowserRouter as Router, Route, Link, Switch} from "react-router-dom";
// import "antd/dist/antd.css"; // import "antd/dist/antd.css";
import { getImageUrl, toPath, getUrl } from 'educoder'; import { getImageUrl, toPath, getUrl } from 'educoder';
import axios from 'axios'; import axios from 'axios';
import './css/TPMchallengesnew.css'; import './css/TPMchallengesnew.css';
import TPMMDEditor from './TPMMDEditor'; import TPMMDEditor from './TPMMDEditor';
let origin = getUrl(); let origin = getUrl();
let path = getUrl("/editormd/lib/") let path = getUrl("/editormd/lib/")
const $ = window.$; const $ = window.$;
let timeout; let timeout;
let currentValue; let currentValue;
const Option = Select.Option; const Option = Select.Option;
const RadioGroup = Radio.Group; const RadioGroup = Radio.Group;
// const testAnswers = [{ // const testAnswers = [{
// "id": 4337, // "id": 4337,
// "name": "解题思路1", // "name": "解题思路1",
// "contents": "答案的解题思路1", // "contents": "答案的解题思路1",
// "level": 1, // "level": 1,
// "score": 25 // "score": 25
// }, // },
// { // {
// "id": 4338, // "id": 4338,
// "name": "解题思路2", // "name": "解题思路2",
// "contents": "答案的解题思路2", // "contents": "答案的解题思路2",
// "level": 2, // "level": 2,
// "score": 25 // "score": 25
// }] // }]
export default class TPManswer extends Component { export default class TPManswer extends Component {
constructor(props) { constructor(props) {
super(props) super(props)
this.state = { this.state = {
choice_url: undefined, choice_url: undefined,
practice_url: undefined, practice_url: undefined,
go_back_url: undefined, go_back_url: undefined,
value: 1, value: 1,
answer:"", answer:"",
id:undefined, id:undefined,
checkpointId:undefined, checkpointId:undefined,
power: false, power: false,
prev_challenge: undefined, prev_challenge: undefined,
next_challenge: undefined, next_challenge: undefined,
answers: [] //testAnswers answers: [] //testAnswers
} }
} }
componentDidMount() { componentDidMount() {
let id = this.props.match.params.shixunId; let id = this.props.match.params.shixunId;
let checkpointId=this.props.match.params.checkpointId; let checkpointId=this.props.match.params.checkpointId;
let newchoice_url= "/shixuns/"+id+"/challenges/newquestion"; let newchoice_url= "/shixuns/"+id+"/challenges/newquestion";
let newpractice_url= "/shixuns/"+id+"/challenges/new"; let newpractice_url= "/shixuns/"+id+"/challenges/new";
let newgo_back_url="/shixuns/"+id+"/challenges"; let newgo_back_url="/shixuns/"+id+"/challenges";
this.setState({ this.setState({
shixunId:id, shixunId:id,
checkpointId:checkpointId checkpointId:checkpointId
}) })
let url = "/shixuns/" + id + "/challenges/" + checkpointId + "/edit.json?tab=2"; let url = "/shixuns/" + id + "/challenges/" + checkpointId + "/edit.json?tab=2";
axios.get(url).then((response) => { axios.get(url).then((response) => {
let newprev_challenge = response.data.prev_challenge; let newprev_challenge = response.data.prev_challenge;
let next_challenge = response.data.next_challenge; let next_challenge = response.data.next_challenge;
if (newprev_challenge != undefined) { if (newprev_challenge != undefined) {
if(newprev_challenge.st===0){ if(newprev_challenge.st===0){
newprev_challenge = "/shixuns/" + id + "/challenges/" + newprev_challenge.id + "/editcheckpoint"; newprev_challenge = "/shixuns/" + id + "/challenges/" + newprev_challenge.id + "/editcheckpoint";
}else{ }else{
newprev_challenge = "/shixuns/" + id + "/challenges/" + newprev_challenge.id + "/editquestion"; newprev_challenge = "/shixuns/" + id + "/challenges/" + newprev_challenge.id + "/editquestion";
} }
} }
if (next_challenge != undefined) { if (next_challenge != undefined) {
if(next_challenge.st===0){ if(next_challenge.st===0){
next_challenge = "/shixuns/" + id + "/challenges/" + next_challenge.id+ "/editcheckpoint"; next_challenge = "/shixuns/" + id + "/challenges/" + next_challenge.id+ "/editcheckpoint";
}else{ }else{
next_challenge = "/shixuns/" + id + "/challenges/" + next_challenge.id+ "/editquestion"; next_challenge = "/shixuns/" + id + "/challenges/" + next_challenge.id+ "/editquestion";
} }
} }
this.setState({ this.setState({
answer:response.data.answer, answer:response.data.answer,
power: response.data.power, power: response.data.power,
choice_url: newchoice_url, // 导航中的新建选择题url choice_url: newchoice_url, // 导航中的新建选择题url
practice_url: newpractice_url, //string 导航中新建实践题url practice_url: newpractice_url, //string 导航中新建实践题url
go_back_url: newgo_back_url, //string 导航中的返回url go_back_url: newgo_back_url, //string 导航中的返回url
position: response.data.position, //int 关卡位置,导航栏中的第几关 position: response.data.position, //int 关卡位置,导航栏中的第几关
prev_challenge: newprev_challenge, prev_challenge: newprev_challenge,
next_challenge: next_challenge, next_challenge: next_challenge,
}) })
if(response.data.power===false){ if(response.data.power===false){
this.props.showSnackbar("没有权限修改"); this.props.showSnackbar("没有权限修改");
} }
// if(response.data.answer===undefined||response.data.answer===null){ // if(response.data.answer===undefined||response.data.answer===null){
// this.answerMD("", "answerMD"); // this.answerMD("", "answerMD");
// }else{ // }else{
// this.answerMD(response.data.answer, "answerMD"); // this.answerMD(response.data.answer, "answerMD");
// } // }
}).catch((error) => { }).catch((error) => {
console.log(error) console.log(error)
}); });
let urlAnswer = `/shixuns/${id}/challenges/${checkpointId}/answer.json`; let urlAnswer = `/shixuns/${id}/challenges/${checkpointId}/answer.json`;
axios.get(urlAnswer).then((response) => { axios.get(urlAnswer).then((response) => {
if (response.data) { if (response.data) {
this.setState({ answers: response.data }) this.setState({ answers: response.data })
} }
}) })
} }
challenge_answer_submit=()=> { challenge_answer_submit=()=> {
// `levelSection${index}` // `levelSection${index}`
// this.refs.md0 // this.refs.md0
const { answers } = this.state; const { answers } = this.state;
const answersParams = answers.slice(0) const answersParams = answers.slice(0)
console.log(answersParams) console.log(answersParams)
let isValidate = true; let isValidate = true;
let totalScore = 0; let totalScore = 0;
answersParams.forEach( (item, index) => { answersParams.forEach( (item, index) => {
if (!isValidate) { if (!isValidate) {
return; return;
} }
const sectionId = `#levelSection${index}`; const sectionId = `#levelSection${index}`;
const mdContnet = this.refs[`md${index}`].getValue().trim();; const mdContnet = this.refs[`md${index}`].getValue().trim();;
item.contents = mdContnet; item.contents = mdContnet;
item.name = item.name.trim() item.name = item.name.trim()
totalScore += item.score; totalScore += item.score;
delete item.id; delete item.id;
if (!item.name) { if (!item.name) {
this.props.showSnackbar("请先填写参考答案名称"); this.props.showSnackbar("请先填写参考答案名称");
isValidate = false; isValidate = false;
} else if (!mdContnet) { } else if (!mdContnet) {
this.props.showSnackbar("请先填写参考答案内容"); this.props.showSnackbar("请先填写参考答案内容");
isValidate = false; isValidate = false;
} }
if (!isValidate) { if (!isValidate) {
$("html, body").animate({ scrollTop: $(`${sectionId}`).offset().top - 100}) $("html, body").animate({ scrollTop: $(`${sectionId}`).offset().top - 100})
} }
}) })
if (!isValidate) { if (!isValidate) {
return; return;
} }
if (totalScore != 100) { if (totalScore != 100) {
this.props.showSnackbar("请先保证占比和为100%"); this.props.showSnackbar("请先保证占比和为100%");
return; return;
} }
let id = this.props.match.params.shixunId; let id = this.props.match.params.shixunId;
let {checkpointId} = this.state; let {checkpointId} = this.state;
let url = `/shixuns/${id}/challenges/${checkpointId}/crud_answer.json`; let url = `/shixuns/${id}/challenges/${checkpointId}/crud_answer.json`;
axios.post(url,{ axios.post(url,{
challenge_answer: answersParams challenge_answer: answersParams
} }
).then((response) => { ).then((response) => {
if (response.data) { if (response.data) {
if (response.data.message) { if (response.data.message) {
this.props.showSnackbar(response.data.message); this.props.showSnackbar(response.data.message);
} }
} }
}).catch((error) => { }).catch((error) => {
console.log(error) console.log(error)
}); });
} }
onNameChange = (e, index) => { onNameChange = (e, index) => {
const newAnswer = Object.assign({}, this.state.answers[index]) const newAnswer = Object.assign({}, this.state.answers[index])
newAnswer.name = e.target.value newAnswer.name = e.target.value
const newAnswers = this.state.answers.slice(0) const newAnswers = this.state.answers.slice(0)
newAnswers[index] = newAnswer newAnswers[index] = newAnswer
this.setState({ answers: newAnswers}) this.setState({ answers: newAnswers})
} }
onScoreChange = (val, index) => { onScoreChange = (val, index) => {
const newAnswer = Object.assign({}, this.state.answers[index]) const newAnswer = Object.assign({}, this.state.answers[index])
newAnswer.score = val newAnswer.score = val
const newAnswers = this.state.answers.slice(0) const newAnswers = this.state.answers.slice(0)
newAnswers[index] = newAnswer newAnswers[index] = newAnswer
this.setState({ answers: newAnswers}) this.setState({ answers: newAnswers})
} }
addAnswer = () => { addAnswer = () => {
const newAnswers = this.state.answers.slice(0) const newAnswers = this.state.answers.slice(0)
newAnswers.push({ newAnswers.push({
"name": `解题思路${newAnswers.length + 1}`, "name": `解题思路${newAnswers.length + 1}`,
"contents": "", "contents": "",
"score": 10 "score": 10
}) })
this.setState({ answers: newAnswers }) this.setState({ answers: newAnswers })
} }
delanswers=(index)=>{ delanswers=(index)=>{
let {answers}=this.state; let {answers}=this.state;
let newanswers=answers; let newanswers=answers;
newanswers.splice(index,1) newanswers.splice(index,1)
this.setState({ this.setState({
answers:newanswers answers:newanswers
}) })
} }
render() { render() {
let { let {
choice_url, choice_url,
practice_url, practice_url,
go_back_url, go_back_url,
position, position,
task_pass_default, task_pass_default,
submit_url, submit_url,
shixunId, shixunId,
checkpointId, checkpointId,
power, power,
prev_challenge, prev_challenge,
next_challenge, next_challenge,
answers, answers,
} = this.state; } = this.state;
let tab1url="/shixuns/" + shixunId + "/challenges/"+checkpointId+"/editcheckpoint"; let tab1url="/shixuns/" + shixunId + "/challenges/"+checkpointId+"/editcheckpoint";
let tab2url="/shixuns/" + shixunId + "/challenges/"+checkpointId+"/tab=2"; let tab2url="/shixuns/" + shixunId + "/challenges/"+checkpointId+"/tab=2";
let tab3url="/shixuns/" + shixunId + "/challenges/"+checkpointId+"/tab=3"; let tab3url="/shixuns/" + shixunId + "/challenges/"+checkpointId+"/tab=3";
// console.log(this.props) // console.log(this.props)
return ( return (
<React.Fragment> <React.Fragment>
<div className="educontent mt30 mb30 tpmAnswer"> <div className="educontent mt30 mb30 tpmAnswer">
<div className="padding10-20 mb10 edu-back-white clearfix"> <div className="padding10-20 mb10 edu-back-white clearfix">
<span className="fl ring-blue mr10 mt7"> <span className="fl ring-blue mr10 mt7">
<img src={getImageUrl("images/educoder/icon/code.svg")} data-tip-down="实训任务" className="fl mt2 ml2"/> <img src={getImageUrl("images/educoder/icon/code.svg")} data-tip-down="实训任务" className="fl mt2 ml2"/>
</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}
className="fr color-blue mr15 mt4" className="fr color-blue mr15 mt4"
style={{display:this.props.status===2||this.props.status===1?'none':'block'}} style={{display:this.props.status===2||this.props.status===1?'none':'block'}}
data-tip-down="新增代码编辑类型的任务">+&nbsp;实践类型</Link> data-tip-down="新增代码编辑类型的任务">+&nbsp;实践类型</Link>
<Link to={choice_url === undefined ? "" : choice_url} <Link to={choice_url === undefined ? "" : choice_url}
className="fr color-blue mr15 mt4" className="fr color-blue mr15 mt4"
style={{display:this.props.status===2||this.props.status===1?'none':'block'}} style={{display:this.props.status===2||this.props.status===1?'none':'block'}}
data-tip-down="新增选择题类型的任务">+&nbsp;选择题类型</Link> data-tip-down="新增选择题类型的任务">+&nbsp;选择题类型</Link>
</div> </div>
<div className="challenge_nav clearfix edu-back-white"> <div className="challenge_nav clearfix edu-back-white">
<li> <li>
<Link to={tab1url}>本关任务</Link> <Link to={tab1url}>本关任务</Link>
</li> </li>
<li > <li >
<Link to={tab2url}>评测设置</Link> <Link to={tab2url}>评测设置</Link>
</li> </li>
<li className="active"> <li className="active">
<Link to={tab3url}>参考答案</Link> <Link to={tab3url}>参考答案</Link>
</li> </li>
</div> </div>
<div className="edu-back-white mb10 clearfix"> <div className="edu-back-white mb10 clearfix">
<div className="padding30-20"> <div className="padding30-20">
<p className=" font-12" style={{ paddingBottom: '5px' <p className=" font-12" style={{ paddingBottom: '5px'
, color: '#666666'}}> , color: '#666666'}}>
可以将参考答案分级设置让学员自行选择级别每级查看后按照比例扣分值学员已完成任务再查看则不影响原因已获得的成绩 可以将参考答案分级设置让学员自行选择级别每级查看后按照比例扣分值学员已完成任务再查看则不影响原因已获得的成绩
</p> </p>
<p className=" font-12 " <p className=" font-12 "
style={{ maxWidth: "782px" style={{ maxWidth: "782px"
, color: '#999999'}}> , color: '#999999'}}>
示例级别1扣减分值占比25%级别2扣减分值占比35%级别3扣减分值占比40%则学员选择查看级别1的答案将被扣减25%的分值 示例级别1扣减分值占比25%级别2扣减分值占比35%级别3扣减分值占比40%则学员选择查看级别1的答案将被扣减25%的分值
选择查看级别2的答案将被扣减60%的分值选择查看级别3的答案将被扣减100%的分值 选择查看级别2的答案将被扣减60%的分值选择查看级别3的答案将被扣减100%的分值
</p> </p>
<style>{` <style>{`
.tpmAnswer .ant-input { width: 230px } .tpmAnswer .ant-input { width: 230px }
.tpmAnswer .score.ant-input-number { width: 54px; } .tpmAnswer .score.ant-input-number { width: 54px; }
.levelSection { margin-top: 16px } .levelSection { margin-top: 16px }
`}</style> `}</style>
{ {
answers.map((answer, index) => { answers.map((answer, index) => {
return <div className="levelSection" id={`levelSection${index}`}> return <div className="levelSection" id={`levelSection${index}`}>
<span className="mr4 color-orange pt10">*</span> <span className="mr4 color-orange pt10">*</span>
<p className="color-grey-6 font-16 mb30 mt10" style={{ display: "inline" }}>级别{index + 1}</p> <p className="color-grey-6 font-16 mb30 mt10" style={{ display: "inline" }}>级别{index + 1}</p>
<a className="fr sample_icon_remove mr30 mt8" onClick={()=>this.delanswers(index)}> <a className="fr sample_icon_remove mr30 mt8" onClick={()=>this.delanswers(index)}>
<i className="fa fa-times-circle color-grey-c font-16 fl" ></i> <i className="fa fa-times-circle color-grey-c font-16 fl" ></i>
</a> </a>
<div className=" color-grey-6 font-16" style={{ marginLeft: "9px", margin: '8px 9px'}}> <div className=" color-grey-6 font-16" style={{ marginLeft: "9px", margin: '8px 9px'}}>
<div className=" "> <div className=" ">
<span>名称</span> <span>名称</span>
<Input value={answer.name} onChange={(e) => this.onNameChange(e, index)}></Input> <Input value={answer.name} onChange={(e) => this.onNameChange(e, index)}></Input>
<span style={{ marginLeft: "20px"}} >扣减分值占比</span> <span style={{ marginLeft: "20px"}} >扣减分值占比</span>
<InputNumber className="score" step={1} min={1} max={100} defaultValue={answer.score} <InputNumber className="score" step={1} min={1} max={100} defaultValue={answer.score}
onChange={(e) => this.onScoreChange(e, index)} ></InputNumber>% onChange={(e) => this.onScoreChange(e, index)} ></InputNumber>%
</div> </div>
<div className="mt10"> <div className="mt10">
<span>参考答案</span> <span>参考答案</span>
<TPMMDEditor ref={`md${index}`} mdID={index} initValue={answer.contents}></TPMMDEditor> <TPMMDEditor ref={`md${index}`} mdID={index} initValue={answer.contents}></TPMMDEditor>
</div> </div>
</div> </div>
</div> </div>
}) })
} }
<div className="clearfix mt20" style={{display:this.props.identity>3||this.props.identity===undefined||power===false?"none":"block"}}> <div className="clearfix mt20" style={{display:this.props.identity>3||this.props.identity===undefined||power===false?"none":"block"}}>
<a href={"javascript:void(0)"} className="defalutCancelbtn fl" onClick={this.addAnswer}>新增</a> <a href={"javascript:void(0)"} className="defalutCancelbtn fl" onClick={this.addAnswer}>新增</a>
</div> </div>
</div> </div>
</div> </div>
<div className="clearfix mt20" style={{display:this.props.identity>3||this.props.identity===undefined||power===false?"none":"block"}}> <div className="clearfix mt20" style={{display:this.props.identity>3||this.props.identity===undefined||power===false?"none":"block"}}>
<a className="defalutSubmitbtn fl mr20" <a className="defalutSubmitbtn fl mr20"
onClick={this.challenge_answer_submit}>提交</a> onClick={this.challenge_answer_submit}>提交</a>
<a href={"/shixuns/" + shixunId + "/challenges"} className="defalutCancelbtn fl">取消</a> <a href={"/shixuns/" + shixunId + "/challenges"} className="defalutCancelbtn fl">取消</a>
</div> </div>
</div> </div>
</React.Fragment> </React.Fragment>
) )
} }
} }

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

File diff suppressed because it is too large Load Diff

@ -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.
@ -143,5 +163,7 @@ return;
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
去掉了
marked v0.3.3 去不了去掉后 这句代码会报错window.editormd.markdownToHTML TODO 看能否去掉单独加载marked的地方
*/ */
Loading…
Cancel
Save