Merge branches 'dev_aliyun' and 'onigin/ysl_a' of https://bdgit.educoder.net/Hjqreturn/educoder into onigin/ysl_a

# Conflicts:
#	public/react/src/modules/courses/Resource/Fileslistitem.js
#	public/react/src/modules/courses/busyWork/CommonWorkItem.js
#	public/react/src/modules/courses/exercise/ExerciseListItem.js
#	public/react/src/modules/courses/graduation/tasks/GraduateTaskItem.js
#	public/react/src/modules/courses/graduation/topics/GraduateTopicItem.js
#	public/react/src/modules/courses/poll/PollListItem.js
#	public/react/src/modules/courses/shixunHomework/ShixunhomeWorkItem.js
#	public/react/src/modules/login/LoginDialog.js
dev_newshixunModel
杨树明 5 years ago
commit 94721dca44

@ -1,4 +1,4 @@
class ReachCriteriaController < Ecs::BaseController
class Ecs::ReachCriteriaController < Ecs::BaseController
before_action :check_major_manager_permission!, only: [:create]
def create

@ -431,6 +431,7 @@ class GamesController < ApplicationController
# params[:status] 1: 目录树点击的请求 0正常自动加载
# 返回参数status -1 系统统一报错提示;-3 需要轮训重试带retry参数-4 立即重试
def rep_content
raise("666")
challenge_path = @game.challenge.try(:path)
if challenge_path.blank?
tip_exception("代码获取异常,请检查实训模板的评测设置是否正确")

@ -28,6 +28,16 @@ class Fileslistitem extends Component{
}
showfiles=(list)=>{
if(this.props.checkIfLogin()===false){
this.props.showLoginDialog()
return
}
if(this.props.checkIfProfileCompleted()===false){
this.props.showProfileCompleteDialog()
return
}
if(list.is_history_file===false){
// this.props.DownloadFileA(list.title,list.url)
//window.location.href=list.url;
@ -194,9 +204,6 @@ class Fileslistitem extends Component{
text-overflow:ellipsis;
white-space:nowrap
}
.fileslistitemsA{
}
`}</style>
<div className="clearfix ds pr contentSection" style={{cursor : this.props.isAdmin ? "pointer" : "default"}} onClick={() => window.$(`.sourceitem${index} input`).click() }>
<h6 onClick={(event)=>this.eventStop(event)}>
@ -208,23 +215,25 @@ class Fileslistitem extends Component{
// href={"/courses/" + coursesId + "/graduation/graduation_tasks/" + categoryid + "/" + taskid + "/list"}
onClick={()=>this.showfiles(discussMessage)}
title={discussMessage.title}
className=" fl mt3 font-16 font-bd color-dark maxwidth580">{discussMessage.title}</a> : ""
className="fl mt3 font-16 font-bd color-dark maxwidth580">{discussMessage.title}</a> : ""
}
{
this.props.isStudent? <a
onClick={()=>this.showfiles(discussMessage)}
title={discussMessage.title}
className=" fl mt3 font-16 font-bd color-dark maxwidth580">{discussMessage.title}</a> :""
className="fl mt3 font-16 font-bd color-dark maxwidth580">{discussMessage.title}</a> :""
}
{
this.props.isNotMember===true?
discussMessage.is_lock === true ?
<span className=" fl mt3 font-16 font-bd color-dark maxwidth580">{discussMessage.title}</span>
<Tooltip title={"私有属性,非课堂成员不能访问"} placement="bottom">
<span className="fl mt3 font-16 font-bd color-dark maxwidth580 pointer">{discussMessage.title}</span>
</Tooltip>
:<a
onClick={()=>this.showfiles(discussMessage)}
title={discussMessage.title}
className=" fl mt3 font-16 font-bd color-dark maxwidth580">{discussMessage.title}</a>:""
className="fl mt3 font-16 font-bd color-dark maxwidth580">{discussMessage.title}</a>:""
}

@ -113,31 +113,36 @@ class Fileslists extends Component{
updadatalist=(id)=>{
// this.seactall(id)
let coursesId=this.props.match.params.coursesId;
let url="/courses/"+coursesId+"/attahcment_category_list.json";
axios.get(url, {
}).then((response) => {
if(response!=undefined){
if(response.data&&response.data) {
if (response.data.status != 401) {
let list = response.data.course_modules;
let course_second_categoriess;
list.map((item, key) => {
course_second_categoriess = item.course_second_categories
})
this.setState({
course_modules: response.data,
has_course_groups: response.data.has_course_groups,
course_second_categories: course_second_categoriess
})
if(this.props.user&&this.props.user.login=== ""||this.props.user&&this.props.user.login=== null||this.props.user&&this.props.user.login=== undefined){
}else{
let coursesId=this.props.match.params.coursesId;
let url="/courses/"+coursesId+"/attahcment_category_list.json";
axios.get(url, {
}).then((response) => {
if(response!=undefined){
if(response.data&&response.data) {
if (response.data.status != 401) {
let list = response.data.course_modules;
let course_second_categoriess;
list.map((item, key) => {
course_second_categoriess = item.course_second_categories
})
this.setState({
course_modules: response.data,
has_course_groups: response.data.has_course_groups,
course_second_categories: course_second_categoriess
})
}
}
}
}
})
}
})
}
updatafiled=()=>{
if(this.props.match.params.main_id){

@ -1,115 +1,126 @@
import React,{ Component } from "react";
import {Tooltip} from 'antd'
import moment from 'moment'
import { getUrl, WordsBtn } from 'educoder'
class BoardsListItem extends Component{
constructor(props){
super(props);
this.state = {
}
}
onTitleClick = (discussMessage) => {
const isAdminOrStudent = this.props.isAdminOrStudent();
if (!isAdminOrStudent && discussMessage.is_public == false) {
// 没有权限访问
return;
}
const cid = this.props.match.params.coursesId
const board_id = this.props.match.params.boardId
this.props.toDetailPage(cid, board_id, discussMessage.id)
}
render(){
let { addGroup } = this.state;
const isAdmin = this.props.isAdmin()
const isAdminOrStudent = this.props.isAdminOrStudent()
const { checkBox, discussMessage, onSticky, onItemClick, current_user } = this.props;
if (!discussMessage || !discussMessage.author) {
return '';
}
let canNotLink = !isAdminOrStudent && discussMessage.is_public == false
return(
<div className="panel-inner-fourm boardsList">
<style>{`
.boardsList .panel-list-img {
width: 50px;
height: 50px;
}
`}</style>
{ checkBox }
<a href={`/users/${discussMessage.author.login}`} alt="用户" style={{"width":"50px","height":"50px","display":"block", margin: "0 10px"}}>
{/* /images/avatars/User/1?1529221779 */}
<img
alt="1?1529221779" className="panel-list-img mr15" height="50"
src={`${getUrl()}/images/${discussMessage.author.image_url}`} width="50"
></img>
</a>
<div className="clearfix ds pr pt5 contentSection" onClick={() => onItemClick(discussMessage)}>
<h6>
<a href="javascript:void(0)" className="panel-list-title hide fl mt5 color-dark font-bd"
style={{ fontWeight: 'bold', cursor: (canNotLink ? 'default' : 'poninter'), maxWidth: '700px' }}
onClick={canNotLink ? () => {} : () => this.onTitleClick(discussMessage)}
title={`${discussMessage.subject.length > 40 ? discussMessage.subject : ''}`}
>{discussMessage.subject}</a>
{ !!discussMessage.sticky && <span className="btn-cir btn-cir-red fl mt5 ml5">置顶</span> }
{
discussMessage.is_public == false ? (<Tooltip title={`${isAdminOrStudent ? '私有属性' : '私有属性,非课堂成员不能访问'}`}>
<i className="iconfont icon-guansuo color-grey-c ml10 font-16 fl mt4"></i>
</Tooltip>) : ""
}
</h6>
<div className="cl"></div>
<p className="color-grey panel-lightgrey mt18 fl">
<span className="mr50">
<a href={`/users/${discussMessage.author.login}`} className="panel-name-small hide fl mr15 mr30 color-grey3 font-14">{discussMessage.author.name}</a>
{ discussMessage.total_replies_count != 0 && <span className="mr15 color-grey9 font-14">{discussMessage.total_replies_count} 回复</span> }
{ discussMessage.praises_count != 0 && <span className="mr15 color-grey9 font-14">{discussMessage.praises_count} 点赞</span> }
{ discussMessage.visits != 0 && <span className="mr15 color-grey9 font-14">{discussMessage.visits} 浏览</span> }
<span className="mr15 color-light-grey-C font-14">{moment(discussMessage.created_on).fromNow()} </span>
</span>
</p>
<div className="fr mt15">
{(isAdmin || discussMessage.author.login == current_user.login) &&
<WordsBtn style="blue" className="fl font-16 ml28"
onClick={(e) => { this.props.toEditPage(this.props.match.params.coursesId, this.props.match.params.boardId, discussMessage.id )} }>编辑</WordsBtn> }
{ isAdmin && <WordsBtn style="blue" className="fl font-16 ml28"
onClick={(e) => { debugger; onSticky(discussMessage); e.cancelBubble = true; e.stopPropagation();}}>
{ discussMessage.sticky ? '取消置顶' : '置顶' }</WordsBtn> }
</div>
{/* { (isAdmin || discussMessage.author.login == current_user.login) &&
<div className="homepagePostSetting" style={{"right":"4px","top":"5px","display":"block"}}>
<ul>
<li className="edu-position edu-position-hidebox">
<i className="fa fa-bars color-grey-b"></i>
<ul className="edu-position-hide undis">
{(isAdmin || discussMessage.author.login == current_user.login) && <li><a href="javascript:void(0)" onClick={(e) => {
this.props.toEditPage(this.props.match.params.coursesId, this.props.match.params.boardId, discussMessage.id )} } >编辑</a></li>
}
{isAdmin && <li><a href="javascript:void(0)" onClick={(e) => { debugger; onSticky(discussMessage); e.cancelBubble = true; e.stopPropagation();} }>
{ discussMessage.sticky ? '取消置顶' : '置顶' }
</a></li>
}
</ul>
</li>
</ul>
</div>
} */}
</div>
</div>
)
}
}
import React,{ Component } from "react";
import {Tooltip} from 'antd'
import moment from 'moment'
import { getUrl, WordsBtn } from 'educoder'
class BoardsListItem extends Component{
constructor(props){
super(props);
this.state = {
}
}
onTitleClick = (discussMessage) => {
if(this.props.checkIfLogin()===false){
this.props.showLoginDialog()
return
}
if(this.props.checkIfProfileCompleted()===false){
this.props.showProfileCompleteDialog()
return
}
const isAdminOrStudent = this.props.isAdminOrStudent();
if (!isAdminOrStudent && discussMessage.is_public == false) {
// 没有权限访问
return;
}
const cid = this.props.match.params.coursesId
const board_id = this.props.match.params.boardId
this.props.toDetailPage(cid, board_id, discussMessage.id)
}
render(){
let { addGroup } = this.state;
const isAdmin = this.props.isAdmin()
const isAdminOrStudent = this.props.isAdminOrStudent()
const { checkBox, discussMessage, onSticky, onItemClick, current_user } = this.props;
if (!discussMessage || !discussMessage.author) {
return '';
}
let canNotLink = !isAdminOrStudent && discussMessage.is_public == false
return(
<div className="panel-inner-fourm boardsList">
<style>{`
.boardsList .panel-list-img {
width: 50px;
height: 50px;
}
`}</style>
{ checkBox }
<a href={`/users/${discussMessage.author.login}`} alt="用户" style={{"width":"50px","height":"50px","display":"block", margin: "0 10px"}}>
{/* /images/avatars/User/1?1529221779 */}
<img
alt="1?1529221779" className="panel-list-img mr15" height="50"
src={`${getUrl()}/images/${discussMessage.author.image_url}`} width="50"
></img>
</a>
<div className="clearfix ds pr pt5 contentSection" onClick={() => onItemClick(discussMessage)}>
<h6>
<Tooltip title={canNotLink?"私有属性,非课堂成员不能访问":`${discussMessage.subject.length > 40 ? discussMessage.subject : ''}`} placement="bottom">
<a className="panel-list-title hide fl mt5 color-dark font-bd pointer"
style={{ fontWeight: 'bold', cursor: (canNotLink ? 'poninter' : 'poninter'), maxWidth: '700px' }}
onClick={canNotLink ? () => {} : () => this.onTitleClick(discussMessage)}
>{discussMessage.subject}</a>
</Tooltip>
{ !!discussMessage.sticky && <span className="btn-cir btn-cir-red fl mt5 ml5">置顶</span> }
{
discussMessage.is_public == false ? (<Tooltip title={`${isAdminOrStudent ? '私有属性' : '私有属性,非课堂成员不能访问'}`} placement="bottom">
<i className="iconfont icon-guansuo color-grey-c ml10 font-16 fl mt4"></i>
</Tooltip>) : ""
}
</h6>
<div className="cl"></div>
<p className="color-grey panel-lightgrey mt18 fl">
<span className="mr50">
<a href={`/users/${discussMessage.author.login}`} className="panel-name-small hide fl mr15 mr30 color-grey3 font-14">{discussMessage.author.name}</a>
{ discussMessage.total_replies_count != 0 && <span className="mr15 color-grey9 font-14">{discussMessage.total_replies_count} 回复</span> }
{ discussMessage.praises_count != 0 && <span className="mr15 color-grey9 font-14">{discussMessage.praises_count} 点赞</span> }
{ discussMessage.visits != 0 && <span className="mr15 color-grey9 font-14">{discussMessage.visits} 浏览</span> }
<span className="mr15 color-light-grey-C font-14">{moment(discussMessage.created_on).fromNow()} </span>
</span>
</p>
<div className="fr mt15">
{(isAdmin || discussMessage.author.login == current_user.login) &&
<WordsBtn style="blue" className="fl font-16 ml28"
onClick={(e) => { this.props.toEditPage(this.props.match.params.coursesId, this.props.match.params.boardId, discussMessage.id )} }>编辑</WordsBtn> }
{ isAdmin && <WordsBtn style="blue" className="fl font-16 ml28"
onClick={(e) => { debugger; onSticky(discussMessage); e.cancelBubble = true; e.stopPropagation();}}>
{ discussMessage.sticky ? '取消置顶' : '置顶' }</WordsBtn> }
</div>
{/* { (isAdmin || discussMessage.author.login == current_user.login) &&
<div className="homepagePostSetting" style={{"right":"4px","top":"5px","display":"block"}}>
<ul>
<li className="edu-position edu-position-hidebox">
<i className="fa fa-bars color-grey-b"></i>
<ul className="edu-position-hide undis">
{(isAdmin || discussMessage.author.login == current_user.login) && <li><a href="javascript:void(0)" onClick={(e) => {
this.props.toEditPage(this.props.match.params.coursesId, this.props.match.params.boardId, discussMessage.id )} } >编辑</a></li>
}
{isAdmin && <li><a href="javascript:void(0)" onClick={(e) => { debugger; onSticky(discussMessage); e.cancelBubble = true; e.stopPropagation();} }>
{ discussMessage.sticky ? '取消置顶' : '置顶' }
</a></li>
}
</ul>
</li>
</ul>
</div>
} */}
</div>
</div>
)
}
}
export default BoardsListItem;

@ -7,41 +7,33 @@ import CoursesListType from '../coursesPublic/CoursesListType'
import { WordsBtn } from 'educoder'
import AccessoryModal2 from '../coursesPublic/AccessoryModal2'
import AccessoryModal from '../coursesPublic/AccessoryModal'
import LoginDialog from '../../login/LoginDialog';
import axios from 'axios'
class CommonWorkItem extends Component{
constructor(props){
super(props);
this.state = {
aModalVisible: false,
isRender:false,
aModalVisible: false
}
}
onItemClick = (item) => {
// console.log("onItemClick");
// console.log(this.props);
try {
if(this.props.current_user.username==="游客"){
this.setState({
isRender:true,
match:"",
});
return
}
}catch (e) {
}
const isStudent = this.props.isStudent()
if(this.props.checkIfLogin()===false){
this.props.showLoginDialog()
return
}
if(this.props.checkIfProfileCompleted()===false){
this.props.showProfileCompleteDialog()
return
}
const isStudent = this.props.isStudent()
if (isStudent) {
this.props.toWorkQuestionPage(this.props.match.params, item.homework_id)
} else {
this.props.toWorkListPage(this.props.match.params, item.homework_id)
}
};
Modifyloginvalue=()=>{
this.setState({
isRender:false,
})
};
}
sendMoreAttachment = (item) => {
this.handleItem = item;
const url = `/student_works/${item.work_id}/supply_attachments.json`
@ -123,7 +115,7 @@ class CommonWorkItem extends Component{
render(){
let { mainList,workType }=this.props;
const { aModalVisible, fileList, revise_reason,isRender } = this.state
const { aModalVisible, fileList, revise_reason } = this.state
let coursesId = this.props.match.params.coursesId;
const isStudent = this.props.isStudent()
@ -138,11 +130,6 @@ class CommonWorkItem extends Component{
fileList={fileList}
description={revise_reason}
></AccessoryModal2> */}
{isRender===true?<LoginDialog
Modifyloginvalue={()=>this.Modifyloginvalue()}
{...this.props}
{...this.state}
/>:""}
<style>
{
`
@ -152,9 +139,6 @@ class CommonWorkItem extends Component{
text-overflow: ellipsis;
white-space: nowrap;
}
.commonworkitemA{
}
`
}
</style>
@ -171,23 +155,15 @@ class CommonWorkItem extends Component{
}
<div className="flex1" onClick={() => this.props.onItemClick(Object.assign({}, item, {id: item.homework_id})) }>
<p className="clearfix mb20">
<style>
{
`
.commonworkitemA{
}
`
}
</style>
<a title={item.name}
className="fl font-16 font-bd mt2 comnonwidth580" style={{cursor: canNotLink ? 'default' : 'poninter'}}
onClick={ canNotLink ? () => {} : () => this.onItemClick(item)}
>{item.name}</a>
<Tooltip title={ canNotLink ? "私有属性,非课堂成员不能访问" : item.name} placement="bottom" >
<span className="fl font-16 font-bd mt2 comnonwidth580 pointer" style={{cursor: canNotLink ? 'poninter' : 'poninter'}}
onClick={ canNotLink ? () => {} : () => this.onItemClick(item)}
>{item.name}</span>
</Tooltip>
{/* 只有非课堂成员且作业是私有的情况下才会为true */}
{
item.private_icon===true ?
(<Tooltip title={ isAdminOrStudent ? "私有属性" : "私有属性,非课堂成员不能访问"}>
(<Tooltip title={ isAdminOrStudent ? "私有属性" : "私有属性,非课堂成员不能访问"} placement="bottom" >
<i className="iconfont icon-guansuo color-grey-c ml10 font-16 fl"></i>
</Tooltip>) : ""
}
@ -217,7 +193,7 @@ class CommonWorkItem extends Component{
{item.uncommit_count===undefined?"":<span className="mr20 fl">{item.uncommit_count} 未交</span>}
{
item.status_time!="" &&
<Tooltip title={ item.status.indexOf('提交中') != -1 ? '提交剩余时间' :
<Tooltip placement="bottom" title={ item.status.indexOf('提交中') != -1 ? '提交剩余时间' :
item.status.indexOf('补交中') != -1 ? '补交剩余时间' :
item.status.indexOf('申诉中') != -1 ? '申诉剩余时间' :
item.status.indexOf('匿评中') != -1 ? '匿评剩余时间' :

@ -641,7 +641,7 @@ class CommonWorkList extends Component{
timeMsg = '申诉剩余时间'
}
const hasData = student_works && !!student_works.length && page == 1
const hasData = this.state.homework_status && this.state.homework_status.indexOf("未发布") == -1 // student_works && !!student_works.length && page == 1 &&
// console.log(StudentData)
// console.log(student_works)

@ -1045,10 +1045,7 @@ class Coursesleftnav extends Component{
})
: course_modules===undefined?"":course_modules.map((item,key)=>{
if(key===this.props.indexs){
console.log(key)
console.log(this.props.indexs)
}
return(
<div key={key}>
{/*<Tooltip placement="bottom" title={"点击空白处展开二级菜单,点击模块名字跳转到对应模块"}>*/}

@ -10,15 +10,14 @@ import { formatDuring ,handleDateString} from 'educoder';
import '../css/members.css';
import '../css/busyWork.css';
import CourseLayoutcomponent from "./Exercise";
import LoginDialog from '../../login/LoginDialog';
const dataformat="YYYY-MM-DD HH:mm";
const polls_status={1:"未发布",2:"提交中",3:"已截止",4:"已结束"}
class ExerciseListItem extends Component{
constructor(props){
super(props);
this.state={
Modalstype:false,
isRender:false,
Modalstype:false
}
}
@ -41,30 +40,7 @@ class ExerciseListItem extends Component{
})
}
};
Modifyloginvalue=()=>{
this.setState({
isRender:false,
})
};
showfiles =(url)=>{
// console.log("ShixunhomeWorkItemshowfiles");
// console.log( this.props.current_user.username);
try {
if(this.props.current_user.username==="游客"){
this.setState({
isRender:true,
match:"",
});
return
}
}catch (e) {
}
this.props.history.push(url);
// this.props.current_user
};
cancelmodel=()=>{
this.setState({
@ -75,8 +51,22 @@ class ExerciseListItem extends Component{
Loadtype:false
})
}
toDetailPage=(url)=>{
if(this.props.checkIfLogin()===false){
this.props.showLoginDialog()
return
}
if(this.props.checkIfProfileCompleted()===false){
this.props.showProfileCompleteDialog()
return
}
this.props.history.push(url);
}
render(){
let {isRender}=this.state;
let{item,checkBox,index}=this.props;
let {coursesId,Id}=this.props.match.params
const IsAdmin =this.props.isAdmin();
@ -101,11 +91,6 @@ class ExerciseListItem extends Component{
modalSave={this.state.ModalSave}
antIcon={this.state.Modalstypeloding}
></Modals>:""}
{isRender===true?<LoginDialog
Modifyloginvalue={()=>this.Modifyloginvalue()}
{...this.props}
{...this.state}
/>:""}
<style>
{
`
@ -126,25 +111,22 @@ 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>*/}
{
this.props.isAdmin()? <a onClick={()=>this.showfiles(`/courses/${coursesId}/exercises/${item.id}/student_exercise_list?tab=0`)}
className="fl font-16 font-bd mt2 color-grey-3 task-hide comnonwidth580"
this.props.isAdmin()? <a className="fl font-16 font-bd mt2 color-grey-3 task-hide comnonwidth580 pointer"
title={item.exercise_name}
>{item.exercise_name}</a>:""
onClick={()=>this.toDetailPage(`/courses/${coursesId}/exercises/${item.id}/student_exercise_list?tab=0`)}>{item.exercise_name}</a>:""
}
{
this.props.isStudent()?
<a className="fl font-16 font-bd mt2 color-grey-3 task-hide comnonwidth580" title={item.exercise_name}
onClick={()=>this.showfiles(`/courses/${coursesId}/exercises/${item.id}/student_exercise_list?tab=0`)}
>{item.exercise_name}</a>:""
<a className="fl font-16 font-bd mt2 color-grey-3 task-hide comnonwidth580 pointer" title={item.exercise_name} onClick={()=>this.toDetailPage(`/courses/${coursesId}/exercises/${item.id}/student_exercise_list?tab=0`)}>{item.exercise_name}</a>:""
}
{
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>
: <a className="fl font-16 font-bd mt2 color-grey-3 task-hide comnonwidth580" title={item.exercise_name}
onClick={()=>this.showfiles(`/courses/${coursesId}/exercises/${item.id}/student_exercise_list?tab=0`)}
>{item.exercise_name}</a>:""
<Tooltip title={"私有属性,非课堂成员不能访问"} placement="bottom">
<span className="fl mt3 font-16 font-bd color-dark comnonwidth580 pointer" title={item.exercise_name}>{item.exercise_name}</span>
</Tooltip>
: <a className="fl font-16 font-bd mt2 color-grey-3 task-hide comnonwidth580 pointer" title={item.exercise_name} onClick={()=>this.toDetailPage(`/courses/${coursesId}/exercises/${item.id}/student_exercise_list?tab=0`)}>{item.exercise_name}</a>:""
}
{

@ -7,15 +7,14 @@ import axios from 'axios';
import Modals from '../../../modals/Modals';
import Associationmodel from '../../coursesPublic/Associationmodel';
import AccessoryModal from "../../coursesPublic/AccessoryModal";
import LoginDialog from "../../../login/LoginDialog";
class GraduateTaskItem extends Component{
constructor(props){
super(props);
this.state = {
modalname:"关联项目",
visible:false,
isRender:false,
visible:false
}
}
@ -33,11 +32,6 @@ class GraduateTaskItem extends Component{
// isrelate:is_relate
// })
}
Modifyloginvalue=()=>{
this.setState({
isRender:false,
})
};
cannelAssociation=()=>{
@ -138,24 +132,22 @@ class GraduateTaskItem extends Component{
setupdate=()=>{
this.props.funlist
};
showfiles =(url)=>{
// console.log("ShixunhomeWorkItemshowfiles");
// console.log( this.props.current_user.username);
try {
if(this.props.current_user.username==="游客"){
this.setState({
isRender:true,
match:"",
});
return
}
}catch (e) {
}
this.props.history.push(url);
// this.props.current_user
}
toDetailPage=(url)=>{
if(this.props.checkIfLogin()===false){
this.props.showLoginDialog()
return
}
if(this.props.checkIfProfileCompleted()===false){
this.props.showProfileCompleteDialog()
return
}
};
this.props.history.push(url);
}
render(){
let {
Modalstype,
@ -165,8 +157,7 @@ class GraduateTaskItem extends Component{
cardsModalsavetype,
loadtype,
modalname,
visible,
isRender
visible
} = this.state;
const { checkBox,
@ -189,11 +180,7 @@ class GraduateTaskItem extends Component{
modalSave={cardsModalsavetype}
loadtype={loadtype}
/>
{isRender===true?<LoginDialog
Modifyloginvalue={()=>this.Modifyloginvalue()}
{...this.props}
{...this.state}
/>:""}
{visible===true?<Associationmodel
modalname={modalname}
visible={visible}
@ -239,30 +226,28 @@ class GraduateTaskItem extends Component{
text-overflow:ellipsis;
white-space:nowrap
}
.graduatetaskitemA{
}
`}</style>
<h6>
{
this.props.isAdmin?<Link
onClick={()=>this.showfiles("/courses/"+coursesId+"/graduation_tasks/"+categoryid+"/detail/"+taskid+"/list")}
this.props.isAdmin?<a onClick={()=>this.toDetailPage("/courses/"+coursesId+"/graduation_tasks/"+categoryid+"/detail/"+taskid+"/list")}
title={discussMessage.name}
className=" fl mt3 font-16 font-bd color-dark maxwidth580">{discussMessage.name}</Link>:""
className="fl mt3 font-16 font-bd color-dark maxwidth580">{discussMessage.name}</a>:""
}
{
this.props.isStudent? <Link
onClick={()=>this.showfiles("/courses/"+coursesId+"/graduation_tasks/"+categoryid+"/detail/"+taskid+"/list")}
this.props.isStudent? <a onClick={()=>this.toDetailPage("/courses/"+coursesId+"/graduation_tasks/"+categoryid+"/detail/"+taskid+"/list")}
title={discussMessage.name}
className=" fl mt3 font-16 font-bd color-dark maxwidth580">{discussMessage.name}</Link>:""
className="fl mt3 font-16 font-bd color-dark maxwidth580">{discussMessage.name}</a>:""
}
{
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>
:<a onClick={()=>this.showfiles("/courses/"+coursesId+"/graduation_tasks/"+categoryid+"/"+taskid+"/list")}
<Tooltip title={"私有属性,非课堂成员不能访问"} placement="bottom">
<span className="fl mt3 font-16 font-bd color-dark maxwidth580 pointer" >{discussMessage.name}</span>
</Tooltip>
:<a onClick={()=>this.toDetailPage("/courses/"+coursesId+"/graduation_tasks/"+categoryid+"/"+taskid+"/list")}
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}</a>:""
}

@ -4,50 +4,37 @@ import CoursesListType from '../../coursesPublic/CoursesListType';
import { WordsBtn } from 'educoder'
import {Tooltip} from 'antd'
import axios from 'axios'
import LoginDialog from "../../../login/LoginDialog";
const map={0:"待选中",1:"待确认",2:"已确认"}
class GraduateTopicItem extends Component{
constructor(props){
super(props);
this.state = {
isRender:false,
}
}
editTopic=(topicId)=>{
editTopic=(topicId)=>{
let courseId=this.props.match.params.coursesId;
this.props.history.push(`/courses/${courseId}/graduation_topics/${topicId}/edit`);
}
toDetailPage=(topicId)=>{
// console.log("toDetailPage");
// console.log(this.props);
try {
if(this.props.current_user.username==="游客"){
this.setState({
isRender:true,
match:"",
});
return
}
}catch (e) {
}
if(this.props.checkIfLogin()===false){
this.props.showLoginDialog()
return
}
if(this.props.checkIfProfileCompleted()===false){
this.props.showProfileCompleteDialog()
return
}
let courseId=this.props.match.params.coursesId;
this.props.history.push(`/courses/${courseId}/graduation_topics/${topicId}/detail`);
};
Modifyloginvalue=()=>{
this.setState({
isRender:false,
})
};
}
render(){
const { checkBox, discussMessage, index,chooseTopic,
data,
courseId
} = this.props;
const {
isRender
}=this.state;
const isAdmin = this.props.isAdmin();
const isStudent=this.props.isStudent();
const isNotMember=this.props.isNotMember();
@ -56,11 +43,6 @@ class GraduateTopicItem extends Component{
}
return(
<div>
{isRender===true?<LoginDialog
Modifyloginvalue={()=>this.Modifyloginvalue()}
{...this.props}
{...this.state}
/>:""}
<style>
{
`
@ -96,25 +78,21 @@ class GraduateTopicItem extends Component{
text-overflow:ellipsis;
white-space:nowrap
}
.GraduateTopicItemA {
}
`}</style>
<h6>
{
isNotMember?
<a
onClick={() => this.toDetailPage(`${discussMessage.id}`)}
className=" fl mt3 font-16 font-bd color-dark maxwidth580">{discussMessage.name}</a>:""
<Tooltip title={ discussMessage.private_icon===true?"私有属性,非课堂成员不能访问":discussMessage.name} placement="bottom">
<span className="fl mt3 font-16 font-bd color-dark maxwidth580 pointer">{discussMessage.name}</span>
</Tooltip>:""
}
{
isStudent?<a
onClick={() => this.toDetailPage(`${discussMessage.id}`)}
className=" fl mt3 font-16 font-bd color-dark maxwidth580">{discussMessage.name}</a>:""
isStudent?<a onClick={() => this.toDetailPage(`${discussMessage.id}`)}
className="fl mt3 font-16 font-bd color-dark maxwidth580">{discussMessage.name}</a>:""
}
{
isAdmin?<a
onClick={() => this.toDetailPage(`${discussMessage.id}`)} className=" fl mt3 font-16 font-bd color-dark maxwidth580">{discussMessage.name}</a>:""
isAdmin?<a onClick={() => this.toDetailPage(`${discussMessage.id}`)} className="fl mt3 font-16 font-bd color-dark maxwidth580">{discussMessage.name}</a>:""
}
{
discussMessage.private_icon===true?

@ -1,12 +1,11 @@
import React,{ Component } from "react";
import Tooltip from 'material-ui/Tooltip';
import {Tooltip} from 'antd';
import {Link} from 'react-router-dom';
import moment from 'moment';
import CoursesListType from '../coursesPublic/CoursesListType';
import { WordsBtn,formatDuring } from 'educoder';
import '../css/members.css';
import '../css/busyWork.css';
import LoginDialog from '../../login/LoginDialog';
const polls_status={1:"未发布",2:"提交中",3:"已截止",4:"已结束"}
@ -15,34 +14,22 @@ const dataformat="YYYY-MM-DD HH:mm";
class PollListItem extends Component{
constructor(props){
super(props);
this.state={
isRender:false,
}
}
Modifyloginvalue=()=>{
this.setState({
isRender:false,
})
};
showfiles =(url)=>{
// console.log("ShixunhomeWorkItemshowfiles");
// console.log( this.props.current_user.username);
try {
if(this.props.current_user.username==="游客"){
this.setState({
isRender:true,
match:"",
});
return
}
}catch (e) {
}
this.props.history.push(url);
// this.props.current_user
toDetailPage=(url)=>{
};
if(this.props.checkIfLogin()===false){
this.props.showLoginDialog()
return
}
if(this.props.checkIfProfileCompleted()===false){
this.props.showProfileCompleteDialog()
return
}
this.props.history.push(url);
}
render(){
let{isRender}=this.state;
let{item,checkBox,courseType,index}=this.props;
let {coursesId}=this.props.match.params;
@ -62,21 +49,18 @@ class PollListItem extends Component{
{checkBox}
</span>
}
{isRender===true?<LoginDialog
Modifyloginvalue={()=>this.Modifyloginvalue()}
{...this.props}
{...this.state}
/>:""}
<div className="flex1 pr">
<p className="clearfix mb30">
{ canNotLink ? <a className="fl font-16 font-bd mt2 color-grey-3 task-hide" onClick={()=>this.showfiles(`/courses/${coursesId}/polls/${item.id}/detail`)} style={{"maxWidth":"600px", "cursor": "default"}} title={item.polls_name}>{item.polls_name}</a> :
<a
onClick={()=>this.showfiles(`/courses/${coursesId}/polls/${item.id}/detail`)}
className="fl font-16 font-bd mt2 color-grey-3 task-hide" style={{"maxWidth":"600px"}} title={item.polls_name}>{item.polls_name}</a>
{ canNotLink ?
<Tooltip title={courseType.user_permission == 0?"私有属性,非课堂成员不能访问":item.polls_name} placement="bottom">
<span className="fl font-16 font-bd mt2 color-grey-3 task-hide pointer" style={{"maxWidth":"600px"}} >{item.polls_name}</span>
</Tooltip>
:
<a onClick={()=>this.toDetailPage(`/courses/${coursesId}/polls/${item.id}/detail`)} className="fl font-16 font-bd mt2 color-grey-3 task-hide pointer" style={{"maxWidth":"600px"}} title={item.polls_name}>{item.polls_name}</a>
}
{
item.lock_status === 0 ?
<Tooltip title={`${courseType.user_permission == 0 ? "私有属性,非课堂成员不能访问" : "私有属性"}`}>
<Tooltip title={`${courseType.user_permission == 0 ? "私有属性,非课堂成员不能访问" : "私有属性"}`} placement="bottom">
<i className="iconfont icon-guansuo color-grey-c ml10 font-16 fl"></i>
</Tooltip>
:""

@ -7,7 +7,6 @@ import axios from 'axios';
import Modals from '../../modals/Modals';
import Associationmodel from '../coursesPublic/Associationmodel';
import ModalsRename from '../coursesPublic/ModalsRename';
import LoginDialog from '../../login/LoginDialog';
// import '../../css/members.css'
import './style.css'
@ -20,8 +19,7 @@ class ShixunhomeWorkItem extends Component{
modalname:"关联项目",
visible:false,
startbtn:false,
code_review:false,
isRender:false,
code_review:false
}
// console.log("获取到this.propssssssssssss")
// console.log(this.props)
@ -144,29 +142,23 @@ class ShixunhomeWorkItem extends Component{
this.setState({
ModalsRenametype:false,
})
};
Modifyloginvalue=()=>{
this.setState({
isRender:false,
})
};
showfiles =(url)=>{
// console.log("ShixunhomeWorkItemshowfiles");
// console.log( this.props.current_user.username);
try {
if(this.props.current_user.username==="游客"){
this.setState({
isRender:true,
match:"",
});
return
}
}catch (e) {
}
this.props.history.push(url);
// this.props.current_user
}
hrefjumpskip=(url)=>{
};
if(this.props.checkIfLogin()===false){
this.props.showLoginDialog()
return
}
if(this.props.checkIfProfileCompleted()===false){
this.props.showProfileCompleteDialog()
return
}
this.props.history.push(url);
}
render(){
let {
Modalstype,
@ -182,7 +174,7 @@ class ShixunhomeWorkItem extends Component{
startshixunCombattype,
shixunsmessage,
startbtn,
isRender,
} = this.state;
const { checkBox,
@ -203,12 +195,6 @@ class ShixunhomeWorkItem extends Component{
cannerNavmoda={()=>this.cannerNavmoda()}
/>
:""}
{isRender===true?<LoginDialog
Modifyloginvalue={()=>this.Modifyloginvalue()}
{...this.props}
{...this.state}
/>:""}
<Modals
modalsType={Modalstype}
modalsTopval={Modalstopval}
@ -319,29 +305,28 @@ class ShixunhomeWorkItem extends Component{
text-overflow:ellipsis;
white-space:nowrap
}
.ShixunhomeWorkItemA{
}
`}</style>
<h6>
{/*to={`/courses/${this.props.match.params.coursesId}/${discussMessage.homework_id}/jobsettings`}*/}
{
this.props.isAdmin?<a onClick={()=>this.showfiles("/courses/"+this.props.match.params.coursesId+"/"+this.state.shixuntypes+"/"+discussMessage.homework_id+"/list?tab=0")}
title={discussMessage.name}
className=" fl mt3 font-16 font-bd color-dark maxwidth580">{discussMessage.name}</a>:""
this.props.isAdmin?<a onClick={()=>this.hrefjumpskip("/courses/"+this.props.match.params.coursesId+"/"+this.state.shixuntypes+"/"+discussMessage.homework_id+"/list?tab=0")}
title={discussMessage.name}
className="fl mt3 font-16 font-bd color-dark maxwidth580">{discussMessage.name}</a>:""
}
{
this.props.isStudent? <a onClick={()=>this.showfiles(`/courses/${this.props.match.params.coursesId}/${this.state.shixuntypes}/${discussMessage.homework_id}/list?tab=0`)}
this.props.isStudent? <a onClick={()=>this.hrefjumpskip(`/courses/${this.props.match.params.coursesId}/${this.state.shixuntypes}/${discussMessage.homework_id}/list?tab=0`)}
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}</a>:""
}
{
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>
: <a onClick={()=>this.showfiles(`/courses/${this.props.match.params.coursesId}/${this.state.shixuntypes}/${discussMessage.homework_id}/list?tab=0`)}
<Tooltip title={"私有属性,非课堂成员不能访问"} placement="bottom">
<span className="fl mt3 font-16 font-bd color-dark maxwidth580 pointer">{discussMessage.name}</span>
</Tooltip>
: <a onClick={()=>this.hrefjumpskip(`/courses/${this.props.match.params.coursesId}/${this.state.shixuntypes}/${discussMessage.homework_id}/list?tab=0`)}
title={discussMessage.name}
className="fl mt3 font-16 font-bd color-dark maxwidth580">{discussMessage.name}</a>:""
}

@ -84,7 +84,8 @@ class ShixunHomework extends Component{
}
componentDidMount() {
this.setState({
isSpin:true
isSpin:true,
})
if(this.props.match.params.main_id){
this.setState({
@ -108,7 +109,8 @@ class ShixunHomework extends Component{
}
seactall=(id)=>{
this.setState({
isSpin:true
isSpin:true,
checkBoxValues:[]
})
let coursesId=this.props.match.params.coursesId;
let url="/courses/"+coursesId+"/homework_commons.json?type=4";
@ -1080,7 +1082,7 @@ class ShixunHomework extends Component{
</span>:
<WordsBtn style="blue" onClick={()=>this.editDir(datas&&datas.category_name)} className={"mr30 font-16"}>目录重命名</WordsBtn>:""}
{this.props.isAdmin()===true?datas&&datas.category_name===undefined||datas&&datas.category_name===null?<WordsBtn style="blue" className="mr30 font-16" onClick={this.createCommonpath}>选用实践课程</WordsBtn>:"":""}
{this.props.isAdmin()===true?<a className={"btn colorblue font-16"} onClick={()=>this.showNewShixunModelType()}>选用实训</a>:""}
{this.props.isAdmin()===true?<a className={"btn colorblue font-16"} onClick={()=>this.showNewShixunModelType()}>选用实训项目</a>:""}
</li>
</p>

@ -398,13 +398,15 @@ class LoginDialog extends Component {
});
}
handleDialogClose = () => {
// this.setState({
// isRender:true,
// match:"",
// });
// 上头像上面传个""就不是undefined了 就会不隐藏了
console.log(this.props.match)
debugger
if(this.props.match===undefined){
window.location.href="/";
window.location.href="/";
// this.setState({
// isRender: false
// })
// this.props.Modifyloginvalue();
}else{
this.setState({
isRender: false

@ -3,7 +3,6 @@ import {getImageUrl} from 'educoder';
import {Tooltip,Modal,Icon,Spin,message} from 'antd';
import DetailCardsEditAndAdd from './DetailCardsEditAndAdd';
import DetailCardsEditAndEdit from './DetailCardsEditAndEdit';
import AccountProfile from"../../user/AccountProfile";
import { BrowserRouter as Router, Route, Link } from "react-router-dom";
import axios from 'axios';
import { DragDropContext , Draggable, Droppable} from 'react-beautiful-dnd';
@ -201,10 +200,8 @@ class DetailCards extends Component{
return
}
if(this.props.current_user&&this.props.current_user.profile_completed===false){
this.setState({
AccountProfiletype:true
})
if(this.props.checkIfProfileCompleted()===false){
this.props.showProfileCompleteDialog()
return
}
@ -308,16 +305,11 @@ class DetailCards extends Component{
startshixunCombattype:false
})
}
hideAccountProfile=()=>{
this.setState({
AccountProfiletype:false
})
}
render(){
let { pathCardsList,
dropid,
AccountProfiletype,
idsum,
pathCardsedittype,
pathlistedit,
@ -339,11 +331,7 @@ class DetailCards extends Component{
// console.log("zzz"+this.props.MenuItemsindextype)
return(
<div>
{AccountProfiletype===true?<AccountProfile
hideAccountProfile={()=>this.hideAccountProfile()}
{...this.props}
{...this.state}
/>:""}
<Modals
modalsType={Modalstype}

@ -374,7 +374,7 @@ class DetailCardsEditAndAdd extends Component{
<p className="clearfix mb30">
<a onClick={this.AddShixunBox} className="fl defalutGreyBorder color-grey-6 ml37">
<i className="iconfont icon-tianjiafangda fl mr5"></i>
选择实训</a>
选用实训项目</a>
<span id="sx_notice" className="fl ml20 color-grey-9 mt5">选择下面实训后可以通过拖拽进行排序调整</span>
</p>

@ -378,7 +378,7 @@ class DetailCardsEditAndEdit extends Component{
</div>
<p className="clearfix mb30">
<a onClick={this.AddShixunBox} className="fl defalutGreyBorder color-grey-6 ml37">
<i className="iconfont icon-tianjiafangda fl mr5"></i>
<i className="iconfont icon-tianjiafangda fl mr5"></i>
</a>
<span id="sx_notice" className="fl ml20 color-grey-9 mt5">选择下面实训后可以通过拖拽进行排序调整</span>
</p>

@ -5,7 +5,6 @@ import SendPanel from "./sendPanel.js";
import { getImageUrl } from 'educoder';
import axios from 'axios';
import Modals from '../../modals/Modals';
import AccountProfile from"../../user/AccountProfile";
import OpenCourse from './OpenCourse';
import Jointheclass from '../../modals/Jointheclass';
import './DetailTop.css';
@ -30,7 +29,7 @@ class DetailTop extends Component{
Pathcourseid:undefined,
OpenCourseTypes:false,
putappointmenttype:false,
getappointmenttype:false
getappointmenttype:false,
}
}
componentDidMount(){
@ -250,7 +249,7 @@ class DetailTop extends Component{
return
}
if(this.props.current_user&&this.props.current_user.profile_completed===false){
if(this.props.checkIfProfileCompleted()===false){
this.props.showProfileCompleteDialog()
return
}
@ -269,10 +268,8 @@ class DetailTop extends Component{
return
}
if(this.props.current_user&&this.props.current_user.profile_completed===false){
this.setState({
AccountProfiletype:true
})
if(this.props.checkIfProfileCompleted()===false){
this.props.showProfileCompleteDialog()
return
}
@ -336,14 +333,10 @@ class DetailTop extends Component{
})
}
hideAccountProfile=()=>{
this.setState({
AccountProfiletype:false
})
}
render(){
let{detailInfoList}=this.props;
let{Modalstype,Modalstopval,cardsModalcancel,putappointmenttype,Modalsbottomval,cardsModalsavetype,loadtype,getappointmenttype,AccountProfiletype}=this.state;
let{Modalstype,Modalstopval,cardsModalcancel,putappointmenttype,Modalsbottomval,cardsModalsavetype,loadtype,getappointmenttype}=this.state;
const radioStyle = {
display: 'block',
height: '30px',
@ -373,11 +366,7 @@ class DetailTop extends Component{
return(
<div className={this.props.courses===undefined?"subhead":this.props.courses.length===0?applypath===true?"subhead mb100":"subhead":applypath===false?detailInfoList.name.length>40?"subhead mb100":"subhead mb70":this.state.MenuItemskey===this.props.courses.length?"subhead mb120":detailInfoList.name.length>40?"subhead mb100":"subhead mb80"}>
{AccountProfiletype===true?<AccountProfile
hideAccountProfile={()=>this.hideAccountProfile()}
{...this.props}
{...this.state}
/>:""}
<Modals
modalsType={Modalstype}

@ -167,7 +167,7 @@ class TPMBanner extends Component {
this.props.showLoginDialog()
return
}
if(this.props.current_user&&this.props.current_user.profile_completed===false){
if(this.props.checkIfProfileCompleted()===false){
this.setState({
AccountProfiletype:true
})
@ -390,7 +390,7 @@ class TPMBanner extends Component {
return
}
if(this.props.current_user&&this.props.current_user.profile_completed===false){
if(this.props.checkIfProfileCompleted()===false){
this.setState({
AccountProfiletype:true
})

@ -52,7 +52,7 @@ export default class TPMUpdatepropaede extends Component {
updatepropaedeuticsvalue=()=>{
let id = this.props.match.params.shixunId;
let url="/shixuns/"+id+"/update_propaedeutics.json";
const update_propaedeuticsvalue = this.editanswersRef.current.getValue().trim();
const update_propaedeuticsvalue = this.neweditanswerRef.current.getValue().trim();
axios.post(url,{
content:update_propaedeuticsvalue
}

@ -228,7 +228,7 @@ class Challenges extends Component {
}
if(this.props.current_user&&this.props.current_user.profile_completed===false){
if(this.props.checkIfProfileCompleted()===false){
this.setState({
AccountProfiletype:true
})

@ -34,7 +34,7 @@ class Collaborators extends Component {
Collaboratorsvisibleadmin: false,
value: 1,
page: 1,
Searchadmin: [],
Searchadmin: undefined,
allChangechecked: false,
Collaboratorslist: [],
Collaboratorslisttype: false,
@ -434,10 +434,10 @@ class Collaborators extends Component {
height: '30px',
lineHeight: '30px',
};
// console.log(collaboratorList)
const antIcon = <Icon type="loading" style={{ fontSize: 24 }} spin />;
console.log(Searchadmin)
return (
<React.Fragment>
<p className="clearfix mt30"
@ -533,9 +533,9 @@ class Collaborators extends Component {
<Spin indicator={antIcon} spinning={this.state.spinnings}>
<div className="clearfix">
<ul className="upload_select_box fl" id="search_not_teachers_list" onScroll={this.contentViewScrolledit}>
{Searchadmin.length === 0 ? <li style={{textAlign: 'center'}}>
{Searchadmin === undefined ? <li style={{textAlign: 'center'}}>
<span>请试试搜索一下</span>
</li> : Searchadmin.map((item, key) => {
</li>:Searchadmin.length === 0 ? "": Searchadmin.map((item, key) => {
return (
<li key={key} style={{display: item.identify === "专业人士" ? "none" : "block"}}>
<Checkbox className="fl mr20" checked={item.checked}

Loading…
Cancel
Save