From 31f53885503899950c404dcf5f711dd6338357f5 Mon Sep 17 00:00:00 2001 From: windy <1374721899@qq.com> Date: Wed, 30 Jun 2021 15:45:52 +0800 Subject: [PATCH 1/8] =?UTF-8?q?BI-88967=20=E5=8F=AF=E9=85=8D=E5=85=A8?= =?UTF-8?q?=E5=B1=80widget=E5=AE=BD=E9=AB=98=E5=B0=BA=E5=AF=B8(=E9=83=A8?= =?UTF-8?q?=E5=88=86)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/case/calendar/calendar.year.js | 4 +- src/case/combo/iconcombo/popup.iconcombo.js | 4 +- .../icontextvaluecombo/popup.icontextvalue.js | 6 +-- .../combo/textvaluecombo/popup.textvalue.js | 4 +- src/case/layer/layer.multipopup.js | 2 +- src/core/platform/web/size.js | 49 +++++++++++++++++++ src/widget/downlist/item.downlist.js | 2 +- src/widget/downlist/popup.downlist.js | 2 +- .../dynamicdate/dynamicdate.param.item.js | 26 +++++----- src/widget/multiselect/multiselect.combo.js | 2 +- .../multiselect/multiselect.combo.nobar.js | 2 +- .../multiselect/multiselect.insert.combo.js | 2 +- .../multiselect.insert.combo.nobar.js | 2 +- src/widget/multiselect/multiselect.loader.js | 4 +- .../multiselect/multiselect.loader.nobar.js | 4 +- .../multiselect/multiselect.popup.view.js | 2 +- .../multiselect.popup.view.nobar.js | 2 +- .../search/multiselect.search.insert.pane.js | 4 +- .../search/multiselect.search.loader.js | 2 +- .../multiselectlist/multiselectlist.insert.js | 10 ++-- .../multiselectlist.insert.nobar.js | 2 +- src/widget/multiselectlist/multiselectlist.js | 2 +- src/widget/year/card.dynamic.year.js | 2 +- src/widget/year/popup.year.js | 9 ++-- 24 files changed, 100 insertions(+), 50 deletions(-) create mode 100644 src/core/platform/web/size.js diff --git a/src/case/calendar/calendar.year.js b/src/case/calendar/calendar.year.js index 2d9d968417..7de7811594 100644 --- a/src/case/calendar/calendar.year.js +++ b/src/case/calendar/calendar.year.js @@ -51,7 +51,7 @@ BI.YearCalendar = BI.inherit(BI.Widget, { columns: 2, rows: 6, columnSize: [1 / 2, 1 / 2], - rowSize: 24 + rowSize: BI.SIZE_CONSANTS.LIST_ITEM_HEIGHT, })), { type: "bi.center_adapt", vgap: 1 @@ -110,7 +110,7 @@ BI.YearCalendar = BI.inherit(BI.Widget, { whiteSpace: "normal", once: false, forceSelected: true, - height: 24, + height: BI.SIZE_CONSANTS.LIST_ITEM_HEIGHT, width: 45, value: td.text, disabled: td.disabled diff --git a/src/case/combo/iconcombo/popup.iconcombo.js b/src/case/combo/iconcombo/popup.iconcombo.js index 3cc4fcd32f..0c6067bac0 100644 --- a/src/case/combo/iconcombo/popup.iconcombo.js +++ b/src/case/combo/iconcombo/popup.iconcombo.js @@ -19,7 +19,7 @@ BI.IconComboPopup = BI.inherit(BI.Pane, { type: "bi.button_group", items: BI.createItems(o.items, { type: "bi.single_select_icon_text_item", - height: 24 + height: BI.SIZE_CONSANTS.LIST_ITEM_HEIGHT, }), chooseType: o.chooseType, layouts: [{ @@ -47,7 +47,7 @@ BI.IconComboPopup = BI.inherit(BI.Pane, { BI.IconComboPopup.superclass.populate.apply(this, arguments); items = BI.createItems(items, { type: "bi.single_select_icon_text_item", - height: 24 + height: BI.SIZE_CONSANTS.LIST_ITEM_HEIGHT, }); this.popup.populate(items); }, diff --git a/src/case/combo/icontextvaluecombo/popup.icontextvalue.js b/src/case/combo/icontextvaluecombo/popup.icontextvalue.js index 424b0dd806..993bceb456 100644 --- a/src/case/combo/icontextvaluecombo/popup.icontextvalue.js +++ b/src/case/combo/icontextvaluecombo/popup.icontextvalue.js @@ -20,7 +20,7 @@ BI.IconTextValueComboPopup = BI.inherit(BI.Pane, { type: "bi.button_group", items: BI.createItems(o.items, { type: "bi.single_select_icon_text_item", - height: 24, + height: BI.SIZE_CONSANTS.LIST_ITEM_HEIGHT, iconHeight: o.iconHeight, iconWidth: o.iconWidth, iconWrapperWidth: o.iconWrapperWidth @@ -55,10 +55,10 @@ BI.IconTextValueComboPopup = BI.inherit(BI.Pane, { var o = this.options; items = BI.createItems(items, { type: "bi.single_select_icon_text_item", - height: 24, + height: BI.SIZE_CONSANTS.LIST_ITEM_HEIGHT, iconWrapperWidth: o.iconWrapperWidth, iconHeight: o.iconHeight, - iconWidth: o.iconWidth + iconWidth: o.iconWidth, }); this.popup.populate(items, keyword); }, diff --git a/src/case/combo/textvaluecombo/popup.textvalue.js b/src/case/combo/textvaluecombo/popup.textvalue.js index cf68deefa9..5b3c0a8ee1 100644 --- a/src/case/combo/textvaluecombo/popup.textvalue.js +++ b/src/case/combo/textvaluecombo/popup.textvalue.js @@ -14,7 +14,7 @@ BI.TextValueComboPopup = BI.inherit(BI.Pane, { items: BI.createItems(o.items, { type: "bi.single_select_item", textAlign: o.textAlign, - height: 24 + height: BI.SIZE_CONSANTS.LIST_ITEM_HEIGHT, }), chooseType: o.chooseType, layouts: [{ @@ -43,7 +43,7 @@ BI.TextValueComboPopup = BI.inherit(BI.Pane, { BI.TextValueComboPopup.superclass.populate.apply(this, arguments); items = BI.createItems(items, { type: "bi.single_select_item", - height: 24 + height: BI.SIZE_CONSANTS.LIST_ITEM_HEIGHT, }); this.popup.populate(items); }, diff --git a/src/case/layer/layer.multipopup.js b/src/case/layer/layer.multipopup.js index ec937a172c..3979c69271 100644 --- a/src/case/layer/layer.multipopup.js +++ b/src/case/layer/layer.multipopup.js @@ -31,7 +31,7 @@ BI.MultiPopupView = BI.inherit(BI.PopupView, { this.buttongroup = BI.createWidget({ type: "bi.button_group", cls: "list-view-toolbar bi-high-light bi-split-top", - height: 24, + height: BI.SIZE_CONSANTS.LIST_ITEM_HEIGHT, items: BI.createItems(text, { type: "bi.text_button", once: false, diff --git a/src/core/platform/web/size.js b/src/core/platform/web/size.js new file mode 100644 index 0000000000..053c05c8e2 --- /dev/null +++ b/src/core/platform/web/size.js @@ -0,0 +1,49 @@ +/** + * @author windy + * @version 2.0 + * Created by windy on 2021/6/30 + */ +_.extend(BI, { + VIEW_SIZE: { + SMALL: 1, + NORMAL: 2, + BIG: 3, + CUSTOM: 4, + }, +}); +BI.Func = BI.Func || {}; +_.extend(BI.Func, { + + /** + * 默认提供三种尺寸类型,small, normal, big + * 也可以在此基础上适用类型custom定制尺寸 + * @param opt + */ + switchWidgetSizeConfig: function(opt) { + switch (opt.type) { + case BI.VIEW_SIZE.BIG: + opt.TOOL_BAR_HEIGHT = 30; + opt.LIST_ITEM_HEIGHT = 30; + opt.TRIGGER_HEIGHT = 30; + break; + case BI.VIEW_SIZE.SMALL: + case BI.VIEW_SIZE.NORMAL: + default: + break; + } + + BI.config('bi.constant.widget.size', function (ob) { + return BI.extend(ob, opt); + }); + }, +}); + +BI.constant('bi.constant.widget.size', { + TOOL_BAR_HEIGHT: 24, + LIST_ITEM_HEIGHT: 24, + TRIGGER_HEIGHT: 24, +}); + +BI.prepares.push(function () { + BI.SIZE_CONSANTS = BI.Constants.getConstant('bi.constant.widget.size'); +}); diff --git a/src/widget/downlist/item.downlist.js b/src/widget/downlist/item.downlist.js index f05fa2e5d0..068c94fabe 100644 --- a/src/widget/downlist/item.downlist.js +++ b/src/widget/downlist/item.downlist.js @@ -4,7 +4,7 @@ BI.DownListItem = BI.inherit(BI.BasicButton, { return BI.extend(conf, { baseCls: "bi-down-list-item bi-list-item-active", cls: "", - height: 24, + height: BI.SIZE_CONSANTS.LIST_ITEM_HEIGHT, logic: { dynamic: true }, diff --git a/src/widget/downlist/popup.downlist.js b/src/widget/downlist/popup.downlist.js index fbf2c2492a..b9ebed40e7 100644 --- a/src/widget/downlist/popup.downlist.js +++ b/src/widget/downlist/popup.downlist.js @@ -98,7 +98,7 @@ BI.DownListPopup = BI.inherit(BI.Pane, { item.el.logic = { dynamic: true }; - item.el.height = item.el.height || self.constants.height; + item.el.height = item.el.height || BI.SIZE_CONSANTS.LIST_ITEM_HEIGHT; item.el.iconCls2 = self.constants.nextIcon; item.popup = { lgap: 1, diff --git a/src/widget/dynamicdate/dynamicdate.param.item.js b/src/widget/dynamicdate/dynamicdate.param.item.js index 1db32d44c9..c8771e9080 100644 --- a/src/widget/dynamicdate/dynamicdate.param.item.js +++ b/src/widget/dynamicdate/dynamicdate.param.item.js @@ -1,14 +1,16 @@ BI.DynamicDateParamItem = BI.inherit(BI.Widget, { - props: { - baseCls: "bi-dynamic-date-param-item", - dateType: BI.DynamicDateCard.TYPE.YEAR, - validationChecker: function() { - return true; - }, - value: 0, - offset: 0, - height: 24 + props: function() { + return { + baseCls: "bi-dynamic-date-param-item", + dateType: BI.DynamicDateCard.TYPE.YEAR, + validationChecker: function() { + return true; + }, + value: 0, + offset: 0, + height: BI.SIZE_CONSANTS.TOOL_BAR_HEIGHT, + } }, render: function () { @@ -19,7 +21,7 @@ BI.DynamicDateParamItem = BI.inherit(BI.Widget, { el: { type: "bi.sign_editor", cls: "bi-border", - height: 22, + height: BI.SIZE_CONSANTS.TOOL_BAR_HEIGHT - 2, validationChecker: function (v) { return BI.isNaturalNumber(v); }, @@ -47,13 +49,13 @@ BI.DynamicDateParamItem = BI.inherit(BI.Widget, { }, { el: { type: "bi.label", - height: 24, + height: BI.SIZE_CONSANTS.TOOL_BAR_HEIGHT, text: this._getText() }, width: o.dateType === BI.DynamicDateCard.TYPE.WORK_DAY ? 60 : 20 }, { type: "bi.text_value_combo", - height: 24, + height: BI.SIZE_CONSANTS.TOOL_BAR_HEIGHT, items: [{ text: BI.i18nText("BI-Basic_Front"), value: 0 diff --git a/src/widget/multiselect/multiselect.combo.js b/src/widget/multiselect/multiselect.combo.js index b57185335e..339e02af0b 100644 --- a/src/widget/multiselect/multiselect.combo.js +++ b/src/widget/multiselect/multiselect.combo.js @@ -10,7 +10,7 @@ BI.MultiSelectCombo = BI.inherit(BI.Single, { baseCls: "bi-multi-select-combo", itemsCreator: BI.emptyFn, valueFormatter: BI.emptyFn, - itemHeight: 24, + itemHeight: BI.SIZE_CONSANTS.LIST_ITEM_HEIGHT, height: 24, allowEdit: true }); diff --git a/src/widget/multiselect/multiselect.combo.nobar.js b/src/widget/multiselect/multiselect.combo.nobar.js index 6203175e4a..70c6b5db22 100644 --- a/src/widget/multiselect/multiselect.combo.nobar.js +++ b/src/widget/multiselect/multiselect.combo.nobar.js @@ -10,7 +10,7 @@ BI.MultiSelectNoBarCombo = BI.inherit(BI.Single, { baseCls: "bi-multi-select-combo-no-bar", itemsCreator: BI.emptyFn, valueFormatter: BI.emptyFn, - itemHeight: 24, + itemHeight: BI.SIZE_CONSANTS.LIST_ITEM_HEIGHT, height: 24, }); }, diff --git a/src/widget/multiselect/multiselect.insert.combo.js b/src/widget/multiselect/multiselect.insert.combo.js index db225e95f0..9c3b979095 100644 --- a/src/widget/multiselect/multiselect.insert.combo.js +++ b/src/widget/multiselect/multiselect.insert.combo.js @@ -11,7 +11,7 @@ BI.MultiSelectInsertCombo = BI.inherit(BI.Single, { itemsCreator: BI.emptyFn, valueFormatter: BI.emptyFn, height: 24, - itemHeight: 24, + itemHeight: BI.SIZE_CONSANTS.LIST_ITEM_HEIGHT, allowEdit: true }); }, diff --git a/src/widget/multiselect/multiselect.insert.combo.nobar.js b/src/widget/multiselect/multiselect.insert.combo.nobar.js index 2fb735ba61..0bd836397e 100644 --- a/src/widget/multiselect/multiselect.insert.combo.nobar.js +++ b/src/widget/multiselect/multiselect.insert.combo.nobar.js @@ -10,7 +10,7 @@ BI.MultiSelectInsertNoBarCombo = BI.inherit(BI.Single, { baseCls: "bi-multi-select-insert-combo-no-bar", itemsCreator: BI.emptyFn, valueFormatter: BI.emptyFn, - itemsHeight: 24, + itemHeight: BI.SIZE_CONSANTS.LIST_ITEM_HEIGHT, height: 24, }); }, diff --git a/src/widget/multiselect/multiselect.loader.js b/src/widget/multiselect/multiselect.loader.js index fdfb2d1aa7..4996f12daa 100644 --- a/src/widget/multiselect/multiselect.loader.js +++ b/src/widget/multiselect/multiselect.loader.js @@ -18,7 +18,7 @@ BI.MultiSelectLoader = BI.inherit(BI.Widget, { valueFormatter: BI.emptyFn, itemsCreator: BI.emptyFn, onLoaded: BI.emptyFn, - itemHeight: 24 + itemHeight: BI.SIZE_CONSANTS.LIST_ITEM_HEIGHT, }); }, @@ -126,7 +126,7 @@ BI.MultiSelectLoader = BI.inherit(BI.Widget, { type: "bi.multi_select_item", logic: this.options.logic, cls: "bi-list-item-active", - height: this.options.itemHeight, + height: this.options.itemHeight || BI.SIZE_CONSANTS.LIST_ITEM_HEIGHT, selected: this.isAllSelected(), iconWrapperWidth: 36 }); diff --git a/src/widget/multiselect/multiselect.loader.nobar.js b/src/widget/multiselect/multiselect.loader.nobar.js index 8f469e62e4..d7744d042f 100644 --- a/src/widget/multiselect/multiselect.loader.nobar.js +++ b/src/widget/multiselect/multiselect.loader.nobar.js @@ -17,7 +17,7 @@ BI.MultiSelectNoBarLoader = BI.inherit(BI.Widget, { }, valueFormatter: BI.emptyFn, itemsCreator: BI.emptyFn, - itemHeight: 24, + itemHeight: BI.SIZE_CONSANTS.LIST_ITEM_HEIGHT, onLoaded: BI.emptyFn }); }, @@ -117,7 +117,7 @@ BI.MultiSelectNoBarLoader = BI.inherit(BI.Widget, { type: "bi.multi_select_item", cls: "bi-list-item-active", logic: this.options.logic, - height: this.options.itemHeight, + height: this.options.itemHeight || BI.SIZE_CONSANTS.LIST_ITEM_HEIGHT, iconWrapperWidth: 36 }); }, diff --git a/src/widget/multiselect/multiselect.popup.view.js b/src/widget/multiselect/multiselect.popup.view.js index 1343eb2f09..9c6bac7f0f 100644 --- a/src/widget/multiselect/multiselect.popup.view.js +++ b/src/widget/multiselect/multiselect.popup.view.js @@ -14,7 +14,7 @@ BI.MultiSelectPopupView = BI.inherit(BI.Widget, { valueFormatter: BI.emptyFn, itemsCreator: BI.emptyFn, onLoaded: BI.emptyFn, - itemHeight: 24, + itemHeight: BI.SIZE_CONSANTS.LIST_ITEM_HEIGHT, }); }, diff --git a/src/widget/multiselect/multiselect.popup.view.nobar.js b/src/widget/multiselect/multiselect.popup.view.nobar.js index 55428df4f1..f5ba1cebd0 100644 --- a/src/widget/multiselect/multiselect.popup.view.nobar.js +++ b/src/widget/multiselect/multiselect.popup.view.nobar.js @@ -13,7 +13,7 @@ BI.MultiSelectNoBarPopupView = BI.inherit(BI.Widget, { maxHeight: 400, valueFormatter: BI.emptyFn, itemsCreator: BI.emptyFn, - itemHeight: 24, + itemHeight: BI.SIZE_CONSANTS.LIST_ITEM_HEIGHT, onLoaded: BI.emptyFn }); }, diff --git a/src/widget/multiselect/search/multiselect.search.insert.pane.js b/src/widget/multiselect/search/multiselect.search.insert.pane.js index 7513408fe0..d5195979c5 100644 --- a/src/widget/multiselect/search/multiselect.search.insert.pane.js +++ b/src/widget/multiselect/search/multiselect.search.insert.pane.js @@ -30,7 +30,7 @@ BI.MultiSelectSearchInsertPane = BI.inherit(BI.Widget, { this.addNotMatchTip = BI.createWidget({ type: "bi.label", text: BI.i18nText("BI-Basic_Click_To_Add_Text", ""), - height: this.constants.height, + height: BI.SIZE_CONSANTS.LIST_ITEM_HEIGHT, cls: "bi-high-light", hgap: 5, }); @@ -57,7 +57,7 @@ BI.MultiSelectSearchInsertPane = BI.inherit(BI.Widget, { element: this, items: [{ el: this.addNotMatchTip, - height: this.constants.height, + height: BI.SIZE_CONSANTS.LIST_ITEM_HEIGHT, }, { el: this.loader, }], diff --git a/src/widget/multiselect/search/multiselect.search.loader.js b/src/widget/multiselect/search/multiselect.search.loader.js index 2ea43383c4..c32bbc0a32 100644 --- a/src/widget/multiselect/search/multiselect.search.loader.js +++ b/src/widget/multiselect/search/multiselect.search.loader.js @@ -92,7 +92,7 @@ BI.MultiSelectSearchLoader = BI.inherit(BI.Widget, { logic: { dynamic: false }, - height: this.options.itemHeight, + height: this.options.itemHeight || BI.SIZE_CONSANTS.LIST_ITEM_HEIGHT, selected: this.isAllSelected(), cls: "bi-list-item-active", iconWrapperWidth: 36 diff --git a/src/widget/multiselectlist/multiselectlist.insert.js b/src/widget/multiselectlist/multiselectlist.insert.js index f4cea55c3d..419e96eb3c 100644 --- a/src/widget/multiselectlist/multiselectlist.insert.js +++ b/src/widget/multiselectlist/multiselectlist.insert.js @@ -7,8 +7,8 @@ BI.MultiSelectInsertList = BI.inherit(BI.Single, { baseCls: "bi-multi-select-insert-list", itemsCreator: BI.emptyFn, valueFormatter: BI.emptyFn, - searcherHeight: 24, - itemHeight: 24 + searcherHeight: BI.SIZE_CONSANTS.TRIGGER_HEIGHT, + itemHeight: BI.SIZE_CONSANTS.LIST_ITEM_HEIGHT, }); }, _init: function () { @@ -71,7 +71,7 @@ BI.MultiSelectInsertList = BI.inherit(BI.Single, { ref: function (ref) { self.editor = ref; }, - height: o.searcherHeight, + height: o.searcherHeight || BI.SIZE_CONSANTS.TRIGGER_HEIGHT, }, isAutoSearch: false, isAutoSync: false, @@ -164,7 +164,7 @@ BI.MultiSelectInsertList = BI.inherit(BI.Single, { element: this, items: [{ el: this.trigger, - height: o.searcherHeight + height: o.searcherHeight || BI.SIZE_CONSANTS.TRIGGER_HEIGHT, }, { el: this.adapter, height: "fill" @@ -175,7 +175,7 @@ BI.MultiSelectInsertList = BI.inherit(BI.Single, { element: this, items: [{ el: this.searcherPane, - top: o.searcherHeight, + top: o.searcherHeight || BI.SIZE_CONSANTS.TRIGGER_HEIGHT, bottom: 0, left: 0, right: 0 diff --git a/src/widget/multiselectlist/multiselectlist.insert.nobar.js b/src/widget/multiselectlist/multiselectlist.insert.nobar.js index bbb6c23bbf..9b0e7b21e9 100644 --- a/src/widget/multiselectlist/multiselectlist.insert.nobar.js +++ b/src/widget/multiselectlist/multiselectlist.insert.nobar.js @@ -7,7 +7,7 @@ BI.MultiSelectInsertNoBarList = BI.inherit(BI.Single, { baseCls: "bi-multi-select-insert-list", itemsCreator: BI.emptyFn, valueFormatter: BI.emptyFn, - searcherHeight: 24 + searcherHeight: BI.SIZE_CONSANTS.LIST_ITEM_HEIGHT, }); }, _init: function () { diff --git a/src/widget/multiselectlist/multiselectlist.js b/src/widget/multiselectlist/multiselectlist.js index e4a046793b..feea0fb2fd 100644 --- a/src/widget/multiselectlist/multiselectlist.js +++ b/src/widget/multiselectlist/multiselectlist.js @@ -8,7 +8,7 @@ BI.MultiSelectList = BI.inherit(BI.Widget, { itemsCreator: BI.emptyFn, valueFormatter: BI.emptyFn, searcherHeight: 24, - itemHeight: 24 + itemHeight: BI.SIZE_CONSANTS.LIST_ITEM_HEIGHT, }); }, _init: function () { diff --git a/src/widget/year/card.dynamic.year.js b/src/widget/year/card.dynamic.year.js index 536fc01636..b38d55119e 100644 --- a/src/widget/year/card.dynamic.year.js +++ b/src/widget/year/card.dynamic.year.js @@ -22,7 +22,7 @@ BI.DynamicYearCard = BI.inherit(BI.Widget, { type: "bi.label", text: BI.i18nText("BI-Multi_Date_Relative_Current_Time"), textAlign: "left", - height: 24 + height: BI.SIZE_CONSANTS.LIST_ITEM_HEIGHT, }, { type: "bi.dynamic_date_param_item", ref: function () { diff --git a/src/widget/year/popup.year.js b/src/widget/year/popup.year.js index 0782b43f13..73afd9681d 100644 --- a/src/widget/year/popup.year.js +++ b/src/widget/year/popup.year.js @@ -8,7 +8,6 @@ BI.DynamicYearPopup = BI.inherit(BI.Widget, { constants: { tabHeight: 30, - buttonHeight: 24 }, props: { @@ -33,7 +32,7 @@ BI.DynamicYearPopup = BI.inherit(BI.Widget, { items: [[{ type: "bi.text_button", cls: "bi-split-top bi-high-light", - textHeight: c.buttonHeight - 1, + textHeight: BI.SIZE_CONSANTS.TOOL_BAR_HEIGHT - 1, shadow: true, text: BI.i18nText("BI-Basic_Clear"), listeners: [{ @@ -44,7 +43,7 @@ BI.DynamicYearPopup = BI.inherit(BI.Widget, { }] }, { type: "bi.text_button", - textHeight: c.buttonHeight - 1, + textHeight: BI.SIZE_CONSANTS.TOOL_BAR_HEIGHT - 1, cls: "bi-split-left bi-split-right bi-high-light bi-split-top", shadow: true, text: BI.i18nText("BI-Basic_Current_Year"), @@ -61,7 +60,7 @@ BI.DynamicYearPopup = BI.inherit(BI.Widget, { }, { type: "bi.text_button", cls: "bi-split-top bi-high-light", - textHeight: c.buttonHeight - 1, + textHeight: BI.SIZE_CONSANTS.TOOL_BAR_HEIGHT - 1, shadow: true, text: BI.i18nText("BI-Basic_OK"), listeners: [{ @@ -76,7 +75,7 @@ BI.DynamicYearPopup = BI.inherit(BI.Widget, { } }] }]], - height: 24 + height: BI.SIZE_CONSANTS.TOOL_BAR_HEIGHT, }, }] }; From 94b406a7b6dad15da1f2fc53f358d7247ff02241 Mon Sep 17 00:00:00 2001 From: windy <1374721899@qq.com> Date: Wed, 30 Jun 2021 16:02:58 +0800 Subject: [PATCH 2/8] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=B8=8Bsize?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/core/platform/web/size.js | 49 ----------------------------------- src/core/size.js | 22 ++++++++++++++++ 2 files changed, 22 insertions(+), 49 deletions(-) delete mode 100644 src/core/platform/web/size.js create mode 100644 src/core/size.js diff --git a/src/core/platform/web/size.js b/src/core/platform/web/size.js deleted file mode 100644 index 053c05c8e2..0000000000 --- a/src/core/platform/web/size.js +++ /dev/null @@ -1,49 +0,0 @@ -/** - * @author windy - * @version 2.0 - * Created by windy on 2021/6/30 - */ -_.extend(BI, { - VIEW_SIZE: { - SMALL: 1, - NORMAL: 2, - BIG: 3, - CUSTOM: 4, - }, -}); -BI.Func = BI.Func || {}; -_.extend(BI.Func, { - - /** - * 默认提供三种尺寸类型,small, normal, big - * 也可以在此基础上适用类型custom定制尺寸 - * @param opt - */ - switchWidgetSizeConfig: function(opt) { - switch (opt.type) { - case BI.VIEW_SIZE.BIG: - opt.TOOL_BAR_HEIGHT = 30; - opt.LIST_ITEM_HEIGHT = 30; - opt.TRIGGER_HEIGHT = 30; - break; - case BI.VIEW_SIZE.SMALL: - case BI.VIEW_SIZE.NORMAL: - default: - break; - } - - BI.config('bi.constant.widget.size', function (ob) { - return BI.extend(ob, opt); - }); - }, -}); - -BI.constant('bi.constant.widget.size', { - TOOL_BAR_HEIGHT: 24, - LIST_ITEM_HEIGHT: 24, - TRIGGER_HEIGHT: 24, -}); - -BI.prepares.push(function () { - BI.SIZE_CONSANTS = BI.Constants.getConstant('bi.constant.widget.size'); -}); diff --git a/src/core/size.js b/src/core/size.js new file mode 100644 index 0000000000..aaf8630087 --- /dev/null +++ b/src/core/size.js @@ -0,0 +1,22 @@ +/** + * @author windy + * @version 2.0 + * Created by windy on 2021/6/30 + */ +_.extend(BI, { + switchSystemSize: function(opt) { + BI.config('bi.constant.system.size', function (ob) { + return BI.extend(ob, opt); + }); + }, +}); + +BI.constant('bi.constant.system.size', { + TOOL_BAR_HEIGHT: 24, + LIST_ITEM_HEIGHT: 24, + TRIGGER_HEIGHT: 24, +}); + +BI.prepares.push(function () { + BI.SIZE_CONSANTS = BI.Constants.getConstant('bi.constant.widget.size'); +}); From db23d3d2f6a00024a5ea75f0543013f2e9abf8a6 Mon Sep 17 00:00:00 2001 From: windy <1374721899@qq.com> Date: Wed, 30 Jun 2021 16:10:42 +0800 Subject: [PATCH 3/8] =?UTF-8?q?=E7=B3=BB=E7=BB=9F=E5=8F=82=E6=95=B0?= =?UTF-8?q?=E5=BD=A2=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/core/system.js | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 src/core/system.js diff --git a/src/core/system.js b/src/core/system.js new file mode 100644 index 0000000000..e4c079c714 --- /dev/null +++ b/src/core/system.js @@ -0,0 +1,25 @@ +/** + * @author windy + * @version 2.0 + * Created by windy on 2021/6/30 + */ +_.extend(BI, { + switchSystemParam: function(opt) { + BI.config('bi.constant.system', function (ob) { + return BI.deepExtend(ob, opt); + }); + }, +}); + +// 系统参数常量 +BI.constant('bi.constant.system', { + size: { // 尺寸 + TOOL_BAR_HEIGHT: 24, + LIST_ITEM_HEIGHT: 24, + TRIGGER_HEIGHT: 24, + }, +}); + +BI.prepares.push(function () { + BI.SIZE_CONSANTS = BI.Constants.getConstant('bi.constant.system').size; +}); From 23b550f42214b57acc64de3ce2dddbea30989d87 Mon Sep 17 00:00:00 2001 From: windy <1374721899@qq.com> Date: Wed, 30 Jun 2021 16:11:39 +0800 Subject: [PATCH 4/8] delete --- src/core/size.js | 22 ---------------------- 1 file changed, 22 deletions(-) delete mode 100644 src/core/size.js diff --git a/src/core/size.js b/src/core/size.js deleted file mode 100644 index aaf8630087..0000000000 --- a/src/core/size.js +++ /dev/null @@ -1,22 +0,0 @@ -/** - * @author windy - * @version 2.0 - * Created by windy on 2021/6/30 - */ -_.extend(BI, { - switchSystemSize: function(opt) { - BI.config('bi.constant.system.size', function (ob) { - return BI.extend(ob, opt); - }); - }, -}); - -BI.constant('bi.constant.system.size', { - TOOL_BAR_HEIGHT: 24, - LIST_ITEM_HEIGHT: 24, - TRIGGER_HEIGHT: 24, -}); - -BI.prepares.push(function () { - BI.SIZE_CONSANTS = BI.Constants.getConstant('bi.constant.widget.size'); -}); From b107f1d4a445adebd8905251971d8bb93a67d640 Mon Sep 17 00:00:00 2001 From: windy <1374721899@qq.com> Date: Wed, 30 Jun 2021 16:51:20 +0800 Subject: [PATCH 5/8] =?UTF-8?q?=E6=8F=90=E4=BE=9Bprovider?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/core/system.js | 51 +++++++++++++++++++++++++++++++--------------- 1 file changed, 35 insertions(+), 16 deletions(-) diff --git a/src/core/system.js b/src/core/system.js index e4c079c714..38123233b7 100644 --- a/src/core/system.js +++ b/src/core/system.js @@ -3,23 +3,42 @@ * @version 2.0 * Created by windy on 2021/6/30 */ -_.extend(BI, { - switchSystemParam: function(opt) { - BI.config('bi.constant.system', function (ob) { - return BI.deepExtend(ob, opt); - }); - }, -}); - // 系统参数常量 -BI.constant('bi.constant.system', { - size: { // 尺寸 - TOOL_BAR_HEIGHT: 24, - LIST_ITEM_HEIGHT: 24, - TRIGGER_HEIGHT: 24, - }, -}); +!(function () { + var system = { + SIZE: { // 尺寸 + TOOL_BAR_HEIGHT: 24, + LIST_ITEM_HEIGHT: 24, + TRIGGER_HEIGHT: 24, + }, + }; + + var provider = function () { + this.inject = function (type, config) { + BI.deepExtend(system[type], config); + }; + + this.$get = function () { + return BI.inherit(BI.OB, { + + getConfig: function (type) { + return system[type]; + }, + }); + }; + }; + + BI.provider("bi.provider.system", provider); +})(); BI.prepares.push(function () { - BI.SIZE_CONSANTS = BI.Constants.getConstant('bi.constant.system').size; + BI.SIZE_CONSANTS = BI.Providers.getProvider('bi.provider.system').getConfig('SIZE'); +}); + +BI.config('bi.provider.system', function (provider) { + provider.inject('SIZE', { + TOOL_BAR_HEIGHT: 30, + LIST_ITEM_HEIGHT: 30, + TRIGGER_HEIGHT: 30, + }) }); From 78f87714f0b7b6f8a0d3023558f984c1cd57b0b9 Mon Sep 17 00:00:00 2001 From: windy <1374721899@qq.com> Date: Wed, 30 Jun 2021 16:52:30 +0800 Subject: [PATCH 6/8] update --- src/core/system.js | 8 -------- 1 file changed, 8 deletions(-) diff --git a/src/core/system.js b/src/core/system.js index 38123233b7..dd7bb0d489 100644 --- a/src/core/system.js +++ b/src/core/system.js @@ -34,11 +34,3 @@ BI.prepares.push(function () { BI.SIZE_CONSANTS = BI.Providers.getProvider('bi.provider.system').getConfig('SIZE'); }); - -BI.config('bi.provider.system', function (provider) { - provider.inject('SIZE', { - TOOL_BAR_HEIGHT: 30, - LIST_ITEM_HEIGHT: 30, - TRIGGER_HEIGHT: 30, - }) -}); From fd4e4eb9730109c9bb524da3656a61c2df3b70da Mon Sep 17 00:00:00 2001 From: windy <1374721899@qq.com> Date: Wed, 30 Jun 2021 17:06:52 +0800 Subject: [PATCH 7/8] =?UTF-8?q?=E7=BB=93=E6=9E=84=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/core/system.js | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/core/system.js b/src/core/system.js index dd7bb0d489..40dc78c5d2 100644 --- a/src/core/system.js +++ b/src/core/system.js @@ -6,7 +6,7 @@ // 系统参数常量 !(function () { var system = { - SIZE: { // 尺寸 + size: { // 尺寸 TOOL_BAR_HEIGHT: 24, LIST_ITEM_HEIGHT: 24, TRIGGER_HEIGHT: 24, @@ -14,15 +14,18 @@ }; var provider = function () { - this.inject = function (type, config) { - BI.deepExtend(system[type], config); + + this.SYSTEM = system; + + this.setSize = function (opt) { + BI.deepExtend(system, { size: opt }); }; this.$get = function () { return BI.inherit(BI.OB, { - getConfig: function (type) { - return system[type]; + getSize: function () { + return system.size; }, }); }; @@ -32,5 +35,5 @@ })(); BI.prepares.push(function () { - BI.SIZE_CONSANTS = BI.Providers.getProvider('bi.provider.system').getConfig('SIZE'); + BI.SIZE_CONSANTS = BI.Providers.getProvider('bi.provider.system').getSize(); }); From 88a0a4e3057f598ae321a5387bba7ec52340f6ab Mon Sep 17 00:00:00 2001 From: windy <1374721899@qq.com> Date: Wed, 30 Jun 2021 17:39:48 +0800 Subject: [PATCH 8/8] =?UTF-8?q?=E6=97=A5=E6=9C=9F=E7=B1=BB=E5=9E=8B?= =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/case/calendar/calendar.js | 6 +++--- src/core/system.js | 8 ++++++++ src/widget/date/calendar/popup.month.js | 4 ++-- src/widget/dynamicdate/dynamicdate.card.js | 4 ++-- src/widget/dynamicdate/dynamicdate.popup.js | 9 ++++----- src/widget/dynamicdatetime/dynamicdatetime.popup.js | 8 ++++---- src/widget/dynamicdatetime/dynamicdatetime.timeselect.js | 6 +++--- src/widget/yearmonth/card.dynamic.yearmonth.js | 2 +- src/widget/yearmonth/card.static.yearmonth.js | 4 ++-- src/widget/yearmonth/popup.yearmonth.js | 9 ++++----- src/widget/yearquarter/card.dynamic.yearquarter.js | 2 +- src/widget/yearquarter/card.static.yearquarter.js | 2 +- src/widget/yearquarter/popup.yearquarter.js | 8 ++++---- 13 files changed, 39 insertions(+), 33 deletions(-) diff --git a/src/case/calendar/calendar.js b/src/case/calendar/calendar.js index 56507ab349..fb762da7e3 100644 --- a/src/case/calendar/calendar.js +++ b/src/case/calendar/calendar.js @@ -78,7 +78,7 @@ BI.Calendar = BI.inherit(BI.Widget, { var items = BI.map(this._getWeekLabel(), function (i, value) { return { type: "bi.label", - height: 24, + height: BI.SIZE_CONSANTS.LIST_ITEM_HEIGHT, text: value }; }); @@ -100,7 +100,7 @@ BI.Calendar = BI.inherit(BI.Widget, { columns: 7, rows: 6, columnSize: [1 / 7, 1 / 7, 1 / 7, 1 / 7, 1 / 7, 1 / 7, 1 / 7], - rowSize: 24, + rowSize: BI.SIZE_CONSANTS.LIST_ITEM_HEIGHT, vgap: 10 }))] }); @@ -159,7 +159,7 @@ BI.Calendar = BI.inherit(BI.Widget, { whiteSpace: "normal", once: false, forceSelected: true, - height: 24, + height: BI.SIZE_CONSANTS.LIST_ITEM_HEIGHT, value: o.year + "-" + month + "-" + td.text, disabled: td.lastMonth || td.nextMonth || td.disabled, lgap: 5, diff --git a/src/core/system.js b/src/core/system.js index 40dc78c5d2..3a3852e051 100644 --- a/src/core/system.js +++ b/src/core/system.js @@ -37,3 +37,11 @@ BI.prepares.push(function () { BI.SIZE_CONSANTS = BI.Providers.getProvider('bi.provider.system').getSize(); }); + +BI.config('bi.provider.system', function (provider) { + provider.setSize({ + TOOL_BAR_HEIGHT: 30, + LIST_ITEM_HEIGHT: 30, + TRIGGER_HEIGHT: 30, + }) +}); diff --git a/src/widget/date/calendar/popup.month.js b/src/widget/date/calendar/popup.month.js index 2add27d544..195b9302f1 100644 --- a/src/widget/date/calendar/popup.month.js +++ b/src/widget/date/calendar/popup.month.js @@ -31,7 +31,7 @@ BI.MonthPopup = BI.inherit(BI.Widget, { columns: 2, rows: 6, columnSize: [1 / 2, 1 / 2], - rowSize: 25 + rowSize: BI.SIZE_CONSANTS.LIST_ITEM_HEIGHT + 1 })), { type: "bi.center_adapt", vgap: 1, @@ -68,7 +68,7 @@ BI.MonthPopup = BI.inherit(BI.Widget, { whiteSpace: "nowrap", once: false, forceSelected: true, - height: 23, + height: BI.SIZE_CONSANTS.LIST_ITEM_HEIGHT - 1, width: 38, value: td, text: td, diff --git a/src/widget/dynamicdate/dynamicdate.card.js b/src/widget/dynamicdate/dynamicdate.card.js index 00d3c12b86..b2fd221ccf 100644 --- a/src/widget/dynamicdate/dynamicdate.card.js +++ b/src/widget/dynamicdate/dynamicdate.card.js @@ -166,7 +166,7 @@ BI.DynamicDateCard = BI.inherit(BI.Widget, { comboItems[0].text = BI.i18nText("BI-Basic_Empty"); items.push({ type: "bi.text_value_combo", - height: 24, + height: BI.SIZE_CONSANTS.TOOL_BAR_HEIGHT, items: comboItems, container: null, value: positionValue || BI.DynamicDateCard.OFFSET.CURRENT, @@ -183,7 +183,7 @@ BI.DynamicDateCard = BI.inherit(BI.Widget, { if(values.length !== 0 && BI.last(values).dateType !== BI.DynamicDateCard.TYPE.DAY && BI.last(values).dateType !== BI.DynamicDateCard.TYPE.WORK_DAY) { items.push({ type: "bi.text_value_combo", - height: 24, + height: BI.SIZE_CONSANTS.TOOL_BAR_HEIGHT, container: null, items: this._getText(BI.last(values).dateType), value: positionValue || BI.DynamicDateCard.OFFSET.CURRENT, diff --git a/src/widget/dynamicdate/dynamicdate.popup.js b/src/widget/dynamicdate/dynamicdate.popup.js index 0c4052e0cf..9e058e9218 100644 --- a/src/widget/dynamicdate/dynamicdate.popup.js +++ b/src/widget/dynamicdate/dynamicdate.popup.js @@ -1,7 +1,6 @@ BI.DynamicDatePopup = BI.inherit(BI.Widget, { constants: { tabHeight: 30, - buttonHeight: 24 }, props: { @@ -27,7 +26,7 @@ BI.DynamicDatePopup = BI.inherit(BI.Widget, { cls: "bi-high-light bi-split-top", shadow: true, text: BI.i18nText("BI-Basic_Clear"), - textHeight: c.buttonHeight - 1, + textHeight: BI.SIZE_CONSANTS.TOOL_BAR_HEIGHT - 1, listeners: [{ eventName: BI.TextButton.EVENT_CHANGE, action: function () { @@ -38,7 +37,7 @@ BI.DynamicDatePopup = BI.inherit(BI.Widget, { type: "bi.text_button", cls: "bi-split-left bi-split-right bi-high-light bi-split-top", shadow: true, - textHeight: c.buttonHeight - 1, + textHeight: BI.SIZE_CONSANTS.TOOL_BAR_HEIGHT - 1, text: BI.i18nText("BI-Multi_Date_Today"), disabled: this._checkTodayValid(), ref: function () { @@ -53,7 +52,7 @@ BI.DynamicDatePopup = BI.inherit(BI.Widget, { }, { type: "bi.text_button", cls: "bi-high-light bi-split-top", - textHeight: c.buttonHeight - 1, + textHeight: BI.SIZE_CONSANTS.TOOL_BAR_HEIGHT - 1, shadow: true, text: BI.i18nText("BI-Basic_OK"), listeners: [{ @@ -68,7 +67,7 @@ BI.DynamicDatePopup = BI.inherit(BI.Widget, { } }] }]], - height: 24 + height: BI.SIZE_CONSANTS.TOOL_BAR_HEIGHT }, }] }); diff --git a/src/widget/dynamicdatetime/dynamicdatetime.popup.js b/src/widget/dynamicdatetime/dynamicdatetime.popup.js index 701320eb33..a4a5281714 100644 --- a/src/widget/dynamicdatetime/dynamicdatetime.popup.js +++ b/src/widget/dynamicdatetime/dynamicdatetime.popup.js @@ -25,7 +25,7 @@ BI.DynamicDateTimePopup = BI.inherit(BI.Widget, { items: [[{ type: "bi.text_button", cls: "bi-high-light bi-split-top", - textHeight: c.buttonHeight - 1, + textHeight: BI.SIZE_CONSANTS.TOOL_BAR_HEIGHT - 1, shadow: true, text: BI.i18nText("BI-Basic_Clear"), listeners: [{ @@ -37,7 +37,7 @@ BI.DynamicDateTimePopup = BI.inherit(BI.Widget, { }, { type: "bi.text_button", cls: "bi-split-left bi-split-right bi-high-light bi-split-top", - textHeight: c.buttonHeight - 1, + textHeight: BI.SIZE_CONSANTS.TOOL_BAR_HEIGHT - 1, shadow: true, text: BI.i18nText("BI-Multi_Date_Today"), disabled: this._checkTodayValid(), @@ -53,7 +53,7 @@ BI.DynamicDateTimePopup = BI.inherit(BI.Widget, { }, { type: "bi.text_button", cls: "bi-high-light bi-split-top", - textHeight: c.buttonHeight - 1, + textHeight: BI.SIZE_CONSANTS.TOOL_BAR_HEIGHT - 1, shadow: true, text: BI.i18nText("BI-Basic_OK"), listeners: [{ @@ -63,7 +63,7 @@ BI.DynamicDateTimePopup = BI.inherit(BI.Widget, { } }] }]], - height: 24 + height: BI.SIZE_CONSANTS.TOOL_BAR_HEIGHT } }] }); diff --git a/src/widget/dynamicdatetime/dynamicdatetime.timeselect.js b/src/widget/dynamicdatetime/dynamicdatetime.timeselect.js index adf6dfb4bf..5642cb7998 100644 --- a/src/widget/dynamicdatetime/dynamicdatetime.timeselect.js +++ b/src/widget/dynamicdatetime/dynamicdatetime.timeselect.js @@ -41,7 +41,7 @@ BI.DynamicDateTimeSelect = BI.inherit(BI.Widget, { } }], width: 60, - height: 24 + height: BI.SIZE_CONSANTS.LIST_ITEM_HEIGHT } }, { type: "bi.label", @@ -77,7 +77,7 @@ BI.DynamicDateTimeSelect = BI.inherit(BI.Widget, { } }], width: 60, - height: 24 + height: BI.SIZE_CONSANTS.LIST_ITEM_HEIGHT }, { type: "bi.label", text: ":", @@ -106,7 +106,7 @@ BI.DynamicDateTimeSelect = BI.inherit(BI.Widget, { } }], width: 60, - height: 24 + height: BI.SIZE_CONSANTS.LIST_ITEM_HEIGHT }] }] }; diff --git a/src/widget/yearmonth/card.dynamic.yearmonth.js b/src/widget/yearmonth/card.dynamic.yearmonth.js index 9b6ffb66de..786b22a00f 100644 --- a/src/widget/yearmonth/card.dynamic.yearmonth.js +++ b/src/widget/yearmonth/card.dynamic.yearmonth.js @@ -19,7 +19,7 @@ BI.DynamicYearMonthCard = BI.inherit(BI.Widget, { type: "bi.label", text: BI.i18nText("BI-Multi_Date_Relative_Current_Time"), textAlign: "left", - height: 24 + height: BI.SIZE_CONSANTS.LIST_ITEM_HEIGHT, }, { type: "bi.vertical", ref: function (_ref) { diff --git a/src/widget/yearmonth/card.static.yearmonth.js b/src/widget/yearmonth/card.static.yearmonth.js index 9e905d9ee4..09ff4ac2fa 100644 --- a/src/widget/yearmonth/card.static.yearmonth.js +++ b/src/widget/yearmonth/card.static.yearmonth.js @@ -25,7 +25,7 @@ BI.StaticYearMonthCard = BI.inherit(BI.Widget, { whiteSpace: "nowrap", once: false, forceSelected: true, - height: 23, + height: BI.SIZE_CONSANTS.LIST_ITEM_HEIGHT - 1, width: 38, value: td, text: td, @@ -77,7 +77,7 @@ BI.StaticYearMonthCard = BI.inherit(BI.Widget, { columns: 2, rows: 6, columnSize: [1 / 2, 1 / 2], - rowSize: 25 + rowSize: BI.SIZE_CONSANTS.LIST_ITEM_HEIGHT + 1 })), { type: "bi.center_adapt", vgap: 1, diff --git a/src/widget/yearmonth/popup.yearmonth.js b/src/widget/yearmonth/popup.yearmonth.js index 8ebaaefc07..66dec8de29 100644 --- a/src/widget/yearmonth/popup.yearmonth.js +++ b/src/widget/yearmonth/popup.yearmonth.js @@ -8,7 +8,6 @@ BI.DynamicYearMonthPopup = BI.inherit(BI.Widget, { constants: { tabHeight: 30, - buttonHeight: 24 }, props: { @@ -33,7 +32,7 @@ BI.DynamicYearMonthPopup = BI.inherit(BI.Widget, { items: [[{ type: "bi.text_button", cls: "bi-split-top bi-high-light", - textHeight: c.buttonHeight - 1, + textHeight: BI.SIZE_CONSANTS.TOOL_BAR_HEIGHT - 1, shadow: true, text: BI.i18nText("BI-Basic_Clear"), listeners: [{ @@ -45,7 +44,7 @@ BI.DynamicYearMonthPopup = BI.inherit(BI.Widget, { }, { type: "bi.text_button", cls: "bi-split-left bi-split-right bi-high-light bi-split-top", - textHeight: c.buttonHeight - 1, + textHeight: BI.SIZE_CONSANTS.TOOL_BAR_HEIGHT - 1, shadow: true, text: BI.i18nText("BI-Basic_Current_Month"), disabled: this._checkTodayValid(), @@ -61,7 +60,7 @@ BI.DynamicYearMonthPopup = BI.inherit(BI.Widget, { }, { type: "bi.text_button", cls: "bi-split-top bi-high-light", - textHeight: c.buttonHeight - 1, + textHeight: BI.SIZE_CONSANTS.TOOL_BAR_HEIGHT - 1, shadow: true, text: BI.i18nText("BI-Basic_OK"), listeners: [{ @@ -76,7 +75,7 @@ BI.DynamicYearMonthPopup = BI.inherit(BI.Widget, { } }] }]], - height: 24 + height: BI.SIZE_CONSANTS.TOOL_BAR_HEIGHT }, }] }; diff --git a/src/widget/yearquarter/card.dynamic.yearquarter.js b/src/widget/yearquarter/card.dynamic.yearquarter.js index 588aa05cf1..9e66e52028 100644 --- a/src/widget/yearquarter/card.dynamic.yearquarter.js +++ b/src/widget/yearquarter/card.dynamic.yearquarter.js @@ -19,7 +19,7 @@ BI.DynamicYearQuarterCard = BI.inherit(BI.Widget, { type: "bi.label", text: BI.i18nText("BI-Multi_Date_Relative_Current_Time"), textAlign: "left", - height: 24 + height: BI.SIZE_CONSANTS.LIST_ITEM_HEIGHT, }, { type: "bi.vertical", ref: function (_ref) { diff --git a/src/widget/yearquarter/card.static.yearquarter.js b/src/widget/yearquarter/card.static.yearquarter.js index 5fdd231ff7..62e3291300 100644 --- a/src/widget/yearquarter/card.static.yearquarter.js +++ b/src/widget/yearquarter/card.static.yearquarter.js @@ -28,7 +28,7 @@ BI.StaticYearQuarterCard = BI.inherit(BI.Widget, { whiteSpace: "nowrap", once: false, forceSelected: true, - height: 24, + height: BI.SIZE_CONSANTS.TOOL_BAR_HEIGHT, ref: function (_ref) { self.quarterMap[j + 1] = _ref; } diff --git a/src/widget/yearquarter/popup.yearquarter.js b/src/widget/yearquarter/popup.yearquarter.js index e1e001d1b5..de49b4ef60 100644 --- a/src/widget/yearquarter/popup.yearquarter.js +++ b/src/widget/yearquarter/popup.yearquarter.js @@ -27,7 +27,7 @@ BI.DynamicYearQuarterPopup = BI.inherit(BI.Widget, { type: "bi.text_button", cls: "bi-split-top bi-high-light", shadow: true, - textHeight: c.buttonHeight - 1, + textHeight: BI.SIZE_CONSANTS.TOOL_BAR_HEIGHT - 1, text: BI.i18nText("BI-Basic_Clear"), listeners: [{ eventName: BI.TextButton.EVENT_CHANGE, @@ -38,7 +38,7 @@ BI.DynamicYearQuarterPopup = BI.inherit(BI.Widget, { }, { type: "bi.text_button", cls: "bi-split-left bi-split-right bi-high-light bi-split-top", - textHeight: c.buttonHeight - 1, + textHeight: BI.SIZE_CONSANTS.TOOL_BAR_HEIGHT - 1, shadow: true, text: BI.i18nText("BI-Basic_Current_Quarter"), disabled: this._checkTodayValid(), @@ -55,7 +55,7 @@ BI.DynamicYearQuarterPopup = BI.inherit(BI.Widget, { type: "bi.text_button", cls: "bi-split-top bi-high-light", shadow: true, - textHeight: c.buttonHeight - 1, + textHeight: BI.SIZE_CONSANTS.TOOL_BAR_HEIGHT - 1, text: BI.i18nText("BI-Basic_OK"), listeners: [{ eventName: BI.TextButton.EVENT_CHANGE, @@ -69,7 +69,7 @@ BI.DynamicYearQuarterPopup = BI.inherit(BI.Widget, { } }] }]], - height: 24 + height: BI.SIZE_CONSANTS.TOOL_BAR_HEIGHT }, }] };