All Downloads are FREE. Search and download functionalities are using the official Maven repository.

templates.sword.add.js.vm Maven / Gradle / Ivy

The newest version!
#set($upperEntityPath=$table.entityPath.toUpperCase())
import React, { PureComponent } from 'react';
import { Form, Input, Card, Button } from 'antd';
import { connect } from 'dva';
import Panel from '../../../components/Panel';
import styles from '../../../layouts/Sword.less';
import { $!{upperEntityPath}_SUBMIT } from '../../../actions/$!{table.entityPath}';

const FormItem = Form.Item;

@connect(({ loading }) => ({
  submitting: loading.effects['$!{table.entityPath}/submit'],
}))
@Form.create()
class $!{entity}Add extends PureComponent {
  handleSubmit = e => {
    e.preventDefault();
    const { dispatch, form } = this.props;
    form.validateFieldsAndScroll((err, values) => {
      if (!err) {
        dispatch($!{upperEntityPath}_SUBMIT(values));
      }
    });
  };

  render() {
    const {
      form: { getFieldDecorator },
      submitting,
    } = this.props;

    const formItemLayout = {
      labelCol: {
        xs: { span: 24 },
        sm: { span: 7 },
      },
      wrapperCol: {
        xs: { span: 24 },
        sm: { span: 12 },
        md: { span: 10 },
      },
    };

    const action = (
      
    );

    return (
      
        
#foreach($field in $!{table.fields}) #if($!{field.name}!=$!{cfg.tenantColumn}) {getFieldDecorator('$!{field.propertyName}', { rules: [ { required: true, message: '请输入$!{field.comment}', }, ], })()} #end #end
); } } export default $!{entity}Add;




© 2015 - 2024 Weber Informatics LLC | Privacy Policy