/** * Copyright (c) OpenSpug Organization. https://github.com/openspug/spug * Copyright (c) * Released under the AGPL-3.0 License. */ import React from 'react'; import { observer } from 'mobx-react'; import { Modal, Form, Input, message } from 'antd'; import http from 'libs/http'; import store from './store'; @observer class ComForm extends React.Component { constructor(props) { super(props); this.state = { loading: false, } } handleSubmit = () => { this.setState({loading: true}); const formData = this.props.form.getFieldsValue(); formData['id'] = store.record.id; http.post('/api/alarm/contact/', formData) .then(res => { message.success('操作成功'); store.formVisible = false; store.fetchRecords() }, () => this.setState({loading: false})) }; render() { const info = store.record; const {getFieldDecorator} = this.props.form; return ( store.formVisible = false} confirmLoading={this.state.loading} onOk={this.handleSubmit}>
{getFieldDecorator('name', {initialValue: info['name']})( )} {getFieldDecorator('phone', {initialValue: info['phone']})( )} {getFieldDecorator('email', {initialValue: info['email']})( )} 如何获取微信 Token ?}> {getFieldDecorator('wx_token', {initialValue: info['wx_token']})( )} 钉钉收不到通知?请参考 官方文档 }> {getFieldDecorator('ding', {initialValue: info['ding']})( )} {getFieldDecorator('qy_wx', {initialValue: info['qy_wx']})( )}
) } } export default Form.create()(ComForm)