|
|
@ -7,41 +7,33 @@ import CoursesListType from '../coursesPublic/CoursesListType'
|
|
|
|
import { WordsBtn } from 'educoder'
|
|
|
|
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 LoginDialog from '../../login/LoginDialog';
|
|
|
|
|
|
|
|
import axios from 'axios'
|
|
|
|
import axios from 'axios'
|
|
|
|
class CommonWorkItem extends Component{
|
|
|
|
class CommonWorkItem extends Component{
|
|
|
|
constructor(props){
|
|
|
|
constructor(props){
|
|
|
|
super(props);
|
|
|
|
super(props);
|
|
|
|
this.state = {
|
|
|
|
this.state = {
|
|
|
|
aModalVisible: false,
|
|
|
|
aModalVisible: false
|
|
|
|
isRender:false,
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
onItemClick = (item) => {
|
|
|
|
onItemClick = (item) => {
|
|
|
|
// console.log("onItemClick");
|
|
|
|
|
|
|
|
// console.log(this.props);
|
|
|
|
if(this.props.checkIfLogin()===false){
|
|
|
|
try {
|
|
|
|
this.props.showLoginDialog()
|
|
|
|
if(this.props.current_user.username==="游客"){
|
|
|
|
return
|
|
|
|
this.setState({
|
|
|
|
}
|
|
|
|
isRender:true,
|
|
|
|
|
|
|
|
match:"",
|
|
|
|
if(this.props.checkIfProfileCompleted()===false){
|
|
|
|
});
|
|
|
|
this.props.showProfileCompleteDialog()
|
|
|
|
return
|
|
|
|
return
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}catch (e) {
|
|
|
|
|
|
|
|
}
|
|
|
|
const isStudent = this.props.isStudent()
|
|
|
|
const isStudent = this.props.isStudent()
|
|
|
|
|
|
|
|
if (isStudent) {
|
|
|
|
if (isStudent) {
|
|
|
|
this.props.toWorkQuestionPage(this.props.match.params, item.homework_id)
|
|
|
|
this.props.toWorkQuestionPage(this.props.match.params, item.homework_id)
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
this.props.toWorkListPage(this.props.match.params, item.homework_id)
|
|
|
|
this.props.toWorkListPage(this.props.match.params, item.homework_id)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
}
|
|
|
|
Modifyloginvalue=()=>{
|
|
|
|
|
|
|
|
this.setState({
|
|
|
|
|
|
|
|
isRender:false,
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
sendMoreAttachment = (item) => {
|
|
|
|
sendMoreAttachment = (item) => {
|
|
|
|
this.handleItem = item;
|
|
|
|
this.handleItem = item;
|
|
|
|
const url = `/student_works/${item.work_id}/supply_attachments.json`
|
|
|
|
const url = `/student_works/${item.work_id}/supply_attachments.json`
|
|
|
@ -123,7 +115,7 @@ class CommonWorkItem extends Component{
|
|
|
|
|
|
|
|
|
|
|
|
render(){
|
|
|
|
render(){
|
|
|
|
let { mainList,workType }=this.props;
|
|
|
|
let { mainList,workType }=this.props;
|
|
|
|
const { aModalVisible, fileList, revise_reason,isRender } = this.state
|
|
|
|
const { aModalVisible, fileList, revise_reason } = this.state
|
|
|
|
let coursesId = this.props.match.params.coursesId;
|
|
|
|
let coursesId = this.props.match.params.coursesId;
|
|
|
|
|
|
|
|
|
|
|
|
const isStudent = this.props.isStudent()
|
|
|
|
const isStudent = this.props.isStudent()
|
|
|
@ -138,11 +130,6 @@ class CommonWorkItem extends Component{
|
|
|
|
fileList={fileList}
|
|
|
|
fileList={fileList}
|
|
|
|
description={revise_reason}
|
|
|
|
description={revise_reason}
|
|
|
|
></AccessoryModal2> */}
|
|
|
|
></AccessoryModal2> */}
|
|
|
|
{isRender===true?<LoginDialog
|
|
|
|
|
|
|
|
Modifyloginvalue={()=>this.Modifyloginvalue()}
|
|
|
|
|
|
|
|
{...this.props}
|
|
|
|
|
|
|
|
{...this.state}
|
|
|
|
|
|
|
|
/>:""}
|
|
|
|
|
|
|
|
<style>
|
|
|
|
<style>
|
|
|
|
{
|
|
|
|
{
|
|
|
|
`
|
|
|
|
`
|
|
|
@ -152,9 +139,6 @@ class CommonWorkItem extends Component{
|
|
|
|
text-overflow: ellipsis;
|
|
|
|
text-overflow: ellipsis;
|
|
|
|
white-space: nowrap;
|
|
|
|
white-space: nowrap;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
.commonworkitemA{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
`
|
|
|
|
`
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</style>
|
|
|
|
</style>
|
|
|
@ -171,23 +155,15 @@ class CommonWorkItem extends Component{
|
|
|
|
}
|
|
|
|
}
|
|
|
|
<div className="flex1" onClick={() => this.props.onItemClick(Object.assign({}, item, {id: item.homework_id})) }>
|
|
|
|
<div className="flex1" onClick={() => this.props.onItemClick(Object.assign({}, item, {id: item.homework_id})) }>
|
|
|
|
<p className="clearfix mb20">
|
|
|
|
<p className="clearfix mb20">
|
|
|
|
<style>
|
|
|
|
<Tooltip title={ canNotLink ? "私有属性,非课堂成员不能访问" : item.name} placement="bottom" >
|
|
|
|
{
|
|
|
|
<span className="fl font-16 font-bd mt2 comnonwidth580 pointer" style={{cursor: canNotLink ? 'poninter' : 'poninter'}}
|
|
|
|
`
|
|
|
|
onClick={ canNotLink ? () => {} : () => this.onItemClick(item)}
|
|
|
|
.commonworkitemA{
|
|
|
|
>{item.name}</span>
|
|
|
|
}
|
|
|
|
</Tooltip>
|
|
|
|
`
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
</style>
|
|
|
|
|
|
|
|
<a title={item.name}
|
|
|
|
|
|
|
|
className="fl font-16 font-bd mt2 comnonwidth580" style={{cursor: canNotLink ? 'default' : 'poninter'}}
|
|
|
|
|
|
|
|
onClick={ canNotLink ? () => {} : () => this.onItemClick(item)}
|
|
|
|
|
|
|
|
>{item.name}</a>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
{/* 只有非课堂成员且作业是私有的情况下才会为true */}
|
|
|
|
{/* 只有非课堂成员且作业是私有的情况下才会为true */}
|
|
|
|
{
|
|
|
|
{
|
|
|
|
item.private_icon===true ?
|
|
|
|
item.private_icon===true ?
|
|
|
|
(<Tooltip title={ isAdminOrStudent ? "私有属性" : "私有属性,非课堂成员不能访问"}>
|
|
|
|
(<Tooltip title={ isAdminOrStudent ? "私有属性" : "私有属性,非课堂成员不能访问"} placement="bottom" >
|
|
|
|
<i className="iconfont icon-guansuo color-grey-c ml10 font-16 fl"></i>
|
|
|
|
<i className="iconfont icon-guansuo color-grey-c ml10 font-16 fl"></i>
|
|
|
|
</Tooltip>) : ""
|
|
|
|
</Tooltip>) : ""
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -217,7 +193,7 @@ class CommonWorkItem extends Component{
|
|
|
|
{item.uncommit_count===undefined?"":<span className="mr20 fl">{item.uncommit_count} 未交</span>}
|
|
|
|
{item.uncommit_count===undefined?"":<span className="mr20 fl">{item.uncommit_count} 未交</span>}
|
|
|
|
{
|
|
|
|
{
|
|
|
|
item.status_time!="" &&
|
|
|
|
item.status_time!="" &&
|
|
|
|
<Tooltip title={ item.status.indexOf('提交中') != -1 ? '提交剩余时间' :
|
|
|
|
<Tooltip placement="bottom" title={ item.status.indexOf('提交中') != -1 ? '提交剩余时间' :
|
|
|
|
item.status.indexOf('补交中') != -1 ? '补交剩余时间' :
|
|
|
|
item.status.indexOf('补交中') != -1 ? '补交剩余时间' :
|
|
|
|
item.status.indexOf('申诉中') != -1 ? '申诉剩余时间' :
|
|
|
|
item.status.indexOf('申诉中') != -1 ? '申诉剩余时间' :
|
|
|
|
item.status.indexOf('匿评中') != -1 ? '匿评剩余时间' :
|
|
|
|
item.status.indexOf('匿评中') != -1 ? '匿评剩余时间' :
|
|
|
|