From e7489118c01533392a5ecfde3bdcfa332d19a8d8 Mon Sep 17 00:00:00 2001 From: ap <951984189@qq.com> Date: Tue, 7 Dec 2021 09:36:22 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E5=96=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- build/plugins/cool.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/build/plugins/cool.ts b/build/plugins/cool.ts index b19bdb5..179caa4 100644 --- a/build/plugins/cool.ts +++ b/build/plugins/cool.ts @@ -197,14 +197,15 @@ function datetimeMerge({ columns, item }: any) { const key = item.prop.replace("start", ""); if (columns.find((e: any) => e.propertyName == "end" + key)) { - item.label = key == "time" ? "时间范围" : "日期范围"; item.prop = key.toLocaleLowerCase(); + item.label = item.prop == "time" ? "时间范围" : "日期范围"; item.hook = "datetimeRange"; item.component = { name: "el-date-picker", props: { - type: key == "time" ? "datetimerange" : "daterange", - valueFormat: "time" ? "YYYY-MM-DD HH:mm:ss" : "YYYY-MM-DD 00:00:00", + type: item.prop == "time" ? "datetimerange" : "daterange", + valueFormat: + item.prop == "time" ? "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)] } };