dev_cs
杨树明 5 years ago
commit 1adc97ca64

@ -126,10 +126,11 @@ module ApplicationHelper
# 用户图像url如果不存在的话source为匿名用户即默认使用匿名用户图像
def url_to_avatar(source)
if File.exist?(disk_filename(source.class, source.id))
ctime = File.ctime(disk_filename(source.class, source.id)).to_i
if source.class.to_s == 'User'
File.join(relative_path, ["#{source.class}", "#{source.id}"])
File.join(relative_path, ["#{source.class}", "#{source.id}"]) + "?t=#{ctime}"
else
File.join("images/avatars", ["#{source.class}", "#{source.id}"])
File.join("images/avatars", ["#{source.class}", "#{source.id}"]) + "?t=#{ctime}"
end
elsif source.class.to_s == 'User'
str = source.user_extension.try(:gender).to_i == 0 ? "b" : "g"

@ -5,6 +5,7 @@ json.members_count course.course_members_count
# json.homework_commons_count course.homework_commons_count
json.homework_commons_count get_tasks_count course
json.attachments_count course.attachments.count
json.visits course.visits
json.first_category_url module_url(course.course_modules.where(hidden: 0).order(position: :desc).first, course)

@ -32,7 +32,7 @@ module.exports = {
// See the discussion in https://github.com/facebookincubator/create-react-app/issues/343.s
// devtool: "cheap-module-eval-source-map",
// 开启调试
// devtool: "eval", // 开启调试
// devtool: "eval-source-map", // 开启调试
// These are the "entry points" to our application.
// 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.

@ -3,13 +3,12 @@
<head>
<meta charset="utf-8">
<!--<meta http-equiv="Content-Security-Policy" content="upgrade-insecure-requests" />-->
<meta http-equiv="Content-Security-Policy" content="upgrade-insecure-requests">
<!-- width=device-width, initial-scale=1 , shrink-to-fit=no -->
<!-- <meta name="viewport" content=""> -->
<meta name="theme-color" content="#000000">
<!--<meta http-equiv="Content-Security-Policy" content="upgrade-insecure-requests">-->
<!--<meta http-equiv="Content-Security-Policy" content="upgrade-insecure-requests">-->
<link rel="manifest" href="%PUBLIC_URL%/manifest.json">
<link rel="shortcut icon" href="%PUBLIC_URL%/favicon.ico">

@ -2,6 +2,7 @@
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="Content-Security-Policy" content="upgrade-insecure-requests">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="theme-color" content="#000000">
<!--

File diff suppressed because one or more lines are too long

@ -299,7 +299,6 @@ class CoursesIndex extends Component{
this.historyArray = [window.location.pathname];
this.props.history.listen( location => {
console.log(location);
this.historyArray.unshift(window.location.pathname);
this.historyArray.length = 2;
//Do your stuff here

@ -70,10 +70,23 @@ class NewWorkForm extends Component{
contentFileList,
answerFileList,
}, () => {
setTimeout(() => {
this.contentMdRef.current.setValue(data.description || '')
this.answerMdRef.current.setValue(data.reference_answer || '')
}, 2000)
// setTimeout(() => {
// this._scrollToTop()
// 阻止setValue的滚动
// $(window).scroll( function() {
// $("html").scrollTop(0)
// $(window).unbind("scroll");
// });
/**
setValue会调用到 codemirror的 o.scrollIntoView(i), 会导致滚动条跳动
*/
// $('.editormd').parent().css('position', 'fixed').css('left', '-1000px')
// this.contentMdRef.current.setValue(data.description || '')
// this.answerMdRef.current.setValue(data.reference_answer || '')
// setTimeout(() => {
// $('.editormd').parent().css('position', '').css('left', 'auto')
// }, 100);
// }, 500)
this.props.form.setFieldsValue({
title: data.name,
@ -85,12 +98,13 @@ class NewWorkForm extends Component{
} else { // new
}
this._scrollToTop()
// this._scrollToTop()
}
_scrollToTop = () => {
setTimeout(() => {
$("html").animate({ scrollTop: 0 })
}, 1500)
// setTimeout(() => {
$("html").scrollTop(0)
// $("html").animate({ scrollTop: 0 })
// }, 1000)
}
// 输入title
@ -303,15 +317,13 @@ class NewWorkForm extends Component{
let{
title_value, contentFileList, answerFileList, max_num, min_num, base_on_project,
init_max_num, init_min_num,
title_num, course_name, category, has_commit, has_project,
isEdit
title_num, course_name, category, has_commit, has_project
}=this.state
const { current_user } = this.props
const courseId = this.state.course_id || this.props.match.params.coursesId ;
if ((isEdit) && !this.state.workLoaded) {
this.isEdit = this.isEdit || this.props.match.url.indexOf('/edit') != -1
if ((this.isEdit) && !this.state.description && this.state.description != '') {
return ''
}
const uploadProps = {
@ -439,7 +451,8 @@ class NewWorkForm extends Component{
}],
})(
<TPMMDEditor ref={this.contentMdRef} placeholder="请在此输入作业内容和要求,最大限制5000个字符" mdID={'courseContentMD'} refreshTimeout={1500}
className="courseMessageMD" initValue={this.state.description}></TPMMDEditor>
initValue={this.state.description} noSetValueOnInit={!!this.isEdit}
className="courseMessageMD" ></TPMMDEditor>
)}
</Form.Item> }
<Upload {...uploadProps} className="upload_1 newWorkUpload">
@ -507,7 +520,8 @@ class NewWorkForm extends Component{
}],
})(
<TPMMDEditor ref={this.answerMdRef} placeholder="请在此输入作业的参考答案,最大限制5000个字符" mdID={'workAnswerMD'}
className="courseMessageMD" refreshTimeout={1500} initValue={this.state.reference_answer || ''}></TPMMDEditor>
initValue={this.state.reference_answer || ''} noSetValueOnInit={!!this.isEdit}
className="courseMessageMD" refreshTimeout={1500} ></TPMMDEditor>
)}
</Form.Item>
<Upload {...answerUploadProps} className="upload_1 newWorkUpload resetNewWorkUpload">

@ -16,7 +16,7 @@ class CBreadcrumb extends Component{
return ''
}
if (item.to) {
return <React.Fragment>
return <React.Fragment key={index}>
<WordsBtn style="grey" className="fl hovercolorblue" to={item.to}>{item.name}</WordsBtn>
{separator ?
<span className="color-grey-9 fl ml3 mr3">{separator}</span> :
@ -24,7 +24,7 @@ class CBreadcrumb extends Component{
}
</React.Fragment>
} else {
return <span>{item.name}</span>
return <span key={index}>{item.name}</span>
}
})}
</p>

@ -181,7 +181,7 @@ class Coursesleftnav extends Component{
on('editshixunname',this.editshixunchild)
on('editshixunmainname',this.editshixunmainname)
this.props.updataleftNavfun();
// this.props.updataleftNavfun();
// this.props.getleftNavid && this.props.getleftNavid("shixun_homework");
// const position =parseInt(this.props.match.params.position);
@ -235,55 +235,56 @@ class Coursesleftnav extends Component{
navidtype=true
}
this.props.updataleftNavfun()
// this.scrollToAnchor()
}
setnavid=(e,key,id,type,url)=>{
// this.props.getleftNavid && this.props.getleftNavid(key,type);
let {selectnavid,navid}=this.state;
if(navidtype===true&&selectnavid===false){
if(navid===key){
this.setState({
navid:"",
selectnavid:false,
newselectnavid:id
})
}else{
this.setState({
navid:key,
positiontype:type,
selectnavid:false,
newselectnavid:id
})
}
}else{
// console.log(navidtype)
// console.log(selectnavid)
this.setState({
navid:"",
selectnavid:false,
newselectnavid:id
})
}
this.props.updataleftNavfun();
this.props.history.replace( url );
e.stopPropagation();//阻止冒泡
// let {selectnavid,navid}=this.state;
//
// if(navidtype===true&&selectnavid===false){
//
// if(navid===key){
// this.setState({
// navid:"",
// selectnavid:false,
// newselectnavid:id
// })
// }else{
// this.setState({
// navid:key,
// positiontype:type,
// selectnavid:false,
// newselectnavid:id
// })
// }
// }else{
// // console.log(navidtype)
// // console.log(selectnavid)
// this.setState({
// navid:"",
// selectnavid:false,
// newselectnavid:id
// })
// }
//
// this.props.updataleftNavfun();
// this.props.history.replace( url );
// e.stopPropagation();//阻止冒泡
this.selectnavid(e,key,id,type,url)
}
selectnavid=(e,key,id,type,urls,index)=>{
let {url}=this.state;
if(urls!=url){
this.props.updataleftNavfun();
this.props.history.replace(urls);
this.props.updataleftNavfun();
}else{
if (key === this.props.indexs) {
this.props.unlocationNavfun(undefined)
} else {
this.props.updataleftNavfun();
this.props.unlocationNavfun(key)
this.props.history.replace(urls);
}
@ -305,8 +306,9 @@ class Coursesleftnav extends Component{
url:urls,
indexs:index
})
this.props.updataleftNavfun();
this.props.history.replace(urls);
this.props.updataleftNavfun();
}
@ -722,24 +724,27 @@ class Coursesleftnav extends Component{
e.stopPropagation();//阻止冒泡
}
showsandians=(e,key,urls,num)=> {
showsandians=(e,key,urls,num,id,type,index)=> {
let {url}=this.state;
if (key === this.props.indexs) {
this.props.unlocationNavfun(undefined)
this.props.history.replace(urls);
} else {
this.props.updataleftNavfun();
this.props.unlocationNavfun(key)
this.props.history.replace(urls);
}
if(urls!=url){
this.props.updataleftNavfun();
this.props.history.replace(urls);
}
// if(this.props.indexs===undefined){
//
// }else{
//
// }
this.setState({
selectnavid:true,
newselectnavid:id,
url:urls,
indexs:index
})
}
maincontent=(item,key)=>{
@ -803,11 +808,6 @@ class Coursesleftnav extends Component{
chapterupdate:false,
})
}
//跳转道描点的地方
scrollToAnchor = () => {
}
render(){
let {
twosandiantype,
@ -829,6 +829,7 @@ class Coursesleftnav extends Component{
// console.log("778");
// console.log("CoursesLeftNav");
// console.log(course_modules);
return(
@ -935,8 +936,8 @@ class Coursesleftnav extends Component{
return(
<div key={key} >
<a>
<li title={item.name.length<7?"":item.name} onClick={(e)=>this.showsandians(e,key,item.category_url,1)} className={this.props.mainurl===item.category_url&&key===this.props.indexs?"liactive":"clearfix active"} onMouseLeave={(e)=>this.hidesandian(e,key)} onMouseEnter={(e)=>this.showsandian(e,key)}>
<a onClick={(e)=>this.showsandians(e,key,item.category_url,1)} className={ item.second_category===undefined?"fl ml20 pd0":item.second_category.length===0?"fl ml20 pd0":this.state.sandiantypes===key?"fl ml20 pd0 ebebeb":"fl ml20 pd0"}>
<li title={item.name.length<7?"":item.name} onClick={(e)=>this.showsandians(e,key,item.category_url,1,item.id,item.type)} className={this.props.mainurl===item.category_url?"liactive":"clearfix active"} onMouseLeave={(e)=>this.hidesandian(e,key)} onMouseEnter={(e)=>this.showsandian(e,key)}>
<a onClick={(e)=>this.showsandians(e,key,item.category_url,1,item.id,item.type)} className={ item.second_category===undefined?"fl ml20 pd0":item.second_category.length===0?"fl ml20 pd0":this.state.sandiantypes===key?"fl ml20 pd0 ebebeb":"fl ml20 pd0"}>
{
item.type==="announcement"?<i className={this.props.location.pathname===item.category_url?"color-blue iconfont icon-xiaoxi1 mr10 fl":"iconfont icon-xiaoxi1 mr10 fl"}></i>:
item.type==="online_learning"?<i className={this.props.location.pathname===item.category_url?"color-blue iconfont icon-kecheng mr10 fl font-16":"iconfont icon-kecheng mr10 fl font-16"}></i>:
@ -981,8 +982,7 @@ class Coursesleftnav extends Component{
ref={provided.innerRef}
{...provided.droppableProps}
className={"droppableul"}
id={this.props.mainurl===item.category_url&&key===this.props.indexs?"scrolldroppableul"+this.props.match.params.category_id:""}
style={{display: this.props.mainurl===item.category_url&&key===this.props.indexs?"":"none"}}
style={{display: key===this.props.indexs?"":"none"}}
>
{item.second_category===undefined?"":item.second_category.map((iem,index)=>{
if(item.type==="course_group"){
@ -1005,7 +1005,7 @@ class Coursesleftnav extends Component{
visible={false}
>
{/*"/courses/"+this.props.match.params.coursesId+"/"+item.type+"/"+iem.category_type+"/"+iem.category_id*/}
<a className={"Draggablelichild"} id={"scroll"+iem.category_id} ref={"scroll"+iem.category_id}>
<a className={"Draggablelichild"}>
<li className="clearfix width93 Draggableli" key={index} onClick={(e)=>this.selectnavids(e,key,iem.category_id,item.type+"child",iem.second_category_url,key)} onMouseLeave={(e)=>this.twosandianhide(e,index,item.type)} onMouseEnter={(e)=>this.twosandianshow(e,index,item.type)}
key={index}
ref={provided.innerRef}
@ -1045,12 +1045,15 @@ 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={"点击空白处展开二级菜单,点击模块名字跳转到对应模块"}>*/}
<a >
<li className={this.props.mainurl===item.category_url&&key===this.props.indexs?"liactive":"clearfix active"}
<li className={this.props.mainurl===item.category_url?"liactive":"clearfix active"}
onClick={(e)=>this.setnavid(e,key,item.id,item.type,item.category_url)} onMouseEnter={(e)=>this.showsandian(e,key)}
title={item.name.length<7?"":item.name}
>
@ -1075,15 +1078,8 @@ class Coursesleftnav extends Component{
</a>
</li>
</a>
{/*</Tooltip>*/}
{/*下拉列表*/}
{/* className={this.props.location.pathname===item.category_url||this.props.location.pathname===this.state.url&&key===this.state.indexs?"":""}*/}
<ul
style={{display:this.props.mainurl===item.category_url&&key===this.props.indexs?"":"none"}}
class="droppableul"
id={this.props.mainurl===item.category_url&&key===this.props.indexs?"scrolldroppableul"+this.props.match.params.category_id:""}
>
<ul style={{display:key===this.props.indexs?"":"none"}} class="droppableul">
{
item.second_category===undefined?"":item.second_category.map((iem,index)=>{
@ -1095,7 +1091,7 @@ class Coursesleftnav extends Component{
}
}
return(
<a id={"scroll"+iem.category_id} ref={"scroll"+iem.category_id}>
<a >
<li className="clearfix Draggableli" key={index} style={{ width: '244px'}} title={iem.category_name.length<10?"":iem.category_name}>
<a className="fl pl46 pd0 Draggablelichild" onClick={(e)=>this.selectnavids(e,key,iem.category_id,item.type+"child",iem.second_category_url,key)} >
@ -1125,72 +1121,3 @@ class Coursesleftnav extends Component{
export default Coursesleftnav;
//
// sandianshow=(e,key)=>{
// this.setState({
// sandiantype:key
// })
// e.stopPropagation();//阻止冒泡
// }
// hidesandian=(e,key)=>{
// this.setState({
// sandiantypes:undefined
// })
// e.stopPropagation();//阻止冒泡
// }
// sandianshow=(e,key)=>{
// this.setState({
// sandiantype:key
// })
// e.stopPropagation();//阻止冒泡
// }
// sandianhide=(e)=>{
// this.setState({
// sandiantype:undefined,
//
// })
// e.stopPropagation();//阻止冒泡
// }
// twosandianshows=(e,key,type)=>{
//
// this.setState({
// twosandiantypenum:key,
// toopvisible:false,
// toopvisibleindex:undefined,
// twosandiantypes:type
// })
// e.stopPropagation();//阻止冒泡
// }
// twoMouseLeave=(e)=>{
// this.setState({
// toopvisible:false,
// })
// e.stopPropagation();//阻止冒泡
// }
{/*{ is_teacher===true?*/}
{/* <div className={hidden_modules.length===0?"none":""}>*/}
{/* <li className="clearfix addjia ebebeb">*/}
{/* <span className="addtaskmodle">*/}
{/* <i className={addGroup===true?"iconfont icon-jia mr5 ml110 fl martop1":"none"} onClick={this.addGroupmodel}></i>*/}
{/* <div className={addGroup===false?"ml100":"none"} onClick={this.addGroupmodelsave}>确定</div>*/}
{/* </span>*/}
{/* </li>*/}
{/* </div> :""}*/}
{/*{ is_teacher===true?<div className={addGroup===false?"CheckboxGroup":"none"}>*/}
{/* <CheckboxGroup style={{ width: '100%' }} value={addCheckboxGroup} onChange={this.addCheckboxGroupID}>*/}
{/* {hidden_modules.length===0?"":hidden_modules.map((list,key)=>{*/}
{/* return(*/}
{/* <li className="clearfix pl20" key={key}>*/}
{/* <Checkbox value={list.id} className="fl "></Checkbox>*/}
{/* <span className="task-hide activity-left-name ml3">{list.name}</span>*/}
{/* </li>*/}
{/* )*/}
{/* })}*/}
{/* </CheckboxGroup>*/}
{/* </div> :""}*/}

@ -30,7 +30,7 @@ class CoursesListType extends Component {
return(
<span style={{display:'inline-block'}}>
{
typelist===undefined?"":typelist.map((item,key)=>{
typelist===undefined || typelist=== 403 || typelist === 401 || typelist=== 407 || typelist=== 408|| typelist=== 409 || typelist === 500?"":typelist.map((item,key)=>{
return(
<Tooltip placement="bottom" title={tipval} getPopupContainer={()=>document.querySelector('.TabsWarp')} key={key}>
<span key={key}>

@ -150,13 +150,13 @@ class ExerciseListItem extends Component{
{
item.exercise_status ===2?
<Tooltip title="提交剩余时间" placement="bottom">
<span className="mr20 fl">{item.exercise_left_time}</span>
<span className="mr20 fl">{"提交剩余时间:"+item.exercise_left_time}</span>
</Tooltip>:""
}
{
item.exercise_status ===3?
{
item.exercise_left_time===null?"":item.exercise_status ===3?
<Tooltip title="截止剩余时间" placement="bottom">
<span className="mr20 fl">{item.exercise_left_time}</span>
<span className="mr20 fl">{"截止剩余时间:"+item.exercise_left_time}</span>
</Tooltip>:""
}
{/*{*/}

@ -249,15 +249,15 @@ class GraduateTaskItem extends Component{
</h6>
<div className="cl"></div>
<p className="color-grey panel-lightgrey mt16 fl">
<p className="color-grey mt16 fl">
<span className="mr50">
{/* <a href="/users/innov" className="panel-name-small hide fl mr15 mr30 color-grey3">{discussMessage.author.name}</a> */}
{discussMessage.commit_count===undefined?"":<span className="mr15 color-grey9 font-14">{discussMessage.commit_count} 已交</span>}
{discussMessage.uncommit_count===undefined?"":<span className="mr15 color-grey9 font-14">{discussMessage.uncommit_count} 未交</span>}
{/*<span className="mr15 color-grey9">{discussMessage.replies_count} 3 未评</span>*/}
<Tooltip title={discussMessage.task_status===1?"提交剩余时间":discussMessage.task_status===2?"补交剩余时间":""} placement="bottom">
<span className="mr15 color-grey9 font-14">{discussMessage.status_time}</span>
<Tooltip title={discussMessage.task_status===1?"提交剩余时间":discussMessage.task_status===2?"补交剩余时间":discussMessage.task_status===3?"交叉评阅剩余时间":""} placement="bottom">
<span className="mr15 color-grey9 font-14">{discussMessage.task_status===1&&discussMessage.status_time!=""&&discussMessage.status_time!=null?"提交剩余时间:"+discussMessage.status_time:discussMessage.task_status===2&&discussMessage.status_time!=""&&discussMessage.status_time!=null?"补交剩余时间:"+discussMessage.status_time:discussMessage.task_status===3&&discussMessage.status_time!=""&&discussMessage.status_time!=null?"交叉评阅剩余时间:"+discussMessage.status_time:discussMessage.status_time}</span>
</Tooltip>
{/* { discussMessage.replies_count != 0 && <span className="mr15 color-grey9">{discussMessage.replies_count} </span> }

@ -32,8 +32,10 @@ class GraduationTasksappraise extends Component{
axios.get(zrl).then((result)=>{
if(result.status===200){
let status=result.data.status;
if(status===undefined || status=== 403 || status === 401 || status=== 407 || status=== 408|| status=== 409 || status === 500||status===-1){
if(result.data.status!=-1){
}else{
this.setState({
firelistdata:result.data,
})

@ -40,7 +40,7 @@ class GraduationTaskssettinglist extends Component{
task_status:undefined,
cross_comment:null,
search:null,
order:"updated_at",
order:"update_time",
b_order:"desc",
course_group:undefined,
loadingstate:true,
@ -92,6 +92,7 @@ class GraduationTaskssettinglist extends Component{
seacthdata=(teacher_comment,task_status,course_group,cross_comment,order,b_order,search,pages)=>{
let{page,limit}=this.state;
// console.log(teacher_comment,task_status,course_group,cross_comment,order,b_order,search)
let task_Id=this.props.match.params.task_Id;
let url="/graduation_tasks/"+task_Id+"/tasks_list.json";
@ -106,7 +107,7 @@ class GraduationTaskssettinglist extends Component{
order:order===null?undefined:order,
b_order:b_order===null?undefined:b_order,
search:search===null?undefined:search,
page:pages===null?undefined:page,
page:pages,
limit:20,
},
paramsSerializer: function(params) {
@ -281,8 +282,6 @@ class GraduationTaskssettinglist extends Component{
funtaskstatus=(checkedValues,key)=>{
// console.log(checkedValues)
console.log(checkedValues);
let {teacher_comment, course_group, cross_comment, order, b_order, search} = this.state;
@ -599,7 +598,7 @@ class GraduationTaskssettinglist extends Component{
this.cannerassocition();
let {taskslistdata}=this.state;
let url = "/graduation_tasks/"+taskslistdata.task_id+"/graduation_works/cancel_relate_project.json";
console.log(url)
axios.get(url).then((result)=>{
if(result.data.status===0){
@ -655,8 +654,7 @@ class GraduationTaskssettinglist extends Component{
/// 确认是否下载
confirmysl(url){
debugger;
console.log(1);
let {teacher_comment, task_status, course_group, cross_comment, order, b_order, search,page} =this.state;
let params ={
@ -958,7 +956,7 @@ class GraduationTaskssettinglist extends Component{
}
console.log(this.props.questionslist.status)
return(
<React.Fragment>
@ -1221,10 +1219,10 @@ class GraduationTaskssettinglist extends Component{
{this.props.isAdmin()===true?<div className="fr color-grey-6 edu-menu-panel">
<p>
<a data-remote="true" class="color-grey-6 font-12">
{order==="updated_at"?"更新时间":order==="work_score"?"最终成绩":order==="student_id"?"学生学号":""}排序</a>
{order==="update_time"?"更新时间":order==="work_score"?"最终成绩":order==="student_id"?"学生学号":""}排序</a>
<i className="iconfont icon-xiajiantou ml5 font-12 color-grey-6"></i></p>
<ul className="edu-menu-list edu-menu-lists" style={{width: '87px'}}>
<li onClick={(e)=>this.funorder("updated_at")}><a data-remote="true">更新时间</a>
<li onClick={(e)=>this.funorder("update_time")}><a data-remote="true">更新时间</a>
</li>
<li onClick={(e)=>this.funorder("work_score" )}><a data-remote="true">最终成绩</a>
</li>
@ -1415,10 +1413,10 @@ class GraduationTaskssettinglist extends Component{
</span>
<div className="fr color-grey-6 edu-menu-panel">
<p><a data-remote="true">
{order==="updated_at"?"时间":order==="work_score"?"成绩":order==="student_id"?"学号":""}排序</a><i
{order==="update_time"?"时间":order==="work_score"?"成绩":order==="student_id"?"学号":""}排序</a><i
className="iconfont icon-xiajiantou ml5 font-12 color-grey-6"></i></p>
<ul className="edu-menu-list">
<li onClick={(e)=>this.funorder("updated_at")} className={order==="updated_at"?"none":""}><a data-remote="true">时间</a>
<li onClick={(e)=>this.funorder("update_time")} className={order==="update_time"?"none":""}><a data-remote="true">时间</a>
</li>
<li onClick={(e)=>this.funorder("work_score" )} className={order==="work_score"?"none":""}><a data-remote="true">成绩</a>
</li>

@ -73,7 +73,7 @@ class PollListItem extends Component{
{
item.polls_status ==2 && item.publish_time !=null &&
<Tooltip title="提交剩余时间">
<span className="mr20 fl mt3">{formatDuring(t)}</span>
<span className="mr20 fl mt3">{"提交剩余时间:"+formatDuring(t)}</span>
</Tooltip>
}
{

@ -329,7 +329,7 @@ class ShixunhomeWorkItem extends Component{
</h6>
<div className="cl"></div>
<p className="color-grey panel-lightgrey mt16 fl">
<p className="color-grey mt16 fl">
<span className="mr50 df">
{/* <a href="/users/innov" className="panel-name-small hide fl mr15 mr30 color-grey3">{discussMessage.author.name}</a> */}
{ discussMessage.author && <span className="mr15 color-grey-3">{discussMessage.author}</span> }

@ -137,7 +137,7 @@ class Trainingjobsetting extends Component {
componentDidMount() {
console.log("Trainingjobsetting");
console.log("componentDidMount");
this.getTrainingjobsetting();
this.getTrainingjobsetting(true);
let query = this.props.location.pathname;
const type = query.split('/');
this.setState({
@ -165,7 +165,7 @@ class Trainingjobsetting extends Component {
// }
// 获取数据地方
getTrainingjobsetting = () => {
getTrainingjobsetting = (bool) => {
// console.log("getTrainingjobsetting")
var homeworkid = this.props.match.params.homeworkid;
// console.log(homeworkid)
@ -293,6 +293,14 @@ class Trainingjobsetting extends Component {
code_review:result.data.code_review
})
this.props.Getdataback(result,result.data);
if(bool===true){
if(this.props.isAdmin() !== undefined){
if(this.props.isAdmin() === true){
this.editSettings(result);
}
}
}
}
})
@ -1592,7 +1600,7 @@ class Trainingjobsetting extends Component {
description:result.data.message
});
this.homeworkhide();
this.getTrainingjobsetting();
this.getTrainingjobsetting(false);
}
}
@ -1623,7 +1631,7 @@ class Trainingjobsetting extends Component {
// message:"提示",
// description:response.data.message
// });
this.getTrainingjobsetting();
this.getTrainingjobsetting(false);
this.homeworkhide()
}
})
@ -1738,7 +1746,6 @@ class Trainingjobsetting extends Component {
flagPageEditstwo:releasetime,
flagPageEditsthrees:deadline,
flagPageEditsfor:endtime,
unifiedsetting:this.state.unifiedsetting,
});
if(this.state.work_efficiencys===true){
@ -1784,7 +1791,122 @@ class Trainingjobsetting extends Component {
} catch (e) {
}
};
//一进来就是老师要用的编辑页面
editSettings=(datas)=>{
console.log("编辑页面");
console.log(datas);
try {
if (datas.data.is_end === true) {
this.setState({
modalsType: true,
modalsTopval: "课堂已结束不能再修改!",
loadtype: true,
modalSave: this.cancelBox
})
} else {
var releasetime =true;
var deadline = true;
var endtime =true;
var whethertopays =true;
//发布时间
if(moment(datas.data.publish_time,"YYYY-MM-DD HH:mm")<=moment()){
releasetime=false;
}
//截止时间
if(moment(datas.data.end_time,"YYYY-MM-DD HH:mm")<=moment()){
deadline=false;
}
//结束时间
if(moment(datas.data.late_time,"YYYY-MM-DD HH:mm")<=moment()){
endtime=false;
}
if(datas.data.allow_late === false){
whethertopays=false;
}
try {
if(datas.data&& datas.data.homework_status[0]==="未发布"){
this.setState({
flagPageEditsbox:true,
flagPageEdit: true,
whethertopay:whethertopays,
flagPageEditstwo:releasetime,
flagPageEditsthrees:deadline,
flagPageEditsfor:endtime,
completionefficiencyscore:true,
work_efficiencys:true,
unifiedsetting:datas.data.unifiedsetting,
latedeductiontwo:20,
});
//均分比例
// result.data.shixun_evaluation === 0 ? "均分比例" : result.data.shixun_evaluation === 1 ? "经验值比例" : result.data.shixun_evaluation === 2 ?
try {
if(datas.data.shixun_evaluation === 0){
this.Equalproportion(20);
}else if(datas.data.shixun_evaluation === 1){
this.Empiricalvalueratio(20);
}
}catch (e) {
}
}else {
this.setState({
flagPageEditsbox:true,
flagPageEdit: true,
whethertopay:whethertopays,
flagPageEditstwo:releasetime,
flagPageEditsthrees:deadline,
flagPageEditsfor:endtime,
unifiedsetting:datas.data.unifiedsetting,
});
if(datas.data.work_efficiencys===true){
this.setState({
completionefficiencyscore:true,
})
}else{
this.setState({
completionefficiencyscore:false,
})
}
}
}catch (e) {
this.setState({
flagPageEditsbox:true,
flagPageEdit: true,
whethertopay:whethertopays,
flagPageEditstwo:releasetime,
flagPageEditsthrees:deadline,
flagPageEditsfor:endtime,
unifiedsetting:datas.data.unifiedsetting,
});
if(datas.data.work_efficiencys===true){
this.setState({
completionefficiencyscore:true,
})
}else{
this.setState({
completionefficiencyscore:false,
})
}
}
if(datas.data.shixun_evaluation === 2){
this.setState({
boolUnitetwoname:"自定义分值",
boolUnitetwo: false,
flagPageEdits:true,
})
}
}
} catch (e) {
}
}
//取消编辑
cancelEdit = () => {
@ -1807,7 +1929,7 @@ class Trainingjobsetting extends Component {
unit_e_tip: "",
})
this.refs.targetElementTrainingjobsetting.scrollIntoView();
this.getTrainingjobsetting();
this.getTrainingjobsetting(false);
}
rulesCheckInfo=(rules)=>{
@ -1919,8 +2041,8 @@ class Trainingjobsetting extends Component {
const dataformat = 'YYYY-MM-DD HH:mm';
let {flagPageEdit,testscripttiptype,publish_timebool,end_timebool,late_timesbool,work_efficiencys,flagPageEdits,flagPageEditstwo,flagPageEditsbox,whethertopay,handclass,flagPageEditsthrees, flagPageEditsfor,rules,rulest,unifiedsetting,group_settings, course_group,unit_e_tip, borreds,borredss,unit_p_tip, end_time, late_time, score_open, publish_time, starttimetype, modalsType, modalsTopval, loadtype, modalSave, endtimetype, latetimetype, allowlate, latepenaltytype, jobsettingsdata, endOpen, mystyle, mystyles} = this.state;
console.log(publish_timebool);
console.log(!flagPageEditstwo);
// console.log(publish_timebool);
// console.log(!flagPageEditstwo);
const radioStyle = {
display: 'block',
height: '30px',

@ -1,88 +1,94 @@
import React, { Component } from 'react';
import React, {Component} from 'react';
import {
Spin,
Pagination,
} from "antd";
import axios from 'axios';
import {getImageUrl,markdownToHTML} from 'educoder';
import {getImageUrl, markdownToHTML} from 'educoder';
import "../css/messagemy.css"
//消息页面
class MessagSub extends Component{
class MessagSub extends Component {
constructor(props) {
super(props);
this.state={
page:1,
limit:10,
typeysl:"",
count:0,
isSpin:false,
data:undefined,
this.state = {
page: 1,
limit: 10,
typeysl: "",
count: 0,
isSpin: false,
data: undefined,
}
}
// 初始化数据
componentDidMount(){
// 初始化数据
componentDidMount() {
// console.log("初始化数据了MessagSub");
// console.log(this.props);
this.getdata("",this.state.page);
this.getdata("", this.state.page);
// this.Messageprivatemessageunreadmessage();
try {
this.props.Mtab(1);
}catch (e) {
} catch (e) {
}
this.props.triggerRef(this)
}
//塞选页数
paginationonChanges=(pageNumber)=>{
paginationonChanges = (pageNumber) => {
this.setState({
page: pageNumber,
})
this.getdata(this.state.typeysl,pageNumber);
this.getdata(this.state.typeysl, pageNumber);
}
//获取数据源
getdata=(types,page)=>{
getdata = (types, page) => {
this.setState({
isSpin:true,
isSpin: true,
})
let{limit}=this.state;
let {limit} = this.state;
let url = `/users/tidings.json`;
axios.get((url),{params:{
type:types,
page:page,
per_page:limit,
}}).then((result) => {
axios.get((url), {
params: {
type: types,
page: page,
per_page: limit,
}
}).then((result) => {
if (result) {
// if (result.data.status === 0) {
this.setState({
page: page,
count: result.data.count,
typeysl: types,
isSpin: false,
data: result.data.tidings === null ? undefined : result.data.tidings === undefined ? undefined : result.data.tidings === [] ? undefined : result.data.tidings === "[]" ? undefined : result.data.tidings.length === 0 ? undefined : result.data.tidings,
})
this.setState({
page: page,
count: result.data.count,
typeysl: types,
isSpin: false,
data: result.data.tidings === null ? undefined : result.data.tidings === undefined ? undefined : result.data.tidings === [] ? undefined : result.data.tidings === "[]" ? undefined : result.data.tidings.length === 0 ? undefined : result.data.tidings,
})
// }
}
}).catch((error) => {
console.log(error);
this.setState({
isSpin:false,
isSpin: false,
})
})
};
getdatas=()=>{
getdatas = () => {
this.setState({
isSpin:true,
isSpin: true,
})
let{typeysl,page,limit}=this.state;
let {typeysl, page, limit} = this.state;
let url = `/users/tidings.json`;
axios.get((url),{params:{
type:typeysl,
page:page,
per_page:limit,
}}).then((result) => {
axios.get((url), {
params: {
type: typeysl,
page: page,
per_page: limit,
}
}).then((result) => {
if (result) {
// if (result.data.status === 0) {
@ -98,172 +104,172 @@ class MessagSub extends Component{
}).catch((error) => {
console.log(error);
this.setState({
isSpin:false,
isSpin: false,
})
})
}
componentWillUnmount(){
componentWillUnmount() {
// 卸载异步操作设置状态
this.setState = (state, callback) => {
return;
}
}
gettourl=(item)=>{
gettourl = (item) => {
switch (item.container_type) {
case "ApplyUserAuthentication" :
if(item.tiding_type==="Apply"){
if(item.auth_type===1){
//系统管理页面
if (item.tiding_type === "Apply") {
if (item.auth_type === 1) {
//系统管理页面
return window.open("/managements/identity_authentication");
}
if(item.auth_type===2){
if (item.auth_type === 2) {
//系统管理页面
return window.open("/managements/professional_authentication")
}
}
if(item.tiding_type ==="System"){
// 账号管理页-认证信息
return window.open("/account/certification")
}
return ;
}
if (item.tiding_type === "System") {
// 账号管理页-认证信息
return window.open("/account/certification")
}
return;
case "CancelUserAuthentication" :
// 账号管理页-认证信息
return window.open("/account/certification")
return window.open("/account/certification")
case "CancelUserProCertification" :
// 账号管理页-认证信息
return window.open("/account/certification")
return window.open("/account/certification")
case "ApplyAddDepartment" :
if(item.tiding_type==="Apply"){
if (item.tiding_type === "Apply") {
//部门审批
return window.open("/managements/depart")
return window.open("/managements/depart")
}
if(item.tiding_type==="System"){
if (item.tiding_type === "System") {
// 账号管理页/account/profile
return window.open("/account/profile")
return window.open("/account/profile")
}
return ;
return;
case "ApplyAddSchools" :
if(item.tiding_type==="Apply"){
if (item.tiding_type === "Apply") {
// 单位审批
return window.open(" /managements/unit")
return window.open(" /managements/unit")
}
if(item.tiding_type==="System"){
if (item.tiding_type === "System") {
// 账号管理页
return window.open("/account/profile")
return window.open("/account/profile")
}
return ;
return;
case "ApplyAction" :
switch (item.parent_container_type) {
case "ApplyShixun" :
if(item.tiding_type==="Apply"){
return window.open("/managements/shixun_authorization")
}
if(item.tiding_type==="System"){
// 实训详情页 :identifier = identifier
return window.open(`/shixuns/${item.identifier}/challenges`)
}
case "ApplySubject" :
if(item.tiding_type==="Apply"){
// 实训课程发布
return window.open("/managements/subject_authorization")
}
if(item.tiding_type==="System"){
// 实践课程详情页 :parent_container_id = parent_container_id
switch (item.parent_container_type) {
case "ApplyShixun" :
if (item.tiding_type === "Apply") {
return window.open("/managements/shixun_authorization")
}
if (item.tiding_type === "System") {
// 实训详情页 :identifier = identifier
return window.open(`/shixuns/${item.identifier}/challenges`)
}
case "ApplySubject" :
if (item.tiding_type === "Apply") {
// 实训课程发布
return window.open("/managements/subject_authorization")
}
if (item.tiding_type === "System") {
// 实践课程详情页 :parent_container_id = parent_container_id
return window.open(`/paths/${item.parent_container_id}`)
}
case "TrialAuthorization" :
if(item.tiding_type==="Apply"){
// 试用授权页面
return window.open("/managements/trial_authorization")
}
if(item.tiding_type==="System"){
// 账号管理页
return window.open("/account/profile")
}
}
return ;
return window.open(`/paths/${item.parent_container_id}`)
}
case "TrialAuthorization" :
if (item.tiding_type === "Apply") {
// 试用授权页面
return window.open("/managements/trial_authorization")
}
if (item.tiding_type === "System") {
// 账号管理页
return window.open("/account/profile")
}
}
return;
case 'JoinCourse' :
// 课堂详情页 :id =
return window.open(`/courses/${item.belong_container_id}/teachers`)
return window.open(`/courses/${item.belong_container_id}/teachers`)
case 'StudentJoinCourse':
// 课堂详情页 :id = container_id
if(item.tiding_type === 'Apply') {
return window.open(`/courses/${item.belong_container_id}/teachers`);
if (item.tiding_type === 'Apply') {
return window.open(`/courses/${item.belong_container_id}/teachers`);
}
if(item.tiding_type === 'System'){
if (item.tiding_type === 'System') {
//教学案例详情 :id = container_id
return window.open(`/courses/${item.belong_container_id}/students`);
return window.open(`/courses/${item.belong_container_id}/students`);
}
case 'DealCourse':
// 课堂详情页 :id = container_id
return window.open(`/courses/${item.belong_container_id}/shixun_homeworks/${item.container_id}`)
return window.open(`/courses/${item.belong_container_id}/shixun_homeworks/${item.container_id}`)
case 'TeacherJoinCourse':
// 课堂详情页 :id = container_id
return window.open(`/courses/${item.belong_container_id}/shixun_homeworks/${item.container_id}`)
return window.open(`/courses/${item.belong_container_id}/shixun_homeworks/${item.container_id}`)
case 'Course' :
// 课堂详情页 :id = container_id
if(item.tiding_type==="Delete"){
if (item.tiding_type === "Delete") {
return;
return;
}
return window.open(`/courses/${item.belong_container_id}/shixun_homeworks/${item.container_id}`)
return window.open(`/courses/${item.belong_container_id}/shixun_homeworks/${item.container_id}`)
case 'ArchiveCourse' :
// 课堂详情页 :id = container_id
return window.open(`/courses/${item.belong_container_id}/shixun_homeworks/${item.container_id}`)
return window.open(`/courses/${item.belong_container_id}/shixun_homeworks/${item.container_id}`)
case "Shixun" :
return window.open(`/shixuns/${item.identifier}/challenges`)
return window.open(`/shixuns/${item.identifier}/challenges`)
case "Subject" :
// 实践课程详情页 :id = container_id
return window.open(`/paths/${item.container_id}`)
return window.open(`/paths/${item.container_id}`)
case "JournalsForMessage" :
switch (item.parent_container_type) {
case "Principal" :
// 反馈页 :id = parent_container_id
// 不用跳了
return '';
case "HomeworkCommon" :
//学生作业页 homework = parent_container_id
if(item.homework_type==="normal"){
//普通作业
return window.open(`/courses/${item.belong_container_id}/common_homeworks/${item.parent_container_id}/question`)
}
if(item.homework_type==="group"){
//分组作业
return window.open(`/courses/${item.belong_container_id}/group_homeworks/${item.parent_container_id}/question`)
}
if(item.homework_type==="practice"){
//实训作业
return window.open(`/courses/${item.belong_container_id}/shixun_homeworks/${item.parent_container_id}/list?tab=1`)
}
return "";
case "GraduationTopic" :
// 毕业目标页 parent_container_id
return window.open(`/courses/${item.belong_container_id}/graduation_topics/${item.parent_container_id}/detail`)
case "StudentWorksScore" :
//学生作业页
if(item.homework_type==="normal"){
//普通作业
return window.open(`/courses/${item.belong_container_id}/common_homeworks/${item.parent_container_id}/question`)
}
if(item.homework_type==="group"){
//分组作业
return window.open(`/courses/${item.belong_container_id}/group_homeworks/${item.parent_container_id}/question`)
}
if(item.homework_type==="practice"){
//实训作业
return window.open(`/courses/${item.belong_container_id}/shixun_homeworks/${item.parent_container_id}/list?tab=1`)
}
return "";
}
switch (item.parent_container_type) {
case "Principal" :
// 反馈页 :id = parent_container_id
// 不用跳了
return '';
case "HomeworkCommon" :
//学生作业页 homework = parent_container_id
if (item.homework_type === "normal") {
//普通作业
return window.open(`/courses/${item.belong_container_id}/common_homeworks/${item.parent_container_id}/question`)
}
if (item.homework_type === "group") {
//分组作业
return window.open(`/courses/${item.belong_container_id}/group_homeworks/${item.parent_container_id}/question`)
}
if (item.homework_type === "practice") {
//实训作业
return window.open(`/courses/${item.belong_container_id}/shixun_homeworks/${item.parent_container_id}/list?tab=1`)
}
return "";
case "GraduationTopic" :
// 毕业目标页 parent_container_id
return window.open(`/courses/${item.belong_container_id}/graduation_topics/${item.parent_container_id}/detail`)
case "StudentWorksScore" :
//学生作业页
if (item.homework_type === "normal") {
//普通作业
return window.open(`/courses/${item.belong_container_id}/common_homeworks/${item.parent_container_id}/question`)
}
if (item.homework_type === "group") {
//分组作业
return window.open(`/courses/${item.belong_container_id}/group_homeworks/${item.parent_container_id}/question`)
}
if (item.homework_type === "practice") {
//实训作业
return window.open(`/courses/${item.belong_container_id}/shixun_homeworks/${item.parent_container_id}/list?tab=1`)
}
return "";
}
case "Memo" :
// 交流问答页 :id = parent_container_id
return window.open(`/forums/${item.parent_container_id}`);
return window.open(`/forums/${item.parent_container_id}`);
case "Message" :
// 交流问答页 :id = parent_container_id
return window.open(`/forums/`);
return window.open(`/forums/`);
case "Watcher" :
// 用户个人中心页 :id = item.trigger_user.login
return window.open(`/users/${item.trigger_user.login}/courses`)
@ -271,7 +277,7 @@ class MessagSub extends Component{
// 这块太复杂 不好处理
return '';
case "Grade" :
//个人中心页 :id = item.trigger_user.login
//个人中心页 :id = item.trigger_user.login
// return window.open(`/users/${item.trigger_user.login}/courses`;
return "";
case "JoinProject" :
@ -282,7 +288,7 @@ class MessagSub extends Component{
return window.open(`/projects/${item.container_id}`)
case 'DealProject':
//项目详情页 :id = container_id
return window.open(`/projects/${item.container_id}`)
return window.open(`/projects/${item.container_id}`)
case 'ManagerJoinProject':
//项目详情页 :id = container_id
return window.open(`/projects/${item.container_id}`)
@ -305,22 +311,22 @@ class MessagSub extends Component{
case "ExerciseScore":
// 课堂-学生试卷详情 :id = container_id :user_id = trigger_user.id
return window.open(` /courses/${item.belong_container_id}/exercises/${item.container_id}/student_exercise_list?tab=0`);
//记得跳评阅页面
//记得跳评阅页面
default :
// 课堂-试卷列表详情 :id = container_id
return window.open(`/courses/${item.belong_container_id}/exercises/${item.container_id}/student_exercise_list?tab=0`);
}
case 'StudentGraduationTopic' :
//课堂-毕业选题详情 :id = parent_container_id
//课堂-毕业选题详情 :id = parent_container_id
return window.open(`/courses/${item.belong_container_id}/graduation_topics/${item.parent_container_id}/detail`)
case 'DealStudentTopicSelect' :
//课堂-毕业选题详情 :id = parent_container_id
//课堂-毕业选题详情 :id = parent_container_id
return window.open(`/courses/${item.belong_container_id}/graduation_topics/${item.parent_container_id}/detail`)
case 'GraduationTask' :
//课堂-毕业任务页 :id = container_id
return window.open(`/courses/${item.belong_container_id}/graduation_tasks/${item.container_id}`)
case "GraduationWork" :
//课堂-毕业xx页 :id = container_id
//课堂-毕业xx页 :id = container_id
return window.open(`/courses/${item.belong_container_id}/graduation_tasks/${item.container_id}`)
case "GraduationWorkScore" :
// 课堂-毕业xx页 :id = parent_container_id
@ -329,70 +335,70 @@ class MessagSub extends Component{
switch (item.parent_container_type) {
case "AnonymousCommentFail" :
// 课堂-作业列表 homework = container_id
if(item.homework_type==="normal"){
if (item.homework_type === "normal") {
//普通作业
return window.open(`/courses/${item.belong_container_id}/common_homeworks/${item.parent_container_id}/list`)
}
if(item.homework_type==="group"){
if (item.homework_type === "group") {
//分组作业
return window.open(`/courses/${item.belong_container_id}/group_homeworks/${item.parent_container_id}/list`)
}
if(item.homework_type==="practice"){
if (item.homework_type === "practice") {
//实训作业
return window.open(`/courses/${item.belong_container_id}/shixun_homeworks/${item.parent_container_id}/list?tab=0`)
}
case "HomeworkPublish" :
if(item.homework_type==="normal"){
if (item.homework_type === "normal") {
//普通作业
return window.open(`/courses/${item.belong_container_id}/common_homeworks/${item.parent_container_id}/list`)
}
if(item.homework_type==="group"){
if (item.homework_type === "group") {
//分组作业
return window.open(`/courses/${item.belong_container_id}/group_homeworks/${item.parent_container_id}/list`)
}
if(item.homework_type==="practice"){
if (item.homework_type === "practice") {
//实训作业
return window.open(`/courses/${item.belong_container_id}/shixun_homeworks/${item.parent_container_id}/list?tab=0`)
}
case "AnonymousAppeal" :
if(item.homework_type==="normal"){
if (item.homework_type === "normal") {
//普通作业
return window.open(`/courses/${item.belong_container_id}/common_homeworks/${item.parent_container_id}/list`)
}
if(item.homework_type==="group"){
if (item.homework_type === "group") {
//分组作业
return window.open(`/courses/${item.belong_container_id}/group_homeworks/${item.parent_container_id}/list`)
}
if(item.homework_type==="practice"){
if (item.homework_type === "practice") {
//实训作业
return window.open(`/courses/${item.belong_container_id}/shixun_homeworks/${item.parent_container_id}/list?tab=0`)
}
default :
// 课堂-作业列表 homework = container_id
if(item.homework_type==="normal"){
if (item.homework_type === "normal") {
//普通作业
return window.open(`/courses/${item.belong_container_id}/common_homeworks/${item.parent_container_id}/list`)
}
if(item.homework_type==="group"){
if (item.homework_type === "group") {
//分组作业
return window.open(`/courses/${item.belong_container_id}/group_homeworks/${item.parent_container_id}/list`)
}
if(item.homework_type==="practice"){
if (item.homework_type === "practice") {
//实训作业
return window.open(`/courses/${item.belong_container_id}/shixun_homeworks/${item.parent_container_id}/list?tab=0`)
}
}
case "StudentWork" :
//课堂-作业 :id = container_id
if(item.homework_type==="normal"){
if (item.homework_type === "normal") {
//普通作业
return window.open(`/courses/${item.belong_container_id}/common_homeworks/${item.parent_container_id}/${item.container_id}/appraise`)
}
if(item.homework_type==="group"){
if (item.homework_type === "group") {
//分组作业/courses/1208/group_homeworks/22373/1219130/appraise
return window.open(`/courses/${item.belong_container_id}/group_homeworks/${item.parent_container_id}/${item.container_id}/appraise`)
}
if(item.homework_type==="practice"){
if (item.homework_type === "practice") {
//实训作业
return window.open(`/courses/${item.belong_container_id}/shixun_homeworks/${item.parent_container_id}/list?tab=0`)
}
@ -425,7 +431,7 @@ class MessagSub extends Component{
// //实训作业
// return window.open(`/courses/${item.belong_container_id}/shixun_homeworks/${item.parent_container_id}/list?tab=0`)
// }
return window.open(`/courses/${item.belong_container_id}/common_homeworks/${item.trigger_user.id}/${item.parent_container_id}/appraise`);
return window.open(`/courses/${item.belong_container_id}/common_homeworks/${item.trigger_user.id}/${item.parent_container_id}/appraise`);
case "ChallengeWorkScore" :
return '';
case "SendMessage" :
@ -448,174 +454,191 @@ class MessagSub extends Component{
// /managements/library_applies
return window.open(`/managements/library_applies`)
}
if(item.tiding_type === 'System'){
if (item.tiding_type === 'System') {
//教学案例详情 :id = container_id
return window.open(`/moop_cases/${item.container_id}`)
}
case "ProjectPackage" :
if(item.tiding_type==="Destroyed"){
return ;
}
if(item.tiding_type==="Destroyed_end"){
return ;
}else {
if (item.tiding_type === 'Apply') {
///managements/project_package_applies
return window.open(`/managements/project_package_applies`)
if (item.tiding_type === "Destroyed") {
return;
}
// if(item.tiding_type === 'System'){
if (item.tiding_type === "Destroyed_end") {
return;
} else {
if (item.tiding_type === 'Apply') {
///managements/project_package_applies
return window.open(`/managements/project_package_applies`)
}
// if(item.tiding_type === 'System'){
//众包详情 :id = container_id
return window.open(`/crowdsourcing/${item.container_id}`)
// }
// }
}
case "Discuss":
return window.open(`/shixuns/${item.identifier}/shixun_discuss`);
case "Discuss":
return window.open(`/shixuns/${item.identifier}/shixun_discuss`);
case "Video":
if(item.tiding_type==="Apply"){
if (item.tiding_type === "Apply") {
return window.open(`/managements/video_applies`);
}else if(item.tiding_type==="System"){
} else if (item.tiding_type === "System") {
return window.open(`/users/${this.props.current_user.login}/videos`);
}
return '';
case "PublicCourseStart":
return window.open(`/courses/${item.container_id}/informs`);
case "SubjectStartCourse":
case "PublicCourseStart":
return window.open(`/courses/${item.container_id}/informs`);
case "SubjectStartCourse":
return window.open(`/paths/${item.container_id}`);
case "ResubmitStudentWork":
return window.open(`/courses/${item.belong_container_id}/graduation_tasks/${item.container_id}/appraise`);
case "AdjustScore":
//belong_container_id course的id
return window.open(`/courses/${item.belong_container_id}/graduation_tasks/${item.parent_container_id}`);
default :
return window.open("/")
return window.open("/")
}
}
render() {
let{page,limit,typeysl,count,isSpin,data}=this.state;
let {page, limit, typeysl, count, isSpin, data} = this.state;
// console.log("6868686868");
// console.log(data);
return (
<div className="clearfix ml20">
{/*头部筛选数据*/}
<ul className="pl10 ridingNav clearfix edu-back-white">
<li className={typeysl===""?"active":""}><a onClick={(s,i)=>this.getdata("",1)}>全部</a></li>
<div className="clearfix ml20">
{/*头部筛选数据*/}
<ul className="pl10 ridingNav clearfix edu-back-white">
<li className={typeysl === "" ? "active" : ""}><a onClick={(s, i) => this.getdata("", 1)}>全部</a></li>
<li className={typeysl&&typeysl==="course"?"active":""} ><a onClick={(s,i)=>this.getdata("course",1)}>课堂提醒</a></li>
<li className={typeysl && typeysl === "course" ? "active" : ""}><a
onClick={(s, i) => this.getdata("course", 1)}>课堂提醒</a></li>
<li className={typeysl&&typeysl==="project"?"active":""} ><a onClick={(s,i)=>this.getdata("project",1)}>项目提醒</a></li>
<li className={typeysl && typeysl === "project" ? "active" : ""}><a
onClick={(s, i) => this.getdata("project", 1)}>项目提醒</a></li>
<li className={typeysl&&typeysl==="project_package"?"active":""}><a onClick={(s,i)=>this.getdata("project_package",1)}>众包提醒</a></li>
{/*<li className={typeysl && typeysl === "project_package" ? "active" : ""}><a*/}
{/*onClick={(s, i) => this.getdata("project_package", 1)}>众包提醒</a></li>*/}
<li className={typeysl&&typeysl==="interaction"?"active":""}><a onClick={(s,i)=>this.getdata("interaction",1)}>互动提醒</a></li>
<li className={typeysl && typeysl === "interaction" ? "active" : ""}><a
onClick={(s, i) => this.getdata("interaction", 1)}>互动提醒</a></li>
<li className={typeysl&&typeysl==="apply"?"active":""}><a onClick={(s,i)=>this.getdata("apply",1)}>审核</a></li>
<li className={typeysl && typeysl === "apply" ? "active" : ""}><a
onClick={(s, i) => this.getdata("apply", 1)}>审核</a></li>
<li className={typeysl&&typeysl==="notice"?"active":""}><a onClick={(s,i)=>this.getdata("notice",1)}>通知</a></li>
<li className={typeysl && typeysl === "notice" ? "active" : ""}><a
onClick={(s, i) => this.getdata("notice", 1)}>通知</a></li>
</ul>
{/*下面内容页面*/}
<div className="bor-top-greyE mycenter">
{/*这里可以进行数据处理*/}
<div className="myw100baifenbi">
<Spin size="large" className="myw100baifenbi mt10" spinning={isSpin}>
</ul>
{/*下面内容页面*/}
<div className="bor-top-greyE mycenter">
{/*这里可以进行数据处理*/}
<div className="myw100baifenbi">
<Spin size="large" className="myw100baifenbi mt10" spinning={isSpin}>
{
data===undefined?"":data.length===0?
<div className="edu-tab-con-box clearfix edu-txt-center">
<img className="edu-nodata-img mb20" src={getImageUrl("images/educoder/nodata.png")}/>
<p className="edu-nodata-p mb20">暂无数据哦~</p>
</div>
:data.map((item,key)=>{
// console.log(data)
// ridinglist-subs
var boolps=true;
if(item.container_type==="PraiseTread"||item.container_type==="Grade"||item.container_type==="ChallengeWorkScore"){
boolps=false;
}
if(item.container_type==="JournalsForMessage"){
if(item.parent_container_type==="Principal"){
boolps=false;
}
if(item.parent_container_type==="HomeworkCommon"){
if(item.homework_type===null||item.homework_type===undefined){
boolps=false;
}
}
}
// if(item.container_type==="HomeworkCommon"){
// if(item.parent_container_type==="AnonymousAppeal"){
// boolps=false;
// }
// }
if(item.container_type==="ProjectPackage"){
if(item.tiding_type==="Destroyed_end"){
boolps=false;
{
data === undefined ? "" : data.length === 0 ?
<div className="edu-tab-con-box clearfix edu-txt-center">
<img className="edu-nodata-img mb20" src={getImageUrl("images/educoder/nodata.png")}/>
<p className="edu-nodata-p mb20">暂无数据哦~</p>
</div>
: data.map((item, key) => {
// console.log(data)
// ridinglist-subs
var boolps = true;
if (item.container_type === "PraiseTread" || item.container_type === "Grade" || item.container_type === "ChallengeWorkScore") {
boolps = false;
}
if (item.container_type === "JournalsForMessage") {
if (item.parent_container_type === "Principal") {
boolps = false;
}
if (item.parent_container_type === "HomeworkCommon") {
if (item.homework_type === null || item.homework_type === undefined) {
boolps = false;
}
}
}
if(item.tiding_type==="Destroyed"){
boolps=false;
// if(item.container_type==="HomeworkCommon"){
// if(item.parent_container_type==="AnonymousAppeal"){
// boolps=false;
// }
// }
if (item.container_type === "ProjectPackage") {
if (item.tiding_type === "Destroyed_end") {
boolps = false;
}
if (item.tiding_type === "Destroyed") {
boolps = false;
}
}
if (item.container_type === "Course") {
if (item.tiding_type === "Delete") {
boolps = false;
}
}
}
if(item.container_type==="Course"){
if(item.tiding_type==="Delete"){
boolps=false;
}
}
return(
<div className="pl25 ridinglist edu-back-white" key={key}>
<div className={boolps===true?"ridinglist-sub clearfix df tiding_item":"ridinglist-subs clearfix df tiding_item"} onClick={()=>this.gettourl(item)}>
<img onMouseDown={()=>this.myCome(item)} src={getImageUrl("images/"+item.trigger_user.image_url)} className="radius mr10 fl myimgw48 myimgh48"/>
<div className="fl flex1">
<p>
<a className="mr20 private_message_a" onMouseDown={()=>this.myCome(item)}>{item.trigger_user.name}</a>
<span className="color-grey-c">{item.time}</span>
{item.tiding_type==="Apply"?(
item.status===0?
<span className="edu-filter-btn ml20 edu-filter-btn-red">待处理</span>:""
):""}
{item.tiding_type==="Apply"?(
item.status===1?
<span className="edu-filter-btn ml20 edu-filter-btn-green">已处理</span>:""
):""}
return (
<div className="pl25 ridinglist edu-back-white" key={key}>
<div
className={boolps === true ? "ridinglist-sub clearfix df tiding_item" : "ridinglist-subs clearfix df tiding_item"}
onClick={() => this.gettourl(item)}>
<img onMouseDown={() => this.myCome(item)}
src={getImageUrl("images/" + item.trigger_user.image_url)}
className="radius mr10 fl myimgw48 myimgh48"/>
<div className="fl flex1">
<p>
<a className="mr20 private_message_a"
onMouseDown={() => this.myCome(item)}>{item.trigger_user.name}</a>
<span className="color-grey-c">{item.time}</span>
{item.tiding_type === "Apply" ? (
item.status === 0 ?
<span className="edu-filter-btn ml20 edu-filter-btn-red">待处理</span> : ""
) : ""}
{item.tiding_type === "Apply" ? (
item.status === 1 ?
<span className="edu-filter-btn ml20 edu-filter-btn-green">已处理</span> : ""
) : ""}
</p>
<style>
{
`.yslspansk span{
</p>
<style>
{
`.yslspansk span{
color: #FF9966!important;
}
`
}
</style>
<p className="color-grey-6 yslspansk markdown-body mt10" style={{wordBreak: "break-word"}} dangerouslySetInnerHTML={{__html: markdownToHTML(item.content).replace(/▁/g, "▁▁▁")}} ></p>
</div>
}
</style>
<p className="color-grey-6 yslspansk markdown-body mt10" style={{wordBreak: "break-word"}}
dangerouslySetInnerHTML={{__html: markdownToHTML(item.content).replace(/▁/g, "▁▁▁")}}></p>
</div>
<span className={item.new_tiding===true?"new-point fr mr40 mt22":""}></span>
</div>
<span className={item.new_tiding === true ? "new-point fr mr40 mt22" : ""}></span>
</div>
</div>
)
})}
</Spin>
</div>
)
})}
</Spin>
{/*页数*/}
{ data===undefined?""
:
(count>10?
<div style={{textAlign: "center"}} className="new_expand mt10">
<div className="edu-txt-center mt30">
<Pagination showQuickJumper current={page}
onChange={this.paginationonChanges} pageSize={limit}
total={count}></Pagination>
</div>
</div>:""
)
{/*页数*/}
{data === undefined ? ""
:
(count > 10 ?
<div style={{textAlign: "center"}} className="new_expand mt10">
<div className="edu-txt-center mt30">
<Pagination showQuickJumper current={page}
onChange={this.paginationonChanges} pageSize={limit}
total={count}></Pagination>
</div>
</div> : ""
)
}
</div>
}
</div>
</div>
</div>
</div>
</div>
)
}
}
export default MessagSub;

@ -495,7 +495,7 @@ class DetailCards extends Component{
:
<li className={showparagraph===false?"none":"fr status_li"}>
{
showparagraphkey===key&&showparagraphindex===index?this.props.detailInfoList&&this.props.detailInfoList.allow_statistics===false&&this.props.MenuItemsindextype===2?"":<div>
showparagraphkey===key&&showparagraphindex===index?this.props.detailInfoList&&this.props.detailInfoList.allow_statistics===false&&this.props.current_user&&this.props.current_user.user_identity==="学生"&&this.props.courses!=undefined?"":<div>
<Link to={'/shixuns/'+line.identifier+'/challenges'} className="mr30 color-blue_4C shixun_detail pointer fl" target="_blank">查看详情</Link>
{line.shixun_status==="暂未公开"?"":<a onClick={()=>this.startgameid(line.identifier)} className="btn_auto user_bluebg_btn fl" id="shixun_operation" >开始实战</a>}
</div>:""

@ -236,19 +236,24 @@ export default class TPMMDEditor extends Component {
setTimeout(() => {
if (that.props.needRecreate == true) {
__editorName.recreate()
__editorName.recreate() // 注意 必须在setValue之前触发不然会清空
} else {
__editorName.resize()
}
console.log('timeout', __editorName.id)
__editorName.cm && __editorName.cm.refresh()
}, that.props.refreshTimeout || 500)
if (that.props.initValue != undefined && that.props.initValue != '') {
__editorName.setValue(that.props.initValue)
}
if (that.state.initValue) {
__editorName.setValue(that.state.initValue)
if (this.props.noSetValueOnInit) {
that.onEditorChange()
} else {
if (that.props.initValue != undefined && that.props.initValue != '') {
__editorName.setValue(that.props.initValue)
}
if (that.state.initValue) {
__editorName.setValue(that.state.initValue)
}
}
__editorName.cm.on("change", (_cm, changeObj) => {
that.contentChanged = true;
if (that.state.showError) {
@ -277,6 +282,7 @@ export default class TPMMDEditor extends Component {
onEditorChange = () => {
if (!this.answers_editormd) return;
const val = this.answers_editormd.getValue();
//console.log('onEditorChange', this.props.id, val)
try {
this.props.onChange && this.props.onChange(val)
} catch(e) {

@ -109,7 +109,7 @@ class ChangeHeaderPicModal extends Component{
// https://www.trustie.net/issues/22461
if ( this.props.current_user.image_url.indexOf('avatars/User/b') != -1
|| this.props.current_user.image_url.indexOf('avatars/User/g') != -1 ) {
this.setTimeout(() => {
window.setTimeout(() => {
this.doAfterUpdated()
}, 1000)
} else {

@ -163,6 +163,13 @@ class InfosCourse extends Component{
</div>
<div className="edu-txt-center course-bottom">
<div className="inline color-grey-6">
{item.visits>0?<span className="fl ml10 mr10 squareIconSpan">
<Tooltip placement="bottom" title="访问量">
<i className="iconfont icon-liulanyan fl mr3"></i>{item.visits}
</Tooltip>
</span>:""}
{
item.members_count > 0 &&
<Tooltip placement="bottom" title="成员">
@ -177,13 +184,13 @@ class InfosCourse extends Component{
<i className="iconfont icon-zuoye fl mr3" data-tip-down="作业"></i>{item.homework_commons_count}</span>
</Tooltip>
}
{
item.attachments_count > 0 &&
<Tooltip placement="bottom" title="资源">
<span className="fl ml10 mr10 squareIconSpan">
<i className="iconfont icon-ziyuan fl mr3" data-tip-down="资源"></i>{item.attachments_count}</span>
</Tooltip>
}
{/*{*/}
{/*item.attachments_count > 0 && */}
{/*<Tooltip placement="bottom" title="资源">*/}
{/*<span className="fl ml10 mr10 squareIconSpan">*/}
{/*<i className="iconfont icon-ziyuan fl mr3" data-tip-down="资源"></i>{item.attachments_count}</span>*/}
{/*</Tooltip>*/}
{/*}*/}
</div>
</div>
</div>

@ -541,7 +541,7 @@ class InfosTopics extends Component{
<div className="cl"></div>
<p className="color-grey panel-lightgrey mt16 fl">
<p className="color-grey mt16 fl">
<span className={"topicswidth600"}>
{types==="publicly"?<span className="topsics135 color-grey9 mr50">{item.creator_name}</span>:""}
<span className="mr50 color-grey9">{item.quotes_count} 次引用</span>

Loading…
Cancel
Save