index.js 1.3 KB
Newer Older
王绍森's avatar
王绍森 committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57
import React from 'react';
import PageTypeMatching from '@/highOrderComponent/PageTypeMatching';
import getInfoGenerator from '../getInfoGenerator';

export { DataType } from '../getInfoGenerator'

const defaultNameSpan = { big: 9, small: 9 };
const defaultFieldSpan = { big: 4, small: 4 };

const defaultPageSetting = {
  selectRows: true, // 是否可以行选择,
  paging: true, // 是否可以分页,
  searchArea: true, // 是否拥有 搜索区dom,
  buttonArea: true, // 是否拥有 按钮区,
};

export default function MyApplyList({
  appId,
  pageSetting = {},
  pageButton = [],
  condition = [],
  nameSpan = defaultNameSpan,
  fileSpan = defaultFieldSpan,
  tableRowKey = 'buzinessId',
  columns = [],
}) {
  const pageSearch = {
    search: {
      fromTab: true,
      getInfo: getInfoGenerator(condition),
      url: '/common/myApplyMap',
      field: {
        appId: {
          required: true,
          defaultValue: appId,
        },
      },
      condition,
      nameSpan,
      fileSpan,
    },
    tableRowKey,
    columns,
  };

  return (
    <PageTypeMatching
      pageSetting={{
        type: 'list',
        listConfig: { ...defaultPageSetting, ...pageSetting },
      }}
      bodyShellStyle={{ marginTop: condition && condition.length ? 16 : 0 }}
      pageButton={pageButton}
      pageSearch={pageSearch}
    />
  );
}