You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
educoder/public/react/src/modules/courses/shixunHomework/Homeworddescription.js

117 lines
3.4 KiB

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

import React, {Component} from "react";
import {
Form,
Select,
Input,
Button,
Checkbox,
Upload,
Icon,
message,
Modal,
Table,
Divider,
InputNumber,
Tag,
DatePicker,
Radio,
Tooltip,
notification
} from "antd";
import TPMMDEditor from '../../tpm/challengesnew/TPMMDEditor';
import {Link, Switch, Route, Redirect} from 'react-router-dom';
import axios from 'axios';
import '../css/members.css'
import "../common/formCommon.css"
import '../css/Courses.css'
import '../css/members.css'
import "../common/formCommon.css"
import '../css/Courses.css'
import moment from 'moment';
import '../css/members.css'
import "../common/formCommon.css"
import './style.css'
import Workquestionandanswer from "./Workquestionandanswer";
const { TextArea } = Input;
class Homeworddescription extends Component {
constructor(props) {
super(props);
this.state = {
props: props,
description:props.description,
}
}
componentDidMount() {
}
//取消操作
clickcancel =()=>{
this.props.NOReleaseNotes();
}
//确认操作
onSaveExercise=()=>{
if(this.state.description === "" || this.state.description===undefined || this.state.description === null){
this.props.showNotification("请输入作业说明");
return
}
this.props.ReleaseNotes(this.state.description);
}
//获取输入框
settextarea=(e)=>{
console.log("settextarea");
console.log(e);
this.setState({
description:e
})
}
render() {
return (
<div >
<div style={{
"background-color":"#FFFFff",
"padding":"20px 20px",
"position": "relative",
"margin-bottom":" 0px"}}>
<style>
{`
.ant-form-item-label{width:80px;}
`}
</style>
<Form.Item
label=""
className="mdInForm"
>
{/*<TextArea placeholder="作业说明..." value={this.state.description} onInput={this.settextarea} style={{"height": "120px"}}/>*/}
{/*<TextArea style={{"height": "120px"}}*/}
{/* autoComplete="off" ></TextArea>*/}
<TPMMDEditor ref={this.mdRef} placeholder={'请在此输入作业内容和要求最大限制5000个字符'}
mdID={'courseMessageMD'} initValue={this.state.description}
className="courseMessageMD" onChange={this.settextarea} style={{"height": "120px"}}
maxLent={"5000"}></TPMMDEditor>
</Form.Item>
<div className="clearfix mt10">
<Button type="primary" className="defalutSubmitbtn fr mr20 "style={{"width":"90px"}} onClick={this.onSaveExercise} >保存</Button>
<Button className="defalutCancelbtn fr mr20 w20" style={{"width":"90px"}} onClick={this.clickcancel} >取消</Button>
</div>
</div>
</div>
)
}
}
const Homeworddescriptions = Form.create({name: 'taskPollNew'})(Homeworddescription);
export default Homeworddescriptions;