From 98b5fd1f714a022ad154f158921184292f21ccf9 Mon Sep 17 00:00:00 2001 From: jimmychai Date: Mon, 27 Nov 2023 19:35:18 +0800 Subject: [PATCH] =?UTF-8?q?BI-138644=20fix:=20=E7=81=B0=E5=8C=96=E7=9A=84?= =?UTF-8?q?=E5=88=86=E7=A7=92=E5=8F=AF=E8=AE=BE=E7=BD=AE=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit (cherry picked from commit 0a6ae59c07811a98fbbcf7e96b753b6d74442a32) --- .../dynamicdatetime.timeselect.js | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/packages/fineui/src/widget/dynamicdatetime/dynamicdatetime.timeselect.js b/packages/fineui/src/widget/dynamicdatetime/dynamicdatetime.timeselect.js index 32ef8f9a0..928ad02fe 100644 --- a/packages/fineui/src/widget/dynamicdatetime/dynamicdatetime.timeselect.js +++ b/packages/fineui/src/widget/dynamicdatetime/dynamicdatetime.timeselect.js @@ -181,18 +181,24 @@ export class DynamicDateTimeSelect extends Widget { } _checkHour(value) { - this.hour.setDownEnable(parseInt(value) > 0); - this.hour.setUpEnable(parseInt(value) < 23); + const { timeSelectTypes } = this.options; + const canSelect = timeSelectTypes.includes(DynamicDateTimeSelect.HOUR); + this.hour.setDownEnable(canSelect && parseInt(value) > 0); + this.hour.setUpEnable(canSelect && parseInt(value) < 23); } _checkMinute(value) { - this.minute.setDownEnable(parseInt(value) > 0); - this.minute.setUpEnable(parseInt(value) < 59); + const { timeSelectTypes } = this.options; + const canSelect = timeSelectTypes.includes(DynamicDateTimeSelect.MINUTE); + this.minute.setDownEnable(canSelect && parseInt(value) > 0); + this.minute.setUpEnable(canSelect && parseInt(value) < 59); } _checkSecond(value) { - this.second.setDownEnable(parseInt(value) > 0); - this.second.setUpEnable(parseInt(value) < 59); + const { timeSelectTypes } = this.options; + const canSelect = timeSelectTypes.includes(DynamicDateTimeSelect.SECOND); + this.second.setDownEnable(canSelect && parseInt(value) > 0); + this.second.setUpEnable(canSelect && parseInt(value) < 59); } _autoSwitch(v, type) {