杨树林 5 years ago
commit f0c61b69ca

@ -122,21 +122,21 @@ module.exports = {
// First, run the linter.
// It's important to do this before Babel processes the JS.
// {
// test: /\.(js|jsx|mjs)$/,
// enforce: 'pre',
// use: [
// {
// options: {
// formatter: eslintFormatter,
// eslintPath: require.resolve('eslint'),
//
// },
// loader: require.resolve('eslint-loader'),
// },
// ],
// include: paths.appSrc,
// },
{
test: /\.(js|jsx|mjs)$/,
enforce: 'pre',
use: [
{
options: {
formatter: eslintFormatter,
eslintPath: require.resolve('eslint'),
},
loader: require.resolve('eslint-loader'),
},
],
include: paths.appSrc,
},
{
// "oneOf" will traverse all following loaders until one will
// match the requirements. When no loader matches it will fall

@ -37,7 +37,8 @@ class Fileslists extends Component{
course_modules:undefined,
has_course_groups:false,
course_is_public:undefined,
isSpin:false
isSpin:false,
course_second_categories:[]
}
}
componentDidMount=()=>{
@ -115,12 +116,22 @@ class Fileslists extends Component{
axios.get(url, {
}).then((response) => {
if(response!=undefined){
if(response.data&&response.data){
let list=response.data.course_modules;
let course_second_categoriess;
list.map((item,key)=>{
course_second_categoriess=item.course_second_categories
})
debugger
this.setState({
course_modules:response.data,
has_course_groups:response.data.has_course_groups
has_course_groups:response.data.has_course_groups,
course_second_categories:course_second_categoriess
})
}
}
})
@ -647,7 +658,8 @@ class Fileslists extends Component{
discussMessageid,
course_modules,
shixunmodal,
course_is_public
course_is_public,
filesId
} = this.state;
let category_id= this.props.match.params.category_id;
@ -797,31 +809,37 @@ class Fileslists extends Component{
overflow-y: auto;
}
.drop_down_menu li {
overflow: visible;
}
overflow: visible;
}
.courseSecond{
margin-left: 10px;
padding: 10px;
}
`}
</style>
<ul className="drop_down_menu" style={{"right":"0px","left":"unset"}}>
<p className="drop_down_search">
<ul className="drop_down_menu" style={{"right":"0px","left":"unset","min-width":'150px'}}>
{this.state.course_second_categories.length>10? <p className="drop_down_search">
<Input placeholder="搜索" value={this.state.dirSearchValue} onChange={(e) => {this.setState({dirSearchValue: e.target.value})}}/>
</p>
</p>:""}
{/*{course_modules&&course_modules.course_modules.map((item,key)=>{*/}
{/*return(*/}
{/*<li key={key} id={item.id} onClick={() => this.moveTos(0)}>{item.module_name}</li>*/}
{/*)*/}
{/*})}*/}
{course_modules&&course_modules.course_modules.map((item,key)=>{
return(
filesId&&filesId===item.id?"":<li key={key} id={item.id} onClick={() => this.moveTos(0)}>{item.module_name}</li>
)
})}
{ course_modules&&course_modules.course_modules.map( (item,key) => {
return item.course_second_categories.filter((item)=> {
return (!this.state.dirSearchValue || item.name.indexOf(this.state.dirSearchValue) != -1)
}).map((itm,k)=>{
return(
<li key={k} id={itm.id} onClick={() => this.moveTos(itm.id )}>{itm.name}</li>
filesId&&filesId===itm.id?"":<li key={k} id={itm.id} onClick={() => this.moveTos(itm.id )}>{itm.name}</li>
)
})
})}
{this.state.course_second_categories.length===0?
<div className={"courseSecond"}>暂无数据</div>:""}
{/*{course_modules&&course_modules.course_modules.map((item,key)=>{*/}
{/*return(*/}
@ -834,7 +852,7 @@ class Fileslists extends Component{
{/*})}*/}
{this.props.isAdmin()?parseInt(this.props.match.params.main_id)===parseInt(this.props.coursesids)?
<p className="drop_down_btn">
<a className="color-grey-6" onClick={()=>this.addDir()}>添加目录...</a>
<a className="color-grey-6" onClick={()=>this.addDir()}>添加目录</a>
</p>
:"":""}
</ul>

@ -410,7 +410,9 @@ class commonWork extends Component{
searchPlaceholder={"请输入名称进行搜索"}
showSearchInput={true}
></Titlesearchsection>
<PublishRightnow ref="publishModalRef" showActionButton={true} {...this.props} checkBoxValues={checkBoxValues}
showActionButton={false}
isPublish={true} doWhenSuccess={this.doWhenSuccess} fromListPage={true}></PublishRightnow>
{
mainList && mainList.course_identity < 5 && mainList.homeworks.length>0 &&
<div className="mt20 edu-back-white padding20-30">
@ -422,8 +424,7 @@ class commonWork extends Component{
onClick={this.onWorkDelete}>删除</a>
</li>
<li className="li_line">
<PublishRightnow ref="publishModalRef" showActionButton={true} {...this.props} checkBoxValues={checkBoxValues}
isPublish={true} doWhenSuccess={this.doWhenSuccess} fromListPage={true}></PublishRightnow>
<a href="javascript:void(0)" className="color-grey-9" onClick={() => this.refs['publishModalRef'].homeworkstart()}>{ "立即发布" }</a>
</li>
<li className="li_line">
<PublishRightnow showActionButton={true} {...this.props} checkBoxValues={checkBoxValues}

@ -467,6 +467,7 @@ class GraduationTasksSubmitedit extends Component{
let courseId=this.props.match.params.coursesId;
let category_id=this.props.match.params.category_id;
let work_Id=this.props.match.params.work_Id
const uploadProps = {
width: 600,
fileList,
@ -487,12 +488,7 @@ class GraduationTasksSubmitedit extends Component{
},
};
// console.log(workslist&&workslist)
// console.log(selectmemberslist&&selectmemberslist)
let graduation_id=workslist===undefined?"":workslist.graduation_id;
let task_id=workslist===undefined?"":workslist.task_id;
return(
<React.Fragment>
@ -530,9 +526,9 @@ class GraduationTasksSubmitedit extends Component{
<p className="clearfix mt10">
{/*<WordsBtn style="grey" className="fl"> <Link to={"/courses/"+courseId+"/graduation"} className="color-grey-6">{workslist&&workslist.course_name}</Link></WordsBtn>*/}
{/*<span className="color-grey-9 fl ml3 mr3">&gt;</span>*/}
<WordsBtn style="grey" className="fl"> <Link to={"/courses/"+courseId+"/graduation_tasks/"+graduation_id} className="color-grey-6">毕设任务</Link></WordsBtn>
<WordsBtn style="grey" className="fl"> <Link to={"/courses/"+courseId+"/graduation_tasks/"+category_id} className="color-grey-6">毕设任务</Link></WordsBtn>
<span className="color-grey-9 fl ml3 mr3">&gt;</span>
<WordsBtn style="grey" className="fl"> <Link to={"/courses/"+courseId+"/graduation_tasks/"+graduation_id+"/"+task_id+"/list"} className="color-grey-6">任务详情</Link></WordsBtn>
<WordsBtn style="grey" className="fl"> <Link to={"/courses/"+courseId+"/graduation_tasks/"+category_id+"/"+work_Id+"/list"} className="color-grey-6">任务详情</Link></WordsBtn>
<span className="color-grey-9 fl ml3 mr3">&gt;</span>
{/*<WordsBtn style="grey" className="fl">*/}
{/*<Link to={"/courses/"+courseId+"/graduation/graduation_tasks/"+category_id} className="color-grey-6">{workslist&&workslist.task_name}</Link>*/}

@ -466,6 +466,7 @@ render(){
let courseId=this.props.match.params.coursesId;
let category_id=this.props.match.params.category_id;
let task_Id=this.props.match.params.task_Id
const uploadProps = {
width: 600,
fileList,
@ -488,10 +489,6 @@ render(){
// console.log(this.props)
// console.log(selectmemberslist&&selectmemberslist)、、
let graduation_id=workslist===undefined?"":workslist.graduation_id;
let task_id=workslist===undefined?"":workslist.task_id;
return(
@ -531,9 +528,9 @@ render(){
<p className="clearfix mt10">
{/*<WordsBtn style="grey" className="fl"> <Link to={"/courses/"+courseId+"/graduation_tasks"} className="color-grey-6">{workslist&&workslist.course_name}</Link></WordsBtn>*/}
{/*<span className="color-grey-9 fl ml3 mr3">&gt;</span>*/}
<WordsBtn style="grey" className="fl"> <Link to={"/courses/"+courseId+"/graduation_tasks/"+graduation_id} className="color-grey-6">毕设任务</Link></WordsBtn>
<WordsBtn style="grey" className="fl"> <Link to={"/courses/"+courseId+"/graduation_tasks/"+category_id} className="color-grey-6">毕设任务</Link></WordsBtn>
<span className="color-grey-9 fl ml3 mr3">&gt;</span>
<WordsBtn style="grey" className="fl"> <Link to={"/courses/"+courseId+"/graduation_tasks/"+graduation_id+"/"+task_id+"/list"} className="color-grey-6">任务详情</Link></WordsBtn>
<WordsBtn style="grey" className="fl"> <Link to={"/courses/"+courseId+"/graduation_tasks/"+category_id+"/"+task_Id+"/list"} className="color-grey-6">任务详情</Link></WordsBtn>
<span className="color-grey-9 fl ml3 mr3">&gt;</span>
{/*<WordsBtn style="grey" className="fl">*/}
{/*<Link to={"/courses/"+courseId+"/graduation/graduation_tasks/"+category_id} className="color-grey-6">{workslist&&workslist.task_name}</Link>*/}

@ -164,7 +164,7 @@ class GraduationTasksappraise extends Component{
<div className={"educontent mb20"}>
<p className="clearfix mt10">
<Link to={"/courses/"+courseId} className="color-grey-9 fl">{datalist&&datalist.course_name}</Link>
<Link to={"/courses/"+courseId+"/students"} className="color-grey-9 fl">{datalist&&datalist.course_name}</Link>
<span className="color-grey-9 fl ml3 mr3">&gt;</span>
<Link to={"/courses/"+courseId+"/graduation_tasks/"+graduation_id} className="color-grey-9 fl">{datalist&&datalist.graduation_name}</Link>
<span className="color-grey-9 fl ml3 mr3">&gt;</span>

@ -2,7 +2,7 @@ import React,{Component} from "React";
import { Form, Select, Input, Button,Checkbox,Upload,Icon,message,Modal} from "antd";
import {Link} from 'react-router-dom';
import TPMMDEditor from '../../../tpm/challengesnew/TPMMDEditor';
import { WordsBtn,getUrl ,bytesToSize} from 'educoder';
import { WordsBtn,getUrl ,bytesToSize,appendFileSizeToUploadFileAll} from 'educoder';
import axios from 'axios';
import Modals from '../../../modals/Modals';
import '../../css/Courses.css';
@ -105,7 +105,9 @@ class GraduationTasksedit extends Component{
// for(var list of fileList ){
// console.log(fileList)
// }
this.setState({ fileList });
this.setState({
fileList: appendFileSizeToUploadFileAll(fileList),
});
}
// onAttachmentRemove = (file) => {
@ -143,10 +145,10 @@ class GraduationTasksedit extends Component{
}
onAttachmentRemove = (file) => {
debugger
this.cancelAttachment();
// const url = `/attachments/${file.response ? file.response.id : file.uid}.json`
const url = `/attachments/${file}.json`
const url = `/attachments/${file.response ? file.response.id : file.uid}.json`
// const url = `/attachments/${file}.json`
axios.delete(url, {
})
.then((response) => {
@ -281,7 +283,7 @@ class GraduationTasksedit extends Component{
width: 600,
// https://github.com/ant-design/ant-design/issues/15505
// showUploadList={false},然后外部拿到 fileList 数组自行渲染列表。
showUploadList: false,
// showUploadList: false,
action: `${getUrl()}/api/attachments.json`,
onChange: this.handleChange,
onRemove: this.onAttachmentRemove,
@ -414,12 +416,7 @@ class GraduationTasksedit extends Component{
)}
</Form.Item>
<input type="hidden" id='descriptiontypes' />
<Upload {...uploadProps} fileList={this.state.fileList} className="upload_1 ml5">
<Button className="uploadBtn">
<Icon type="upload" /> 上传附件
</Button>
(单个文件150M以内)
</Upload>
{attachments&&attachments.map((item,key)=>{
return(
@ -448,37 +445,43 @@ class GraduationTasksedit extends Component{
</div>
)
})}
<style>
{
`
.maxwidth500{
max-width:500px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
color: #05101a;
}
`
}
</style>
{this.state.fileList.length===0?"":this.state.fileList.map((item,key)=>{
return(
<p className="color-grey mt10" key={key} >
<a className="color-grey fl">
<i className="font-14 color-green iconfont icon-fujian mr8" aria-hidden="true"></i>
</a>
<span className="mr12 color9B9B maxwidth500 fl" length="58">
{item.name}
</span>
<span className="color656565 mt2 color-grey-6 font-12 mr8">
{item.response===undefined?"":bytesToSize(item.size)}
</span>
<i className="font-14 iconfont icon-guanbi "
id={item.response===undefined?"":item.response.id}
aria-hidden="true" onClick={()=>this.onAttachmentRemove(item.response===undefined?"":item.response.id&&item.response.id)}></i>
</p>
)
})}
<Upload {...uploadProps} fileList={this.state.fileList} className="upload_1 ml5">
<Button className="uploadBtn">
<Icon type="upload" /> 上传附件
</Button>
(单个文件150M以内)
</Upload>
{/*<style>*/}
{/*{*/}
{/*`*/}
{/*.maxwidth500{*/}
{/*max-width:500px;*/}
{/*overflow: hidden;*/}
{/*text-overflow: ellipsis;*/}
{/*white-space: nowrap;*/}
{/*color: #05101a;*/}
{/*}*/}
{/*`*/}
{/*}*/}
{/*</style>*/}
{/*{this.state.fileList.length===0?"":this.state.fileList.map((item,key)=>{*/}
{/*return(*/}
{/*<p className="color-grey mt10" key={key} >*/}
{/*<a className="color-grey fl">*/}
{/*<i className="font-14 color-green iconfont icon-fujian mr8" aria-hidden="true"></i>*/}
{/*</a>*/}
{/*<span className="mr12 color9B9B maxwidth500 fl" length="58">*/}
{/*{item.name}*/}
{/*</span>*/}
{/*<span className="color656565 mt2 color-grey-6 font-12 mr8">*/}
{/*{item.response===undefined?"":bytesToSize(item.size)}*/}
{/*</span>*/}
{/*<i className="font-14 iconfont icon-guanbi "*/}
{/*id={item.response===undefined?"":item.response.id}*/}
{/*aria-hidden="true" onClick={()=>this.onAttachmentRemove(item.response===undefined?"":item.response.id&&item.response.id)}></i>*/}
{/*</p>*/}
{/*)*/}
{/*})}*/}
{/*{attachments&&attachments.map((item,key)=>{*/}
{/*return(*/}

@ -2,7 +2,7 @@ import React, {Component} from "React";
import {Form, Select, Input, Button, Checkbox, Upload, Icon, message, Modal} from "antd";
import {Link} from 'react-router-dom';
import TPMMDEditor from '../../../tpm/challengesnew/TPMMDEditor';
import {WordsBtn, getUrl,bytesToSize} from 'educoder';
import {WordsBtn, getUrl,bytesToSize,appendFileSizeToUploadFileAll} from 'educoder';
import axios from 'axios';
import Modals from '../../../modals/Modals';
import '../../css/Courses.css';
@ -130,7 +130,9 @@ class GraduationTasksnew extends Component {
// for(var list of fileList ){
// console.log(list)
// }
this.setState({fileList});
this.setState({
fileList: appendFileSizeToUploadFileAll(fileList),
});
}
// onAttachmentRemove = (file) => {
@ -167,8 +169,8 @@ class GraduationTasksnew extends Component {
}
onAttachmentRemove = (file) => {
// const url = `/attachments/${file.response ? file.response.id : file.uid}.json`
const url = `/attachments/${file}.json`
const url = `/attachments/${file.response ? file.response.id : file.uid}.json`
// const url = `/attachments/${file}.json`
axios.delete(url, {})
.then((response) => {
if (response.data) {
@ -257,7 +259,7 @@ class GraduationTasksnew extends Component {
multiple: true,
// https://github.com/ant-design/ant-design/issues/15505
// showUploadList={false},然后外部拿到 fileList 数组自行渲染列表。
showUploadList: false,
// showUploadList: false,
action: `${getUrl()}/api/attachments.json`,
onChange: this.handleChange,
onRemove: this.onAttachmentRemove,
@ -423,6 +425,15 @@ class GraduationTasksnew extends Component {
)}
</Form.Item>
<input type="hidden" id='descriptiontypes'/>
<style>
{
`
.upload_1 .ant-upload-list{
width: 560px;
}
`
}
</style>
<Upload {...uploadProps} className="upload_1 ml5">
<Button className="uploadBtn">
<Icon type="upload"/> 上传附件
@ -430,37 +441,25 @@ class GraduationTasksnew extends Component {
(单个文件150M以内)
</Upload>
<style>
{
`
.maxwidth500{
max-width:500px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
color: #05101a;
}
`
}
</style>
{this.state.fileList.length===0?"":this.state.fileList.map((item,key)=>{
return(
<p className="color-grey mt10" key={key} >
<a className="color-grey fl">
<i className="font-14 color-green iconfont icon-fujian mr8" aria-hidden="true"></i>
</a>
<span className="mr12 color9B9B maxwidth500 fl" length="58">
{item.name}
</span>
<span className="color656565 mt2 color-grey-6 font-12 mr8">
{item.response===undefined?"":bytesToSize(item.size)}
</span>
<i className="font-14 iconfont icon-guanbi "
id={item.response===undefined?"":item.response.id}
aria-hidden="true" onClick={()=>this.onAttachmentRemove(item.response===undefined?"":item.response.id&&item.response.id)}></i>
</p>
)
})}
{/*{this.state.fileList.length===0?"":this.state.fileList.map((item,key)=>{*/}
{/*return(*/}
{/*<p className="color-grey mt10" key={key} >*/}
{/*<a className="color-grey fl">*/}
{/*<i className="font-14 color-green iconfont icon-fujian mr8" aria-hidden="true"></i>*/}
{/*</a>*/}
{/*<span className="mr12 color9B9B maxwidth500 fl" length="58">*/}
{/*{item.name}*/}
{/*</span>*/}
{/*<span className="color656565 mt2 color-grey-6 font-12 mr8">*/}
{/*{item.response===undefined?"":bytesToSize(item.size)}*/}
{/*</span>*/}
{/*<i className="font-14 iconfont icon-guanbi "*/}
{/*id={item.response===undefined?"":item.response.id}*/}
{/*aria-hidden="true" onClick={()=>this.onAttachmentRemove(item.response===undefined?"":item.response.id&&item.response.id)}></i>*/}
{/*</p>*/}
{/*)*/}
{/*})}*/}
</div>

@ -32,6 +32,7 @@ const dataSource = [{
}];
const buildColumns = (that) => {
const { course_groups } = that.state
const columns=[{
title: '序号',
dataIndex: 'id',
@ -72,14 +73,17 @@ const buildColumns = (that) => {
return <span className="color-dark overflowHidden1"
style={{maxWidth: '110px'}} >{student_id}</span>
}
}, {
title: '分班',
dataIndex: 'course_group_name',
key: 'course_group_name',
align:'center',
width:"50%",
className:"color-grey-6"
}];
if (course_groups && course_groups.length) {
columns.push({
title: '分班',
dataIndex: 'course_group_name',
key: 'course_group_name',
align:'center',
width:"50%",
className:"color-grey-6"
})
}
const isAdminOrStudent = that.props.isAdminOrStudent()
if (!isAdminOrStudent) {
columns.some((item,key)=> {
@ -458,9 +462,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
@ -621,12 +625,18 @@ class studentsList extends Component{
}
</ul>
</li>}
<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>
{currentOrderName}
{ course_groups && !!course_groups.length &&
<React.Fragment>
<i className="iconfont icon-xiajiantou font-12 ml2"></i>
<ul className="drop_down_normal" style={{width: '124px'}}>
<li onClick={() => this.onSortTypeChange(ORDER_BY_NUM)} >学生学号排序</li>
<li onClick={() => this.onSortTypeChange(ORDER_BY_GROUP)} >分班名称排序</li>
</ul>
</React.Fragment>
}
</li>
</div>
</div>

@ -174,7 +174,7 @@ function buildColumns(that) {
},
})
}
if(isAdmin && hasGraduationModule) {
if(isAdminOrTeacher && hasGraduationModule) {
columns.unshift({
title: '',
dataIndex: 'course_member_id',
@ -594,7 +594,7 @@ class studentsList extends Component{
`}</style>
<div className="mt20 edu-back-white padding20 teacherList">
<div className="clearfix stu_head" style={{paddingLeft: '15px'}}>
{ isAdmin && hasGraduationModule && <Checkbox className="fl" onChange={this.onCheckAll} checked={checkAllValue} >已选 {checkBoxValues.length} </Checkbox> }
{ isAdminOrTeacher && hasGraduationModule && <Checkbox className="fl" onChange={this.onCheckAll} checked={checkAllValue} >已选 {checkBoxValues.length} </Checkbox> }
{ <div className="studentList_operation_ul">
{ hasGraduationModule && isAdminOrTeacher && <li className="li_line drop_down">
加入答辩组<i className="iconfont icon-xiajiantou font-12 ml2"></i>

@ -645,8 +645,12 @@ class ShixunStudentWork extends Component {
<span className={"startfont"}>
正在执行查重请稍后刷新页面查看结果 温馨提示执行时间因查重作品数以及作品的代码量而异
</span>
<NoneData></NoneData>
</li>
<div className="justify break_full_word new_li edu-back-white" style={{minHeight: '480px',display:duplicatechecking===true?"":"none"}}>
<NoneData></NoneData>
</div>
<style>
{`
.newbutton{

@ -878,6 +878,7 @@ class ShixunHomework extends Component{
if(response.data&&response.data){
this.setState({
course_modules:response.data,
homework_categorys:response.data.homework_category
})
}
}
@ -1128,19 +1129,31 @@ class ShixunHomework extends Component{
<Input placeholder="搜索" value={this.state.dirSearchValue} onChange={(e) => {this.setState({dirSearchValue: e.target.value})}}/>
</p> }
{/*{course_modules&&course_modules.main_category.map((item,key)=>{*/}
{/*return(*/}
{/*<li key={key} id={item.main_category_id} onClick={() => this.moveTos(item.main_category_id)}>{item.main_category_name}</li>*/}
{/*)*/}
{/*})}*/}
{course_modules&&course_modules.main_category.map((item,key)=>{
return(
datas&&datas.category_id===null?datas.main_category_id===item.main_category_id?"":<li key={key} id={item.main_category_id} onClick={() => this.moveTos(item.main_category_id)}>{item.main_category_name}</li>:""
)
})}
{ course_modules&&course_modules.homework_category.filter((item)=> {
{ course_modules&&course_modules.homework_category.filter((item,key)=> {
return (!this.state.dirSearchValue || item.category_name.indexOf(this.state.dirSearchValue) != -1)
}).map( (item,key) => {
return <li key={key} id={item.category_id} onClick={() => this.moveTos(item.category_id )}>{item.category_name}</li>
})}
return
datas&&datas.category_id!=null?datas.category_id===item.category_id?"":<li key={key} id={item.category_id} onClick={() => this.moveTos(item.category_id )}>{item.category_name}</li>:""
})}
<style>
{`
.courseSecond{
margin-left: 10px;
padding: 10px;
}
`}
</style>
{course_modules&&course_modules.homework_category.length===0?
<div className={"courseSecond"}>暂无数据</div>:""}
{/*{course_modules&&course_modules.homework_category.map((item,key)=>{*/}
{/*return(*/}

Loading…
Cancel
Save