-
-
@
-
-
-
+ const { branches, pull, tag_name, isSpin } = this.state;
+
+ return (
+
- }>
-
复制
-
- }
-
- }
- } : {
- title: '你当前所在分班',
- dataIndex: 'group',
- key: 'group',
- align:'center',
- width:"20%",
- className:"color-grey-6",
- render: (invite_code, record, index) => {
- return props.current_group_id == record.id &&
- }
- })
- columns.push( aCol );
- }
-
- columns.push({
- title: '操作',
- dataIndex: 'setting',
- key: 'setting',
- align:'center',
- width:"14%",
- className:"color-grey-6",
- render: (none, record, index) => {
- return
- {!isCourseEnd && isAdmin && onDelete(record)} style={'grey'}>删除分班}
-
- {isStudent && addToDir(record)} style={''}>加入分班}
- onGoDetail(record)} style={''} className="color-dark">查看
-
- }
- })
-
- return columns
- }
- const doAddToDir = async (record) => {
- const courseId = props.match.params.coursesId
- const url = `/courses/${courseId}/join_course_group.json`
- const course_group_id = record.id
-
- const response = await axios.post(url, {
- course_group_id
- })
- if (response && response.data.status == 0) {
- 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({
- content:
-
该分班的学生将被移动到“未分班”
-
是否确认删除?
-
,
- onOk: () => {
- // const cid = this.props.match.params.coursesId
-
- const url = `/course_groups/${record.id}.json`
- axios.delete(url)
- .then((response) => {
- if (response.data.status == 0) {
- props.showNotification('删除成功')
- props.onOperationSuccess && props.onOperationSuccess()
- // props.history.push(response.data.right_url)
- }
- })
- .catch(function (error) {
- console.log(error);
- });
- }
- })
- }
- function onGoDetail(record) {
- props.history.push(`/classrooms/${courseId}/course_groups/${record.id}`)
- }
- // 停用和启用邀请码
- function changeInviteCode(id,flag){
- if(flag){
- changeInviteCodeFunc(id,flag);
- }else{
- props.confirm({
- content:"分班邀请码停用后,用户不能主动加入该分班了",
- subContent:'您是否确认停用?',
- onOk:() => {
- changeInviteCodeFunc(id,flag)
- }
- })
- }
- }
-
- function changeInviteCodeFunc(id,flag){
- const url= `/course_groups/${id}/set_invite_code_halt.json`;
- axios.post(url).then(result=>{
- if(result){
- props.showNotification(`邀请码${flag?"启用":"停用"}成功!`);
- props.onOperationSuccess && props.onOperationSuccess();
- }
- }).catch(error=>{
- console.log(error);
- })
- }
- const isAdmin = props.isAdmin();
- const isSuperAdmin = props.isSuperAdmin();
- const isStudent = props.isStudent()
- const isNotMember = props.isNotMember()
-
-
- const isParent = true;
- const isCourseEnd= props.isCourseEnd();
-
- const course_groups = props.course_groups
- const columns = buildColumns()
- const dataSource = course_groups.map(item => {
- return {
- ...item,
- subStringOfMember_manager : (item.member_manager && item.member_manager.length > 92)
- ? item.member_manager.substring(0, 92) + '...' : null
- }
- })
- return (
-
-
- {/* onChange={onTableChange} */}
-
-
-
- )
-}
-export default CourseGroupListTable
diff --git a/src/modules/courses/members/common.js b/src/modules/courses/members/common.js
deleted file mode 100644
index 4c0d2ed5..00000000
--- a/src/modules/courses/members/common.js
+++ /dev/null
@@ -1,2 +0,0 @@
-export const ROLE_TEACHER_NUM = 2;
-export const ROLE_ASSISTANT_NUM = 3;
\ No newline at end of file
diff --git a/src/modules/courses/members/modal/AddAdminModal.js b/src/modules/courses/members/modal/AddAdminModal.js
deleted file mode 100644
index 5cbf0c20..00000000
--- a/src/modules/courses/members/modal/AddAdminModal.js
+++ /dev/null
@@ -1,234 +0,0 @@
-import React, { Component } from "react";
-import { Modal, Checkbox, Input, Spin, Select, Divider, Radio } from "antd";
-import axios from 'axios'
-import ModalWrapper from "../../common/ModalWrapper"
-import InfiniteScroll from 'react-infinite-scroller';
-import { ROLE_TEACHER_NUM, ROLE_ASSISTANT_NUM } from '../common'
-import NoneData from '../../coursesPublic/NoneData'
-import { ConditionToolTip } from 'educoder'
-import SchoolSelect from '../../coursesPublic/form/SchoolSelect'
-
-const RadioGroup = Radio.Group;
-
-const Option = Select.Option;
-const pageCount = 15;
-class AddAdminModal extends Component{
- constructor(props){
- super(props);
- this.state={
- radioBoxValue: [],
- users: [],
- hasMore: true,
- loading: false,
- courseGroup: '',
- page: 1
- }
- }
- fetchTeacherList = (arg_page) => {
- const courseId = this.props.match.params.coursesId
- const page = arg_page || this.state.page;
- const { name, school_name } = this.state
-
- let url = `/courses/${courseId}/teachers.json`
- this.setState({ loading: true })
- axios.get(url, {
- params: {
- page: page,
- limit: pageCount
- }
- })
- .then((response) => {
- if (!response.data.teacher_list || response.data.teacher_list.length == 0) {
- this.setState({
- teacher_list: page == 1 ? response.data.teacher_list : this.state.teacher_list,
- page,
- loading: false,
- hasMore: false,
- })
- } else {
- this.setState({
- teacher_list: page == 1 ? response.data.teacher_list : this.state.teacher_list.concat(response.data.teacher_list),
- page,
- loading: false,
- hasMore: response.data.teacher_list.length == pageCount
- })
- }
-
- })
- .catch(function (error) {
- console.log(error);
- });
- }
- componentDidMount() {
-
-
- }
- setVisible = (visible) => {
- if (visible) {
- this.fetchTeacherList()
- }
- this.refs.modalWrapper.setVisible(visible)
- if (visible == false) {
- this.setState({
- radioBoxValue: ''
- })
- }
- }
-
- onSendOk = () => {
- if(!this.state.radioBoxValue || this.state.radioBoxValue.length == 0) {
- this.props.showNotification('请从列表中先选择用户。')
- return;
- }
- const courseId = this.props.match.params.coursesId
- const params = {
- "user_ids": this.state.radioBoxValue
- }
- const { courseGroup } = this.state
-
- if (courseGroup) {
- params.course_group_id = courseGroup
- }
- const url = `/courses/${courseId}/change_course_admin.json`
- axios.post(url, {
- course_member_id: this.state.radioBoxValue.course_member_id,
- user_id: this.state.radioBoxValue.user_id
- }).then((result)=>{
- if(result.data.status==0){
- this.props.showNotification('操作成功。')
- if (this.props.isCourseAdmin()) {
- window.location.reload()
- }
- // this.fetchAll()
- this.setVisible(false)
- this.props.changeAdminSuccess && this.props.changeAdminSuccess()
- }
- }).catch((error)=>{
- console.log(error);
- })
- }
-
- onOk = () => {
- this.onSendOk()
- }
-
- onCheckBoxChange = (e) => {
- this.setState({
- radioBoxValue: e.target.value
- })
- }
-
- handleInfiniteOnLoad = () => {
- this.fetchTeacherList(this.state.page + 1)
- }
-
- onSearch = () => {
- this.fetchTeacherList(1)
- }
- handleCourseGroupChange = (value) => {
- this.setState({
- courseGroup: value
- })
- }
- render(){
- const { teacher_list, radioBoxValue, loading, hasMore, name, school_name
- , courseGroup, course_groups, } = this.state
- const { moduleName } = this.props
- return(
-
-
-
-
-
选择的成员将会成为新的管理员
-
您将不再拥有管理员的权限,但您仍是教师团队的一员
-
-
-
-
- {/*
-
-
-
-
-
*/}
- { teacher_list && teacher_list.length ?
- {/* https://github.com/CassetteRocks/react-infinite-scroller/issues/70 */}
-
-
-
-
- { teacher_list.map( candidate => {
- return (
-
-
-
-
-
- {/*
- 12 }>
-
-
-
- */}
-
-
- )
- }) }
-
- {loading && hasMore && (
-
-
-
- )}
-
-
-
-
: }
-
- )
- }
-}
-export default AddAdminModal;
diff --git a/src/modules/courses/members/modal/AddGraduationGroupModal.js b/src/modules/courses/members/modal/AddGraduationGroupModal.js
deleted file mode 100644
index 7c55da97..00000000
--- a/src/modules/courses/members/modal/AddGraduationGroupModal.js
+++ /dev/null
@@ -1,75 +0,0 @@
-import React, { Component } from "react";
-import { Input} from "antd";
-import axios from 'axios'
-import ModalWrapper from "../../common/ModalWrapper"
-class AddStudentModal extends Component{
- constructor(props){
- super(props);
- this.state={
- name: ''
- }
- }
- componentDidMount() {
-
-
- }
- setVisible = (visible) => {
- this.refs.modalWrapper.setVisible(visible)
- if (visible == false) {
- this.setState({
- name: ''
- })
- }
- }
-
- onSendOk = () => {
- if(!this.state.name || !this.state.name.trim()) {
- this.props.showNotification('请先输入答辩组名称。')
- return;
- }
- const courseId = this.props.match.params.coursesId
- const url = `/courses/${courseId}/create_graduation_group.json`
- const params = {
- "name": this.state.name
- }
- axios.post(url, params)
- .then((response) => {
- if (response.data.status == 0) {
- this.setVisible(false)
- this.props.onOk && this.props.onOk();
- this.props.showNotification('添加成功')
- }
- })
- .catch(function (error) {
- console.log(error);
- });
- }
-
- onOk = () => {
- this.onSendOk()
- }
-
- render(){
- const { name } = this.state
- const { moduleName } = this.props
-
- return(
-
-
- 名称:
- this.setState({name: e.target.value})}
- placeholder={'示例:李老师答辩组'}
- >
-
-
- )
- }
-}
-export default AddStudentModal;
diff --git a/src/modules/courses/members/modal/AddStudentModal.js b/src/modules/courses/members/modal/AddStudentModal.js
deleted file mode 100644
index 5ab20751..00000000
--- a/src/modules/courses/members/modal/AddStudentModal.js
+++ /dev/null
@@ -1,394 +0,0 @@
-import React, { Component } from "react";
-import { Modal, Checkbox, Input, Spin, Select, Divider } from "antd";
-import axios from "axios";
-import ModalWrapper from "../../common/ModalWrapper";
-import InfiniteScroll from "react-infinite-scroller";
-import { ROLE_TEACHER_NUM, ROLE_ASSISTANT_NUM } from "../common";
-import NoneData from "../../coursesPublic/NoneData";
-import { ConditionToolTip, ThemeContext } from "educoder";
-import SchoolSelect from "../../coursesPublic/form/SchoolSelect";
-import moment from "moment";
-
-const formatTime = (time) => {
- if (time) {
- return moment(time).format("YYYY-MM-DD HH:mm");
- } else {
- return "-";
- }
-};
-const Option = Select.Option;
-const pageCount = 15;
-class AddStudentModal extends Component {
- constructor(props) {
- super(props);
- this.state = {
- checkBoxValues: [],
- users: [],
- hasMore: true,
- loading: false,
- courseGroup: "",
- page: 1,
- isSpin: false,
- };
- }
- fetchMemberList = (arg_page) => {
- const courseId = this.props.match.params.coursesId;
- const page = arg_page || this.state.page;
- const { name, school_name } = this.state;
- let url = `/courses/${courseId}/search_users.json?page=${page}&limit=${pageCount}&school_name=${
- school_name || ""
- }&name=${name || ""}`;
- this.setState({ loading: true });
- axios
- .get(encodeURI(url))
- .then((response) => {
- if (!response.data.users || response.data.users.length == 0) {
- this.setState({
- users: page == 1 ? response.data.users : this.state.users,
- page,
- loading: false,
- hasMore: false,
- });
- } else {
- this.setState({
- users:
- page == 1
- ? response.data.users
- : this.state.users.concat(response.data.users),
- page,
- loading: false,
- hasMore: response.data.users.length == pageCount,
- });
- }
- })
- .catch(function (error) {
- console.log(error);
- });
- };
- componentDidMount() {}
- fetchOptions = () => {
- // add_teacher_popup
- const courseId = this.props.match.params.coursesId;
-
- let url = `/courses/${courseId}/all_course_groups.json`;
-
- axios
- .get(url, {})
- .then((response) => {
- if (response.data.course_groups && response.data.course_groups.length) {
- this.setState({
- course_groups: response.data.course_groups,
- courseGroup: "0", // response.data.course_groups[0].id
- });
- } else {
- // showNotification('')
- }
- })
- .catch(function (error) {
- console.log(error);
- });
- };
- setVisible = (visible) => {
- if (visible) {
- this.setState(
- {
- school_name: this.props.user.user_school,
- name: undefined,
- },
- () => {
- this.fetchMemberList();
- }
- );
- this.fetchOptions();
- }
- this.refs.modalWrapper.setVisible(visible);
- if (visible == false) {
- this.setState({
- checkBoxValues: [],
- });
- }
- };
-
- onSendOk = () => {
- if (!this.state.checkBoxValues || this.state.checkBoxValues.length == 0) {
- this.props.showNotification("请从列表中先选择用户。");
- return;
- }
- this.setState({
- isSpin: true,
- });
- const courseId = this.props.match.params.coursesId;
- const url = `/courses/${courseId}/add_students_by_search.json`;
- const params = {
- user_ids: this.state.checkBoxValues,
- };
- const { courseGroup } = this.state;
- if (courseGroup) {
- params.course_group_id = courseGroup;
- }
- axios
- .post(url, params)
- .then((response) => {
- if (response.data.status == 0) {
- this.setVisible(false);
- this.props.showNotification("添加成功");
- this.props.addStudentSuccess && this.props.addStudentSuccess(params);
- this.setState({
- isSpin: false,
- });
- }
- })
- .catch(function (error) {
- console.log(error);
- });
- };
-
- onOk = () => {
- this.onSendOk();
- };
-
- onCheckBoxChange = (checkBoxValues) => {
- this.setState({
- checkBoxValues: checkBoxValues,
- });
- };
-
- handleInfiniteOnLoad = () => {
- this.fetchMemberList(this.state.page + 1);
- };
-
- onSearch = () => {
- this.fetchMemberList(1);
- };
- handleCourseGroupChange = (value) => {
- this.setState({
- courseGroup: value,
- });
- };
- render() {
- const {
- users,
- checkBoxValues,
- loading,
- hasMore,
- name,
- school_name,
- courseGroup,
- course_groups,
- isSpin,
- } = this.state;
- const { moduleName } = this.props;
- let theme = this.context;
- return (
-
-
-
- {/* */}
-
-
-
-
- {"姓名"}
-
-
- {"学号"}
-
-
- {"最后登录时间"}
-
-
- {"单位"}
-
-
-
-
- {loading || users.length ? (
-
- {/* https://github.com/CassetteRocks/react-infinite-scroller/issues/70 */}
-
-
-
- {users.map((candidate) => {
- return (
-
-
-
- {candidate.name ? (
-
- {candidate.name}
-
- ) : (
-
- )}
-
-
- {candidate.student_id || "-"}
-
-
- {formatTime(candidate.last_login_on)}
-
-
- {candidate.school_name||'-'}
-
-
- {candidate.added ? "已加入" : ""}
-
-
- );
- })}
-
- {loading && hasMore && (
-
-
-
- )}
-
-
- {course_groups && course_groups.length && (
-
-
- 所选学生分班至(选填):
-
-
-
- )}
-
- ) : (
-
- )}
-
-
- );
- }
-}
-
-AddStudentModal.contextType = ThemeContext;
-export default AddStudentModal;
diff --git a/src/modules/courses/members/modal/AddTeacherModal.js b/src/modules/courses/members/modal/AddTeacherModal.js
deleted file mode 100644
index a9bfad3d..00000000
--- a/src/modules/courses/members/modal/AddTeacherModal.js
+++ /dev/null
@@ -1,474 +0,0 @@
-import React, { Component } from "react";
-import { Modal, Checkbox, Input, Spin, Select, Divider, Icon } from "antd";
-import axios from "axios";
-import ModalWrapper from "../../common/ModalWrapper";
-import InfiniteScroll from "react-infinite-scroller";
-import { ROLE_TEACHER_NUM, ROLE_ASSISTANT_NUM } from "../common";
-import { ConditionToolTip, ActionBtn } from "educoder";
-import NoneData from "../../coursesPublic/NoneData";
-import AddGraduationGroupModal from "./AddGraduationGroupModal";
-import SchoolSelect from "../../coursesPublic/form/SchoolSelect";
-import moment from "moment";
-
-const formatTime = (time) => {
- if (time) {
- return moment(time).format("YYYY-MM-DD HH:mm");
- } else {
- return "-";
- }
-};
-const formatePhone = (phone) => {
- if (phone && typeof phone === "string") {
- return phone.substring(0, 3) + "****" + phone.substring(7);
- } else {
- return "-";
- }
-};
-const Option = Select.Option;
-const pageCount = 15;
-let timeout, currentValue;
-class AddTeacherModal extends Component {
- constructor(props) {
- super(props);
- this.state = {
- school_names: [],
- checkBoxValues: [],
- candidates: [],
- hasMore: true,
- loading: false,
- page: 1,
- };
- }
- fetchMemberList = (arg_page) => {
- const courseId = this.props.match.params.coursesId;
- const page = arg_page || this.state.page;
- const { name, school_name } = this.state;
- let url = `/courses/${courseId}/search_teacher_candidate.json`;
- this.setState({ loading: true });
- axios
- .post(url, {
- page: page,
- limit: pageCount,
- school_name: school_name || "",
- name: name || "",
- })
- .then((response) => {
- if (!response.data.candidates || response.data.candidates.length == 0) {
- this.setState({
- candidates:
- page == 1 ? response.data.candidates : this.state.candidates,
- page,
- loading: false,
- hasMore: false,
- });
- } else {
- this.setState({
- candidates:
- page == 1
- ? response.data.candidates
- : this.state.candidates.concat(response.data.candidates),
- page,
- loading: false,
- hasMore: response.data.candidates.length == pageCount,
- });
- }
- })
- .catch(function (error) {
- console.log(error);
- });
- };
- componentDidMount() {}
- onAddGraduationGroupOk = () => {
- this.fetchOptions();
- };
- fetchOptions = () => {
- // add_teacher_popup
- const courseId = this.props.match.params.coursesId;
-
- let url = `/courses/${courseId}/add_teacher_popup.json`;
-
- axios
- .get(url, {})
- .then((response) => {
- if (response.data.school_name) {
- this.setState(
- {
- school_name: response.data.school_name,
- },
- () => this.fetchMemberList()
- );
- } else {
- this.fetchMemberList();
- }
- if (response.data.graduation_groups) {
- this.setState({
- graduation_groups: response.data.graduation_groups,
- });
- }
- if (response.data.course_groups) {
- this.setState({
- course_groups: response.data.course_groups,
- });
- }
- })
- .catch(function (error) {
- console.log(error);
- });
- };
- setVisible = (visible) => {
- if (visible) {
- this.fetchOptions();
- }
- this.refs.modalWrapper.setVisible(visible);
- if (visible == false) {
- this.setState({
- checkBoxValues: [],
- });
- }
- this.setState({
- name: undefined,
- graduationGroup: undefined,
- courseGroup: undefined,
- });
- };
-
- onSendOk = () => {
- const courseId = this.props.match.params.coursesId;
- const url = `/courses/${courseId}/add_teacher.json`;
- if (this.state.checkBoxValues.length == 0) {
- this.props.showNotification("请先在下面列表中选择要添加教师的成员");
- return;
- }
- const params = {
- user_list: this.state.checkBoxValues.map((item) => {
- return { user_id: item };
- }),
- // "graduation_group_id": "2",
- // "course_group_id": "820",
- role: this.props.isTeacher ? ROLE_TEACHER_NUM : ROLE_ASSISTANT_NUM,
- };
- const { graduationGroup, courseGroup } = this.state;
- if (graduationGroup) {
- params.graduation_group_id = graduationGroup;
- }
- if (courseGroup) {
- params.course_group_id = courseGroup;
- }
- axios
- .post(url, params)
- .then((response) => {
- if (response.data.status == 0) {
- this.setVisible(false);
- this.props.showNotification("添加成功");
- this.props.addTeacherSuccess && this.props.addTeacherSuccess(params);
- }
- })
- .catch(function (error) {
- console.log(error);
- });
- };
-
- onOk = () => {
- this.onSendOk();
- };
-
- onCheckBoxChange = (checkBoxValues) => {
- this.setState({
- checkBoxValues: checkBoxValues,
- });
- };
-
- handleInfiniteOnLoad = () => {
- this.fetchMemberList(this.state.page + 1);
- };
-
- onSearch = () => {
- this.fetchMemberList(1);
- };
- handleGradationGroupChange = (value) => {
- this.setState({
- graduationGroup: value,
- });
- };
- handleCourseGroupChange = (value) => {
- this.setState({
- courseGroup: value,
- });
- };
- onOrgNameChange = (value) => {
- // console.log('school_name: ', value)
- this.setState({ school_name: value });
- };
-
- hasGraduationModule = () => {
- const { course_modules } = this.props;
- const result =
- course_modules &&
- course_modules.filter((item) => {
- return item.type == "graduation";
- });
- return result && result.length > 0;
- };
-
- render() {
- const {
- candidates,
- checkBoxValues,
- loading,
- hasMore,
- name,
- school_name,
- school_names,
- graduationGroup,
- graduation_groups,
- courseGroup,
- course_groups,
- } = this.state;
- const { moduleName } = this.props;
-
- return (
-
-
-
-
- {/* graduation_groups && !!graduation_groups.length */}
-
-
-
-
- {"姓名"}
-
-
- {"手机号/邮箱"}
-
-
- {"最后登录时间"}
-
-
- {"单位"}
-
-
- {""}
-
-
- {loading || candidates.length ? (
-
- {/* https://github.com/CassetteRocks/react-infinite-scroller/issues/70 */}
-
-
-
- {candidates &&
- candidates.map((candidate) => {
- return (
-
-
-
-
- {candidate.name}
-
-
-
- {candidate.phone
- ? formatePhone(candidate.phone)
- : formatePhone(candidate.email)}
-
-
- {formatTime(candidate.last_login_on)}
-
-
- {candidate.school_name||'-'}
-
-
- {candidate.added ? "已加入" : ""}
-
-
- );
- })}
-
- {loading && hasMore && (
-
-
-
- )}
-
-
-
- ) : (
-
- )}
-
- {/* { this.hasGraduationModule() &&
-
添加至答辩组:
-
-
} */}
-
- {course_groups && !!course_groups.length && (
-
- 管理权限:
-
-
- )}
-
-
- );
- }
-}
-export default AddTeacherModal;
diff --git a/src/modules/courses/members/modal/CourseGroupChooserModal.js b/src/modules/courses/members/modal/CourseGroupChooserModal.js
deleted file mode 100644
index b80a927f..00000000
--- a/src/modules/courses/members/modal/CourseGroupChooserModal.js
+++ /dev/null
@@ -1,127 +0,0 @@
-import React, { useState, useEffect, useRef, useMemo } from 'react'
-import { trigger } from 'educoder'
-import { Input, Checkbox } from "antd";
-import CourseGroupChooser from '../CourseGroupChooser'
-import ModalWrapper from "../../common/ModalWrapper"
-import axios from 'axios'
-/**
- arg_course_groups 选中的id数组
- joinCourseGroup 选中时触发 joinCourseGroup(checkedValues, item, index) 传入item:数据对象,index: 数据对象index
- checkAllValue 是否全选
- onCheckAllChange 全选 onCheckAllChange(e, item, index)
- course_groups 所有的group
-*/
-function CourseGroupChooserModal({ course_groups = [], isAdminOrCreator, item, index,
- setVisible, visible, record = {}, props = {}, fetchAll
- }) {
- // , arg_course_groups, checkAllValue , onCheckAllChange, joinCourseGroup
- const [checkAllValue, setCheckAllValue] = useState(true)
- const [arg_course_groups, setArg_course_groups] = useState(course_groups.map(item => item.id))
- const modalEl = useRef(null);
- useEffect(() => {
- setCheckAllValue(true)
- setArg_course_groups(course_groups.map(item => item.id))
- }, [course_groups, visible])
-
- useEffect(() => {
- if (visible != undefined) {
- modalEl.current.setVisible(true)
- }
- }, [visible])
-
- const joinCourseGroup = (checks) => {
- setArg_course_groups(checks)
- }
- const onCheckAllChange = (e) => {
- if (checkAllValue) {
- setArg_course_groups([])
- } else {
- setArg_course_groups(course_groups.map(item => item.id))
- }
- setCheckAllValue(!checkAllValue)
- }
- const onOk = async () => {
- let approval = 1
- const courseId = props.match.params.coursesId
- let url = `/courses/${courseId}/teacher_application_review.json`
- const response = await axios.post(url, {
- user_id: record.user_id,
- application_id: record.application_id,
- approval: approval,
- group_id: arg_course_groups
- }).then((result) => {
- if (result.data.status === 0) {
- props.showNotification(`已${approval == 1? '同意' : '拒绝'}`)
- fetchAll(1)
- modalEl.current.setVisible(false)
- }})
- }
- return (
-
-
- {/*
- */}
- 确认同意TA的加入,并设置TA的分班管理权限
-
-
-
- )
-}
-export default (CourseGroupChooserModal)
\ No newline at end of file
diff --git a/src/modules/courses/members/modal/CreateGroupByImportModal.js b/src/modules/courses/members/modal/CreateGroupByImportModal.js
deleted file mode 100644
index 03e1429e..00000000
--- a/src/modules/courses/members/modal/CreateGroupByImportModal.js
+++ /dev/null
@@ -1,153 +0,0 @@
-import React, { Component } from "react";
-import { Modal, Checkbox, Input, Spin, Upload, Divider, Icon } from "antd";
-import axios from 'axios'
-import ModalWrapper from "../../common/ModalWrapper"
-
-import { ConditionToolTip, getUploadActionUrl } from 'educoder'
-
-const { Dragger } = Upload;
-
-
-
-class CreateGroupByImportModal extends Component{
- constructor(props){
- super(props);
- this.state={
- }
- }
- fetchMemberList = (arg_page) => {
- }
- componentDidMount() {
-
-
- }
- onSendOk = () => {
- const courseId = this.props.match.params.coursesId
-
- let url = `/courses/${courseId}/create_group_by_importing_file.json`
- let { fileList } =this.state;
-
- if (!fileList || fileList.length == 0) {
- // this.props.showNotification('请先上传附件')
- this.setState({
- errorTip :'请先上传附件',
- })
- return;
- }
- let newfileList=[];
- if(fileList!=undefined&&fileList.length>0) {
- for (var list of fileList) {
- newfileList.push(list.response.id)
- }
- }
- axios.post(url, {
- attachment_ids: newfileList
- })
- .then((response) => {
- if (response.data.status == 0) {
- this.props.showNotification(response.data.message)
- this.props.createGroupImportSuccess && this.props.createGroupImportSuccess()
- this.setVisible(false)
- } else {
-
- }
- })
- .catch(function (error) {
- console.log(error);
- });
- }
- setVisible = (visible) => {
- if (visible) {
- this.setState({ fileList: [] });
- }
- this.refs.modalWrapper.setVisible(visible)
-
- }
- handleChange = (info) => {
- let fileList = info.fileList;
- console.log(fileList)
- this.setState({ fileList });
- }
-
- onOk = () => {
- this.onSendOk()
- }
-
- onAttachmentRemove = (file) => {
- if(!file.percent || file.percent == 100){
- this.props.confirm({
- content: '是否确认删除?',
-
- onOk: () => {
- this.deleteAttachment(file)
- },
- onCancel() {
- console.log('Cancel');
- },
- });
-
- return false;
- }
-
- }
- deleteAttachment = (file) => {
- const url = `/attachments/${file.response ? file.response.id : file.uid}.json`
- axios.delete(url, {
- })
- .then((response) => {
- if (response.data) {
- // const { status } = response.data;
- if (response.data.status === 0) {
-
- this.setState((state) => {
- const index = state.fileList.indexOf(file);
- const newFileList = state.fileList.slice();
- newFileList.splice(index, 1);
- return {
- fileList: newFileList,
- };
- });
- }
- }
- })
- .catch(function (error) {
- console.log(error);
- });
- }
-
- render(){
- const { candidates, checkBoxValues, loading, hasMore, name, school_name, school_names
- , graduationGroup, graduation_groups, courseGroup, course_groups , fileList } = this.state
- const { moduleName } = this.props
-
- const props = {
- name: 'file',
- multiple: true,
- fileList:fileList,
- action: getUploadActionUrl(),
- onRemove: this.onAttachmentRemove,
- onChange: this.handleChange
- };
- return(
-
-
-
-
-
- 点击或拖拽文件到这里上传
-
- 单个文件最大150MB
-
-
-
- )
- }
-}
-export default CreateGroupByImportModal;
diff --git a/src/modules/courses/members/studentsList.css b/src/modules/courses/members/studentsList.css
deleted file mode 100644
index bd7b88ed..00000000
--- a/src/modules/courses/members/studentsList.css
+++ /dev/null
@@ -1,51 +0,0 @@
-.stu_table .ant-table-thead > tr > th, .stu_table .ant-table-tbody > tr > td,
-.courseGroupList .ant-table-thead > tr > th, .courseGroupList .ant-table-tbody > tr > td {
- padding: 14px 6px;
-}
-
-.E9F8FF{
- background-color: #E9F8FF;
-}
-
-.codeBtnStyle{
- height: 18px;
- line-height: 18px;
- padding:0px 5px;
- cursor: pointer;
- font-size: 12px;
- border-radius: 2px;
-}
-.codeBtn_yellow{
- border:1px solid #FF6B06;
- color: #FF6B06!important;
-}
-.codeBtn_green{
- border:1px solid #00BA38;
- color: #00BA38!important;
-}
-
-.codeBtn_blue{
- border:1px solid #4CACFF;
- color: #4CACFF!important;
-}
-
-.course_publicNav{
- display: flex;
-}
-.course_publicNav li{
- position: relative;
- margin-right: 30px;
- cursor: pointer;
-}
-.course_publicNav li.active{
- color: #4CACFF
-}
-.course_publicNav li.active::after{
- position: absolute;
- width: 100%;
- height: 2px;
- content: '';
- left: 0px;
- bottom: -33px;
- background: #4CACFF;
-}
\ No newline at end of file
diff --git a/src/modules/courses/members/studentsList.js b/src/modules/courses/members/studentsList.js
deleted file mode 100644
index 4f46f32d..00000000
--- a/src/modules/courses/members/studentsList.js
+++ /dev/null
@@ -1,937 +0,0 @@
-import React, { Component } from "react";
-import { Input, Checkbox, Table, Pagination, Modal, Menu, Spin, Tooltip, Divider, Popconfirm } from "antd";
-import ClipboardJS from 'clipboard'
-import '../css/Courses.css'
-import '../css/members.css'
-import CourseLayoutcomponent from '../common/CourseLayoutComponent'
-
-import Titlesearchsection from '../common/titleSearch/TitleSearchSection'
-import ColorCountText from '../common/titleSearch/ColorCountText'
-import { WordsBtn, trigger, on, off, getRandomcode, getRandomNumber, sortDirections } from 'educoder'
-import Modals from "../../modals/Modals";
-import axios from 'axios'
-import _ from 'lodash'
-import NoneData from "../coursesPublic/NoneData"
-import DownloadMessageysl from "../../modals/DownloadMessageysl";
-import CreateGroupByImportModal from './modal/CreateGroupByImportModal'
-import ChangeRolePop from './ChangeRolePop'
-import "./studentsList.css"
-
-const Search = Input.Search;
-const TYPE_STUDENTS = 1
-const TYPE_COURSE_GOURP_PARENT = 2
-const TYPE_COURSE_GOURP_CHILD = 3
-const buildColumns = (that, isParent) => {
- const { course_groups, sortedInfo } = that.state
- let showSorter = isParent == true
- const courseId = that.props.match.params.coursesId
- const columns = [{
- title: '序号',
- dataIndex: 'id',
- key: 'id',
- align: 'center',
- width: "8%",
- className: "color-grey-6",
- render: (id, student, index) => {
- return (that.state.page - 1) * 20 + index + 1
- }
- },
- // {
- // title: '用户id',
- // dataIndex: 'login',
- // key: 'login',
- // align:'center',
- // width:"10%",
- // className:"color-grey-6",
- // render: (login, record) => {
- // return
10 ? login : ''}
- // >{login}
- // }
- // },
- {
- title: '姓名',
- dataIndex: 'name',
- key: 'name',
- align: 'center',
- width: "10%",
- className: "color-grey-6",
- render: (name, record) => {
- return
{name}
- }
- }, {
- title: '学号',
- dataIndex: 'student_id',
- key: 'student_id',
- align: 'center',
- width: "10%",
- className: "color-grey-6",
- sorter: true,
- sortDirections: sortDirections,
- sortOrder: sortedInfo.columnKey === 'student_id' && sortedInfo.order,
- render: (student_id, record) => {
- return
10 ? student_id : ''}
- style={{ maxWidth: '160px' }} >{student_id}
- }
- }
- , {
- title: '手机号',
- dataIndex: 'user_phone',
- key: 'user_phone',
- align: 'center',
- width: "10%",
- className: "color-grey-6",
- // sorter: true,
- // sortDirections: sortDirections,
- // sortOrder: sortedInfo.columnKey === 'user_phone' && sortedInfo.order,
- render: (user_phone, record) => {
- return
10 ? user_phone : ''}
- style={{ maxWidth: '160px' }} >{user_phone}
- }
- }
- , {
- title: '邮箱',
- dataIndex: 'user_mail',
- key: 'user_mail',
- align: 'center',
- width: "10%",
- className: "color-grey-6",
- // sorter: true,
- // sortDirections: sortDirections,
- // sortOrder: sortedInfo.columnKey === 'user_mail' && sortedInfo.order,
- render: (user_mail, record) => {
- return
10 ? user_mail : ''}
- style={{ maxWidth: '160px' }} >{user_mail}
- }
- }
- ];
-
- if (that.hasGroupModule()) {
- that.isStudentPage && columns.push({
- title: '分班',
- dataIndex: 'course_group_name',
- key: 'course_group_name',
- align: 'center',
- width: "25%",
- className: "color-grey-6",
- sorter: showSorter,
- sortDirections: sortDirections,
- sortOrder: sortedInfo.columnKey === 'course_group_name' && sortedInfo.order,
- })
- }
- const isAdminOrStudent = that.props.isAdminOrStudent()
- if (!isAdminOrStudent) {
- columns.some((item, key) => {
- if (item.title === "学号") {
- columns.splice(key, 1)
- return true
- }
- })
- }
- const isAdmin = that.props.isAdmin()
- if (isAdmin) {
- !that.isStudentPage && columns.unshift({
- title: '',
- dataIndex: 'check',
- key: 'check',
- render: (text, item) => {
- return
- },
- width: "5%"
- })
-
- columns.push({
- title: '操作',
- key: 'action',
- width: '22%',
- align: 'center',
- render: (text, record) => {
- return (
-
- that.onDelete(record)} style={'grey'}>删除学生
- {record.member_roles && record.member_roles.length && }
-
- )
- },
- })
-
- }
-
- return columns;
-}
-
-// 1-按照学生学号 2-按照分班名称,
-const ORDER_BY_NUM = 1;
-const ORDER_BY_GROUP = 2;
-
-class studentsList extends Component {
- constructor(props) {
- super(props);
- this.state = {
- page: 1,
- order: ORDER_BY_NUM,
- searchValue: '',
- course_groups: [],
- students: [],
- checkBoxValues: [],
-
- stu_new_flag: false,
- StudentList_value: "",
- modalsType: "",
- modalsTopval: "",
- modalsBottomval: "",
- modalCancel: "",
- n_And_e: 1,
- isSpin: false,
- DownloadType: false,
- DownloadMessageval: undefined,
- sortedInfo: { order: 'ascend', columnKey: 'student_id' }
- }
- }
- /// 确认是否下载
- confirmysl(url, urls) {
- // this.props.showGlobalLoading('正在生成文件,请稍后...')
- axios.get(url + 'export=true').then((response) => {
- if (response === undefined) {
- return
- }
- if (response.data.status && response.data.status === -1) {
-
- } else if (response.data.status && response.data.status === -2) {
- if (response.data.message === "100") {
- // 已超出文件导出的上限数量(100 ),建议:
-
- this.setState({
- DownloadType: true,
- DownloadMessageval: 100
- })
- } else {
- //因附件资料超过500M
- this.setState({
- DownloadType: true,
- DownloadMessageval: 500
- })
- }
- } else {
-
- // this.props.showNotification(`正在下载中`);
- // window.open("/api"+url, '_blank');
- this.props.slowDownload(getRandomcode(url))
-
- // getUrl() + "/api"+
- // const fileUrl = url;
-
- // this.props.slowDownload(fileUrl)
- // return;
-
- // downloadFile({
- // url: fileUrl,
- // successCallback: (url) => {
- // console.log('successCallback')
- // },
- // failCallback: (responseHtml, url) => {
- // console.log('failCallback')
- // }
- // })
- // window.open(fileUrl, "_self");// , '_blank'
- }
- }).catch((error) => {
- console.log(error)
- });
- }
- hasGroupModule = () => {
- const { course_modules } = this.props;
- const result = course_modules && course_modules.filter(item => {
- return item.type == 'course_group'
- })
- return result && result.length > 0
- }
-
- Downloadcal = () => {
- this.setState({
- DownloadType: false,
- DownloadMessageval: undefined
- })
- }
-
- inputStudent = (e) => {
- this.setState({
- StudentList_value: e.target.value
- })
- }
- // 有关新建分班和分班重命名
- showStuNewBox = (index) => {
- this.setState({
- stu_new_flag: true,
- n_And_e: index
- })
- }
- hideStuNewBox = () => {
- this.setState({
- stu_new_flag: false
- })
- }
- // 有关删除分班
- delClasses = () => {
- this.setState({
- modalsType: true,
- modalsTopval: "该分班的学生将被移动到“XX班”",
- modalsBottomval: "是否确认删除?",
- modalCancel: true
- })
- }
- cancelDelClasses = () => {
- this.setState({
- modalsType: false,
- modalsTopval: "",
- modalsBottomval: "",
- modalCancel: false
- })
- }
- // 确认删除
- sureDelClasses = () => {
- this.setState({
- modalsType: false,
- modalsTopval: "",
- modalsBottomval: "",
- modalCancel: false
- })
- }
-
- onChange = () => {
-
- }
- onChangeRoleSuccess = () => {
- const { page, searchValue } = this.state;
- this.fetchAll(page, searchValue);
- }
- componentDidMount() {
- this.setState({
- isSpin: true
- })
- const { page, searchValue } = this.state;
- this.fetchAll(page, searchValue);
- const isAdmin = this.props.isAdmin()
- // if (isAdmin) {
- this.fetchCourseGroups();
- // }
-
- isAdmin && on('addStudentSuccess', this.addStudentSuccessListener)
- isAdmin && on('updateNavSuccess', this.updateNavSuccess)
- }
- componentWillUnmount() {
- if (this.clipboard) {
- this.clipboard.destroy()
- }
- const isAdmin = this.props.isAdmin()
- if (isAdmin) {
- off('addStudentSuccess', this.addStudentSuccessListener)
- off('updateNavSuccess', this.updateNavSuccess)
- }
- }
- createGroupImportSuccess = () => {
- this.props.updataleftNavfun()
- }
- updateNavSuccess = () => {
- this.fetchCourseGroups();
- const { page, searchValue } = this.state;
-
- this.fetchAll(page, searchValue);
- }
-
- addStudentSuccessListener = (e, data) => {
- const params = JSON.parse(data)
- this.props.updataleftNavfun()
- const course_group_id = this.props.match.params.course_group_id;
- const coursesId = this.props.match.params.coursesId;
- const { searchValue } = this.state;
- if (params.course_group_id === course_group_id) {
- this.fetchAll(1, searchValue);
- } else {
- this.props.history.push(`/classrooms/${coursesId}/course_groups/${params.course_group_id || '0'}`)
- }
- // console.log('addStudentSuccessListener', data)
- }
- fetchCourseGroups = () => {
- const courseId = this.props.match.params.coursesId
-
- let url = `/courses/${courseId}/all_course_groups.json`
-
- axios.get(url, {
- })
- .then((response) => {
- if (response.data.course_groups && response.data.course_groups.length) {
- this.setState({
- course_groups: response.data.course_groups
- })
- } else {
- // showNotification('')
- }
- })
- .catch(function (error) {
- console.log(error);
- });
- }
- componentDidUpdate(prevProps) {
- if (prevProps.match.params.course_group_id != this.props.match.params.course_group_id) {
- this.setState({ checkBoxValues: [], checkAllValue: false })
-
- this.fetchAll(1, this.state.searchValue)
- }
- // 加载了2次
- // else if (prevProps.coursesids != this.props.coursesids) {
- // this.fetchAll(1)
- // }
- }
- fetchAll = (argPage, searchValue) => {
- this.setState({
- isSpin: true
- })
- let id = this.props.match.params.coursesId
- let course_group_id = this.props.match.params.course_group_id
-
- const { coursesids } = this.props
- // if (!coursesids) {
- // return;
- // }
- if (!course_group_id || course_group_id == coursesids) {
- course_group_id = ''
- }
- if (argPage) {
- this.setState({ page: argPage })
- }
- let page = argPage || this.state.page
- let { sortedInfo } = this.state
- let order = 1;
- if (sortedInfo.columnKey == 'student_id') {
- order = 1;
- } else if (sortedInfo.columnKey == 'course_group_name') {
- order = 2;
- }
- let sort = 'desc';
- if (sortedInfo.order == 'ascend') {
- sort = 'asc'
- }
-
- let url = `/courses/${id}/students.json?order=${order}&sort=${sort}&page=${page}&limit=20&course_group_id=${course_group_id}`;
- if (!!searchValue) {
- url += '&search=' + searchValue;
- }
- axios.get(encodeURI(url)).then((result) => {
- if (result.data.students) {
- this.setState({
- students: result.data.students,
- total_count: result.data.students_count,
- course_group_name: result.data.course_group_name,
- invite_code: result.data.invite_code,
- isSpin: false
- }, () => {
- if (course_group_id) {
- if (!this.clipboard) {
- const clipboard = new ClipboardJS('.copybtn');
- clipboard.on('success', (e) => {
- this.props.showNotification('复制成功')
- });
- this.clipboard = clipboard
- }
- }
- })
- }
- }).catch((error) => {
- console.log(error);
- this.setState({
- isSpin: false
- })
- })
- }
-
- onInputSearchChange = (e) => {
- this.setState({
- searchValue: e.target.value
- })
-
- // if (this.timeoutHandler) {
- // clearTimeout(this.timeoutHandler)
- // }
- // this.timeoutHandler = setTimeout(() => {
- // this.fetchAll(1)
- // }, 1200)
- }
- onSortTypeChange = (order) => {
- const { page, searchValue } = this.state;
- this.setState({ order: order }, () => {
- this.fetchAll(page, searchValue)
- })
- }
- onPageChange = (page) => {
- const { searchValue } = this.state;
- this.fetchAll(page, searchValue)
- this.setState({ checkAllValue: false })
- }
-
- onPressEnter = (e) => {
- this.setState({
- page: 1,
- searchValue: e
- })
- this.fetchAll(1, e)
- }
-
- onCheckBoxChange = (checkedValues) => {
- this.setState({
- checkBoxValues: checkedValues,
- checkAllValue: checkedValues.length == this.state.students.length
- })
- }
- // 多选
- moveToGroup = (group) => {
- const len = this.state.checkBoxValues.length
- if (len == 0) {
- this.props.showNotification('请从列表先选择要移动的学生')
- return;
- }
-
- let id = this.props.match.params.coursesId
- let { order, searchValue, page } = this.state
- let url = `/courses/${id}/transfer_to_course_group.json`;
- axios.post((url), {
- students: this.state.checkBoxValues.map(item => { return { course_member_id: item } }),
- course_group_id: group.id
- }).then((result) => {
- if (result.data.status == 0) {
- this.props.showNotification('移动成功')
- this.setState({ checkBoxValues: [] })
- this.fetchAll(page, searchValue);
- this.props.updataleftNavfun()
-
- }
- }).catch((error) => {
- console.log(error);
- })
- }
- onCheckAll = (e) => {
- this.setState({
- checkAllValue: e.target.checked
- })
- const values = this.state.students.map(item => {
- return item.course_member_id
- })
- if (e.target.checked) {
- const concated = this.state.checkBoxValues.concat(values);
- const sortedUniqed = _.uniq(concated)
- this.setState({
- checkBoxValues: sortedUniqed
- })
- } else {
- this.setState({
- checkBoxValues: _.difference(this.state.checkBoxValues, values)
- })
- }
- }
- // 多选
- onDelete = (record) => {
- if (!record) {
- const len = this.state.checkBoxValues.length
- if (len == 0) {
- this.props.showNotification('请先从列表选择要删除的学生')
- return;
- }
- }
- const { page, searchValue } = this.state;
-
- this.props.confirm({
- // content: `确认要删除所选的${len}个学生吗?`,
- content: `是否确认删除?`,
- onOk: () => {
- let id = this.props.match.params.coursesId
- let url = `/courses/${id}/delete_from_course.json`;
- axios.post((url), {
- students: [{ course_member_id: record.course_member_id }] // this.state.checkBoxValues.map(item => {return {course_member_id: item} }),
- }).then((result) => {
- if (result.data.status == 0) {
- this.props.showNotification('删除成功')
- this.props.updataleftNavfun()
- this.fetchAll(page, searchValue);
- this.setState({ checkBoxValues: [] })
- trigger('updatabanner')
- }
- }).catch((error) => {
- console.log(error);
- })
- }
- })
- }
- addDir = () => {
- trigger('groupAdd', this.props.coursesids)
- }
- 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
-
- const response = await axios.post(url, {
- course_group_id
- })
- const { page, searchValue } = this.state;
-
- if (response && response.data.status == 0) {
- this.props.showNotification(`已加入分班:${this.state.course_group_name}`)
- this.props.updataleftNavfun()
- this.fetchAll(page, searchValue)
- }
- }
- 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 })
- }
- deleteDir = () => {
- this.props.confirm({
- content:
-
该分班的学生将被移动到“未分班”
-
是否确认删除?
-
,
- onOk: () => {
- const course_group_id = this.props.match.params.course_group_id
- const courseId = this.props.match.params.coursesId
-
- const url = `/course_groups/${course_group_id}.json`
- axios.delete(url)
- .then((response) => {
- if (response.data.status == 0) {
- this.props.showNotification('删除成功')
- this.props.history.push(`/classrooms/${courseId}/course_groups`)
- }
- })
- .catch(function (error) {
- console.log(error);
- });
- }
- })
- }
- jsCopy = () => {
- var e = document.getElementById("copy_invite_code");
- e.select();
- document.execCommand("Copy");
- this.props.showNotification('复制成功')
- }
-
- onTableChange = (pagination, filters, sorter) => {
- const { page, searchValue } = this.state;
-
- this.setState({
- sortedInfo: sorter,
- }, () => {
- this.fetchAll(page, searchValue);
- });
- }
-
-
- render() {
- const isAdmin = this.props.isAdmin()
- const isStudent = this.props.isStudent()
- const isSuperAdmin = this.props.isSuperAdmin()
- const isCourseEnd = this.props.isCourseEnd()
- let {
- page,
-
- order,
- StudentList_value,
- stu_new_flag,
- modalsType,
- modalsTopval,
- modalsBottomval,
- n_And_e,
-
- students,
- searchValue,
- total_count,
- course_groups,
- checkBoxValues,
- checkAllValue
- } = this.state;
- let currentOrderName = '学生学号排序'
- if (order == ORDER_BY_GROUP) {
- currentOrderName = '分班名称排序'
- }
- const { coursesids } = this.props
- const course_group_id = this.props.match.params.course_group_id
- const isParent = !course_group_id || course_group_id == coursesids
- const { course_group_name, invite_code } = this.state;
-
- const courseId = this.props.match.params.coursesId
- let exportUrl = `/courses/${courseId}/export_member_scores_excel.xlsx?`; //总成绩
- let exportUrltwo = `/courses/${courseId}/export_couser_info.xlsx?`; //课堂信息
- let exportUrlthree = `/courses/${courseId}/export_member_act_score.xlsx?`; //活跃度
-
-
-
- const params = {}
- if (course_group_id) {
- params.group_id = course_group_id
- }
- if (searchValue) {
- searchValue = searchValue.trim()
- if (searchValue) {
- params.search = searchValue
- }
- }
- let paramsString = ''
- for (let key in params) {
- paramsString += `&${key}=${params[key]}&`
- }
- exportUrl += paramsString;
- exportUrltwo += paramsString;
- exportUrlthree += paramsString;
-
-
- // console.log(paramsString);
- // console.log(checkBoxValues);
- // console.log(searchValue);
- let pageType = TYPE_STUDENTS
- if (this.props.match.path.endsWith('students')) {
-
- } else if (course_group_id) {
- pageType = TYPE_COURSE_GOURP_CHILD
- } else {
- pageType = TYPE_COURSE_GOURP_PARENT
- }
- // 本页面有2个状态,学生列表、具体分班
- const isStudentPage = pageType == TYPE_STUDENTS
- this.isStudentPage = isStudentPage
- const isGroupChildPage = pageType == TYPE_COURSE_GOURP_CHILD
- let studentlist = buildColumns(this, isParent);
- if (this.props.isexcellent === true) {
- studentlist.some((item, key) => {
- if (item.title === "手机号") {
- studentlist.splice(key, 1)
- return true
- }
- }
- )
- }
-
- if (this.props.isexcellent === true) {
- studentlist.some((item, key) => {
- if (item.title === "邮箱") {
- studentlist.splice(key, 1)
- return true
- }
- }
- )
- }
-
- return (
-
-
-
- {
- course_group_name ?
-
-
- { this.props.history.push(`/classrooms/${courseId}/course_groups`) }}
- style={{ color: '#212121', verticalAlign: 'initial', marginRight: '14px' }}
- >
- {course_group_name}
-
- :
-
- - { this.props.history.push(`/classrooms/${courseId}/course_groups`) }}>分班列表
- - 未分班
-
- }
-
- {isAdmin && invite_code &&
- 邀请码:
-
- {invite_code}
-
-
- 成员可以通过邀请码主动加入分班
- 点击立刻复制邀请码
- }>
-