Browse Source

BI-88967 可配全局widget宽高尺寸(部分)

es6
windy 3 years ago
parent
commit
31f5388550
  1. 4
      src/case/calendar/calendar.year.js
  2. 4
      src/case/combo/iconcombo/popup.iconcombo.js
  3. 6
      src/case/combo/icontextvaluecombo/popup.icontextvalue.js
  4. 4
      src/case/combo/textvaluecombo/popup.textvalue.js
  5. 2
      src/case/layer/layer.multipopup.js
  6. 49
      src/core/platform/web/size.js
  7. 2
      src/widget/downlist/item.downlist.js
  8. 2
      src/widget/downlist/popup.downlist.js
  9. 26
      src/widget/dynamicdate/dynamicdate.param.item.js
  10. 2
      src/widget/multiselect/multiselect.combo.js
  11. 2
      src/widget/multiselect/multiselect.combo.nobar.js
  12. 2
      src/widget/multiselect/multiselect.insert.combo.js
  13. 2
      src/widget/multiselect/multiselect.insert.combo.nobar.js
  14. 4
      src/widget/multiselect/multiselect.loader.js
  15. 4
      src/widget/multiselect/multiselect.loader.nobar.js
  16. 2
      src/widget/multiselect/multiselect.popup.view.js
  17. 2
      src/widget/multiselect/multiselect.popup.view.nobar.js
  18. 4
      src/widget/multiselect/search/multiselect.search.insert.pane.js
  19. 2
      src/widget/multiselect/search/multiselect.search.loader.js
  20. 10
      src/widget/multiselectlist/multiselectlist.insert.js
  21. 2
      src/widget/multiselectlist/multiselectlist.insert.nobar.js
  22. 2
      src/widget/multiselectlist/multiselectlist.js
  23. 2
      src/widget/year/card.dynamic.year.js
  24. 9
      src/widget/year/popup.year.js

4
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

4
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);
},

6
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);
},

4
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);
},

2
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,

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

2
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
},

2
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,

26
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

2
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
});

2
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,
});
},

2
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
});
},

2
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,
});
},

4
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
});

4
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
});
},

2
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,
});
},

2
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
});
},

4
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,
}],

2
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

10
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

2
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 () {

2
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 () {

2
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 () {

9
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,
},
}]
};

Loading…
Cancel
Save