杨树林 6 years ago
commit 654f9cbc97

@ -8,7 +8,6 @@ import { WordsBtn } from 'educoder'
import AccessoryModal2 from '../coursesPublic/AccessoryModal2' import AccessoryModal2 from '../coursesPublic/AccessoryModal2'
import AccessoryModal from '../coursesPublic/AccessoryModal' import AccessoryModal from '../coursesPublic/AccessoryModal'
import axios from 'axios' import axios from 'axios'
import ConnectProject from './ConnectProject'
class CommonWorkItem extends Component{ class CommonWorkItem extends Component{
constructor(props){ constructor(props){
super(props); super(props);
@ -128,7 +127,7 @@ class CommonWorkItem extends Component{
} }
</style> </style>
{ {
mainList && mainList.homeworks.length>0 && mainList.homeworks.map((item,index)=>{ mainList && mainList.homeworks && mainList.homeworks.length>0 && mainList.homeworks.map((item,index)=>{
let canNotLink = !isAdminOrStudent && item.private_icon == true let canNotLink = !isAdminOrStudent && item.private_icon == true
return( return(
<div className="mt20 edu-back-white padding02010" key={index} > <div className="mt20 edu-back-white padding02010" key={index} >
@ -196,7 +195,7 @@ class CommonWorkItem extends Component{
<li className="fr"> <li className="fr">
{ // { //
item.work_status && item.work_status.indexOf('关联项目') != -1 && item.work_status && item.work_status.indexOf('关联项目') != -1 &&
<ConnectProject className="fl" {...this.props} work={item}></ConnectProject> <WordsBtn style="blue" className={` font-16 fl}`} onClick={() => this.props.openConnectionProject(item)}>关联项目</WordsBtn>
} }
{ // { //
item.work_status && item.work_status.indexOf('提交作品') != -1 && item.work_status && item.work_status.indexOf('提交作品') != -1 &&

@ -47,9 +47,14 @@ function buildColumns(that, student_works) {
} }
let courseId= that.props.match.params.coursesId; let courseId= that.props.match.params.coursesId;
let workId= that.props.match.params.workId; let workId= that.props.match.params.workId;
const { course_group_count } = that.state; const { course_group_count, homework_status } = that.state;
const isAdmin = that.props.isAdmin() const isAdmin = that.props.isAdmin()
const isAdminOrStudent = that.props.isAdminOrStudent() const isAdminOrStudent = that.props.isAdminOrStudent()
const isStudent = that.props.isStudent()
const isNiPing = homework_status.indexOf('匿评中') != -1
// https://www.trustie.net/issues/21450 分组作业作品列表 学时视角,匿评阶段的列表显示信息不正确
const niPingAndIsStudent = isStudent && isNiPing
let columns = [{ let columns = [{
width: 60, width: 60,
title: '序号', title: '序号',
@ -76,7 +81,9 @@ function buildColumns(that, student_works) {
{text} {text}
</div> </div>
), ),
}, { }]
if (!niPingAndIsStudent) {
columns.push({
width: 180, width: 180,
title: '学号', title: '学号',
dataIndex: 'student_id', dataIndex: 'student_id',
@ -87,10 +94,11 @@ function buildColumns(that, student_works) {
<a href="javascript:;" style={{color:'#9A9A9A'}}>{record.student_id}</a> <a href="javascript:;" style={{color:'#9A9A9A'}}>{record.student_id}</a>
</span> </span>
), ),
}] })
}
// TODO 只有有分班时才显示分班列 // TODO 只有有分班时才显示分班列
if (course_group_count != 0) { if (course_group_count != 0 && !niPingAndIsStudent) {
columns.push( { columns.push( {
title: '分班', title: '分班',
key: 'group_name', key: 'group_name',
@ -103,7 +111,7 @@ function buildColumns(that, student_works) {
), ),
} ) } )
} }
if (gotWorkGroup) { if (gotWorkGroup && !niPingAndIsStudent) {
columns.push({ columns.push({
width: 72, width: 72,
title: '分组', title: '分组',
@ -154,7 +162,9 @@ function buildColumns(that, student_works) {
<a href="javascript:;" style={{color:'#989898'}}>{update_time ? moment(update_time).format('YYYY-MM-DD hh:mm') : '--'}</a> <a href="javascript:;" style={{color:'#989898'}}>{update_time ? moment(update_time).format('YYYY-MM-DD hh:mm') : '--'}</a>
</span> </span>
), ),
}, { }])
if (!niPingAndIsStudent) {
columns.push({
width: 72, width: 72,
title: '教师评分', title: '教师评分',
key: 'teacher_score', key: 'teacher_score',
@ -168,7 +178,9 @@ function buildColumns(that, student_works) {
</span> </span>
</Tooltip> </Tooltip>
), ),
}, { })
columns.push({
width: 72, width: 72,
title: '助教评分', title: '助教评分',
key: 'teaching_asistant_score', key: 'teaching_asistant_score',
@ -192,7 +204,10 @@ function buildColumns(that, student_works) {
</Tooltip> } </Tooltip> }
</span> </span>
), ),
}]) })
}
if (that.state.anonymous_comment) { if (that.state.anonymous_comment) {
/** /**
@ -242,7 +257,7 @@ function buildColumns(that, student_works) {
), ),
}) })
} }
if (!niPingAndIsStudent) {
columns.push({ columns.push({
width: 72, width: 72,
title: '最终成绩', title: '最终成绩',
@ -272,6 +287,7 @@ function buildColumns(that, student_works) {
) )
}, },
}) })
}
if (isAdminOrStudent || that.props.work_public == true) { if (isAdminOrStudent || that.props.work_public == true) {
columns.push({ columns.push({
width: 92, width: 92,

@ -5,6 +5,7 @@ import '../css/members.css'
import { WordsBtn } from 'educoder' import { WordsBtn } from 'educoder'
import axios from 'axios' import axios from 'axios'
import InfiniteScroll from 'react-infinite-scroller'; import InfiniteScroll from 'react-infinite-scroller';
import NoneData from "../coursesPublic/NoneData"
const Search =Input.Search; const Search =Input.Search;
const LIMIT = 15 const LIMIT = 15
@ -36,7 +37,7 @@ class ConnectProject extends Component{
this.connectProject(radioValue) this.connectProject(radioValue)
} }
connectProject = (project_id) => { connectProject = (project_id) => {
let workId=this.props.work.homework_id; let workId=this.work.homework_id;
const url = `/homework_commons/${workId}/student_works/relate_project.json` const url = `/homework_commons/${workId}/student_works/relate_project.json`
axios.post(url, { axios.post(url, {
project_id: project_id project_id: project_id
@ -75,6 +76,9 @@ class ConnectProject extends Component{
loading: false, loading: false,
hasMore: result.data.projects.length != 0 hasMore: result.data.projects.length != 0
}) })
if (page == 1) {
this.setState({ haveProjects: result.data.projects.length > 0 })
}
} }
}).catch((error)=>{ }).catch((error)=>{
console.log(error); console.log(error);
@ -84,11 +88,12 @@ class ConnectProject extends Component{
if (window.location.port == 3007) { if (window.location.port == 3007) {
window.location.href = '/testbdweb.educoder.net/projects/new' window.location.href = '/testbdweb.educoder.net/projects/new'
} else { } else {
window.location.href = '/educoder.net/projects/new' window.location.href = '/projects/new'
} }
} }
//关联项目 //关联项目
openConnectionProject=()=>{ openConnectionProject=(work)=>{
this.work = work;
this.fetchData() this.fetchData()
this.setState({ this.setState({
project_flag:true project_flag:true
@ -104,10 +109,9 @@ class ConnectProject extends Component{
} }
render(){ render(){
let {project_flag, projects, loading, hasMore }=this.state; let {project_flag, projects, loading, hasMore, haveProjects }=this.state;
return( return(
<React.Fragment> <React.Fragment>
<WordsBtn style="blue" className={` font-16 ${this.props.className || ''}`} onClick={this.openConnectionProject}>关联项目</WordsBtn>
<Modal <Modal
visible={project_flag} visible={project_flag}
title="关联项目" title="关联项目"
@ -120,7 +124,7 @@ class ConnectProject extends Component{
> >
<div className="newupload_conbox clearfix"> <div className="newupload_conbox clearfix">
{ {
projects && !!projects.length && (projects && !!projects.length || this.state.keyword) &&
<div> <div>
<Search placeholder="请输入项目名称进行搜索" className="with100" <Search placeholder="请输入项目名称进行搜索" className="with100"
value={this.state.keyword} onInput={(e) => {this.setState({keyword: e.target.value})}} value={this.state.keyword} onInput={(e) => {this.setState({keyword: e.target.value})}}
@ -145,7 +149,11 @@ class ConnectProject extends Component{
</div> </div>
} }
{ {
(!projects || projects.length == 0) && haveProjects && projects.length == 0 &&
<NoneData></NoneData>
}
{
(!haveProjects) &&
<div className="edu-txt-center"> <div className="edu-txt-center">
您当前尚未管理任何项目请先<WordsBtn style="blue" className="" onClick={this.toCreateProject}>创建项目</WordsBtn> 您当前尚未管理任何项目请先<WordsBtn style="blue" className="" onClick={this.toCreateProject}>创建项目</WordsBtn>
</div> </div>

@ -9,6 +9,7 @@ import '../css/busyWork.css'
import CoursesListType from '../coursesPublic/CoursesListType' import CoursesListType from '../coursesPublic/CoursesListType'
import CommonWorkItem from './CommonWorkItem' import CommonWorkItem from './CommonWorkItem'
import PublishRightnow from './PublishRightnow' import PublishRightnow from './PublishRightnow'
import ConnectProject from './ConnectProject'
import { WordsBtn } from 'educoder' import { WordsBtn } from 'educoder'
import Modals from '../../modals/Modals' import Modals from '../../modals/Modals'
@ -53,7 +54,9 @@ class commonWork extends Component{
let {page,search,order}=this.state; let {page,search,order}=this.state;
this.getList(page,search,order); this.getList(page,search,order);
} }
openConnectionProject = (work) => {
this.refs['connectProject'].openConnectionProject(work)
}
// 新建 // 新建
createCommonWork=(type)=>{ createCommonWork=(type)=>{
@ -338,6 +341,8 @@ class commonWork extends Component{
</div> </div>
</div> </div>
</div> */} </div> */}
<ConnectProject ref="connectProject" {...this.props}></ConnectProject>
<Titlesearchsection <Titlesearchsection
title={main_category_name} title={main_category_name}
@ -418,12 +423,14 @@ class commonWork extends Component{
<Spin size="large" spinning={this.state.isSpin}> <Spin size="large" spinning={this.state.isSpin}>
<Checkbox.Group style={{"width":"100%"}} onChange={this.onChangeSelect} value={checkBoxValues}> <Checkbox.Group style={{"width":"100%"}} onChange={this.onChangeSelect} value={checkBoxValues}>
<CommonWorkItem mainList={mainList} {...this.props} workType={workType} onItemClick={this.onItemClick}></CommonWorkItem> <CommonWorkItem mainList={mainList} {...this.props} workType={workType} onItemClick={this.onItemClick}
openConnectionProject={this.openConnectionProject}
></CommonWorkItem>
</Checkbox.Group> </Checkbox.Group>
</Spin> </Spin>
{ {
mainList && mainList.homeworks.length==0 && <NoneData></NoneData> mainList && mainList.homeworks && mainList.homeworks.length==0 && <NoneData></NoneData>
} }
{ {

@ -46,9 +46,9 @@ class CCommentItem extends Component{
let { item, commentIndex }=this.props; let { item, commentIndex }=this.props;
const url = `/student_works/${studentWorkId}/cancel_appeal.json` const url = `/student_works/${studentWorkId}/cancel_appeal.json`
axios.post(url, { data: { axios.post(url, {
score_id: item.id score_id: item.id
}}) })
.then((response) => { .then((response) => {
if (response.data.status == 0) { if (response.data.status == 0) {
this.showNotification('撤销成功') this.showNotification('撤销成功')
@ -262,9 +262,21 @@ class CCommentItem extends Component{
return( return(
<div className="ccomment comment_item_cont df clearfix" key={item.id}> <div className="ccomment comment_item_cont df clearfix" key={item.id}>
<div className="J_Comment_Face fl"> <div className="J_Comment_Face fl">
<a href={`${_origin}/users/${item.user_login}`} target="_blank">
<img alt="用户头像" height="50" src={getImageUrl(`images/${item.image_url}`)} width="50"/> {item.image_url == '--' ?
<a href={`javascript:void(0)`} >
<img alt="用户头像" height="50"
src={`${getUrl()}/images/edu_user/anony.png`} width="50"/>
</a> </a>
: <a href={`${_origin}/users/${item.user_login}`} target="_blank">
<img alt="用户头像" height="50"
src={`${getUrl()}/images/${item.image_url}`}
width="50"/>
</a>}
{/* <a href={`${_origin}/users/${item.user_login}`} target="_blank">
<img alt="用户头像" height="50" src={getImageUrl(`images/${item.image_url}`)} width="50"/>
</a> */}
</div> </div>
<div className="t_content fl"> <div className="t_content fl">

@ -358,7 +358,7 @@ class CoursesBanner extends Component {
{ {
coursedata===undefined || coursedata.status===401 || coursedata.status===407?"": coursedata===undefined || coursedata.status===401 || coursedata.status===407?"":
<Tooltip placement="bottom" title={coursedata&&coursedata.name.length<38?"":coursedata.name}> <Tooltip placement="bottom" title={coursedata&&coursedata.name && coursedata.name.length<38?"":coursedata.name}>
<span className="font-24 fl bannername">{coursedata.name}</span> <span className="font-24 fl bannername">{coursedata.name}</span>
</Tooltip> </Tooltip>

@ -105,7 +105,8 @@ function buildColumns(that) {
} }
, ,
}); });
if (that.hasGraduationModule()) { const hasGraduationModule = that.hasGraduationModule()
if (hasGraduationModule) {
columns.push({ columns.push({
title: '答辩组', title: '答辩组',
key: 'graduation_group', key: 'graduation_group',
@ -145,7 +146,7 @@ function buildColumns(that) {
}, },
}) })
} }
if(isAdmin) { if(isAdmin && hasGraduationModule) {
columns.unshift({ columns.unshift({
title: '', title: '',
dataIndex: 'course_member_id', dataIndex: 'course_member_id',
@ -184,7 +185,7 @@ class studentsList extends Component{
searchValue:e.target.value searchValue:e.target.value
}) })
} }
// approval 2 - 拒绝
onAgree = (record, approval = 1) => { onAgree = (record, approval = 1) => {
const courseId = this.props.match.params.coursesId const courseId = this.props.match.params.coursesId
@ -197,7 +198,7 @@ class studentsList extends Component{
}) })
.then((response) => { .then((response) => {
if (response.data.status == 0) { if (response.data.status == 0) {
this.props.showNotification(`${approval ? '同意' : '拒绝'}`) this.props.showNotification(`${approval == 1? '同意' : '拒绝'}`)
this.fetchAll(1) this.fetchAll(1)
} }
}) })
@ -215,14 +216,22 @@ class studentsList extends Component{
}) })
this.fetchAll(1); this.fetchAll(1);
const isAdminOrTeacher = this.props.isAdminOrTeacher() const isAdminOrTeacher = this.props.isAdminOrTeacher()
const isAdmin = this.props.isAdmin()
isAdminOrTeacher && this.getGroupList(); isAdminOrTeacher && this.getGroupList();
this.getCourseGroups(); this.getCourseGroups();
on('addTeacherSuccess', this.addTeacherSuccessListener) on('addTeacherSuccess', this.addTeacherSuccessListener)
isAdmin && on('updateNavSuccess', this.updateNavSuccess)
} }
componentWillUnmount() { componentWillUnmount() {
off('addTeacherSuccess', this.addTeacherSuccessListener) off('addTeacherSuccess', this.addTeacherSuccessListener)
const isAdmin = this.props.isAdmin()
isAdmin && off('updateNavSuccess', this.updateNavSuccess)
}
updateNavSuccess = () => {
this.getCourseGroups()
} }
addTeacherSuccessListener = (e, data) => { addTeacherSuccessListener = (e, data) => {
// const params = JSON.parse(data) // const params = JSON.parse(data)
@ -498,6 +507,7 @@ class studentsList extends Component{
}) })
} }
const isAdminOrTeacher = this.props.isAdminOrTeacher() const isAdminOrTeacher = this.props.isAdminOrTeacher()
const hasGraduationModule = this.hasGraduationModule()
return( return(
<React.Fragment> <React.Fragment>
@ -543,9 +553,9 @@ 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 && <Checkbox className="fl" onChange={this.onCheckAll} checked={checkAllValue} >已选 {checkBoxValues.length} </Checkbox> } { isAdmin && hasGraduationModule && <Checkbox className="fl" onChange={this.onCheckAll} checked={checkAllValue} >已选 {checkBoxValues.length} </Checkbox> }
{ <div className="studentList_operation_ul"> { <div className="studentList_operation_ul">
{ this.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>
<ul className="drop_down_menu" style={{"right":"0px","left":"unset", minWidth: '222px'}}> <ul className="drop_down_menu" style={{"right":"0px","left":"unset", minWidth: '222px'}}>

Loading…
Cancel
Save