|
|
|
@ -32,6 +32,7 @@ export class DynamicYearQuarterPopup extends Widget {
|
|
|
|
|
max: "2099-12-31", |
|
|
|
|
width: 180, |
|
|
|
|
supportDynamic: true, |
|
|
|
|
isShow: false, // 是否是预览状态
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
static BUTTON_CLEAR_EVENT_CHANGE = "BUTTON_CLEAR_EVENT_CHANGE"; |
|
|
|
@ -41,7 +42,7 @@ export class DynamicYearQuarterPopup extends Widget {
|
|
|
|
|
|
|
|
|
|
render() { |
|
|
|
|
this.storeValue = { type: DynamicYearQuarterCombo.Static }; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return { |
|
|
|
|
type: VerticalLayout.xtype, |
|
|
|
|
items: [ |
|
|
|
@ -157,7 +158,7 @@ export class DynamicYearQuarterPopup extends Widget {
|
|
|
|
|
_checkTodayValid() { |
|
|
|
|
const o = this.options; |
|
|
|
|
const today = getDate(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return !!checkDateVoid( |
|
|
|
|
today.getFullYear(), |
|
|
|
|
today.getMonth() + 1, |
|
|
|
@ -169,7 +170,7 @@ export class DynamicYearQuarterPopup extends Widget {
|
|
|
|
|
|
|
|
|
|
_getTabJson() { |
|
|
|
|
const o = this.options; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return { |
|
|
|
|
type: Tab.xtype, |
|
|
|
|
logic: { |
|
|
|
@ -263,8 +264,8 @@ export class DynamicYearQuarterPopup extends Widget {
|
|
|
|
|
default: |
|
|
|
|
if ( |
|
|
|
|
this.storeValue && |
|
|
|
|
this.storeValue.type === |
|
|
|
|
DynamicYearQuarterCombo.Dynamic |
|
|
|
|
this.storeValue.type === |
|
|
|
|
DynamicYearQuarterCombo.Dynamic |
|
|
|
|
) { |
|
|
|
|
this.dynamicPane.setValue( |
|
|
|
|
this.storeValue.value |
|
|
|
@ -304,10 +305,22 @@ export class DynamicYearQuarterPopup extends Widget {
|
|
|
|
|
v = v || {}; |
|
|
|
|
const type = v.type || DynamicDateCombo.Static; |
|
|
|
|
const value = v.value || v; |
|
|
|
|
this.dateTab.setSelect(type); |
|
|
|
|
const { isShow } = this.options; |
|
|
|
|
let date; |
|
|
|
|
|
|
|
|
|
// 如果是预览状态 直接打开静态页面
|
|
|
|
|
this.dateTab.setSelect(isShow ? DynamicDateCombo.Static : type); |
|
|
|
|
switch (type) { |
|
|
|
|
case DynamicDateCombo.Dynamic: |
|
|
|
|
this.dynamicPane.setValue(value); |
|
|
|
|
if (isShow) { |
|
|
|
|
date = DynamicDateHelper.getCalculation(value); |
|
|
|
|
this.year.setValue({ |
|
|
|
|
year: date.getFullYear(), |
|
|
|
|
quarter: getQuarter(date), |
|
|
|
|
}); |
|
|
|
|
} else { |
|
|
|
|
this.dynamicPane.setValue(value); |
|
|
|
|
} |
|
|
|
|
this._setInnerValue(); |
|
|
|
|
break; |
|
|
|
|
case DynamicDateCombo.Static: |
|
|
|
|