Browse Source

BI-138644 fix: 灰化的分秒可设置值

(cherry picked from commit 0a6ae59c07)
research/test
jimmychai 1 year ago
parent
commit
98b5fd1f71
  1. 18
      packages/fineui/src/widget/dynamicdatetime/dynamicdatetime.timeselect.js

18
packages/fineui/src/widget/dynamicdatetime/dynamicdatetime.timeselect.js

@ -181,18 +181,24 @@ export class DynamicDateTimeSelect extends Widget {
} }
_checkHour(value) { _checkHour(value) {
this.hour.setDownEnable(parseInt(value) > 0); const { timeSelectTypes } = this.options;
this.hour.setUpEnable(parseInt(value) < 23); const canSelect = timeSelectTypes.includes(DynamicDateTimeSelect.HOUR);
this.hour.setDownEnable(canSelect && parseInt(value) > 0);
this.hour.setUpEnable(canSelect && parseInt(value) < 23);
} }
_checkMinute(value) { _checkMinute(value) {
this.minute.setDownEnable(parseInt(value) > 0); const { timeSelectTypes } = this.options;
this.minute.setUpEnable(parseInt(value) < 59); const canSelect = timeSelectTypes.includes(DynamicDateTimeSelect.MINUTE);
this.minute.setDownEnable(canSelect && parseInt(value) > 0);
this.minute.setUpEnable(canSelect && parseInt(value) < 59);
} }
_checkSecond(value) { _checkSecond(value) {
this.second.setDownEnable(parseInt(value) > 0); const { timeSelectTypes } = this.options;
this.second.setUpEnable(parseInt(value) < 59); const canSelect = timeSelectTypes.includes(DynamicDateTimeSelect.SECOND);
this.second.setDownEnable(canSelect && parseInt(value) > 0);
this.second.setUpEnable(canSelect && parseInt(value) < 59);
} }
_autoSwitch(v, type) { _autoSwitch(v, type) {

Loading…
Cancel
Save