index.js 1.3 KB
Newer Older
王绍森's avatar
王绍森 committed
1 2 3 4
import React from 'react';
import PageTypeMatching from '@/highOrderComponent/PageTypeMatching';
import getInfoGenerator from '../getInfoGenerator';

5
export { DataType } from '../getInfoGenerator';
王绍森's avatar
王绍森 committed
6 7 8 9 10

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

const defaultPageSetting = {
11 12 13 14
	selectRows: true, // 是否可以行选择,
	paging: true, // 是否可以分页,
	searchArea: true, // 是否拥有 搜索区dom,
	buttonArea: true, // 是否拥有 按钮区,
王绍森's avatar
王绍森 committed
15 16 17
};

export default function MyApplyList({
18 19 20 21 22 23 24 25 26
	appId,
	pageSetting = {},
	pageButton = [],
	condition = [],
	nameSpan = defaultNameSpan,
	fileSpan = defaultFieldSpan,
	tableRowKey = 'buzinessId',
	columns = [],
	scroll,
王绍森's avatar
王绍森 committed
27
}) {
28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46
	const pageSearch = {
		search: {
			fromTab: true,
			getInfo: getInfoGenerator(condition),
			url: '/common/myApplyMap',
			field: {
				appId: {
					required: true,
					defaultValue: appId,
				},
			},
			condition,
			nameSpan,
			fileSpan,
		},
		scroll,
		tableRowKey,
		columns,
	};
王绍森's avatar
王绍森 committed
47

48 49 50 51 52 53 54 55 56 57 58
	return (
		<PageTypeMatching
			pageSetting={{
				type: 'list',
				listConfig: { ...defaultPageSetting, ...pageSetting },
			}}
			bodyShellStyle={{ marginTop: condition && condition.length ? 16 : 0 }}
			pageButton={pageButton}
			pageSearch={pageSearch}
		/>
	);
王绍森's avatar
王绍森 committed
59
}