const getRules = t => ({
    SEARCH_FORM_SCHEMA: {
        rules: [
            {
                type: 'rc-input',
                field: 'businessUnit',
                value: '',
                props: {
                    clearable: true,
                    placeholder: t('businessUnit'),
                },
            },
            {
                type: 'rc-date-picker',
                field: 'date1',
                value: [],
                flex: 2,
                props: {
                    type: 'daterange',
                    'start-placeholder': t('startTimePlaceholder'),
                    'end-placeholder': t('endTimePlaceholder'),
                },
            },
            {
                type: 'select',
                field: 'employeeType',
                value: '',
                props: {
                    clearable: true,
                    placeholder: t('employeeType'),
                },
                options: [
                    { value: '0', label: t('internalStaff') },
                    { value: '1', label: t('isv') },
                    { value: '2', label: t('dealer') },
                ],
            },
            {
                type: 'rc-input',
                field: 'account',
                value: '',
                props: {
                    clearable: true,
                    placeholder: t('account'),
                },
            },
            {
                type: 'rc-input',
                field: 'name',
                value: '',
                props: {
                    clearable: true,
                    placeholder: t('name'),
                },
            },
        ],
        buttonExtend: [
            {
                eventName: 'export',
                btnName: t('export'),
                props: {
                    type: 'primary',
                    plain: true,
                },
            },
            {
                eventName: 'exportHistory',
                btnName: t('exportHistory'),
                props: {
                    text: true,
                },
            },
        ],
    },
    TABLE_SCHEMA: {
        rules: [
            {
                title: t('unit'),
                key: 'businessUnit',
                width: 201,
                fixed: 'left',
            },
            {
                title: t('date'),
                key: 'date',
                width: 211,
            },
            {
                title: t('name'),
                key: 'name',
                width: 170,
            },
            {
                title: t('employeeType'),
                key: 'employeeType',
            },
            {
                title: t('account'),
                key: 'account',
                width: 149,
            },
            {
                title: t('punchType'),
                key: 'punchType',
            },
            {
                title: t('punchTime'),
                key: 'punchTime',
            },
            {
                title: t('businessType'),
                key: 'businessType',
            },
            {
                title: t('punchInformation'),
                key: 'punchInformation',
                slot: 'punch',
                width: 278,
            },
        ],
        actionRules: [
            {
                type: 'rc-button',
                emit: ['click'],
                emitPrefix: 'batchexport',
                props: {
                    // element-plus 属性
                    type: 'primary',
                    size: 'small',
                    disabled: false,
                },
                children: [t('batchExport')],
            },
        ],
    },
})
export default getRules

