import React,{ Component } from "react"; import {Tooltip, Modal, Input } from 'antd' import moment from 'moment' import { getUrl, WordsBtn } from 'educoder' import axios from 'axios' class AddDirModal extends Component{ constructor(props){ super(props); this.state = { } } onInput = (e) => { this.setState({ inputValue: e.target.value }) } open = () => { this.setState({ visible: true, inputValue: '' }) } onSave = () => { let coursesId = this.props.match.params.coursesId; const url = `/courses/${coursesId}/boards.json` let { inputValue } = this.state; axios.post(url,{ name: inputValue }).then((response)=>{ if (response.data.status == 0) { this.onCancel() this.props.showNotification('添加成功') this.props.addSuccess && this.props.addSuccess() } }).catch((error)=>{ console.log(error) }) } onCancel = () => { this.setState({ visible: false, inputValue: '' }) } render(){ let { inputValue, visible } = this.state; const { title } = this.props; return(
{this.props.label}:
{/* {this.state.NavmodalValuetype===true? {this.state.NavmodalValues} :""} */} {/* this.state.NavmodalValuetype===true?"clearfix mt20 edu-txt-center": */}
取消 确定
) } } export default AddDirModal;