diff --git a/packages/fineui/src/widget/dynamicdatetime/dynamicdatetime.combo.js b/packages/fineui/src/widget/dynamicdatetime/dynamicdatetime.combo.js index 3ac88d788..0fc27ae09 100644 --- a/packages/fineui/src/widget/dynamicdatetime/dynamicdatetime.combo.js +++ b/packages/fineui/src/widget/dynamicdatetime/dynamicdatetime.combo.js @@ -207,6 +207,7 @@ export class DynamicDateTimeCombo extends Single { popup: { el: { type: DynamicDateTimePopup.xtype, + timeSelectTypes: opts.timeSelectTypes, width: opts.isNeedAdjustWidth ? opts.width : undefined, supportDynamic: opts.supportDynamic, behaviors: opts.behaviors, diff --git a/packages/fineui/src/widget/dynamicdatetime/dynamicdatetime.popup.js b/packages/fineui/src/widget/dynamicdatetime/dynamicdatetime.popup.js index 6668ca462..33678a041 100644 --- a/packages/fineui/src/widget/dynamicdatetime/dynamicdatetime.popup.js +++ b/packages/fineui/src/widget/dynamicdatetime/dynamicdatetime.popup.js @@ -204,6 +204,7 @@ export class DynamicDateTimePopup extends Widget { { el: { type: DynamicDateTimeSelect.xtype, + timeSelectTypes: o.timeSelectTypes, cls: "bi-split-top", ref: _ref => { this.timeSelect = _ref; diff --git a/packages/fineui/src/widget/dynamicdatetime/dynamicdatetime.timeselect.js b/packages/fineui/src/widget/dynamicdatetime/dynamicdatetime.timeselect.js index 45355275b..32ef8f9a0 100644 --- a/packages/fineui/src/widget/dynamicdatetime/dynamicdatetime.timeselect.js +++ b/packages/fineui/src/widget/dynamicdatetime/dynamicdatetime.timeselect.js @@ -29,11 +29,12 @@ export class DynamicDateTimeSelect extends Widget { return { baseCls: "bi-date-time-select", editorHeight: SIZE_CONSANTS.LIST_ITEM_HEIGHT, + timeSelectTypes: [DynamicDateTimeSelect.HOUR, DynamicDateTimeSelect.MINUTE, DynamicDateTimeSelect.SECOND], }; } render() { - const { editorHeight } = this.options; + const { editorHeight, timeSelectTypes } = this.options; return { type: CenterAdaptLayout.xtype, @@ -44,6 +45,8 @@ export class DynamicDateTimeSelect extends Widget { { el: { type: NumberEditor.xtype, + disabled: !timeSelectTypes.includes(DynamicDateTimeSelect.HOUR), + warningTitle: i18nText("BI-Basic_Do_Not_Support_Modification"), ref: _ref => { this.hour = _ref; }, @@ -89,6 +92,8 @@ export class DynamicDateTimeSelect extends Widget { }, { type: NumberEditor.xtype, + disabled: !timeSelectTypes.includes(DynamicDateTimeSelect.MINUTE), + warningTitle: i18nText("BI-Basic_Do_Not_Support_Modification"), ref: _ref => { this.minute = _ref; }, @@ -133,6 +138,8 @@ export class DynamicDateTimeSelect extends Widget { }, { type: NumberEditor.xtype, + disabled: !timeSelectTypes.includes(DynamicDateTimeSelect.SECOND), + warningTitle: i18nText("BI-Basic_Do_Not_Support_Modification"), ref: _ref => { this.second = _ref; }, diff --git a/packages/fineui/src/widget/numbereditor/number.editor.js b/packages/fineui/src/widget/numbereditor/number.editor.js index 1adc95ce4..054830699 100644 --- a/packages/fineui/src/widget/numbereditor/number.editor.js +++ b/packages/fineui/src/widget/numbereditor/number.editor.js @@ -1,6 +1,5 @@ import { shortcut, - Widget, extend, emptyFn, createWidget, @@ -18,9 +17,10 @@ import { import { SignEditor } from "@/case"; import { TextEditor } from "../editor"; import { IconButton } from "@/base"; +import { Single } from "../../base/single"; @shortcut() -export class NumberEditor extends Widget { +export class NumberEditor extends Single { static xtype = "bi.number_editor"; static EVENT_CONFIRM = "EVENT_CONFIRM"; diff --git a/packages/fineui/src/widget/timeinterval/timeinterval.js b/packages/fineui/src/widget/timeinterval/timeinterval.js index b1c9848c2..47e6d0210 100644 --- a/packages/fineui/src/widget/timeinterval/timeinterval.js +++ b/packages/fineui/src/widget/timeinterval/timeinterval.js @@ -76,6 +76,7 @@ export class TimeInterval extends Single { const o = this.options; const combo = createWidget({ type: DynamicDateTimeCombo.xtype, + timeSelectTypes: o.timeSelectTypes, simple: o.simple, supportDynamic: o.supportDynamic, minDate: o.minDate, diff --git a/packages/fineui/src/widget/yearinterval/yearinterval.js b/packages/fineui/src/widget/yearinterval/yearinterval.js index 42172300f..d82ee5654 100644 --- a/packages/fineui/src/widget/yearinterval/yearinterval.js +++ b/packages/fineui/src/widget/yearinterval/yearinterval.js @@ -28,6 +28,7 @@ export class YearInterval extends Single { minDate: "1900-01-01", maxDate: "2099-12-31", supportDynamic: true, + simple: false, }; static EVENT_VALID = "EVENT_VALID"; @@ -71,6 +72,7 @@ export class YearInterval extends Single { const o = this.options; const combo = createWidget({ type: DynamicYearCombo.xtype, + simple: o.simple, supportDynamic: o.supportDynamic, minDate: o.minDate, maxDate: o.maxDate, diff --git a/packages/fineui/src/widget/yearquarterinterval/yearquarterinterval.js b/packages/fineui/src/widget/yearquarterinterval/yearquarterinterval.js index 16fa9f4a5..e6ea96a7d 100644 --- a/packages/fineui/src/widget/yearquarterinterval/yearquarterinterval.js +++ b/packages/fineui/src/widget/yearquarterinterval/yearquarterinterval.js @@ -28,6 +28,7 @@ export class YearQuarterInterval extends Single { minDate: "1900-01-01", maxDate: "2099-12-31", supportDynamic: true, + simple: false, }; static EVENT_VALID = "EVENT_VALID"; @@ -71,6 +72,7 @@ export class YearQuarterInterval extends Single { const o = this.options; const combo = createWidget({ type: DynamicYearQuarterCombo.xtype, + simple: o.simple, supportDynamic: o.supportDynamic, minDate: o.minDate, maxDate: o.maxDate, diff --git a/packages/fineui/typescript/index.ts b/packages/fineui/typescript/index.ts index 3e85c960b..97de6153e 100644 --- a/packages/fineui/typescript/index.ts +++ b/packages/fineui/typescript/index.ts @@ -167,8 +167,10 @@ export { BubblePopupView, BubblePopupBarView, TextBubblePopupBarView } from "./c export { ArrowTreeGroupNodeCheckbox } from "./case/checkbox/check.arrownode"; export { NumberInterval } from "./widget/numberinterval/numberinterval"; export { DynamicYearQuarterCombo } from "./widget/yearquarter/combo.yearquarter"; +export { YearQuarterInterval } from "./widget/yearquarterinterval/yearquarterinterval"; export { DynamicYearCombo } from "./widget/year/combo.year"; export { DynamicYearPopup } from "./widget/year/popup.year"; +export { YearInterval } from "./widget/yearinterval/yearinterval"; export { IntervalSlider } from "./widget/intervalslider/intervalslider"; export { MultiSelectInsertList } from "./widget/multiselectlist/multiselectlist.insert"; export { YearMonthInterval } from "./widget/yearmonthinterval/yearmonthinterval"; diff --git a/packages/fineui/typescript/widget/dynamicdate/dynamicdate.combo.ts b/packages/fineui/typescript/widget/dynamicdate/dynamicdate.combo.ts index 305a71c4f..e9a54490a 100644 --- a/packages/fineui/typescript/widget/dynamicdate/dynamicdate.combo.ts +++ b/packages/fineui/typescript/widget/dynamicdate/dynamicdate.combo.ts @@ -25,6 +25,7 @@ export declare class DynamicDateCombo extends Single { tabIndex?: number; }; watermark?: string; + simple?: boolean; } & Single['props'] setMinDate(minDate: string): void; diff --git a/packages/fineui/typescript/widget/dynamicdatetime/dynamicdatetime.combo.ts b/packages/fineui/typescript/widget/dynamicdatetime/dynamicdatetime.combo.ts index 268372758..120f38ef3 100644 --- a/packages/fineui/typescript/widget/dynamicdatetime/dynamicdatetime.combo.ts +++ b/packages/fineui/typescript/widget/dynamicdatetime/dynamicdatetime.combo.ts @@ -25,6 +25,8 @@ export declare class DynamicDateTimeCombo extends Single { watermark?: string; } & Single['props']; + getValue(): DynamicDateTimeComboValue; + setMinDate(minDate: string): void; setMaxDate(minDate: string): void; @@ -39,3 +41,15 @@ export declare class DynamicDateTimeCombo extends Single { setWaterMark(v: string): void } + +export interface DynamicDateTimeComboValue { + type: number; + value: { + year: number; + month: number; + day: number; + hour: number; + minute: number; + second: number; + }; +} diff --git a/packages/fineui/typescript/widget/timeinterval/timeinterval.ts b/packages/fineui/typescript/widget/timeinterval/timeinterval.ts index d9596e4fd..87d4fd977 100644 --- a/packages/fineui/typescript/widget/timeinterval/timeinterval.ts +++ b/packages/fineui/typescript/widget/timeinterval/timeinterval.ts @@ -1,5 +1,5 @@ import { Single } from "../../base/single/single"; -import { DynamicDataComboValue } from "../dynamicdate/dynamicdate.combo"; +import { DynamicDateTimeComboValue } from "../dynamicdatetime/dynamicdatetime.combo"; export declare class TimeInterval extends Single { static xtype: string; @@ -13,11 +13,11 @@ export declare class TimeInterval extends Single { supportDynamic?: boolean; watermark?: string; simple?: boolean; - } & Single['props'] + } & Single['props']; getValue(): { - start: DynamicDataComboValue; - end: DynamicDataComboValue; + start: DynamicDateTimeComboValue; + end: DynamicDateTimeComboValue; }; setMinDate(minDate: string): void; diff --git a/packages/fineui/typescript/widget/year/combo.year.ts b/packages/fineui/typescript/widget/year/combo.year.ts index 605f1700d..5b9b21acb 100644 --- a/packages/fineui/typescript/widget/year/combo.year.ts +++ b/packages/fineui/typescript/widget/year/combo.year.ts @@ -7,7 +7,16 @@ export declare class DynamicYearCombo extends Widget { static EVENT_CONFIRM: string; static EVENT_BEFORE_POPUPVIEW: string; + getValue(): DynamicYearComboValue; + setMinDate(minDate: string): void; setMaxDate(maxDate: string): void; } + +export interface DynamicYearComboValue { + type: number; + value: { + year: number; + }; +} diff --git a/packages/fineui/typescript/widget/yearinterval/yearinterval.ts b/packages/fineui/typescript/widget/yearinterval/yearinterval.ts new file mode 100644 index 000000000..36461498a --- /dev/null +++ b/packages/fineui/typescript/widget/yearinterval/yearinterval.ts @@ -0,0 +1,23 @@ +import { Single } from "../../base/single/single"; +import { DynamicYearComboValue } from "../year/combo.year"; + +export declare class YearInterval extends Single { + static xtype: string; + static EVENT_VALID: string; + static EVENT_ERROR: string; + static EVENT_CHANGE: string; + static EVENT_BEFORE_POPUPVIEW: string; + + props: { + simple?: boolean; + } & Single['props']; + + getValue(): { + start: DynamicYearComboValue; + end: DynamicYearComboValue; + }; + + setMinDate(minDate: string): void; + + setMaxDate(maxDate: string): void; +} diff --git a/packages/fineui/typescript/widget/yearmonth/combo.yearmonth.ts b/packages/fineui/typescript/widget/yearmonth/combo.yearmonth.ts index 557173441..10f198e46 100644 --- a/packages/fineui/typescript/widget/yearmonth/combo.yearmonth.ts +++ b/packages/fineui/typescript/widget/yearmonth/combo.yearmonth.ts @@ -12,7 +12,18 @@ export declare class DynamicYearMonthCombo extends Single { getKey(): string; + getValue(): DynamicYearMonthComboValue; + setMinDate(minDate: string): void; setMaxDate(maxDate: string): void; } + +export interface DynamicYearMonthComboValue { + type: number; + value: { + year: number; + month: number; + }; +} + diff --git a/packages/fineui/typescript/widget/yearmonthinterval/yearmonthinterval.ts b/packages/fineui/typescript/widget/yearmonthinterval/yearmonthinterval.ts index 0c12744ae..9da536c22 100644 --- a/packages/fineui/typescript/widget/yearmonthinterval/yearmonthinterval.ts +++ b/packages/fineui/typescript/widget/yearmonthinterval/yearmonthinterval.ts @@ -1,4 +1,5 @@ import { Single } from '../../base/single/single'; +import { DynamicYearMonthComboValue } from '../yearmonth/combo.yearmonth'; export declare class YearMonthInterval extends Single { static xtype: string; @@ -7,9 +8,13 @@ export declare class YearMonthInterval extends Single { static EVENT_CHANGE: string; static EVENT_BEFORE_POPUPVIEW: string; + props: { + simple?: boolean; + } & Single['props']; + getValue(): { - start: number; - end: number; + start: DynamicYearMonthComboValue; + end: DynamicYearMonthComboValue; }; setMinDate(minDate: string): void; diff --git a/packages/fineui/typescript/widget/yearquarter/combo.yearquarter.ts b/packages/fineui/typescript/widget/yearquarter/combo.yearquarter.ts index b1e42df97..f1a07770b 100644 --- a/packages/fineui/typescript/widget/yearquarter/combo.yearquarter.ts +++ b/packages/fineui/typescript/widget/yearquarter/combo.yearquarter.ts @@ -5,7 +5,17 @@ export declare class DynamicYearQuarterCombo extends Widget { static EVENT_CONFIRM: string; static EVENT_BEFORE_POPUPVIEW: string; + getValue(): DynamicYearQuarterComboValue; + setMinDate(minDate: string): void; setMaxDate(maxDate: string): void; } + +export interface DynamicYearQuarterComboValue { + type: number; + value: { + year: number; + quarter: number; + }; +} diff --git a/packages/fineui/typescript/widget/yearquarterinterval/yearquarterinterval.ts b/packages/fineui/typescript/widget/yearquarterinterval/yearquarterinterval.ts new file mode 100644 index 000000000..30f90abcf --- /dev/null +++ b/packages/fineui/typescript/widget/yearquarterinterval/yearquarterinterval.ts @@ -0,0 +1,23 @@ +import { Single } from "../../base/single/single"; +import { DynamicYearQuarterComboValue } from "../yearquarter/combo.yearquarter"; + +export declare class YearQuarterInterval extends Single { + static xtype: string; + static EVENT_VALID: string; + static EVENT_ERROR: string; + static EVENT_CHANGE: string; + static EVENT_BEFORE_POPUPVIEW: string; + + props: { + simple?: boolean; + } & Single['props']; + + getValue(): { + start: DynamicYearQuarterComboValue; + end: DynamicYearQuarterComboValue; + }; + + setMinDate(minDate: string): void; + + setMaxDate(maxDate: string): void; +}