|
|
|
@ -1542,73 +1542,73 @@ Demo.TextValueCombo = BI.inherit(BI.Widget, {
|
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
BI.shortcut("demo.text_value_combo", Demo.TextValueCombo);/** |
|
|
|
|
* Created by Dailer on 2017/7/11. |
|
|
|
|
*/ |
|
|
|
|
Demo.TextValueDownListCombo = BI.inherit(BI.Widget, { |
|
|
|
|
props: { |
|
|
|
|
baseCls: "" |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
render: function () { |
|
|
|
|
var self = this; |
|
|
|
|
return { |
|
|
|
|
type: "bi.horizontal_auto", |
|
|
|
|
items: [{ |
|
|
|
|
type: "bi.text_value_down_list_combo", |
|
|
|
|
width: 300, |
|
|
|
|
ref: function (_ref) { |
|
|
|
|
self.refs = _ref; |
|
|
|
|
}, |
|
|
|
|
text: "默认值", |
|
|
|
|
value: 11, |
|
|
|
|
items: [[{ |
|
|
|
|
text: BI.i18nText("BI-Basic_Number_IN"), |
|
|
|
|
value: 1, |
|
|
|
|
cls: "dot-e-font" |
|
|
|
|
}, { |
|
|
|
|
text: BI.i18nText("BI-Basic_Not_Number_In"), |
|
|
|
|
value: 2, |
|
|
|
|
cls: "dot-e-font" |
|
|
|
|
}], [{ |
|
|
|
|
el: { |
|
|
|
|
text: BI.i18nText("BI-Basic_More_Than"), |
|
|
|
|
value: 3, |
|
|
|
|
cls: "dot-e-font" |
|
|
|
|
}, |
|
|
|
|
value: 3, |
|
|
|
|
children: [{ |
|
|
|
|
text: BI.i18nText("BI-Basic_Settled_Value"), |
|
|
|
|
value: 4, |
|
|
|
|
cls: "dot-e-font" |
|
|
|
|
}, { |
|
|
|
|
text: BI.i18nText("BI-Basic_Average_Value"), |
|
|
|
|
value: 5, |
|
|
|
|
cls: "dot-e-font" |
|
|
|
|
}] |
|
|
|
|
}]] |
|
|
|
|
}, { |
|
|
|
|
type: "bi.button", |
|
|
|
|
width: 90, |
|
|
|
|
height: 25, |
|
|
|
|
text: "setValue", |
|
|
|
|
handler: function () { |
|
|
|
|
self.refs.setValue(2); |
|
|
|
|
} |
|
|
|
|
}, { |
|
|
|
|
type: "bi.button", |
|
|
|
|
width: 90, |
|
|
|
|
height: 25, |
|
|
|
|
text: "getValue", |
|
|
|
|
handler: function () { |
|
|
|
|
BI.Msg.alert("", JSON.stringify(self.refs.getValue())); |
|
|
|
|
} |
|
|
|
|
}], |
|
|
|
|
vgap: 20 |
|
|
|
|
}; |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
BI.shortcut("demo.text_value_combo", Demo.TextValueCombo);/** |
|
|
|
|
* Created by Dailer on 2017/7/11. |
|
|
|
|
*/ |
|
|
|
|
Demo.TextValueDownListCombo = BI.inherit(BI.Widget, { |
|
|
|
|
props: { |
|
|
|
|
baseCls: "" |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
render: function () { |
|
|
|
|
var self = this; |
|
|
|
|
return { |
|
|
|
|
type: "bi.horizontal_auto", |
|
|
|
|
items: [{ |
|
|
|
|
type: "bi.text_value_down_list_combo", |
|
|
|
|
width: 300, |
|
|
|
|
ref: function (_ref) { |
|
|
|
|
self.refs = _ref; |
|
|
|
|
}, |
|
|
|
|
text: "默认值", |
|
|
|
|
value: 11, |
|
|
|
|
items: [[{ |
|
|
|
|
text: BI.i18nText("BI-Basic_Number_IN"), |
|
|
|
|
value: 1, |
|
|
|
|
cls: "dot-e-font" |
|
|
|
|
}, { |
|
|
|
|
text: BI.i18nText("BI-Basic_Not_Number_In"), |
|
|
|
|
value: 2, |
|
|
|
|
cls: "dot-e-font" |
|
|
|
|
}], [{ |
|
|
|
|
el: { |
|
|
|
|
text: BI.i18nText("BI-Basic_More_Than"), |
|
|
|
|
value: 3, |
|
|
|
|
cls: "dot-e-font" |
|
|
|
|
}, |
|
|
|
|
value: 3, |
|
|
|
|
children: [{ |
|
|
|
|
text: BI.i18nText("BI-Basic_Settled_Value"), |
|
|
|
|
value: 4, |
|
|
|
|
cls: "dot-e-font" |
|
|
|
|
}, { |
|
|
|
|
text: BI.i18nText("BI-Basic_Average_Value"), |
|
|
|
|
value: 5, |
|
|
|
|
cls: "dot-e-font" |
|
|
|
|
}] |
|
|
|
|
}]] |
|
|
|
|
}, { |
|
|
|
|
type: "bi.button", |
|
|
|
|
width: 90, |
|
|
|
|
height: 25, |
|
|
|
|
text: "setValue", |
|
|
|
|
handler: function () { |
|
|
|
|
self.refs.setValue(2); |
|
|
|
|
} |
|
|
|
|
}, { |
|
|
|
|
type: "bi.button", |
|
|
|
|
width: 90, |
|
|
|
|
height: 25, |
|
|
|
|
text: "getValue", |
|
|
|
|
handler: function () { |
|
|
|
|
BI.Msg.alert("", JSON.stringify(self.refs.getValue())); |
|
|
|
|
} |
|
|
|
|
}], |
|
|
|
|
vgap: 20 |
|
|
|
|
}; |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
BI.shortcut("demo.text_value_down_list_combo", Demo.TextValueDownListCombo);/** |
|
|
|
|
* Created by Dailer on 2017/7/11. |
|
|
|
|
*/ |
|
|
|
@ -10386,46 +10386,46 @@ Demo.Date = BI.inherit(BI.Widget, {
|
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
BI.shortcut("demo.multidate_combo", Demo.Date);/** |
|
|
|
|
* Created by Urthur on 2017/7/18. |
|
|
|
|
*/ |
|
|
|
|
Demo.CustomDateTime = BI.inherit(BI.Widget, { |
|
|
|
|
props: {}, |
|
|
|
|
render: function () { |
|
|
|
|
var self = this; |
|
|
|
|
return { |
|
|
|
|
type: "bi.absolute", |
|
|
|
|
items: [{ |
|
|
|
|
el: { |
|
|
|
|
type: "bi.date_time_combo", |
|
|
|
|
listeners: [{ |
|
|
|
|
eventName: BI.DateTimeCombo.EVENT_CONFIRM, |
|
|
|
|
action: function () { |
|
|
|
|
var value = this.getValue(); |
|
|
|
|
var date = new Date(value.year, value.month - 1, value.day, value.hour, value.minute, value.second); |
|
|
|
|
var dateStr = BI.print(date, "%Y-%X-%d %H:%M:%S"); |
|
|
|
|
BI.Msg.alert("日期", dateStr); |
|
|
|
|
} |
|
|
|
|
}, { |
|
|
|
|
eventName: BI.DateTimeCombo.EVENT_CANCEL, |
|
|
|
|
action: function () { |
|
|
|
|
} |
|
|
|
|
}], |
|
|
|
|
value: { |
|
|
|
|
year: 2017, |
|
|
|
|
month: 2, |
|
|
|
|
day: 23, |
|
|
|
|
hour: 12, |
|
|
|
|
minute: 11, |
|
|
|
|
second: 1 |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
top: 200, |
|
|
|
|
left: 200 |
|
|
|
|
}] |
|
|
|
|
}; |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
BI.shortcut("demo.multidate_combo", Demo.Date);/** |
|
|
|
|
* Created by Urthur on 2017/7/18. |
|
|
|
|
*/ |
|
|
|
|
Demo.CustomDateTime = BI.inherit(BI.Widget, { |
|
|
|
|
props: {}, |
|
|
|
|
render: function () { |
|
|
|
|
var self = this; |
|
|
|
|
return { |
|
|
|
|
type: "bi.absolute", |
|
|
|
|
items: [{ |
|
|
|
|
el: { |
|
|
|
|
type: "bi.date_time_combo", |
|
|
|
|
listeners: [{ |
|
|
|
|
eventName: BI.DateTimeCombo.EVENT_CONFIRM, |
|
|
|
|
action: function () { |
|
|
|
|
var value = this.getValue(); |
|
|
|
|
var date = new Date(value.year, value.month - 1, value.day, value.hour, value.minute, value.second); |
|
|
|
|
var dateStr = BI.print(date, "%Y-%X-%d %H:%M:%S"); |
|
|
|
|
BI.Msg.alert("日期", dateStr); |
|
|
|
|
} |
|
|
|
|
}, { |
|
|
|
|
eventName: BI.DateTimeCombo.EVENT_CANCEL, |
|
|
|
|
action: function () { |
|
|
|
|
} |
|
|
|
|
}], |
|
|
|
|
value: { |
|
|
|
|
year: 2017, |
|
|
|
|
month: 2, |
|
|
|
|
day: 23, |
|
|
|
|
hour: 12, |
|
|
|
|
minute: 11, |
|
|
|
|
second: 1 |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
top: 200, |
|
|
|
|
left: 200 |
|
|
|
|
}] |
|
|
|
|
}; |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
BI.shortcut("demo.date_time", Demo.CustomDateTime);Demo.Downlist = BI.inherit(BI.Widget, { |
|
|
|
|
props: { |
|
|
|
|
baseCls: "demo-downlist" |
|
|
|
@ -10670,183 +10670,183 @@ Demo.Month = BI.inherit(BI.Widget, {
|
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
BI.shortcut("demo.month", Demo.Month);/** |
|
|
|
|
* Created by User on 2017/3/22. |
|
|
|
|
*/ |
|
|
|
|
Demo.MultiSelectCombo = BI.inherit(BI.Widget, { |
|
|
|
|
props: { |
|
|
|
|
baseCls: "demo-multi-select-combo" |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
_createMultiSelectCombo: function () { |
|
|
|
|
var self = this; |
|
|
|
|
var widget = BI.createWidget({ |
|
|
|
|
type: "bi.multi_select_insert_combo", |
|
|
|
|
itemsCreator: BI.bind(this._itemsCreator, this), |
|
|
|
|
width: 200, |
|
|
|
|
value: { |
|
|
|
|
type: 1, |
|
|
|
|
value: ["柳州市城贸金属材料有限责任公司", "柳州市建福房屋租赁有限公司", "柳州市迅昌数码办公设备有限责任公司"] |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
widget.on(BI.MultiSelectCombo.EVENT_CONFIRM, function () { |
|
|
|
|
BI.Msg.toast(JSON.stringify(this.getValue())); |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
return widget; |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
_getItemsByTimes: function (items, times) { |
|
|
|
|
var res = []; |
|
|
|
|
for (var i = (times - 1) * 100; items[i] && i < times * 100; i++) { |
|
|
|
|
res.push(items[i]); |
|
|
|
|
} |
|
|
|
|
return res; |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
_hasNextByTimes: function (items, times) { |
|
|
|
|
return times * 100 < items.length; |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
_itemsCreator: function (options, callback) { |
|
|
|
|
var self = this; |
|
|
|
|
var items = Demo.CONSTANTS.ITEMS; |
|
|
|
|
var keywords = (options.keywords || []).slice(); |
|
|
|
|
if (options.keyword) { |
|
|
|
|
keywords.push(options.keyword); |
|
|
|
|
} |
|
|
|
|
BI.each(keywords, function (i, kw) { |
|
|
|
|
var search = BI.Func.getSearchResult(items, kw); |
|
|
|
|
items = search.match.concat(search.find); |
|
|
|
|
}); |
|
|
|
|
if (options.selectedValues) {// 过滤
|
|
|
|
|
var filter = BI.makeObject(options.selectedValues, true); |
|
|
|
|
items = BI.filter(items, function (i, ob) { |
|
|
|
|
return !filter[ob.value]; |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
if (options.type == BI.MultiSelectCombo.REQ_GET_ALL_DATA) { |
|
|
|
|
callback({ |
|
|
|
|
items: items |
|
|
|
|
}); |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
if (options.type == BI.MultiSelectCombo.REQ_GET_DATA_LENGTH) { |
|
|
|
|
callback({count: items.length}); |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
BI.delay(function () { |
|
|
|
|
callback({ |
|
|
|
|
items: self._getItemsByTimes(items, options.times), |
|
|
|
|
hasNext: self._hasNextByTimes(items, options.times) |
|
|
|
|
}); |
|
|
|
|
}, 1000); |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
render: function () { |
|
|
|
|
return { |
|
|
|
|
type: "bi.absolute", |
|
|
|
|
scrolly: false, |
|
|
|
|
items: [{ |
|
|
|
|
el: this._createMultiSelectCombo(), |
|
|
|
|
right: "50%", |
|
|
|
|
top: 10 |
|
|
|
|
}] |
|
|
|
|
}; |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
BI.shortcut("demo.multi_select_combo", Demo.MultiSelectCombo);/** |
|
|
|
|
* Created by User on 2017/3/22. |
|
|
|
|
*/ |
|
|
|
|
Demo.MultiSelectList = BI.inherit(BI.Widget, { |
|
|
|
|
props: { |
|
|
|
|
baseCls: "demo-multi-select-combo" |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
mounted: function () { |
|
|
|
|
this.list.populate(); |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
_createMultiSelectCombo: function () { |
|
|
|
|
var self = this; |
|
|
|
|
var widget = BI.createWidget({ |
|
|
|
|
type: "bi.multi_select_insert_list", |
|
|
|
|
ref: function (ref) { |
|
|
|
|
self.list = ref; |
|
|
|
|
}, |
|
|
|
|
itemsCreator: BI.bind(this._itemsCreator, this), |
|
|
|
|
value: ["柳州市城贸金属材料有限责任公司", "柳州市建福房屋租赁有限公司", "柳州市迅昌数码办公设备有限责任公司"] |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
widget.on(BI.MultiSelectCombo.EVENT_CONFIRM, function () { |
|
|
|
|
BI.Msg.toast(JSON.stringify(this.getValue())); |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
return widget; |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
_getItemsByTimes: function (items, times) { |
|
|
|
|
var res = []; |
|
|
|
|
for (var i = (times - 1) * 10; items[i] && i < times * 10; i++) { |
|
|
|
|
res.push(items[i]); |
|
|
|
|
} |
|
|
|
|
return res; |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
_hasNextByTimes: function (items, times) { |
|
|
|
|
return times * 10 < items.length; |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
_itemsCreator: function (options, callback) { |
|
|
|
|
var self = this; |
|
|
|
|
var items = Demo.CONSTANTS.ITEMS; |
|
|
|
|
var keywords = (options.keywords || []).slice(); |
|
|
|
|
if (options.keyword) { |
|
|
|
|
keywords.push(options.keyword); |
|
|
|
|
} |
|
|
|
|
BI.each(keywords, function (i, kw) { |
|
|
|
|
var search = BI.Func.getSearchResult(items, kw); |
|
|
|
|
items = search.match.concat(search.find); |
|
|
|
|
}); |
|
|
|
|
if (options.selectedValues) {// 过滤
|
|
|
|
|
var filter = BI.makeObject(options.selectedValues, true); |
|
|
|
|
items = BI.filter(items, function (i, ob) { |
|
|
|
|
return !filter[ob.value]; |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
if (options.type == BI.MultiSelectCombo.REQ_GET_ALL_DATA) { |
|
|
|
|
callback({ |
|
|
|
|
items: items |
|
|
|
|
}); |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
if (options.type == BI.MultiSelectCombo.REQ_GET_DATA_LENGTH) { |
|
|
|
|
callback({count: items.length}); |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
BI.delay(function () { |
|
|
|
|
callback({ |
|
|
|
|
items: self._getItemsByTimes(items, options.times), |
|
|
|
|
hasNext: self._hasNextByTimes(items, options.times) |
|
|
|
|
}); |
|
|
|
|
}, 1000); |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
render: function () { |
|
|
|
|
return { |
|
|
|
|
type: "bi.absolute", |
|
|
|
|
scrolly: false, |
|
|
|
|
items: [{ |
|
|
|
|
el: this._createMultiSelectCombo(), |
|
|
|
|
top: 50, |
|
|
|
|
left: 50, |
|
|
|
|
right: 50, |
|
|
|
|
bottom: 50 |
|
|
|
|
}] |
|
|
|
|
}; |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
BI.shortcut("demo.month", Demo.Month);/** |
|
|
|
|
* Created by User on 2017/3/22. |
|
|
|
|
*/ |
|
|
|
|
Demo.MultiSelectCombo = BI.inherit(BI.Widget, { |
|
|
|
|
props: { |
|
|
|
|
baseCls: "demo-multi-select-combo" |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
_createMultiSelectCombo: function () { |
|
|
|
|
var self = this; |
|
|
|
|
var widget = BI.createWidget({ |
|
|
|
|
type: "bi.multi_select_insert_combo", |
|
|
|
|
itemsCreator: BI.bind(this._itemsCreator, this), |
|
|
|
|
width: 200, |
|
|
|
|
value: { |
|
|
|
|
type: 1, |
|
|
|
|
value: ["柳州市城贸金属材料有限责任公司", "柳州市建福房屋租赁有限公司", "柳州市迅昌数码办公设备有限责任公司"] |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
widget.on(BI.MultiSelectCombo.EVENT_CONFIRM, function () { |
|
|
|
|
BI.Msg.toast(JSON.stringify(this.getValue())); |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
return widget; |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
_getItemsByTimes: function (items, times) { |
|
|
|
|
var res = []; |
|
|
|
|
for (var i = (times - 1) * 100; items[i] && i < times * 100; i++) { |
|
|
|
|
res.push(items[i]); |
|
|
|
|
} |
|
|
|
|
return res; |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
_hasNextByTimes: function (items, times) { |
|
|
|
|
return times * 100 < items.length; |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
_itemsCreator: function (options, callback) { |
|
|
|
|
var self = this; |
|
|
|
|
var items = Demo.CONSTANTS.ITEMS; |
|
|
|
|
var keywords = (options.keywords || []).slice(); |
|
|
|
|
if (options.keyword) { |
|
|
|
|
keywords.push(options.keyword); |
|
|
|
|
} |
|
|
|
|
BI.each(keywords, function (i, kw) { |
|
|
|
|
var search = BI.Func.getSearchResult(items, kw); |
|
|
|
|
items = search.match.concat(search.find); |
|
|
|
|
}); |
|
|
|
|
if (options.selectedValues) {// 过滤
|
|
|
|
|
var filter = BI.makeObject(options.selectedValues, true); |
|
|
|
|
items = BI.filter(items, function (i, ob) { |
|
|
|
|
return !filter[ob.value]; |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
if (options.type == BI.MultiSelectCombo.REQ_GET_ALL_DATA) { |
|
|
|
|
callback({ |
|
|
|
|
items: items |
|
|
|
|
}); |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
if (options.type == BI.MultiSelectCombo.REQ_GET_DATA_LENGTH) { |
|
|
|
|
callback({count: items.length}); |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
BI.delay(function () { |
|
|
|
|
callback({ |
|
|
|
|
items: self._getItemsByTimes(items, options.times), |
|
|
|
|
hasNext: self._hasNextByTimes(items, options.times) |
|
|
|
|
}); |
|
|
|
|
}, 1000); |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
render: function () { |
|
|
|
|
return { |
|
|
|
|
type: "bi.absolute", |
|
|
|
|
scrolly: false, |
|
|
|
|
items: [{ |
|
|
|
|
el: this._createMultiSelectCombo(), |
|
|
|
|
right: "50%", |
|
|
|
|
top: 10 |
|
|
|
|
}] |
|
|
|
|
}; |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
BI.shortcut("demo.multi_select_combo", Demo.MultiSelectCombo);/** |
|
|
|
|
* Created by User on 2017/3/22. |
|
|
|
|
*/ |
|
|
|
|
Demo.MultiSelectList = BI.inherit(BI.Widget, { |
|
|
|
|
props: { |
|
|
|
|
baseCls: "demo-multi-select-combo" |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
mounted: function () { |
|
|
|
|
this.list.populate(); |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
_createMultiSelectCombo: function () { |
|
|
|
|
var self = this; |
|
|
|
|
var widget = BI.createWidget({ |
|
|
|
|
type: "bi.multi_select_insert_list", |
|
|
|
|
ref: function (ref) { |
|
|
|
|
self.list = ref; |
|
|
|
|
}, |
|
|
|
|
itemsCreator: BI.bind(this._itemsCreator, this), |
|
|
|
|
value: ["柳州市城贸金属材料有限责任公司", "柳州市建福房屋租赁有限公司", "柳州市迅昌数码办公设备有限责任公司"] |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
widget.on(BI.MultiSelectCombo.EVENT_CONFIRM, function () { |
|
|
|
|
BI.Msg.toast(JSON.stringify(this.getValue())); |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
return widget; |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
_getItemsByTimes: function (items, times) { |
|
|
|
|
var res = []; |
|
|
|
|
for (var i = (times - 1) * 10; items[i] && i < times * 10; i++) { |
|
|
|
|
res.push(items[i]); |
|
|
|
|
} |
|
|
|
|
return res; |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
_hasNextByTimes: function (items, times) { |
|
|
|
|
return times * 10 < items.length; |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
_itemsCreator: function (options, callback) { |
|
|
|
|
var self = this; |
|
|
|
|
var items = Demo.CONSTANTS.ITEMS; |
|
|
|
|
var keywords = (options.keywords || []).slice(); |
|
|
|
|
if (options.keyword) { |
|
|
|
|
keywords.push(options.keyword); |
|
|
|
|
} |
|
|
|
|
BI.each(keywords, function (i, kw) { |
|
|
|
|
var search = BI.Func.getSearchResult(items, kw); |
|
|
|
|
items = search.match.concat(search.find); |
|
|
|
|
}); |
|
|
|
|
if (options.selectedValues) {// 过滤
|
|
|
|
|
var filter = BI.makeObject(options.selectedValues, true); |
|
|
|
|
items = BI.filter(items, function (i, ob) { |
|
|
|
|
return !filter[ob.value]; |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
if (options.type == BI.MultiSelectCombo.REQ_GET_ALL_DATA) { |
|
|
|
|
callback({ |
|
|
|
|
items: items |
|
|
|
|
}); |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
if (options.type == BI.MultiSelectCombo.REQ_GET_DATA_LENGTH) { |
|
|
|
|
callback({count: items.length}); |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
BI.delay(function () { |
|
|
|
|
callback({ |
|
|
|
|
items: self._getItemsByTimes(items, options.times), |
|
|
|
|
hasNext: self._hasNextByTimes(items, options.times) |
|
|
|
|
}); |
|
|
|
|
}, 1000); |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
render: function () { |
|
|
|
|
return { |
|
|
|
|
type: "bi.absolute", |
|
|
|
|
scrolly: false, |
|
|
|
|
items: [{ |
|
|
|
|
el: this._createMultiSelectCombo(), |
|
|
|
|
top: 50, |
|
|
|
|
left: 50, |
|
|
|
|
right: 50, |
|
|
|
|
bottom: 50 |
|
|
|
|
}] |
|
|
|
|
}; |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
BI.shortcut("demo.multi_select_list", Demo.MultiSelectList);/** |
|
|
|
|
* Created by Dailer on 2017/7/13. |
|
|
|
|
*/ |
|
|
|
@ -11353,134 +11353,134 @@ Demo.SingleTreeCombo = BI.inherit(BI.Widget, {
|
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
BI.shortcut("demo.single_tree_combo", Demo.SingleTreeCombo);/** |
|
|
|
|
* Created by Urthur on 2017/9/4. |
|
|
|
|
*/ |
|
|
|
|
Demo.Slider = BI.inherit(BI.Widget, { |
|
|
|
|
props: { |
|
|
|
|
baseCls: "demo-slider", |
|
|
|
|
width: 300, |
|
|
|
|
height: 50, |
|
|
|
|
min: 0, |
|
|
|
|
max: 100 |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
render: function () { |
|
|
|
|
var self = this, o = this.options; |
|
|
|
|
var singleSlider = BI.createWidget({ |
|
|
|
|
type: "bi.single_slider", |
|
|
|
|
digit: 0, |
|
|
|
|
width: o.width, |
|
|
|
|
height: o.height, |
|
|
|
|
cls: "layout-bg-white" |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
singleSlider.setMinAndMax({ |
|
|
|
|
min: 10, |
|
|
|
|
max: o.max |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
singleSlider.setValue(30); |
|
|
|
|
singleSlider.populate(); |
|
|
|
|
singleSlider.on(BI.SingleSlider.EVENT_CHANGE, function () { |
|
|
|
|
console.log(this.getValue()); |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
var normalSingleSlider = BI.createWidget({ |
|
|
|
|
type: "bi.single_slider_normal", |
|
|
|
|
width: o.width, |
|
|
|
|
height: 30, |
|
|
|
|
cls: "layout-bg-white" |
|
|
|
|
}); |
|
|
|
|
normalSingleSlider.setMinAndMax({ |
|
|
|
|
min: o.min, |
|
|
|
|
max: o.max |
|
|
|
|
}); |
|
|
|
|
normalSingleSlider.setValue(10); |
|
|
|
|
normalSingleSlider.populate(); |
|
|
|
|
|
|
|
|
|
var singleSliderLabel = BI.createWidget({ |
|
|
|
|
type: "bi.single_slider_label", |
|
|
|
|
width: o.width, |
|
|
|
|
height: o.height, |
|
|
|
|
digit: 0, |
|
|
|
|
unit: "个", |
|
|
|
|
cls: "layout-bg-white" |
|
|
|
|
}); |
|
|
|
|
singleSliderLabel.setMinAndMax({ |
|
|
|
|
min: o.min, |
|
|
|
|
max: o.max |
|
|
|
|
}); |
|
|
|
|
singleSliderLabel.setValue(10); |
|
|
|
|
singleSliderLabel.populate(); |
|
|
|
|
|
|
|
|
|
var intervalSlider = BI.createWidget({ |
|
|
|
|
type: "bi.interval_slider", |
|
|
|
|
width: o.width, |
|
|
|
|
digit: 0, |
|
|
|
|
cls: "layout-bg-white" |
|
|
|
|
}); |
|
|
|
|
intervalSlider.setMinAndMax({ |
|
|
|
|
min: o.min, |
|
|
|
|
max: o.max |
|
|
|
|
}); |
|
|
|
|
intervalSlider.setValue({ |
|
|
|
|
min: 10, |
|
|
|
|
max: 120 |
|
|
|
|
}); |
|
|
|
|
intervalSlider.populate(); |
|
|
|
|
|
|
|
|
|
var intervalSliderLabel = BI.createWidget({ |
|
|
|
|
type: "bi.interval_slider", |
|
|
|
|
width: o.width, |
|
|
|
|
unit: "px", |
|
|
|
|
cls: "layout-bg-white", |
|
|
|
|
digit: 1 |
|
|
|
|
}); |
|
|
|
|
intervalSliderLabel.setMinAndMax({ |
|
|
|
|
min: 0, |
|
|
|
|
max: 120 |
|
|
|
|
}); |
|
|
|
|
intervalSliderLabel.setValue({ |
|
|
|
|
min: 10, |
|
|
|
|
max: 120 |
|
|
|
|
}); |
|
|
|
|
intervalSliderLabel.populate(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return { |
|
|
|
|
type: "bi.vertical", |
|
|
|
|
element: this, |
|
|
|
|
items: [{ |
|
|
|
|
type: "bi.center_adapt", |
|
|
|
|
items: [{ |
|
|
|
|
el: singleSlider |
|
|
|
|
}] |
|
|
|
|
}, { |
|
|
|
|
type: "bi.center_adapt", |
|
|
|
|
items: [{ |
|
|
|
|
el: normalSingleSlider |
|
|
|
|
}] |
|
|
|
|
}, { |
|
|
|
|
type: "bi.center_adapt", |
|
|
|
|
items: [{ |
|
|
|
|
el: singleSliderLabel |
|
|
|
|
}] |
|
|
|
|
}, { |
|
|
|
|
type: "bi.center_adapt", |
|
|
|
|
items: [{ |
|
|
|
|
el: intervalSlider |
|
|
|
|
}] |
|
|
|
|
}, { |
|
|
|
|
type: "bi.center_adapt", |
|
|
|
|
items: [{ |
|
|
|
|
el: intervalSliderLabel |
|
|
|
|
}] |
|
|
|
|
}], |
|
|
|
|
vgap: 20 |
|
|
|
|
}; |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
BI.shortcut("demo.single_tree_combo", Demo.SingleTreeCombo);/** |
|
|
|
|
* Created by Urthur on 2017/9/4. |
|
|
|
|
*/ |
|
|
|
|
Demo.Slider = BI.inherit(BI.Widget, { |
|
|
|
|
props: { |
|
|
|
|
baseCls: "demo-slider", |
|
|
|
|
width: 300, |
|
|
|
|
height: 50, |
|
|
|
|
min: 0, |
|
|
|
|
max: 100 |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
render: function () { |
|
|
|
|
var self = this, o = this.options; |
|
|
|
|
var singleSlider = BI.createWidget({ |
|
|
|
|
type: "bi.single_slider", |
|
|
|
|
digit: 0, |
|
|
|
|
width: o.width, |
|
|
|
|
height: o.height, |
|
|
|
|
cls: "layout-bg-white" |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
singleSlider.setMinAndMax({ |
|
|
|
|
min: 10, |
|
|
|
|
max: o.max |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
singleSlider.setValue(30); |
|
|
|
|
singleSlider.populate(); |
|
|
|
|
singleSlider.on(BI.SingleSlider.EVENT_CHANGE, function () { |
|
|
|
|
console.log(this.getValue()); |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
var normalSingleSlider = BI.createWidget({ |
|
|
|
|
type: "bi.single_slider_normal", |
|
|
|
|
width: o.width, |
|
|
|
|
height: 30, |
|
|
|
|
cls: "layout-bg-white" |
|
|
|
|
}); |
|
|
|
|
normalSingleSlider.setMinAndMax({ |
|
|
|
|
min: o.min, |
|
|
|
|
max: o.max |
|
|
|
|
}); |
|
|
|
|
normalSingleSlider.setValue(10); |
|
|
|
|
normalSingleSlider.populate(); |
|
|
|
|
|
|
|
|
|
var singleSliderLabel = BI.createWidget({ |
|
|
|
|
type: "bi.single_slider_label", |
|
|
|
|
width: o.width, |
|
|
|
|
height: o.height, |
|
|
|
|
digit: 0, |
|
|
|
|
unit: "个", |
|
|
|
|
cls: "layout-bg-white" |
|
|
|
|
}); |
|
|
|
|
singleSliderLabel.setMinAndMax({ |
|
|
|
|
min: o.min, |
|
|
|
|
max: o.max |
|
|
|
|
}); |
|
|
|
|
singleSliderLabel.setValue(10); |
|
|
|
|
singleSliderLabel.populate(); |
|
|
|
|
|
|
|
|
|
var intervalSlider = BI.createWidget({ |
|
|
|
|
type: "bi.interval_slider", |
|
|
|
|
width: o.width, |
|
|
|
|
digit: 0, |
|
|
|
|
cls: "layout-bg-white" |
|
|
|
|
}); |
|
|
|
|
intervalSlider.setMinAndMax({ |
|
|
|
|
min: o.min, |
|
|
|
|
max: o.max |
|
|
|
|
}); |
|
|
|
|
intervalSlider.setValue({ |
|
|
|
|
min: 10, |
|
|
|
|
max: 120 |
|
|
|
|
}); |
|
|
|
|
intervalSlider.populate(); |
|
|
|
|
|
|
|
|
|
var intervalSliderLabel = BI.createWidget({ |
|
|
|
|
type: "bi.interval_slider", |
|
|
|
|
width: o.width, |
|
|
|
|
unit: "px", |
|
|
|
|
cls: "layout-bg-white", |
|
|
|
|
digit: 1 |
|
|
|
|
}); |
|
|
|
|
intervalSliderLabel.setMinAndMax({ |
|
|
|
|
min: 0, |
|
|
|
|
max: 120 |
|
|
|
|
}); |
|
|
|
|
intervalSliderLabel.setValue({ |
|
|
|
|
min: 10, |
|
|
|
|
max: 120 |
|
|
|
|
}); |
|
|
|
|
intervalSliderLabel.populate(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return { |
|
|
|
|
type: "bi.vertical", |
|
|
|
|
element: this, |
|
|
|
|
items: [{ |
|
|
|
|
type: "bi.center_adapt", |
|
|
|
|
items: [{ |
|
|
|
|
el: singleSlider |
|
|
|
|
}] |
|
|
|
|
}, { |
|
|
|
|
type: "bi.center_adapt", |
|
|
|
|
items: [{ |
|
|
|
|
el: normalSingleSlider |
|
|
|
|
}] |
|
|
|
|
}, { |
|
|
|
|
type: "bi.center_adapt", |
|
|
|
|
items: [{ |
|
|
|
|
el: singleSliderLabel |
|
|
|
|
}] |
|
|
|
|
}, { |
|
|
|
|
type: "bi.center_adapt", |
|
|
|
|
items: [{ |
|
|
|
|
el: intervalSlider |
|
|
|
|
}] |
|
|
|
|
}, { |
|
|
|
|
type: "bi.center_adapt", |
|
|
|
|
items: [{ |
|
|
|
|
el: intervalSliderLabel |
|
|
|
|
}] |
|
|
|
|
}], |
|
|
|
|
vgap: 20 |
|
|
|
|
}; |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
BI.shortcut("demo.slider", Demo.Slider);/** |
|
|
|
|
* Created by Dailer on 2017/7/13. |
|
|
|
|
*/ |
|
|
|
|