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] =?UTF-8?q?=E6=97=A5=E6=9C=9F=E7=B1=BB=E5=9E=8B=E6=9B=B4?= =?UTF-8?q?=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 }, }] };