From 8cb583e0778bc5e6622e60f9e60814384175aaca Mon Sep 17 00:00:00 2001 From: mkppo <17605043035@163.com> Date: Tue, 7 Dec 2021 09:47:36 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=97=B6=E9=97=B4=E7=B1=BB?= =?UTF-8?q?=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- build/plugins/cool.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/build/plugins/cool.ts b/build/plugins/cool.ts index 179caa4..8f6ebdc 100644 --- a/build/plugins/cool.ts +++ b/build/plugins/cool.ts @@ -198,14 +198,14 @@ function datetimeMerge({ columns, item }: any) { if (columns.find((e: any) => e.propertyName == "end" + key)) { item.prop = key.toLocaleLowerCase(); - item.label = item.prop == "time" ? "时间范围" : "日期范围"; + const isTime = item.prop == "time"; + item.label = isTime ? "时间范围" : "日期范围"; item.hook = "datetimeRange"; item.component = { name: "el-date-picker", props: { - type: item.prop == "time" ? "datetimerange" : "daterange", - valueFormat: - item.prop == "time" ? "YYYY-MM-DD HH:mm:ss" : "YYYY-MM-DD 00:00:00", + type: isTime ? "datetimerange" : "daterange", + valueFormat: isTime ? "YYYY-MM-DD HH:mm:ss" : "YYYY-MM-DD 00:00:00", defaultTime: [new Date(2000, 1, 1, 0, 0, 0), new Date(2000, 1, 1, 23, 59, 59)] } };