diff --git a/app/services/admins/save_laboratory_setting_service.rb b/app/services/admins/save_laboratory_setting_service.rb
index 00e202cd9..f2a5c151e 100644
--- a/app/services/admins/save_laboratory_setting_service.rb
+++ b/app/services/admins/save_laboratory_setting_service.rb
@@ -30,7 +30,7 @@ class Admins::SaveLaboratorySettingService < ApplicationService
hash = {}
hash[:name] = strip nav[:name]
hash[:link] = strip nav[:link]
- hash[:hidden] = nav[:hidden].to_s == 0
+ hash[:hidden] = nav[:hidden].to_s != '0'
hash
end
end
diff --git a/public/react/src/modules/courses/members/CourseGroupList.js b/public/react/src/modules/courses/members/CourseGroupList.js
index ec0b23fb3..664e0d95a 100644
--- a/public/react/src/modules/courses/members/CourseGroupList.js
+++ b/public/react/src/modules/courses/members/CourseGroupList.js
@@ -152,7 +152,7 @@ function CourseGroupList(props) {
}
{
// pageType !== TYPE_STUDENTS &&
- !isCourseEnd && isAdmin && isParent && addDir()}>新建分班 }
+ !isCourseEnd && isAdmin && addDir()}>新建分班 }
{/* {
isAdmin && !isParent && course_group_id != 0 && deleteDir()}>删除分班 } */}
{/* {
diff --git a/public/react/src/modules/courses/members/CourseGroupListTable.js b/public/react/src/modules/courses/members/CourseGroupListTable.js
index 4645cf838..1560183f5 100644
--- a/public/react/src/modules/courses/members/CourseGroupListTable.js
+++ b/public/react/src/modules/courses/members/CourseGroupListTable.js
@@ -28,7 +28,6 @@ function CourseGroupListTable(props) {
}
course_groups.forEach((record) => {
const id = record.id
- debugger;
let _clipboard = new ClipboardJS(`.copyBtn_${id}`);
_clipboard.on('success', (e) => {
props.showNotification('复制成功')
@@ -142,7 +141,7 @@ function CourseGroupListTable(props) {
return columns
}
- const addToDir = async (record) => {
+ const doAddToDir = async (record) => {
const courseId = props.match.params.coursesId
const url = `/courses/${courseId}/join_course_group.json`
const course_group_id = record.id
@@ -151,11 +150,27 @@ function CourseGroupListTable(props) {
course_group_id
})
if (response && response.data.status == 0) {
- props.showNotification('加入成功')
+ props.showNotification(`已加入分班:${record.name}`)
props.updataleftNavfun()
props.onOperationSuccess && props.onOperationSuccess()
}
}
+ const addToDir = (record) => {
+ props.confirm({
+
+ content: `是否确认加入分班: ${record.name}?`,
+
+ okText: '确认',
+ cancelText: '取消',
+
+ onOk: () => {
+ doAddToDir(record)
+ },
+ onCancel() {
+ console.log('Cancel');
+ },
+ });
+ }
function onDelete(record) {
props.confirm({
diff --git a/public/react/src/modules/courses/members/studentsList.js b/public/react/src/modules/courses/members/studentsList.js
index 9acc4c0bf..ab29dde45 100644
--- a/public/react/src/modules/courses/members/studentsList.js
+++ b/public/react/src/modules/courses/members/studentsList.js
@@ -130,7 +130,7 @@ const buildColumns = (that,isParent) => {
}
const isAdmin = that.props.isAdmin()
if (isAdmin) {
- columns.unshift({
+ !that.isStudentPage && columns.unshift({
title: '',
dataIndex: 'check',
key: 'check',
@@ -547,7 +547,7 @@ class studentsList extends Component{
addDir = () => {
trigger('groupAdd', this.props.coursesids)
}
- addToDir = async () => {
+ doAddToDir = async () => {
const courseId = this.props.match.params.coursesId
const url = `/courses/${courseId}/join_course_group.json`
const course_group_id = this.props.match.params.course_group_id
@@ -556,11 +556,27 @@ class studentsList extends Component{
course_group_id
})
if (response && response.data.status == 0) {
- this.props.showNotification('加入成功')
+ this.props.showNotification(`已加入分班:${this.state.course_group_name}`)
this.props.updataleftNavfun()
this.fetchAll()
}
}
+ addToDir = (record) => {
+ this.props.confirm({
+
+ content: `是否确认加入分班: ${this.state.course_group_name}?`,
+
+ okText: '确认',
+ cancelText: '取消',
+
+ onOk: () => {
+ this.doAddToDir()
+ },
+ onCancel() {
+ console.log('Cancel');
+ },
+ });
+ }
renameDir = () => {
const course_group_id = this.props.match.params.course_group_id
trigger('groupRename', { id: parseInt(course_group_id), name: this.state.course_group_name})
@@ -670,7 +686,8 @@ class studentsList extends Component{
} else {
pageType = TYPE_COURSE_GOURP_CHILD
}
-
+ const isStudentPage = pageType == TYPE_STUDENTS
+ this.isStudentPage = isStudentPage
return(
@@ -708,23 +725,24 @@ class studentsList extends Component{
searchPlaceholder={ '请输入姓名、学号进行搜索' }
firstRowRight={
- {
+ {/* {
// pageType !== TYPE_STUDENTS &&
- isSuperAdmin &&
+ !isStudentPage && isSuperAdmin &&
this.refs['createGroupByImportModal'].setVisible(true)}>导入创建分班
- }
+ } */}
+
{
- // pageType !== TYPE_STUDENTS &&
- !isCourseEnd && isAdmin && isParent && this.addDir()}>添加分班 }
+ !isStudentPage && isAdmin && !isParent && course_group_id != 0 && this.deleteDir()}>删除分班 }
{
- isStudent && !isParent && course_group_id != 0 && this.addToDir()}>加入分班 }
+ !isStudentPage && isAdmin && !isParent && course_group_id != 0 && this.renameDir()}>分班重命名 }
{
- isAdmin && !isParent && course_group_id != 0 && this.deleteDir()}>删除分班 }
+ !isStudentPage && !isCourseEnd && isAdmin && this.addDir()}>新建分班 }
+
{
- isAdmin && !isParent && course_group_id != 0 && this.renameDir()}>分班重命名 }
+ !isStudentPage && isStudent && !isParent && course_group_id != 0 && this.addToDir()}>加入分班 }