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

META-INF.templates.sword.view.js.vm Maven / Gradle / Ivy

#set($upperEntityPath=$table.entityPath.toUpperCase())
#set($editId="$" + "{" + "id" + "}")
import React, { PureComponent } from 'react';
import router from 'umi/router';
import { Form, Card, Button } from 'antd';
import { connect } from 'dva';
import Panel from '../../../components/Panel';
import styles from '../../../layouts/Sword.less';
import { $!{upperEntityPath}_DETAIL } from '../../../actions/$!{table.entityPath}';

const FormItem = Form.Item;

@connect(({ $!{table.entityPath} }) => ({
  $!{table.entityPath},
}))
@Form.create()
class $!{entity}View extends PureComponent {
  componentWillMount() {
    const {
      dispatch,
      match: {
        params: { id },
      },
    } = this.props;
    dispatch($!{upperEntityPath}_DETAIL(id));
  }

  handleEdit = () => {
    const {
      match: {
        params: { id },
      },
    } = this.props;
    router.push(`/$!{cfg.servicePackage}/$!{table.entityPath}/edit/$!{editId}`);
  };

  render() {
    const {
      $!{table.entityPath}: { detail },
    } = 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}) {detail.$!{field.propertyName}} #end #end
); } } export default $!{entity}View;




© 2015 - 2024 Weber Informatics LLC | Privacy Policy