修改定时任务表格布局

This commit is contained in:
hanhh 2021-09-23 22:12:19 +08:00
parent af2f3deeab
commit a79fd74130

View File

@ -71,6 +71,8 @@ const Crontab = ({ headerStyle, isPhone }: any) => {
title: '任务名', title: '任务名',
dataIndex: 'name', dataIndex: 'name',
key: 'name', key: 'name',
fixed: 'left',
width: 150,
align: 'center' as const, align: 'center' as const,
render: (text: string, record: any) => ( render: (text: string, record: any) => (
<span> <span>
@ -93,7 +95,8 @@ const Crontab = ({ headerStyle, isPhone }: any) => {
title: '任务', title: '任务',
dataIndex: 'command', dataIndex: 'command',
key: 'command', key: 'command',
width: '40%', fixed: 'left',
width: 250,
align: 'center' as const, align: 'center' as const,
render: (text: string, record: any) => { render: (text: string, record: any) => {
return ( return (
@ -118,6 +121,7 @@ const Crontab = ({ headerStyle, isPhone }: any) => {
title: '任务定时', title: '任务定时',
dataIndex: 'schedule', dataIndex: 'schedule',
key: 'schedule', key: 'schedule',
width: 110,
align: 'center' as const, align: 'center' as const,
sorter: { sorter: {
compare: (a: any, b: any) => a.schedule.localeCompare(b.schedule), compare: (a: any, b: any) => a.schedule.localeCompare(b.schedule),
@ -127,6 +131,7 @@ const Crontab = ({ headerStyle, isPhone }: any) => {
{ {
title: '最后运行时间', title: '最后运行时间',
align: 'center' as const, align: 'center' as const,
width: 150,
sorter: { sorter: {
compare: (a: any, b: any) => { compare: (a: any, b: any) => {
return a.last_execution_time - b.last_execution_time; return a.last_execution_time - b.last_execution_time;
@ -137,7 +142,6 @@ const Crontab = ({ headerStyle, isPhone }: any) => {
return ( return (
<span <span
style={{ style={{
textAlign: 'left',
display: 'block', display: 'block',
}} }}
> >
@ -156,6 +160,7 @@ const Crontab = ({ headerStyle, isPhone }: any) => {
{ {
title: '最后运行时长', title: '最后运行时长',
align: 'center' as const, align: 'center' as const,
width: 120,
sorter: { sorter: {
compare: (a: any, b: any) => { compare: (a: any, b: any) => {
return a.last_running_time - b.last_running_time; return a.last_running_time - b.last_running_time;
@ -166,7 +171,6 @@ const Crontab = ({ headerStyle, isPhone }: any) => {
return ( return (
<span <span
style={{ style={{
textAlign: 'left',
display: 'block', display: 'block',
}} }}
> >
@ -180,6 +184,7 @@ const Crontab = ({ headerStyle, isPhone }: any) => {
{ {
title: '下次运行时间', title: '下次运行时间',
align: 'center' as const, align: 'center' as const,
width: 150,
sorter: { sorter: {
compare: (a: any, b: any) => { compare: (a: any, b: any) => {
return a.nextRunTime - b.nextRunTime; return a.nextRunTime - b.nextRunTime;
@ -190,7 +195,6 @@ const Crontab = ({ headerStyle, isPhone }: any) => {
return ( return (
<span <span
style={{ style={{
textAlign: 'left',
display: 'block', display: 'block',
}} }}
> >
@ -207,7 +211,7 @@ const Crontab = ({ headerStyle, isPhone }: any) => {
key: 'status', key: 'status',
dataIndex: 'status', dataIndex: 'status',
align: 'center' as const, align: 'center' as const,
width: 70, width: 85,
filters: [ filters: [
{ {
text: '运行中', text: '运行中',
@ -269,6 +273,8 @@ const Crontab = ({ headerStyle, isPhone }: any) => {
title: '操作', title: '操作',
key: 'action', key: 'action',
align: 'center' as const, align: 'center' as const,
width: 80,
fixed: 'right',
render: (text: string, record: any, index: number) => { render: (text: string, record: any, index: number) => {
const isPc = !isPhone; const isPc = !isPhone;
return ( return (