Browse Source

完善 FineUI Demo

es6
刘荣歆 7 years ago
parent
commit
14f005f385
  1. 121
      demo/js/widget/arrangment/demo.adaptivearrangement.js
  2. 13
      demo/js/widget/arrangment/demo.interactivearrangement.js
  3. 31
      demo/js/widget/date/demo.date.js
  4. 39
      demo/js/widget/date/demo.datepane.js
  5. 27
      demo/js/widget/dialog/demo.dialog.js
  6. 20
      demo/js/widget/month/demo.month.js
  7. 41
      demo/js/widget/multitree/demo.multi_tree_combo.js
  8. 77
      demo/js/widget/pathchooser/demo.directionpathchooser.js
  9. 177
      demo/js/widget/pathchooser/demo.pathchooser.js
  10. 20
      demo/js/widget/quarter/demo.quarter.js
  11. 65
      demo/js/widget/relationview/demo.relationview.js
  12. 35
      demo/js/widget/selecttree/demo.multilayer_select_tree_combo.js
  13. 182
      demo/js/widget/selecttree/demo.select_tree_combo.js
  14. 35
      demo/js/widget/singletree/demo.multilayer_single_tree_combo.js
  15. 181
      demo/js/widget/singletree/demo.single_tree_combo.js
  16. 40
      demo/js/widget/table/demo.excel_table.js
  17. 33
      demo/js/widget/timeinterval/demo.time_interval.js
  18. 24
      demo/js/widget/tree/demo.switch_tree.js
  19. 19
      demo/js/widget/year/demo.year.js
  20. 32
      demo/js/widget/yearmonth/demo.year_month_combo.js
  21. 33
      demo/js/widget/yearquarter/demo.year_quarter_combo.js
  22. 1344
      docs/demo.js

121
demo/js/widget/arrangment/demo.adaptivearrangement.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);

13
demo/js/widget/arrangment/demo.interactivearrangement.js

@ -0,0 +1,13 @@
/**
* Created by User on 2017/3/22.
*/
Demo.RelationView = BI.inherit(BI.Widget, {
props: {
},
render: function () {
return {
type: "bi.interactive_arrangement",
};
}
});
BI.shortcut("demo.interactive_arrangement", Demo.RelationView);

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: "aiyaya",
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", 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);

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

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

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

177
demo/js/widget/pathchooser/demo.pathchooser.js

@ -0,0 +1,177 @@
/**
* Created by User on 2017/3/22.
*/
Demo.PathChooser = BI.inherit(BI.Widget, {
props: {
baseCls: "demo-path-chooser"
},
render: function () {
var pathchooser = BI.createWidget({
type: "bi.path_chooser",
width: 800,
height: 400,
items: // [
// [{region: "区域X", value: "X1"},
// {region: "区域Q", value: "Q"},
// {region: "区域A", value: "A"},
// {region: "区域B", value: "B"},
// {region: "区域D", value: "D"},
// {region: "区域E", value: "E"},
// {region: "区域G", value: "G"},
// {region: "区域I", value: "I"},
// {region: "区域J", value: "J"}],
// [{region: "区域X", value: "X"},
// {region: "区域Q", value: "Q"},
// {region: "区域A", value: "A"},
// {region: "区域B", value: "B"},
// {region: "区域C", value: "C"},
// {region: "区域D", value: "D"},
// {region: "区域E", value: "E"},
// {region: "区域G", value: "G"},
// {region: "区域I", value: "I"},
// {region: "区域J", value: "J"}],
// [{region: "区域X", value: "X"},
// //{region: "区域Q", value: "Q"},
// {region: "区域A", value: "A"},
// {region: "区域C", value: "C"},
// {region: "区域D", value: "D"},
// {region: "区域E", value: "E"},
// {region: "区域G", value: "G"},
// {region: "区域I", value: "I"},
// {region: "区域J", value: "J"}],
// [{region: "区域X", value: "X"},
// {region: "区域Q", value: "Q"},
// {region: "区域A", value: "A"},
// {region: "区域B", value: "B"},
// {region: "区域D", value: "D"},
// {region: "区域E", value: "E1"},
// {region: "区域H", value: "H"},
// {region: "区域I", value: "I"},
// {region: "区域J", value: "J"}],
// [{region: "区域X", value: "X"},
// {region: "区域Q", value: "Q"},
// {region: "区域A", value: "A"},
// {region: "区域B", value: "B"},
// {region: "区域C", value: "C"},
// {region: "区域D", value: "D"},
// {region: "区域E", value: "E1"},
// {region: "区域H", value: "H"},
// {region: "区域I", value: "I"},
// {region: "区域J", value: "J"}],
// [{region: "区域X", value: "X"},
// {region: "区域Q", value: "Q"},
// {region: "区域A", value: "A"},
// {region: "区域C", value: "C"},
// {region: "区域D", value: "D"},
// {region: "区域E", value: "E1"},
// {region: "区域H", value: "H"},
// {region: "区域I", value: "I"},
// {region: "区域J", value: "J"}],
// [{region: "区域X", value: "X"},
// {region: "区域Q", value: "Q"},
// {region: "区域A", value: "A"},
// {region: "区域B", value: "B"},
// {region: "区域D", value: "D"},
// {region: "区域F", value: "F"},
// {region: "区域H", value: "H"},
// {region: "区域I", value: "I"},
// {region: "区域J", value: "J"}],
// [{region: "区域X", value: "X"},
// {region: "区域Q", value: "Q"},
// {region: "区域A", value: "A"},
// {region: "区域B", value: "B"},
// {region: "区域C", value: "C"},
// {region: "区域D", value: "D"},
// {region: "区域F", value: "F"},
// {region: "区域H", value: "H"},
// {region: "区域I", value: "I"},
// {region: "区域J", value: "J"}],
// [{region: "区域X", value: "X", text: "X"},
// {region: "区域Q", value: "Q", text: "Q"},
// {region: "区域A", value: "A", text: "A"},
// {region: "区域C", value: "C", text: "C"},
// {region: "区域D", value: "D", text: "D"},
// {region: "区域F", value: "F", text: "F"},
// {region: "区域H", value: "H", text: "H"},
// {region: "区域I", value: "I", text: "I"},
// {region: "区域J", value: "J", text: "J"}]
//]
[[{
"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"
}]]
});
pathchooser.setValue();
return {
type: "bi.absolute",
items: [{
el: pathchooser,
left: 100,
top: 100
}, {
el: {
type: "bi.button",
text: "getValue",
handler: function () {
BI.Msg.toast(JSON.stringify(pathchooser.getValue()));
}
},
left: 100,
bottom: 10
}]
}
}
});
BI.shortcut("demo.path_chooser", Demo.PathChooser);

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

65
demo/js/widget/relationview/demo.relationview.js

@ -0,0 +1,65 @@
/**
* Created by User on 2017/3/22.
*/
Demo.RelationView = BI.inherit(BI.Widget, {
props: {
baseCls: "demo-relation-view"
},
render: function () {
var relationview = BI.createWidget({
type: "bi.relation_view",
items: [
{
primary: {
region: "B", regionText: "比", regionTitle: "bbb", regionHandler: function () {
alert("a")
},
title: "b2...",
value: "b2", text: "b2字段",
handler: function () {
alert("d")
}
},
foreign: {region: "C", value: "c1", text: "c1字段"}
},
{
primary: {region: "A", value: "a1", text: "a1字段"},
foreign: {region: "C", value: "c2", text: "c2字段"}
},
{
primary: {region: "C", value: "c3", text: "c3字段"},
foreign: {region: "D", value: "d1", text: "d1字段"}
},
{
primary: {region: "A", value: "a1", text: "a1字段"},
foreign: {region: "B", value: "b1", text: "b1字段"}
},
{
primary: {region: "X", value: "x1", text: "x1字段"},
foreign: {region: "Y", value: "y1", text: "y1字段"}
},
{
primary: {region: "X", value: "x2", text: "x2字段"},
foreign: {region: "Z", value: "z1", text: "z1字段"}
},
{
primary: {region: "X", value: "x2", text: "x2字段"},
foreign: {region: "B", value: "b1", text: "b1字段"}
},
{
primary: {region: "X33", value: "x233", text: "x233字段"},
}
]
});
return {
type: "bi.float_center_adapt",
items: [{
el: relationview
}]
}
}
});
BI.shortcut("demo.relation_view", Demo.RelationView);

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

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

1344
docs/demo.js

File diff suppressed because one or more lines are too long
Loading…
Cancel
Save