Browse Source

修改下size

es6
windy 3 years ago
parent
commit
94b406a7b6
  1. 49
      src/core/platform/web/size.js
  2. 22
      src/core/size.js

49
src/core/platform/web/size.js

@ -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');
});

22
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');
});
Loading…
Cancel
Save