import React from 'react';
import { connect } from 'dva';
import ListTablePage from './ListTablePage';
import TableComponent from "../../baseComponents/TableComponent";

class ListTablePageBase extends TableComponent {
  constructor(props) {
    super(props);
    this.state = {
      isfirstLoad: true,
      formData: {},
    };
  };

  onRenderTableSubRow(params) {
    const { tableCode, tableConfig, record } = params ? params : {};
    return (
      <ListTablePage
        data={this.props.data}
        formCode={tableConfig.formData ? tableConfig.formData.CODE : ''}
        parentId={tableConfig.id}
        parentRecord={record}
        isQuery={true}
        customParams={this.props.customParams}
        onRegLoadDataFunc={(params) => {
          this.onRegSubRowLoadDataFunc({ ...params, tableCode })
        }}
      />
    )
  }

}
export default connect(({ app, loading, listPage, login, custom, search }) => ({ app, loading, listPage, login, custom, search }))(ListTablePageBase);
