From d9aacbcb92af2e67edc2a6f9f74b8327c81203a9 Mon Sep 17 00:00:00 2001 From: hanhh <18330117883@163.com> Date: Thu, 19 Aug 2021 14:45:42 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=9A=E6=97=B6=E4=BB=BB=E5=8A=A1=E6=94=AF?= =?UTF-8?q?=E6=8C=81=E4=BB=BB=E5=8A=A1=E5=90=8D=EF=BC=8C=E5=AE=9A=E6=97=B6?= =?UTF-8?q?=EF=BC=8C=E5=91=BD=E4=BB=A4=E6=8E=92=E5=BA=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 环境变量支持名称排序 --- src/pages/crontab/index.tsx | 12 ++++++++++++ src/pages/env/index.tsx | 1 + 2 files changed, 13 insertions(+) diff --git a/src/pages/crontab/index.tsx b/src/pages/crontab/index.tsx index 130b3c62..d82da79e 100644 --- a/src/pages/crontab/index.tsx +++ b/src/pages/crontab/index.tsx @@ -69,6 +69,10 @@ const Crontab = () => { render: (text: string, record: any) => ( {record.name || record._id} ), + sorter: { + compare: (a: any, b: any) => a.name.localeCompare(b.name), + multiple: 2, + }, }, { title: '任务', @@ -90,12 +94,20 @@ const Crontab = () => { ); }, + sorter: { + compare: (a: any, b: any) => a.command.localeCompare(b.command), + multiple: 3, + }, }, { title: '任务定时', dataIndex: 'schedule', key: 'schedule', align: 'center' as const, + sorter: { + compare: (a: any, b: any) => a.schedule.localeCompare(b.schedule), + multiple: 1, + }, }, { title: '状态', diff --git a/src/pages/env/index.tsx b/src/pages/env/index.tsx index edf9e580..0e47b40c 100644 --- a/src/pages/env/index.tsx +++ b/src/pages/env/index.tsx @@ -119,6 +119,7 @@ const Env = () => { dataIndex: 'name', key: 'name', align: 'center' as const, + sorter: (a: any, b: any) => a.name.localeCompare(b.name), }, { title: '值',