From 7d6658f72d2adaa454e9bf01f5f1e17efdd8175c Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Fri, 11 Oct 2019 15:51:26 +0800 Subject: [PATCH] table --- .../courses/members/CourseGroupList.js | 13 +- .../courses/members/CourseGroupListTable.js | 117 ++++++++++++++++++ 2 files changed, 126 insertions(+), 4 deletions(-) create mode 100644 public/react/src/modules/courses/members/CourseGroupListTable.js diff --git a/public/react/src/modules/courses/members/CourseGroupList.js b/public/react/src/modules/courses/members/CourseGroupList.js index 15bc12bd8..248a4d52d 100644 --- a/public/react/src/modules/courses/members/CourseGroupList.js +++ b/public/react/src/modules/courses/members/CourseGroupList.js @@ -20,6 +20,7 @@ import NoneData from "../coursesPublic/NoneData" import DownloadMessageysl from "../../modals/DownloadMessageysl"; import CreateGroupByImportModal from './modal/CreateGroupByImportModal' import ChangeRolePop from './ChangeRolePop' +import CourseGroupListTable from './CourseGroupListTable' /** 角色数组, CREATOR: 创建者, PROFESSOR: 教师, ASSISTANT_PROFESSOR: 助教, STUDENT: 学生 */ @@ -38,9 +39,9 @@ function CourseGroupList(props) { }, []) async function fetchAll() { const url = `/courses/${courseId}/course_groups.json` - const response = await axios.get(url, params: { + const response = await axios.get(url, { params: { search: searchValue - }); + }}); console.log(response) if (response) { setListRes(response.data) @@ -102,8 +103,7 @@ function CourseGroupList(props) { const isCourseEnd= ''; const course_group_id= ''; - const DownloadMessageval= ''; - const DownloadType= ''; + const total_count = listRes.group_count; const none_group_member_count = listRes.none_group_member_count; const course_groups = listRes.course_groups @@ -192,6 +192,11 @@ function CourseGroupList(props) { } onPressEnter={onPressEnter} > + + ) } diff --git a/public/react/src/modules/courses/members/CourseGroupListTable.js b/public/react/src/modules/courses/members/CourseGroupListTable.js new file mode 100644 index 000000000..96a13cf27 --- /dev/null +++ b/public/react/src/modules/courses/members/CourseGroupListTable.js @@ -0,0 +1,117 @@ +import React, { useState, useEffect } from 'react' + +import { Input,Checkbox,Table, Pagination, Modal,Menu ,Spin, Tooltip , Divider, Popconfirm } from "antd"; + +import { WordsBtn, trigger, on, off, getUrl, downloadFile , sortDirections } from 'educoder' +/** + 角色数组, CREATOR: 创建者, PROFESSOR: 教师, ASSISTANT_PROFESSOR: 助教, STUDENT: 学生 + course_members_count: 0 + id: 2441 + invite_code: "WUNX9K" + member_manager: "全部教师" + name: "e'e'e" +*/ +function buildColumns() { + const columns=[{ + title: '序号', + dataIndex: 'id', + key: 'id', + align:'center', + width:"10%", + className:"color-grey-6", + render: (id, record, index) => { + return index + 1 + } + }, + { + title: '分班名称', + dataIndex: 'name', + key: 'name', + align:'center', + width:"20%", + className:"color-grey-6", + render: (name, record, index) => { + return name + } + }, + { + title: '邀请码', + dataIndex: 'invite_code', + key: 'invite_code', + align:'center', + width:"10%", + className:"color-grey-6", + render: (invite_code, record, index) => { + return invite_code + } + }, + { + title: '学生成员', + dataIndex: 'course_members_count', + key: 'course_members_count', + align:'center', + width:"10%", + className:"color-grey-6", + render: (course_members_count, record, index) => { + return course_members_count + } + }, + { + title: '管理教师', + dataIndex: 'member_manager', + key: 'member_manager', + align:'center', + width:"25%", + className:"color-grey-6", + render: (member_manager, record, index) => { + return member_manager + } + }, + { + title: '操作', + dataIndex: 'setting', + key: 'setting', + align:'center', + width:"25%", + className:"color-grey-6", + render: (none, record, index) => { + return + } + }, + ] + return columns +} +function CourseGroupListTable(props) { + const [serachValue, setSerachValue] = useState('') + + const courseId = props.match.params.coursesId + + useEffect(() => { + + }, []) + + const onConfirm = async () => { + } + + function deleteDir() { + + } + const isAdmin = true; + const isSuperAdmin = true; + const isParent = true; + const searchValue = ''; + const isCourseEnd= ''; + const course_group_id= ''; + + + const course_groups = props.course_groups + const columns = buildColumns() + return ( + + {/* onChange={onTableChange} */} +
+ +
+ ) +} +export default CourseGroupListTable \ No newline at end of file