forked from fanruan/fineui
Browse Source
* commit '5f552faadc64cf22cd0f9863249497efda03e40a': add Tree update add textArea 多边框 bubblecombo 实现setEnable方法 getMonthDaymaster
guy
8 years ago
32 changed files with 798 additions and 294 deletions
@ -0,0 +1,93 @@
|
||||
if(![].indexOf){ |
||||
/** |
||||
* 检查指定的值是否在数组中 |
||||
* @param {Object} o 要检查的值 |
||||
* @return {Number} o在数组中的索引(如果不在数组中则返回-1) |
||||
*/ |
||||
[].indexOf = function (o) { |
||||
for (var i = 0, len = this.length; i < len; i++) { |
||||
if (_.isEqual(o, this[i])) { |
||||
return i; |
||||
} |
||||
} |
||||
return -1; |
||||
} |
||||
} |
||||
if(![].lastIndexOf){ |
||||
/** |
||||
* 检查指定的值是否在数组中 |
||||
* ie67不支持数组的这个方法 |
||||
* @param {Object} o 要检查的值 |
||||
* @return {Number} o在数组中的索引(如果不在数组中则返回-1) |
||||
*/ |
||||
[].lastIndexOf = function (o) { |
||||
for (var len = this.length, i = len - 1; i >= 0; i--) { |
||||
if (_.isEqual(o, this[i])) { |
||||
return i; |
||||
} |
||||
} |
||||
return -1; |
||||
} |
||||
}/** |
||||
* 特殊情况 |
||||
* Created by wang on 15/6/23. |
||||
*/ |
||||
//解决console未定义问题 guy
|
||||
window.console = window.console || (function () { |
||||
var c = {}; |
||||
c.log = c.warn = c.debug = c.info = c.error = c.time = c.dir = c.profile |
||||
= c.clear = c.exception = c.trace = c.assert = function () { |
||||
}; |
||||
return c; |
||||
})(); |
||||
/* |
||||
* 前端缓存 |
||||
*/ |
||||
window.localStorage || (window.localStorage = { |
||||
items: {}, |
||||
setItem: function (k, v) { |
||||
BI.Cache.addCookie(k, v); |
||||
}, |
||||
getItem: function (k) { |
||||
return BI.Cache.getCookie(k); |
||||
}, |
||||
removeItem: function (k) { |
||||
BI.Cache.deleteCookie(k); |
||||
}, |
||||
key: function () { |
||||
|
||||
}, |
||||
clear: function () { |
||||
this.items = {}; |
||||
} |
||||
});//修复ie9下sort方法的bug
|
||||
!function (window) { |
||||
var ua = window.navigator.userAgent.toLowerCase(), |
||||
reg = /msie|applewebkit.+safari/; |
||||
if (reg.test(ua)) { |
||||
var _sort = Array.prototype.sort; |
||||
Array.prototype.sort = function (fn) { |
||||
if (!!fn && typeof fn === 'function') { |
||||
if (this.length < 2) { |
||||
return this; |
||||
} |
||||
var i = 0, j = i + 1, l = this.length, tmp, r = false, t = 0; |
||||
for (; i < l; i++) { |
||||
for (j = i + 1; j < l; j++) { |
||||
t = fn.call(this, this[i], this[j]); |
||||
r = (typeof t === 'number' ? t : |
||||
!!t ? 1 : 0) > 0; |
||||
if (r === true) { |
||||
tmp = this[i]; |
||||
this[i] = this[j]; |
||||
this[j] = tmp; |
||||
} |
||||
} |
||||
} |
||||
return this; |
||||
} else { |
||||
return _sort.call(this); |
||||
} |
||||
}; |
||||
} |
||||
}(window); |
@ -0,0 +1,66 @@
|
||||
/** |
||||
* 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); |
@ -0,0 +1,93 @@
|
||||
if(![].indexOf){ |
||||
/** |
||||
* 检查指定的值是否在数组中 |
||||
* @param {Object} o 要检查的值 |
||||
* @return {Number} o在数组中的索引(如果不在数组中则返回-1) |
||||
*/ |
||||
[].indexOf = function (o) { |
||||
for (var i = 0, len = this.length; i < len; i++) { |
||||
if (_.isEqual(o, this[i])) { |
||||
return i; |
||||
} |
||||
} |
||||
return -1; |
||||
} |
||||
} |
||||
if(![].lastIndexOf){ |
||||
/** |
||||
* 检查指定的值是否在数组中 |
||||
* ie67不支持数组的这个方法 |
||||
* @param {Object} o 要检查的值 |
||||
* @return {Number} o在数组中的索引(如果不在数组中则返回-1) |
||||
*/ |
||||
[].lastIndexOf = function (o) { |
||||
for (var len = this.length, i = len - 1; i >= 0; i--) { |
||||
if (_.isEqual(o, this[i])) { |
||||
return i; |
||||
} |
||||
} |
||||
return -1; |
||||
} |
||||
}/** |
||||
* 特殊情况 |
||||
* Created by wang on 15/6/23. |
||||
*/ |
||||
//解决console未定义问题 guy
|
||||
window.console = window.console || (function () { |
||||
var c = {}; |
||||
c.log = c.warn = c.debug = c.info = c.error = c.time = c.dir = c.profile |
||||
= c.clear = c.exception = c.trace = c.assert = function () { |
||||
}; |
||||
return c; |
||||
})(); |
||||
/* |
||||
* 前端缓存 |
||||
*/ |
||||
window.localStorage || (window.localStorage = { |
||||
items: {}, |
||||
setItem: function (k, v) { |
||||
BI.Cache.addCookie(k, v); |
||||
}, |
||||
getItem: function (k) { |
||||
return BI.Cache.getCookie(k); |
||||
}, |
||||
removeItem: function (k) { |
||||
BI.Cache.deleteCookie(k); |
||||
}, |
||||
key: function () { |
||||
|
||||
}, |
||||
clear: function () { |
||||
this.items = {}; |
||||
} |
||||
});//修复ie9下sort方法的bug
|
||||
!function (window) { |
||||
var ua = window.navigator.userAgent.toLowerCase(), |
||||
reg = /msie|applewebkit.+safari/; |
||||
if (reg.test(ua)) { |
||||
var _sort = Array.prototype.sort; |
||||
Array.prototype.sort = function (fn) { |
||||
if (!!fn && typeof fn === 'function') { |
||||
if (this.length < 2) { |
||||
return this; |
||||
} |
||||
var i = 0, j = i + 1, l = this.length, tmp, r = false, t = 0; |
||||
for (; i < l; i++) { |
||||
for (j = i + 1; j < l; j++) { |
||||
t = fn.call(this, this[i], this[j]); |
||||
r = (typeof t === 'number' ? t : |
||||
!!t ? 1 : 0) > 0; |
||||
if (r === true) { |
||||
tmp = this[i]; |
||||
this[i] = this[j]; |
||||
this[j] = tmp; |
||||
} |
||||
} |
||||
} |
||||
return this; |
||||
} else { |
||||
return _sort.call(this); |
||||
} |
||||
}; |
||||
} |
||||
}(window); |
Loading…
Reference in new issue