/* eslint-disable array-callback-return,no-undef */
import React, { Component } from 'react';
import { Form } from '@ant-design/compatible';
// import '@ant-design/compatible/assets/index.css';
import { Layout, Spin } from 'antd-v4';
import styles from '../../index.less';
// import Toolbar from '../Common/ToolBar/ToolBarNew';
import * as commonFunc from '../Common/commonFunc';
import CommonBase from '../Common/CommonBase';
import CommonElementEvent from '../Common/CommonElementEvent';
import * as commonUtils from '../../utils/utils';/* 通用方法 */
import CommonView from '../Common/CommonViewNew';

const { Content } = Layout;

class MonthEndingClosingInfoComponent extends Component {
  constructor(props) {
    super(props);
    this.state = {
    };
    this.form = {}; /*   表单对象   */
  }
  render() {
    const { pageLoading } = this.props;
    return (
      <div>
        <Spin spinning={pageLoading}>
          <div>
            <MonthEndingClosingComponent
              {...this.props}
              {...this.state}
            />
          </div>
        </Spin>
      </div>
    );
  }
}
const MonthEndingClosingComponent = Form.create({
  mapPropsToFields(props) {
    const { masterData } = props;
    const obj = commonFunc.mapPropsToFields(masterData, Form);
    return obj;
  },
})((props) => {
  const {
    form, onReturnForm, masterData,
  } = props;
  /*   回带表单   */
  onReturnForm(form);
  if (commonUtils.isNotEmptyObject(masterData)) {
    masterData.bCheck = true;
  }

  return (
    <Form>
      <Layout>
        <Layout className={styles.clayout}>
          <Content className={styles.content}>
            <div className="bill-search-group" >
              <CommonView {...props} />
            </div>
          </Content>
        </Layout>
      </Layout>
    </Form>
  );
});

export default CommonBase(CommonElementEvent(MonthEndingClosingInfoComponent));

