dev_forum
hjm 6 years ago
parent 5444373331
commit 16e1a517c6

@ -1,7 +1,7 @@
import React, {Component} from 'react';
import {Link} from "react-router-dom";
import axios from 'axios';
import {getImageUrl, trigger} from 'educoder';
import {getImageUrl, trigger, on, off} from 'educoder';
import { Tooltip, message,Popover} from 'antd';
import CoursesListType from '../coursesPublic/CoursesListType';
import Addcourses from '../coursesPublic/Addcourses';
@ -48,8 +48,12 @@ class CoursesBanner extends Component {
componentDidMount() {
this.onloadupdatabanner()
on('updatabanner', this.updatabanner)
}
componentWillUnmount() {
off('updatabanner', this.updatabanner)
}
onloadupdatabanner=()=>{
this.updatabanner()

@ -79,7 +79,7 @@ const buildColumns = (that) => {
return columns;
}
// 1-按照学号排序 2-按照分班排序
// 1-按照学生学号 2-按照分班名称
const ORDER_BY_NUM = 1;
const ORDER_BY_GROUP = 2;
@ -317,6 +317,8 @@ class studentsList extends Component{
if (result.data.status == 0) {
this.props.showNotification('移动成功')
this.fetchAll()
this.props.updataleftNavfun()
}
}).catch((error)=>{
console.log(error);
@ -362,6 +364,7 @@ class studentsList extends Component{
this.props.showNotification('删除成功')
this.fetchAll()
this.setState({checkBoxValues: []})
trigger('updatabanner')
}
}).catch((error)=>{
console.log(error);
@ -428,9 +431,9 @@ class studentsList extends Component{
checkBoxValues,
checkAllValue
}=this.state;
let currentOrderName = '学排序'
let currentOrderName = '学生学号'
if (order == ORDER_BY_GROUP) {
currentOrderName = '分班排序'
currentOrderName = '分班名称'
}
const { coursesids } = this.props
const course_group_id = this.props.match.params.course_group_id
@ -574,8 +577,8 @@ class studentsList extends Component{
<li className="drop_down">
{currentOrderName}<i className="iconfont icon-xiajiantou font-12 ml2"></i>
<ul className="drop_down_normal">
<li onClick={() => this.onSortTypeChange(ORDER_BY_NUM)} >排序</li>
<li onClick={() => this.onSortTypeChange(ORDER_BY_GROUP)} >分班排序</li>
<li onClick={() => this.onSortTypeChange(ORDER_BY_NUM)} >生学</li>
<li onClick={() => this.onSortTypeChange(ORDER_BY_GROUP)} >分班名称</li>
</ul>
</li>
</div>

@ -51,7 +51,7 @@ function buildColumns(that) {
dataIndex: 'role',
key: 'role',
}]
that.course_groups && that.course_groups.length && columns.push({
that.state.course_groups && that.state.course_groups.length && columns.push({
title: <Tooltip title="仅能批阅指定分班的作品">管理权限</Tooltip>,
width: 230,
key: 'course_groups',
@ -462,6 +462,7 @@ class studentsList extends Component{
if (response.data.status == 0) {
// {"status":1,"message":"删除成功"}
this.props.showNotification('删除成功')
trigger('updatabanner')
this.fetchAll()
}
})

Loading…
Cancel
Save