杨树林 6 years ago
commit ce6a255c60

@ -42,8 +42,6 @@
"immutability-helper": "^2.6.6",
"install": "^0.12.2",
"jest": "20.0.4",
"js-base64": "^2.5.1",
"js-file-download": "^0.4.7",
"lodash": "^4.17.5",
"loglevel": "^1.6.1",
"material-ui": "^1.0.0-beta.40",
@ -165,7 +163,6 @@
"babel-plugin-import": "^1.11.0",
"concat": "^1.0.3",
"happypack": "^5.0.1",
"videojs-for-react": "^0.0.3",
"webpack-bundle-analyzer": "^3.0.3",
"webpack-parallel-uglify-plugin": "^1.1.0"
}

@ -5,6 +5,7 @@ import locale from 'antd/lib/date-picker/locale/zh_CN';
import { WordsBtn,getUrl ,handleDateString} from 'educoder';
import axios from 'axios';
import Modals from '../../../modals/Modals';
import DownloadMessage from '../../../modals/DownloadMessage';
import CoursesListType from '../../coursesPublic/CoursesListType';
import PublishModals from "../../coursesPublic/PublishModals";
import HomeworkModal from "../../coursesPublic/HomeworkModal";
@ -894,7 +895,40 @@ class GraduationTaskssettingapp extends Component{
}
/// 确认是否下载
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(){
const { getFieldDecorator } = this.props.form;
const dateFormat = 'YYYY-MM-DD HH:mm';
@ -969,7 +1003,12 @@ class GraduationTaskssettingapp extends Component{
{/*course_groups={course_groups}*/}
{/*skipTop={this.skipTop}*/}
{/*/>*/}
<DownloadMessage
{...this.props}
value={this.state.DownloadMessageval}
modalCancel={this.Downloadcal}
modalsType={this.state.DownloadType}
/>
<HomeworkModal
starttimes={this.state.starttimes}
typs={this.state.typs}
@ -1070,8 +1109,8 @@ class GraduationTaskssettingapp extends Component{
{this.props.isAdmin()? <li className="li_line drop_down fr color-blue font-16 mr20 mt20" style={{"paddingLeft":"0px"}}>
导出<i className="iconfont icon-xiajiantou font-12 ml2"></i>
<ul className="drop_down_menu" style={{"right":"-34px","left":"unset","height":"auto"}}>
<li><a href={"/api/graduation_tasks/"+task_Id+"/tasks_list.xlsx"} className="color-dark">导出成绩</a></li>
<li><a href={"/api/graduation_tasks/"+task_Id+"/tasks_list.zip"} className="color-dark">导出作品附件</a></li>
<li><a onClick={()=>this.confirmysl("/api/graduation_tasks/"+task_Id+"/tasks_list.xlsx")} className="color-dark">导出成绩</a></li>
<li><a onClick={()=>this.confirmysl("/api/graduation_tasks/"+task_Id+"/tasks_list.zip")} className="color-dark">导出作品附件</a></li>
</ul>
</li>:""}

@ -6,7 +6,7 @@ import axios from 'axios';
import moment from 'moment';
import HomeworkModal from "../../coursesPublic/HomeworkModal";
import Modals from '../../../modals/Modals';
import DownloadMessage from '../../../modals/DownloadMessage';
import CoursesListType from '../../coursesPublic/CoursesListType';
import ModulationModal from "../../coursesPublic/ModulationModal";
@ -612,7 +612,51 @@ class GraduationTaskssettinglist extends Component{
this.seacthdata(teacher_comment,task_status,course_group,cross_comment,order,b_order,search,pageNumber);
}
/// 确认是否下载
confirmysl(url){
let {teacher_comment, task_status, course_group, cross_comment, order, b_order, search,page} =this.state;
axios.get(url,{
teacher_comment:teacher_comment,
task_status:task_status,
course_group:course_group,
cross_comment:cross_comment,
order:order,
b_order:b_order,
search:search,
}).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 {coursename,coursesearch,taskname,taskid,taskslistdata,data,page,limit,teacher_comment,task_status,cross_comment,search,loadingstate,
@ -959,7 +1003,17 @@ class GraduationTaskssettinglist extends Component{
Cancel={this.Cancelvisible}
categoryid={taskslistdata.work_id}
setupdate={this.setupdate}
/>:""} {taskslistdata&&taskslistdata?
/>:""}
<DownloadMessage
{...this.props}
value={this.state.DownloadMessageval}
modalCancel={this.Downloadcal}
modalsType={this.state.DownloadType}
/>
{taskslistdata&&taskslistdata?
// 教师列表
this.props.isAdmin()?<div className="newMain clearfix">
<div className={"educontent mb20"}>
@ -1025,8 +1079,8 @@ class GraduationTaskssettinglist extends Component{
{this.props.isAdmin()? <li className="li_line drop_down fr color-blue font-16 mr20 mt20" style={{"paddingLeft":"0px"}}>
导出<i className="iconfont icon-xiajiantou font-12 ml2"></i>
<ul className="drop_down_menu" style={{"right":"-34px","left":"unset","height":"auto"}}>
<li><a href={"/api/graduation_tasks/"+task_Id+"/tasks_list.xlsx"} className="color-dark">学生成绩</a></li>
<li><a href={"/api/graduation_tasks/"+task_Id+"/tasks_list.zip"} className="color-dark">作品附件</a></li>
<li><a onClick={()=>this.confirmysl("/api/graduation_tasks/"+task_Id+"/tasks_list.xlsx")} className="color-dark">学生成绩</a></li>
<li><a onClick={()=>this.confirmysl("/api/graduation_tasks/"+task_Id+"/tasks_list.zip")} className="color-dark">作品附件</a></li>
</ul>
</li>:""}

@ -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}*/}
{/*/>*/}
<DownloadMessage
{...this.props}
value={this.state.DownloadMessageval}
modalCancel={this.Downloadcal}
modalsType={this.state.DownloadType}
/>
<HomeworkModal
starttimes={this.state.starttimes}
typs={this.state.typs}
@ -311,8 +352,8 @@ class GraduationTasksquestions extends Component{
{this.props.isAdmin()? <li className="li_line drop_down fr color-blue font-16 mr20 mt20" style={{"paddingLeft":"0px"}}>
导出<i className="iconfont icon-xiajiantou font-12 ml2"></i>
<ul className="drop_down_menu" style={{"right":"-34px","left":"unset","height":"auto"}}>
<li><a href={"/api/graduation_tasks/"+task_Id+"/tasks_list.xlsx"} className="color-dark">导出成绩</a></li>
<li><a href={"/api/graduation_tasks/"+task_Id+"/tasks_list.zip"} className="color-dark">导出作品附件</a></li>
<li><a onClick={()=>this.confirmysl("/api/graduation_tasks/"+task_Id+"/tasks_list.xlsx")} className="color-dark">导出成绩</a></li>
<li><a onClick={()=>this.confirmysl("/api/graduation_tasks/"+task_Id+"/tasks_list.zip")} className="color-dark">导出作品附件</a></li>
</ul>
</li>:""}

@ -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 ? '' : <a href="javascript:;">{(that.state.page - 1) * 20 + index + 1
- (that.state.application_list ? that.state.application_list.length : 0)} </a>
return index + 1
// return item.isApply == true ? '' : <a href="javascript:;">{(that.state.page - 1) * 20 + index + 1
// - (that.state.application_list ? that.state.application_list.length : 0)} </a>
}
}
// ,{
@ -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 <a href={`/login/${record.login}`} target="_blank" className="overflowHidden1" style={{ maxWidth: '110px'}}
title={`${name.length > 4 ? name : ''}`}>{name}</a>
@ -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: <Tooltip title="仅能批阅指定分班的作品">管理权限</Tooltip>,
@ -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 => (
<span>
{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
})
}
}).catch((error)=>{
console.log(error);
} 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
// })
// })
}
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{
</React.Fragment>
}
secondRowLeft={
total_count ? <ColorCountText count={total_count} name="个教师"></ColorCountText> : ''
isAdminOrTeacher ? <div className="fl mt6 task_menu_ul ">
<Menu mode="horizontal" defaultSelectedKeys="1" onClick={this.selectedStatus}>
<Menu.Item key="1">已审批({total_count})</Menu.Item>
<Menu.Item key="2">待审批({apply_size})</Menu.Item>
</Menu>
</div> :
(total_count ? <ColorCountText count={total_count} name="个教师"></ColorCountText> : '')
}
onPressEnter={this.onPressEnter}
></Titlesearchsection>
<style>{`
.task_menu_ul .ant-menu-item, .task_menu_ul .ant-menu-submenu-title{
padding:0px;
margin-right: 30px;
line-height: 68px;
font-size: 16px;
}
.teacherList .ant-table-pagination.ant-pagination {
float: none;
text-align: center;
@ -599,7 +678,7 @@ class studentsList extends Component{
<div className="mt20 edu-back-white padding20 teacherList">
<div className="clearfix stu_head" style={{paddingLeft: '15px'}}>
{ isAdminOrTeacher && hasGraduationModule && <Checkbox className="fl" onChange={this.onCheckAll} checked={checkAllValue} >已选 {checkBoxValues.length} </Checkbox> }
{ <div className="studentList_operation_ul">
{ filterKey == '1' && <div className="studentList_operation_ul">
{ hasGraduationModule && isAdminOrTeacher && <li className="li_line drop_down">
加入答辩组<i className="iconfont icon-xiajiantou font-12 ml2"></i>
<ul className="drop_down_menu" style={{"right":"0px","left":"unset", minWidth: '222px'}}>
@ -627,14 +706,14 @@ class studentsList extends Component{
</p>
</ul>
</li> }
<li className="drop_down">
{/* <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_NAME)} >姓名排序</li>
<li onClick={() => this.onSortTypeChange(ORDER_BY_DATE)} style={{width: '125px'}}>加入时间排序</li>
{this.hasGraduationModule() && <li onClick={() => this.onSortTypeChange(ORDER_BY_GRADUATION_GROUP)} >答辩组排序</li>}
</ul>
</li>
</li> */}
</div> }
</div>
<Spin size="large" spinning={this.state.isSpin}>
@ -642,7 +721,8 @@ class studentsList extends Component{
<Checkbox.Group style={{ width: '100%' }} onChange={this.onCheckBoxChange} value={checkBoxValues}>
{/* pagination={{ current: page, total: total_count, pageSize:20, onChange: this.onPageChange }} */}
<Table columns={columns} dataSource={combineArray}
pagination={total_count > 20 ? { //分页
onChange={this.onTableChange}
pagination={total_count > 20 && filterKey == '1' ? { //分页
total: page == 1 && this.state.application_list.length ? total_count + total_count / Math.floor(this.state.application_list.length + 20) : total_count , //数据总数量
pageSize: page == 1 && this.state.application_list.length ? this.state.application_list.length + 20 : 20, //显示几条一页
current: page,

@ -556,7 +556,7 @@ class Workquestionandanswer extends Component {
description={jobsettingsdata === undefined ? "" : jobsettingsdata === null ? "" : jobsettingsdata === "null" ? "" : jobsettingsdata.data.explanation === undefined ? "" : jobsettingsdata.data.explanation === null ? "" : jobsettingsdata.data.explanation}></Homeworddescription>
</div>
:
<div className="pl20 " style={{"padding": "10px 10px 10px 20px"}}>
<div className="pl20 markdown-body" style={{"padding": "10px 10px 10px 20px"}}>
{jobsettingsdata === undefined ? "无" : jobsettingsdata === null ? "无" : jobsettingsdata === "null" ? "无" :
jobsettingsdata.data.explanation === undefined ? "无" : jobsettingsdata.data.explanation === null ? "无" :
<div

@ -18,7 +18,7 @@ export function ImageLayerOfCommentHOC(options = {}) {
const imageSrc = event.target.src || event.target.getAttribute('src') || event.target.getAttribute('href')
// 判断imageSrc是否是图片
const fileName = event.target.innerHTML.trim()
if (isImageExtension(imageSrc.trim()) || isImageExtension(fileName)) {
if (isImageExtension(imageSrc.trim()) || isImageExtension(fileName) || event.target.tagName == 'IMG') {
// 非回复里的头像图片; 非emoticons
if (imageSrc.indexOf('/images/avatars/User') === -1 &&
imageSrc.indexOf('kindeditor/plugins/emoticons') === -1 ) {

@ -41,9 +41,10 @@
align-items: center;
display: -webkit-flex;
height: 100%;
text-align: center;
}
.passImg{
max-width: 100%;
max-width: 86%;
max-height: 100%;
}
/* ImageLayer ----------------- End */

@ -159,7 +159,7 @@ class CodeEvaluateView extends Component {
let headIconClass = '';
let _headLockIconClass = '';
if (item.is_public === 0) {
if (item.is_public == 0) {
if (game.test_sets_view === true || power === 1){
_headLockIconClass = 'fas fa-unlock-alt'
} else {
@ -175,7 +175,7 @@ class CodeEvaluateView extends Component {
testSetsComponentArray.push(
<div className="-task-ces-top clearfix" onClick={ this.onTestSetHeaderClick.bind(this, index) }
style={{cursor:'pointer'}} key={index+'-0'}>
style={{cursor:'pointer', 'margin-top':index == 0 ? '4px' : ''}} key={index+'-0'}>
<p className="clearfix">
<i className={`fa ${ 'fa-caret-right'} mr8 font-16`}
style={isExpanded ? {transform: 'rotate(90deg)'} : {}}></i>

@ -283,6 +283,9 @@ class LeftView extends Component {
color: #CDCDCD;
flex: 0 0 45px;
}
.markdown-body ol, .markdown-body ul {
padding-left: 2.5em;
}
`}</style>
<div className="multiLevelAnswer">
@ -293,7 +296,7 @@ class LeftView extends Component {
<div className="name">{item.name}</div>
<div className="status">已解锁</div>
</div>
<div className="contents" dangerouslySetInnerHTML={{__html: markdownToHTML(item.contents)}}>
<div className="contents markdown-body" dangerouslySetInnerHTML={{__html: markdownToHTML(item.contents)}}>
</div>
</div>
})}

@ -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 <div className="levelSection" id={`levelSection${index}`}>
return <div className="levelSection" id={`levelSection${index}`} style={{ clear: 'both' }}>
<span className="mr4 color-orange pt10">*</span>
<p className="color-grey-6 font-16 mb30 mt10" style={{ display: "inline" }}>级别{index + 1}</p>
<a className="fr sample_icon_remove mr30 mt8" onClick={()=>this.delanswers(index)}>

Loading…
Cancel
Save