修改定时任务pageSize,增加全部展示为一页

This commit is contained in:
whyour 2022-08-25 23:12:12 +08:00
parent 3e88314d0a
commit bc281ee4d7

View File

@ -122,7 +122,7 @@ const Crontab = ({ headerStyle, isPhone, theme }: any) => {
</> </>
), ),
sorter: { sorter: {
compare: (a: any, b: any) => a.name.localeCompare(b.name), compare: (a: any, b: any) => a?.name?.localeCompare(b?.name),
multiple: 2, multiple: 2,
}, },
}, },
@ -382,23 +382,7 @@ const Crontab = ({ headerStyle, isPhone, theme }: any) => {
.then((_data: any) => { .then((_data: any) => {
const { data, total } = _data.data; const { data, total } = _data.data;
setValue( setValue(
data data.map((x) => {
.sort((a: any, b: any) => {
const sortA =
a.isPinned && a.status !== 0
? 5
: a.isDisabled && a.status !== 0
? 4
: a.status;
const sortB =
b.isPinned && b.status !== 0
? 5
: b.isDisabled && b.status !== 0
? 4
: b.status;
return CrontabSort[sortA] - CrontabSort[sortB];
})
.map((x) => {
return { return {
...x, ...x,
nextRunTime: cron_parser nextRunTime: cron_parser
@ -748,11 +732,6 @@ const Crontab = ({ headerStyle, isPhone, theme }: any) => {
const rowSelection = { const rowSelection = {
selectedRowIds, selectedRowIds,
onChange: onSelectChange, onChange: onSelectChange,
selections: [
Table.SELECTION_ALL,
Table.SELECTION_INVERT,
Table.SELECTION_NONE,
],
}; };
const delCrons = () => { const delCrons = () => {
@ -927,7 +906,9 @@ const Crontab = ({ headerStyle, isPhone, theme }: any) => {
total, total,
showTotal: (total: number, range: number[]) => showTotal: (total: number, range: number[]) =>
`${range[0]}-${range[1]} 条/总共 ${total}`, `${range[0]}-${range[1]} 条/总共 ${total}`,
pageSizeOptions: [20, 100, 500, 1000] as any, pageSizeOptions: [10, 20, 50, 100, 200, 500, total || 10000].sort(
(a, b) => a - b,
),
}} }}
onRow={(record) => { onRow={(record) => {
return { return {