|
|
@ -1,6 +1,6 @@
|
|
|
|
import React, { useState, useEffect } from 'react'
|
|
|
|
import React, { useState, useEffect } from 'react'
|
|
|
|
|
|
|
|
|
|
|
|
import { Input,Checkbox,Table, Pagination, Modal,Menu ,Spin, Tooltip , Badge, Popconfirm } from "antd";
|
|
|
|
import { Input,Checkbox,Table, Pagination, Modal,Menu ,Spin, Tooltip , Badge, Popconfirm, Result } from "antd";
|
|
|
|
import axios from 'axios'
|
|
|
|
import axios from 'axios'
|
|
|
|
|
|
|
|
|
|
|
|
import { WordsBtn, trigger, on, off, getUrl, downloadFile , sortDirections } from 'educoder'
|
|
|
|
import { WordsBtn, trigger, on, off, getUrl, downloadFile , sortDirections } from 'educoder'
|
|
|
@ -108,6 +108,13 @@ function CourseGroupListTable(props) {
|
|
|
|
render: (invite_code, record, index) => {
|
|
|
|
render: (invite_code, record, index) => {
|
|
|
|
return <React.Fragment>
|
|
|
|
return <React.Fragment>
|
|
|
|
<span>{invite_code}</span>
|
|
|
|
<span>{invite_code}</span>
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
record.edit_auth ?
|
|
|
|
|
|
|
|
<span onClick={()=>changeInviteCode(record.id,record.invite_code_halt)} className={record.invite_code_halt ?"codeBtnStyle codeBtn_green ml10":"codeBtnStyle codeBtn_blue ml10"}>
|
|
|
|
|
|
|
|
{record.invite_code_halt ?"启用":"停用"}
|
|
|
|
|
|
|
|
</span>
|
|
|
|
|
|
|
|
:""
|
|
|
|
|
|
|
|
}
|
|
|
|
{isAdmin &&
|
|
|
|
{isAdmin &&
|
|
|
|
<Tooltip title={
|
|
|
|
<Tooltip title={
|
|
|
|
<div>
|
|
|
|
<div>
|
|
|
@ -212,6 +219,18 @@ function CourseGroupListTable(props) {
|
|
|
|
function onGoDetail(record) {
|
|
|
|
function onGoDetail(record) {
|
|
|
|
props.history.push(`/courses/${courseId}/course_groups/${record.id}`)
|
|
|
|
props.history.push(`/courses/${courseId}/course_groups/${record.id}`)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// 停用和启用邀请码
|
|
|
|
|
|
|
|
function changeInviteCode(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 isAdmin = props.isAdmin();
|
|
|
|
const isSuperAdmin = props.isSuperAdmin();
|
|
|
|
const isSuperAdmin = props.isSuperAdmin();
|
|
|
|
const isStudent = props.isStudent()
|
|
|
|
const isStudent = props.isStudent()
|
|
|
|