import React from 'react'; import { Form, Button, Select } from 'antd'; import './index.less'; import Page from '@src/containers/Page'; import Block from '@src/components/Block'; import { formatFormError } from '@src/services/Tools'; import { asyncSMessage } from '@src/services/AsyncTools'; import { QuestionType } from '../../../../Constant'; import { System } from '../../../stores/system'; export default class extends Page { initData() { System.getPlace().then(result => { const { form } = this.props; form.setFieldsValue(result); this.setState({ load: true, data: result }); }); } submit() { const { form } = this.props; form.validateFields((err) => { if (!err) { const data = form.getFieldsValue(); System.setPlace(data) .then(() => { this.setState(data); asyncSMessage('保存成功'); }).catch((e) => { form.setFields(formatFormError(data, e.result)); }); } }); } renderView() { const { getFieldDecorator } = this.props.form; return
{QuestionType.map(row => { return {getFieldDecorator(row.value, { rules: [ { required: false, message: '请输入跳转地址' }, ], })(