From cd3aecc8f18da84d41ac9a8f2f9dc47f53ea2de9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Thu, 15 Aug 2019 15:57:01 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modules/courses/gradinforms/Eduinforms.js | 158 +++++++++++++++--- .../courses/gradinforms/myysleduinforms.css | 6 + 2 files changed, 143 insertions(+), 21 deletions(-) create mode 100644 public/react/src/modules/courses/gradinforms/myysleduinforms.css diff --git a/public/react/src/modules/courses/gradinforms/Eduinforms.js b/public/react/src/modules/courses/gradinforms/Eduinforms.js index 13c3c0545..d23e77b1f 100644 --- a/public/react/src/modules/courses/gradinforms/Eduinforms.js +++ b/public/react/src/modules/courses/gradinforms/Eduinforms.js @@ -1,13 +1,19 @@ import React,{ Component } from "react"; -import { Input,Checkbox,Table, Pagination, Modal,Menu, Tooltip,Spin } from "antd"; -import { WordsBtn,on, off, trigger } from 'educoder'; -import '../css/members.css'; -import '../css/busyWork.css' +import { Input,Checkbox,Table, Pagination, Modal,Menu, Tooltip,Spin,Button,Form } from "antd"; +import { WordsBtn,on, off, trigger,markdownToHTML,getImageUrl} from 'educoder'; +import './myysleduinforms.css' +import axios from 'axios'; +import TPMMDEditor from "../../tpm/challengesnew/TPMMDEditor"; class Eduinforms extends Component{ constructor(props){ super(props); + this.messageRef = React.createRef(); + this.state={ + description:null, + isSpin:true, + whethertoedit:false, } } @@ -15,15 +21,37 @@ class Eduinforms extends Component{ componentDidMount() { console.log("获取到数据"); console.log(this.props); - // let url = "/courses/:id/informs.json"; - // - // axios.get(url).then((response) => { - // if(response){ + let url = `/courses/${this.props.match.params.id}/informs.json`; // - // } - // }).catch((error) => { - // console.log(error) - // }); + axios.get(url).then((response) => { + if(response){ + if(response.data){ + this.setState({ + description:response.data.description, + isSpin:false, + }) + }else { + this.setState({ + description:null, + isSpin:false, + + }) + + } + }else { + this.setState({ + description:null, + isSpin:false, + }) + + } + }).catch((error) => { + console.log(error) + this.setState({ + description:null, + isSpin:false, + }) + }); } @@ -33,35 +61,123 @@ class Eduinforms extends Component{ } + bianji = (bians)=>{ + this.setState({ + whethertoedit:bians, + }) + }; + handleSubmit=()=>{ + } render(){ + let{description,whethertoedit} =this.state; + const {getFieldDecorator} = this.props.form; return( -
-
+
+

公告栏 -

  • +
  • this.bianji(true)}> 编辑
  • - {/**/} - - - - {/**/} + + +
    + { + whethertoedit === false? +
    + { + description === null || description=== undefined ? +
    +
    +

    暂时还没有相关数据哦!

    +
    + :"" + } +
    + : +
    +
    + +
    +
    + + + {getFieldDecorator('description', { + rules: [{ + required: true, message: '请在此输入内容,最多5000个字符', + }, { + max: 5000, message: '最大限制为5000个字符', + }], + })( + + )} + +
    +
    + + +
    + 取消 + +
    +
    +
    +
    + } + + +
    + + + + +
    ) } } -export default Eduinforms; +const Eduinformss = Form.create({ name: 'eduinforms' })(Eduinforms); +export default Eduinformss; diff --git a/public/react/src/modules/courses/gradinforms/myysleduinforms.css b/public/react/src/modules/courses/gradinforms/myysleduinforms.css new file mode 100644 index 000000000..6fa1367d4 --- /dev/null +++ b/public/react/src/modules/courses/gradinforms/myysleduinforms.css @@ -0,0 +1,6 @@ +.yslmt16px{ + padding-top: 16px; + padding-left: 25px; + padding-right: 25px; + padding-bottom: 50px; +}