From 86a20e86803fce6131d1ce664a78f395a3257341 Mon Sep 17 00:00:00 2001
From: caishi <1149225589@qq.com>
Date: Fri, 21 Jun 2019 10:09:35 +0800
Subject: [PATCH] =?UTF-8?q?=E4=B8=AA=E4=BA=BA=E4=B8=BB=E9=A1=B5?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../graduation/topics/GraduateTopicDetail.js | 46 +++++++++++++------
.../topics/GraduateTopicDetailInfo.js | 7 ++-
.../topics/GraduateTopicDetailTable.js | 2 +-
.../graduation/topics/GraduateTopicItem.js | 14 +++---
.../graduation/topics/GraduateTopicNew.js | 43 +++++++++++++++--
.../courses/graduation/topics/index.js | 18 +++++++-
.../courses/poll/PollDetailTabFirst.js | 2 +-
.../src/modules/courses/poll/PollListItem.js | 29 +++++-------
.../modules/tpm/challengesnew/TPMMDEditor.js | 2 +-
.../react/src/modules/user/usersInfo/Infos.js | 2 +-
.../src/modules/user/usersInfo/InfosCourse.js | 17 ++++---
.../src/modules/user/usersInfo/InfosPath.js | 8 ++--
.../modules/user/usersInfo/InfosProject.js | 17 ++++---
.../src/modules/user/usersInfo/InfosShixun.js | 8 ++--
14 files changed, 143 insertions(+), 72 deletions(-)
diff --git a/public/react/src/modules/courses/graduation/topics/GraduateTopicDetail.js b/public/react/src/modules/courses/graduation/topics/GraduateTopicDetail.js
index e0eb07d56..27c27c64a 100644
--- a/public/react/src/modules/courses/graduation/topics/GraduateTopicDetail.js
+++ b/public/react/src/modules/courses/graduation/topics/GraduateTopicDetail.js
@@ -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{
课题详情
+ {/* null: 未选题 0:待确认 1:已同意 2:已拒绝 */}
+ {
+ isStudent && tableData.user_selected == false && (tableData.user_selected_topic==null || tableData.user_selected_topic==2) &&
+ 选题
+ }
{
- isStudent && {tableData.user_selected_topic ? "取消选题":"选题"}
+ isStudent && tableData.user_selected == true && tableData.user_selected_topic==0 &&
+ 取消选题
}
{
isAdmin && 编辑
diff --git a/public/react/src/modules/courses/graduation/topics/GraduateTopicDetailInfo.js b/public/react/src/modules/courses/graduation/topics/GraduateTopicDetailInfo.js
index 708de6dcb..f0694964c 100644
--- a/public/react/src/modules/courses/graduation/topics/GraduateTopicDetailInfo.js
+++ b/public/react/src/modules/courses/graduation/topics/GraduateTopicDetailInfo.js
@@ -57,12 +57,17 @@ class GraduateTopicDetailTable extends Component{
return(
+
{
topicInfo && topicInfo.description!="" &&
-
+
}
{
diff --git a/public/react/src/modules/courses/graduation/topics/GraduateTopicDetailTable.js b/public/react/src/modules/courses/graduation/topics/GraduateTopicDetailTable.js
index 7dbbf21f7..963c7a4f9 100644
--- a/public/react/src/modules/courses/graduation/topics/GraduateTopicDetailTable.js
+++ b/public/react/src/modules/courses/graduation/topics/GraduateTopicDetailTable.js
@@ -254,7 +254,7 @@ class GraduateTopicDetailTable extends Component{
tableData.users_list && tableData.users_list.length > 0 && tableData.users_list.map((item,key)=>{
return(
- {parseInt(key)*parseInt(page*15)+1}
+ {parseInt(key+1)+(parseInt(page-1)*15)}
{item.student_name}
{item.student_id}
{item.class_group_name || "--"}
diff --git a/public/react/src/modules/courses/graduation/topics/GraduateTopicItem.js b/public/react/src/modules/courses/graduation/topics/GraduateTopicItem.js
index 136280943..17a1b070e 100644
--- a/public/react/src/modules/courses/graduation/topics/GraduateTopicItem.js
+++ b/public/react/src/modules/courses/graduation/topics/GraduateTopicItem.js
@@ -96,26 +96,26 @@ class GraduateTopicItem extends Component{
-
+
{discussMessage.author}
- {discussMessage.selected_count} 已选
- {discussMessage.confirmation_count} 已确认
+ {discussMessage.selected_count} 已选
+ {discussMessage.confirmation_count} 已确认
{
isAdmin && this.editTopic(`${discussMessage.id}`)} style="blue" className="font-16">编辑
}
{
- isStudent && data.user_selected == true && discussMessage.user_selected==true &&
- chooseTopic(`${discussMessage.id}`,index,discussMessage.user_selected)} style="blue" className="font-16">
+ isStudent && data.user_selected == true && discussMessage.user_topic_status==0 &&
+ chooseTopic(`${discussMessage.id}`,index,true)} style="blue" className="font-16">
取消选题
}
{
- isStudent && data.user_selected == false && discussMessage.user_selected == false &&
- 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) &&
+ chooseTopic(`${discussMessage.id}`,index,false)} style="blue" className="font-16">
选题
}
diff --git a/public/react/src/modules/courses/graduation/topics/GraduateTopicNew.js b/public/react/src/modules/courses/graduation/topics/GraduateTopicNew.js
index 7c0811615..c3c0d18e2 100644
--- a/public/react/src/modules/courses/graduation/topics/GraduateTopicNew.js
+++ b/public/react/src/modules/courses/graduation/topics/GraduateTopicNew.js
@@ -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(
+
{course_name}
@@ -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;
+ }
`}
@@ -392,7 +422,7 @@ class GraduateTopicNew extends Component{
{getFieldDecorator('description', {
rules: [{
@@ -405,7 +435,9 @@ class GraduateTopicNew extends Component{
mdID={'courseMessageMD'} initValue={this.editTopic ? this.editTopic.content : ''} className="courseMessageMD">
)}
-
+
{
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;
+ }
`}
@@ -546,7 +581,7 @@ class GraduateTopicNew extends Component{
{getFieldDecorator('city', {
rules: [{
diff --git a/public/react/src/modules/courses/graduation/topics/index.js b/public/react/src/modules/courses/graduation/topics/index.js
index d7d6852f2..f84f53952 100644
--- a/public/react/src/modules/courses/graduation/topics/index.js
+++ b/public/react/src/modules/courses/graduation/topics/index.js
@@ -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{
diff --git a/public/react/src/modules/courses/poll/PollDetailTabFirst.js b/public/react/src/modules/courses/poll/PollDetailTabFirst.js
index 4166895e1..6a5be2e8d 100644
--- a/public/react/src/modules/courses/poll/PollDetailTabFirst.js
+++ b/public/react/src/modules/courses/poll/PollDetailTabFirst.js
@@ -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',
diff --git a/public/react/src/modules/courses/poll/PollListItem.js b/public/react/src/modules/courses/poll/PollListItem.js
index 769b4db33..3ebb6eb73 100644
--- a/public/react/src/modules/courses/poll/PollListItem.js
+++ b/public/react/src/modules/courses/poll/PollListItem.js
@@ -49,23 +49,23 @@ class PollListItem extends Component{
{
item.polls_status !=1 &&
-
+
{item.poll_answer} 已答
{item.poll_unanswer} 未答
}
{
item.polls_status ==1 && item.publish_time ==null && item.created_at &&
- 创建于{moment(item.created_at).format(dataformat)}
+ 创建于{moment(item.created_at).format(dataformat)}
}
{
item.polls_status ==1 && item.publish_time !=null &&
- 将发布于{moment(item.publish_time).format(dataformat)}
+ 将发布于{moment(item.publish_time).format(dataformat)}
}
{
item.polls_status ==2 && item.publish_time !=null &&
- {formatDuring(t)}
+ {formatDuring(t)}
}
{
@@ -81,21 +81,14 @@ class PollListItem extends Component{
}
:""
}
-
- {
- IsAdmin &&
-
-
- -
-
-
-
+ {
+ IsAdmin &&
+
-
- }
+ }
+
)
diff --git a/public/react/src/modules/tpm/challengesnew/TPMMDEditor.js b/public/react/src/modules/tpm/challengesnew/TPMMDEditor.js
index 30fa1c803..4af26d698 100644
--- a/public/react/src/modules/tpm/challengesnew/TPMMDEditor.js
+++ b/public/react/src/modules/tpm/challengesnew/TPMMDEditor.js
@@ -300,7 +300,7 @@ export default class TPMMDEditor extends Component {
-
+
{noStorage == true ? '' :
}
{noStorage == true ? '' :
}
diff --git a/public/react/src/modules/user/usersInfo/Infos.js b/public/react/src/modules/user/usersInfo/Infos.js
index 0f608426c..8d77a1b29 100644
--- a/public/react/src/modules/user/usersInfo/Infos.js
+++ b/public/react/src/modules/user/usersInfo/Infos.js
@@ -268,7 +268,7 @@ class Infos extends Component{
实训
实训课程
项目
- { isAdmin &&
题库 }
+ { data && data.identity !="学生" &&
this.ToBank(`/`)}>题库 }
diff --git a/public/react/src/modules/user/usersInfo/InfosCourse.js b/public/react/src/modules/user/usersInfo/InfosCourse.js
index 1a6b78542..b864dff63 100644
--- a/public/react/src/modules/user/usersInfo/InfosCourse.js
+++ b/public/react/src/modules/user/usersInfo/InfosCourse.js
@@ -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{
this.changeCategory("manage")}>{is_current ? "我":"TA"}管理的
this.changeCategory("study")}>{is_current ? "我":"TA"}学习的
-
+ {
+ is_current &&
+
+ }
共参与{totalCount}个{category?category=="manage"?"发布":"学习":"课堂"}
时间最新
{
- !isStudent && page == 1 && !category &&
+ !isStudent && page == 1 && !category && is_current &&
}
{
diff --git a/public/react/src/modules/user/usersInfo/InfosPath.js b/public/react/src/modules/user/usersInfo/InfosPath.js
index 156370f05..55422f208 100644
--- a/public/react/src/modules/user/usersInfo/InfosPath.js
+++ b/public/react/src/modules/user/usersInfo/InfosPath.js
@@ -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{
this.changeCategory("study")}>{is_current ? "我":"TA"}学习的
{
- category && category == "manage" &&
+ category && category == "manage" && is_current &&
}
{
- category && category == "study" &&
+ category && category == "study" && is_current &&
{
- isStudent ==false && page == 1 && !category &&
+ !isStudent && page == 1 && !category && is_current &&
}
{
diff --git a/public/react/src/modules/user/usersInfo/InfosProject.js b/public/react/src/modules/user/usersInfo/InfosProject.js
index eb3ef9b65..fab96f59e 100644
--- a/public/react/src/modules/user/usersInfo/InfosProject.js
+++ b/public/react/src/modules/user/usersInfo/InfosProject.js
@@ -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{
this.changeCategory("manage")}>{is_current ? "我":"TA"}管理的
this.changeCategory("study")}>{is_current ? "我":"TA"}学习的
-
+ {
+ is_current &&
+
+ }
共参与{totalCount}个{category?category=="manage"?"发布":"学习":"项目"}
时间最新
{
- !isStudent && page == 1 && !category &&
+ !isStudent && page == 1 && !category && is_current &&
}
{
diff --git a/public/react/src/modules/user/usersInfo/InfosShixun.js b/public/react/src/modules/user/usersInfo/InfosShixun.js
index 1fcd86b98..90575f9f0 100644
--- a/public/react/src/modules/user/usersInfo/InfosShixun.js
+++ b/public/react/src/modules/user/usersInfo/InfosShixun.js
@@ -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{
this.changeCategory("study")}>{is_current ? "我":"TA"}学习的
{
- category && category == "manage" &&
+ category && category == "manage" && is_current &&
}
{
- category && category == "study" &&
+ category && category == "study" && is_current &&
{
- isStudent ==false && page == 1 && !category &&
+ !isStudent && page == 1 && !category && is_current &&
}
{