|
|
|
@ -2,7 +2,7 @@
|
|
|
|
|
|
|
|
|
|
// 给多层级单选树增加设置错误值时标红状态
|
|
|
|
|
BI.config("bi.multilayer_single_tree_combo", function (config) { |
|
|
|
|
var ERROR_CLASS = 'combo-error'; |
|
|
|
|
var ERROR_CLASS = "combo-error"; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 判断是否是有效值 |
|
|
|
@ -11,10 +11,12 @@
|
|
|
|
|
* @returns {Boolean} |
|
|
|
|
*/ |
|
|
|
|
function isValueValid (options, value) { |
|
|
|
|
value = value || options.value || ''; |
|
|
|
|
value = value || options.value; |
|
|
|
|
if (Array.isArray(value)) { |
|
|
|
|
value = value[0]; |
|
|
|
|
} |
|
|
|
|
value = value || null; |
|
|
|
|
|
|
|
|
|
var items = options.items || []; |
|
|
|
|
var itemIds = []; |
|
|
|
|
|
|
|
|
@ -29,9 +31,9 @@
|
|
|
|
|
|
|
|
|
|
if (BI.contains(itemIds, value)) { |
|
|
|
|
return true; |
|
|
|
|
} else { |
|
|
|
|
return false; |
|
|
|
|
} |
|
|
|
|
return false; |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
@ -107,7 +109,7 @@
|
|
|
|
|
return BI.Models.getModel("dec.amiba.test.tree.model"); |
|
|
|
|
}, |
|
|
|
|
props: { |
|
|
|
|
baseCls: 'fine-test-tree', |
|
|
|
|
baseCls: "fine-test-tree" |
|
|
|
|
}, |
|
|
|
|
watch: { |
|
|
|
|
items: function (items) { |
|
|
|
@ -137,17 +139,17 @@
|
|
|
|
|
|
|
|
|
|
// 测试修改value
|
|
|
|
|
setTimeout(function () { |
|
|
|
|
console.log('setValue'); |
|
|
|
|
self.treeRef.setValue('不存在的值'); |
|
|
|
|
console.log("setValue"); |
|
|
|
|
self.treeRef.setValue(""); |
|
|
|
|
}, 3000); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
items: [ |
|
|
|
|
{ |
|
|
|
|
type: 'bi.label', |
|
|
|
|
textAlign: 'left', |
|
|
|
|
text: '叶子节点单选' |
|
|
|
|
type: "bi.label", |
|
|
|
|
textAlign: "left", |
|
|
|
|
text: "叶子节点单选" |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
type: "bi.multilayer_single_tree_combo", |
|
|
|
@ -160,7 +162,7 @@
|
|
|
|
|
width: 250, |
|
|
|
|
value: self.model.value, |
|
|
|
|
listeners: [{ |
|
|
|
|
eventName: 'EVENT_CHANGE', |
|
|
|
|
eventName: "EVENT_CHANGE", |
|
|
|
|
action: function () { |
|
|
|
|
self.model.value = self.treeRef.getValue()[0]; |
|
|
|
|
} |
|
|
|
|