Merge branches 'dev_aliyun' and 'dev_aliyun_beta' of https://bdgit.educoder.net/Hjqreturn/educoder into dev_Ysm

dev_aliyun_beta
杨树明 5 years ago
commit 44c7465a1a

@ -31,6 +31,7 @@ module.exports = {
// See the discussion in https://github.com/facebookincubator/create-react-app/issues/343.s // See the discussion in https://github.com/facebookincubator/create-react-app/issues/343.s
// devtool: "cheap-module-eval-source-map", // devtool: "cheap-module-eval-source-map",
// 开启调试 // 开启调试
devtool: "source-map", // 开启调试
// These are the "entry points" to our application. // These are the "entry points" to our application.
// This means they will be the "root" imports that are included in JS bundle. // This means they will be the "root" imports that are included in JS bundle.
// The first two entry points enable "hot" CSS and auto-refreshes for JS. // The first two entry points enable "hot" CSS and auto-refreshes for JS.

@ -195,7 +195,30 @@ function generateNewIndexJsp() {
let cdnHost = 'https://shixun.educoder.net' let cdnHost = 'https://shixun.educoder.net'
cdnHost = 'https://ali-cdn.educoder.net' cdnHost = 'https://ali-cdn.educoder.net'
cdnHost = '' cdnHost = ''
var result = data.replace('/js/js_min_all.js', `${cdnHost}/react/build/js/js_min_all.js?v=${newVersion}`)
var mainRegex = /<script type="text\/javascript" src="\/react\/build\/.\/static\/js\/main.([a-zA-Z0-9]{8,}).js"><\/script>/
var matchResult = data.match(mainRegex)
var code = `
<script>
(function() {
var _host = ''
/*
if (window.location.host == 'pre-newweb.educoder.net') {
_host = 'https://testali-cdn.educoder.net/react/build/'
} else if (window.location.host == 'www.educoder.net') {
_host = 'https://ali-newweb.educoder.net/react/build/'
}*/
document.write('<script type="text/javascript" src="' + _host + 'js/js_min_all.js"><\\/script>');
document.write('<script type="text/javascript" src="' + _host + 'static/js/main.${matchResult[1]}.js"><\\/script>');
})()
</script>
`
var jsMinAllRegex = /<script type="text\/javascript" src="\/js\/js_min_all.js"><\/script>/
// <script type="text/javascript" src="/js/js_min_all.js"></script>
var result = data
.replace(jsMinAllRegex, code)
// .replace('/js/js_min_all.js', `${cdnHost}/react/build/js/js_min_all.js?v=${newVersion}`)
// .replace('/js/js_min_all_2.js', `${cdnHost}/react/build/js/js_min_all_2.js?v=${newVersion}`) // .replace('/js/js_min_all_2.js', `${cdnHost}/react/build/js/js_min_all_2.js?v=${newVersion}`)
// ${cdnHost} 加了cdn后这个文件里的字体文件加载会有跨域的报错 ../fonts/fontawesome-webfont.eot // ${cdnHost} 加了cdn后这个文件里的字体文件加载会有跨域的报错 ../fonts/fontawesome-webfont.eot
@ -204,10 +227,11 @@ function generateNewIndexJsp() {
.replace('/css/iconfont.css', `${cdnHost}/react/build/css/iconfont.css?v=${newVersion}`) .replace('/css/iconfont.css', `${cdnHost}/react/build/css/iconfont.css?v=${newVersion}`)
.replace(/\/js\/create_kindeditor.js/g, `${cdnHost}/react/build/js/create_kindeditor.js?v=${newVersion}`) .replace(/\/js\/create_kindeditor.js/g, `${cdnHost}/react/build/js/create_kindeditor.js?v=${newVersion}`)
.replace(mainRegex, '')
// .replace('/react/build/./static/css/main', `${cdnHost}/react/build/./static/css/main`) // .replace('/react/build/./static/css/main', `${cdnHost}/react/build/./static/css/main`)
// .replace('/react/build/./static/js/main', `${cdnHost}/react/build/./static/js/main`) // .replace('/react/build/./static/js/main', `${cdnHost}/react/build/./static/js/main`)
.replace(/https:\/\/testeduplus2.educoder.net/g, ''); // .replace(/https:\/\/testeduplus2.educoder.net/g, '');
// .replace(/http:\/\/testbdweb.educoder.net/g, ''); // .replace(/http:\/\/testbdweb.educoder.net/g, '');
// .replace('/css/css_min_all.css', '/react/build/css/css_min_all.css'); // .replace('/css/css_min_all.css', '/react/build/css/css_min_all.css');

@ -55,6 +55,10 @@ html, body {
.markdown-body p { .markdown-body p {
white-space: pre-wrap; white-space: pre-wrap;
} }
/* https://www.educoder.net/courses/2346/group_homeworks/34405/question */
.renderAsHtml.markdown-body p {
white-space: inherit;
}
/* resize */ /* resize */
.editormd .CodeMirror { .editormd .CodeMirror {
border-right: none !important; border-right: none !important;

@ -1,4 +1,5 @@
import React, {Component} from 'react'; import React, {Component} from 'react';
import './public-path';
import logo from './logo.svg'; import logo from './logo.svg';
import './App.css'; import './App.css';
import {LocaleProvider} from 'antd' import {LocaleProvider} from 'antd'

@ -9,6 +9,7 @@ export function markdownToHTML(oldContent, selector) {
window.$('#md_div').html('') window.$('#md_div').html('')
// markdown to html // markdown to html
if (selector && oldContent && oldContent.startsWith('<p')) { // 普通html处理 if (selector && oldContent && oldContent.startsWith('<p')) { // 普通html处理
window.$('#' + selector).addClass('renderAsHtml')
window.$('#' + selector).html(oldContent) window.$('#' + selector).html(oldContent)
} else { } else {
try { try {

@ -1,4 +1,5 @@
import React,{ Component } from "react"; import React,{ Component } from "react";
import { ConditionToolTip } from 'educoder'
class AttachmentsList extends Component{ class AttachmentsList extends Component{
constructor(props){ constructor(props){
@ -12,14 +13,18 @@ class AttachmentsList extends Component{
attachments.map((item,key)=>{ attachments.map((item,key)=>{
return( return(
<p key={key}> <p key={key}>
<a className="color-grey"> <a className="color-grey fl">
<i className="font-14 color-green iconfont icon-fujian mr8"></i> <i className="font-14 color-green iconfont icon-fujian mr8"></i>
</a> </a>
{ {
item.is_pdf && item.is_pdf == true ? item.is_pdf && item.is_pdf == true ?
<a href={item.url} className="mr12" length="58" target="_blank">{item.title}</a> <ConditionToolTip title={item.title} condition={item.title && item.title.length > 30 }>
<a href={item.url} className="mr12 fl task-hide" length="58" target="_blank" style={{"maxWidth":"432px"}}>{item.title}</a>
</ConditionToolTip>
: :
<a href={item.url} className="mr12" length="58">{item.title}</a> <ConditionToolTip title={item.title} condition={item.title && item.title.length > 30 }>
<a href={item.url} className="mr12 fl task-hide" length="58" style={{"maxWidth":"432px"}}>{item.title}</a>
</ConditionToolTip>
} }
<span className="color-grey mt2 color-grey-6 font-12">{item.filesize}</span> <span className="color-grey mt2 color-grey-6 font-12">{item.filesize}</span>
</p> </p>

@ -131,10 +131,14 @@ class Fileslistitem extends Component{
}); });
} }
eventStop = (event) =>{
event.stopPropagation()
}
render(){ render(){
const { checkBox, const { checkBox,
discussMessage, discussMessage,index
} = this.props; } = this.props;
return( return(
@ -190,9 +194,9 @@ class Fileslistitem extends Component{
white-space:nowrap white-space:nowrap
} }
`}</style> `}</style>
<div className="clearfix ds pr contentSection"> <div className="clearfix ds pr contentSection" style={{cursor : this.props.isAdmin ? "pointer" : "default"}} onClick={() => window.$(`.sourceitem${index} input`).click() }>
<h6> <h6 onClick={(event)=>this.eventStop(event)}>
<span className="fl mr12 mt3"> <span className={`sourceitem${index} fl mr12 mt3`}>
{checkBox} {checkBox}
</span> </span>
{ {
@ -283,8 +287,7 @@ class Fileslistitem extends Component{
</span> </span>
</span> </span>
{this.props.isAdmin? {this.props.isAdmin?
<span className={"fr mrf2 mr10"}> <span className={"fr mrf2 mr10"} onClick={(event)=>this.eventStop(event)}>
<WordsBtn style="blue" className="colorblue font-16 mr20 fr"> <WordsBtn style="blue" className="colorblue font-16 mr20 fr">
<a className="btn colorblue" <a className="btn colorblue"
onClick={()=>this.settingList()}>设置</a> onClick={()=>this.settingList()}>设置</a>
@ -292,7 +295,7 @@ class Fileslistitem extends Component{
</span>:""} </span>:""}
{this.props.isStudent===true&&this.props.current_user.login===discussMessage.author.login? {this.props.isStudent===true&&this.props.current_user.login===discussMessage.author.login?
<span className={"fr mrf2 mr10"}> <span className={"fr mrf2 mr10"} onClick={(event)=>this.eventStop(event)}>
<WordsBtn style="blue" className="colorblue font-16 mr20 fr"> <WordsBtn style="blue" className="colorblue font-16 mr20 fr">
<a className="btn colorblue" <a className="btn colorblue"

@ -10,6 +10,8 @@ import Selectsetting from "../coursesPublic/SelectSetting";
import HomeworkModal from "../coursesPublic/HomeworkModal"; import HomeworkModal from "../coursesPublic/HomeworkModal";
import Fileslistitem from './Fileslistitem'; import Fileslistitem from './Fileslistitem';
import Titlesearchsection from '../common/titleSearch/TitleSearchSection'; import Titlesearchsection from '../common/titleSearch/TitleSearchSection';
import NoneData from "../coursesPublic/NoneData";
import _ from 'lodash'
import './style.css'; import './style.css';
import '../css/members.css'; import '../css/members.css';
import moment from 'moment'; import moment from 'moment';
@ -474,7 +476,16 @@ class Fileslists extends Component{
} }
onItemClick = (item) => {
const checkBoxValues = this.state.checkBoxValues.slice(0);
const index = checkBoxValues.indexOf(item.id);
if (index != -1) {
_.remove(checkBoxValues, (listItem)=> listItem === item.id)
} else {
checkBoxValues.push(item.id);
}
this.onCheckBoxChange(checkBoxValues)
}
PaginationTask=(page)=>{ PaginationTask=(page)=>{
let {search,order,selectpage,checkAllValue,checkBoxValues}=this.state; let {search,order,selectpage,checkAllValue,checkBoxValues}=this.state;
@ -787,7 +798,7 @@ class Fileslists extends Component{
showSearchInput={true} showSearchInput={true}
></Titlesearchsection> ></Titlesearchsection>
{this.props.isAdmin()? <div className="mt20 edu-back-white padding20-30" style={{display:this.props.isAdmin()||this.props.isStudent()?"":"none"}}> {this.props.isAdmin()? files===undefined?'' :files.length===0? "":<div className="mt20 edu-back-white padding20-30" style={{display:this.props.isAdmin()||this.props.isStudent()?"":"none"}}>
<div className="clearfix"> <div className="clearfix">
{this.props.isAdmin()? <Checkbox className="fl" onChange={this.onCheckAll} checked={checkAllValue}>已选 {checkBoxValues.length} </Checkbox>:""} {this.props.isAdmin()? <Checkbox className="fl" onChange={this.onCheckAll} checked={checkAllValue}>已选 {checkBoxValues.length} </Checkbox>:""}
<div className="studentList_operation_ul"> <div className="studentList_operation_ul">
@ -897,7 +908,7 @@ class Fileslists extends Component{
{ files&&files.map((item, index) => { { files&&files.map((item, index) => {
return ( return (
<div className="mt20 edu-back-white padding02010" key={index}> <div className="mt20 edu-back-white padding02010" key={index} onClick={()=>this.onItemClick(item)}>
<div className="clearfix"> <div className="clearfix">
<div key={index}> <div key={index}>
<Fileslistitem <Fileslistitem
@ -910,6 +921,7 @@ class Fileslists extends Component{
Settingtypes={(id)=>this.Settingtypes(id)} Settingtypes={(id)=>this.Settingtypes(id)}
coursesId={this.props.match.params.coursesId} coursesId={this.props.match.params.coursesId}
updatafiledfun={()=>this.updatafiled()} updatafiledfun={()=>this.updatafiled()}
index={index}
></Fileslistitem> ></Fileslistitem>
</div> </div>
</div> </div>
@ -948,21 +960,23 @@ class Fileslists extends Component{
/>:""} />:""}
</div> </div>
<div className="alltask edu-back-white"
style={
{ {
display: files===undefined?'none' :files.length===0? 'block' : 'none' files===undefined?'' :files.length===0?<NoneData></NoneData>:""
}
} }
>
<div className="edu-tab-con-box clearfix edu-txt-center">
<img className="edu-nodata-img mb20" src="/images/educoder/nodata.png" />
<p className="edu-nodata-p mb20">暂时还没有相关数据哦</p></div>
</div>
</React.Fragment> </React.Fragment>
) )
} }
} }
export default Fileslists; export default Fileslists;
{/*<div className="alltask"*/}
{/*style={*/}
{/*{*/}
{/*display: files===undefined?'none' :files.length===0? 'block' : 'none'*/}
{/*}*/}
{/*}*/}
{/*>*/}
{/*<div className="edu-tab-con-box clearfix edu-txt-center">*/}
{/*<img className="edu-nodata-img mb20" src="/images/educoder/nodata.png" />*/}
{/*<p className="edu-nodata-p mb20">暂时还没有相关数据哦!</p></div>*/}
{/*</div>*/}

@ -376,10 +376,15 @@ class BoardsNew extends Component{
dropdownRender={menu => ( dropdownRender={menu => (
<div> <div>
{menu} {menu}
{
isAdmin &&
<React.Fragment>
<Divider style={{ margin: '4px 0' }} /> <Divider style={{ margin: '4px 0' }} />
<div style={{ padding: '8px', cursor: 'pointer' }} onMouseDown={() => this.refs['addDirModal'].open()}> <div style={{ padding: '8px', cursor: 'pointer' }} onMouseDown={() => this.refs['addDirModal'].open()}>
<Icon type="plus" /> 添加目录 <Icon type="plus" /> 添加目录
</div> </div>
</React.Fragment>
}
</div> </div>
)} )}
> >

@ -24,7 +24,7 @@ import '../../forums/RightSection.css'
import './TopicDetail.css' import './TopicDetail.css'
import '../common/courseMessage.css' import '../common/courseMessage.css'
import { Pagination, Tooltip } from 'antd' import { Pagination, Tooltip } from 'antd'
import { bytesToSize, ConditionToolTip, markdownToHTML, MarkdownToHtml } from 'educoder' import { bytesToSize, ConditionToolTip, markdownToHTML, MarkdownToHtml , setImagesUrl } from 'educoder'
import SendToCourseModal from '../coursesPublic/modal/SendToCourseModal' import SendToCourseModal from '../coursesPublic/modal/SendToCourseModal'
import CBreadcrumb from '../common/CBreadcrumb' import CBreadcrumb from '../common/CBreadcrumb'
import { generateComments, generateChildComments, _findById, handleContentBeforeCreateNew, addNewComment import { generateComments, generateChildComments, _findById, handleContentBeforeCreateNew, addNewComment
@ -57,6 +57,7 @@ class TopicDetail extends Component {
pageCount: 1, pageCount: 1,
comments: [], comments: [],
goldRewardDialogOpen: false, goldRewardDialogOpen: false,
author:undefined
} }
} }
componentDidMount() { componentDidMount() {
@ -85,7 +86,8 @@ class TopicDetail extends Component {
memo: Object.assign({}, { memo: Object.assign({}, {
...response.data.data, ...response.data.data,
replies_count: response.data.data.total_replies_count replies_count: response.data.data.total_replies_count
}, {...this.state.memo}) }, {...this.state.memo}),
author:response.data.data.author
}, () => { }, () => {
}) })
@ -514,7 +516,7 @@ class TopicDetail extends Component {
render() { render() {
const { match, history } = this.props const { match, history } = this.props
const { recommend_shixun, current_user,author_info } = this.props; const { recommend_shixun, current_user,author_info } = this.props;
const { memo, comments, hasMoreComments, goldRewardDialogOpen, pageCount, total_count } = this.state; const { memo, comments, hasMoreComments, goldRewardDialogOpen, pageCount, total_count , author } = this.state;
const messageId = match.params.topicId const messageId = match.params.topicId
if (this.state.memoLoading || !current_user) { if (this.state.memoLoading || !current_user) {
return <div className="edu-back-white" id="forum_index_list"></div> return <div className="edu-back-white" id="forum_index_list"></div>
@ -599,11 +601,12 @@ class TopicDetail extends Component {
} }
</div> </div>
<div className="color-grey-9 clearfix"> <div className="df mt20">
<span className="fl" style={{marginTop: "2px"}}>{moment(memo.created_on).fromNow()} 发布</span> <img src={setImagesUrl(`/images/${author && author.image_url}`)} className="radius mr10 mt2" width="40px" height="40px"/>
<div className="fr"> <div className="flex1">
<div className="color-grey-9 lineh-20">
</div> <span class="color-grey-3 mr20 fl" style={{"fontWeight":"400"}}>{author && author.name}</span>
<span className="fl">{moment(memo.created_on).fromNow()} 发布</span>
</div> </div>
<div className="color-grey-9 clearfix"> <div className="color-grey-9 clearfix">
@ -627,11 +630,11 @@ class TopicDetail extends Component {
</a> </a>
</Tooltip> </Tooltip>
} }
{!!memo.praises_count && {!!memo.total_praises_count &&
<Tooltip title={"点赞数"}> <Tooltip title={"点赞数"}>
<span className={`noteDetailNum `} style={{}}> <span className={`noteDetailNum `} style={{}}>
<i className="iconfont icon-dianzan-xian mr5"></i> <i className="iconfont icon-dianzan-xian mr5"></i>
<span style={{ top: "2px", position: "relative" }}>{ memo.praises_count }</span> <span style={{ top: "2px", position: "relative" }}>{ memo.total_praises_count }</span>
</span> </span>
</Tooltip> </Tooltip>
} }
@ -645,6 +648,8 @@ class TopicDetail extends Component {
</div> </div>
</div> </div>
</div> </div>
</div>
</div>
<div className="padding30 memoContent new_li" style={{ paddingBottom: '10px'}}> <div className="padding30 memoContent new_li" style={{ paddingBottom: '10px'}}>

@ -363,7 +363,7 @@ class Boards extends Component{
<FilesListItem></FilesListItem> */} <FilesListItem></FilesListItem> */}
{isAdmin && <div className="mt20 edu-back-white padding20-30"> {messages&&messages.length == 0?"": 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">

@ -15,7 +15,7 @@ import WorkDetailPageHeader from './common/WorkDetailPageHeader'
import CommonWorkAppraiseReply from './reply/CommonWorkAppraiseReply' import CommonWorkAppraiseReply from './reply/CommonWorkAppraiseReply'
import Example from './TestHooks' import Example from './TestHooks'
import CommonWorkAppraiseReviseAttachments from './CommonWorkAppraiseReviseAttachments' import CommonWorkAppraiseReviseAttachments from './CommonWorkAppraiseReviseAttachments'
import LeaderIcon from './common/LeaderIcon'
const { Option} = Select; const { Option} = Select;
const CheckboxGroup = Checkbox.Group; const CheckboxGroup = Checkbox.Group;
const confirm = Modal.confirm; const confirm = Modal.confirm;
@ -88,6 +88,14 @@ class CommonWorkAppraise extends Component{
console.log(error) console.log(error)
}) })
} }
componentDidUpdate(prevProps, prevState) {
if (this.props.match.params.studentWorkId != prevProps.match.params.studentWorkId) {
this.getWork();
this.getReviseAttachments()
this.commonWorkAppraiseReply && this.commonWorkAppraiseReply.fetchAllComments()
}
}
componentDidMount() { componentDidMount() {
this.getWork(); this.getWork();
this.getReviseAttachments() this.getReviseAttachments()
@ -156,12 +164,13 @@ class CommonWorkAppraise extends Component{
attachments, homework_id, project_info, work_members, is_evaluation, attachments, homework_id, project_info, work_members, is_evaluation,
description, update_user_name, update_time, commit_time, author_name, description, update_user_name, update_time, commit_time, author_name,
revise_attachments, revise_reason, atta_update_user, atta_update_time, atta_update_user_login, revise_attachments, revise_reason, atta_update_user, atta_update_time, atta_update_user_login,
Modalstype,Modalstopval,ModalCancel,ModalSave,loadtype Modalstype,Modalstopval,ModalCancel,ModalSave,loadtype, is_leader_work
} =this.state; } =this.state;
let courseId=this.props.match.params.coursesId; let courseId=this.props.match.params.coursesId;
let category_id=this.props.match.params.category_id; let category_id=this.props.match.params.category_id;
let studentWorkId=this.props.match.params.studentWorkId; let studentWorkId=this.props.match.params.studentWorkId;
const isAdmin = this.props.isAdmin()
return( return(
<WorkDetailPageHeader <WorkDetailPageHeader
{...this.props} {...this.state} {...this.props} {...this.state}
@ -251,13 +260,28 @@ class CommonWorkAppraise extends Component{
{is_evaluation != true && work_members && !!work_members.length && <div className={"stud-class-set bor-top-greyE edu-back-white padding20-30"}> {is_evaluation != true && work_members && !!work_members.length && <div className={"stud-class-set bor-top-greyE edu-back-white padding20-30"}>
<div className={"color-grey-6 mb10"}> <div className={"color-grey-6 mb10"}>
其他组员 全部组员
</div> </div>
<div className={"ml20"}> <div className={"ml20 color-grey-6"}>
<div className="">
当前组员{author_name} {is_leader_work && <LeaderIcon small={true} ></LeaderIcon>}
</div>
<div>
其他组员
{work_members.map((item, index) => { {work_members.map((item, index) => {
return item.user_name + ' ' return <React.Fragment>
{isAdmin ?
<a className={`color-blue ${index == 0 ? '' : 'ml10'}`} href="javascript:void(0)"
onClick={() => this.props.toWorkDetailPage(this.props.match.params, null, item.work_id)}
>
{item.user_name}
</a> : <span className={`${index == 0 ? '' : 'ml10'}`} >{item.user_name}</span>}
{item.is_leader && <LeaderIcon small={true} ></LeaderIcon>}
</React.Fragment>
})} })}
</div> </div>
</div>
</div> </div>
} }
</div> </div>
@ -266,6 +290,7 @@ class CommonWorkAppraise extends Component{
{/* task_type={datalist&&datalist.task_type} */} {/* task_type={datalist&&datalist.task_type} */}
<CommonWorkAppraiseReply {...this.props} task_id={studentWorkId} <CommonWorkAppraiseReply {...this.props} task_id={studentWorkId}
onReplySuccess={this.onReplySuccess} {...this.state} onReplySuccess={this.onReplySuccess} {...this.state}
wrappedComponentRef={(ref) => {this.commonWorkAppraiseReply = ref}}
></CommonWorkAppraiseReply> ></CommonWorkAppraiseReply>
</div> </div>

@ -15,7 +15,7 @@ import WorkDetailPageHeader from './common/WorkDetailPageHeader'
import PublishRightnow from './PublishRightnow' import PublishRightnow from './PublishRightnow'
import ModulationModal from "../coursesPublic/ModulationModal"; import ModulationModal from "../coursesPublic/ModulationModal";
import AccessoryModal from "../coursesPublic/AccessoryModal"; import AccessoryModal from "../coursesPublic/AccessoryModal";
import LeaderIcon from './common/LeaderIcon'
const { Option} = Select; const { Option} = Select;
const CheckboxGroup = Checkbox.Group; const CheckboxGroup = Checkbox.Group;
const confirm = Modal.confirm; const confirm = Modal.confirm;
@ -97,7 +97,12 @@ function buildColumns(that, student_works, studentData) {
}} title={text && text.length > 5 ? text : ''}> }} title={text && text.length > 5 ? text : ''}>
{/* <Tooltip placement="bottom" title={text}> {/* <Tooltip placement="bottom" title={text}>
</Tooltip> */} </Tooltip> */}
{text} {record.is_leader ?
<div style={{ display: 'flex', 'flex-direction': 'column', 'align-items': 'center'}}>
<div >{text}</div>
<LeaderIcon></LeaderIcon>
</div>
: <React.Fragment>{text}</React.Fragment>}
</div> </div>
), ),
}] }]

@ -0,0 +1,19 @@
import React,{Component} from "React";
export default function LeaderIcon(props = {}) {
let icon = null;
if (props.small) {
icon = <div className="font-8 blueFull Actionbtn" style={{
height: '14px',
'line-height': '14px',
width: '24px',
padding: 0,
'margin-top': '-2px',
'margin-left': '2px',
'vertical-align': 'middle', }}>组长</div>
} else {
icon = <div className="font-8 blueFull Actionbtn" style={{ height: '16px', 'line-height': '16px', width: '30px'}}>组长</div>
}
return icon
}

@ -85,8 +85,7 @@ class WorkDetailPageHeader extends Component{
background: #fff; background: #fff;
} }
.workDetailPageHeader .summaryname { .workDetailPageHeader .summaryname {
line-height: 20px; line-height:30px
margin-top: 13px;
} }
`}</style> `}</style>
<CBreadcrumb items={[ <CBreadcrumb items={[
@ -99,18 +98,18 @@ class WorkDetailPageHeader extends Component{
// { name: childModuleName } // { name: childModuleName }
]}></CBreadcrumb> ]}></CBreadcrumb>
<div style={{ width:'100%',height:'52px'}} > <div className="clearfix mt20 mb20" >
<span className=" fl color-black summaryname" style={{height: 'auto'}}> <span className=" fl color-black summaryname">
{homework_name} {homework_name}
{/* <Link to={"/courses/"+courseId+"/graduation"+"/graduation_tasks/"}>{homework_name}</Link> */} {/* <Link to={"/courses/"+courseId+"/graduation"+"/graduation_tasks/"}>{homework_name}</Link> */}
</span> </span>
<CoursesListType <CoursesListType
typelist={homework_status} typelist={homework_status}
typesylename={"mt12"} typesylename={"mt3"}
/> />
{category && <a className="color-grey-6 fr font-16 ml30 mt7 mr20" onClick={this.goback} style={{ marginRight: '26px'}}>返回</a>} {category && <a className="color-grey-6 fr font-16 ml30 mr30 lineh-25" onClick={this.goback}>返回</a>}
{this.props.update_atta && {this.props.update_atta &&
<React.Fragment> <React.Fragment>

@ -143,7 +143,9 @@ class commonWork extends Component{
this.setState({ this.setState({
order:e.key==="all"?"":e.key, order:e.key==="all"?"":e.key,
page:1, page:1,
isSpin:true isSpin:true,
checkBoxValues:[],
checkAll:false
}) })
let {search}=this.state; let {search}=this.state;
this.getList(1,search,e.key==="all"?"":e.key); this.getList(1,search,e.key==="all"?"":e.key);

@ -750,7 +750,7 @@ class Coursesleftnav extends Component{
{/*分班*/} {/*分班*/}
{item.type==="course_group"?<div onClick={e=>this.Navmodalnames(e,2,"course_group",item.id)}>添加分班</div>:""} {item.type==="course_group"?<div onClick={e=>this.Navmodalnames(e,2,"course_group",item.id)}>添加分班</div>:""}
{/*分班*/} {/*分班*/}
{item.type==="course_group"?<div onClick={e=>this.Navmodalnames(e,5,"editname",item.id,item.name)}>重命名</div>: <div onClick={e=>this.Navmodalnames(e,3,"editname",item.id,item.name)}></div>} {item.type==="course_group"? <div onClick={e=>this.Navmodalnames(e,3,"editname",item.id,item.name)}>重命名</div>:""}
<div onClick={e=>this.edithidden(e,item.id)}>隐藏</div> <div onClick={e=>this.edithidden(e,item.id)}>隐藏</div>
<div onClick={e=>this.editSetup(e,item.id)}>置顶</div> <div onClick={e=>this.editSetup(e,item.id)}>置顶</div>

@ -1,5 +1,5 @@
import React, { Component } from 'react'; import React, { Component } from 'react';
import {getImageUrl} from 'educoder'; import { getImageUrl , getUrl } from 'educoder';
class NoneData extends Component{ class NoneData extends Component{
constructor(props) { constructor(props) {
@ -9,7 +9,20 @@ class NoneData extends Component{
const { style } = this.props; const { style } = this.props;
return( return(
<div className="edu-tab-con-box clearfix edu-txt-center" style={style}> <div className="edu-tab-con-box clearfix edu-txt-center" style={style}>
<img className="edu-nodata-img mb20" src={getImageUrl("images/educoder/nodata.png")}/> <style>
{`
.edu-tab-con-box{
padding:100px 0px;
}
.ant-modal-body .edu-tab-con-box{
padding:0px!important;
}
img.edu-nodata-img{
margin: 40px auto 20px;
}
`}
</style>
<img className="edu-nodata-img mb20" src={getUrl("/images/educoder/nodata.png")}/>
<p className="edu-nodata-p mb20">暂时还没有相关数据哦</p> <p className="edu-nodata-p mb20">暂时还没有相关数据哦</p>
</div> </div>
) )

@ -180,11 +180,13 @@ class PathModal extends Component{
}else{ }else{
// this.homeworkstart // this.homeworkstart
//调用立即发布弹窗 //调用立即发布弹窗
// this.props.showNotification(response.data.message)
this.props.hidecouseShixunModal(); this.props.hidecouseShixunModal();
this.props.courseshomeworkstart(response.data.category_id,response.data.homework_ids) this.props.updataleftNavfun()
// this.props.courseshomeworkstart(response.data.category_id,response.data.homework_ids)
// this.props.showNotification("选用成功") // this.props.showNotification("选用成功")
// this.props.showNotification(response.data.message) // this.props.showNotification(response.data.message)
// this.props.homeworkupdatalists(Coursename,page,order); this.props.homeworkupdatalists(this.props.Coursename,this.props.page,this.props.order);
} }
// if(response.status===200) { // if(response.status===200) {

@ -171,6 +171,19 @@ class Exercise extends Component{
checkAllValue: checkedValues.length == exercises.length checkAllValue: checkedValues.length == exercises.length
}) })
} }
onItemClick = (item) => {
const checkBoxValues = this.state.checkBoxValues.slice(0);
const index = checkBoxValues.indexOf(item.id);
if (index != -1) {
_.remove(checkBoxValues, (listItem)=> listItem === item.id)
} else {
checkBoxValues.push(item.id)
}
this.onCheckBoxChange(checkBoxValues)
}
// 全选or反选 // 全选or反选
onCheckAll = (e) => { onCheckAll = (e) => {
this.setState({ this.setState({
@ -507,7 +520,7 @@ class Exercise extends Component{
</div> </div>
</div> </div>
<Spin size="large" spinning={this.state.isSpin}> <Spin size="large" spinning={this.state.isSpin}>
{this.props.isAdmin()?<div className="mt20 mb20 edu-back-white padding20-30"> {this.props.isAdmin()?exercises && exercises.length ===0?"":<div className="mt20 mb20 edu-back-white padding20-30">
<div className="clearfix"> <div className="clearfix">
<Checkbox className="fl" onChange={this.onCheckAll} checked={checkAllValue}>已选 {checkBoxValues.length} </Checkbox> <Checkbox className="fl" onChange={this.onCheckAll} checked={checkAllValue}>已选 {checkBoxValues.length} </Checkbox>
<div className="studentList_operation_ul"> <div className="studentList_operation_ul">
@ -559,9 +572,9 @@ class Exercise extends Component{
{...this.props} {...this.props}
{...this.state} {...this.state}
item={item} item={item}
key={key} index={key}
onItemClick={this.onItemClick}
checkBox={<Checkbox value={item.id} key={item.id} checkBox={<Checkbox value={item.id} key={item.id}
// onClick={() => this.onItemClick(item)}
></Checkbox>} ></Checkbox>}
></ExerciseListItem> ></ExerciseListItem>
) )

@ -52,17 +52,17 @@ class ExerciseListItem extends Component{
}) })
} }
render(){ render(){
let{item,checkBox}=this.props; let{item,checkBox,index}=this.props;
let {coursesId,Id}=this.props.match.params let {coursesId,Id}=this.props.match.params
const IsAdmin =this.props.isAdmin(); const IsAdmin =this.props.isAdmin();
const IsStudent =this.props.isStudent(); const IsStudent =this.props.isStudent();
// console.log(this.props.current_user.user_id) // console.log(this.props.current_user.user_id)
return( return(
<div className="workList_Item" style={{padding:"30px"}}> <div className="workList_Item" style={{cursor : IsAdmin ? "pointer" : "default",padding:"30px" }} onClick={() => window.$(`.exerciseitem${index} input`).click() }>
{ {
IsAdmin && IsAdmin &&
<span className="fl mr12"> <span className={`exerciseitem${index} fl mr12`}>
{checkBox} {checkBox}
</span> </span>
} }
@ -96,20 +96,20 @@ class ExerciseListItem extends Component{
{/*<Link to={`/courses/${coursesId}/exercises/${item.id}/exercises/student_exercise_list?tab=0`} className="fl font-16 font-bd mt2 color-grey-3 task-hide" style={{"maxWidth":"600px"}}>{item.exercise_name}</Link>*/} {/*<Link to={`/courses/${coursesId}/exercises/${item.id}/exercises/student_exercise_list?tab=0`} className="fl font-16 font-bd mt2 color-grey-3 task-hide" style={{"maxWidth":"600px"}}>{item.exercise_name}</Link>*/}
{ {
this.props.isAdmin()? <a className="fl font-16 font-bd mt2 color-grey-3 task-hide comnonwidth580" this.props.isAdmin()? <Link className="fl font-16 font-bd mt2 color-grey-3 task-hide comnonwidth580"
title={item.exercise_name} title={item.exercise_name}
href={`/courses/${coursesId}/exercises/${item.id}/student_exercise_list?tab=0`}>{item.exercise_name}</a>:"" to={`/courses/${coursesId}/exercises/${item.id}/student_exercise_list?tab=0`}>{item.exercise_name}</Link>:""
} }
{ {
this.props.isStudent()? this.props.isStudent()?
<a className="fl font-16 font-bd mt2 color-grey-3 task-hide comnonwidth580" title={item.exercise_name} href={`/courses/${coursesId}/exercises/${item.id}/student_exercise_list?tab=0`}>{item.exercise_name}</a>:"" <Link className="fl font-16 font-bd mt2 color-grey-3 task-hide comnonwidth580" title={item.exercise_name} to={`/courses/${coursesId}/exercises/${item.id}/student_exercise_list?tab=0`}>{item.exercise_name}</Link>:""
} }
{ {
this.props.isNotMember()? item.lock_status === 0 ? this.props.isNotMember()? item.lock_status === 0 ?
<span className="fl mt3 font-16 font-bd color-dark comnonwidth580" title={item.exercise_name}>{item.exercise_name}</span> <span className="fl mt3 font-16 font-bd color-dark comnonwidth580" title={item.exercise_name}>{item.exercise_name}</span>
: <a className="fl font-16 font-bd mt2 color-grey-3 task-hide comnonwidth580" title={item.exercise_name} href={`/courses/${coursesId}/exercises/${item.id}/student_exercise_list?tab=0`}>{item.exercise_name}</a>:"" : <Link className="fl font-16 font-bd mt2 color-grey-3 task-hide comnonwidth580" title={item.exercise_name} to={`/courses/${coursesId}/exercises/${item.id}/student_exercise_list?tab=0`}>{item.exercise_name}</Link>:""
} }
{ {
@ -165,8 +165,8 @@ class ExerciseListItem extends Component{
{ IsAdmin &&<div className="homepagePostSetting" style={{"right":"-17px","top":"51px","display":"block","width":"100px"}}> { IsAdmin &&<div className="homepagePostSetting" style={{"right":"-17px","top":"51px","display":"block","width":"100px"}}>
<a className="btn colorblue font-16" href={`/courses/${coursesId}/exercises/${item.id}/edit`}>编辑</a> <Link className="btn colorblue font-16" to={`/courses/${coursesId}/exercises/${item.id}/edit`}>编辑</Link>
<a className="btn colorblue ml20 font-16" href={`/courses/${coursesId}/exercises/${item.id}/student_exercise_list?tab=3`}>设置</a> <Link className="btn colorblue ml20 font-16" to={`/courses/${coursesId}/exercises/${item.id}/student_exercise_list?tab=3`}>设置</Link>
</div> } </div> }
</p> </p>

@ -541,6 +541,18 @@ class ExerciseReviewAndAnswer extends Component{
.inputNumber30 .ant-input-number-input-wrap .ant-input-number-input{ .inputNumber30 .ant-input-number-input-wrap .ant-input-number-input{
height: 28px; height: 28px;
} }
.setRadioStyle{
width:100%;
cursor:pointer;
}
.setRadioStyle span:last-child{
flex:1;
display:flex;
}
.setRadioStyle .ant-radio,.setRadioStyle .ant-checkbox{
height:16px;
margin-top:2px;
}
`}</style> `}</style>
{/*<p style={{height:"60px"}}></p>*/} {/*<p style={{height:"60px"}}></p>*/}
<Modals <Modals

@ -44,19 +44,19 @@ class Multiple extends Component{
console.log(questionType); console.log(questionType);
return( return(
<div className="pl30 pr30 singleDisplay"> <div className="pl30 pr30 singleDisplay">
<Checkbox.Group disabled={ user_exercise_status == 1 ? true : false } onChange={this.saveId} value={questionType.user_answer}> <Checkbox.Group className="with100" disabled={ user_exercise_status == 1 ? true : false } onChange={this.saveId} value={questionType.user_answer}>
{ {
questionType.question_choices && questionType.question_choices.map((item,key)=>{ questionType.question_choices && questionType.question_choices.map((item,key)=>{
let prefix = `${tagArray[key]}.` let prefix = `${tagArray[key]}.`
return( return(
<p className="clearfix mb15 df"> <p className="clearfix mb15 df">
<Checkbox className="fl lineh-15 df mr8 mt2" value={item.choice_id} key={item.choice_id}>{prefix}</Checkbox> <Checkbox className="lineh-15 df mr8 setRadioStyle" value={item.choice_id}>
{/* <span class="fl lineh-20 mt1"></span> */} <span className="fl mr3 lineh-20">{prefix}</span>
{/* <span style={{display:"inline-block"}} className="markdown-body " dangerouslySetInnerHTML={{__html: markdownToHTML1(item.choice_text)}}></span> */}
<MarkdownToHtml content={item.choice_text} selector={'multiple_' + (this.props.index + 1) + (key + 1)} <MarkdownToHtml content={item.choice_text} selector={'multiple_' + (this.props.index + 1) + (key + 1)}
className="" style={{display:"inline-block"}} className="flex1" style={{display:"inline-block"}}
></MarkdownToHtml> ></MarkdownToHtml>
</Checkbox>
</p> </p>
) )
}) })

@ -40,18 +40,18 @@ class single extends Component{
let isJudge = questionType.question_type == 2 let isJudge = questionType.question_type == 2
return( return(
<div className="pl30 pr30 singleDisplay"> <div className="pl30 pr30 singleDisplay">
<Radio.Group disabled={ user_exercise_status == 1 ? true : false } value={questionType.user_answer[0]} onChange={this.changeItem}> <Radio.Group className="with100" disabled={ user_exercise_status == 1 ? true : false } value={questionType.user_answer[0]} onChange={this.changeItem}>
{ {
questionType.question_choices && questionType.question_choices.map((item,key)=>{ questionType.question_choices && questionType.question_choices.map((item,key)=>{
let prefix = isJudge ? undefined : `${tagArray[key]}.` let prefix = isJudge ? undefined : `${tagArray[key]}.`
return( return(
<p className={parseInt(questionType.question_type) == 0 ? "clearfix mb15 df" : "fl mr40 df"}> <p className={parseInt(questionType.question_type) == 0 ? "clearfix mb15" : "fl mr40"}>
<Radio className="fl lineh-20" value={item.choice_id}>{prefix}</Radio> <Radio className="df lineh-20 setRadioStyle" value={item.choice_id}>
{/* <span className="fl lineh-20 mr3 "></span> */} <span className="fl mr3">{prefix}</span>
{/* <span style={{display:"inline-block", 'margin-top': '-1px'}} className="markdown-body fl " dangerouslySetInnerHTML={{__html: markdownToHTML1(item.choice_text)}}></span> */}
<MarkdownToHtml content={item.choice_text} selector={'single_' + (this.props.index + 1) + (key + 1)} <MarkdownToHtml content={item.choice_text} selector={'single_' + (this.props.index + 1) + (key + 1)}
className="fl" style={{display:"inline-block", 'margin-top': '-1px'}} className="flex1" style={{display:"inline-block", 'margin-top': '-1px'}}
></MarkdownToHtml> ></MarkdownToHtml>
</Radio>
</p> </p>
) )
}) })

@ -151,16 +151,12 @@ class GraduateTaskItem extends Component{
coursesId, coursesId,
categoryid, categoryid,
taskid, taskid,
index,
isAdmin
} = this.props; } = this.props;
// console.log(discussMessage)
return( return(
<div className="graduateTopicList boardsList"> <div className="graduateTopicList boardsList" style={{cursor : isAdmin ? "pointer" : "default" }} onClick={() => window.$(`.taskitem${index} input`).click() }>
<Modals <Modals
modalsType={Modalstype} modalsType={Modalstype}
modalsTopval={Modalstopval} modalsTopval={Modalstopval}
@ -193,8 +189,9 @@ class GraduateTaskItem extends Component{
margin-right: 15px; margin-right: 15px;
} }
`}</style> `}</style>
<span className={`taskitem${index} fl`} style={{"height":"59px"}}>
{ checkBox } { checkBox }
</span>
{/* {/*
style={{borderTop:data===undefined?"":data.course_identity<4?'1px solid #EBEBEB':'1px solid transparent'}} style={{borderTop:data===undefined?"":data.course_identity<4?'1px solid #EBEBEB':'1px solid transparent'}}
*/} */}

@ -13,6 +13,7 @@ import Modals from '../../../modals/Modals';
import UseBank from "../../busyWork/UseBank"; import UseBank from "../../busyWork/UseBank";
import '../../css/members.css'; import '../../css/members.css';
import '../style.css'; import '../style.css';
import NoneData from "../../coursesPublic/NoneData";
class GraduationTasks extends Component{ class GraduationTasks extends Component{
@ -350,8 +351,6 @@ class GraduationTasks extends Component{
checkBoxValues: checkedValues, checkBoxValues: checkedValues,
checkAllValue:type checkAllValue:type
}) })
} }
@ -384,7 +383,9 @@ class GraduationTasks extends Component{
this.setState({ this.setState({
order: e.key, order: e.key,
isSpin:true isSpin:true,
checkBoxValues:[],
checkAllValue:false
}); });
let newkey=e.key; let newkey=e.key;
@ -696,7 +697,7 @@ class GraduationTasks extends Component{
<FilesListItem></FilesListItem> */} <FilesListItem></FilesListItem> */}
{this.props.isAdmin()? <div className="mt20 edu-back-white padding20-30"> {this.props.isAdmin()?all_count===undefined?'' :all_count===0?"": <div className="mt20 edu-back-white padding20-30">
<div className="clearfix"> <div className="clearfix">
<Checkbox className="fl" onChange={this.onCheckAll} checked={checkAllValue}>已选 {checkBoxValues.length} </Checkbox> <Checkbox className="fl" onChange={this.onCheckAll} checked={checkAllValue}>已选 {checkBoxValues.length} </Checkbox>
<div className="studentList_operation_ul"> <div className="studentList_operation_ul">
@ -726,10 +727,10 @@ class GraduationTasks extends Component{
} }
`}</style> `}</style>
<Spin size="large" spinning={this.state.isSpin}> <Checkbox.Group style={{ width: '100%' }} onChange={this.onCheckBoxChange} value={checkBoxValues}> <Spin size="large" spinning={this.state.isSpin}> <Checkbox.Group style={{ width: '100%' }} onChange={this.onCheckBoxChange} value={checkBoxValues}>
{ tasks.map((item, index) => { { tasks&&tasks.map((item, index) => {
// console.log(item) // console.log(item)
return ( return (
<div className="mt20 edu-back-white padding02010" key={index}> <div className="mt20 edu-back-white pt10 pl30 pr30" key={index}>
<div className="clearfix"> <div className="clearfix">
<GraduateTaskItem <GraduateTaskItem
discussMessage={item} discussMessage={item}
@ -746,6 +747,7 @@ class GraduationTasks extends Component{
coursesId={this.props.match.params.coursesId} coursesId={this.props.match.params.coursesId}
categoryid={this.props.match.params.Id} categoryid={this.props.match.params.Id}
workid={item.work_id} workid={item.work_id}
index={index}
></GraduateTaskItem> ></GraduateTaskItem>
</div> </div>
</div> </div>
@ -770,18 +772,11 @@ class GraduationTasks extends Component{
/> />
</div> </div>
} }
<div className="alltask edu-back-white"
style={
{ {
display: all_count===undefined?'none' :all_count===0? 'block' : 'none' all_count===undefined?'' :all_count===0? <NoneData></NoneData>:""
}
} }
>
<div className="edu-tab-con-box clearfix edu-txt-center">
<img className="edu-nodata-img mb20" src="/images/educoder/nodata.png" />
<p className="edu-nodata-p mb20">暂时还没有相关数据哦</p></div>
</div>
<div> <div>
</div> </div>
@ -791,3 +786,15 @@ class GraduationTasks extends Component{
} }
} }
export default GraduationTasks; export default GraduationTasks;
{/*<div className="alltask"*/}
{/*style={*/}
{/*{*/}
{/*display: all_count===undefined?'none' :all_count===0? 'block' : 'none'*/}
{/*}*/}
{/*}*/}
{/*>*/}
{/*<div className="edu-tab-con-box clearfix edu-txt-center">*/}
{/*<img className="edu-nodata-img mb20" src="/images/educoder/nodata.png" />*/}
{/*<p className="edu-nodata-p mb20">暂时还没有相关数据哦!</p></div>*/}
{/*</div>*/}

@ -6,7 +6,7 @@ import '../style.css'
import axios from "axios"; import axios from "axios";
import GraduateTopicReply from './GraduateTopicReply' import GraduateTopicReply from './GraduateTopicReply'
import { ConditionToolTip,MarkdownToHtml } from 'educoder' import { ConditionToolTip , MarkdownToHtml , AttachmentList } from 'educoder'
const $=window.$; const $=window.$;
const type={1: "设计",2: "论文", 3: "创作"} const type={1: "设计",2: "论文", 3: "创作"}
@ -60,9 +60,10 @@ class GraduateTopicDetailTable extends Component{
{ {
topicInfo && topicInfo.attachment_list.length>0 && topicInfo && topicInfo.attachment_list.length>0 &&
<p className="mt30"> <p className="mt30">
{ {/* {
topicInfo.attachment_list.map((item,key)=>{ topicInfo.attachment_list.map((item,key)=>{
return( return(
<li className="clearfix mb8" key={key}> <li className="clearfix mb8" key={key}>
<i className="iconfont icon-fujian color-green font-16 mr8 fl"></i> <i className="iconfont icon-fujian color-green font-16 mr8 fl"></i>
<ConditionToolTip title={item.title} condition={item.title && item.title.length > 30 }> <ConditionToolTip title={item.title} condition={item.title && item.title.length > 30 }>
@ -72,7 +73,8 @@ class GraduateTopicDetailTable extends Component{
</li> </li>
) )
}) })
} } */}
<AttachmentList {...this.props} {...this.state} attachments = {topicInfo.attachment_list}></AttachmentList>
</p> </p>
} }
</div> </div>

@ -47,7 +47,7 @@ class GraduateTopicItem extends Component{
} }
</style> </style>
<div className="graduateTopicList boardsList mb20"> <div className="graduateTopicList boardsList mb20" style={{cursor : isAdmin ? "pointer" : "default" }} onClick={() => window.$(`.topicItem${index} input`).click() }>
<style>{` <style>{`
.graduateTopicList .ant-checkbox-input {s .graduateTopicList .ant-checkbox-input {s
@ -58,7 +58,7 @@ class GraduateTopicItem extends Component{
padding: 17px 30px 20px!important; padding: 17px 30px 20px!important;
} }
`}</style> `}</style>
{ isAdmin ? checkBox : ""} { isAdmin ? <span className={`topicItem${index} fl`} style={{"height":"64px"}}>{checkBox}</span> : ""}
<div className="clearfix ds pr flex1"> <div className="clearfix ds pr flex1">
<style>{` <style>{`
.maxwidth580{ .maxwidth580{

@ -13,12 +13,15 @@ class CreateGroupByImportModal extends Component{
constructor(props){ constructor(props){
super(props); super(props);
this.state={ this.state={
errorTip:undefined
} }
} }
fetchMemberList = (arg_page) => {
}
componentDidMount() {
onSendOk = () => {
}
onSendOk = () => {
const courseId = this.props.match.params.coursesId const courseId = this.props.match.params.coursesId
let url = `/courses/${courseId}/create_group_by_importing_file.json` let url = `/courses/${courseId}/create_group_by_importing_file.json`
@ -109,7 +112,7 @@ class CreateGroupByImportModal extends Component{
render(){ render(){
const { candidates, checkBoxValues, loading, hasMore, name, school_name, school_names const { candidates, checkBoxValues, loading, hasMore, name, school_name, school_names
, graduationGroup, graduation_groups, courseGroup, course_groups , fileList , errorTip } = this.state , graduationGroup, graduation_groups, courseGroup, course_groups , fileList } = this.state
const { moduleName } = this.props const { moduleName } = this.props
const props = { const props = {
@ -138,9 +141,6 @@ class CreateGroupByImportModal extends Component{
单个文件最大150MB 单个文件最大150MB
</p> </p>
</Dragger> </Dragger>
<p className="color-red lineh-25 edu-txt-left" style={{height:"25px"}}>
<span className={ errorTip ? "" : "none" }>{errorTip}</span>
</p>
</ModalWrapper> </ModalWrapper>
) )
} }

@ -288,6 +288,7 @@ class Poll extends Component{
}) })
let{type,StudentList_value}=this.state let{type,StudentList_value}=this.state
this.InitList(type,StudentList_value,1); this.InitList(type,StudentList_value,1);
this.props.updataleftNavfun();
} }
}).catch((error)=>{ }).catch((error)=>{
console.log(error); console.log(error);
@ -595,7 +596,8 @@ class Poll extends Component{
{...this.state} {...this.state}
courseType={course_types} courseType={course_types}
item={item} item={item}
key={key} index={key}
onItemClick={this.onItemClick}
checkBox={<Checkbox value={item.id} key={item.id} onClick={() => this.onItemClick(item)}></Checkbox>} checkBox={<Checkbox value={item.id} key={item.id} onClick={() => this.onItemClick(item)}></Checkbox>}
></PollListItem> ></PollListItem>
) )

@ -16,7 +16,7 @@ class PollListItem extends Component{
super(props); super(props);
} }
render(){ render(){
let{item,checkBox,courseType}=this.props; let{item,checkBox,courseType,index}=this.props;
let {coursesId}=this.props.match.params; let {coursesId}=this.props.match.params;
const IsAdmin =this.props.isAdmin(); const IsAdmin =this.props.isAdmin();
@ -28,10 +28,10 @@ class PollListItem extends Component{
let canNotLink = !isAdminOrStudent && item.lock_status == 0 let canNotLink = !isAdminOrStudent && item.lock_status == 0
return( return(
<div className="workList_Item polllisthover" style={{padding:"30px"}}> <div className="workList_Item polllisthover" style={{cursor : IsAdmin ? "pointer" : "default",padding:"30px" }} onClick={() => window.$(`.pollitem${index} input`).click() }>
{ {
IsAdmin && IsAdmin &&
<span className="fl mr12"> <span className={`pollitem${index} fl mr12`}>
{checkBox} {checkBox}
</span> </span>
} }

@ -124,13 +124,19 @@ class ShixunhomeWorkItem extends Component{
}) })
} }
editname = (name,id) => { // 实训详情,阻止冒泡
stopPro = (event) => {
event.stopPropagation()
}
editname = (name,id,event) => {
this.setState({ this.setState({
ModalsRenametype:true, ModalsRenametype:true,
NavmodalValue:name, NavmodalValue:name,
Navmodalname:"重命名", Navmodalname:"重命名",
url:`/homework_commons/${id}/alter_name.json` url:`/homework_commons/${id}/alter_name.json`
}) })
event.stopPropagation()
} }
cannerNavmoda=()=>{ cannerNavmoda=()=>{
this.setState({ this.setState({
@ -157,23 +163,12 @@ class ShixunhomeWorkItem extends Component{
const { checkBox, const { checkBox,
discussMessage, discussMessage,
taskid, taskid,index
} = this.props; } = this.props;
//
// allow_late: true //是否开启补交
// homework_id: 9250
// shixun_identifier: "25ykhpvl"
//
// console.log("this.props.isAdmin");
return( return(
<div className="graduateTopicList boardsList"> <React.Fragment>
{this.state.ModalsRenametype===true? {
this.state.ModalsRenametype===true?
<ModalsRename <ModalsRename
{...this.props} {...this.props}
Navmodalnametype={this.state.ModalsRenametype} Navmodalnametype={this.state.ModalsRenametype}
@ -184,7 +179,6 @@ class ShixunhomeWorkItem extends Component{
cannerNavmoda={()=>this.cannerNavmoda()} cannerNavmoda={()=>this.cannerNavmoda()}
/> />
:""} :""}
<Modals <Modals
modalsType={Modalstype} modalsType={Modalstype}
modalsTopval={Modalstopval} modalsTopval={Modalstopval}
@ -193,7 +187,6 @@ class ShixunhomeWorkItem extends Component{
modalSave={cardsModalsavetype} modalSave={cardsModalsavetype}
loadtype={loadtype} loadtype={loadtype}
/> />
{visible===true?<Associationmodel {visible===true?<Associationmodel
modalname={modalname} modalname={modalname}
visible={visible} visible={visible}
@ -201,8 +194,6 @@ class ShixunhomeWorkItem extends Component{
taskid={taskid} taskid={taskid}
funlist={this.props.funlist} funlist={this.props.funlist}
/>:""} />:""}
<Modal <Modal
keyboard={false} keyboard={false}
title="提示" title="提示"
@ -218,6 +209,7 @@ class ShixunhomeWorkItem extends Component{
onClick={() => this.hidestartshixunsreplace(hidestartshixunsreplacevalue)}>知道了</a> onClick={() => this.hidestartshixunsreplace(hidestartshixunsreplacevalue)}>知道了</a>
</div> </div>
</Modal> </Modal>
<Modal <Modal
keyboard={false} keyboard={false}
title="提示" title="提示"
@ -238,7 +230,7 @@ class ShixunhomeWorkItem extends Component{
{/*</p>*/} {/*</p>*/}
</Modal> </Modal>
<div className="graduateTopicList boardsList" style={{cursor : this.props.isAdmin ? "pointer" : "default"}} onClick={() => window.$(`.shixunitem${index} input`).click() } >
<style>{` <style>{`
.boardsList .ant-checkbox-wrapper{ .boardsList .ant-checkbox-wrapper{
margin-top: -35px; margin-top: -35px;
@ -284,7 +276,11 @@ class ShixunhomeWorkItem extends Component{
`}</style> `}</style>
{this.props.isAdmin?checkBox:""} {this.props.isAdmin?
<span className={`shixunitem${index} fl`} style={{"height":"55px"}}>{checkBox}</span>
:
""
}
<div className="clearfix ds pr pt5 contentSection" > <div className="clearfix ds pr pt5 contentSection" >
<style>{` <style>{`
@ -299,23 +295,23 @@ class ShixunhomeWorkItem extends Component{
{/*to={`/courses/${this.props.match.params.coursesId}/${discussMessage.homework_id}/jobsettings`}*/} {/*to={`/courses/${this.props.match.params.coursesId}/${discussMessage.homework_id}/jobsettings`}*/}
{ {
this.props.isAdmin?<a href={"/courses/"+this.props.match.params.coursesId+"/"+this.state.shixuntypes+"/"+discussMessage.homework_id+"/list?tab=0"} this.props.isAdmin?<Link to={"/courses/"+this.props.match.params.coursesId+"/"+this.state.shixuntypes+"/"+discussMessage.homework_id+"/list?tab=0"}
title={discussMessage.name} title={discussMessage.name}
className="fl mt3 font-16 font-bd color-dark maxwidth580">{discussMessage.name}</a>:"" className="fl mt3 font-16 font-bd color-dark maxwidth580">{discussMessage.name}</Link>:""
} }
{ {
this.props.isStudent? <a href={`/courses/${this.props.match.params.coursesId}/${this.state.shixuntypes}/${discussMessage.homework_id}/list?tab=0`} this.props.isStudent? <Link to={`/courses/${this.props.match.params.coursesId}/${this.state.shixuntypes}/${discussMessage.homework_id}/list?tab=0`}
title={discussMessage.name} title={discussMessage.name}
className="fl mt3 font-16 font-bd color-dark maxwidth580">{discussMessage.name}</a>:"" className="fl mt3 font-16 font-bd color-dark maxwidth580">{discussMessage.name}</Link>:""
} }
{ {
this.props.isNotMember===true? this.props.discussMessage.private_icon===true? this.props.isNotMember===true? this.props.discussMessage.private_icon===true?
<span className="fl mt3 font-16 font-bd color-dark maxwidth580" title={discussMessage.name}>{discussMessage.name}</span> <span className="fl mt3 font-16 font-bd color-dark maxwidth580" title={discussMessage.name}>{discussMessage.name}</span>
: <a href={`/courses/${this.props.match.params.coursesId}/${this.state.shixuntypes}/${discussMessage.homework_id}/list?tab=0`} : <Link to={`/courses/${this.props.match.params.coursesId}/${this.state.shixuntypes}/${discussMessage.homework_id}/list?tab=0`}
title={discussMessage.name} title={discussMessage.name}
className="fl mt3 font-16 font-bd color-dark maxwidth580">{discussMessage.name}</a>:"" className="fl mt3 font-16 font-bd color-dark maxwidth580">{discussMessage.name}</Link>:""
} }
@ -383,9 +379,9 @@ class ShixunhomeWorkItem extends Component{
` `
} }
</style> </style>
{this.props.isAdmin?<div className={this.props.isAdminOrCreator()?"homepagePostSetting homepagePostSettingname":"homepagePostSetting homepagePostSettingbox"} style={{"right":"-2px","top":"44px","display":"block"}}> {this.props.isAdmin?<div onClick={(event)=>this.stopPro(event)} className={this.props.isAdminOrCreator()?"homepagePostSetting homepagePostSettingname":"homepagePostSetting homepagePostSettingbox"} style={{"right":"-2px","top":"44px","display":"block"}}>
<a className="btn colorblue font-16" href={"/shixuns/"+discussMessage.shixun_identifier+"/challenges"} target={"_blank"}>实训详情</a> <Link className="btn colorblue font-16" to={"/shixuns/"+discussMessage.shixun_identifier+"/challenges"} target={"_blank"}>实训详情</Link>
{this.props.isAdminOrCreator()?<a onClick={()=>this.editname(discussMessage.name,discussMessage.homework_id)} className={"btn colorblue ml20 font-16"}>重命名</a>:""} {this.props.isAdminOrCreator()?<a onClick={(event)=>this.editname(discussMessage.name,discussMessage.homework_id,event)} className={"btn colorblue ml20 font-16"}>重命名</a>:""}
{/*<WordsBtn className="btn colorblue ml20 font-16" to={`/courses/${this.props.match.params.coursesId}/${this.state.shixuntypes}/${discussMessage.homework_id}/settings?tab=3`} > 设置</WordsBtn>*/} {/*<WordsBtn className="btn colorblue ml20 font-16" to={`/courses/${this.props.match.params.coursesId}/${this.state.shixuntypes}/${discussMessage.homework_id}/settings?tab=3`} > 设置</WordsBtn>*/}
<WordsBtn className="btn colorblue font-16 ml15" to={`/courses/${this.props.match.params.coursesId}/${this.state.shixuntypes}/${discussMessage.homework_id}/settings?tab=3`} > 设置</WordsBtn> <WordsBtn className="btn colorblue font-16 ml15" to={`/courses/${this.props.match.params.coursesId}/${this.state.shixuntypes}/${discussMessage.homework_id}/settings?tab=3`} > 设置</WordsBtn>
</div>:""} </div>:""}
@ -408,6 +404,7 @@ class ShixunhomeWorkItem extends Component{
</div> </div>
</div> </div>
</React.Fragment>
) )
} }
} }

@ -587,6 +587,8 @@ class ShixunHomework extends Component{
let {Coursename,page}=this.state; let {Coursename,page}=this.state;
this.setState({ this.setState({
order: e.key, order: e.key,
checkBoxValues:[],
checkedtype:false,
isSpin:true isSpin:true
}); });
let newkey=e.key; let newkey=e.key;
@ -655,6 +657,7 @@ class ShixunHomework extends Component{
} }
savedelete=()=>{ savedelete=()=>{
let {Coursename,page,order,checkBoxValues,datas}=this.state; let {Coursename,page,order,checkBoxValues,datas}=this.state;
let category_id=this.props.match.params.category_id; let category_id=this.props.match.params.category_id;
@ -1019,8 +1022,8 @@ class ShixunHomework extends Component{
<div className="edu-back-white"> <div className="edu-back-white">
<p className="clearfix padding30 bor-bottom-greyE"> <p className="clearfix padding30 bor-bottom-greyE">
<p style={{height: '20px'}}> <p style={{height: '20px'}}>
<span className="font-18 fl color-dark-21">{datas&&datas.category_name===undefined||datas&&datas.category_name===null?datas&&datas.main_category_name:datas&&datas.category_name+" 作业列表"}</span> {/*<span className="font-18 fl color-dark-21">{datas&&datas.category_name===undefined||datas&&datas.category_name===null?datas&&datas.main_category_name:datas&&datas.category_name+" 作业列表"}</span>*/}
{/* <span className="font-18 fl color-dark-21">实训作业</span>*/} <span className="font-18 fl color-dark-21">实训作业</span>
<li className="fr"> <li className="fr">
{this.props.isAdmin()===true?datas&&datas.category_name===undefined||datas&&datas.category_name===null? {this.props.isAdmin()===true?datas&&datas.category_name===undefined||datas&&datas.category_name===null?
<span> <span>
@ -1062,7 +1065,9 @@ class ShixunHomework extends Component{
</div> </div>
</div> </div>
<Spin size="large" spinning={this.state.isSpin}> <Spin size="large" spinning={this.state.isSpin}>
{this.props.isAdmin()===true?<div className="mt20 edu-back-white padding20-30"> {this.props.isAdmin()===true?
datas===undefined?'' :datas.task_count===0?"":
<div className="mt20 edu-back-white padding20-30">
<div className="clearfix"> <div className="clearfix">
<Checkbox className="fl" style={{marginTop:'0px'}}checked={checkedtype} onClick={this.funselect}>已选 {checkBoxValues&&checkBoxValues.length} </Checkbox> <Checkbox className="fl" style={{marginTop:'0px'}}checked={checkedtype} onClick={this.funselect}>已选 {checkBoxValues&&checkBoxValues.length} </Checkbox>
@ -1163,6 +1168,7 @@ class ShixunHomework extends Component{
isClassManagement={this.props.isClassManagement()} isClassManagement={this.props.isClassManagement()}
checkBox={this.props.isAdmin()?<Checkbox value={item.homework_id} key={item.homework_id}></Checkbox>:""} checkBox={this.props.isAdmin()?<Checkbox value={item.homework_id} key={item.homework_id}></Checkbox>:""}
match={this.props.match} match={this.props.match}
index={index}
coursedata={this.props.coursedata} coursedata={this.props.coursedata}
coursupdata={()=>this.homeworkupdatalist(Coursename,page,order)} coursupdata={()=>this.homeworkupdatalist(Coursename,page,order)}
course_identity={datas.course_identity} course_identity={datas.course_identity}
@ -1203,18 +1209,10 @@ class ShixunHomework extends Component{
</div> </div>
<div className="alltask "
style={
{ {
display: datas===undefined?'none' :datas.task_count===0? 'block' : 'none' datas===undefined?'' :datas.task_count===0? <NoneData></NoneData>:""
}
} }
>
<div className="edu-tab-con-box clearfix edu-txt-center"><img className="edu-nodata-img mb20"
src="/images/educoder/nodata.png" />
<p className="edu-nodata-p mb20">暂时还没有相关数据哦</p></div>
</div>
</Spin> </Spin>
</div> </div>
@ -1223,3 +1221,14 @@ class ShixunHomework extends Component{
} }
} }
export default ShixunHomework; export default ShixunHomework;
// {/*<div className="alltask "*/}
// {/*style={*/}
// {/*{*/}
// {/*display: datas===undefined?'none' :datas.task_count===0? 'block' : 'none'*/}
// {/*}*/}
// {/*}*/}
// {/*>*/}
// {/*<div className="edu-tab-con-box clearfix edu-txt-center">*/}
// {/*<img className="edu-nodata-img mb20" src="/images/educoder/nodata.png" />*/}
// {/*<p className="edu-nodata-p mb20">暂时还没有相关数据哦!</p></div>*/}
// {/*</div>*/}

@ -224,12 +224,15 @@ class MainContentContainer extends Component {
} }
componentDidUpdate(prevProps, prevState, snapshot) { componentDidUpdate(prevProps, prevState, snapshot) {
const { game } = this.props const { game, challenge } = this.props
if (game && prevProps.game if (game && prevProps.game
&& prevProps.game.identifier !== game.identifier) { && prevProps.game.identifier !== game.identifier) {
// 切换关卡时,停止轮训 // 切换关卡时,停止轮训
this.oldGameIdentifier = prevProps.game.identifier; this.oldGameIdentifier = prevProps.game.identifier;
this.doFileUpdateRequestOnCodeMirrorBlur(prevProps)
} else if (challenge && (challenge.pathIndex || prevProps.challenge.pathIndex) && challenge.pathIndex != prevProps.challenge.pathIndex) {
this.doFileUpdateRequestOnCodeMirrorBlur(prevProps)
} }
} }
@ -386,8 +389,8 @@ class MainContentContainer extends Component {
} }
doFileUpdateRequestOnCodeMirrorBlur = () => { doFileUpdateRequestOnCodeMirrorBlur = (props) => {
var fileUpdatePromise = this.doFileUpdateRequest(true) var fileUpdatePromise = this.doFileUpdateRequest(true, undefined, props)
if (fileUpdatePromise) { if (fileUpdatePromise) {
fileUpdatePromise.then((resData) => { fileUpdatePromise.then((resData) => {
if (resData.status === -1) { // 保存文件出现异常 if (resData.status === -1) { // 保存文件出现异常
@ -496,7 +499,8 @@ class MainContentContainer extends Component {
} }
// forTest true 是评测时触发的file_update // forTest true 是评测时触发的file_update
doFileUpdateRequest(checkIfCodeChanged, forTest) { doFileUpdateRequest(checkIfCodeChanged, forTest, props) {
const _props = props || this.props;
const { codeStatus } = this.state; const { codeStatus } = this.state;
if (!forTest && codeStatus !== UPDATED) { // 已修改状态才能保存 if (!forTest && codeStatus !== UPDATED) { // 已修改状态才能保存
return; return;
@ -521,7 +525,7 @@ class MainContentContainer extends Component {
}) })
return null; return null;
} }
const { challenge, output_sets, onRunCodeTestFinish, myshixun } = this.props const { challenge, output_sets, onRunCodeTestFinish, myshixun } = _props
// var url = `${locationPath}/file_update?path=${encodeURIComponent(challenge.path)}` // var url = `${locationPath}/file_update?path=${encodeURIComponent(challenge.path)}`
var url = `/myshixuns/${myshixun.identifier}/update_file.json` var url = `/myshixuns/${myshixun.identifier}/update_file.json`

@ -37,6 +37,8 @@ export function ImageLayerOfCommentHOC(options = {}) {
} }
// jQuery._data( $('.newMain')[0], "events" ) // jQuery._data( $('.newMain')[0], "events" )
componentDidMount() { componentDidMount() {
this.props.wrappedComponentRef && this.props.wrappedComponentRef(this.refs['wrappedComponentRef'])
// commentsDelegateParent #game_left_contents #tab_con_4 // commentsDelegateParent #game_left_contents #tab_con_4
setTimeout(() => { setTimeout(() => {
$(options.parentSelector || ".commentsDelegateParent") $(options.parentSelector || ".commentsDelegateParent")
@ -60,7 +62,7 @@ export function ImageLayerOfCommentHOC(options = {}) {
<React.Fragment> <React.Fragment>
<ImageLayer {...this.state} onImageLayerClose={this.onImageLayerClose}></ImageLayer> <ImageLayer {...this.state} onImageLayerClose={this.onImageLayerClose}></ImageLayer>
<WrappedComponent {...this.props} > <WrappedComponent {...this.props} ref="wrappedComponentRef">
</WrappedComponent> </WrappedComponent>
</React.Fragment> </React.Fragment>
) )

@ -14,7 +14,8 @@ class addCollaborators extends Component{
search:'', search:'',
partnerListid:[], partnerListid:[],
checkAll: false, checkAll: false,
optionss:[] optionss:[],
useristrue:false
} }
} }
addBox=()=>{ addBox=()=>{
@ -70,6 +71,13 @@ class addCollaborators extends Component{
let {partnerListid} =this.state; let {partnerListid} =this.state;
let id=this.props.match.params.pathId; let id=this.props.match.params.pathId;
let url="/paths/"+id+"/add_subject_members.json" let url="/paths/"+id+"/add_subject_members.json"
if(partnerListid.length===0){
this.setState({
useristrue:true
})
return
}
axios.post(url,{ axios.post(url,{
user_ids:partnerListid user_ids:partnerListid
}).then((response) => { }).then((response) => {
@ -87,9 +95,17 @@ class addCollaborators extends Component{
} }
addCollaboratorsid=(id)=>{ addCollaboratorsid=(id)=>{
if(id.length===0){
this.setState({ this.setState({
partnerListid:id partnerListid:id,
}) })
}else{
this.setState({
partnerListid:id,
useristrue:false
})
}
} }
onCheckAllChange = (e) => { onCheckAllChange = (e) => {
@ -145,7 +161,7 @@ class addCollaborators extends Component{
} }
render(){ render(){
let {addPartner,search,partnerList,optionss,checkAll,partnerListid} = this.state; let {addPartner,search,partnerList,optionss,checkAll,partnerListid,useristrue} = this.state;
return( return(
this.props.detailInfoList===undefined?"":this.props.detailInfoList.allow_add_member===true? this.props.detailInfoList===undefined?"":this.props.detailInfoList.allow_add_member===true?
@ -199,6 +215,7 @@ class addCollaborators extends Component{
} }
</CheckboxGroup> </CheckboxGroup>
</ul> </ul>
{useristrue===true?<span className={"color-red"}>请先选择用户</span>:""}
<div className="mt20 marginauto clearfix edu-txt-center"> <div className="mt20 marginauto clearfix edu-txt-center">
<a onClick={this.hideAddBox} className="pop_close task-btn mr30">取消</a> <a onClick={this.hideAddBox} className="pop_close task-btn mr30">取消</a>
<a className="task-btn task-btn-orange" onClick={this.SaveAddBox} id="submit_send_shixun">确定</a> <a className="task-btn task-btn-orange" onClick={this.SaveAddBox} id="submit_send_shixun">确定</a>

@ -45,7 +45,8 @@ class Collaborators extends Component {
collaboratorListsumtype:true, collaboratorListsumtype:true,
user_name:undefined, user_name:undefined,
school_name:undefined, school_name:undefined,
spinnings:false spinnings:false,
useristrue:false
} }
} }
componentDidMount() { componentDidMount() {
@ -217,10 +218,20 @@ class Collaborators extends Component {
} else { } else {
alltype = false alltype = false
} }
if(newlist.length===0){
this.setState({
Searchadmin: newlist,
allChangechecked: alltype,
})
}else{
this.setState({ this.setState({
Searchadmin: newlist, Searchadmin: newlist,
allChangechecked: alltype allChangechecked: alltype,
useristrue:false
}) })
}
} }
allChange = (e) => { allChange = (e) => {
@ -260,6 +271,13 @@ class Collaborators extends Component {
} }
} }
} }
if(user_ids.length===0){
this.setState({
useristrue:true
})
return
}
let url = "/shixuns/" + id + "/shixun_members_added.json"; let url = "/shixuns/" + id + "/shixun_members_added.json";
axios.post(url, { axios.post(url, {
user_ids: user_ids user_ids: user_ids
@ -405,7 +423,8 @@ class Collaborators extends Component {
collaboratorListsum, collaboratorListsum,
collaboratorListsumtype, collaboratorListsumtype,
user_name, user_name,
school_name school_name,
useristrue
} = this.state; } = this.state;
let {loadingContent} = this.props; let {loadingContent} = this.props;
const radioStyle = { const radioStyle = {
@ -547,7 +566,7 @@ class Collaborators extends Component {
</div> </div>
{useristrue===true?<span className={"color-red"}>请先选择用户</span>:""}
<div className="clearfix edu-txt-center mt20"> <div className="clearfix edu-txt-center mt20">
<a className="pop_close task-btn mb10 mr40 colorFFF" <a className="pop_close task-btn mb10 mr40 colorFFF"
onClick={() => this.CollaboratorsshowModal("cooperation")}>取消</a> onClick={() => this.CollaboratorsshowModal("cooperation")}>取消</a>

@ -8,7 +8,7 @@ import "./usersInfo.css"
import "../../courses/css/members.css" import "../../courses/css/members.css"
import "../../courses/css/Courses.css" import "../../courses/css/Courses.css"
import banner from '../../../images/account/infobanner.png' import { LinkAfterLogin } from 'educoder'
class InfosBanner extends Component{ class InfosBanner extends Component{
constructor(props){ constructor(props){
@ -69,7 +69,14 @@ class InfosBanner extends Component{
</span> </span>
: :
<span className="fl mt35 ml60"> <span className="fl mt35 ml60">
<a href={`/messages/${login}/message_detail?target_ids=${id}`} className="user_default_btn user_yellow_btn fl font-18">私信</a> <LinkAfterLogin
{...this.props}
{...this.state}
className="user_default_btn user_yellow_btn fl font-18"
to={`/messages/${login}/message_detail?target_ids=${id}`}
>
私信
</LinkAfterLogin>
</span> </span>
} }
</div> </div>
@ -83,7 +90,7 @@ class InfosBanner extends Component{
<li className={`${moduleName == 'shixuns' ? 'active' : '' }`}> <li className={`${moduleName == 'shixuns' ? 'active' : '' }`}>
<Link <Link
onClick={() => this.setState({moduleName: 'shixuns'})} onClick={() => this.setState({moduleName: 'shixuns'})}
to={`/users/${username}/shixuns`}>实训项目</Link> to={`/users/${username}/shixuns`}>开发社区</Link>
</li> </li>
<li className={`${moduleName == 'paths' ? 'active' : '' }`}> <li className={`${moduleName == 'paths' ? 'active' : '' }`}>
<Link <Link
@ -93,7 +100,7 @@ class InfosBanner extends Component{
<li className={`${moduleName == 'projects' ? 'active' : '' }`}> <li className={`${moduleName == 'projects' ? 'active' : '' }`}>
<Link <Link
onClick={() => this.setState({moduleName: 'projects'})} onClick={() => this.setState({moduleName: 'projects'})}
to={`/users/${username}/projects`}>开发项目</Link> to={`/users/${username}/projects`}>项目</Link>
</li> </li>
<li className={`${moduleName == 'package' ? 'active' : '' }`}> <li className={`${moduleName == 'package' ? 'active' : '' }`}>
<Link <Link

@ -130,7 +130,7 @@ class InfosCourse extends Component{
this.props.current_user && this.props.current_user.user_identity != "学生" ? <Create href={"/courses/new"} name={"新建课堂"} index="1"></Create> : "" this.props.current_user && this.props.current_user.user_identity != "学生" ? <Create href={"/courses/new"} name={"新建课堂"} index="1"></Create> : ""
} }
{ {
(!data || data.courses.length==0) && (!is_current || (this.props.current_user && this.props.current_user.user_identity === "学生" )) && <NoneData></NoneData> (!data || (data && data.courses.length==0)) && category && <NoneData></NoneData>
} }
{ {
data && data.courses && data.courses.map((item,key)=>{ data && data.courses && data.courses.map((item,key)=>{

@ -152,7 +152,7 @@ class InfosPath extends Component{
this.props.current_user && this.props.current_user.user_identity != "学生" ? <Create href={"/paths/new"} name={"新建实践课程"} index="3"></Create>:"" this.props.current_user && this.props.current_user.user_identity != "学生" ? <Create href={"/paths/new"} name={"新建实践课程"} index="3"></Create>:""
} }
{ {
(!data || data.subjects.length==0) && (!is_current || (this.props.current_user && this.props.current_user.user_identity === "学生" )) && <NoneData></NoneData> (!data || (data && data.subjects.length==0)) && category && <NoneData></NoneData>
} }
{ {
data && data.subjects && data.subjects.map((item,key)=>{ data && data.subjects && data.subjects.map((item,key)=>{

@ -125,7 +125,7 @@ class InfosProject extends Component{
<Create href={`${this.props.Headertop && this.props.Headertop.old_url}/projects/new`} name={"新建开发项目"} index="4"></Create>:"" <Create href={`${this.props.Headertop && this.props.Headertop.old_url}/projects/new`} name={"新建开发项目"} index="4"></Create>:""
} }
{ {
(!data || data.projects.length==0) && (!is_current || (this.props.current_user && this.props.current_user.user_identity === "学生" )) && <NoneData></NoneData> (!data || (data && data.projects.length==0)) && category && <NoneData></NoneData>
} }
{ {
data && data.projects && data.projects.map((item,key)=>{ data && data.projects && data.projects.map((item,key)=>{

@ -1,14 +1,11 @@
import React, { Component } from 'react'; import React, { Component } from 'react';
import { SnackbarHOC } from 'educoder';
import {BrowserRouter as Router,Route,Switch} from 'react-router-dom'; import { Pagination , Spin } from 'antd';
import {Tooltip,Menu,Pagination,Spin} from 'antd';
import Loadable from 'react-loadable';
import Loading from '../../../Loading';
import NoneData from '../../courses/coursesPublic/NoneData' import NoneData from '../../courses/coursesPublic/NoneData'
import axios from 'axios'; import axios from 'axios';
import {getImageUrl,setImagesUrl} from 'educoder'; import { setImagesUrl } from 'educoder';
import { TPMIndexHOC } from '../../tpm/TPMIndexHOC';
import { CNotificationHOC } from '../../courses/common/CNotificationHOC'
import "./usersInfo.css" import "./usersInfo.css"
import Create from './publicCreatNew' import Create from './publicCreatNew'
@ -115,7 +112,7 @@ class InfosShixun extends Component{
totalCount, totalCount,
isSpin isSpin
} = this.state; } = this.state;
let isStudent = this.props.isStudent();
let is_current=this.props.is_current; let is_current=this.props.is_current;
return( return(
<div className="educontent"> <div className="educontent">
@ -161,16 +158,14 @@ class InfosShixun extends Component{
<Create href={"/shixuns/new"} name={"新建实训"} index="2"></Create>:"" <Create href={"/shixuns/new"} name={"新建实训"} index="2"></Create>:""
} }
{ {
(!data || data.shixuns.length==0) && (!is_current || (this.props.current_user && this.props.current_user.user_identity === "学生" )) && <NoneData></NoneData> (!data || (data && data.shixuns.length==0)) && category && <NoneData></NoneData>
} }
{ {
data && data.shixuns && data.shixuns.map((item,key)=>{ data && data.shixuns && data.shixuns.map((item,key)=>{
return( return(
<div className="square-Item" onClick={()=>this.turnToCourses(`/shixuns/${item.identifier}/challenges`)}> <div className="square-Item" onClick={()=>this.turnToCourses(`/shixuns/${item.identifier}/challenges`)}>
{ {
item.tag && <div className="tag-green"><span className="tag-name">{item.tag}</span> item.tag && <div className="tag-green"><span className="tag-name">{item.tag}</span><img className="fl" src={setImagesUrl("images/educoder/tag2.png")}/></div>
{/*<img className="fl" src={setImagesUrl("images/educoder/tag2.png")}/>*/}
</div>
} }
<a href="javascript:void(0)" className="square-img"> <a href="javascript:void(0)" className="square-img">
<img src={setImagesUrl(`${item.image_url}`)}/> <img src={setImagesUrl(`${item.image_url}`)}/>

@ -0,0 +1,6 @@
/*global __webpack_public_path__ */
if (window._enableCDN && window.location.host == 'pre-newweb.educoder.net') {
__webpack_public_path__ = 'http://testali-cdn.educoder.net/react/build/'
} else if (window._enableCDN && window.location.host == 'www.educoder.net') {
__webpack_public_path__ = 'https://ali-newweb.educoder.net/react/build/'
}
Loading…
Cancel
Save