|
|
|
@ -0,0 +1,189 @@
|
|
|
|
|
// 分班列表 加入分班
|
|
|
|
|
|
|
|
|
|
import React, { useState, useEffect } from 'react'
|
|
|
|
|
|
|
|
|
|
import { Input,Checkbox,Table, Pagination, Modal,Menu ,Spin, Tooltip , Divider, Popconfirm } from "antd";
|
|
|
|
|
import ClipboardJS from 'clipboard'
|
|
|
|
|
import axios from 'axios'
|
|
|
|
|
import _ from 'lodash'
|
|
|
|
|
|
|
|
|
|
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, getUrl, downloadFile , sortDirections } from 'educoder'
|
|
|
|
|
import Modals from "../../modals/Modals";
|
|
|
|
|
import NoneData from "../coursesPublic/NoneData"
|
|
|
|
|
import DownloadMessageysl from "../../modals/DownloadMessageysl";
|
|
|
|
|
import CreateGroupByImportModal from './modal/CreateGroupByImportModal'
|
|
|
|
|
import ChangeRolePop from './ChangeRolePop'
|
|
|
|
|
/**
|
|
|
|
|
角色数组, CREATOR: 创建者, PROFESSOR: 教师, ASSISTANT_PROFESSOR: 助教, STUDENT: 学生
|
|
|
|
|
*/
|
|
|
|
|
function CourseGroupList(props) {
|
|
|
|
|
const [checkBoxRoles, setCheckBoxRoles] = useState()
|
|
|
|
|
|
|
|
|
|
const courseId = props.match.params.coursesId
|
|
|
|
|
|
|
|
|
|
useEffect(() => {
|
|
|
|
|
fetchAll()
|
|
|
|
|
}, [])
|
|
|
|
|
function fetchAll() {
|
|
|
|
|
const url = `/courses/${courseId}/course_groups.json`
|
|
|
|
|
}
|
|
|
|
|
const onConfirm = async () => {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function createGroupImportSuccess() {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
function addDir() {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
function deleteDir() {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
function onPressEnter() {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
function onInputSearchChange() {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
function onInputSearchChange() {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
function Downloadcal() {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
const confirmysl = (url) => {
|
|
|
|
|
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 {
|
|
|
|
|
props.slowDownload(url)
|
|
|
|
|
}
|
|
|
|
|
}).catch((error) => {
|
|
|
|
|
console.log(error)
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const isAdmin = true;
|
|
|
|
|
const isSuperAdmin = true;
|
|
|
|
|
const isParent = true;
|
|
|
|
|
const searchValue = '';
|
|
|
|
|
const isCourseEnd= '';
|
|
|
|
|
const course_group_id= '';
|
|
|
|
|
|
|
|
|
|
const DownloadMessageval= '';
|
|
|
|
|
const DownloadType= '';
|
|
|
|
|
const total_count = 9
|
|
|
|
|
|
|
|
|
|
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?`; //活跃度
|
|
|
|
|
return (
|
|
|
|
|
<React.Fragment>
|
|
|
|
|
<DownloadMessageysl
|
|
|
|
|
{...props}
|
|
|
|
|
value={DownloadMessageval}
|
|
|
|
|
modalCancel={Downloadcal}
|
|
|
|
|
modalsType={DownloadType}
|
|
|
|
|
/>
|
|
|
|
|
<Titlesearchsection
|
|
|
|
|
title={"分班列表"}
|
|
|
|
|
searchValue={ searchValue }
|
|
|
|
|
onInputSearchChange={onInputSearchChange}
|
|
|
|
|
showSearchInput={total_count >= 10}
|
|
|
|
|
searchPlaceholder={ '请输入姓名、学号进行搜索' }
|
|
|
|
|
firstRowRight={
|
|
|
|
|
<React.Fragment>
|
|
|
|
|
{ // pageType !== TYPE_STUDENTS &&
|
|
|
|
|
isSuperAdmin && <React.Fragment>
|
|
|
|
|
{/* ref="createGroupByImportModal" */}
|
|
|
|
|
<CreateGroupByImportModal {...props}
|
|
|
|
|
createGroupImportSuccess={createGroupImportSuccess}
|
|
|
|
|
></CreateGroupByImportModal>
|
|
|
|
|
{/* this.refs['createGroupByImportModal'].setVisible(true) */}
|
|
|
|
|
<WordsBtn style="blue" className="mr30" onClick={()=> {}}>导入创建分班</WordsBtn>
|
|
|
|
|
</React.Fragment> }
|
|
|
|
|
{
|
|
|
|
|
// pageType !== TYPE_STUDENTS &&
|
|
|
|
|
!isCourseEnd && isAdmin && isParent && <WordsBtn style="blue" className="mr30" onClick={()=>addDir()}>添加分班</WordsBtn> }
|
|
|
|
|
{
|
|
|
|
|
isAdmin && !isParent && course_group_id != 0 && <WordsBtn style="blue" className="mr30" onClick={()=>deleteDir()}>删除分班</WordsBtn> }
|
|
|
|
|
{/* {
|
|
|
|
|
isAdmin && !isParent && course_group_id != 0 && <WordsBtn style="blue" className="mr30" onClick={()=>this.renameDir()}>分班重命名</WordsBtn> } */}
|
|
|
|
|
<style>{`
|
|
|
|
|
.drop_down_menu li a {
|
|
|
|
|
padding: 0px;
|
|
|
|
|
font-size: 14px;
|
|
|
|
|
}
|
|
|
|
|
.drop_down_menu {
|
|
|
|
|
/*width: 93px;*/
|
|
|
|
|
}
|
|
|
|
|
.drop_down_menu li {
|
|
|
|
|
width:100%;
|
|
|
|
|
box-sizing:boder-box;
|
|
|
|
|
float:unset;
|
|
|
|
|
line-height:30px!important;
|
|
|
|
|
flex: 0 0 30px;
|
|
|
|
|
}
|
|
|
|
|
.drop_down_menu, .drop_down_normal {
|
|
|
|
|
padding-top: 10px;
|
|
|
|
|
padding-bottom: 8px;
|
|
|
|
|
}
|
|
|
|
|
.drop_down_menu .drop_down_btn{
|
|
|
|
|
border-top:none;
|
|
|
|
|
}
|
|
|
|
|
.dividerStyle.ant-divider-horizontal{
|
|
|
|
|
margin: 0px;
|
|
|
|
|
}
|
|
|
|
|
`}</style>
|
|
|
|
|
{ isAdmin &&
|
|
|
|
|
<li className="li_line drop_down fr color-blue font-16">
|
|
|
|
|
导出<i className="iconfont icon-xiajiantou font-12 ml2"></i>
|
|
|
|
|
<ul className="drop_down_menu" style={{"right": "-20px", "left": "unset", "height": "auto"}}>
|
|
|
|
|
<li><a
|
|
|
|
|
onClick={(i) => confirmysl(exportUrltwo)}>课堂信息</a>
|
|
|
|
|
</li>
|
|
|
|
|
<li><a
|
|
|
|
|
onClick={(i) => confirmysl(exportUrlthree)}>活跃度</a>
|
|
|
|
|
</li>
|
|
|
|
|
<li><a
|
|
|
|
|
onClick={(i) => confirmysl(exportUrl)}>总成绩</a>
|
|
|
|
|
</li>
|
|
|
|
|
</ul>
|
|
|
|
|
</li>
|
|
|
|
|
}
|
|
|
|
|
</React.Fragment>
|
|
|
|
|
}
|
|
|
|
|
secondRowLeft={
|
|
|
|
|
total_count ? <ColorCountText count={total_count} name="个分班"></ColorCountText> : ''
|
|
|
|
|
}
|
|
|
|
|
onPressEnter={onPressEnter}
|
|
|
|
|
></Titlesearchsection>
|
|
|
|
|
</React.Fragment>
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
export default CourseGroupList
|