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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
import React, { useState } from 'react';
import PageTypeMatching from '@/highOrderComponent/PageTypeMatching';
import getInfoGenerator from '@/webPublic/FormInsertDiy/getInfoGenerator';
import AuditModal from './AuditModal';
import { findValueByKey } from '../../../../pages/zydtw/Cxcy/utils';
import withGoBack from '@/highOrderComponent/withGoBack';
import ButtonDiy from '@/baseComponent/ButtonDiy';
const defaultNameSpan = { big: 9, small: 9 };
const defaultFieldSpan = { big: 4, small: 4 };
const defaultPageSetting = {
selectRows: true,
paging: true,
searchArea: true,
buttonArea: true,
};
export default withGoBack(function BatchAudit({
appId,
flowNode,
getInfo,
condition,
nameSpan,
fieldSpan,
tableRowKey,
columns,
pageButton,
pageSetting,
}) {
const pageSearch = {
search: {
searchType: 'cascadeSearchNew',
getInfo: getInfo || getInfoGenerator(condition),
url: '/common/assigneeTasks',
field: {
appId: {
required: true,
defaultValue: appId,
},
flowNode: {
required: true,
defaultValue: flowNode,
},
},
condition: condition || [],
nameSpan: nameSpan || defaultNameSpan,
fileSpan: fieldSpan || defaultFieldSpan,
},
tableRowKey: tableRowKey || 'buzinessId',
columns: columns || [],
};
const defaultPageButton = [
{
type: 'create',
name: '批量审核',
component: 'RenderComponent',
render: ({ selectRows, getPage }) => {
const disabled = !selectRows || !Array.isArray(selectRows) || !selectRows.length;
return (
<AuditModal
selectRows={selectRows.map((i) => ({ ...i, code: findValueByKey(i, 'code') }))}
getPage={getPage}>
{({ onShow }) => <ButtonDiy name="批量审核" handleClick={onShow} disabled={disabled} />}
</AuditModal>
);
},
},
];
return (
<PageTypeMatching
tabsShellStyle={{ marginTop: 0 }}
pageSetting={{ type: 'list', listConfig: { ...defaultPageSetting, ...pageSetting } }}
pageButton={pageButton || defaultPageButton}
pageSearch={pageSearch}
/>
);
});