毕设调整

dev_forum
杨树明 6 years ago
parent 2141b068f9
commit e0668cea7c

@ -248,20 +248,7 @@ class Fileslistitem extends Component{
} }
</style> </style>
{this.props.isAdmin ||this.props.current_user.username===discussMessage.author.name?
<span className={"sttingbox"}>
<WordsBtn style="blue" className="colorblue font-16 mr20 fr">
<a className="btn colorblue"
onClick={()=>this.settingList()}>设置</a>
</WordsBtn>
<WordsBtn style="blue" className="colorblue font-16 mr20 fr">
<a className="btn colorblue"
onClick={()=>this.onDelete(discussMessage.id)}>删除</a>
</WordsBtn>
</span>:""}
<style> <style>
{ {
@ -269,25 +256,28 @@ class Fileslistitem extends Component{
.lightgreybox{ .lightgreybox{
min-width: 260px; min-width: 260px;
} }
.mrf2{
margin-top: -2px;
}
` `
} }
</style> </style>
{discussMessage.course_groups.length===0?"": {discussMessage.course_groups.length===0?"":
<p className="color-grey panel-lightgrey mt8 fl lightgreybox"> <p className="color-grey panel-lightgrey mt8 fl lightgreybox" style={{width:'100%'}}>
{discussMessage.course_groups.map((item,key)=>{ {discussMessage.course_groups.map((item,key)=>{
return( return(
<div className="mr50"> <div className="mr50">
<span className="mr15 color-dark">{item.course_group_name}</span> <span className="mr15 color-dark">{item.course_group_name}</span>
<span className="mr15 color-grey9 fr">发布于 { moment(item.course_group_publish_time).format('YYYY-MM-DD hh:mm')}</span> <span className="mr15 color-grey9 ">发布于 { moment(item.course_group_publish_time).format('YYYY-MM-DD hh:mm')}</span>
</div> </div>
) )
})} })}
</p>} </p>}
<p className="color-grey panel-lightgrey mt8 fl" style={{width:'70%'}}> <p className="color-grey panel-lightgrey mt8 fl" style={{width:'100%'}}>
<span className="mr50"> <span className="mr50">
<span className="mr15 color-dark">{discussMessage.author.name}</span> <span className="mr15 color-dark">{discussMessage.author.login}</span>
<span className="mr15 color-grey9">大小 {discussMessage.filesize}</span> <span className="mr15 color-grey9">大小 {discussMessage.filesize}</span>
<span className="mr15 color-grey9">下载 {discussMessage.downloads_count}</span> <span className="mr15 color-grey9">下载 {discussMessage.downloads_count}</span>
<span className="mr15 color-grey9">引用 {discussMessage.quotes}</span> <span className="mr15 color-grey9">引用 {discussMessage.quotes}</span>
@ -299,15 +289,31 @@ class Fileslistitem extends Component{
{ discussMessage.publish_time===null?"":discussMessage.is_publish===true?moment(discussMessage.publish_time).fromNow():moment(discussMessage.publish_time).format('YYYY-MM-DD hh:mm')} { discussMessage.publish_time===null?"":discussMessage.is_publish===true?moment(discussMessage.publish_time).fromNow():moment(discussMessage.publish_time).format('YYYY-MM-DD hh:mm')}
</span> </span>
</span> </span>
{this.props.isAdmin ||this.props.current_user.login===discussMessage.author.login?
<span className={"fr mrf2"}>
<WordsBtn style="blue" className="colorblue font-16 mr20 fr">
<a className="btn colorblue"
onClick={()=>this.settingList()}>设置</a>
</WordsBtn>
<WordsBtn style="blue" className="colorblue font-16 mr20 fr">
<a className="btn colorblue"
onClick={()=>this.onDelete(discussMessage.id)}>删除</a>
</WordsBtn>
</span>:""}
</p> </p>
<p className="color-grey panel-lightgrey mt8 fl" style={{width:'100%'}}> <p className="color-grey panel-lightgrey mt8 fl" style={{width:'100%'}}>
<span className="mr50"> <span className="mr50">
<span className="mr15 color-dark">资源描述 :</span> {/*<span className="mr15 color-dark"></span>*/}
<span className="mr15 color-dark">{discussMessage.description}</span> <span className="mr15 color-dark">
{this.props.isAdmin ?<span><i className="iconfont icon-bianjidaibeijing font-22 color-green" onClick={()=>this.settingList()}></i></span>:""} <pre>资源描述 :{discussMessage.description===null?"暂无描述":discussMessage.description}</pre>
</span>
{/*{this.props.isAdmin ?<span><i className="iconfont icon-bianjidaibeijing font-22 color-green" onClick={()=>this.settingList()}></i></span>:""}*/}
</span> </span>
</p> </p>

@ -655,8 +655,8 @@ class Fileslists extends Component{
secondRowLeft={ secondRowLeft={
<div style={{"display":"inline-block", "marginTop": "22px"}}> <div style={{"display":"inline-block", "marginTop": "22px"}}>
<span> {total_count} 个资源</span> <span> {total_count} 个资源</span>
<span style={{"marginLeft":"16px"}}>公共资源{public_count}</span> <span style={{"marginLeft":"16px"}}>已发布{public_count}</span>
{this.props.isAdmin()||this.props.isStudent()?<span style={{"marginLeft":"16px"}}>私有资源{private_count}</span>:""} {this.props.isAdmin()||this.props.isStudent()?<span style={{"marginLeft":"16px"}}>未发布{private_count}</span>:""}
</div> </div>
} }
onPressEnter={this.onPressEnter} onPressEnter={this.onPressEnter}

@ -1,136 +1,136 @@
import React, { Component } from 'react'; import React, { Component } from 'react';
import {getImageUrl} from 'educoder'; import {getImageUrl} from 'educoder';
import { BrowserRouter as Router, Route, Link } from "react-router-dom"; import { BrowserRouter as Router, Route, Link } from "react-router-dom";
import {Tooltip,Spin,Alert} from 'antd'; import {Tooltip,Spin,Alert} from 'antd';
import ShowSpin from '../../../common/ShowSpin'; import ShowSpin from '../../../common/ShowSpin';
class coursesHomeCard extends Component{ class coursesHomeCard extends Component{
constructor(props) { constructor(props) {
super(props) super(props)
} }
render(){ render(){
let {coursesHomelist}=this.props; let {coursesHomelist}=this.props;
return( return(
<div className="educontent mb20" id="subjects_list_content"> <div className="educontent mb20" id="subjects_list_content">
<style> <style>
{` {`
.square-Item .square-img img { .square-Item .square-img img {
width: 60px; width: 60px;
border-radius: 6px 6px 0px 0px; border-radius: 6px 6px 0px 0px;
vertical-align: bottom; vertical-align: bottom;
height: 60px; height: 60px;
border-radius: 50%; border-radius: 50%;
}` }`
} }
</style> </style>
<div className="square-list clearfix"> <div className="square-list clearfix">
{/*<ShowSpin/>*/} {/*<ShowSpin/>*/}
{ {
coursesHomelist===undefined?"":coursesHomelist.courses.map((item,key)=>{ coursesHomelist===undefined?"":coursesHomelist.courses.map((item,key)=>{
return( return(
<div className = "square-Item" style={{cursor:'pointer'}} key={key}> <div className = "square-Item" style={{cursor:'pointer'}} key={key}>
<div className={item.is_public===0&&item.is_accessible === false ? "closeSquare" : "none"}> <div className={item.is_public===0&&item.is_accessible === false ? "closeSquare" : "none"}>
<img src={getImageUrl("images/educoder/icon/lockclose.svg")} <img src={getImageUrl("images/educoder/icon/lockclose.svg")}
className="mt80 mb25"/> className="mt80 mb25"/>
<p className="font-14 color-white">非成员不能访问</p> <p className="font-14 color-white">非成员不能访问</p>
</div> </div>
<Link to={item.first_category_url} className="square-img" target="_blank"> <a href={item.first_category_url} className="square-img" target="_blank">
{ {
item.is_public===1&&item.id===1309? item.is_public===1&&item.id===1309?
<div> <div>
<div className = "publicpart orangeBlack"></div> <div className = "publicpart orangeBlack"></div>
<span className="smalltrangle"></span> <span className="smalltrangle"></span>
<span className={"publicword"}> 公开 </span> <span className={"publicword"}> 公开 </span>
</div> </div>
:"" :""
} }
{ {
item.is_public===1&&item.id!=1309? item.is_public===1&&item.id!=1309?
<div> <div>
<div className = "publicpart"></div> <div className = "publicpart"></div>
<span className="smalltrangle"></span> <span className="smalltrangle"></span>
<span className={"publicword"}> 公开 </span> <span className={"publicword"}> 公开 </span>
</div> </div>
:"" :""
} }
{item.is_end===true?<p className="fr squareIconSpan mt10 biaoqiancours"> {item.is_end===true?<p className="fr squareIconSpan mt10 biaoqiancours">
<i className="iconfont icon-biaoqian fl memberscount"></i> <i className="iconfont icon-biaoqian fl memberscount"></i>
<div className={"coursesover"}>已结束</div> <div className={"coursesover"}>已结束</div>
</p>:""} </p>:""}
<div className="substance"> <div className="substance">
<p className="subName font-16"> <p className="subName font-16">
{/*{item.name.length>32?*/} {/*{item.name.length>32?*/}
{/*<Tooltip placement="bottom" >*/} {/*<Tooltip placement="bottom" >*/}
{/**/} {/**/}
{/*</Tooltip>: <span>{item.name}</span>}*/} {/*</Tooltip>: <span>{item.name}</span>}*/}
<span title={item.name.length>23?item.name:""}>{item.name}</span> <span title={item.name.length>23?item.name:""}>{item.name}</span>
</p> </p>
<span className={"color-dark"}> <span className={"color-dark"}>
<img alt="用户" className="radius mt15" height="60" src={getImageUrl(`${"images/"+item.avatar_url}`)} width="60"/> <img alt="用户" className="radius mt15" height="60" src={getImageUrl(`${"images/"+item.avatar_url}`)} width="60"/>
</span> </span>
<p className="font-14 mt10"><span className={"color-dark"}>{item.creator} {item.technical_title}</span></p> <p className="font-14 mt10"><span className={"color-dark"}>{item.creator} {item.technical_title}</span></p>
<p className="font-16 mb15 task-hide mt10"> <p className="font-16 mb15 task-hide mt10">
<Tooltip placement="bottom" title={item.school}> <Tooltip placement="bottom" title={item.school}>
<span className="color-grey-98">{item.school}</span> <span className="color-grey-98">{item.school}</span>
</Tooltip> </Tooltip>
</p> </p>
</div> </div>
<div className="edu-txt-center course-bottom"> <div className="edu-txt-center course-bottom">
<div className="inline color-grey-B4"> <div className="inline color-grey-B4">
{item.visits===0?"":<span className="fl ml10 mr10 squareIconSpan"> {item.visits===0?"":<span className="fl ml10 mr10 squareIconSpan">
<Tooltip placement="bottom" title="访问量"> <Tooltip placement="bottom" title="访问量">
<i className="iconfont icon-liulanyan fl mr3"></i>{item.visits} <i className="iconfont icon-liulanyan fl mr3"></i>{item.visits}
</Tooltip> </Tooltip>
</span>} </span>}
{item.course_members_count===0?"":<span className="fl ml10 mr10 squareIconSpan"> {item.course_members_count===0?"":<span className="fl ml10 mr10 squareIconSpan">
<Tooltip placement="bottom" title="成员"> <Tooltip placement="bottom" title="成员">
<i className="iconfont icon-chengyuan fl mr3"></i>{item.course_members_count} <i className="iconfont icon-chengyuan fl mr3"></i>{item.course_members_count}
</Tooltip> </Tooltip>
</span>} </span>}
{item.tasks_count===0?"":<span className="fl ml10 mr10 squareIconSpan"> {item.tasks_count===0?"":<span className="fl ml10 mr10 squareIconSpan">
<Tooltip placement="bottom" title="作业"> <Tooltip placement="bottom" title="作业">
<i className="iconfont icon-zuoye fl mr3"></i>{item.tasks_count} <i className="iconfont icon-zuoye fl mr3"></i>{item.tasks_count}
</Tooltip> </Tooltip>
</span>} </span>}
{/*<span className="fl ml10 mr10 squareIconSpan">*/} {/*<span className="fl ml10 mr10 squareIconSpan">*/}
{/*<Tooltip placement="bottom" title="资源">*/} {/*<Tooltip placement="bottom" title="资源">*/}
{/*<i className="iconfont icon-ziyuan fl mr3"></i>{item.attachment_count}*/} {/*<i className="iconfont icon-ziyuan fl mr3"></i>{item.attachment_count}*/}
{/*</Tooltip>*/} {/*</Tooltip>*/}
{/*</span>*/} {/*</span>*/}
</div> </div>
</div> </div>
</Link> </a>
</div> </div>
) )
}) })
} }
</div> </div>
</div> </div>
) )
} }
} }
export default coursesHomeCard; export default coursesHomeCard;

@ -185,18 +185,21 @@ class GraduateTaskItem extends Component{
{ {
this.props.isAdmin?<a href={"/courses/"+coursesId+"/graduation_tasks/"+categoryid+"/"+taskid+"/list"} this.props.isAdmin?<a href={"/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>:""
} }
{ {
this.props.isStudent? <a href={"/courses/"+coursesId+"/graduation_tasks/"+categoryid+"/"+taskid+"/list"} this.props.isStudent? <a href={"/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>:""
} }
{ {
this.props.isNotMember?this.props.discussMessage.private_icon===true? this.props.isNotMember?this.props.discussMessage.private_icon===true?
<span className="fl mt3 font-16 font-bd color-dark maxwidth580">{discussMessage.name}</span> <span className="fl mt3 font-16 font-bd color-dark maxwidth580" title={discussMessage.name}>{discussMessage.name}</span>
: :
<a href={"/courses/"+coursesId+"/graduation_tasks/"+categoryid+"/"+taskid+"/list"} <a href={"/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>:""
} }

@ -473,7 +473,7 @@ class GraduationTasksSubmitedit extends Component{
{/*<Link to={"/courses/"+courseId+"/graduation/graduation_tasks/"+category_id} className="color-grey-6">{workslist&&workslist.task_name}</Link>*/} {/*<Link to={"/courses/"+courseId+"/graduation/graduation_tasks/"+category_id} className="color-grey-6">{workslist&&workslist.task_name}</Link>*/}
{/*<span className="color-grey-9 ml3 mr3">&gt;</span>*/} {/*<span className="color-grey-9 ml3 mr3">&gt;</span>*/}
{/*</WordsBtn>*/} {/*</WordsBtn>*/}
<span>{this.props.user.username} 提交作品</span> <span>{this.props.user&&this.props.user.username} 提交作品</span>
</p> </p>
<div style={{ width:'100%',height:'75px'}} > <div style={{ width:'100%',height:'75px'}} >

@ -459,7 +459,7 @@ render(){
{/*<Link to={"/courses/"+courseId+"/graduation/graduation_tasks/"+category_id} className="color-grey-6">{workslist&&workslist.task_name}</Link>*/} {/*<Link to={"/courses/"+courseId+"/graduation/graduation_tasks/"+category_id} className="color-grey-6">{workslist&&workslist.task_name}</Link>*/}
{/*<span className="color-grey-9 ml3 mr3">&gt;</span>*/} {/*<span className="color-grey-9 ml3 mr3">&gt;</span>*/}
{/*</WordsBtn>*/} {/*</WordsBtn>*/}
<span>{this.props.user.username} 提交作品</span> <span>{this.props.user&&this.props.user.username} 提交作品</span>
</p> </p>
<div style={{ width:'100%',height:'75px'}} > <div style={{ width:'100%',height:'75px'}} >

@ -234,11 +234,11 @@ class GraduationTasksappraise extends Component{
<div className={"color-grey-6 h20 ml20"}> <div className={"color-grey-6 h20 ml20"}>
<span className={"color9B9B fr"}>更新</span> {/*<span className={"color9B9B fr"}>更新</span>*/}
<span className={"fr font-13 mr10 ml10"}>{datalist&&datalist.update_user_name}</span> {/*<span className={"fr font-13 mr10 ml10"}>{datalist&&datalist.update_user_name}</span>*/}
<span className={"color9B9B fr"}> {/*<span className={"color9B9B fr"}>*/}
{moment(datalist&&datalist.update_time).format('YYYY-MM-DD HH:mm:ss')==="Invalid date"?"":moment(datalist&&datalist.update_time).format('YYYY-MM-DD HH:mm:ss')} {/*{moment(datalist&&datalist.update_time).format('YYYY-MM-DD HH:mm:ss')==="Invalid date"?"":moment(datalist&&datalist.update_time).format('YYYY-MM-DD HH:mm:ss')}*/}
</span> {/*</span>*/}
<span className={"color9B9B fr mr30"}>提交</span> <span className={"color9B9B fr mr30"}>提交</span>
<span className={"fr font-13 mr10 ml10"}>{datalist&&datalist.author_name}</span> <span className={"fr font-13 mr10 ml10"}>{datalist&&datalist.author_name}</span>
<span className={" color9B9B fr"}> <span className={" color9B9B fr"}>

@ -124,8 +124,9 @@ class GraduationTasksappraiseReply extends Component{
saveModulationModal=(value,num)=>{ saveModulationModal=(value,num)=>{
console.log(value,num) console.log(value,num)
let {operationId}=this.state; let {operationId}=this.state;
let category_id= this.props.match.params.category_id;
// console.log(value,num) // console.log(value,num)
let url ="/graduation_works/"+operationId+"/adjust_score.json"; let url ="/graduation_works/"+category_id+"/adjust_score.json";
axios.post(url,{ axios.post(url,{
score:num, score:num,
comment:value comment:value
@ -138,6 +139,7 @@ class GraduationTasksappraiseReply extends Component{
Modalstopval:result.data.message, Modalstopval:result.data.message,
ModalSave:this.cancelmodel, ModalSave:this.cancelmodel,
}) })
this.fetchAllComments()
} }
}).catch((error)=>{ }).catch((error)=>{

@ -18,7 +18,7 @@ class GraduationTasksedit extends Component{
this.state={ this.state={
coursename:"", coursename:"",
coursesearch:"", coursesearch:"",
title_num:20, title_num:60,
title_value:"", title_value:"",
fileList: [], fileList: [],
contents: [{val:"",id:1}], contents: [{val:"",id:1}],
@ -138,8 +138,11 @@ class GraduationTasksedit extends Component{
} }
goback=()=>{ goback=()=>{
let courseId=this.props.match.params.coursesId; // let courseId=this.props.match.params.coursesId;
window.location.href="/courses/"+courseId+"/graduation_tasks/"+this.state.data.graduation_id; // window.location.href="/courses/"+courseId+"/graduation_tasks/"+this.state.data.graduation_id;
// goback = () => {
window.history.go(-1)
} }
@ -147,7 +150,7 @@ class GraduationTasksedit extends Component{
changeTitle=(e)=>{ changeTitle=(e)=>{
this.setState({ this.setState({
title_num:20-parseInt(e.target.value.length), title_num:60-parseInt(e.target.value.length),
title_value:e.target.value title_value:e.target.value
}) })
@ -315,7 +318,7 @@ class GraduationTasksedit extends Component{
<Form.Item label="任务标题" > <Form.Item label="任务标题" >
{getFieldDecorator('name', { {getFieldDecorator('name', {
rules: [{ required: true, message: "请输入标题" }], rules: [{ required: true, message: "请输入标题" }],
})(<Input placeholder="请输入任务名称最大限制20个字符" value={name} onInput={this.changeTitle} className="searchView searchViewAfter" style={{"width":"100%"}} maxLength="20" addonAfter={String(title_num)}/>)} })(<Input placeholder="请输入任务名称最大限制20个字符" value={name} onInput={this.changeTitle} className="searchView searchViewAfter" style={{"width":"100%"}} maxLength="60" addonAfter={String(title_num)}/>)}
</Form.Item> </Form.Item>
<input type="hidden" id='nametypes' /> <input type="hidden" id='nametypes' />
</div> </div>

@ -111,11 +111,11 @@ class GraduationTaskssettingapp extends Component{
max_nums: result.data.max_num, max_nums: result.data.max_num,
task_type: result.data.task_type, task_type: result.data.task_type,
baseonproject: result.data.base_on_project, baseonproject: result.data.base_on_project,
publish_time: result.data.publish_time, publish_time:moment(moment(handleDateString(result.data.publish_time))).format("YYYY-MM-DD HH:mm"),
end_time: result.data.end_time, end_time:moment(moment(handleDateString(result.data.end_time))).format("YYYY-MM-DD HH:mm"),
allowlate: result.data.allow_late, allowlate: result.data.allow_late,
latepenalty: result.data.late_penalty, latepenalty: result.data.late_penalty,
latetime: result.data.late_time, latetime:moment(moment(handleDateString(result.data.late_time))).format("YYYY-MM-DD HH:mm"),
crosscomment: result.data.cross_comment, crosscomment: result.data.cross_comment,
taskid: result.data.id, taskid: result.data.id,
taskname: result.data.task_name, taskname: result.data.task_name,
@ -128,7 +128,7 @@ class GraduationTaskssettingapp extends Component{
hasproject: result.data.has_project, hasproject: result.data.has_project,
hascommit: result.data.has_commit, hascommit: result.data.has_commit,
assigngroups: assigngroups, assigngroups: assigngroups,
commenttime: result.data.comment_time, commenttime:moment(moment(handleDateString(result.data.comment_time))).format("YYYY-MM-DD HH:mm"),
task_status: result.data.task_status task_status: result.data.task_status
}) })
} }
@ -142,7 +142,9 @@ class GraduationTaskssettingapp extends Component{
componentDidMount(){ componentDidMount(){
this.getsettings(); this.getsettings();
if(this.props.isAdmin()===true){
this.editSetting()
}
} }
@ -210,17 +212,18 @@ class GraduationTaskssettingapp extends Component{
latetime:null latetime:null
}) })
}else{ }else{
endtime=moment(handleDateString(dateString)).add(1, 'months')
endtime= moment(moment(handleDateString(dateString))).add(1, 'months').format("YYYY-MM-DD HH:mm")
let {allowlate}=this.state; let {allowlate}=this.state;
if(allowlate===true||allowlate===1){ if(allowlate===true||allowlate===1){
this.setState({ this.setState({
publish_time:handleDateString(dateString), publish_time:moment(moment(handleDateString(dateString))).format("YYYY-MM-DD HH:mm"),
end_time:endtime, end_time:endtime,
latetime:moment(endtime).add(1, 'months'), latetime:moment(moment(handleDateString(endtime))).add(1, 'months').format("YYYY-MM-DD HH:mm"),
}) })
}else{ }else{
this.setState({ this.setState({
publish_time:handleDateString(dateString), publish_time:moment(moment(handleDateString(dateString))).format("YYYY-MM-DD HH:mm"),
end_time:endtime end_time:endtime
}) })
} }
@ -240,12 +243,12 @@ class GraduationTaskssettingapp extends Component{
let {allowlate}=this.state; let {allowlate}=this.state;
if(allowlate===true||allowlate===1){ if(allowlate===true||allowlate===1){
this.setState({ this.setState({
end_time:handleDateString(dateString), end_time:moment(moment(handleDateString(dateString))).format("YYYY-MM-DD HH:mm"),
latetime:moment(handleDateString(dateString)).add(1, 'months'), latetime:moment(moment(handleDateString(dateString))).add(1, 'months').format("YYYY-MM-DD HH:mm"),
}) })
}else{ }else{
this.setState({ this.setState({
end_time:handleDateString(dateString) end_time:moment(moment(handleDateString(dateString))).format("YYYY-MM-DD HH:mm"),
}) })
} }
@ -288,7 +291,7 @@ class GraduationTaskssettingapp extends Component{
this.setState({ this.setState({
latepenalty:5, latepenalty:5,
allowlate:e.target.value, allowlate:e.target.value,
latetime:end_time===null?"":moment(end_time).add(1, 'months'), latetime:end_time===null?"":moment(moment(handleDateString(end_time))).add(1, 'months').format("YYYY-MM-DD HH:mm"),
}) })
}else{ }else{
this.setState({ this.setState({
@ -326,7 +329,7 @@ class GraduationTaskssettingapp extends Component{
this.setState({ this.setState({
crosscomment:e.target.checked, crosscomment:e.target.checked,
commenttime:newtime commenttime:moment(moment(newtime)).format("YYYY-MM-DD HH:mm"),
}) })
}else{ }else{
@ -410,7 +413,7 @@ class GraduationTaskssettingapp extends Component{
Topval:"发布设置均可修改", Topval:"发布设置均可修改",
Botvalleft:"点击修改", Botvalleft:"点击修改",
Botval:"此设置将对所有分班生效", Botval:"此设置将对所有分班生效",
starttime:moment(moment(handleDateString(this.props.getNowFormatDates(1))).add(1, 'months')).format("YYYY-MM-DD HH:mm"), starttime:moment(moment(handleDateString(this.props.getNowFormatDates(1)))).format("YYYY-MM-DD HH:mm") ,
starttimes:this.props.getNowFormatDates(1), starttimes:this.props.getNowFormatDates(1),
typs:"start", typs:"start",
endtime:endtime, endtime:endtime,
@ -558,6 +561,7 @@ class GraduationTaskssettingapp extends Component{
commenttimetype:false commenttimetype:false
}) })
} }
debugger
if(moment(this.state.commenttime)<moment(publish_time)){ if(moment(this.state.commenttime)<moment(publish_time)){
this.setState({ this.setState({
commenttimetype:true, commenttimetype:true,
@ -569,6 +573,7 @@ class GraduationTaskssettingapp extends Component{
commenttimetype:false commenttimetype:false
}) })
} }
if(moment(this.state.commenttime)<moment(end_time)){ if(moment(this.state.commenttime)<moment(end_time)){
this.setState({ this.setState({
commenttimetype:true, commenttimetype:true,
@ -716,6 +721,7 @@ class GraduationTaskssettingapp extends Component{
if(resulet.data.status===0){ if(resulet.data.status===0){
this.getsettings(); this.getsettings();
this.cancelmodel(); this.cancelmodel();
this.isgoback()
this.setState({ this.setState({
// Modalstype:true, // Modalstype:true,
// Modalstopval:resulet.data.message, // Modalstopval:resulet.data.message,
@ -871,8 +877,8 @@ class GraduationTaskssettingapp extends Component{
//编辑 //编辑
editSetting = () => { editSetting = () => {
try {
if (this.state.settingdata.is_end === true) { if (this.state.settingdata&&this.state.settingdata.is_end === true) {
// this.setState({ // this.setState({
// modalsType: true, // modalsType: true,
// modalsTopval: "课堂已结束不能再修改!", // modalsTopval: "课堂已结束不能再修改!",
@ -886,9 +892,7 @@ class GraduationTaskssettingapp extends Component{
flagPageEdit: true, flagPageEdit: true,
}) })
} }
} catch (e) {
}
} }
@ -1025,8 +1029,8 @@ class GraduationTaskssettingapp extends Component{
</div> </div>
<div className="stud-class-set bor-bottom-greyE"> <div className="stud-class-set bor-bottom-greyE" id={"publishtimestart"}>
<div className="mt10 clearfix edu-back-white poll_list pl20"> <div className="mt10 clearfix edu-back-white poll_list pl20" id={"publishtimeend"}>
<Link to={"/courses/"+courseId+"/graduation_tasks/"+category_id+"/"+task_Id+"/list"}>任务列表</Link> <Link to={"/courses/"+courseId+"/graduation_tasks/"+category_id+"/"+task_Id+"/list"}>任务列表</Link>
<Link to={"/courses/"+courseId+"/graduation_tasks/"+category_id+"/"+task_Id+"/questions"}>任务问答</Link> <Link to={"/courses/"+courseId+"/graduation_tasks/"+category_id+"/"+task_Id+"/questions"}>任务问答</Link>
@ -1113,7 +1117,7 @@ class GraduationTaskssettingapp extends Component{
<div className={"h20 mb30 ml30"} id={"publishtimestart"}> <div className={"h20 mb30 ml30"} >
<span>发布时间</span> <span>发布时间</span>
<Tooltip placement="bottom" title={this.props.isAdmin()===true?starttimetype===true?"时间已过,不能再修改":"":""}> <Tooltip placement="bottom" title={this.props.isAdmin()===true?starttimetype===true?"时间已过,不能再修改":"":""}>
<span> <span>
@ -1150,7 +1154,7 @@ class GraduationTaskssettingapp extends Component{
{this.state.publishTimetypesval} {this.state.publishTimetypesval}
</div>:""} </div>:""}
<div className={"h20 mb30 ml30"} id={"publishtimeend"}> <div className={"h20 mb30 ml30"} >
<span>截止时间</span> <span>截止时间</span>
<Tooltip placement="bottom" title={this.props.isAdmin()===true?endtimetype===true?"时间已过,不能再修改":"":""}> <Tooltip placement="bottom" title={this.props.isAdmin()===true?endtimetype===true?"时间已过,不能再修改":"":""}>
<span> <span>
@ -1166,7 +1170,7 @@ class GraduationTaskssettingapp extends Component{
value={end_time===null||end_time===""?"":moment(end_time, dateFormat)} value={end_time===null||end_time===""?"":moment(end_time, dateFormat)}
onChange={this.onChangeTimeend} onChange={this.onChangeTimeend}
disabledTime={disabledDateTime} disabledTime={disabledDateTime}
disabled={this.props.isAdmin()===true?endtimetype===true?true:flagPageEdit===true?false:true:true} disabled={this.props.isSuperAdmin()===true?flagPageEdit===true?false:true:this.props.isAdmin()===true?endtimetype===true?true:flagPageEdit===true?false:true:true}
className={this.state.endTimetypes===true||end_timetype===true?"noticeTip":""} className={this.state.endTimetypes===true||end_timetype===true?"noticeTip":""}
/> />
</span> </span>

@ -105,10 +105,12 @@ class GraduationTaskssettinglist extends Component{
teacherrating: worklists[i].teacher_comment_score, teacherrating: worklists[i].teacher_comment_score,
crossrating: worklists[i].cross_comment_score, crossrating: worklists[i].cross_comment_score,
finalscore: worklists[i].final_score.work_score === null ? "--" : worklists[i].final_score.work_score, finalscore: worklists[i].final_score.work_score === null ? "--" : worklists[i].final_score.work_score,
operation: this.props.isAdmin()?[{name: worklists[i].assign === true ? "分配" : "", id: worklists[i].id}, { operation: this.props.isAdmin()?[{name: worklists[i].assign === true ? "分配" : "", id: worklists[i].id,status:worklists[i].status}, {
name: "调分", name: "调分",
id: worklists[i].id id: worklists[i].id,
}, {name:"评阅", id: worklists[i].id}]:[{name:"", id: worklists[i].id}], status:worklists[i].status
}, {name:"评阅", id: worklists[i].id, status:worklists[i].status}]:[{name:"", id: worklists[i].id,
status:worklists[i].status}],
}) })
} }
} }
@ -723,8 +725,8 @@ class GraduationTaskssettinglist extends Component{
<div> <div>
{this.props.isAdmin()?operation.map((tag,key) => { {this.props.isAdmin()?operation.map((tag,key) => {
return( return(
<div key={key}> <div key={key}>
<Tooltip placement="bottom" title={tag.name==="分配"?"指定该作品的交叉评阅人":tag.name==="调分"?<pre>调整学生最终成绩<br/> {tag.status===0?"--":<Tooltip placement="bottom" title={tag.name==="分配"?"指定该作品的交叉评阅人":tag.name==="调分"?<pre>调整学生最终成绩<br/>
其它历史评分将全部失效</pre>:""}> 其它历史评分将全部失效</pre>:""}>
{tag.name==="评阅"?<a style={{color:'#4CACFF'}} href={"/courses/"+courseId+"/graduation_tasks/"+tag.id+"/appraise"} >{tag.name}</a> {tag.name==="评阅"?<a style={{color:'#4CACFF'}} href={"/courses/"+courseId+"/graduation_tasks/"+tag.id+"/appraise"} >{tag.name}</a>
@ -734,7 +736,7 @@ class GraduationTaskssettinglist extends Component{
>{tag.name}</a> >{tag.name}</a>
} }
</Tooltip> </Tooltip>}
</div> </div>
) )
}):""} }):""}
@ -742,8 +744,10 @@ class GraduationTaskssettinglist extends Component{
this.props.isStudent()? this.props.isStudent()?
operation.map((tag,key) => { operation.map((tag,key) => {
return( return(
<div key={key}> <div key={key}>
{tag.status===0?"--":
<a style={{color:'#4CACFF'}} href={"/courses/"+courseId+"/graduation_tasks/"+tag.id+"/appraise"} >查看</a> <a style={{color:'#4CACFF'}} href={"/courses/"+courseId+"/graduation_tasks/"+tag.id+"/appraise"} >查看</a>
}
</div> </div>
)} )}
):"" ):""
@ -853,8 +857,9 @@ class GraduationTaskssettinglist extends Component{
<div> <div>
{this.props.isAdmin()?operation.map((tag,key) => { {this.props.isAdmin()?operation.map((tag,key) => {
return( return(
<div key={key}> <div key={key}>
<Tooltip placement="bottom" title={tag.name==="分配"?"指定该作品的交叉评阅人":tag.name==="调分"?<pre>调整学生最终成绩<br/> {tag.status===0?"--":
<Tooltip placement="bottom" title={tag.name==="分配"?"指定该作品的交叉评阅人":tag.name==="调分"?<pre>调整学生最终成绩<br/>
其它历史评分将全部失效</pre>:""}> 其它历史评分将全部失效</pre>:""}>
{tag.name==="评阅"?<a style={{color:'#4CACFF'}} href={"/courses/"+courseId+"/graduation_tasks/"+tag.id+"/appraise"} >{tag.name}</a> {tag.name==="评阅"?<a style={{color:'#4CACFF'}} href={"/courses/"+courseId+"/graduation_tasks/"+tag.id+"/appraise"} >{tag.name}</a>
@ -865,6 +870,7 @@ class GraduationTaskssettinglist extends Component{
} }
</Tooltip> </Tooltip>
}
</div> </div>
) )
}):""} }):""}
@ -872,8 +878,10 @@ class GraduationTaskssettinglist extends Component{
this.props.isStudent()? this.props.isStudent()?
operation.map((tag,key) => { operation.map((tag,key) => {
return( return(
<div key={key}> <div key={key}>
{tag.status===0?"--":
<a style={{color:'#4CACFF'}} href={"/courses/"+courseId+"/graduation_tasks/"+tag.id+"/appraise"} >查看</a> <a style={{color:'#4CACFF'}} href={"/courses/"+courseId+"/graduation_tasks/"+tag.id+"/appraise"} >查看</a>
}
</div> </div>
)} )}
):"" ):""
@ -997,16 +1005,18 @@ class GraduationTaskssettinglist extends Component{
<div> <div>
{this.props.isAdmin()?operation.map((tag,key) => { {this.props.isAdmin()?operation.map((tag,key) => {
return( return(
<div key={key}> <div key={key}>
<Tooltip placement="bottom" title={tag.name==="分配"?"指定该作品的交叉评阅人":tag.name==="调分"?<pre>调整学生最终成绩<br/> {tag.status===0?"--":
其它历史评分将全部失效</pre>:""}> <Tooltip placement="bottom" title={tag.name==="分配"?"指定该作品的交叉评阅人":tag.name==="调分"?<pre>调整学生最终成绩<br/>
{tag.name==="评阅"?<a style={{color:'#4CACFF'}} href={"/courses/"+courseId+"/graduation_tasks/"+tag.id+"/appraise"} >{tag.name}</a> 其它历史评分将全部失效</pre>:""}>
: {tag.name==="评阅"?<a style={{color:'#4CACFF'}} href={"/courses/"+courseId+"/graduation_tasks/"+tag.id+"/appraise"} >{tag.name}</a>
<a style={{color:tag.name==="调分"?"#000":'#4CACFF'}} :
onClick={tag.name==="调分"?()=>this.showModulationtype(tag.id):tag.name==="分配"?()=>this.showAllocationModal(tag.id):""} <a style={{color:tag.name==="调分"?"#000":'#4CACFF'}}
>{tag.name}</a> onClick={tag.name==="调分"?()=>this.showModulationtype(tag.id):tag.name==="分配"?()=>this.showAllocationModal(tag.id):""}
} >{tag.name}</a>
</Tooltip> }
</Tooltip>
}
</div> </div>
) )
}):""} }):""}
@ -1015,8 +1025,10 @@ class GraduationTaskssettinglist extends Component{
this.props.isStudent()? this.props.isStudent()?
operation.map((tag,key) => { operation.map((tag,key) => {
return( return(
<div key={key}> <div key={key}>
{tag.status===0?"--":
<a style={{color:'#4CACFF'}} href={"/courses/"+courseId+"/graduation_tasks/"+tag.id+"/appraise"} >查看</a> <a style={{color:'#4CACFF'}} href={"/courses/"+courseId+"/graduation_tasks/"+tag.id+"/appraise"} >查看</a>
}
</div> </div>
)} )}
):"" ):""
@ -1125,7 +1137,8 @@ class GraduationTaskssettinglist extends Component{
<div> <div>
{this.props.isAdmin()?operation.map((tag,key) => { {this.props.isAdmin()?operation.map((tag,key) => {
return( return(
<div key={key}> <div key={key}>
{tag.status===0?"--":
<Tooltip placement="bottom" title={tag.name==="分配"?"指定该作品的交叉评阅人":tag.name==="调分"?<pre>调整学生最终成绩<br/> <Tooltip placement="bottom" title={tag.name==="分配"?"指定该作品的交叉评阅人":tag.name==="调分"?<pre>调整学生最终成绩<br/>
其它历史评分将全部失效</pre>:""}> 其它历史评分将全部失效</pre>:""}>
{tag.name==="评阅"?<a style={{color:'#4CACFF'}} href={"/courses/"+courseId+"/graduation_tasks/"+tag.id+"/appraise"} >{tag.name}</a> {tag.name==="评阅"?<a style={{color:'#4CACFF'}} href={"/courses/"+courseId+"/graduation_tasks/"+tag.id+"/appraise"} >{tag.name}</a>
@ -1135,6 +1148,7 @@ class GraduationTaskssettinglist extends Component{
>{tag.name}</a> >{tag.name}</a>
} }
</Tooltip> </Tooltip>
}
</div> </div>
) )
}):""} }):""}
@ -1143,8 +1157,10 @@ class GraduationTaskssettinglist extends Component{
this.props.isStudent()? this.props.isStudent()?
operation.map((tag,key) => { operation.map((tag,key) => {
return( return(
<div key={key}> <div key={key}>
<a style={{color:'#4CACFF'}} href={"/courses/"+courseId+"/graduation_tasks/"+tag.id+"/appraise"} >查看</a> {tag.status===0?"--":
<a style={{color:'#4CACFF'}} href={"/courses/"+courseId+"/graduation_tasks/"+tag.id+"/appraise"} >查看</a>
}
</div> </div>
)} )}
):"" ):""

@ -1,7 +1,7 @@
import React,{Component} from "React"; import React,{Component} from "React";
import { Form, Select, Input, Button,Checkbox,Upload,Icon,message,Modal, Table, Divider, Tag} from "antd"; import { Form, Select, Input, Button,Checkbox,Upload,Icon,message,Modal, Table, Divider, Tag} from "antd";
import {Link} from 'react-router-dom'; import {Link} from 'react-router-dom';
import { WordsBtn } from 'educoder'; import { WordsBtn,markdownToHTML} from 'educoder';
import axios from 'axios'; import axios from 'axios';
import Modals from '../../../modals/Modals'; import Modals from '../../../modals/Modals';
import HomeworkModal from "../../coursesPublic/HomeworkModal"; import HomeworkModal from "../../coursesPublic/HomeworkModal";
@ -332,7 +332,7 @@ class GraduationTasksquestions extends Component{
width: '100%', width: '100%',
border: '1px solid transparent' border: '1px solid transparent'
}}> }}>
{questionslist.description} <div dangerouslySetInnerHTML={{__html: markdownToHTML(questionslist.description).replace(/▁/g,"▁▁▁")}}></div>
</div>:"" </div>:""
} }

@ -1,104 +1,104 @@
import React, { Component } from 'react'; import React, { Component } from 'react';
import { Redirect } from 'react-router'; import { Redirect } from 'react-router';
import { BrowserRouter as Router, Route, Link, Switch } from "react-router-dom"; import { BrowserRouter as Router, Route, Link, Switch } from "react-router-dom";
import PropTypes from 'prop-types'; import PropTypes from 'prop-types';
import classNames from 'classnames'; import classNames from 'classnames';
import { getImageUrl, toPath } from 'educoder'; import { getImageUrl, toPath } from 'educoder';
import moment from 'moment'; import moment from 'moment';
class PostItem extends Component { class PostItem extends Component {
_toTenThousand(num) { _toTenThousand(num) {
if (num > 10000) { if (num > 10000) {
return ( (num - 500)/ 10000 ).toFixed(1) + '万' return ( (num - 500)/ 10000 ).toFixed(1) + '万'
} }
return num return num
} }
render() { render() {
const { match, history, currentPage, memo, user, setTop, setDown } = this.props const { match, history, currentPage, memo, user, setTop, setDown } = this.props
return ( return (
<div className="forum_table_line pl20"> <div className="forum_table_line pl20">
<div className="forum_table_item" id={`memo_detail_${memo.id}`}> <div className="forum_table_item" id={`memo_detail_${memo.id}`}>
<a href={`/users/${memo.login}`} className="fr mr15"> <a href={`/users/${memo.login}`} className="fr mr15">
<img alt="用户头像" className="bor-radius-all mt3" height="50" src={getImageUrl(`images/`+memo.image_url)} width="50" /> <img alt="用户头像" className="bor-radius-all mt3" height="50" src={getImageUrl(`images/`+memo.image_url)} width="50" />
</a> </a>
<div className="fl pr" style={{flex: 1}}> <div className="fl pr" style={{flex: 1}}>
<p className="font-16 clearfix" > <p className="font-16 clearfix" >
{/* target="_blank" */} {/* target="_blank" */}
<Link to={`/forums/${memo.id}`} target="_blank" title={memo.subject} <a href={`/forums/${memo.id}`} target="_blank" title={memo.subject}
className="clearfix task-hide item_name fl" style={{maxWidth: '750px'}} > className="clearfix task-hide item_name fl" style={{maxWidth: '750px'}} >
{memo.subject} {memo.subject}
</Link> </a>
{ memo.sticky && <span className="btn-top btn-cir-orange mt6 ml5 fl">置顶</span> } { memo.sticky && <span className="btn-top btn-cir-orange mt6 ml5 fl">置顶</span> }
{ memo.reward && { memo.reward &&
<span className=" ml10 fl color-orange03 fl" data-tip-down={`获得平台奖励金币:${memo.reward}`}> <span className=" ml10 fl color-orange03 fl" data-tip-down={`获得平台奖励金币:${memo.reward}`}>
<i className="iconfont icon-gift font-16 mr5 fl"></i><span className="fl mt3 font-14">{memo.reward}</span> <i className="iconfont icon-gift font-16 mr5 fl"></i><span className="fl mt3 font-14">{memo.reward}</span>
</span> </span>
} }
</p> </p>
<div className="clearfix mt5 color-grey-9"> <div className="clearfix mt5 color-grey-9">
<span className="fl">{memo.username}</span> <span className="fl">{memo.username}</span>
{/*todo{memo.username} {/*todo{memo.username}
memo.language && memo.language != 'other' && <span className="fl language-cir-orange mr10 mt3 ml6">{memo.language}</span> memo.language && memo.language != 'other' && <span className="fl language-cir-orange mr10 mt3 ml6">{memo.language}</span>
*/} */}
<span className="fl ml50">{moment(memo.updated_at).fromNow()}</span> <span className="fl ml50">{moment(memo.updated_at).fromNow()}</span>
{memo.tag && memo.tag.length ? <span className="fl ml50">来自 {memo.tag.join('/')}</span> : ''} {memo.tag && memo.tag.length ? <span className="fl ml50">来自 {memo.tag.join('/')}</span> : ''}
{/*<span className="fl language-cir-orange mr10 mt3">C++</span>*/} {/*<span className="fl language-cir-orange mr10 mt3">C++</span>*/}
<p className="font-12 fr mr8 color-grey-6"> <p className="font-12 fr mr8 color-grey-6">
{/* data-tip-down="回复数" <i className="fa fa-comments-o mr5"></i>{memo.replies_count} {/* data-tip-down="回复数" <i className="fa fa-comments-o mr5"></i>{memo.replies_count}
<i className="fa fa-thumbs-o-up mr5"></i>{memo.praise_count}*/} <i className="fa fa-thumbs-o-up mr5"></i>{memo.praise_count}*/}
{memo.replies_count ? {memo.replies_count ?
<span className="mr10 ml10 fl edu-txt-right" style={{cursor: 'default'}} > <span className="mr10 ml10 fl edu-txt-right" style={{cursor: 'default'}} >
{memo.replies_count} 回复 {memo.replies_count} 回复
</span> :''} </span> :''}
{memo.praise_count ? {memo.praise_count ?
<span className="mr10 ml10 fl edu-txt-right" style={{cursor: 'default'}} > <span className="mr10 ml10 fl edu-txt-right" style={{cursor: 'default'}} >
{memo.praise_count} {memo.praise_count}
</span> :''} </span> :''}
{memo.viewed_count ? {memo.viewed_count ?
<span className="mr10 ml10 fl edu-txt-right" style={{cursor: 'default',minWidth:'55px'}}> <span className="mr10 ml10 fl edu-txt-right" style={{cursor: 'default',minWidth:'55px'}}>
{this._toTenThousand(memo.viewed_count)} 浏览 {this._toTenThousand(memo.viewed_count)} 浏览
</span> :''} </span> :''}
</p> </p>
</div> </div>
{ user && (user.admin === true || user.user_id === memo.author_id) && { user && (user.admin === true || user.user_id === memo.author_id) &&
<div className="edu-position-hidebox" style={{position: 'absolute', right: '18px',top:'0px'}}> <div className="edu-position-hidebox" style={{position: 'absolute', right: '18px',top:'0px'}}>
<a href="javascript:void(0);"><i className="fa fa-bars font-16"></i></a> <a href="javascript:void(0);"><i className="fa fa-bars font-16"></i></a>
<ul className="edu-position-hide undis"> <ul className="edu-position-hide undis">
{ user.admin === true && { user.admin === true &&
( memo.sticky === true ? ( memo.sticky === true ?
<li><a href="javascript:void(0);" onClick={() => setDown(memo)}>取消置顶</a></li> <li><a href="javascript:void(0);" onClick={() => setDown(memo)}>取消置顶</a></li>
: :
<li><a href="javascript:void(0);" onClick={() => setTop(memo)}>&nbsp;&nbsp;</a></li> ) <li><a href="javascript:void(0);" onClick={() => setTop(memo)}>&nbsp;&nbsp;</a></li> )
} }
<li><Link to={`/forums/${memo.id}/edit`}>&nbsp;&nbsp;</Link></li> <li><Link to={`/forums/${memo.id}/edit`}>&nbsp;&nbsp;</Link></li>
<li> <li>
<a href="javascript:void(0)" onClick={() => <a href="javascript:void(0)" onClick={() =>
window.delete_confirm_box_2_react(`onMemoDelete`, '您确定要删除吗?' , memo)}> window.delete_confirm_box_2_react(`onMemoDelete`, '您确定要删除吗?' , memo)}>
&nbsp;&nbsp;</a> &nbsp;&nbsp;</a>
</li> </li>
</ul> </ul>
</div> </div>
} }
</div> </div>
</div> </div>
</div> </div>
); );
} }
} }
export default PostItem export default PostItem

Loading…
Cancel
Save