个人主页

dev_forum
caishi 6 years ago
parent f79d1a8ad1
commit 86a20e8680

@ -67,25 +67,35 @@ class GraduateTopicDetail extends Component{
let course_id=this.props.match.params.course_id;
let {tableData}=this.state;
let url="/courses/"+course_id+"/graduation_topics/"+graduation_topic_id+"/"
if(tableData.user_selected_topic){
url+="student_cancel_topic.json"
}else{
url+="student_select_topic.json"
}
axios.post((url)).then((result)=>{
console.log(result);
if(result.data.status == 0){
this.getDetailList();
this.props.showNotification(`${result.data.message}`);
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==0){
url+="student_cancel_topic.json"
}else if(tableData.user_selected_topic==null || tableData.user_selected_topic==2){
url+="student_select_topic.json"
}
axios.post((url)).then((result)=>{
console.log(result);
if(result.data.status == 0){
this.getDetailList();
this.props.showNotification(`${result.data.message}`);
}
}).catch((error)=>{
console.log(error);
})
}
}).catch((error)=>{
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();
@ -113,8 +123,14 @@ class GraduateTopicDetail extends Component{
<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>

@ -57,12 +57,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>
<span className="markdown-body" dangerouslySetInnerHTML={{__html: markdownToHTML(topicInfo.description)}}></span>
}
</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>
}

@ -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,
@ -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>
@ -384,6 +389,31 @@ class GraduateTopicNew extends Component{
.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>
@ -392,7 +422,7 @@ class GraduateTopicNew extends Component{
<Form.Item
label="选题简介"
style={{"borderBottom":'none'}}
className="chooseDes"
className="chooseDes pr"
>
{getFieldDecorator('description', {
rules: [{
@ -405,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:[{
@ -508,6 +540,9 @@ class GraduateTopicNew extends Component{
.flexBlock .ant-row.ant-form-item {
margin-bottom: 6px;
}
.ant-cascader-menu{
min-width:125px!important;
}
`}</style>
@ -546,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>
{
IsAdmin &&
<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>

@ -268,7 +268,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(`/`)}>题库</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>
<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>
{
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>
<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>
{
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