caishi 6 years ago
commit 68b85b7364

@ -1,5 +1,5 @@
import { bytesToSize } from 'educoder'; import { bytesToSize } from 'educoder';
export function markdownToHTML(oldContent) { export function markdownToHTML(oldContent, selector) {
window.$('#md_div').html('') window.$('#md_div').html('')
// markdown to html // markdown to html
var markdwonParser = window.editormd.markdownToHTML("md_div", { var markdwonParser = window.editormd.markdownToHTML("md_div", {
@ -12,6 +12,9 @@ export function markdownToHTML(oldContent) {
sequenceDiagram: true // 默认不解析 sequenceDiagram: true // 默认不解析
}); });
const content = window.$('#md_div').html() const content = window.$('#md_div').html()
if (selector) {
window.$(selector).html(content)
}
return content return content
} }

@ -6,40 +6,23 @@ class MarkdownToHtml extends Component{
this.state={ this.state={
} }
} }
// componentDidUpdate = (prevProps) => { componentDidUpdate = (prevProps) => {
// if (this.props.content) { if (this.props.content) {
// if ( prevProps.content != this.props.content ) { if ( prevProps.content != this.props.content ) {
// if (!this.shixunDescr) { markdownToHTML(this.props.content, `.markdown_to_html_${this.props.selector || ''}`)
// this.shixunDescr = window.editormd.markdownToHTML("memo_content_editorMd", { }
// markdown: this.props.content, }
// htmlDecode: "style,script,iframe", // you can filter tags decode }
// taskList: true, componentDidMount () {
// tex: true, // 默认不解析 this.props.content && markdownToHTML(this.props.content, `.markdown_to_html_${this.props.selector || ''}`)
// flowChart: true, // 默认不解析
// sequenceDiagram: true // 默认不解析 }
// });
// } else {
// this.shixunDescr.html(this.props.content)
// }
// }
// }
// }
// componentDidMount () {
// if (!this.shixunDescr) {
// this.shixunDescr = window.editormd.markdownToHTML("memo_content_editorMd", {
// markdown: this.props.content,
// htmlDecode: "style,script,iframe", // you can filter tags decode
// taskList: true,
// tex: true, // 默认不解析
// flowChart: true, // 默认不解析
// sequenceDiagram: true // 默认不解析
// });
// }
// }
render(){ render(){
return( return(
<div id="memo_content_editorMd" className="new_li markdown-body" dangerouslySetInnerHTML={{__html: markdownToHTML(this.props.content)}}> <div id="memo_content_editorMd" className={`new_li markdown-body ${this.props.className} markdown_to_html_${this.props.selector || ''}`}
// dangerouslySetInnerHTML={{__html: markdownToHTML(this.props.content)}}
>
</div> </div>
) )
} }

@ -236,6 +236,7 @@
/* line-height: 14px; */ /* line-height: 14px; */
width: 100%; width: 100%;
word-wrap: break-word; word-wrap: break-word;
margin-bottom: 4px;
} }
.childComment .break_word_comments{ .childComment .break_word_comments{
line-height: 22px; line-height: 22px;

@ -168,7 +168,7 @@ class Comments extends Component {
} }
</div> </div>
<p className="fr mr10 orig_reply lineh-20"> <p className="fr orig_reply lineh-20">
<span id="hidden_discuss_btn_952"> <span id="hidden_discuss_btn_952">
</span> </span>
@ -225,7 +225,7 @@ class Comments extends Component {
<div className="comment_content clearfix" id={`reply_content_${item.id}`}> <div className="comment_content clearfix" id={`reply_content_${item.id}`}>
<div className="color-grey-3" id={`reply_content_${item.id}`}> <div className="color-grey-3" id={`reply_content_${item.id}`}>
<div className={"break_word_comments"} dangerouslySetInnerHTML={{__html: _content}}></div> <div className={"break_word_comments markdown-body"} dangerouslySetInnerHTML={{__html: _content}}></div>
<div className="cl"></div> <div className="cl"></div>
</div> </div>
</div> </div>
@ -326,7 +326,7 @@ class Comments extends Component {
{ item.hidden && ((this.props.onlySuperAdminCouldHide && !item.isSuperAdmin) { item.hidden && ((this.props.onlySuperAdminCouldHide && !item.isSuperAdmin)
|| !this.props.onlySuperAdminCouldHide && item.admin === false && (item.manager === false || item.manager == undefined)) || !this.props.onlySuperAdminCouldHide && item.admin === false && (item.manager === false || item.manager == undefined))
? <p className="color-orange font-16">违规评论已被屏蔽</p> ? <p className="color-orange font-16">违规评论已被屏蔽</p>
: <div className={"break_word_comments"} dangerouslySetInnerHTML={{__html: _content}}></div> : <div className={"break_word_comments markdown-body"} dangerouslySetInnerHTML={{__html: _content}}></div>
} }
<div className="cl"></div> <div className="cl"></div>
</div> </div>

@ -8,6 +8,7 @@ import {getUrl} from 'educoder';
import moment from 'moment'; import moment from 'moment';
import CoursesListType from '../coursesPublic/CoursesListType'; import CoursesListType from '../coursesPublic/CoursesListType';
import Showoldfiles from "../coursesPublic/Showoldfiles"; import Showoldfiles from "../coursesPublic/Showoldfiles";
import Modals from '../../modals/Modals';
class Fileslistitem extends Component{ class Fileslistitem extends Component{
constructor(props){ constructor(props){
@ -74,6 +75,67 @@ class Fileslistitem extends Component{
Showoldfiles:false, Showoldfiles:false,
}) })
} }
onDelete = (id) => {
this.setState({
Modalstype:true,
Modalstopval:"是否确认删除?",
ModalCancel:this.cancelmodel,
ModalSave:()=>this.savedelete(id),
})
}
cancelmodel=()=>{
this.setState({
Modalstype:false,
Loadtype:false,
Modalstopval:"",
ModalCancel:"",
ModalSave:"",
checkBoxValues:[],
})
}
savedelete=(id)=>{
this.setState({
Modalstype:false,
})
const cid = this.props.match.params.coursesId
const url = `/files/bulk_delete.json`;
axios.delete(url, { data: {
course_id:cid,
ids: [id],
}})
.then((response) => {
if (response.data.status == 0) {
//Modalstopval:response.data.message,
this.props.updatafiledfun()
this.setState({
// Modalstype:true,
// Modalstopval:"删除成功",
ModalsBottomval:"",
// ModalSave:this.cancelmodel,
// Loadtype:true,
checkBoxValues:[],
checkAllValue:false
})
this.props.showNotification("删除成功");
}
})
.catch(function (error) {
console.log(error);
});
}
render(){ render(){
const { checkBox, const { checkBox,
@ -84,6 +146,16 @@ class Fileslistitem extends Component{
return( return(
<div className="graduateTopicList boardsList"> <div className="graduateTopicList boardsList">
{/*提示*/}
{this.state.Modalstype&&this.state.Modalstype===true?<Modals
modalsType={this.state.Modalstype}
modalsTopval={this.state.Modalstopval}
modalCancel={this.state.ModalCancel}
modalSave={this.state.ModalSave}
modalsBottomval={this.state.ModalsBottomval}
loadtype={this.state.Loadtype}
/>:""}
<Showoldfiles <Showoldfiles
visible={this.state.Showoldfiles} visible={this.state.Showoldfiles}
allfiles={this.state.allfiles} allfiles={this.state.allfiles}
@ -176,39 +248,36 @@ 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>
</span>:""}
<div className="cl"></div>
<style> <style>
{ {
` `
.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>
@ -220,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>

@ -106,6 +106,14 @@ class Fileslists extends Component{
}) })
} }
updatafiled=()=>{
debugger
if(this.props.match.params.main_id){
this.seactall();
}else if(this.props.match.params.Id){
this.seactall(parseInt(this.props.match.params.Id),1)
}
}
seactall=(coursesecondcategoryid,type)=>{ seactall=(coursesecondcategoryid,type)=>{
this.setState({ this.setState({
@ -243,8 +251,7 @@ class Fileslists extends Component{
.then((response) => { .then((response) => {
if (response.data.status == 0) { if (response.data.status == 0) {
//Modalstopval:response.data.message, //Modalstopval:response.data.message,
this.updatafiled()
this.seactall();
this.setState({ this.setState({
// Modalstype:true, // Modalstype:true,
// Modalstopval:"删除成功", // Modalstopval:"删除成功",
@ -254,7 +261,6 @@ class Fileslists extends Component{
checkBoxValues:[], checkBoxValues:[],
checkAllValue:false checkAllValue:false
}) })
this.props.updataleftNavfun()
this.props.showNotification("删除成功"); this.props.showNotification("删除成功");
} }
}) })
@ -519,7 +525,7 @@ class Fileslists extends Component{
checkBoxValues:[], checkBoxValues:[],
// checkAllValue:false // checkAllValue:false
}) })
this.props.updataleftNavfun() this.updatafiled()
this.props.showNotification('资源移动成功') this.props.showNotification('资源移动成功')
} }
}) })
@ -649,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}
@ -658,7 +664,7 @@ class Fileslists extends Component{
showSearchInput={true} showSearchInput={true}
></Titlesearchsection> ></Titlesearchsection>
<div className="mt20 edu-back-white padding20-30" style={{display:this.props.isAdmin()||this.props.isStudent()?"":"none"}}> {this.props.isAdmin()? <div className="mt20 edu-back-white padding20-30" style={{display:this.props.isAdmin()||this.props.isStudent()?"":"none"}}>
<div className="clearfix"> <div className="clearfix">
{this.props.isAdmin()? <Checkbox className="fl" onChange={this.onCheckAll} checked={checkAllValue}>已选 {checkBoxValues.length} </Checkbox>:""} {this.props.isAdmin()? <Checkbox className="fl" onChange={this.onCheckAll} checked={checkAllValue}>已选 {checkBoxValues.length} </Checkbox>:""}
<div className="studentList_operation_ul"> <div className="studentList_operation_ul">
@ -736,7 +742,7 @@ class Fileslists extends Component{
</li>:""} </li>:""}
</div> </div>
</div> </div>
</div> </div> :""}
<style>{` <style>{`
.padding02010{ .padding02010{
@ -771,6 +777,7 @@ class Fileslists extends Component{
checkBox={<Checkbox value={item.id}></Checkbox>} checkBox={<Checkbox value={item.id}></Checkbox>}
Settingtypes={(id)=>this.Settingtypes(id)} Settingtypes={(id)=>this.Settingtypes(id)}
coursesId={this.props.match.params.coursesId} coursesId={this.props.match.params.coursesId}
updatafiledfun={()=>this.updatafiled()}
></Fileslistitem> ></Fileslistitem>
</div> </div>
</div> </div>

@ -1,6 +1,7 @@
import React,{ Component } from "react"; import React,{ Component } from "react";
import {Tooltip} from 'antd' import {Tooltip} from 'antd'
import moment from 'moment' import moment from 'moment'
import { getUrl } from 'educoder'
class BoardsListItem extends Component{ class BoardsListItem extends Component{
constructor(props){ constructor(props){
super(props); super(props);
@ -26,6 +27,8 @@ class BoardsListItem extends Component{
if (!discussMessage || !discussMessage.author) { if (!discussMessage || !discussMessage.author) {
return ''; return '';
} }
let canNotLink = !isAdminOrStudent && discussMessage.is_public == false
return( return(
<div className="panel-inner-fourm boardsList"> <div className="panel-inner-fourm boardsList">
<style>{` <style>{`
@ -35,17 +38,18 @@ class BoardsListItem extends Component{
} }
`}</style> `}</style>
{ checkBox } { checkBox }
<a href="/users/innov" alt="用户" style={{"width":"50px","height":"50px","display":"block", margin: "0 10px"}}> <a href={`/users/${discussMessage.author.login}`} alt="用户" style={{"width":"50px","height":"50px","display":"block", margin: "0 10px"}}>
{/* /images/avatars/User/1?1529221779 */} {/* /images/avatars/User/1?1529221779 */}
<img <img
alt="1?1529221779" className="panel-list-img mr15" height="50" alt="1?1529221779" className="panel-list-img mr15" height="50"
src={`/images/${discussMessage.author.image_url}`} width="50" src={`${getUrl()}/images/${discussMessage.author.image_url}`} width="50"
></img> ></img>
</a> </a>
<div className="clearfix ds pr pt5 contentSection" onClick={() => onItemClick(discussMessage)}> <div className="clearfix ds pr pt5 contentSection" onClick={() => onItemClick(discussMessage)}>
<h6> <h6>
<a href="javascript:void(0)" className="panel-list-title hide fl mt5 color-dark font-bd" style={{ fontWeight: 'bold' }} <a href="javascript:void(0)" className="panel-list-title hide fl mt5 color-dark font-bd"
onClick={() => this.onTitleClick(discussMessage)} style={{ fontWeight: 'bold', cursor: (canNotLink ? 'default' : 'poninter') }}
onClick={canNotLink ? () => {} : () => this.onTitleClick(discussMessage)}
>{discussMessage.subject}</a> >{discussMessage.subject}</a>
{ !!discussMessage.sticky && <span className="btn-cir btn-cir-red fl mt5 ml5">置顶</span> } { !!discussMessage.sticky && <span className="btn-cir btn-cir-red fl mt5 ml5">置顶</span> }
{ {
@ -59,7 +63,7 @@ class BoardsListItem extends Component{
<div className="cl"></div> <div className="cl"></div>
<p className="color-grey panel-lightgrey mt10 fl"> <p className="color-grey panel-lightgrey mt10 fl">
<span className="mr50"> <span className="mr50">
<a href="/users/innov" className="panel-name-small hide fl mr15 mr30 color-grey3">{discussMessage.author.name}</a> <a href={`/users/${discussMessage.author.login}`} className="panel-name-small hide fl mr15 mr30 color-grey3">{discussMessage.author.name}</a>
{ discussMessage.total_replies_count != 0 && <span className="mr15 color-grey9">{discussMessage.total_replies_count} 回复</span> } { discussMessage.total_replies_count != 0 && <span className="mr15 color-grey9">{discussMessage.total_replies_count} 回复</span> }
{ discussMessage.total_praises_count != 0 && <span className="mr15 color-grey9">{discussMessage.total_praises_count} 点赞</span> } { discussMessage.total_praises_count != 0 && <span className="mr15 color-grey9">{discussMessage.total_praises_count} 点赞</span> }

@ -24,7 +24,7 @@ import '../../forums/RightSection.css'
import './TopicDetail.css' import './TopicDetail.css'
import '../common/courseMessage.css' import '../common/courseMessage.css'
import { Pagination, Tooltip } from 'antd' import { Pagination, Tooltip } from 'antd'
import { bytesToSize, ConditionToolTip } from 'educoder' import { bytesToSize, ConditionToolTip, markdownToHTML, MarkdownToHtml } from 'educoder'
import SendToCourseModal from '../coursesPublic/modal/SendToCourseModal' import SendToCourseModal from '../coursesPublic/modal/SendToCourseModal'
import CBreadcrumb from '../common/CBreadcrumb' import CBreadcrumb from '../common/CBreadcrumb'
import { generateComments, generateChildComments, _findById, handleContentBeforeCreateNew, addNewComment import { generateComments, generateChildComments, _findById, handleContentBeforeCreateNew, addNewComment
@ -87,15 +87,6 @@ class TopicDetail extends Component {
replies_count: response.data.data.total_replies_count replies_count: response.data.data.total_replies_count
}, {...this.state.memo}) }, {...this.state.memo})
}, () => { }, () => {
setTimeout(()=>{
var shixunDescr = window.editormd.markdownToHTML("memo_content_editorMd", {
htmlDecode: "style,script,iframe", // you can filter tags decode
taskList: true,
tex: true, // 默认不解析
flowChart: true, // 默认不解析
sequenceDiagram: true // 默认不解析
});
}, 200)
}) })
// const { memo_replies, memo } = response.data; // const { memo_replies, memo } = response.data;
@ -181,13 +172,13 @@ class TopicDetail extends Component {
// md渲染content等xhr执行完即memoLoading变化memo.content更新后初始化md // md渲染content等xhr执行完即memoLoading变化memo.content更新后初始化md
setTimeout(()=>{ setTimeout(()=>{
var shixunDescr = window.editormd.markdownToHTML("memo_content_editorMd", { // var shixunDescr = window.editormd.markdownToHTML("memo_content_editorMd", {
htmlDecode: "style,script,iframe", // you can filter tags decode // htmlDecode: "style,script,iframe", // you can filter tags decode
taskList: true, // taskList: true,
tex: true, // 默认不解析 // tex: true, // 默认不解析
flowChart: true, // 默认不解析 // flowChart: true, // 默认不解析
sequenceDiagram: true // 默认不解析 // sequenceDiagram: true // 默认不解析
}); // });
}, 200) }, 200)
} }
@ -629,13 +620,8 @@ class TopicDetail extends Component {
<div className="padding40 memoContent new_li"> <div className="padding40 memoContent new_li">
<div id="memo_content_editorMd" className="new_li"> <MarkdownToHtml content={memo.content}></MarkdownToHtml>
<textarea style={{'display': 'none'}}>
{memo.content}
</textarea>
</div>
</div> </div>
{/* style={{ paddingTop: '0px'}} */}
<div className="padding40 bor-bottom-greyE" > <div className="padding40 bor-bottom-greyE" >
<div className="mt10 mb20"> <div className="mt10 mb20">
{/* ${memo.user_praise ? '' : ''} */} {/* ${memo.user_praise ? '' : ''} */}

@ -104,6 +104,7 @@ class CommonWorkItem extends Component{
let coursesId = this.props.match.params.coursesId; let coursesId = this.props.match.params.coursesId;
const isStudent = this.props.isStudent() const isStudent = this.props.isStudent()
const isAdmin = this.props.isAdmin()
const isAdminOrStudent = this.props.isAdminOrStudent() const isAdminOrStudent = this.props.isAdminOrStudent()
return( return(
<div className="workList"> <div className="workList">
@ -128,19 +129,20 @@ class CommonWorkItem extends Component{
</style> </style>
{ {
mainList && mainList.homeworks.length>0 && mainList.homeworks.map((item,index)=>{ mainList && mainList.homeworks.length>0 && mainList.homeworks.map((item,index)=>{
let canNotLink = !isAdminOrStudent && item.private_icon == true
return( return(
<div className="mt20 edu-back-white padding02010" key={index} > <div className="mt20 edu-back-white padding02010" key={index} >
<div className="clearfix"> <div className="clearfix">
<div className="workList_Item"> <div className="workList_Item">
{ {
mainList && mainList.course_identity < 5 && mainList && isAdmin &&
<span className="fl mr12"><Checkbox value={item.homework_id}></Checkbox></span> <span className="fl mr12"><Checkbox value={item.homework_id}></Checkbox></span>
} }
<div className="flex1" onClick={() => this.props.onItemClick(Object.assign({}, item, {id: item.homework_id})) }> <div className="flex1" onClick={() => this.props.onItemClick(Object.assign({}, item, {id: item.homework_id})) }>
<p className="clearfix mb20"> <p className="clearfix mb20">
<a title={item.name} <a title={item.name}
className="fl font-16 font-bd mt2 comnonwidth580" className="fl font-16 font-bd mt2 comnonwidth580" style={{cursor: canNotLink ? 'normal' : 'poninter'}}
onClick={() => this.onItemClick(item)} onClick={canNotLink ? () => {} : () => this.onItemClick(item)}
>{item.name}</a> >{item.name}</a>
{/* 只有非课堂成员且作业是私有的情况下才会为true */} {/* 只有非课堂成员且作业是私有的情况下才会为true */}
@ -155,7 +157,7 @@ class CommonWorkItem extends Component{
<CoursesListType typelist={item.status} /> <CoursesListType typelist={item.status} />
</span> </span>
{ {
mainList && mainList.course_identity < 5 && mainList && isAdmin &&
<li className="fr drop_down"> <li className="fr drop_down">
<i className="iconfont icon-caidan font-16 color-grey-c"></i> <i className="iconfont icon-caidan font-16 color-grey-c"></i>
<ul className="drop_down_normal" style={{ textAlign: 'center'}}> <ul className="drop_down_normal" style={{ textAlign: 'center'}}>

@ -17,7 +17,7 @@
} }
/* 子回复按钮 */ /* 子回复按钮 */
.course-message .reply_to_message a.commentsbtn.task-btn-blue { .course-message .reply_to_message a.commentsbtn.task-btn-blue {
margin-right: 50px; /* margin-right: 50px; */
} }
/* 改边距 */ /* 改边距 */
/* .course-message .commentsDelegateParent { /* .course-message .commentsDelegateParent {

@ -62,7 +62,7 @@ class Titlesearchsection extends Component{
<p className="clearfix padding30 bor-bottom-greyE"> <p className="clearfix padding30 bor-bottom-greyE">
<p style={{height: '20px'}}> <p style={{height: '20px'}}>
<span className="font-18 fl color-dark-21">{title}</span> <span className="font-18 fl color-dark-21">{title}</span>
<li className="fr"> <li className="fr font-16">
{ firstRowRight } { firstRowRight }
</li> </li>
</p> </p>

@ -40,7 +40,7 @@ class coursesHomeCard extends Component{
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>
@ -118,7 +118,7 @@ class coursesHomeCard extends Component{
</div> </div>
</div> </div>
</Link> </a>
</div> </div>
) )
}) })

@ -196,6 +196,7 @@ class Selectresource extends Component{
} }
savecouseShixunModal=()=>{ savecouseShixunModal=()=>{
let {patheditarry}=this.state; let {patheditarry}=this.state;
let {coursesId,attachmentId}=this.props; let {coursesId,attachmentId}=this.props;
let url="/files/import.json"; let url="/files/import.json";

@ -181,6 +181,7 @@ class Selectsetting extends Component{
} }
savecouseShixunModal=()=>{ savecouseShixunModal=()=>{
debugger
let {fileList,is_public,unified_setting,description,datatime,course_groups}=this.state; let {fileList,is_public,unified_setting,description,datatime,course_groups}=this.state;
let newfileList=[]; let newfileList=[];
@ -188,7 +189,7 @@ class Selectsetting extends Component{
newfileList.push(list.response.id) newfileList.push(list.response.id)
} }
if(description===undefined){ if(description===undefined||description===null){
}else if(description.length>100){ }else if(description.length>100){
this.setState({ this.setState({
@ -512,7 +513,7 @@ class Selectsetting extends Component{
.popups{ .popups{
padding-left: 20px; padding-left: 20px;
padding-right: 20px; padding-right: 20px;
padding-top: 30px; padding-top: 20px;
} }
`}</style> `}</style>
<div className="popups"> <div className="popups">
@ -696,7 +697,7 @@ class Selectsetting extends Component{
id={"startimes"} id={"startimes"}
className={"Selectleft20"} className={"Selectleft20"}
width={"200px"} width={"200px"}
value={item.publish_time===undefined||item.publish_time===""?"":moment(item.publish_time, dateFormat)} value={item.publish_time===undefined||item.publish_time===""?"":item.publish_time===null?"":moment(item.publish_time, dateFormat)}
onChange={(e,index)=>this.onChangeTimepublishs(e,index,key)} onChange={(e,index)=>this.onChangeTimepublishs(e,index,key)}
// onChange={ this.onChangeTimepublish } // onChange={ this.onChangeTimepublish }
disabledTime={disabledDateTime} disabledTime={disabledDateTime}
@ -739,7 +740,7 @@ class Selectsetting extends Component{
{/*{this.state.course_group_idtypes===true?<p className={"color-red"}>请选择分班</p>:""}*/} {/*{this.state.course_group_idtypes===true?<p className={"color-red"}>请选择分班</p>:""}*/}
{/*{course_group_publish_timestype===true?<p className={"color-red mt10"}>请填写完整</p>:""}*/} {/*{course_group_publish_timestype===true?<p className={"color-red mt10"}>请填写完整</p>:""}*/}
<textarea placeholder="请在此输入补交附件的原因最大限制100个字符" className={"mt10"} value={description} onInput={this.settextarea} style={{ <textarea placeholder="请输入资源描述最大限制100个字符" className={"mt10"} value={description} onInput={this.settextarea} style={{
width: '100%', width: '100%',
height:'120px', height:'120px',
border:'1px solid rgba(234,234,234,1)', border:'1px solid rgba(234,234,234,1)',

@ -566,7 +566,7 @@ class Sendresource extends Component{
border:'1px solid rgba(234,234,234,1)', border:'1px solid rgba(234,234,234,1)',
padding: '10px' padding: '10px'
}}></textarea> }}></textarea>
{descriptiontype===true?<p className={"color-red"}>描述不能超过最大限制100个字符</p>:""} {descriptiontype===true?<p className={"color-red"}>请输入资源描述最大限制100个字符</p>:""}
<div className="clearfix mt30 edu-txt-center mb10"> <div className="clearfix mt30 edu-txt-center mb10">
<a className="task-btn color-white mr70" onClick={this.props.Cancel}>{this.props.Cancelname}</a> <a className="task-btn color-white mr70" onClick={this.props.Cancel}>{this.props.Cancelname}</a>
<a className="task-btn task-btn-orange" onClick={()=>this.Saves()}>{this.props.Savesname}</a> <a className="task-btn task-btn-orange" onClick={()=>this.Saves()}>{this.props.Savesname}</a>

@ -85,11 +85,14 @@ class ExerciseListItem extends Component{
text-overflow: ellipsis; text-overflow: ellipsis;
white-space: nowrap; white-space: nowrap;
} }
.homepagePostSetting {
position: absolute;
}
` `
} }
</style> </style>
<div className="flex1 pr"> <div className="flex1 pr">
<p className="clearfix mb30"> <p className="clearfix mb20">
{/*<Link to={`/courses/${coursesId}/exercises/${item.id}/exercises/student_exercise_list?tab=0`} className="fl font-16 font-bd mt2 color-grey-3 task-hide" style={{"maxWidth":"600px"}}>{item.exercise_name}</Link>*/} {/*<Link to={`/courses/${coursesId}/exercises/${item.id}/exercises/student_exercise_list?tab=0`} className="fl font-16 font-bd mt2 color-grey-3 task-hide" style={{"maxWidth":"600px"}}>{item.exercise_name}</Link>*/}
{ {
@ -161,23 +164,32 @@ class ExerciseListItem extends Component{
{/*item.exercise_status ==2?"":*/} {/*item.exercise_status ==2?"":*/}
{/*<span className="mr20 fl"> 发布于{moment(item.exercise_left_time).fromNow()} </span>*/} {/*<span className="mr20 fl"> 发布于{moment(item.exercise_left_time).fromNow()} </span>*/}
{/*}*/} {/*}*/}
{ IsAdmin &&<div className="homepagePostSetting" style={{"right":"-17px","top":"51px","display":"block","width":"100px"}}>
<a className="btn colorblue font-16" href={`/courses/${coursesId}/exercises/${item.id}/edit`} target={"_blank"}>编辑</a>
<a className="btn colorblue ml20 font-16" href={`/courses/${coursesId}/exercises/${item.id}/student_exercise_list?tab=3`}>设置</a>
</div> }
</p> </p>
{ {/*{*/}
IsAdmin && {/*IsAdmin &&*/}
<div className="homepagePostSetting" style={{"right":"0px","top":"-5px","position":"absolute","display":"block"}}> {/*<div className="homepagePostSetting" style={{"right":"0px","top":"-5px","position":"absolute","display":"block"}}>*/}
<ul> {/*<ul>*/}
<li className="edu-position edu-position-hidebox"> {/*<li className="edu-position edu-position-hidebox">*/}
<i className="fa fa-bars color-grey-b"></i> {/*<i className="fa fa-bars color-grey-b"></i>*/}
<ul className="edu-position-hide undis"> {/*<ul className="edu-position-hide undis">*/}
<li> <Link className="" to={`/courses/${coursesId}/exercises/${item.id}/edit`}>编辑</Link></li> {/*<li> <Link className="" to={`/courses/${coursesId}/exercises/${item.id}/edit`}>编辑</Link></li>*/}
<li> <a className="" href={` {/*<li> <a className="" href={`*/}
/courses/${coursesId}/exercises/${item.id}/student_exercise_list?tab=3` {/*/courses/${coursesId}/exercises/${item.id}/student_exercise_list?tab=3`*/}
}>设置</a></li> {/*}>设置</a></li>*/}
</ul> {/*</ul>*/}
</li> {/*</li>*/}
</ul> {/*</ul>*/}
</div> {/*</div>*/}
} {/*}*/}
{ {
IsStudent && IsStudent &&
<div className="homepagePostSetting" style={{"right":"0px","top":"62px","position":"absolute","display":"block"}}> <div className="homepagePostSetting" style={{"right":"0px","top":"62px","position":"absolute","display":"block"}}>

@ -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>:""
} }
@ -234,12 +237,20 @@ class GraduateTaskItem extends Component{
</span> </span>
</p> </p>
<style>
{
`
.mrf4{
margin-right: -4px;
}
`
}
</style>
{this.props.isAdmin? {this.props.isAdmin?
<div className="mt13"> <div className="mt13">
<WordsBtn style="blue" to={"/courses/"+coursesId+"/graduation_tasks/"+taskid+"/edit"} className="colorblue font-16 mr20 fr"> <WordsBtn style="blue" to={"/courses/"+coursesId+"/graduation_tasks/"+taskid+"/edit"} className="colorblue font-16 mrf4 fr">
<a className="btn colorblue">编辑</a> <a className="btn colorblue">编辑</a>
</WordsBtn> </WordsBtn>
<WordsBtn style="blue" to={"/courses/"+coursesId+"/graduation_tasks/"+categoryid+"/"+taskid+"/setting"} className="colorblue font-16 mr20 fr"> <WordsBtn style="blue" to={"/courses/"+coursesId+"/graduation_tasks/"+categoryid+"/"+taskid+"/setting"} className="colorblue font-16 mr20 fr">

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

@ -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 moment from 'moment'; import moment from 'moment';
import Modals from '../../../modals/Modals'; import Modals from '../../../modals/Modals';
@ -205,7 +205,7 @@ class GraduationTasksappraise extends Component{
</div> </div>
<div className={"ml20"}> <div className={"ml20"}>
{datalist&&datalist.description} <div dangerouslySetInnerHTML={{__html: markdownToHTML(datalist&&datalist.description===null?"--":datalist&&datalist.description).replace(/▁/g,"▁▁▁")}}></div>
</div> </div>
{/*<div className={"color-grey-6 h20 ml20"}>*/} {/*<div className={"color-grey-6 h20 ml20"}>*/}
@ -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)=>{

@ -83,7 +83,7 @@ class GraduationTasksappraiseReplyChild extends Component{
</div> */} </div> */}
{this.props.ultimate===true?"": isAdmin && <GraduationTasksappraiseMainEditor {...this.props} {this.props.ultimate===true?"": isAdmin && <GraduationTasksappraiseMainEditor {...this.props}
addSuccess={this.props.addSuccess()} addSuccess={() => this.props.addSuccess()}
></GraduationTasksappraiseMainEditor> } ></GraduationTasksappraiseMainEditor> }
<style>{` <style>{`

@ -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}],
@ -125,7 +125,7 @@ class GraduationTasksedit extends Component{
GraduationTasksedittype=false; GraduationTasksedittype=false;
// window.location.href="/courses/"+course_id+"/graduation/"+graduationId+"/graduation_tasks/"+category_id+"/questions"; // window.location.href="/courses/"+course_id+"/graduation/"+graduationId+"/graduation_tasks/"+category_id+"/questions";
// this.goback() // this.goback()
this.props.history.push("/courses/"+this.props.match.params.coursesId+"/graduation_tasks/"+graduation_id+"/"+this.props.match.params.category_id +"/setting"); window.location.href="/courses/"+this.props.match.params.coursesId+"/graduation_tasks/"+graduation_id+"/"+this.props.match.params.category_id +"/setting";
} }
}).catch((error) => { }).catch((error) => {
console.log(error) console.log(error)
@ -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:result.data.publish_time===null?"":moment(moment(handleDateString(result.data.publish_time))).format("YYYY-MM-DD HH:mm"),
end_time: result.data.end_time, end_time:result.data.end_time===null?"":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:result.data.late_time===null?"":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:result.data.comment_time===null?"":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,
@ -480,7 +483,7 @@ class GraduationTaskssettingapp extends Component{
saveTaskssetting=()=>{ saveTaskssetting=()=>{
let {latepenalty,hascommit,minnums,max_nums,publish_time,end_time,crosscomment,latetime}=this.state; let {latepenalty,hascommit,minnums,max_nums,publish_time,end_time,crosscomment,latetime,starttimetype}=this.state;
if(latepenalty===undefined){ if(latepenalty===undefined){
this.setState({ this.setState({
latepenaltytype:true, latepenaltytype:true,
@ -500,19 +503,19 @@ class GraduationTaskssettingapp extends Component{
} }
if(starttimetype===false) {
if(moment(publish_time) <= moment()){ if (moment(publish_time) <= moment()) {
this.setState({ this.setState({
publishTimetypes:true, publishTimetypes: true,
publishTimetypesval:"发布时间不能早于当前时间", publishTimetypesval: "发布时间不能早于当前时间",
}) })
return return
}else{ } else {
this.setState({ this.setState({
publishTimetypes:false publishTimetypes: false
}) })
} }
}
if(moment(end_time)<moment(publish_time)){ if(moment(end_time)<moment(publish_time)){
@ -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,
@ -583,7 +588,7 @@ class GraduationTaskssettingapp extends Component{
} }
if(starttimetype===false){
if(publish_time===null||publish_time=== ""){ if(publish_time===null||publish_time=== ""){
this.setState({ this.setState({
publishTimetypes:true, publishTimetypes:true,
@ -592,6 +597,8 @@ class GraduationTaskssettingapp extends Component{
this.scrollToAnchor("publishtimestart"); this.scrollToAnchor("publishtimestart");
return return
} }
}
@ -714,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,
@ -869,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: "课堂已结束不能再修改!",
@ -884,9 +892,7 @@ class GraduationTaskssettingapp extends Component{
flagPageEdit: true, flagPageEdit: true,
}) })
} }
} catch (e) {
}
} }
@ -1023,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>
@ -1111,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>
@ -1148,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>
@ -1164,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}],
}) })
} }
} }
@ -727,11 +729,13 @@ class GraduationTaskssettinglist extends Component{
<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==="评阅"?tag.status===0?"--":<a style={{color:'#4CACFF'}} href={"/courses/"+courseId+"/graduation_tasks/"+tag.id+"/appraise"} >
tag.name
</a>
: :
<a style={{color:tag.name==="调分"?"#000":'#4CACFF'}} <a style={{color:tag.name==="调分"?"#000":'#4CACFF'}}
onClick={tag.name==="调分"?()=>this.showModulationtype(tag.id):tag.name==="分配"?()=>this.showAllocationModal(tag.id):""} onClick={tag.name==="调分"?()=>this.showModulationtype(tag.id):tag.name==="分配"?()=>this.showAllocationModal(tag.id):""}
>{tag.name}</a> >{tag.status===0?"":tag.name}</a>
} }
</Tooltip> </Tooltip>
@ -743,7 +747,7 @@ class GraduationTaskssettinglist extends Component{
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>
)} )}
):"" ):""
@ -854,17 +858,21 @@ class GraduationTaskssettinglist extends Component{
{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/> <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==="评阅"?tag.status===0?"--":<a style={{color:'#4CACFF'}} href={"/courses/"+courseId+"/graduation_tasks/"+tag.id+"/appraise"} >
tag.name
</a>
: :
<a style={{color:tag.name==="调分"?"#000":'#4CACFF'}} <a style={{color:tag.name==="调分"?"#000":'#4CACFF'}}
onClick={tag.name==="调分"?()=>this.showModulationtype(tag.id):tag.name==="分配"?()=>this.showAllocationModal(tag.id):""} onClick={tag.name==="调分"?()=>this.showModulationtype(tag.id):tag.name==="分配"?()=>this.showAllocationModal(tag.id):""}
>{tag.name}</a> >{tag.status===0?"":tag.name}</a>
} }
</Tooltip> </Tooltip>
</div> </div>
) )
}):""} }):""}
@ -873,7 +881,9 @@ class GraduationTaskssettinglist extends Component{
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>
)} )}
):"" ):""
@ -998,15 +1008,18 @@ class GraduationTaskssettinglist extends Component{
{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/> <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==="评阅"?tag.status===0?"--":<a style={{color:'#4CACFF'}} href={"/courses/"+courseId+"/graduation_tasks/"+tag.id+"/appraise"} >
tag.name</a>
: :
<a style={{color:tag.name==="调分"?"#000":'#4CACFF'}} <a style={{color:tag.name==="调分"?"#000":'#4CACFF'}}
onClick={tag.name==="调分"?()=>this.showModulationtype(tag.id):tag.name==="分配"?()=>this.showAllocationModal(tag.id):""} onClick={tag.name==="调分"?()=>this.showModulationtype(tag.id):tag.name==="分配"?()=>this.showAllocationModal(tag.id):""}
>{tag.name}</a> >{tag.status===0?"":tag.name}</a>
} }
</Tooltip> </Tooltip>
}
</div> </div>
) )
}):""} }):""}
@ -1016,7 +1029,9 @@ class GraduationTaskssettinglist extends Component{
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>
)} )}
):"" ):""
@ -1126,15 +1141,19 @@ class GraduationTaskssettinglist extends Component{
{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/> <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==="评阅"?tag.status===0?"--":<a style={{color:'#4CACFF'}} href={"/courses/"+courseId+"/graduation_tasks/"+tag.id+"/appraise"} >
tag.name
</a>
: :
<a style={{color:tag.name==="调分"?"#000":'#4CACFF'}} <a style={{color:tag.name==="调分"?"#000":'#4CACFF'}}
onClick={tag.name==="调分"?()=>this.showModulationtype(tag.id):tag.name==="分配"?()=>this.showAllocationModal(tag.id):""} onClick={tag.name==="调分"?()=>this.showModulationtype(tag.id):tag.name==="分配"?()=>this.showAllocationModal(tag.id):""}
>{tag.name}</a> >{tag.status===0?"":tag.name}</a>
} }
</Tooltip> </Tooltip>
}
</div> </div>
) )
}):""} }):""}
@ -1144,7 +1163,8 @@ class GraduationTaskssettinglist extends Component{
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>:""
} }

@ -158,16 +158,18 @@ class MemoDetailMDEditor extends Component {
</a> </a>
</div> </div>
<style> <style>
{/*
先注释了影响到了md的拖拽
{ {
` `
.commentInputs{ .commentInputs{
height: 250px; height: 250px;
} }
` `
} } */}
</style> </style>
<div nhname={`new_message_${memo.id}`} className="commentInput commentInputs" <div nhname={`new_message_${memo.id}`} className="commentInput commentInputs"
style={{ padding: '30px',boxSizing:"border-box", display: isInited ? '' : 'none' }} > style={{ padding: '30px',boxSizing:"border-box", display: isInited ? '' : 'none', paddingBottom: '40px' }} >
<div id="memo_comment_editorMd" className="editorMD" style={{ marginBottom: '0px' <div id="memo_comment_editorMd" className="editorMD" style={{ marginBottom: '0px'
, border: errorMsg ? '1px solid red' : '1px solid #ddd'}}> , border: errorMsg ? '1px solid red' : '1px solid #ddd'}}>
<textarea style={{'display': 'none'}}> <textarea style={{'display': 'none'}}>
@ -178,7 +180,7 @@ class MemoDetailMDEditor extends Component {
marginLeft: '4px'}}>{errorMsg}</span> } marginLeft: '4px'}}>{errorMsg}</span> }
<a id={`new_message_submit_btn_${memo.id}`} href="javascript:void(0)" <a id={`new_message_submit_btn_${memo.id}`} href="javascript:void(0)"
onClick={this.onCommit} className="commentsbtn task-btn task-btn-blue fr"> onClick={this.onCommit} className="commentsbtn task-btn task-btn-blue fr">
发送 {this.props.buttonText || '发送'}
</a> </a>
</div> </div>
</React.Fragment> </React.Fragment>

@ -31,10 +31,10 @@ class PostItem extends Component {
<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> }

@ -8,7 +8,7 @@ import PropTypes from 'prop-types';
import classNames from 'classnames'; import classNames from 'classnames';
import { getImageUrl } from 'educoder' import { getImageUrl ,markdownToHTML} from 'educoder'
import { CircularProgress } from 'material-ui/Progress'; import { CircularProgress } from 'material-ui/Progress';
@ -250,9 +250,7 @@ class Challenges extends Component {
id="challenge_editorMd_description"> id="challenge_editorMd_description">
<p id="ReactMarkdown" style={{overflow:'hidden'}}> <p id="ReactMarkdown" style={{overflow:'hidden'}}>
{ChallengesDataList === undefined ? "" :ChallengesDataList.description===null?"": {ChallengesDataList === undefined ? "" :ChallengesDataList.description===null?"":
<textarea> <div dangerouslySetInnerHTML={{__html: markdownToHTML(ChallengesDataList.description).replace(/▁/g,"▁▁▁")}}></div>
{ChallengesDataList.description}
</textarea>
} }
</p> </p>

@ -88,7 +88,7 @@ class ShixunDiscuss extends Component {
<a href={i.user.user_url} className="content-username hide fl">{i.user.name}</a> <a href={i.user.user_url} className="content-username hide fl">{i.user.name}</a>
<span className="t_area fl">{i.time}</span> <span className="t_area fl">{i.time}</span>
</div> </div>
<p className="fr mr10 orig_reply lineh-20"> <p className="fr orig_reply lineh-20">
<span id="hidden_discuss_btn_952"></span> <span id="hidden_discuss_btn_952"></span>
<a className="color-grey-8"> <a className="color-grey-8">
<i className="iconfont icon-jiangli fl mt2"></i> <i className="iconfont icon-jiangli fl mt2"></i>

Loading…
Cancel
Save