import React from "react"; import { Spin, Button, Tabs, Table, message, Modal, Upload, Form, Input } from "antd"; import { splitUrl } from "@/tools"; import PicturesWall from "./picturesWall"; import "./remove.less" const FormItem = Form.Item; const AddPicModal = React.createClass({ getInitialState() { return { newVisible: false, rotateDeg: 0, voucherUrl: [], }; }, componentWillReceiveProps(nextProps) { this.setState({ newVisible: nextProps.ShowModal, }); }, handleOk() { this.setState({ newVisible: false, }); }, add() { if(this.state.voucherUrl.length == 0) { message.warning("请上传图片") return } if(this.state.remarks == "" || this.state.remarks == undefined) { message.warning("请填写图片备注") return } this.props.add(this.state.voucherUrl[0].response.data, this.state.remarks); this.setState({ voucherUrl: [], remarks: undefined, }); }, getVoucherUrl(e) { this.setState({ voucherUrl: e, }); }, cancel() { this.props.cancel() this.setState({ voucherUrl: [], remarks: undefined }) }, render() { return (
{ this.setState({ remarks: e.target.value, }); }} />
); }, }); export default AddPicModal;