From 1eb8e263f7d002269d8aa215f2461e1598e957a1 Mon Sep 17 00:00:00 2001 From: kilo5hz <1005hz@outlook.com> Date: Thu, 6 Jan 2022 15:59:58 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=94=B9=E6=A0=87=E7=AD=BE=E5=B1=95?= =?UTF-8?q?=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/crontab/index.tsx | 70 ++++++++++++++++++------------------- 1 file changed, 35 insertions(+), 35 deletions(-) diff --git a/src/pages/crontab/index.tsx b/src/pages/crontab/index.tsx index 0537f5b6..9919215a 100644 --- a/src/pages/crontab/index.tsx +++ b/src/pages/crontab/index.tsx @@ -11,6 +11,7 @@ import { Menu, Typography, Input, + Popover, } from 'antd'; import { ClockCircleOutlined, @@ -30,7 +31,7 @@ import { import config from '@/utils/config'; import { PageContainer } from '@ant-design/pro-layout'; import { request } from '@/utils/http'; -import CronModal,{CronLabelModal} from './modal'; +import CronModal,{ CronLabelModal } from './modal'; import CronLogModal from './logModal'; import cron_parser from 'cron-parser'; import { diffTime } from '@/utils/date'; @@ -77,20 +78,39 @@ const Crontab = ({ headerStyle, isPhone }: any) => { width: 150, align: 'center' as const, render: (text: string, record: any) => ( - { - goToScriptManager(record); - }} - > - {record.name || record._id}{' '} - {record.isPinned ? ( - - - - ) : ( - '' - )} - + <> + { + goToScriptManager(record); + }} + > + {record.name || record._id}{' '} + {record.isPinned ? ( + + + + ) : ( + '' + )} + + + {record.labels?.length > 0 && record.labels[0] !== '' ? + + {record.labels?.map((label: string, i: number) => ( + { onSearch(`label:${label}`) }}> + {label} + + ))} + + }> + {record.labels[0]} + + : ''} + + ), sorter: { compare: (a: any, b: any) => a.name.localeCompare(b.name), @@ -275,26 +295,6 @@ const Crontab = ({ headerStyle, isPhone }: any) => { ), }, - { - title: '标签', - key: 'labels', - dataIndex: 'labels', - align: 'center' as const, - width: 100, - render: (text: string, record: any) => ( - <> - {record.labels?.map((label: string) => ( - { onSearch(`label:${label}`) }}>{label} - ))} - - ), - }, { title: '操作', key: 'action',