dev_forum
杨树明 6 years ago
parent e2d8bbea66
commit 321e902baf

@ -613,7 +613,7 @@ class Selectsetting extends Component{
{item.name} {item.name}
</span> </span>
<span className="color656565 mt2 color-grey-6 font-12 mr8"> <span className="color656565 mt2 color-grey-6 font-12 mr8">
{item.response===undefined?"":isNaN(this.props.bytesToSize(item.response.filesize))?"":this.props.bytesToSize(item.response.filesize)} {item.response===undefined?"":isNaN(this.props.bytesToSize(item.response.filesize))?"123":this.props.bytesToSize(item.response.filesize)}
</span> </span>
<i className="font-14 iconfont icon-guanbi " <i className="font-14 iconfont icon-guanbi "
id={item.response===undefined?"":item.response.id} id={item.response===undefined?"":item.response.id}

@ -2,7 +2,7 @@ import React,{Component} from "React";
import { Form, Select, Input, Button,Checkbox,Upload,Icon,message,Modal,Spin,Tooltip} from "antd"; import { Form, Select, Input, Button,Checkbox,Upload,Icon,message,Modal,Spin,Tooltip} 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 } from 'educoder'; import { WordsBtn,getUrl ,bytesToSize} from 'educoder';
import axios from 'axios'; import axios from 'axios';
import Modals from '../../../modals/Modals'; import Modals from '../../../modals/Modals';
const Search = Input.Search; const Search = Input.Search;
@ -577,7 +577,7 @@ class GraduationTasksSubmitedit extends Component{
{item.name} {item.name}
</span> </span>
<span className="color656565 mt2 color-grey-6 font-12 mr8"> <span className="color656565 mt2 color-grey-6 font-12 mr8">
{item.response===undefined?"":isNaN(this.props.bytesToSize(item.response.filesize))?"":this.props.bytesToSize(item.response.filesize)} {item.response===undefined?"":bytesToSize(item.size)}
</span> </span>
<i className="font-14 iconfont icon-guanbi " <i className="font-14 iconfont icon-guanbi "
id={item.response===undefined?"":item.response.id} id={item.response===undefined?"":item.response.id}

@ -2,7 +2,7 @@ import React,{Component} from "React";
import { Form, Select, Input, Button,Checkbox,Upload,Icon,message,Modal,Tooltip,Spin} from "antd"; import { Form, Select, Input, Button,Checkbox,Upload,Icon,message,Modal,Tooltip,Spin} 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,getImageUrl} from 'educoder'; import { WordsBtn,getUrl,getImageUrl,bytesToSize} from 'educoder';
import axios from 'axios'; import axios from 'axios';
import Modals from '../../../modals/Modals'; import Modals from '../../../modals/Modals';
const Search = Input.Search; const Search = Input.Search;
@ -263,7 +263,7 @@ class GraduationTasksSubmitnew extends Component{
} }
deleteAttachment = (file) => { deleteAttachment = (file) => {
const url = `/attachments/${file.response ? file.response.id : file.uid}.json` const url = `/attachments/${file}.json`
axios.delete(url, { axios.delete(url, {
}) })
.then((response) => { .then((response) => {
@ -446,7 +446,7 @@ render(){
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,
@ -545,7 +545,39 @@ render(){
</Button> </Button>
<span className={"color-grey-9"}>(单个文件150M以内)</span> <span className={"color-grey-9"}>(单个文件150M以内)</span>
</Upload> </Upload>
</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>
)
})}
</div>

@ -258,7 +258,7 @@ class GraduationTasksappraise extends Component{
</div> </div>
<div className="color-grey" key={key}> <div className="color-grey">
{firelistdata===undefined?"":firelistdata.length===0?"":firelistdata.revise_attachments.map((item,key)=>{ {firelistdata===undefined?"":firelistdata.length===0?"":firelistdata.revise_attachments.map((item,key)=>{
return( return(

@ -317,73 +317,59 @@ class GraduationTaskssettingapp extends Component{
} }
funcrosscomment=(e)=>{ funcrosscomment=(e)=>{
let {latetime,end_time}=this.state;
let {latetime,end_time,allowlate}=this.state;
let newtime; let newtime;
if(latetime!=null&&end_time!=null){ if(e.target.checked===true){
if(e.target.checked===true){ if(allowlate===1||allowlate===true){
if(moment(latetime)>moment(end_time)){ if(latetime===null||latetime===""){
newtime=moment(latetime)+604800000; let newlatetime=moment(new Date()).add(7, 'days').format("YYYY-MM-DD HH:mm");
newtime=new Date(newtime) let newcommenttime=moment(new Date()).format("YYYY-MM-DD HH:mm");
}else if(moment(latetime)<moment(end_time)){ this.setState({
newtime=moment(end_time)+604800000; latetime:newlatetime,
newtime=new Date(newtime) crosscomment:e.target.checked,
} commenttime:newcommenttime
})
}else{
let newlatetime=moment(latetime).add(7, 'days').format("YYYY-MM-DD HH:mm");
let newcommenttime=moment(latetime).format("YYYY-MM-DD HH:mm");
this.setState({
latetime:newlatetime,
crosscomment:e.target.checked,
commenttime:newcommenttime
})
}
}else{
if(end_time===null||end_time===""){
let newend_time=moment(new Date()).add(7, 'days').format("YYYY-MM-DD HH:mm");
let newcommenttime=moment(new Date()).add(8, 'days').format("YYYY-MM-DD HH:mm");
this.setState({
end_time:newend_time,
crosscomment:e.target.checked,
commenttime:newcommenttime
})
}else{
let newend_time=moment(end_time).add(7, 'days').format("YYYY-MM-DD HH:mm");
let newcommenttime=moment(end_time).add(8, 'days').format("YYYY-MM-DD HH:mm");
this.setState({
end_time:newend_time,
crosscomment:e.target.checked,
commenttime:newcommenttime
})
}
this.setState({ }
crosscomment:e.target.checked,
commenttime:moment(moment(newtime)).format("YYYY-MM-DD HH:mm"),
})
}else{
this.setState({
crosscomment:e.target.checked,
commenttime:undefined
})
}
}else if(latetime===null&&end_time!=null){ }else{
if(e.target.checked===true){ this.setState({
newtime=moment(end_time)+604800000; crosscomment:e.target.checked,
newtime=new Date(newtime) commenttime:undefined
this.setState({ })
crosscomment:e.target.checked, }
commenttime:newtime
})
}else{
this.setState({
crosscomment:e.target.checked,
commenttime:undefined
})
}
}else if(latetime!=null&&end_time===null){
if(e.target.checked===true){
newtime=moment(latetime)+604800000;
newtime=new Date(newtime)
this.setState({
crosscomment:e.target.checked,
commenttime:newtime
})
}else{
this.setState({
crosscomment:e.target.checked,
commenttime:undefined
})
}
}else if(latetime===null&&end_time===null){
if(e.target.checked===true){
newtime=moment(new Date())+604800000;
newtime=new Date(newtime)
this.setState({
crosscomment:e.target.checked,
commenttime:newtime
})
}else{
this.setState({
crosscomment:e.target.checked,
commenttime:undefined
})
}
}
} }
@ -588,7 +574,6 @@ class GraduationTaskssettingapp extends Component{
commenttimetype:false commenttimetype:false
}) })
} }
debugger
if(moment(this.state.commenttime)<moment(publish_time)){ if(moment(this.state.commenttime)<moment(publish_time)){
this.setState({ this.setState({
commenttimetype:true, commenttimetype:true,

@ -7,7 +7,7 @@
width:237px!important; width:237px!important;
height: 30px; height: 30px;
margin-bottom: 30px; margin-bottom: 30px;
margin-right: 35px; /*margin-right: 35px;*/
} }
.search-newysl { .search-newysl {
width:237px!important; width:237px!important;

Loading…
Cancel
Save