dev_hjm_a
hjm 5 years ago
parent 1a8d0378aa
commit e4ec0cc0a2

@ -24,15 +24,27 @@ import ChangeRolePop from './ChangeRolePop'
角色数组, CREATOR: 创建者, PROFESSOR: 教师, ASSISTANT_PROFESSOR: 助教, STUDENT: 学生 角色数组, CREATOR: 创建者, PROFESSOR: 教师, ASSISTANT_PROFESSOR: 助教, STUDENT: 学生
*/ */
function CourseGroupList(props) { function CourseGroupList(props) {
const [checkBoxRoles, setCheckBoxRoles] = useState() const [serachValue, setSerachValue] = useState('')
const [DownloadType, setDownloadType] = useState()
const [DownloadMessageval, setDownloadMessageval] = useState()
const [listRes, setListRes] = useState({})
const courseId = props.match.params.coursesId const courseId = props.match.params.coursesId
useEffect(() => { useEffect(() => {
fetchAll() fetchAll()
}, []) }, [])
function fetchAll() { async function fetchAll() {
const url = `/courses/${courseId}/course_groups.json` const url = `/courses/${courseId}/course_groups.json`
const response = await axios.get(url, params: {
search: searchValue
});
console.log(response)
if (response) {
setListRes(response.data)
}
} }
const onConfirm = async () => { const onConfirm = async () => {
} }
@ -52,8 +64,8 @@ function CourseGroupList(props) {
function onInputSearchChange() { function onInputSearchChange() {
} }
function onInputSearchChange() { function onInputSearchChange(e) {
setSerachValue(e.target.value)
} }
function Downloadcal() { function Downloadcal() {
@ -68,17 +80,12 @@ function CourseGroupList(props) {
}else if(response.data.status&&response.data.status===-2){ }else if(response.data.status&&response.data.status===-2){
if(response.data.message === "100"){ if(response.data.message === "100"){
// 已超出文件导出的上限数量100 ),建议: // 已超出文件导出的上限数量100 ),建议:
setDownloadType(true)
this.setState({ setDownloadMessageval(100)
DownloadType:true,
DownloadMessageval:100
})
}else { }else {
//因附件资料超过500M //因附件资料超过500M
this.setState({ setDownloadType(true)
DownloadType:true, setDownloadMessageval(500)
DownloadMessageval:500
})
} }
}else { }else {
props.slowDownload(url) props.slowDownload(url)
@ -97,7 +104,9 @@ function CourseGroupList(props) {
const DownloadMessageval= ''; const DownloadMessageval= '';
const DownloadType= ''; const DownloadType= '';
const total_count = 9 const total_count = listRes.group_count;
const none_group_member_count = listRes.none_group_member_count;
const course_groups = listRes.course_groups
let exportUrl = `/courses/${courseId}/export_member_scores_excel.xlsx?`; //总成绩 let exportUrl = `/courses/${courseId}/export_member_scores_excel.xlsx?`; //总成绩
let exportUrltwo = `/courses/${courseId}/export_couser_info.xlsx?`; //课堂信息 let exportUrltwo = `/courses/${courseId}/export_couser_info.xlsx?`; //课堂信息
@ -115,7 +124,7 @@ function CourseGroupList(props) {
searchValue={ searchValue } searchValue={ searchValue }
onInputSearchChange={onInputSearchChange} onInputSearchChange={onInputSearchChange}
showSearchInput={total_count >= 10} showSearchInput={total_count >= 10}
searchPlaceholder={ '请输入姓名、学号进行搜索' } searchPlaceholder={ '请输入名称进行搜索' }
firstRowRight={ firstRowRight={
<React.Fragment> <React.Fragment>
{ // pageType !== TYPE_STUDENTS && { // pageType !== TYPE_STUDENTS &&

Loading…
Cancel
Save