dev_oauth
杨树明 6 years ago
parent 71521968f4
commit a62d58fb21

@ -1,108 +1,108 @@
import React,{ Component } from "react";
import { Modal,Checkbox,Upload,Button,Icon,message,Input} from "antd";
class ModulationModal extends Component{
constructor(props){
super(props);
this.state={
group_ids:[],
fileList:[],
textareaval:undefined,
Inputsval:undefined
}
}
Saves=()=>{
let {textareaval,Inputsval}=this.state;
if(textareaval===""||textareaval===undefined){
this.setState({
textareavaltype:true
})
return
}
this.setState({
textareavaltype: false
})
if(Inputsval===undefined||Inputsval===""){
this.setState({
Inputsvaltype:true
})
return
}
this.props.Saves(textareaval,Inputsval)
}
settextarea=(e)=>{
this.setState({
textareaval:e.target.value
})
}
setInputs=(e)=>{
var value=parseInt(e.target.value)
if(isNaN(value)){
value=0
}else{
if(value<0||value>100){
value=0
}
}
this.setState({
Inputsval:value
})
}
render(){
let {textareaval,Inputsval,textareavaltype,Inputsvaltype}=this.state;
return(
<div>
<Modal
keyboard={false}
className={"HomeworkModal"}
title={this.props.modalname || '调分'}
visible={this.props.visible}
closable={false}
footer={null}
destroyOnClose={true}
>
<div className="task-popup-content">
<p className="task-popup-text-center font-16">
<span className={"color-dark-21"}>该学生的最终成绩将不会按照评分规则进行计算</span>
</p>
<div className="clearfix">
<textarea
className="winput-100-150"
placeholder="请填写您对作品调分的原因"
value={textareaval}
onInput={this.settextarea}
></textarea>
<li style={{height:"20px",lineHeight:"20px"}}><span className={textareavaltype===true?"color-red":"none"}>原因不能为空</span></li>
</div>
<li>
<Input style={{
width: '20%',
}}
placeholder="请填写分数"
value={Inputsval}
onInput={this.setInputs}/> <span className="ml10"></span>
</li>
<li style={{height:"20px",lineHeight:"20px"}}><span className={Inputsvaltype===true?"color-red":"none"}>分数不能为空</span></li>
<div className="clearfix edu-txt-center">
<a className="task-btn color-white mr30" onClick={this.props.Cancel}>{this.props.Cancelname || '取消'}</a>
<a className="task-btn task-btn-orange" onClick={this.Saves}>{this.props.Savesname || '保存'}</a>
</div>
</div>
</Modal>
</div>
)
}
}
import React,{ Component } from "react";
import { Modal,Checkbox,Upload,Button,Icon,message,Input} from "antd";
class ModulationModal extends Component{
constructor(props){
super(props);
this.state={
group_ids:[],
fileList:[],
textareaval:undefined,
Inputsval:undefined
}
}
Saves=()=>{
let {textareaval,Inputsval}=this.state;
if(textareaval===""||textareaval===undefined){
this.setState({
textareavaltype:true
})
return
}
this.setState({
textareavaltype: false
})
if(Inputsval===undefined||Inputsval===""){
this.setState({
Inputsvaltype:true
})
return
}
this.props.Saves(textareaval,Inputsval)
}
settextarea=(e)=>{
this.setState({
textareaval:e.target.value
})
}
setInputs=(e)=>{
var value=parseInt(e.target.value)
if(isNaN(value)){
value=0
}else{
if(value<0||value>100){
value=0
}
}
this.setState({
Inputsval:value
})
}
render(){
let {textareaval,Inputsval,textareavaltype,Inputsvaltype}=this.state;
return(
<div>
<Modal
keyboard={false}
className={"HomeworkModal"}
title={this.props.modalname || '调分'}
visible={this.props.visible}
closable={false}
footer={null}
destroyOnClose={true}
>
<div className="task-popup-content">
<p className="task-popup-text-center font-16 mb20">
<span className={"color-dark-21"}>该学生的最终成绩将不会按照评分规则进行计算</span>
</p>
<div className="clearfix">
<textarea
className="winput-100-150"
placeholder="请填写您对作品调分的原因"
value={textareaval}
onInput={this.settextarea}
></textarea>
<li style={{height:"20px",lineHeight:"20px"}}><span className={textareavaltype===true?"color-red":"none"}>原因不能为空</span></li>
</div>
<li>
<Input style={{
width: '20%',
}}
placeholder="请填写分数"
value={Inputsval}
onInput={this.setInputs}/> <span className="ml10"></span>
</li>
<li style={{height:"20px",lineHeight:"20px"}}><span className={Inputsvaltype===true?"color-red":"none"}>分数不能为空</span></li>
<div className="clearfix edu-txt-center">
<a className="task-btn color-white mr30" onClick={this.props.Cancel}>{this.props.Cancelname || '取消'}</a>
<a className="task-btn task-btn-orange" onClick={this.Saves}>{this.props.Savesname || '保存'}</a>
</div>
</div>
</Modal>
</div>
)
}
}
export default ModulationModal;

@ -2,7 +2,7 @@ import React,{Component} from "React";
import { Form, Select, Input, Button,Checkbox,Upload,Icon,message,Modal} from "antd";
import {Link} from 'react-router-dom';
import TPMMDEditor from '../../../tpm/challengesnew/TPMMDEditor';
import { WordsBtn,getUrl ,bytesToSize,appendFileSizeToUploadFileAll} from 'educoder';
import { WordsBtn,getUrl ,bytesToSize,appendFileSizeToUploadFileAll,AttachmentList} from 'educoder';
import axios from 'axios';
import Modals from '../../../modals/Modals';
import '../../css/Courses.css';
@ -419,35 +419,35 @@ class GraduationTasksedit extends Component{
)}
</Form.Item>
<input type="hidden" id='descriptiontypes' />
<AttachmentList {...this.props} {...this.state} attachments={attachments&&attachments}></AttachmentList>
{/*{attachments&&attachments.map((item,key)=>{*/}
{attachments&&attachments.map((item,key)=>{
return(
<div className="color-grey mt5"
key={key}
>
<a className="color-grey ml3">
<i className="font-14 color-green iconfont icon-fujian mr8" aria-hidden="true"></i>
</a>
<a
href={item.url}
className="mr12 color9B9B" length="58">
{item.title}
</a>
<span className="color656565 mt2 color-grey-6 font-12 mr8">
{item.filesize}
</span>
{item.delete===true?
<i className="font-14 iconfont icon-guanbi "
id={item.id}
onClick={()=>this.onAttachmentRemove(item.id)}
aria-hidden="true">
</i>:""}
</div>
)
})}
{/*return(*/}
{/*<div className="color-grey mt5"*/}
{/*key={key}*/}
{/*>*/}
{/*<a className="color-grey ml3">*/}
{/*<i className="font-14 color-green iconfont icon-fujian mr8" aria-hidden="true"></i>*/}
{/*</a>*/}
{/*<a*/}
{/*href={item.url}*/}
{/*className="mr12 color9B9B" length="58">*/}
{/*{item.title}*/}
{/*</a>*/}
{/*<span className="color656565 mt2 color-grey-6 font-12 mr8">*/}
{/*{item.filesize}*/}
{/*</span>*/}
{/*{item.delete===true?*/}
{/*<i className="font-14 iconfont icon-guanbi "*/}
{/*id={item.id}*/}
{/*onClick={()=>this.onAttachmentRemove(item.id)}*/}
{/*aria-hidden="true">*/}
{/*</i>:""}*/}
{/*</div>*/}
{/*)*/}
{/*})}*/}
<Upload {...uploadProps} fileList={this.state.fileList} className="upload_1 ml5">
<Button className="uploadBtn">
<Icon type="upload" /> 上传附件

@ -1,7 +1,7 @@
import React,{Component} from "React";
import { Form, Select, Input, Button,Checkbox,Upload,Icon,message,Modal, Table, Divider, Tag} from "antd";
import {Link} from 'react-router-dom';
import { WordsBtn,markdownToHTML} from 'educoder';
import { WordsBtn,markdownToHTML,AttachmentList} from 'educoder';
import axios from 'axios';
import Modals from '../../../modals/Modals';
import DownloadMessageysl from "../../../modals/DownloadMessageysl";
@ -396,23 +396,23 @@ class GraduationTasksquestions extends Component{
}
<div>
{questionslist&&questionslist.attachments.map((item,key)=>{
return(
<div className="color-grey mt5">
<a className="color-grey">
<i className="font-14 color-green iconfont icon-fujian mr8" aria-hidden="true"></i>
</a>
<a href={item.url}
className="mr12" length="58">
{item.title}
</a>
<span className="color-grey mt2 color-grey-6 font-12">{item.filesize}</span>
</div>
)
})}
{/*{questionslist&&questionslist.attachments.map((item,key)=>{*/}
{/*return(*/}
{/*<div className="color-grey mt5">*/}
{/*<a className="color-grey">*/}
{/*<i className="font-14 color-green iconfont icon-fujian mr8" aria-hidden="true"></i>*/}
{/*</a>*/}
{/*<a href={item.url}*/}
{/*className="mr12" length="58">*/}
{/*{item.title}*/}
{/*</a>*/}
{/*<span className="color-grey mt2 color-grey-6 font-12">{item.filesize}</span>*/}
{/*</div>*/}
{/*)*/}
{/*})}*/}
<AttachmentList {...this.props} {...this.state} attachments={questionslist&&questionslist.attachments}></AttachmentList>
</div>
{questionslist&&questionslist.group_info?<div>

Loading…
Cancel
Save