mirror of
https://github.com/whyour/qinglong.git
synced 2025-07-08 04:16:07 +08:00
修改定时任务pageSize,增加全部展示为一页
This commit is contained in:
parent
3e88314d0a
commit
bc281ee4d7
|
@ -122,7 +122,7 @@ const Crontab = ({ headerStyle, isPhone, theme }: any) => {
|
|||
</>
|
||||
),
|
||||
sorter: {
|
||||
compare: (a: any, b: any) => a.name.localeCompare(b.name),
|
||||
compare: (a: any, b: any) => a?.name?.localeCompare(b?.name),
|
||||
multiple: 2,
|
||||
},
|
||||
},
|
||||
|
@ -382,31 +382,15 @@ const Crontab = ({ headerStyle, isPhone, theme }: any) => {
|
|||
.then((_data: any) => {
|
||||
const { data, total } = _data.data;
|
||||
setValue(
|
||||
data
|
||||
.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 {
|
||||
...x,
|
||||
nextRunTime: cron_parser
|
||||
.parseExpression(x.schedule)
|
||||
.next()
|
||||
.toDate(),
|
||||
};
|
||||
}),
|
||||
data.map((x) => {
|
||||
return {
|
||||
...x,
|
||||
nextRunTime: cron_parser
|
||||
.parseExpression(x.schedule)
|
||||
.next()
|
||||
.toDate(),
|
||||
};
|
||||
}),
|
||||
);
|
||||
setTotal(total);
|
||||
})
|
||||
|
@ -748,11 +732,6 @@ const Crontab = ({ headerStyle, isPhone, theme }: any) => {
|
|||
const rowSelection = {
|
||||
selectedRowIds,
|
||||
onChange: onSelectChange,
|
||||
selections: [
|
||||
Table.SELECTION_ALL,
|
||||
Table.SELECTION_INVERT,
|
||||
Table.SELECTION_NONE,
|
||||
],
|
||||
};
|
||||
|
||||
const delCrons = () => {
|
||||
|
@ -927,7 +906,9 @@ const Crontab = ({ headerStyle, isPhone, theme }: any) => {
|
|||
total,
|
||||
showTotal: (total: number, range: number[]) =>
|
||||
`第 ${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) => {
|
||||
return {
|
||||
|
|
Loading…
Reference in New Issue
Block a user