@@ -1025,8 +1079,8 @@ class GraduationTaskssettinglist extends Component{
{this.props.isAdmin()?
导出
:""}
diff --git a/public/react/src/modules/courses/graduation/tasks/GraduationTaskssettingquestions.js b/public/react/src/modules/courses/graduation/tasks/GraduationTaskssettingquestions.js
index 4e807fde4..7c1a1474a 100644
--- a/public/react/src/modules/courses/graduation/tasks/GraduationTaskssettingquestions.js
+++ b/public/react/src/modules/courses/graduation/tasks/GraduationTaskssettingquestions.js
@@ -4,6 +4,7 @@ import {Link} from 'react-router-dom';
import { WordsBtn,markdownToHTML} from 'educoder';
import axios from 'axios';
import Modals from '../../../modals/Modals';
+import DownloadMessage from '../../../modals/DownloadMessage';
import HomeworkModal from "../../coursesPublic/HomeworkModal";
import CoursesListType from '../../coursesPublic/CoursesListType';
import moment from 'moment';
@@ -187,6 +188,41 @@ class GraduationTasksquestions extends Component{
course_groupslist:id
})
}
+
+ /// 确认是否下载
+ confirmysl(url){
+ axios.get(url).then((response) => {
+ if(response.data.status&&response.data.status===-1){
+
+ }else if(response.data.status&&response.data.status===-2){
+ if(response.data.messages === "100"){
+ // 已超出文件导出的上限数量(100 ),建议:
+
+ this.setState({
+ DownloadType:true,
+ DownloadMessageval:100
+ })
+ }else {
+ //因附件资料超过500M
+ this.setState({
+ DownloadType:true,
+ DownloadMessageval:500
+ })
+ }
+ }else {
+ this.props.showNotification(`正在下载中`);
+ window.open("/api"+url, '_blank');
+ }
+ }).catch((error) => {
+ console.log(error)
+ });
+ }
+ Downloadcal=()=>{
+ this.setState({
+ DownloadType:false,
+ DownloadMessageval:undefined
+ })
+ }
render(){
let { Modalstype,Modalstopval,ModalCancel,ModalSave,questionslist} =this.state;
@@ -218,7 +254,12 @@ class GraduationTasksquestions extends Component{
{/*modalSave={ModalSave}*/}
{/*loadtype={Loadtype}*/}
{/*/>*/}
-
+
导出
:""}
diff --git a/public/react/src/modules/courses/members/teacherList.js b/public/react/src/modules/courses/members/teacherList.js
index 2c5108f8d..a3cc08437 100644
--- a/public/react/src/modules/courses/members/teacherList.js
+++ b/public/react/src/modules/courses/members/teacherList.js
@@ -1,5 +1,5 @@
import React,{ Component } from "react";
-import { Input,Checkbox,Table, Divider, Tooltip,Spin } from "antd";
+import { Input,Checkbox,Table, Divider, Tooltip,Spin, Menu } from "antd";
import CourseLayoutcomponent from '../common/CourseLayoutComponent'
@@ -27,18 +27,22 @@ const ROLE_ADMIN = "管理员"
const ROLE_TEACHER = "教师"
const ROLE_TEACHER_ASSISTANT = "助教"
const pageSize = 20;
+
function buildColumns(that) {
+ let sortedInfo = that.state.sortedInfo || {}
const isAdmin = that.props.isAdmin()
const isAdminOrCreator = that.props.isAdminOrCreator();
const isAdminOrTeacher = that.props.isAdminOrTeacher()
- const { course_groups } = that.state
+ const { course_groups, filterKey } = that.state
+ const showSorter = filterKey == '1'
const columns = [{
title: '序号',
dataIndex: 'name',
key: 'index',
render: (content, item, index) => {
- return item.isApply == true ? '' : {(that.state.page - 1) * 20 + index + 1
- - (that.state.application_list ? that.state.application_list.length : 0)}
+ return index + 1
+ // return item.isApply == true ? '' : {(that.state.page - 1) * 20 + index + 1
+ // - (that.state.application_list ? that.state.application_list.length : 0)}
}
}
// ,{
@@ -55,6 +59,8 @@ function buildColumns(that) {
dataIndex: 'name',
width: 120,
key: 'name',
+ sorter: showSorter,
+ sortOrder: sortedInfo.columnKey === 'name' && sortedInfo.order,
render: (name, record) => {
return 4 ? name : ''}`}>{name}
@@ -63,6 +69,11 @@ function buildColumns(that) {
title: '角色',
dataIndex: 'role',
key: 'role',
+ sorter: showSorter,
+ // 'ascend' | 'descend'
+ defaultSortOrder: 'ascend',
+ sortOrder: sortedInfo.columnKey === 'role' && sortedInfo.order,
+
}]
that.state.course_groups && that.state.course_groups.length && columns.push({
title: 管理权限,
@@ -138,8 +149,11 @@ function buildColumns(that) {
columns.push({
title: '答辩组',
// width: 90,
+ sorter: showSorter,
key: 'graduation_group',
dataIndex: 'graduation_group',
+ sortOrder: sortedInfo.columnKey === 'graduation_group' && sortedInfo.order,
+
render: text => (
{text}
@@ -200,6 +214,7 @@ class studentsList extends Component{
this.state={
headIndex:"1",
page:1,
+ sortedInfo: { columnKey: 'role', order: 'ascend'},
totalPage:undefined,
searchValue:"",
order: ORDER_BY_DATE,
@@ -209,7 +224,8 @@ class studentsList extends Component{
checkBoxValues: [],
isSpin:false,
application_list: [],
- checkAllArray: []
+ checkAllArray: [],
+ filterKey: 1, // 1 已审批 2 待审批
}
}
onCheckAllChange = (e, item, index) => {
@@ -339,7 +355,7 @@ class studentsList extends Component{
console.log(error);
});
}
- fetchAll=(argPage)=>{
+ fetchAll = async (argPage) => {
this.setState({
isSpin:true
})
@@ -347,28 +363,57 @@ class studentsList extends Component{
if (argPage) {
this.setState({ page: argPage })
}
+
+ const sortedInfo = this.state.sortedInfo;
let page = argPage || this.state.page
- let { order, searchValue }=this.state
- let url=`/courses/${id}/teachers.json?order=${order}&page=${page}`;
+ let { searchValue, filterKey }=this.state
+ let order = 1;
+ if (sortedInfo.columnKey == 'role') {
+ order = 1;
+ } else if (sortedInfo.columnKey == 'name') {
+ order = 2;
+ } else if (sortedInfo.columnKey == 'graduation_group') {
+ order = 3;
+ }
+ let sort = 'desc'
+ if (sortedInfo.order == 'ascend') {
+ sort = 'asc'
+ }
+ let url=`/courses/${id}/teachers.json?order=${order}&page=${page}&sort=${sort}`;
+ if (filterKey == '1') {
+
+ } else if (filterKey == '2') {
+ url = `/courses/${id}/apply_teachers.json?_a=1`
+ }
if(searchValue!=""){
url+='&search='+searchValue;
}
- axios.get((url)).then((result)=>{
+ const result = await axios.get(url)
+ // axios.get((url)).then((result)=>{
if (result.data.teacher_list) {
this.setState({
teachers: result.data.teacher_list,
total_count: result.data.teacher_list_size,
- application_list: result.data.application_list,
+ application_list: result.data.application_list || [],
+ is_admin: result.data.is_admin,
+ apply_size: result.data.apply_size,
+ isSpin:false
+ })
+ } else if (result.data.application_list) {
+ this.setState({
+ total_count: result.data.teacher_list_size,
+ application_list: result.data.application_list || [],
is_admin: result.data.is_admin,
+ apply_size: result.data.apply_size,
isSpin:false
})
}
- }).catch((error)=>{
- console.log(error);
- this.setState({
- isSpin:false
- })
- })
+ // }).catch((error)=>{
+ // console.log(error);
+ // this.setState({
+ // isSpin:false
+ // })
+ // })
}
getGroupList(){
let id = this.props.match.params.coursesId
@@ -529,13 +574,33 @@ class studentsList extends Component{
})
return result && result.length > 0
}
-
+ onTableChange = (pagination, filters, sorter) => {
+ console.log('Various parameters', pagination, filters, sorter);
+ this.setState({
+ sortedInfo: sorter,
+ }, () => {
+ this.fetchAll()
+ });
+ };
+ clearSelection = () => {
+ this.setState({ checkBoxValues: [] })
+ }
+ selectedStatus=(e)=>{
+ this.clearSelection()
+ this.setState({
+ filterKey: e.key,
+ page:1,
+ isSpin:true
+ }, () => {
+ this.fetchAll();
+ })
+ }
render(){
const isAdmin = this.props.isAdmin()
const columns = buildColumns(this)
let {
searchValue, checkBoxValues, checkAllValue,
- groupList, total_count, teachers, order, page
+ groupList, total_count, teachers, order, page, apply_size, filterKey
}=this.state
let currentOrderName = '加入时间排序'
@@ -544,12 +609,13 @@ class studentsList extends Component{
} else if (order == ORDER_BY_GRADUATION_GROUP) {
currentOrderName = '答辩组排序'
}
- const combineArray = teachers.slice(0)
- if (page == 1) {
- this.state.application_list && this.state.application_list.slice(0).reverse().forEach(item => {
- item.isApply = true
- combineArray.unshift(item)
- })
+ let combineArray = teachers.slice(0)
+ if (page == 1 && filterKey == '2') {
+ // this.state.application_list && this.state.application_list.slice(0).reverse().forEach(item => {
+ // item.isApply = true
+ // combineArray.unshift(item)
+ // })
+ combineArray = this.state.application_list
}
const isAdminOrTeacher = this.props.isAdminOrTeacher()
const hasGraduationModule = this.hasGraduationModule()
@@ -585,12 +651,25 @@ class studentsList extends Component{
}
secondRowLeft={
- total_count ? : ''
+ isAdminOrTeacher ?
+
+ :
+ (total_count ? : '')
}
onPressEnter={this.onPressEnter}
>
@@ -293,7 +296,7 @@ class LeftView extends Component {
{item.name}
已解锁
-
})}
diff --git a/public/react/src/modules/tpm/challengesnew/TPManswer2.js b/public/react/src/modules/tpm/challengesnew/TPManswer2.js
index 98c615065..b5e1b43a6 100644
--- a/public/react/src/modules/tpm/challengesnew/TPManswer2.js
+++ b/public/react/src/modules/tpm/challengesnew/TPManswer2.js
@@ -195,10 +195,10 @@ export default class TPManswer extends Component {
this.setState({ answers: newAnswers})
}
answerOnChange = (val, index) => {
- // if (!this.state.answers[index]) {
- // // 1、2、3删除2会走到这里
- // return;
- // }
+ if (!this.state.answers[index]) {
+ // 1、2、3删除2会走到这里
+ return;
+ }
const newAnswer = Object.assign({}, this.state.answers[index])
newAnswer.contents = val
const newAnswers = this.state.answers.slice(0)
@@ -314,7 +314,7 @@ export default class TPManswer extends Component {
{
answers.map((answer, index) => {
- return