dev_hjm_a
hjm 5 years ago
parent e4ec0cc0a2
commit 7d6658f72d

@ -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}
></Titlesearchsection>
<CourseGroupListTable
course_groups={course_groups}
{...props}
></CourseGroupListTable>
</React.Fragment>
)
}

@ -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 (
<React.Fragment>
{/* onChange={onTableChange} */}
<Table columns={columns} dataSource={course_groups} pagination={false}></Table>
</React.Fragment>
)
}
export default CourseGroupListTable
Loading…
Cancel
Save