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] =?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 053c05c8e..000000000 --- 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 000000000..aaf863008 --- /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'); +});