Urthur 7 years ago
parent
commit
7e77bb9b44
  1. 13
      bi/case.js
  2. 8
      bi/core.css
  3. 16149
      bi/widget.js
  4. 17
      demo/config.js
  5. 3
      demo/css/main.css
  6. 2
      demo/js/config/base.js
  7. 2
      demo/js/config/case.js
  8. 255
      demo/js/config/widget.js
  9. 121
      demo/js/widget/arrangment/demo.adaptive_arrangement.js
  10. 0
      demo/js/widget/arrangment/demo.interactive_arrangement.js
  11. 31
      demo/js/widget/combo/demo.formula_combo.js
  12. 38
      demo/js/widget/combo/demo.icon_combo.js
  13. 45
      demo/js/widget/combo/demo.static_combo.js
  14. 60
      demo/js/widget/combo/demo.text_value_combo.js
  15. 57
      demo/js/widget/combo/demo.text_value_down_list_combo.js
  16. 32
      demo/js/widget/combo/demo.text_vlaue_check_combo.js
  17. 31
      demo/js/widget/date/demo.date.js
  18. 39
      demo/js/widget/date/demo.datepane.js
  19. 27
      demo/js/widget/dialog/demo.dialog.js
  20. 136
      demo/js/widget/downlist/demo.downlist.js
  21. 46
      demo/js/widget/editor/demo.adapt_editor.js
  22. 22
      demo/js/widget/editor/demo.clear_editor.js
  23. 22
      demo/js/widget/editor/demo.record_editor.js
  24. 29
      demo/js/widget/editor/demo.search_editor.js
  25. 41
      demo/js/widget/editor/demo.shelter_editor.js
  26. 24
      demo/js/widget/editor/demo.sign_editor.js
  27. 24
      demo/js/widget/editor/demo.sign_initial_editor.js
  28. 22
      demo/js/widget/editor/demo.sign_style_editor.js
  29. 24
      demo/js/widget/editor/demo.state_editor.js
  30. 28
      demo/js/widget/editor/demo.text_editor.js
  31. 20
      demo/js/widget/month/demo.month.js
  32. 6
      demo/js/widget/multiselect/demo.multi_select_combo.js
  33. 41
      demo/js/widget/multitree/demo.multi_tree_combo.js
  34. 44
      demo/js/widget/numericalinterval/demo.numerical_interval.js
  35. 77
      demo/js/widget/pathchooser/demo.directionpathchooser.js
  36. 0
      demo/js/widget/pathchooser/demo.pathchooser.js
  37. 20
      demo/js/widget/quarter/demo.quarter.js
  38. 0
      demo/js/widget/relationview/demo.relationview.js
  39. 35
      demo/js/widget/selecttree/demo.multilayer_select_tree_combo.js
  40. 182
      demo/js/widget/selecttree/demo.select_tree_combo.js
  41. 35
      demo/js/widget/singletree/demo.multilayer_single_tree_combo.js
  42. 181
      demo/js/widget/singletree/demo.single_tree_combo.js
  43. 40
      demo/js/widget/table/demo.excel_table.js
  44. 33
      demo/js/widget/timeinterval/demo.time_interval.js
  45. 66
      demo/js/widget/tree/demo.multilayer_select_tree_combo.js
  46. 24
      demo/js/widget/tree/demo.switch_tree.js
  47. 19
      demo/js/widget/year/demo.year.js
  48. 32
      demo/js/widget/yearmonth/demo.year_month_combo.js
  49. 33
      demo/js/widget/yearquarter/demo.year_quarter_combo.js
  50. 5
      demo/less/main.less
  51. 13
      docs/case.js
  52. 8
      docs/core.css
  53. 3
      docs/demo.css
  54. 3041
      docs/demo.js
  55. BIN
      docs/icon/arrow left right.png
  56. BIN
      docs/icon/radio.png
  57. BIN
      docs/icon/slider.png
  58. BIN
      docs/icon/双向箭头.png
  59. 24
      docs/index.html
  60. 16149
      docs/widget.js
  61. 1776
      package-lock.json
  62. 13
      src/case/tree/tree.display.js
  63. 11
      src/component/treevaluechooser/abstract.treevaluechooser.js
  64. 8
      src/css/core/utils/common.css
  65. 8
      src/less/core/utils/common.less
  66. 2
      src/less/resource/icon.less
  67. 15
      src/widget/multiselect/multiselect.combo.js

13
bi/case.js

@ -12033,6 +12033,19 @@ BI.DisplayTree = BI.inherit(BI.TreeView, {
return setting; return setting;
}, },
_dealWidthNodes: function (nodes) {
nodes = BI.DisplayTree.superclass._dealWidthNodes.apply(this, arguments);
var self = this, o = this.options;
BI.each(nodes, function (i, node) {
if (node.count > 0) {
node.text = node.value + "(" + BI.i18nText("BI-Basic_Altogether") + node.count + BI.i18nText("BI-Basic_Count") + ")";
} else {
node.text = node.value;
}
});
return nodes;
},
initTree: function (nodes, setting) { initTree: function (nodes, setting) {
var setting = setting || this._configSetting(); var setting = setting || this._configSetting();
this.nodes = $.fn.zTree.init(this.tree.element, setting, nodes); this.nodes = $.fn.zTree.init(this.tree.element, setting, nodes);

8
bi/core.css

@ -3900,7 +3900,7 @@ i {
.bi-list-item-none:hover, .bi-list-item-none:hover,
.bi-list-item-none.hover { .bi-list-item-none.hover {
color: inherit; color: inherit;
background-color: inherit; background-color: transparent;
} }
.bi-list-item-none:hover .bi-input, .bi-list-item-none:hover .bi-input,
.bi-list-item-none.hover .bi-input { .bi-list-item-none.hover .bi-input {
@ -3913,7 +3913,7 @@ i {
.bi-list-item-none:active, .bi-list-item-none:active,
.bi-list-item-none.active { .bi-list-item-none.active {
color: inherit; color: inherit;
background-color: inherit; background-color: transparent;
} }
.bi-list-item-none:active .bi-input, .bi-list-item-none:active .bi-input,
.bi-list-item-none.active .bi-input { .bi-list-item-none.active .bi-input {
@ -3951,7 +3951,7 @@ i {
.bi-theme-dark .bi-list-item-none:hover, .bi-theme-dark .bi-list-item-none:hover,
.bi-theme-dark .bi-list-item-none.hover { .bi-theme-dark .bi-list-item-none.hover {
color: inherit; color: inherit;
background-color: inherit; background-color: transparent;
} }
.bi-theme-dark .bi-list-item-none:hover .bi-input, .bi-theme-dark .bi-list-item-none:hover .bi-input,
.bi-theme-dark .bi-list-item-none.hover .bi-input { .bi-theme-dark .bi-list-item-none.hover .bi-input {
@ -3964,7 +3964,7 @@ i {
.bi-theme-dark .bi-list-item-none:active, .bi-theme-dark .bi-list-item-none:active,
.bi-theme-dark .bi-list-item-none.active { .bi-theme-dark .bi-list-item-none.active {
color: inherit; color: inherit;
background-color: inherit; background-color: transparent;
} }
.bi-theme-dark .bi-list-item-none:active .bi-input, .bi-theme-dark .bi-list-item-none:active .bi-input,
.bi-theme-dark .bi-list-item-none.active .bi-input { .bi-theme-dark .bi-list-item-none.active .bi-input {

16149
bi/widget.js

File diff suppressed because it is too large Load Diff

17
demo/config.js

File diff suppressed because one or more lines are too long

3
demo/css/main.css

@ -45,3 +45,6 @@ body {
.bi-theme-dark body { .bi-theme-dark body {
background-color: #191B2B; background-color: #191B2B;
} }
.demo-editor {
border: 1px solid #cccccc;
}

2
demo/js/config/base.js

@ -1,7 +1,7 @@
Demo.BASE_CONFIG = [{ Demo.BASE_CONFIG = [{
id: 2, id: 2,
text: "基础控件", text: "基础控件",
open: true open: false
}, { }, {
pId: 2, pId: 2,
text: "bi.label", text: "bi.label",

2
demo/js/config/case.js

@ -1,7 +1,7 @@
Demo.CASE_CONFIG = [{ Demo.CASE_CONFIG = [{
id: 3, id: 3,
text: "实例控件", text: "实例控件",
open: true, open: false
}, { }, {
pId: 3, pId: 3,
id: 301, id: 301,

255
demo/js/config/widget.js

@ -1,4 +1,5 @@
Demo.WIDGET_CONFIG = [{ Demo.WIDGET_CONFIG = [{
<<<<<<< HEAD
id: 4, id: 4,
text: "详细控件" text: "详细控件"
}, { }, {
@ -50,3 +51,257 @@ Demo.WIDGET_CONFIG = [{
text: "bi.custom_date_time", text: "bi.custom_date_time",
value: "demo.custom_date_time" value: "demo.custom_date_time"
}]; }];
=======
id: 4,
text: "详细控件",
open: true
}, {
id: 400,
pId: 4,
text: "tree"
}, {
pId: 400,
text: "bi.multi_tree_combo",
value: "demo.multi_tree_combo"
}, {
id: 401,
pId: 4,
text: "table"
}, {
pId: 401,
text: "bi.preview_table",
value: "demo.preview_table"
}, {
pId: 401,
text: "bi.responsive_table",
value: "demo.responsive_table"
}, {
pId: 401,
text: "bi.excel_table",
value: "demo.excel_table"
}, {
pId: 4,
id: 402,
text: "年份控件",
open: false
}, {
pId: 402,
text: "bi.year_combo",
value: "demo.year"
}, {
pId: 4,
id: 403,
text: "月份控件",
open: false
}, {
pId: 403,
text: "bi.month_combo",
value: "demo.month"
}, {
pId: 4,
id: 404,
text: "季度控件",
open: false
}, {
pId: 404,
text: "bi.quarter_combo",
value: "demo.quarter"
}, {
pId: 4,
id: 405,
text: "下拉列表",
open: false
}, {
pId: 405,
text: "bi.down_list_combo",
value: "demo.down_list"
}, {
pId: 4,
id: 406,
text: "文本框控件",
open: false
}, {
pId: 406,
text: "bi.text_editor",
value: "demo.text_editor"
}, {
pId: 406,
text: "bi.search_editor",
value: "demo.search_editor"
}, {
pId: 406,
text: "bi.sign_editor",
value: "demo.sign_editor"
}, {
pId: 406,
text: "bi.sign_initial_editor",
value: "demo.sign_initial_editor"
}, {
pId: 406,
text: "bi.sign_style_editor",
value: "demo.sign_style_editor"
}, {
pId: 406,
text: "bi.state_editor",
value: "demo.state_editor"
}, {
pId: 406,
text: "bi.clear_editor",
value: "demo.clear_editor"
}, {
pId: 406,
text: "bi.record_editor",
value: "demo.record_editor"
}, {
pId: 406,
text: "bi.shelter_editor",
value: "demo.shelter_editor"
},
{
pId: 4,
id: 407,
text: "下拉框控件",
open: false
}, {
pId: 407,
text: "bi.text_value_combo",
value: "demo.text_value_combo"
}, {
pId: 407,
text: "bi.text_value_check_combo",
value: "demo.text_value_check_combo"
}, {
pId: 407,
text: "bi.text_value_down_list_combo",
value: "demo.text_value_down_list_combo"
}, {
pId: 407,
text: "bi.static_combo",
value: "demo.static_combo"
}, {
pId: 407,
text: "bi.icon_combo",
value: "demo.icon_combo"
}, {
pId: 407,
text: "bi.formula_combo",
value: "demo.formula_combo"
}, {
pId: 4,
id: 408,
text: "选择字段列表",
open: false
}, {
pId: 408,
text: "bi.placeholder"
}, {
pId: 4,
id: 409,
text: "公式编辑器",
open: false
}, {
pId: 409,
text: "bi.placeholder"
}, {
pId: 4,
id: 410,
text: "数值区间控件"
}, {
pId: 410,
text: "bi.numerical_interval",
value: "demo.numberical_interval"
}, {
pId: 4,
id: 411,
text: "下拉复选框有确定按钮"
}, {
pId: 411,
text: "bi.multi_select_combo",
value: "demo.multi_select_combo"
}, {
pId: 4,
id: 412,
text: "简单日期控件"
}, {
pId: 412,
text: "bi.date_combo",
value: "demo.date"
}, {
pId: 412,
text: "bi.date_pane_widget",
value: "demo.date_pane_widget"
}, {
pId: 412,
text: "bi.year_month_combo",
value: "demo.year_month_combo"
},{
pId: 412,
text: "bi.year_quarter_combo",
value: "demo.year_quarter_combo"
},{
pId: 4,
id: 413,
text: "简单下拉树"
}, {
pId: 413,
text: "bi.single_tree_combo",
value: "demo.single_tree_combo"
}, {
pId: 413,
text: "bi.multilayer_single_tree_combo",
value: "demo.multilayer_single_tree_combo"
}, {
pId: 4,
id: 414,
text: "可选下拉树"
}, {
pId: 414,
text: "bi.select_tree_combo",
value: "demo.select_tree_combo"
}, {
pId: 414,
text: "bi.multilayer_select_tree_combo",
value: "demo.multilayer_select_tree_combo"
}, {
pId: 4,
id: 415,
text: "路径选择"
}, {
pId: 415,
text: "bi.path_chooser",
value: "demo.path_chooser"
}, {
pId: 415,
text: "bi.direction_path_chooser",
value: "demo.direction_path_chooser"
}, {
pId: 4,
id: 416,
text: "关联视图"
}, {
pId: 416,
text: "bi.relation_view",
value: "demo.relation_view"
}, {
pId: 4,
id: 417,
text: "布局"
}, {
pId: 417,
text: "bi.adaptive_arrangement",
value: "demo.adaptive_arrangement"
}, {
pId: 417,
text: "bi.interactive_arrangement",
value: "demo.interactive_arrangement"
}, {
pId: 4,
id: 418,
text: "提示对话框"
}, {
pId: 418,
text: "bi.dialog",
value: "demo.dialog"
}
];
>>>>>>> 3903ca444e161ac208f69ba22c0a3136d7a0fa81

121
demo/js/widget/arrangment/demo.adaptive_arrangement.js

@ -0,0 +1,121 @@
Demo.AdaptiveArrangement = BI.inherit(BI.Widget, {
_createItem: function () {
var self = this;
var id = BI.UUID();
var item = BI.createWidget({
type: "bi.text_button",
id: id,
cls: "layout-bg" + BI.random(1, 8),
handler: function () {
self.arrangement.deleteRegion(id);
}
});
item.setValue(item.attr("id"));
return item;
},
render: function () {
var self = this;
this.arrangement = BI.createWidget({
type: "bi.adaptive_arrangement",
layoutType: BI.Arrangement.LAYOUT_TYPE.ADAPTIVE,
cls: "mvc-border",
width: 800,
height: 400,
items: []
});
var drag = BI.createWidget({
type: "bi.label",
cls: "mvc-border",
width: 100,
height: 25,
text: "drag me"
});
// drag.element.draggable &&
drag.element.draggable({
revert: true,
cursorAt: {
left: 0,
top: 0
},
drag: function (e, ui) {
self.arrangement.setPosition({
left: ui.position.left,
top: ui.position.top
}, {
width: 300,
height: 200
})
},
stop: function (e, ui) {
self.arrangement.addRegion({
el: self._createItem()
});
},
helper: function (e) {
var helper = self.arrangement.getHelper();
return helper.element;
}
});
BI.createWidget({
type: "bi.absolute",
items: [{
el: drag,
left: 30,
top: 450
}, {
el: this.arrangement,
left: 30,
top: 30
}, {
el: {
type: "bi.button",
text: "回撤",
height: 25,
handler: function () {
//self.arrangement.revoke();
}
},
left: 130,
top: 450
}, {
el: {
type: "bi.button",
text: "getAllRegions",
height: 25,
handler: function () {
var items = [];
BI.each(self.arrangement.getAllRegions(), function (i, region) {
items.push({
id: region.id,
left: region.left,
top: region.top,
width: region.width,
height: region.height
});
});
BI.Msg.toast(JSON.stringify(items));
}
},
left: 230,
top: 450
}, {
el: {
type: "bi.button",
text: "relayout",
height: 25,
handler: function () {
self.arrangement.relayout();
}
},
left: 330,
top: 450
}]
});
}
});
BI.shortcut("demo.adaptive_arrangement", Demo.AdaptiveArrangement);

0
demo/js/widget/demo.interactivearrangement.js → demo/js/widget/arrangment/demo.interactive_arrangement.js

31
demo/js/widget/combo/demo.formula_combo.js

@ -0,0 +1,31 @@
/**
* Created by Dailer on 2017/7/12.
*/
Demo.FormulaCombo = BI.inherit(BI.Widget, {
props: {
baseCls: ""
},
render: function () {
var self = this;
return {
type: "bi.horizontal_auto",
items: [{
type: "bi.formula_combo",
fieldItems: [{
text: "A",
value: "A",
fieldType: 16
}],
width: 200,
height: 30
}],
vgap: 20
}
}
})
BI.shortcut("demo.formula_combo", Demo.FormulaCombo);

38
demo/js/widget/combo/demo.icon_combo.js

@ -0,0 +1,38 @@
/**
* Created by Dailer on 2017/7/12.
*/
Demo.IconCombo = BI.inherit(BI.Widget, {
props: {
baseCls: ""
},
render: function () {
var self = this;
return {
type: "bi.horizontal_auto",
items: [{
type: "bi.icon_combo",
ref:function(_ref){
self.refs=_ref;
},
// iconClass: "pull-down-ha-font",
items: [{
value: "第一项",
iconClass: "delete-font"
}, {
value: "第二项",
iconClass: "rename-font"
}, {
value: "第三项",
iconClass: "move-font"
}]
}],
vgap: 20
}
}
})
BI.shortcut("demo.icon_combo", Demo.IconCombo);

45
demo/js/widget/combo/demo.static_combo.js

@ -0,0 +1,45 @@
/**
* Created by Dailer on 2017/7/11.
*/
Demo.StaticCombo = BI.inherit(BI.Widget, {
props: {
baseCls: ""
},
beforeMounted: function () {
this.refs.setValue(2);
},
render: function () {
var self = this;
return {
type: "bi.horizontal_auto",
items: [{
type: "bi.static_combo",
text: "Value 不变",
width: 300,
ref: function (_ref) {
self.refs = _ref;
},
items: [
{
text: "MVC-1",
value: 1
}, {
text: "MVC-2",
value: 2
}, {
text: "MVC-3",
value: 3
}
]
}],
vgap: 20
}
}
})
BI.shortcut("demo.static_combo", Demo.StaticCombo);

60
demo/js/widget/combo/demo.text_value_combo.js

@ -0,0 +1,60 @@
/**
* Created by Dailer on 2017/7/11.
*/
Demo.TextValueCombo = BI.inherit(BI.Widget, {
props: {
baseCls: ""
},
render: function () {
return {
type: "bi.horizontal_auto",
items: [{
type: "bi.text_value_combo",
text: "天气热死了",
width: 300,
items: [{
text: "MVC-1",
value: 1
}, {
text: "MVC-2",
value: 2
}, {
text: "MVC-3",
value: 3
}]
},{
type: "bi.text_value_check_combo",
text: "天气热死了",
width: 300,
items: [{
text: "MVC-1",
value: 1
}, {
text: "MVC-2",
value: 2
}, {
text: "MVC-3",
value: 3
}]
},{
type: "bi.text_value_combo",
text: "天气热死了",
width: 300,
items: [{
text: "MVC-1",
value: 1
}, {
text: "MVC-2",
value: 2
}, {
text: "MVC-3",
value: 3
}]
}],
vgap: 20
}
}
})
BI.shortcut("demo.text_value_combo", Demo.TextValueCombo);

57
demo/js/widget/combo/demo.text_value_down_list_combo.js

@ -0,0 +1,57 @@
/**
* Created by Dailer on 2017/7/11.
*/
Demo.TextValueDownListCombo = BI.inherit(BI.Widget, {
props: {
baseCls: ""
},
beforeMounted:function(){
this.refs.setValue(2);
},
render: function () {
var self = this;
return {
type: "bi.horizontal_auto",
items: [{
type: "bi.label",
cls: "layout-bg2",
text: "分组+二级",
width: 300
}, {
type: "bi.text_value_down_list_combo",
text: "天气热死了",
width: 300,
ref: function (_ref) {
self.refs = _ref;
},
items: [
[{
el: {
text: "MVC-1",
value: 1
},
children: [{
text: "MVC-1-1",
value: 11
}]
}],
[{
text: "MVC-2",
value: 2
}, {
text: "MVC-3",
value: 3
}]
]
}],
vgap: 20
}
}
})
BI.shortcut("demo.text_value_down_list_combo", Demo.TextValueDownListCombo);

32
demo/js/widget/combo/demo.text_vlaue_check_combo.js

@ -0,0 +1,32 @@
/**
* Created by Dailer on 2017/7/11.
*/
Demo.TextValueCheckCombo = BI.inherit(BI.Widget, {
props: {
baseCls: ""
},
render: function () {
return {
type: "bi.horizontal_auto",
items: [{
type: "bi.text_value_check_combo",
text: "天气热死了",
width: 300,
items: [{
text: "MVC-1",
value: 1
}, {
text: "MVC-2",
value: 2
}, {
text: "MVC-3",
value: 3
}]
}],
vgap: 20
}
}
})
BI.shortcut("demo.text_value_check_combo", Demo.TextValueCheckCombo);

31
demo/js/widget/date/demo.date.js

@ -0,0 +1,31 @@
/**
* Created by Dailer on 2017/7/11.
*/
Demo.Date = BI.inherit(BI.Widget, {
props: {
baseCls: "demo-date"
},
_init: function () {
Demo.Date.superclass._init.apply(this, arguments);
},
render: function () {
return {
type: "bi.horizontal_auto",
vgap: 10,
items: [{
type: "bi.date_combo",
width: 300
}, {
type: "bi.button",
text: "getVlaue",
height: 50,
width: 300
}]
}
}
})
BI.shortcut("demo.date", Demo.Date);

39
demo/js/widget/date/demo.datepane.js

@ -0,0 +1,39 @@
Demo.DatePane = BI.inherit(BI.Widget, {
props: {
baseCls: "demo-datepane"
},
render: function () {
return {
type: "bi.horizontal_auto",
items: [{
type: "bi.vertical",
vgap: 10,
items: [{
type: "bi.label",
cls: "layout-bg2",
text: "bi.date_pane_widget"
}, {
type: "bi.date_pane_widget",
selectedTime: {
year: 2017,
month: 12,
day: 11
},
height:300
},
{
type: "bi.button",
text: "getValue",
handler: function () {
BI.Msg.toast("date" + JSON.stringify(datepane.getValue()));
}
}
],
width: "50%"
}]
}
}
})
BI.shortcut("demo.date_pane_widget", Demo.DatePane);

27
demo/js/widget/dialog/demo.dialog.js

@ -0,0 +1,27 @@
Demo.DialogView = BI.inherit(BI.Widget, {
render: function () {
var items = [{
el: {
type: 'bi.button',
text: '弹出对话框',
level: 'common',
height: 30
}
}];
BI.each(items, function (i, item) {
item.el.handler = function () {
BI.Msg.alert('提示', "这是一段可以换行的文字,为了使它换行我要多写几个字,但是我又凑不够这么多的字,万般焦急下,只能随便写写");
}
});
return {
type: "bi.left",
vgap: 200,
hgap: 20,
items: items
}
}
});
BI.shortcut("demo.dialog", Demo.DialogView);

136
demo/js/widget/downlist/demo.downlist.js

@ -0,0 +1,136 @@
Demo.Downlist = BI.inherit(BI.Widget, {
props: {
baseCls: "demo-downlist"
},
mounted: function () {
var downlist = this.downlist;
var label = this.label;
downlist.on(BI.DownListCombo.EVENT_CHANGE, function (value, fatherValue) {
label.setValue(JSON.stringify(downlist.getValue()));
});
this.downlist.on(BI.DownListCombo.EVENT_SON_VALUE_CHANGE, function (value, fatherValue) {
label.setValue(JSON.stringify(downlist.getValue()));
});
},
render: function () {
self = this;
return {
type: "bi.horizontal_adapt",
items: [{
type: "bi.down_list_combo",
ref: function (_ref) {
self.downlist = _ref;
},
cls:"layout-bg3",
height: 30,
width: 100,
items: [
[{
el: {
text: "column 1111",
iconCls1: "check-mark-e-font",
value: 11
},
children: [{
text: "column 1.1",
value: 21,
cls: "dot-e-font",
selected: true
}, {
text: "column 1.222222222222222222222222222222222222",
cls: "dot-e-font",
value: 22,
}]
}],
[{
el: {
type: "bi.icon_text_icon_item",
text: "column 2",
iconCls1: "chart-type-e-font",
cls: "dot-e-font",
value: 12
},
disabled: true,
children: [{
type: "bi.icon_text_item",
cls: "dot-e-font",
height: 25,
text: "column 2.1",
value: 11
}, {
text: "column 2.2",
value: 12,
cls: "dot-e-font"
}]
}],
[{
text: "column 8",
value: 18,
cls: "dot-e-font",
selected: true
},
{
text: "column 9",
cls: "dot-e-font",
value: 19
}
],
[{
text: "column 10",
value: 20,
cls: "dot-e-font",
selected: true
},
{
text: "column 11",
cls: "dot-e-font",
value: 21
},
{
text: "column 12",
cls: "dot-e-font",
value: 22
},
{
text: "column 13",
cls: "dot-e-font",
value: 23
},
{
text: "column 14",
cls: "dot-e-font",
value: 24
},
{
text: "column 15",
cls: "dot-e-font",
value: 23
}
]
]
}, {
type: "bi.label",
text: "显示选择值",
width:500,
cls:"layout-bg4",
ref: function (_ref) {
self.label = _ref;
}
}],
vgap: 20
}
}
})
BI.shortcut("demo.down_list", Demo.Downlist);

46
demo/js/widget/editor/demo.adapt_editor.js

@ -0,0 +1,46 @@
/**
* Created by Dailer on 2017/7/11.
*/
Demo.AdaptEditor = BI.inherit(BI.Widget, {
props: {
baseCls: ""
},
//这东西好奇怪,不支持设置宽度,那么渲染出来宽度几乎没有,无奈之下只能假装给他个默认值了
beforeMounted: function () {
this.refs.setValue("Winter is coming !")
},
render: function () {
var self = this;
var editor = BI.createWidget({
type: "bi.adapt_editor",
cls: "layout-bg5",
ref: function (_ref) {
self.refs = _ref;
}
})
var text=["You know nothing! Jon Snow","A Lannister always pays his debts.","Power is a curious thing."]
return {
type: "bi.horizontal_auto",
items: [{
el: editor
}, {
type: "bi.button",
text: "为了展示长度真的是可变的,每点一下就换一行字",
handler: function () {
var temp=text.shift();
editor.setValue(temp);
text.push(temp);
}
}],
vgap: 20
}
}
})
BI.shortcut("demo.adapt_editor", Demo.AdaptEditor);

22
demo/js/widget/editor/demo.clear_editor.js

@ -0,0 +1,22 @@
/**
* Created by Dailer on 2017/7/11.
*/
Demo.ClearEditor = BI.inherit(BI.Widget, {
props: {
baseCls: ""
},
render: function () {
return {
type: "bi.horizontal_auto",
items: [{
type: "bi.clear_editor",
cls: "bi-border",
width: 300,
watermark: "这个是带清除按钮的"
}],
vgap: 20
}
}
})
BI.shortcut("demo.clear_editor", Demo.ClearEditor);

22
demo/js/widget/editor/demo.record_editor.js

@ -0,0 +1,22 @@
/**
* Created by Dailer on 2017/7/11.
*/
Demo.RecordEditor = BI.inherit(BI.Widget, {
props: {
baseCls: ""
},
render: function () {
return {
type: "bi.horizontal_auto",
items: [{
type: "bi.record_editor",
cls: "bi-border",
width: 300,
watermark: "这个是可以记录输入的"
}],
vgap: 20
}
}
})
BI.shortcut("demo.record_editor", Demo.RecordEditor);

29
demo/js/widget/editor/demo.search_editor.js

@ -0,0 +1,29 @@
/**
* Created by Dailer on 2017/7/11.
*/
Demo.SearchEditor = BI.inherit(BI.Widget, {
props: {
baseCls: "demo-exceltable"
},
render: function () {
return {
type: "bi.horizontal_auto",
items: [{
type: "bi.search_editor",
width: 300,
watermark:"添加合法性判断",
errorText: "长度必须大于4",
validationChecker:function(){
return this.getValue().length > 4 ? true : false
}
},{
type: "bi.small_search_editor",
width: 300,
watermark:"这个是 small,小一号"
}],
vgap:20
}
}
})
BI.shortcut("demo.search_editor", Demo.SearchEditor);

41
demo/js/widget/editor/demo.shelter_editor.js

@ -0,0 +1,41 @@
/**
* Created by Dailer on 2017/7/11.
*/
Demo.ClearEditor = BI.inherit(BI.Widget, {
props: {
baseCls: ""
},
render: function () {
var editor;
return {
type: "bi.horizontal_auto",
items: [{
type: "bi.shelter_editor",
cls: "bi-border",
ref:function(_ref){
editor=_ref;
},
width: 300,
watermark: "这个是带标记的"
},{
type:"bi.button",
text:"setValue",
width:300,
handler:function(){
editor.setValue("凛冬将至");
}
},{
type:"bi.button",
text:"doHighLight",
width:300,
handler:function(){
editor.doHighLight();
console.log(editor.getState());
}
}],
vgap: 20
}
}
})
BI.shortcut("demo.shelter_editor", Demo.ClearEditor);

24
demo/js/widget/editor/demo.sign_editor.js

@ -0,0 +1,24 @@
/**
* Created by Dailer on 2017/7/14.
*/
Demo.SignEditor = BI.inherit(BI.Widget, {
props: {
baseCls: ""
},
render: function () {
return {
type: "bi.horizontal_adapt",
items: [{
type: "bi.sign_editor",
// cls:"layout-bg5",
value: "123",
text: "456",
width: 300
}],
vgap: 20
}
}
})
BI.shortcut("demo.sign_editor", Demo.SignEditor);

24
demo/js/widget/editor/demo.sign_initial_editor.js

@ -0,0 +1,24 @@
/**
* Created by Dailer on 2017/7/11.
*/
Demo.SignInitialEditor = BI.inherit(BI.Widget, {
props: {
baseCls: ""
},
render: function () {
return {
type: "bi.horizontal_adapt",
items: [{
type: "bi.sign_initial_editor",
cls:"layout-bg5",
value:"123",
text:"456",
width: 300
}],
vgap:20
}
}
})
BI.shortcut("demo.sign_initial_editor", Demo.SignInitialEditor);

22
demo/js/widget/editor/demo.sign_style_editor.js

@ -0,0 +1,22 @@
/**
* Created by Dailer on 2017/7/11.
*/
Demo.SignStyleEditor = BI.inherit(BI.Widget, {
props: {
baseCls: "demo-exceltable"
},
render: function () {
return {
type: "bi.horizontal_adapt",
items: [{
type: "bi.sign_style_editor",
cls:"layout-bg5",
value:"12313",
width: 300
}],
vgap:20
}
}
})
BI.shortcut("demo.sign_style_editor", Demo.SignStyleEditor);

24
demo/js/widget/editor/demo.state_editor.js

@ -0,0 +1,24 @@
/**
* Created by Dailer on 2017/7/11.
*/
Demo.StateEditor = BI.inherit(BI.Widget, {
props: {
baseCls: ""
},
render: function () {
return {
type: "bi.horizontal_adapt",
items: [{
type: "bi.state_editor",
cls:"bi-border",
value:"123",
text:"456",
width: 300
}],
vgap:20
}
}
})
BI.shortcut("demo.state_editor", Demo.StateEditor);

28
demo/js/widget/editor/demo.text_editor.js

@ -0,0 +1,28 @@
/**
* Created by Dailer on 2017/7/11.
*/
Demo.TextEditor = BI.inherit(BI.Widget, {
props: {
baseCls: "demo-exceltable"
},
render: function () {
return {
type: "bi.horizontal_auto",
items: [{
type: "bi.text_editor",
watermark:"这是水印,watermark",
width: 300
},{
type: "bi.text_editor",
watermark:"这个不予许空",
allowBlank: false,
errorText: "非空!",
width: 300
}],
vgap:20
}
}
})
BI.shortcut("demo.text_editor", Demo.TextEditor);

20
demo/js/widget/month/demo.month.js

@ -0,0 +1,20 @@
/**
* Created by Dailer on 2017/7/11.
*/
Demo.Month = BI.inherit(BI.Widget, {
props: {
baseCls: "demo-exceltable"
},
render: function () {
return {
type: "bi.horizontal_adapt",
items: [{
type: "bi.month_combo",
width: 300
}]
}
}
})
BI.shortcut("demo.month", Demo.Month);

6
demo/js/widget/demo.multiselectcombo.js → demo/js/widget/multiselect/demo.multi_select_combo.js

@ -44,8 +44,8 @@ Demo.MultiSelectCombo = BI.inherit(BI.Widget, {
var search = BI.Func.getSearchResult(items, kw); var search = BI.Func.getSearchResult(items, kw);
items = search.matched.concat(search.finded); items = search.matched.concat(search.finded);
}); });
if (options.selectedValues) {//过滤 if (options.selected_values) {//过滤
var filter = BI.makeObject(options.selectedValues, true); var filter = BI.makeObject(options.selected_values, true);
items = BI.filter(items, function (i, ob) { items = BI.filter(items, function (i, ob) {
return !filter[ob.value]; return !filter[ob.value];
}); });
@ -74,7 +74,7 @@ Demo.MultiSelectCombo = BI.inherit(BI.Widget, {
scrolly: false, scrolly: false,
items: [{ items: [{
el: this._createMultiSelectCombo(), el: this._createMultiSelectCombo(),
right: 10, right: "50%",
top: 10 top: 10
}] }]
} }

41
demo/js/widget/multitree/demo.multi_tree_combo.js

@ -0,0 +1,41 @@
/**
* Created by Dailer on 2017/7/13.
*/
Demo.MultiTreeCombo = BI.inherit(BI.Widget, {
props: {
baseCls: ""
},
render: function () {
var self = this;
var items = BI.deepClone(Demo.CONSTANTS.TREE);
return {
type: "bi.horizontal_auto",
items: [{
type: "bi.multi_tree_combo",
ref: function (_ref) {
self.tree = _ref;
},
itemsCreator: function (options, callback) {
console.log(options);
callback({
items: items
});
},
width: 300
}, {
type: "bi.button",
text: "getVlaue",
handler: function () {
BI.Msg.toast(JSON.stringify(self.tree.getValue()));
},
width: 300
}],
vgap: 20
}
}
})
BI.shortcut("demo.multi_tree_combo", Demo.MultiTreeCombo);

44
demo/js/widget/numericalinterval/demo.numerical_interval.js

@ -0,0 +1,44 @@
/**
* Created by Dailer on 2017/7/12.
*/
Demo.NumericalInterval = BI.inherit(BI.Widget, {
props: {
baseCls: "demo-exceltable"
},
mounted: function () {
var numerical = this.numerical;
var label = this.label;
numerical.on(BI.NumericalInterval.EVENT_CHANGE, function () {
var temp = numerical.getValue();
var res = "大于" + (temp.closemin ? "等于 " : " ") + temp.min + " 小于" + (temp.closemax ? "等于 " : " ") + temp.max;
label.setValue(res);
})
},
render: function () {
var self = this;
return {
type: "bi.horizontal_auto",
items: [{
type: "bi.numerical_interval",
ref: function (_ref) {
self.numerical = _ref;
},
width: 500
}, {
type: "bi.label",
ref: function (_ref) {
self.label = _ref;
},
text: "显示结果"
}],
vgap: 20
}
}
})
BI.shortcut("demo.numberical_interval", Demo.NumericalInterval);

77
demo/js/widget/pathchooser/demo.directionpathchooser.js

@ -0,0 +1,77 @@
Demo.DirectionPathChooser = BI.inherit(BI.Widget, {
props: {
baseCls: "demo-direction-path-chooser"
},
render: function () {
return {
type: "bi.center_adapt",
items: [
{
type: "bi.direction_path_chooser",
items: [[{
"region": "8c4460bc3605685e",
"regionText": "采购订单XXX",
"text": "ID",
"value": "1"
}, {
"region": "0fbd0dc648f41e97",
"regionText": "采购订单",
"text": "学号",
"value": "3"
}, {
"region": "c6d72d6c7e19a667",
"regionText": "供应商基本信息",
"text": "ID",
"value": "5"
}], [{
"region": "ed013e18cc7c8637",
"regionText": "采购订单XXX",
"text": "ID",
"value": "1"
}, {
"region": "153d75878431f8ee",
"regionText": "A3",
"text": "学号",
"value": "2"
}, {
"region": "3861fb024c7d7825",
"regionText": "采购订单",
"text": "学号",
"value": "3"
}, {
"region": "88e3e5071bd10bc5",
"regionText": "供应商",
"text": "ID",
"value": "4"
}, {
"region": "8476c77ab5c147e0",
"regionText": "供应商基本信息",
"text": "ID",
"value": "5"
}], [{
"region": "f00f67fbb9fba6fe",
"regionText": "采购订单XXX",
"text": "ID",
"value": "1"
}, {
"region": "1e8badf5d5793408",
"regionText": "A3",
"text": "学号",
"value": "2"
}, {
"region": "de1ebd3d0986a294",
"regionText": "供应商基本信息",
"text": "ID",
"value": "5"
}]]
}
]
}
}
})
BI.shortcut("demo.direction_path_chooser",Demo.DirectionPathChooser);

0
demo/js/widget/demo.pathchooser.js → demo/js/widget/pathchooser/demo.pathchooser.js

20
demo/js/widget/quarter/demo.quarter.js

@ -0,0 +1,20 @@
/**
* Created by Dailer on 2017/7/11.
*/
Demo.Quarter = BI.inherit(BI.Widget, {
props: {
baseCls: "demo-exceltable"
},
render: function () {
return {
type: "bi.horizontal_adapt",
items: [{
type: "bi.quarter_combo",
width: 300
}]
}
}
})
BI.shortcut("demo.quarter", Demo.Quarter);

0
demo/js/widget/demo.relationview.js → demo/js/widget/relationview/demo.relationview.js

35
demo/js/widget/selecttree/demo.multilayer_select_tree_combo.js

@ -0,0 +1,35 @@
/**
* Created by Dailer on 2017/7/13.
*/
Demo.MultiLayerSelectTreeCombo = BI.inherit(BI.Widget, {
props: {
baseCls: ""
},
render: function () {
var self = this;
var items = BI.deepClone(Demo.CONSTANTS.TREE);
return {
type: "bi.horizontal_auto",
items: [{
type: "bi.multilayer_select_tree_combo",
ref: function (_ref) {
self.tree = _ref;
},
text: "默认值",
items: items,
width: 300
}, {
type: "bi.button",
text: "getVlaue",
handler: function () {
BI.Msg.toast(self.tree.getValue()[0]);
},
width: 300
}],
vgap: 20
}
}
})
BI.shortcut("demo.multilayer_select_tree_combo", Demo.MultiLayerSelectTreeCombo);

182
demo/js/widget/selecttree/demo.select_tree_combo.js

@ -0,0 +1,182 @@
/**
* Created by Dailer on 2017/7/13.
*/
Demo.SelectTreeCombo = BI.inherit(BI.Widget, {
props: {
baseCls: "demo-exceltable"
},
render: function () {
var self = this;
var items = [{
id: 1,
text: "第一项",
value: 1,
isParent: true,
title: "第一项"
}, {
id: 2,
text: "第二项",
value: 2,
isParent: true,
title: "第二项"
}, {
id: 3,
text: "第三项",
value: 3,
isParent: true,
open: true,
title: "第三项"
}, {
id: 4,
text: "第四项",
value: 4,
isParent: true,
title: "第四项"
}, {
id: 5,
text: "第五项",
value: 5,
isParent: true,
title: "第五项"
}, {
id: 6,
text: "第六项",
value: 6,
isParent: true,
open: true,
title: "第六项"
}, {
id: 7,
text: "第七项",
value: 7,
isParent: true,
open: true,
title: "第七项"
}, {
id: 11,
pId: 1,
text: "子项1",
value: 11,
title: "子项1"
}, {
id: 12,
pId: 1,
text: "子项2",
value: 12,
title: "子项2"
}, {
id: 13,
pId: 1,
text: "子项3",
value: 13,
title: "子项3"
}, {
id: 21,
pId: 2,
text: "子项1",
value: 21,
title: "子项1"
}, {
id: 22,
pId: 2,
text: "子项2",
value: 22,
title: "子项2"
}, {
id: 31,
pId: 3,
text: "子项1",
value: 31,
title: "子项1"
}, {
id: 32,
pId: 3,
text: "子项2",
value: 32,
title: "子项2"
}, {
id: 33,
pId: 3,
text: "子项3",
value: 33,
title: "子项3"
}, {
id: 41,
pId: 4,
text: "子项1",
value: 41,
title: "子项1"
}, {
id: 42,
pId: 4,
text: "子项2",
value: 42,
title: "子项2"
}, {
id: 43,
pId: 4,
text: "子项3",
value: 43,
title: "子项3"
}, {
id: 51,
pId: 5,
text: "子项1",
value: 51,
title: "子项1"
}, {
id: 52,
pId: 5,
text: "子项2",
value: 52,
title: "子项2"
}, {
id: 61,
pId: 6,
text: "子项1",
value: 61,
title: "子项1"
}, {
id: 62,
pId: 6,
text: "子项2",
value: 62,
title: "子项2"
}, {
id: 71,
pId: 7,
text: "子项1",
value: 71,
title: "子项1"
}, {
id: 72,
pId: 7,
text: "子项2",
value: 72,
title: "子项2"
}];
return {
type: "bi.horizontal_auto",
items: [{
type: "bi.select_tree_combo",
ref: function (_ref) {
self.tree = _ref;
},
text: "默认值",
items: items,
width: 300
}, {
type: "bi.button",
text: "getVlaue",
handler: function () {
BI.Msg.toast(self.tree.getValue()[0]);
},
width: 300
}],
vgap: 20
}
}
})
BI.shortcut("demo.select_tree_combo", Demo.SelectTreeCombo);

35
demo/js/widget/singletree/demo.multilayer_single_tree_combo.js

@ -0,0 +1,35 @@
/**
* Created by Dailer on 2017/7/13.
*/
Demo.MultiLayerSingleTreeCombo = BI.inherit(BI.Widget, {
props: {
baseCls: ""
},
render: function () {
var self = this;
var items = BI.deepClone(Demo.CONSTANTS.TREE);
return {
type: "bi.horizontal_auto",
items: [{
type: "bi.multilayer_single_tree_combo",
ref: function (_ref) {
self.tree = _ref;
},
text: "默认值",
items: items,
width: 300
}, {
type: "bi.button",
text: "getVlaue",
handler: function () {
BI.Msg.toast(self.tree.getValue()[0]);
},
width: 300
}],
vgap: 20
}
}
})
BI.shortcut("demo.multilayer_single_tree_combo", Demo.MultiLayerSingleTreeCombo);

181
demo/js/widget/singletree/demo.single_tree_combo.js

@ -0,0 +1,181 @@
/**
* Created by Dailer on 2017/7/13.
*/
Demo.SingleTreeCombo = BI.inherit(BI.Widget, {
props: {
baseCls: "demo-exceltable"
},
render: function () {
var self = this;
return {
type: "bi.horizontal_auto",
items: [{
type: "bi.single_tree_combo",
ref: function (_ref) {
self.tree = _ref;
},
text: "默认值",
items: [{
id: 1,
text: "第一项",
value: 1,
isParent: true,
title: "第一项"
}, {
id: 2,
text: "第二项",
value: 1,
isParent: true,
title: "第二项"
}, {
id: 3,
text: "第三项",
value: 1,
isParent: true,
open: true,
title: "第三项"
}, {
id: 4,
text: "第四项",
value: 1,
isParent: true,
title: "第四项"
}, {
id: 5,
text: "第五项",
value: 1,
isParent: true,
title: "第五项"
}, {
id: 6,
text: "第六项",
value: 1,
isParent: true,
open: true,
title: "第六项"
}, {
id: 7,
text: "第七项",
value: 1,
isParent: true,
open: true,
title: "第七项"
}, {
id: 11,
pId: 1,
text: "子项1",
value: 11,
title: "子项1"
}, {
id: 12,
pId: 1,
text: "子项2",
value: 12,
title: "子项2"
}, {
id: 13,
pId: 1,
text: "子项3",
value: 13,
title: "子项3"
}, {
id: 21,
pId: 2,
text: "子项1",
value: 21,
title: "子项1"
}, {
id: 22,
pId: 2,
text: "子项2",
value: 22,
title: "子项2"
}, {
id: 31,
pId: 3,
text: "子项1",
value: 31,
title: "子项1"
}, {
id: 32,
pId: 3,
text: "子项2",
value: 32,
title: "子项2"
}, {
id: 33,
pId: 3,
text: "子项3",
value: 33,
title: "子项3"
}, {
id: 41,
pId: 4,
text: "子项1",
value: 41,
title: "子项1"
}, {
id: 42,
pId: 4,
text: "子项2",
value: 42,
title: "子项2"
}, {
id: 43,
pId: 4,
text: "子项3",
value: 43,
title: "子项3"
}, {
id: 51,
pId: 5,
text: "子项1",
value: 51,
title: "子项1"
}, {
id: 52,
pId: 5,
text: "子项2",
value: 52,
title: "子项2"
}, {
id: 61,
pId: 6,
text: "子项1",
value: 61,
title: "子项1"
}, {
id: 62,
pId: 6,
text: "子项2",
value: 62,
title: "子项2"
}, {
id: 71,
pId: 7,
text: "子项1",
value: 71,
title: "子项1"
}, {
id: 72,
pId: 7,
text: "子项2",
value: 72,
title: "子项2"
}],
width: 300
}, {
type: "bi.button",
text: "getVlaue",
handler: function () {
BI.Msg.toast(self.tree.getValue()[0]);
},
width: 300
}],
vgap: 20
}
}
})
BI.shortcut("demo.single_tree_combo", Demo.SingleTreeCombo);

40
demo/js/widget/table/demo.excel_table.js

@ -0,0 +1,40 @@
/**
* Created by Dailer on 2017/7/12.
*/
Demo.ExcelTable = BI.inherit(BI.Widget, {
props: {
baseCls: "demo-exceltable"
},
render: function () {
return {
type: "bi.horizontal_auto",
items: [{
type: "bi.excel_table",
columnSize: [200,200,200,200,200],
items: [
[{
type: "bi.label",
cls: "layout-bg1",
text: "第一行第一列"
}, {
type: "bi.label",
cls: "layout-bg2",
text: "第一行第二列"
}],
[{
type: "bi.label",
cls: "layout-bg3",
text: "第二行第一列"
}, {
type: "bi.label",
cls: "layout-bg4",
text: "第二行第二列"
}]
]
}],
width:500
}
}
})
BI.shortcut("demo.excel_table", Demo.ExcelTable);

33
demo/js/widget/timeinterval/demo.time_interval.js

@ -0,0 +1,33 @@
/**
* Created by Dailer on 2017/7/13.
*/
Demo.TimeInterval = BI.inherit(BI.Widget, {
props: {
baseCls: ""
},
render: function () {
var self = this;
var items = BI.deepClone(Demo.CONSTANTS.TREE);
return {
type: "bi.horizontal_auto",
items: [{
type: "bi.time_interval",
ref: function (_ref) {
self.interval = _ref;
},
width: 300
}, {
type: "bi.button",
text: "getVlaue",
handler: function () {
BI.Msg.toast(JSON.stringify(self.interval.getValue()));
},
width: 300
}],
vgap: 20
}
}
})
BI.shortcut("demo.time_interval", Demo.TimeInterval);

66
demo/js/widget/tree/demo.multilayer_select_tree_combo.js

@ -1,66 +0,0 @@
/**
* Created by User on 2017/3/22.
*/
Demo.MultiSelectCombo = BI.inherit(BI.Widget, {
props: {},
render: function (vessel) {
var TREEWITHCHILDREN = [{
id: -1, value: "根目录", text: "根目录", children: [
{
id: 1, value: "第一级目录1", text: "第一级目录1", children: [
{id: 11, value: "第二级文件1", text: "第二级文件1"},
{
id: 12, value: "第二级目录2", text: "第二级目录2", children: [
{
id: 121, value: "第三级目录1", text: "第三级目录1", children: [
{
id: 1211, value: "第四级目录1", text: "第四级目录1", children: [
{id: 12111, value: "第五级文件1", text: "第五级文件1"}
]
}
]
},
{id: 122, value: "第三级文件1", text: "第三级文件1"}
]
}
]
},
{
id: 2, value: "第一级目录2", text: "第一级目录2", children: [
{
id: 21, value: "第二级目录3", text: "第二级目录3", children: [
{
id: 211, value: "第三级目录2", text: "第三级目录2", children: [
{id: 2111, value: "第四级文件1", text: "第四级文件1"}
]
},
{id: 212, value: "第三级文件2", text: "第三级文件2"}
]
},
{id: 22, value: "第二级文件2", text: "第二级文件2"}
]
}
]
}];
var items = BI.deepClone(TREEWITHCHILDREN);
var combo = BI.createWidget({
type: "bi.multilayer_select_tree_combo",
});
combo.populate(items);
return {
type: "bi.vertical",
items: [combo, {
type: "bi.button",
width: 100,
text: "getValue",
handler: function () {
BI.Msg.alert("", JSON.stringify(combo.getValue()));
}
}],
vgap: 100
}
}
});
BI.shortcut("demo.multilayer_select_tree_combo", Demo.MultiSelectCombo);

24
demo/js/widget/tree/demo.switch_tree.js

@ -0,0 +1,24 @@
/**
* Created by Dailer on 2017/7/13.
*/
Demo.SwitchTree = BI.inherit(BI.Widget, {
props: {
baseCls: ""
},
render: function () {
var items = BI.deepClone(Demo.CONSTANTS.TREE);
return {
type: "bi.horizontal_auto",
items: [{
type: "bi.switch_tree",
items: items
},{
type:"bi.button",
text:"getValue"
}]
}
}
})
BI.shortcut("demo.switch_tree", Demo.SwitchTree);

19
demo/js/widget/year/demo.year.js

@ -0,0 +1,19 @@
/**
* Created by Dailer on 2017/7/11.
*/
Demo.Year = BI.inherit(BI.Widget, {
props: {
baseCls: "demo-exceltable"
},
render: function () {
return {
type: "bi.horizontal_adapt",
items: [{
type: "bi.year_combo",
width: 300
}]
}
}
})
BI.shortcut("demo.year", Demo.Year);

32
demo/js/widget/yearmonth/demo.year_month_combo.js

@ -0,0 +1,32 @@
/**
* Created by Dailer on 2017/7/13.
*/
Demo.YearMonthCombo = BI.inherit(BI.Widget, {
props: {
baseCls: ""
},
render: function () {
var self = this;
return {
type: "bi.horizontal_auto",
items: [{
type: "bi.year_month_combo",
ref: function (_ref) {
self.widget = _ref;
},
width: 300
}, {
type: "bi.button",
text: "getValue",
handler: function () {
BI.Msg.toast(JSON.stringify(self.widget.getValue()))
},
width: 300
}],
vgap: 20
}
}
})
BI.shortcut("demo.year_month_combo", Demo.YearMonthCombo);

33
demo/js/widget/yearquarter/demo.year_quarter_combo.js

@ -0,0 +1,33 @@
/**
* Created by Dailer on 2017/7/13.
*/
Demo.YearQuarterCombo = BI.inherit(BI.Widget, {
props: {
baseCls: ""
},
render: function () {
var self=this;
return {
type: "bi.horizontal_auto",
items: [{
type: "bi.year_quarter_combo",
width: 300,
ref:function(_ref){
self.widget=_ref;
},
yearBehaviors: {},
quarterBehaviors: {},
}, {
type: "bi.button",
text: "getValue",
handler:function(){
BI.Msg.toast(JSON.stringify(self.widget.getValue()))
},
width: 300
}],
vgap: 20
}
}
})
BI.shortcut("demo.year_quarter_combo", Demo.YearQuarterCombo);

5
demo/less/main.less

@ -1,5 +1,4 @@
@import "index"; @import "index";
.layout-bg-white { .layout-bg-white {
background-color: #ffffff; background-color: #ffffff;
} }
@ -61,3 +60,7 @@ body {
.bi-theme-dark body { .bi-theme-dark body {
background-color: @color-bi-background-normal-theme-dark; background-color: @color-bi-background-normal-theme-dark;
} }
.demo-editor {
border: 1px solid rgb(204, 204, 204);
}

13
docs/case.js

@ -12033,6 +12033,19 @@ BI.DisplayTree = BI.inherit(BI.TreeView, {
return setting; return setting;
}, },
_dealWidthNodes: function (nodes) {
nodes = BI.DisplayTree.superclass._dealWidthNodes.apply(this, arguments);
var self = this, o = this.options;
BI.each(nodes, function (i, node) {
if (node.count > 0) {
node.text = node.value + "(" + BI.i18nText("BI-Basic_Altogether") + node.count + BI.i18nText("BI-Basic_Count") + ")";
} else {
node.text = node.value;
}
});
return nodes;
},
initTree: function (nodes, setting) { initTree: function (nodes, setting) {
var setting = setting || this._configSetting(); var setting = setting || this._configSetting();
this.nodes = $.fn.zTree.init(this.tree.element, setting, nodes); this.nodes = $.fn.zTree.init(this.tree.element, setting, nodes);

8
docs/core.css

@ -3900,7 +3900,7 @@ i {
.bi-list-item-none:hover, .bi-list-item-none:hover,
.bi-list-item-none.hover { .bi-list-item-none.hover {
color: inherit; color: inherit;
background-color: inherit; background-color: transparent;
} }
.bi-list-item-none:hover .bi-input, .bi-list-item-none:hover .bi-input,
.bi-list-item-none.hover .bi-input { .bi-list-item-none.hover .bi-input {
@ -3913,7 +3913,7 @@ i {
.bi-list-item-none:active, .bi-list-item-none:active,
.bi-list-item-none.active { .bi-list-item-none.active {
color: inherit; color: inherit;
background-color: inherit; background-color: transparent;
} }
.bi-list-item-none:active .bi-input, .bi-list-item-none:active .bi-input,
.bi-list-item-none.active .bi-input { .bi-list-item-none.active .bi-input {
@ -3951,7 +3951,7 @@ i {
.bi-theme-dark .bi-list-item-none:hover, .bi-theme-dark .bi-list-item-none:hover,
.bi-theme-dark .bi-list-item-none.hover { .bi-theme-dark .bi-list-item-none.hover {
color: inherit; color: inherit;
background-color: inherit; background-color: transparent;
} }
.bi-theme-dark .bi-list-item-none:hover .bi-input, .bi-theme-dark .bi-list-item-none:hover .bi-input,
.bi-theme-dark .bi-list-item-none.hover .bi-input { .bi-theme-dark .bi-list-item-none.hover .bi-input {
@ -3964,7 +3964,7 @@ i {
.bi-theme-dark .bi-list-item-none:active, .bi-theme-dark .bi-list-item-none:active,
.bi-theme-dark .bi-list-item-none.active { .bi-theme-dark .bi-list-item-none.active {
color: inherit; color: inherit;
background-color: inherit; background-color: transparent;
} }
.bi-theme-dark .bi-list-item-none:active .bi-input, .bi-theme-dark .bi-list-item-none:active .bi-input,
.bi-theme-dark .bi-list-item-none.active .bi-input { .bi-theme-dark .bi-list-item-none.active .bi-input {

3
docs/demo.css

@ -48,6 +48,9 @@ body {
.bi-theme-dark body { .bi-theme-dark body {
background-color: #191B2B; background-color: #191B2B;
} }
.demo-editor {
border: 1px solid #cccccc;
}
.demo-north { .demo-north {
background-color: #3c8dbc; background-color: #3c8dbc;
} }

3041
docs/demo.js

File diff suppressed because one or more lines are too long

BIN
docs/icon/arrow left right.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 389 B

BIN
docs/icon/radio.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 385 B

BIN
docs/icon/slider.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

BIN
docs/icon/双向箭头.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 189 B

24
docs/index.html

@ -1,19 +1,14 @@
<!DOCTYPE html> <!DOCTYPE html>
<html lang="en"> <html lang="en">
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<title></title> <title></title>
<link rel="stylesheet" type="text/css" href="core.css" />
<link rel="stylesheet" type="text/css" <link rel="stylesheet" type="text/css" href="base.css" />
href="core.css"/> <link rel="stylesheet" type="text/css" href="widget.css" />
<link rel="stylesheet" type="text/css" <link rel="stylesheet" type="text/css" href="resource.css" />
href="base.css"/> <link rel="stylesheet" type="text/css" href="demo.css" />
<link rel="stylesheet" type="text/css"
href="widget.css"/>
<link rel="stylesheet" type="text/css"
href="resource.css"/>
<link rel="stylesheet" type="text/css"
href="demo.css"/>
<script src="polyfill.js"></script> <script src="polyfill.js"></script>
<script src="core.js"></script> <script src="core.js"></script>
@ -22,12 +17,15 @@
<script src="widget.js"></script> <script src="widget.js"></script>
<!--图表--> <!--图表-->
<script src="vancharts-all.js"></script> <script src="vancharts-all.js"></script>
<script src="biconst.js"></script><!--图表用到的常量(直接拿的bi的常量)--> <script src="biconst.js"></script>
<!--图表用到的常量(直接拿的bi的常量)-->
<script src="chart.js"></script> <script src="chart.js"></script>
<script src="demo.js"></script> <script src="demo.js"></script>
</head> </head>
<body> <body>
<div id="wrapper"></div> <div id="wrapper"></div>
</body> </body>
</html> </html>

16149
docs/widget.js

File diff suppressed because it is too large Load Diff

1776
package-lock.json generated

File diff suppressed because it is too large Load Diff

13
src/case/tree/tree.display.js

@ -44,6 +44,19 @@ BI.DisplayTree = BI.inherit(BI.TreeView, {
return setting; return setting;
}, },
_dealWidthNodes: function (nodes) {
nodes = BI.DisplayTree.superclass._dealWidthNodes.apply(this, arguments);
var self = this, o = this.options;
BI.each(nodes, function (i, node) {
if (node.count > 0) {
node.text = node.value + "(" + BI.i18nText("BI-Basic_Altogether") + node.count + BI.i18nText("BI-Basic_Count") + ")";
} else {
node.text = node.value;
}
});
return nodes;
},
initTree: function (nodes, setting) { initTree: function (nodes, setting) {
var setting = setting || this._configSetting(); var setting = setting || this._configSetting();
this.nodes = $.fn.zTree.init(this.tree.element, setting, nodes); this.nodes = $.fn.zTree.init(this.tree.element, setting, nodes);

11
src/component/treevaluechooser/abstract.treevaluechooser.js

@ -227,7 +227,7 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
function search(parents, current, result, searched) { function search(parents, current, result, searched) {
var newParents = BI.clone(parents); var newParents = BI.clone(parents);
newParents.push(current); newParents.push(current);
if (self._isMatch(current, keyword)) { if (self._isMatch(parents, current, keyword)) {
searched && searched.push(newParents); searched && searched.push(newParents);
return true; return true;
} }
@ -256,7 +256,7 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
function isSearchValueInParent(parentValues) { function isSearchValueInParent(parentValues) {
for (var i = 0, len = parentValues.length; i < len; i++) { for (var i = 0, len = parentValues.length; i < len; i++) {
if (self._isMatch(parentValues[i], keyword)) { if (self._isMatch(parentValues.slice(0, parentValues.length - 1), parentValues[i], keyword)) {
return true; return true;
} }
} }
@ -382,7 +382,7 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
} }
function nodeSearch(deep, parentValues, current, isAllSelect, result) { function nodeSearch(deep, parentValues, current, isAllSelect, result) {
if (self._isMatch(current, keyword)) { if (self._isMatch(parentValues, current, keyword)) {
var checked = isAllSelect || isSelected(parentValues, current); var checked = isAllSelect || isSelected(parentValues, current);
createOneJson(parentValues, current, false, checked, !isAllSelect && isHalf(parentValues, current), true, result); createOneJson(parentValues, current, false, checked, !isAllSelect && isHalf(parentValues, current), true, result);
return [true, checked]; return [true, checked];
@ -612,8 +612,9 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
}); });
}, },
_isMatch: function (value, keyword) { _isMatch: function (parentValues, value, keyword) {
var finded = BI.Func.getSearchResult([value], keyword); var node = this._getTreeNode(parentValues, value);
var finded = BI.Func.getSearchResult([node.text || node.value], keyword);
return finded.finded.length > 0 || finded.matched.length > 0; return finded.finded.length > 0 || finded.matched.length > 0;
}, },

8
src/css/core/utils/common.css

@ -724,7 +724,7 @@
.bi-list-item-none:hover, .bi-list-item-none:hover,
.bi-list-item-none.hover { .bi-list-item-none.hover {
color: inherit; color: inherit;
background-color: inherit; background-color: transparent;
} }
.bi-list-item-none:hover .bi-input, .bi-list-item-none:hover .bi-input,
.bi-list-item-none.hover .bi-input { .bi-list-item-none.hover .bi-input {
@ -737,7 +737,7 @@
.bi-list-item-none:active, .bi-list-item-none:active,
.bi-list-item-none.active { .bi-list-item-none.active {
color: inherit; color: inherit;
background-color: inherit; background-color: transparent;
} }
.bi-list-item-none:active .bi-input, .bi-list-item-none:active .bi-input,
.bi-list-item-none.active .bi-input { .bi-list-item-none.active .bi-input {
@ -775,7 +775,7 @@
.bi-theme-dark .bi-list-item-none:hover, .bi-theme-dark .bi-list-item-none:hover,
.bi-theme-dark .bi-list-item-none.hover { .bi-theme-dark .bi-list-item-none.hover {
color: inherit; color: inherit;
background-color: inherit; background-color: transparent;
} }
.bi-theme-dark .bi-list-item-none:hover .bi-input, .bi-theme-dark .bi-list-item-none:hover .bi-input,
.bi-theme-dark .bi-list-item-none.hover .bi-input { .bi-theme-dark .bi-list-item-none.hover .bi-input {
@ -788,7 +788,7 @@
.bi-theme-dark .bi-list-item-none:active, .bi-theme-dark .bi-list-item-none:active,
.bi-theme-dark .bi-list-item-none.active { .bi-theme-dark .bi-list-item-none.active {
color: inherit; color: inherit;
background-color: inherit; background-color: transparent;
} }
.bi-theme-dark .bi-list-item-none:active .bi-input, .bi-theme-dark .bi-list-item-none:active .bi-input,
.bi-theme-dark .bi-list-item-none.active .bi-input { .bi-theme-dark .bi-list-item-none.active .bi-input {

8
src/less/core/utils/common.less

@ -706,7 +706,7 @@
& .bi-textarea { & .bi-textarea {
color: inherit; color: inherit;
} }
background-color: inherit; background-color: transparent;
} }
&:active, &.active { &:active, &.active {
color: inherit; color: inherit;
@ -716,7 +716,7 @@
& .bi-textarea { & .bi-textarea {
color: inherit; color: inherit;
} }
background-color: inherit; background-color: transparent;
& .bi-high-light { & .bi-high-light {
color: inherit; color: inherit;
} }
@ -748,7 +748,7 @@
& .bi-textarea { & .bi-textarea {
color: inherit; color: inherit;
} }
background-color: inherit; background-color: transparent;
} }
&:active, &.active { &:active, &.active {
color: inherit; color: inherit;
@ -758,7 +758,7 @@
& .bi-textarea { & .bi-textarea {
color: inherit; color: inherit;
} }
background-color: inherit; background-color: transparent;
& .bi-high-light { & .bi-high-light {
color: inherit; color: inherit;
} }

2
src/less/resource/icon.less

@ -55,3 +55,5 @@
//Half Select //Half Select
.icon(check-half-select-icon, @icon-half-select); .icon(check-half-select-icon, @icon-half-select);

15
src/widget/multiselect/multiselect.combo.js

@ -24,6 +24,8 @@ BI.MultiSelectCombo = BI.inherit(BI.Single, {
self.trigger.getCounter().setButtonChecked(self.storeValue); self.trigger.getCounter().setButtonChecked(self.storeValue);
}; };
this.storeValue = {}; this.storeValue = {};
//标记正在请求数据
this.requesting = false;
this.trigger = BI.createWidget({ this.trigger = BI.createWidget({
type: "bi.multi_select_trigger", type: "bi.multi_select_trigger",
@ -162,10 +164,16 @@ BI.MultiSelectCombo = BI.inherit(BI.Single, {
self.populate(); self.populate();
}); });
}); });
//当退出的时候如果还在处理请求,则等请求结束后再对外发确定事件
this.wants2Quit = false;
this.combo.on(BI.Combo.EVENT_AFTER_HIDEVIEW, function () { this.combo.on(BI.Combo.EVENT_AFTER_HIDEVIEW, function () {
//important:关闭弹出时又可能没有退出编辑状态 //important:关闭弹出时又可能没有退出编辑状态
self.trigger.stopEditing(); self.trigger.stopEditing();
if (self.requesting === true) {
self.wants2Quit = true;
} else {
self.fireEvent(BI.MultiSelectCombo.EVENT_CONFIRM); self.fireEvent(BI.MultiSelectCombo.EVENT_CONFIRM);
}
}); });
var triggerBtn = BI.createWidget({ var triggerBtn = BI.createWidget({
@ -218,6 +226,7 @@ BI.MultiSelectCombo = BI.inherit(BI.Single, {
_joinKeywords: function (keywords, callback) { _joinKeywords: function (keywords, callback) {
var self = this, o = this.options; var self = this, o = this.options;
this._assertValue(this.storeValue); this._assertValue(this.storeValue);
this.requesting = true;
o.itemsCreator({ o.itemsCreator({
type: BI.MultiSelectCombo.REQ_GET_ALL_DATA, type: BI.MultiSelectCombo.REQ_GET_ALL_DATA,
keywords: keywords keywords: keywords
@ -240,6 +249,7 @@ BI.MultiSelectCombo = BI.inherit(BI.Single, {
_joinAll: function (res, callback) { _joinAll: function (res, callback) {
var self = this, o = this.options; var self = this, o = this.options;
this._assertValue(res); this._assertValue(res);
this.requesting = true;
o.itemsCreator({ o.itemsCreator({
type: BI.MultiSelectCombo.REQ_GET_ALL_DATA, type: BI.MultiSelectCombo.REQ_GET_ALL_DATA,
keywords: [this.trigger.getKey()] keywords: [this.trigger.getKey()]
@ -300,6 +310,11 @@ BI.MultiSelectCombo = BI.inherit(BI.Single, {
value: [] value: []
} }
} }
if (self.wants2Quit === true) {
self.fireEvent(BI.MultiSelectCombo.EVENT_CONFIRM);
self.wants2Quit = false;
}
self.requesting = false;
} }
}, },

Loading…
Cancel
Save