dev_hjm_a
hjm 5 years ago
parent 1a8d0378aa
commit e4ec0cc0a2

@ -24,15 +24,27 @@ import ChangeRolePop from './ChangeRolePop'
角色数组, CREATOR: 创建者, PROFESSOR: 教师, ASSISTANT_PROFESSOR: 助教, STUDENT: 学生
*/
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
useEffect(() => {
fetchAll()
}, [])
function fetchAll() {
async function fetchAll() {
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 () => {
}
@ -52,8 +64,8 @@ function CourseGroupList(props) {
function onInputSearchChange() {
}
function onInputSearchChange() {
function onInputSearchChange(e) {
setSerachValue(e.target.value)
}
function Downloadcal() {
@ -67,18 +79,13 @@ function CourseGroupList(props) {
}else if(response.data.status&&response.data.status===-2){
if(response.data.message === "100"){
// 已超出文件导出的上限数量100 ),建议:
this.setState({
DownloadType:true,
DownloadMessageval:100
})
// 已超出文件导出的上限数量100 ),建议:
setDownloadType(true)
setDownloadMessageval(100)
}else {
//因附件资料超过500M
this.setState({
DownloadType:true,
DownloadMessageval:500
})
//因附件资料超过500M
setDownloadType(true)
setDownloadMessageval(500)
}
}else {
props.slowDownload(url)
@ -97,7 +104,9 @@ function CourseGroupList(props) {
const DownloadMessageval= '';
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 exportUrltwo = `/courses/${courseId}/export_couser_info.xlsx?`; //课堂信息
@ -115,7 +124,7 @@ function CourseGroupList(props) {
searchValue={ searchValue }
onInputSearchChange={onInputSearchChange}
showSearchInput={total_count >= 10}
searchPlaceholder={ '请输入姓名、学号进行搜索' }
searchPlaceholder={ '请输入名称进行搜索' }
firstRowRight={
<React.Fragment>
{ // pageType !== TYPE_STUDENTS &&

Loading…
Cancel
Save