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

@ -613,7 +613,7 @@ class Selectsetting extends Component{
{item.name}
</span>
<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>
<i className="font-14 iconfont icon-guanbi "
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 {Link} from 'react-router-dom';
import TPMMDEditor from '../../../tpm/challengesnew/TPMMDEditor';
import { WordsBtn,getUrl } from 'educoder';
import { WordsBtn,getUrl ,bytesToSize} from 'educoder';
import axios from 'axios';
import Modals from '../../../modals/Modals';
const Search = Input.Search;
@ -577,7 +577,7 @@ class GraduationTasksSubmitedit extends Component{
{item.name}
</span>
<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>
<i className="font-14 iconfont icon-guanbi "
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 {Link} from 'react-router-dom';
import TPMMDEditor from '../../../tpm/challengesnew/TPMMDEditor';
import { WordsBtn,getUrl,getImageUrl} from 'educoder';
import { WordsBtn,getUrl,getImageUrl,bytesToSize} from 'educoder';
import axios from 'axios';
import Modals from '../../../modals/Modals';
const Search = Input.Search;
@ -263,7 +263,7 @@ class GraduationTasksSubmitnew extends Component{
}
deleteAttachment = (file) => {
const url = `/attachments/${file.response ? file.response.id : file.uid}.json`
const url = `/attachments/${file}.json`
axios.delete(url, {
})
.then((response) => {
@ -446,7 +446,7 @@ render(){
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,
@ -545,7 +545,39 @@ render(){
</Button>
<span className={"color-grey-9"}>(单个文件150M以内)</span>
</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 className="color-grey" key={key}>
<div className="color-grey">
{firelistdata===undefined?"":firelistdata.length===0?"":firelistdata.revise_attachments.map((item,key)=>{
return(

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

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

Loading…
Cancel
Save