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

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

const defaultNameSpan = { big: 9, small: 9 };
const defaultFieldSpan = { big: 4, small: 4 };
王绍森's avatar
王绍森 committed
9

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

王绍森's avatar
王绍森 committed
17
export default function AuditPage({ appId, tab1 = {}, tab2 = {} }) {
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
	const pageSearch = {
		tab1: {
			search: {
				searchType: 'cascadeSearchNew',
				getInfo: tab1.getInfo || getInfoGenerator(tab1.condition),
				url: '/common/assigneeTasks',
				field: {
					appId: {
						required: true,
						defaultValue: appId,
					},
				},
				condition: tab1.condition || [],
				nameSpan: tab1.nameSpan || defaultNameSpan,
				fileSpan: tab1.fieldSpan || defaultFieldSpan,
			},
			tableRowKey: tab1.tableRowKey || 'buzinessId',
			columns: tab1.columns || [],
		},
		tab2: {
			search: {
				searchType: 'cascadeSearchNew',
				getInfo: tab2.getInfo || getInfoGenerator(tab2.condition),
				url: '/common/assigneeDTasks',
				field: {
					appId: {
						required: true,
						defaultValue: appId,
					},
				},
				condition: tab2.condition || [],
				nameSpan: tab2.nameSpan || defaultNameSpan,
				fileSpan: tab2.fieldSpan || defaultFieldSpan,
			},
			tableRowKey: tab2.tableRowKey || 'id',
			columns: tab2.columns || [],
		},
	};
王绍森's avatar
王绍森 committed
56

57 58 59 60
	const pageButton = {
		tab1: tab1.pageButton || [],
		tab2: tab2.pageButton || [],
	};
王绍森's avatar
王绍森 committed
61

62 63 64 65 66 67 68 69 70 71 72 73 74 75 76
	const pageSetting = {
		type: 'listTab', // 页面类型
		tabList: {
			tab1: {
				key: 0,
				name: '待审核',
				listConfig: { ...defaultPageSetting, ...tab1.pageSetting },
			},
			tab2: {
				name: '已审核',
				key: 1,
				listConfig: { ...defaultPageSetting, ...tab2.pageSetting },
			},
		},
	};
王绍森's avatar
王绍森 committed
77

78 79 80 81 82 83 84 85
	return (
		<PageTypeMatching
			tabsShellStyle={{ marginTop: 0 }}
			pageSetting={pageSetting}
			pageButton={pageButton}
			pageSearch={pageSearch}
		/>
	);
王绍森's avatar
王绍森 committed
86
}