Merge remote-tracking branch 'origin/master'

dev_forum
杨树明 6 years ago
commit 255b897a2b

@ -1,7 +1,7 @@
import React,{ Component } from "react";
import {Tooltip} from 'antd'
import moment from 'moment'
import { getUrl } from 'educoder'
import { getUrl, WordsBtn } from 'educoder'
class BoardsListItem extends Component{
constructor(props){
super(props);
@ -61,34 +61,37 @@ class BoardsListItem extends Component{
</h6>
<div className="cl"></div>
<p className="color-grey panel-lightgrey mt10 fl">
<p className="color-grey panel-lightgrey mt18 fl">
<span className="mr50">
<a href={`/users/${discussMessage.author.login}`} className="panel-name-small hide fl mr15 mr30 color-grey3">{discussMessage.author.name}</a>
<a href={`/users/${discussMessage.author.login}`} className="panel-name-small hide fl mr15 mr30 color-grey3 font-14">{discussMessage.author.name}</a>
{ discussMessage.total_replies_count != 0 && <span className="mr15 color-grey9">{discussMessage.total_replies_count} 回复</span> }
{ discussMessage.total_praises_count != 0 && <span className="mr15 color-grey9">{discussMessage.total_praises_count} 点赞</span> }
{ discussMessage.visits != 0 && <span className="mr15 color-grey9">{discussMessage.visits} 浏览</span> }
{ discussMessage.total_replies_count != 0 && <span className="mr15 color-grey9 font-14">{discussMessage.total_replies_count} 回复</span> }
{ discussMessage.total_praises_count != 0 && <span className="mr15 color-grey9 font-14">{discussMessage.total_praises_count} 点赞</span> }
{ discussMessage.visits != 0 && <span className="mr15 color-grey9 font-14">{discussMessage.visits} 浏览</span> }
<span className="mr15 color-light-grey-C">{moment(discussMessage.created_on).fromNow()} </span>
<span className="mr15 color-light-grey-C font-14">{moment(discussMessage.created_on).fromNow()} </span>
</span>
{/* <span className="mr10">最后回复<span className="ml10 mr10">社区导师</span>10个月前</span> */}
</p>
<div className="fr mt15">
{(isAdmin || discussMessage.author.login == current_user.login) &&
<WordsBtn style="blue" className="fl font-16 ml28"
onClick={(e) => { this.props.toEditPage(this.props.match.params.coursesId, this.props.match.params.boardId, discussMessage.id )} }>编辑</WordsBtn> }
{ isAdmin && <WordsBtn style="blue" className="fl font-16 ml28"
onClick={(e) => { debugger; onSticky(discussMessage); e.cancelBubble = true; e.stopPropagation();}}>
{ discussMessage.sticky ? '取消置顶' : '置顶' }</WordsBtn> }
</div>
{/* <span className="mr10"><i className="fa fa-eye color-grey mr5 "></i>473</span> */}
{/* <p className="fr panel-lightgrey mt10">
<span className="mr10"><i className="fa fa-eye color-grey mr5" data-tip-down="浏览数"></i>82</span>
<span className="mr10"><i className="fa fa-thumbs-up color-grey mr5" data-tip-down="点赞数"></i>1</span>
<span className="mr10"><i className="fa fa-comments-o color-grey mr5" data-tip-down="回复数"></i>4</span>
</p> */}
{ (isAdmin || discussMessage.author.login == current_user.login) &&
{/* { (isAdmin || discussMessage.author.login == current_user.login) &&
<div className="homepagePostSetting" style={{"right":"4px","top":"5px","display":"block"}}>
<ul>
<li className="edu-position edu-position-hidebox">
<i className="fa fa-bars color-grey-b"></i>
<ul className="edu-position-hide undis">
{/* <li><a href="javascript:void(0)" onclick="show_send(34255, 1, 'message');">发送</a></li> */}
{(isAdmin || discussMessage.author.login == current_user.login) && <li><a href="javascript:void(0)" onClick={(e) => {
this.props.toEditPage(this.props.match.params.coursesId, this.props.match.params.boardId, discussMessage.id )} } >编辑</a></li>
}
@ -96,14 +99,13 @@ class BoardsListItem extends Component{
{ discussMessage.sticky ? '取消置顶' : '置顶' }
</a></li>
}
{/* <li>
<a href="javascript:void(0);" onclick="delete_confirm_box_3('/boards/5464/topics/34255/destroy', '确定要删除该帖子吗?')">删除</a>
</li> */}
</ul>
</li>
</ul>
</div>
}
} */}
</div>
</div>
)

@ -280,7 +280,7 @@ class BoardsNew extends Component{
{ name: this.isEdit ? '帖子编辑' : '帖子新建'}
]}></CBreadcrumb>
<p className="clearfix mt30 mb30">
<p className="clearfix mt20 mb20">
<span className="fl font-24 color-grey-3">{this.isEdit ? "编辑" : "新建"}帖子</span>
<a href="javascript:void(0)" className="color-grey-6 fr font-16 mr2"
onClick={() => this.props.history.goBack()}>

@ -227,15 +227,30 @@ class TopicDetail extends Component {
// filesize = bytesToSize(item.filesize)
}
attachments.push(
<p className="clearfix" key={index} >
<a href={item.url} className="color-green clearfix notefileDownload">
<i className="iconfont icon-xiazai color-green ml5 fl"></i>
// <p className="clearfix" key={index} >
// <a href={item.url} className="color-green clearfix notefileDownload">
// <i className="iconfont icon-fujian color-green ml5 fl"></i>
// {fileName && <ConditionToolTip title={fileName} condition={fileName.length > 30 }>
// <span className="fl task-hide upload_item" style={{ color: '#333'}}>{fileName}</span>
// </ConditionToolTip>}
// <span className="fl" style={{ color: '#999', marginLeft: '6px'}}>{filesize? ` ${filesize.replace(' ', '')}` : ''}</span>
// </a>
// </p>
<div className="color-grey" key={index}>
<a className="color-grey ml20">
<i className="font-14 color-green iconfont icon-fujian mr8" aria-hidden="true"></i>
</a>
{fileName && <ConditionToolTip title={fileName} condition={fileName.length > 30 }>
<span className="fl task-hide upload_item" style={{ color: '#333'}}>{fileName}</span>
</ConditionToolTip>}
<span className="fl" style={{ color: '#999', marginLeft: '6px'}}>{filesize? ` ${filesize.replace(' ', '')}` : ''}</span>
<a href={item.url}
className="mr12 color9B9B" length="58">
{fileName}
</a>
</p>
</ConditionToolTip>}
<span className="color656565 mt2 color-grey-6 font-12 mr8">{item.filesize}</span>
</div>
)
})
return attachments;
@ -542,7 +557,7 @@ class TopicDetail extends Component {
</span> }
{/* || current_user.user_id === author_info.user_id */}
{ current_user && (isAdmin || isCurrentUserTheAuthor) &&
<div className="edu-position-hidebox" style={{position: 'absolute', right: '18px',top:'4px'}}>
<div className="edu-position-hidebox" style={{position: 'absolute', right: '2px',top:'4px'}}>
<a href="javascript:void(0);"><i className="fa fa-bars font-16"></i></a>
<ul className="edu-position-hide undis">
@ -619,10 +634,10 @@ class TopicDetail extends Component {
</div>
<div className="padding40 memoContent new_li">
<div className="padding30 memoContent new_li" style={{ paddingBottom: '10px'}}>
<MarkdownToHtml content={memo.content}></MarkdownToHtml>
</div>
<div className="padding40 bor-bottom-greyE" >
<div className="padding40 bor-bottom-greyE" style={{paddingTop: '2px'}}>
<div className="mt10 mb20">
{/* ${memo.user_praise ? '' : ''} */}
<Tooltip title={`${memo.liked ? '取消点赞' : '点赞'}`}>

@ -156,7 +156,7 @@ class CommonWorkItem extends Component{
<span className="fl">
<CoursesListType typelist={item.status} />
</span>
{
{/* {
mainList && isAdmin &&
<li className="fr drop_down">
<i className="iconfont icon-caidan font-16 color-grey-c"></i>
@ -170,7 +170,7 @@ class CommonWorkItem extends Component{
</li>
</ul>
</li>
}
} */}
</p>
<p className="color-grey-9 clearfix">
{item.commit_count===undefined?"":<span className="mr20 fl">{item.commit_count} 已交</span>}
@ -184,6 +184,12 @@ class CommonWorkItem extends Component{
<span className="mr20 fl">{item.status_time}</span>
</Tooltip>
}
{this.props.isAdmin && <div className="fr">
<WordsBtn style="blue" className="fl font-16 ml28" onClick={ () => { this.props.toEditPage(this.props.match.params, item.homework_id) }}>编辑</WordsBtn>
<WordsBtn style="blue" className="fl font-16 ml28" onClick={ () => { this.props.toWorkSettingPage(this.props.match.params, item.homework_id) }}>设置</WordsBtn>
</div>}
{
//
isStudent &&

@ -70,10 +70,10 @@ function buildColumns(that, student_works) {
overflow: 'hidden',
textOverflow: 'ellipsis',
whiteSpace: 'nowrap'
}}>
<Tooltip placement="bottom" title={text}>
}} title={text}>
{/* <Tooltip placement="bottom" title={text}>
</Tooltip> */}
{text}
</Tooltip>
</div>
),
}, {

@ -36,6 +36,10 @@ const CommonWorkAnswer = Loadable({
loader: () => import('./CommonWorkAnswer'),
loading:Loading,
})
const CommonWorkAppraise = Loadable({
loader: () => import('./CommonWorkAppraise'),
loading:Loading,
})
const CommonWork = Loadable({
@ -87,6 +91,12 @@ class CoursesWorkIndex extends Component{
(props) => (<CommonWorkDetailIndex {...this.props} {...props} {...this.state} />)
}
></Route>
{/* 评阅 */}
<Route exact path="/courses/:coursesId/group_homeworks/:workId/:studentWorkId/appraise"
render={
(props) => (<CommonWorkAppraise {...this.props} {...props} {...this.state} />)
}
></Route>
<Route exact path="/courses/:coursesId/group_homeworks/:workId/post"

@ -373,7 +373,7 @@ class NewWork extends Component{
{ name: `${ this.isEdit ? '编辑' : '新建'}` }
]}></CBreadcrumb>
<p className="clearfix mt30 mb30">
<p className="clearfix mt20 mb20">
<span className="fl font-24 color-grey-3">{this.isEdit ?"编辑":"新建"}{ moduleName }</span>
{/* history.goBack()
this.props.toListPage(this.props.match.params, category.category_id)}

@ -25,7 +25,7 @@
} */
#forum_list .return_btn.no_mr {
margin-right: 15px
/* margin-right: 15px */
}
/* md编辑器拖拽调整 */

@ -405,10 +405,10 @@ class ExerciceNew extends Component{
{ name: this.isEdit ? '编辑试卷' : '新建试卷'}
]}></CBreadcrumb>
<p className="clearfix mt30 mb30">
<p className="clearfix mt20 mb20">
<span className="fl font-24 color-grey-3">{this.isEdit ? "编辑" : "新建"}试卷</span>
<a href="javascript:void(0)" className="color-grey-6 fr font-16 mr2"
onClick={() => this.props.history.goBack()}>
onClick={() => this.props.history.length == 1 ? this.props.history.push(`/courses/${courseId}/exercises/${left_banner_id}`): this.props.history.goBack()}>
返回
</a>
</p>

@ -1360,7 +1360,7 @@ class GraduationTaskssettinglist extends Component{
<a id="graduation_comment_no_limit" alue={null} className={teacher_comment===null?"pl10 pr10 check_on":"pl10 pr10 "} onClick={this.funteachercomment}>不限</a>
</span>
<CheckboxGroup value={teacher_comment} onChange={(e)=>this.funteachercomment(e,taskslistdata.search_assistants&&taskslistdata.search_assistants.teacher_comment.length)} style={{ paddingTop: '4px'}}>
{taskslistdata.search_assistants&&taskslistdata.search_assistants.teacher_comment.map((item,key)=>{
{taskslistdata.search_assistants && taskslistdata.search_assistants.teacher_comment && taskslistdata.search_assistants.teacher_comment.map((item,key)=>{
return(
<span key={key}>
<Checkbox value={item.id} onClick={this.funteachercomment} className="fl ">{item.name}
@ -1502,7 +1502,7 @@ class GraduationTaskssettinglist extends Component{
pagination={false}
loading={loadingstate}
onChange={this.TablePagination}
className="edu-txt-center"
/>}
</div>
</div>
@ -1744,6 +1744,7 @@ class GraduationTaskssettinglist extends Component{
pagination={false}
loading={loadingstate}
onChange={this.TablePagination}
className="edu-txt-center"
/>}
</div>
</div>

@ -744,13 +744,9 @@ class GraduationTasks extends Component{
</Checkbox.Group>
</Spin>
<div className="mb40 edu-txt-center padding20-30"
style={
{
display: all_count===undefined?1:all_count< 15 ? 'none' : 'block'
}
}
>
all_count > 15 &&
<div className="mb40 edu-txt-center padding20-30" >
<Pagination
showQuickJumper
defaultCurrent={1}
@ -761,7 +757,7 @@ class GraduationTasks extends Component{
onChange={this.PaginationTask}
/>
</div>
}
<div className="alltask edu-back-white"
style={
{
@ -769,8 +765,8 @@ class GraduationTasks extends Component{
}
}
>
<div className="edu-tab-con-box clearfix edu-txt-center"><img className="edu-nodata-img mb20"
src="https://www.educoder.net/images/educoder/nodata.png" />
<div className="edu-tab-con-box clearfix edu-txt-center">
<img className="edu-nodata-img mb20" src="https://www.educoder.net/images/educoder/nodata.png" />
<p className="edu-nodata-p mb20">暂无数据哦~</p></div>
</div>

@ -67,10 +67,13 @@ class GraduateTopicDetail extends Component{
let course_id=this.props.match.params.course_id;
let {tableData}=this.state;
this.props.confirm({
content: tableData.user_selected_topic==0?`是否确认取消选题?`:"是否确认选题?",
onOk: () => {
let url="/courses/"+course_id+"/graduation_topics/"+graduation_topic_id+"/"
if(tableData.user_selected_topic){
if(tableData.user_selected_topic==0){
url+="student_cancel_topic.json"
}else{
}else if(tableData.user_selected_topic==null || tableData.user_selected_topic==2){
url+="student_select_topic.json"
}
axios.post((url)).then((result)=>{
@ -83,9 +86,16 @@ class GraduateTopicDetail extends Component{
console.log(error);
})
}
})
}
render(){
let {tableData,tablePage,tablePageSize,tab}=this.state
let {
tableData,
tablePage,
tablePageSize,
tab,
}=this.state
let {course_id,graduation_topic_id}=this.props.match.params;
const isStudent =this.props.isStudent();
const isAdmin =this.props.isAdmin();
@ -110,11 +120,17 @@ class GraduateTopicDetail extends Component{
<div className="fl mt6 task_menu_ul ml30">
<Menu mode="horizontal" defaultSelectedKeys="1" onClick={this.onChangeStatus}>
<Menu.Item key="1">选题列表</Menu.Item>
<Menu.Item key="2">课题详情</Menu.Item>
<Menu.Item key="2">选题问答</Menu.Item>
</Menu>
</div>
{/* null: 未选题 0待确认 1已同意 2已拒绝 */}
{
isStudent && tableData.user_selected == false && (tableData.user_selected_topic==null || tableData.user_selected_topic==2) &&
<WordsBtn className="fr font-16 mt22 mr30" style="blue" onClick={this.actionTopic}>选题</WordsBtn>
}
{
isStudent && <WordsBtn className="fr font-16 mt22 mr30" style="blue" onClick={this.actionTopic}>{tableData.user_selected_topic ? "取消选题":"选题"}</WordsBtn>
isStudent && tableData.user_selected == true && tableData.user_selected_topic==0 &&
<WordsBtn className="fr font-16 mt22 mr30" style="blue" onClick={this.actionTopic}>取消选题</WordsBtn>
}
{
isAdmin && <WordsBtn className="fr font-16 mt22 mr30" to={`/courses/${course_id}/graduation_topics/${graduation_topic_id}/edit`} style="blue">编辑</WordsBtn>

@ -6,7 +6,7 @@ import '../style.css'
import axios from "axios";
import GraduateTopicReply from './GraduateTopicReply'
import { ConditionToolTip,markdownToHTML } from 'educoder'
import { ConditionToolTip,MarkdownToHtml } from 'educoder'
const $=window.$;
const type={1: "设计",2: "论文", 3: "创作"}
@ -21,18 +21,6 @@ class GraduateTopicDetailTable extends Component{
topicInfo:undefined
}
}
updatamakedown=(id)=>{
setTimeout(()=>{
var shixunDescr = window.editormd.markdownToHTML(id, {
htmlDecode: "style,script,iframe",
taskList: true,
tex: true,
flowChart: true,
sequenceDiagram: true
});
$("#"+id+" p:first").addClass("ReactMarkdown");
}, 200)
}
componentDidMount=()=>{
let course_id=this.props.match.params.course_id;
let graduation_topic_id=this.props.match.params.graduation_topic_id;
@ -47,7 +35,6 @@ class GraduateTopicDetailTable extends Component{
}).catch((error)=>{
console.log(error);
})
this.updatamakedown("gratuationTopic_Detail");
}
render(){
let{topicInfo}=this.state
@ -57,12 +44,17 @@ class GraduateTopicDetailTable extends Component{
return(
<div>
<style>{`
.editormd-html-preview{
width:100%!important;
}
`}</style>
<div className="edu-back-white mb20 padding30">
<div className="bor-bottom-greyE pb30">
<div id="gratuationTopic_Detail" className="new_li markdown-body justify">
{
topicInfo && topicInfo.description!="" &&
<span className="markdown-body fl" dangerouslySetInnerHTML={{__html: markdownToHTML(topicInfo.description)}}></span>
<MarkdownToHtml content={topicInfo.description} ></MarkdownToHtml>
}
</div>
{

@ -254,7 +254,7 @@ class GraduateTopicDetailTable extends Component{
tableData.users_list && tableData.users_list.length > 0 && tableData.users_list.map((item,key)=>{
return(
<li className="color-grey-9 clearfix" key={key}>
<span style={{"width":"5%"}} className="color-grey-6">{parseInt(key)*parseInt(page*15)+1}</span>
<span style={{"width":"5%"}} className="color-grey-6">{parseInt(key+1)+(parseInt(page-1)*15)}</span>
<span style={{"width":"12%"}} className="color-grey-3">{item.student_name}</span>
<span style={{"width":"13%"}}>{item.student_id}</span>
<span style={{"width":"15%"}}>{item.class_group_name || "--"}</span>

@ -96,26 +96,26 @@ class GraduateTopicItem extends Component{
<div className="cl"></div>
<p className="color-grey mt20 clearfix">
<span className="fl mr40">
<span className="fl mr40 mt1">
<Tooltip title="指导老师" placement="bottom">
<span className="color-grey3">{discussMessage.author}</span>
</Tooltip>
</span>
<span className="mr20 color-grey-9">{discussMessage.selected_count} 已选</span>
<span className="color-grey-9">{discussMessage.confirmation_count} 已确认</span>
<span className="fl mr20 color-grey-9 mt1">{discussMessage.selected_count} 已选</span>
<span className="fl color-grey-9 mt1">{discussMessage.confirmation_count} 已确认</span>
<span className="fr">
{
isAdmin && <WordsBtn onClick={()=>this.editTopic(`${discussMessage.id}`)} style="blue" className="font-16">编辑</WordsBtn>
}
{
isStudent && data.user_selected == true && discussMessage.user_selected==true &&
<WordsBtn onClick={()=>chooseTopic(`${discussMessage.id}`,index,discussMessage.user_selected)} style="blue" className="font-16">
isStudent && data.user_selected == true && discussMessage.user_topic_status==0 &&
<WordsBtn onClick={()=>chooseTopic(`${discussMessage.id}`,index,true)} style="blue" className="font-16">
取消选题
</WordsBtn>
}
{
isStudent && data.user_selected == false && discussMessage.user_selected == false &&
<WordsBtn onClick={()=>chooseTopic(`${discussMessage.id}`,index,discussMessage.user_selected)} style="blue" className="font-16">
isStudent && data.user_selected==false && (discussMessage.user_topic_status == null || discussMessage.user_topic_status == 2) &&
<WordsBtn onClick={()=>chooseTopic(`${discussMessage.id}`,index,false)} style="blue" className="font-16">
选题
</WordsBtn>
}

@ -38,7 +38,7 @@ class GraduateTopicNew extends Component{
topic_source:[],
topic_type:[],
attachments:undefined,
addonAfter:20,
addonAfter:60,
left_banner_id:undefined,
course_name:undefined
}
@ -87,7 +87,7 @@ class GraduateTopicNew extends Component{
let topicId=this.props.match.params.topicId
let url=`/courses/${cid}/graduation_topics/${topicId}/edit.json`;
axios.get((url)).then((result)=>{
if(result.status==200){
if(result){
this.setState({
left_banner_id:result.data.left_banner_id,
course_name:result.data.course_name,
@ -257,7 +257,7 @@ class GraduateTopicNew extends Component{
// 附件相关 ------------ END
changeTopicName=(e)=>{
let num= 20 - parseInt(e.target.value.length);
let num= 60 - parseInt(e.target.value.length);
this.setState({
addonAfter:num < 0 ? 0 : num
})
@ -315,6 +315,11 @@ class GraduateTopicNew extends Component{
console.log(this.props);
return(
<div className="newMain ">
<style>{`
.courseForm .ant-form-item-label{
margin-left:unset!important
}
`}</style>
<div className="edu-class-container edu-position courseForm">
<p className="clearfix mb20 mt10">
<WordsBtn style="grey" className="fl" to={`/courses/${coursesId}`}>{course_name}</WordsBtn>
@ -357,10 +362,10 @@ class GraduateTopicNew extends Component{
rules: [{
required: true, message: '请输入选题名称',
}, {
max: 20, message: '最大限制为20个字符',
max: 60, message: '最大限制为60个字符',
}],
})(
<Input placeholder="请输入帖子选题名称,最大限制20个字符" maxLength="20" onInput={this.changeTopicName} autoComplete="off" addonAfter={String(addonAfter)} className="searchViewAfter" />
<Input placeholder="请输入帖子选题名称,最大限制60个字符" maxLength="60" onInput={this.changeTopicName} autoComplete="off" addonAfter={String(addonAfter)} className="searchViewAfter" />
)}
</Form.Item>
</div>
@ -381,6 +386,34 @@ class GraduateTopicNew extends Component{
width: 350px;
margin-bottom:10px;
}
.ant-upload-list-item{
margin-top:0px!important;
}
.ant-form-item-children{
position:unset
}
.rememberTip{
position:absolute;
right:0px;
bottom:-10px;
}
.chooseDes .ant-form-explain{
position:absolute;
bottom:-10px;
left:0px;
}
.setUploadStyle .uploadBtn{
height:20px;
line-height:20px;
}
.setUploadStyle .ant-form-item-control{
margin-top:15px!important;
line-height:22px!important;
}
.setUploadStyle .ant-upload-list{
margin-top:5px;
}
`}</style>
@ -389,7 +422,7 @@ class GraduateTopicNew extends Component{
<Form.Item
label="选题简介"
style={{"borderBottom":'none'}}
className="chooseDes"
className="chooseDes pr"
>
{getFieldDecorator('description', {
rules: [{
@ -402,7 +435,9 @@ class GraduateTopicNew extends Component{
mdID={'courseMessageMD'} initValue={this.editTopic ? this.editTopic.content : ''} className="courseMessageMD"></TPMMDEditor>
)}
</Form.Item>
<Form.Item>
<Form.Item
className="setUploadStyle"
>
{
getFieldDecorator('file',{
rules:[{
@ -505,6 +540,9 @@ class GraduateTopicNew extends Component{
.flexBlock .ant-row.ant-form-item {
margin-bottom: 6px;
}
.ant-cascader-menu{
min-width:125px!important;
}
`}</style>
@ -543,7 +581,7 @@ class GraduateTopicNew extends Component{
</Form.Item>
<Form.Item
label="调研或实习地点"
className="mt15 with22"
className="mt15 with22 setAreaStyle"
>
{getFieldDecorator('city', {
rules: [{

@ -223,7 +223,23 @@ onDelete=(index)=>{
})
}else{
// 加入题库
let courseid=this.props.match.params.coursesId
let url=`/courses/${courseid}/graduation_topics/add_to_bank.json`;
axios.post((url),{
topic_ids:checkBoxValues
}).then((result)=>{
if(result){
this.props.showNotification(`题库更新成功`);
let {searchValue,page,status} =this.state
this.fetchAll(searchValue,page,status);
this.setState({
checkBoxValues:[],
checkAllValue:false
})
}
}).catch((error)=>{
console.log(error)
})
}
}else{

@ -187,7 +187,7 @@ class PollDetailTabFirst extends Component{
key: 'classes',
dataIndex: 'classes',
width:160,
className:course_groups && course_groups.length > 0?"edu-txt-center":"edu-txt-center none"
className:poll_types && poll_types.groups_count > 0 ? "edu-txt-center":"edu-txt-center none"
}, {
title: '提交状态',
dataIndex: 'status',

@ -49,23 +49,23 @@ class PollListItem extends Component{
<p className="color-grey-9 clearfix">
{
item.polls_status !=1 &&
<span className="fl mt2">
<span className="fl mt3">
<span className="mr20">{item.poll_answer} 已答</span>
<span className="mr20">{item.poll_unanswer} 未答</span>
</span>
}
{
item.polls_status ==1 && item.publish_time ==null && item.created_at &&
<span className="mr20 fl mt2">创建于{moment(item.created_at).format(dataformat)}</span>
<span className="mr20 fl mt3">创建于{moment(item.created_at).format(dataformat)}</span>
}
{
item.polls_status ==1 && item.publish_time !=null &&
<span className="mr20 fl mt2">将发布于{moment(item.publish_time).format(dataformat)}</span>
<span className="mr20 fl mt3">将发布于{moment(item.publish_time).format(dataformat)}</span>
}
{
item.polls_status ==2 && item.publish_time !=null &&
<Tooltip title="提交剩余时间">
<span className="mr20 fl mt2">{formatDuring(t)}</span>
<span className="mr20 fl mt3">{formatDuring(t)}</span>
</Tooltip>
}
{
@ -81,21 +81,14 @@ class PollListItem extends Component{
}
</WordsBtn>:""
}
</p>
{
IsAdmin &&
<div className="homepagePostSetting" style={{"right":"0px","top":"-5px","position":"absolute","display":"block"}}>
<ul>
<li className="edu-position edu-position-hidebox">
<i className="fa fa-bars color-grey-b"></i>
<ul className="edu-position-hide undis">
<li> <WordsBtn className="" to={`/courses/${coursesId}/polls/${item.id}/${"edit"}`}>编辑</WordsBtn></li>
<li> <WordsBtn className="" to={`/courses/${coursesId}/polls/${item.id}/detail?tab=3`}>设置</WordsBtn></li>
</ul>
</li>
<ul className="fr">
<WordsBtn style="blue" className="mr20 font-16" to={`/courses/${coursesId}/polls/${item.id}/detail?tab=3`}>设置</WordsBtn>
<WordsBtn style="blue" className="font-16" to={`/courses/${coursesId}/polls/${item.id}/${"edit"}`}>编辑</WordsBtn>
</ul>
</div>
}
</p>
</div>
</div>
)

@ -300,7 +300,7 @@ export default class TPMMDEditor extends Component {
</div>
</div>
</div>
<div className={"fr"}>
<div className={"fr rememberTip"}>
{noStorage == true ? '' : <p id={`e_tip_mdEditor_${mdID}`} className="edu-txt-right color-grey-cd font-12"></p>}
{noStorage == true ? '' : <p id={`e_tips_mdEditor_${mdID}`} className="edu-txt-right color-grey-cd font-12"></p>}
</div>

@ -15,6 +15,8 @@ import "../../courses/css/members.css"
import "../../courses/css/Courses.css"
import update from 'immutability-helper'
import Trialapplication from '../../login/Trialapplication'
const $ = window.$;
class Infos extends Component{
@ -26,7 +28,8 @@ class Infos extends Component{
is_edit:false,
sign:undefined,
type:0,
login:undefined
login:undefined,
isRenders:false
}
}
componentDidMount =()=>{
@ -44,6 +47,8 @@ class Infos extends Component{
}
}
}
//获取个人主页信息
getInfo = (user_login) =>{
let url =`/users/${user_login}/homepage_info.json`;
@ -146,6 +151,22 @@ class Infos extends Component{
}
}
// 试用申请
trialapplications =()=>{
this.setState({
isRenders: true,
showTrial:true
})
}
cancelModulationModels=()=>{
this.setState({
isRenders: false
})
}
ToBank=(url)=>{
window.location.href=url;
}
render(){
let {
data ,
@ -155,12 +176,16 @@ class Infos extends Component{
type,
followed,
id,
login
login,
isRenders
}=this.state;
let {username}= this.props.match.params;
let {isAdmin}=this.props.isAdmin();
return(
<div className="newMain">
{
isRenders && <Trialapplication {...this.state} Cancel={() => this.cancelModulationModels()}/>
}
<div className="user-main-half">
<div className="user-headImg"></div>
<div className="user-headCon">
@ -251,7 +276,7 @@ class Infos extends Component{
:
<a herf="javascript:void(0);" onClick={this.signFor} id="attendance" className="user_default_btn user_orange_btn fl mb15">签到</a>
:
<a herf="javascript:void(0);" onClick="user_apply_trail();" id="authentication_apply" className="user_default_btn user_private_btn fl ml15">试用申请</a>
<a herf="javascript:void(0);" onClick={this.trialapplications} id="authentication_apply" className="user_default_btn user_private_btn fl ml15">试用申请</a>
}
</div>
:
@ -268,7 +293,7 @@ class Infos extends Component{
<Menu.Item key="1">实训</Menu.Item>
<Menu.Item key="2">实训课程</Menu.Item>
<Menu.Item key="3">项目</Menu.Item>
{ isAdmin && <Menu.Item key="4">题库</Menu.Item> }
{ data && data.identity !="学生" && <Menu.Item key="4" onClick={()=>this.ToBank(`/users/${username}?type=a_project`)}>题库</Menu.Item> }
</Menu>
</div>
</div>

@ -41,7 +41,7 @@ class InfosCourse extends Component{
category,
status,
page,
per_page:category && page ==1?17:16
per_page: this.props.is_current && category && page ==1?17:16
}}).then((result)=>{
if(result){
this.setState({
@ -111,18 +111,21 @@ class InfosCourse extends Component{
<li className={category=="manage" ? "active" : ""}><a href="javascript:void(0)" onClick={()=>this.changeCategory("manage")}>{is_current ? "我":"TA"}管理的</a></li>
<li className={category=="study" ? "active" : ""}><a href="javascript:void(0)" onClick={()=>this.changeCategory("study")}>{is_current ? "我":"TA"}学习的</a></li>
</div>
{
is_current &&
<div className="edu-back-white padding20-30 clearfix secondNav bor-top-greyE">
<li className={status ? "" : "active"}><a href="javascript:void(0)" onClick={()=>this.changeStatus()}>全部</a></li>
<li className={status=="processing" ? "active" : ""}><a href="javascript:void(0)" onClick={()=>this.changeStatus("processing")}>正在进行</a></li>
<li className={status=="end" ? "active" : ""}><a href="javascript:void(0)" onClick={()=>this.changeStatus("end")}>已结束</a></li>
</div>
}
<p className="pl25 pr25 clearfix font-12 mb20 mt20">
<span className="fl color-grey-9">共参与{totalCount}{category?category=="manage"?"发布":"学习":"课堂"}</span>
<span className="fr color-grey-9">时间最新</span>
</p>
<div className="square-list clearfix">
{
!isStudent && page == 1 && !category &&
!isStudent && page == 1 && !category && is_current &&
<Create href={"/courses/new"} name={"新建课堂"} index="1"></Create>
}
{

@ -44,7 +44,7 @@ class InfosPath extends Component{
status,
sort_by,
page,
per_page:category && page ==1?17:16
per_page:this.props.is_current && category && page ==1?17:16
}}).then((result)=>{
if(result){
this.setState({
@ -126,7 +126,7 @@ class InfosPath extends Component{
<li className={category=="study" ? "active" : ""}><a href="javascript:void(0)" onClick={()=>this.changeCategory("study")}>{is_current ? "我":"TA"}学习的</a></li>
</div>
{
category && category == "manage" &&
category && category == "manage" && is_current &&
<div className="edu-back-white padding20-30 clearfix secondNav bor-top-greyE">
<li className={status ? "" : "active"}><a href="javascript:void(0)" onClick={()=>this.changeStatus()}>全部</a></li>
<li className={status=="editing" ? "active" : ""}><a href="javascript:void(0)" onClick={()=>this.changeStatus("editing")}>编辑中</a></li>
@ -135,7 +135,7 @@ class InfosPath extends Component{
</div>
}
{
category && category == "study" &&
category && category == "study" && is_current &&
<div className="edu-back-white padding20-30 clearfix secondNav bor-top-greyE">
<li className={status ? "" : "active"}><a href="javascript:void(0)" onClick={()=>this.changeStatus()}>全部</a></li>
<li className={status=="unfinished" ? "active" : ""}><a href="javascript:void(0)" onClick={()=>this.changeStatus("unfinished")}>未完成</a></li>
@ -148,7 +148,7 @@ class InfosPath extends Component{
</div>
<div className="square-list clearfix">
{
isStudent ==false && page == 1 && !category &&
!isStudent && page == 1 && !category && is_current &&
<Create href={"/paths/new"} name={"新建实训课程"} index="3"></Create>
}
{

@ -37,7 +37,7 @@ class InfosProject extends Component{
category,
status,
page,
per_page:category && page ==1?17:16
per_page:this.props.is_current && category && page ==1?17:16
}}).then((result)=>{
if(result){
this.setState({
@ -107,18 +107,21 @@ class InfosProject extends Component{
<li className={category=="manage" ? "active" : ""}><a href="javascript:void(0)" onClick={()=>this.changeCategory("manage")}>{is_current ? "我":"TA"}管理的</a></li>
<li className={category=="study" ? "active" : ""}><a href="javascript:void(0)" onClick={()=>this.changeCategory("study")}>{is_current ? "我":"TA"}学习的</a></li>
</div>
{
is_current &&
<div className="edu-back-white padding20-30 clearfix secondNav bor-top-greyE">
<li className={status ? "" : "active"}><a href="javascript:void(0)" onClick={()=>this.changeStatus()}>全部</a></li>
<li className={status=="publicly" ? "active" : ""}><a href="javascript:void(0)" onClick={()=>this.changeStatus("publicly")}>公开</a></li>
<li className={status=="personal" ? "active" : ""}><a href="javascript:void(0)" onClick={()=>this.changeStatus("personal")}>私有</a></li>
</div>
}
<p className="pl25 pr25 clearfix font-12 mb20 mt20">
<span className="fl color-grey-9">共参与{totalCount}{category?category=="manage"?"发布":"学习":"项目"}</span>
<span className="fr color-grey-9">时间最新</span>
</p>
<div className="square-list clearfix">
{
!isStudent && page == 1 && !category &&
!isStudent && page == 1 && !category && is_current &&
<Create href={"/projects/new"} name={"新建项目"} index="4"></Create>
}
{

@ -44,7 +44,7 @@ class InfosShixun extends Component{
status,
sort_by,
page,
per_page:category && page ==1?17:16
per_page:this.props.is_current && category && page ==1?17:16
}}).then((result)=>{
if(result){
this.setState({
@ -126,7 +126,7 @@ class InfosShixun extends Component{
<li className={category=="study" ? "active" : ""}><a href="javascript:void(0)" onClick={()=>this.changeCategory("study")}>{is_current ? "我":"TA"}学习的</a></li>
</div>
{
category && category == "manage" &&
category && category == "manage" && is_current &&
<div className="edu-back-white padding20-30 clearfix secondNav bor-top-greyE">
<li className={status ? "" : "active"}><a href="javascript:void(0)" onClick={()=>this.changeStatus()}>全部</a></li>
<li className={status=="editing" ? "active" : ""}><a href="javascript:void(0)" onClick={()=>this.changeStatus("editing")}>编辑中</a></li>
@ -136,7 +136,7 @@ class InfosShixun extends Component{
</div>
}
{
category && category == "study" &&
category && category == "study" && is_current &&
<div className="edu-back-white padding20-30 clearfix secondNav bor-top-greyE">
<li className={status ? "" : "active"}><a href="javascript:void(0)" onClick={()=>this.changeStatus()}>全部</a></li>
<li className={status=="processing" ? "active" : ""}><a href="javascript:void(0)" onClick={()=>this.changeStatus("processing")}>未通关</a></li>
@ -157,7 +157,7 @@ class InfosShixun extends Component{
</div>
<div className="square-list clearfix">
{
isStudent ==false && page == 1 && !category &&
!isStudent && page == 1 && !category && is_current &&
<Create href={"/shixuns/new"} name={"新建实训"} index="2"></Create>
}
{

Loading…
Cancel
Save