dev_forum
hjm 6 years ago
parent 5444373331
commit 16e1a517c6

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

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

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

Loading…
Cancel
Save