杨树林 5 years ago
commit f0c61b69ca

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

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

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

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

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

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

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

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

@ -878,6 +878,7 @@ class ShixunHomework extends Component{
if(response.data&&response.data){ if(response.data&&response.data){
this.setState({ this.setState({
course_modules:response.data, 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})}}/> <Input placeholder="搜索" value={this.state.dirSearchValue} onChange={(e) => {this.setState({dirSearchValue: e.target.value})}}/>
</p> } </p> }
{/*{course_modules&&course_modules.main_category.map((item,key)=>{*/} {course_modules&&course_modules.main_category.map((item,key)=>{
{/*return(*/} return(
{/*<li key={key} id={item.main_category_id} onClick={() => this.moveTos(item.main_category_id)}>{item.main_category_name}</li>*/} 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) return (!this.state.dirSearchValue || item.category_name.indexOf(this.state.dirSearchValue) != -1)
}).map( (item,key) => { }).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)=>{*/} {/*{course_modules&&course_modules.homework_category.map((item,key)=>{*/}
{/*return(*/} {/*return(*/}

Loading…
Cancel
Save