From fbbf5a88d49e582f12f5cfdd0afca1632af0797d Mon Sep 17 00:00:00 2001 From: cxx Date: Thu, 9 May 2024 16:01:48 +0800 Subject: [PATCH] =?UTF-8?q?fix=20bug:=20=E6=97=B6=E9=97=B4=E6=97=A5?= =?UTF-8?q?=E6=9C=9F=E9=80=89=E6=8B=A9=E5=99=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/view/component/common/dateTimePicker.html | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/app/view/component/common/dateTimePicker.html b/app/view/component/common/dateTimePicker.html index 58cd2e1..d45f719 100644 --- a/app/view/component/common/dateTimePicker.html +++ b/app/view/component/common/dateTimePicker.html @@ -36,9 +36,9 @@ Vue.component("date-time-picker", { template: '#date-time-picker', props: { - datetime: { - type: [Date, String], - default: null, + value: { + type: String, + default: '' }, disabled: { type: Boolean, @@ -52,8 +52,6 @@ Vue.component("date-time-picker", { v => !!v || '必填', ], }, - constantObj: { - }, date: null, hour: null, minute: null @@ -72,21 +70,24 @@ Vue.component("date-time-picker", { }, created() {}, mounted() { - this.init() + this.doUiAction('init') }, methods: { async doUiAction(uiActionId, uiActionData) { switch (uiActionId) { + case 'init': + await this.init(); + break; default: console.error("[doUiAction] uiActionId not find", {uiActionId}); break; } }, init(){ - if (!this.datetime) { + if (!this.value) { return; } - let datetime = dayjs(this.datetime) + let datetime = dayjs(this.value) this.date = `${datetime.year()}-${datetime.month()+1}-${datetime.date()}` this.hour = `${datetime.hour()}` this.minute = `${datetime.minute()}`