diff --git a/dist/2.0/fineui.ie.js b/dist/2.0/fineui.ie.js index a83082d73..80928cb87 100644 --- a/dist/2.0/fineui.ie.js +++ b/dist/2.0/fineui.ie.js @@ -69244,11 +69244,16 @@ BI.MultiLayerSelectTreeTrigger = BI.inherit(BI.Trigger, { _getSearchItems: function(keyword) { var o = this.options; - var findingText = BI.Func.getSearchResult(this.nodes, keyword, "text"); - var findingValue = o.allowSearchValue ? BI.Func.getSearchResult(this.nodes, keyword, "value") : {find: [], match: []}; - var textItems = findingText.find.concat(findingText.match); - var valueItems = findingValue.find.concat(findingValue.match); - return this._fillTreeStructure4Search(BI.uniqBy(textItems.concat(valueItems), "id")); + // 把数组搜索换成用BI.tree搜索节点, 搜到了就不再往下搜索 + var items = []; + this.tree.traverse(function (node) { + var find = BI.Func.getSearchResult([node.text || (o.allowSearchValue && node.value) || ""], keyword); + if(find.find.length > 0 || find.match.length > 0) { + items.push(node); + return true; + } + }); + return this._fillTreeStructure4Search(items, "id"); }, _createJson: function(node, open) { @@ -70415,11 +70420,16 @@ BI.MultiLayerSingleTreeTrigger = BI.inherit(BI.Trigger, { _getSearchItems: function(keyword) { var o = this.options; - var findingText = BI.Func.getSearchResult(this.nodes, keyword, "text"); - var findingValue = o.allowSearchValue ? BI.Func.getSearchResult(this.nodes, keyword, "value") : {find: [], match: []}; - var textItems = findingText.find.concat(findingText.match); - var valueItems = findingValue.find.concat(findingValue.match); - return this._fillTreeStructure4Search(BI.uniqBy(textItems.concat(valueItems), "id")); + // 把数组搜索换成用BI.tree搜索节点, 搜到了就不再往下搜索 + var items = []; + this.tree.traverse(function (node) { + var find = BI.Func.getSearchResult([node.text || (o.allowSearchValue && node.value) || ""], keyword); + if(find.find.length > 0 || find.match.length > 0) { + items.push(node); + return true; + } + }); + return this._fillTreeStructure4Search(items, "id"); }, _createJson: function(node, open) { diff --git a/dist/2.0/fineui.js b/dist/2.0/fineui.js index 1492ee320..9bc68ae6c 100644 --- a/dist/2.0/fineui.js +++ b/dist/2.0/fineui.js @@ -69648,11 +69648,16 @@ BI.MultiLayerSelectTreeTrigger = BI.inherit(BI.Trigger, { _getSearchItems: function(keyword) { var o = this.options; - var findingText = BI.Func.getSearchResult(this.nodes, keyword, "text"); - var findingValue = o.allowSearchValue ? BI.Func.getSearchResult(this.nodes, keyword, "value") : {find: [], match: []}; - var textItems = findingText.find.concat(findingText.match); - var valueItems = findingValue.find.concat(findingValue.match); - return this._fillTreeStructure4Search(BI.uniqBy(textItems.concat(valueItems), "id")); + // 把数组搜索换成用BI.tree搜索节点, 搜到了就不再往下搜索 + var items = []; + this.tree.traverse(function (node) { + var find = BI.Func.getSearchResult([node.text || (o.allowSearchValue && node.value) || ""], keyword); + if(find.find.length > 0 || find.match.length > 0) { + items.push(node); + return true; + } + }); + return this._fillTreeStructure4Search(items, "id"); }, _createJson: function(node, open) { @@ -70819,11 +70824,16 @@ BI.MultiLayerSingleTreeTrigger = BI.inherit(BI.Trigger, { _getSearchItems: function(keyword) { var o = this.options; - var findingText = BI.Func.getSearchResult(this.nodes, keyword, "text"); - var findingValue = o.allowSearchValue ? BI.Func.getSearchResult(this.nodes, keyword, "value") : {find: [], match: []}; - var textItems = findingText.find.concat(findingText.match); - var valueItems = findingValue.find.concat(findingValue.match); - return this._fillTreeStructure4Search(BI.uniqBy(textItems.concat(valueItems), "id")); + // 把数组搜索换成用BI.tree搜索节点, 搜到了就不再往下搜索 + var items = []; + this.tree.traverse(function (node) { + var find = BI.Func.getSearchResult([node.text || (o.allowSearchValue && node.value) || ""], keyword); + if(find.find.length > 0 || find.match.length > 0) { + items.push(node); + return true; + } + }); + return this._fillTreeStructure4Search(items, "id"); }, _createJson: function(node, open) { diff --git a/dist/bundle.ie.js b/dist/bundle.ie.js index a83082d73..80928cb87 100644 --- a/dist/bundle.ie.js +++ b/dist/bundle.ie.js @@ -69244,11 +69244,16 @@ BI.MultiLayerSelectTreeTrigger = BI.inherit(BI.Trigger, { _getSearchItems: function(keyword) { var o = this.options; - var findingText = BI.Func.getSearchResult(this.nodes, keyword, "text"); - var findingValue = o.allowSearchValue ? BI.Func.getSearchResult(this.nodes, keyword, "value") : {find: [], match: []}; - var textItems = findingText.find.concat(findingText.match); - var valueItems = findingValue.find.concat(findingValue.match); - return this._fillTreeStructure4Search(BI.uniqBy(textItems.concat(valueItems), "id")); + // 把数组搜索换成用BI.tree搜索节点, 搜到了就不再往下搜索 + var items = []; + this.tree.traverse(function (node) { + var find = BI.Func.getSearchResult([node.text || (o.allowSearchValue && node.value) || ""], keyword); + if(find.find.length > 0 || find.match.length > 0) { + items.push(node); + return true; + } + }); + return this._fillTreeStructure4Search(items, "id"); }, _createJson: function(node, open) { @@ -70415,11 +70420,16 @@ BI.MultiLayerSingleTreeTrigger = BI.inherit(BI.Trigger, { _getSearchItems: function(keyword) { var o = this.options; - var findingText = BI.Func.getSearchResult(this.nodes, keyword, "text"); - var findingValue = o.allowSearchValue ? BI.Func.getSearchResult(this.nodes, keyword, "value") : {find: [], match: []}; - var textItems = findingText.find.concat(findingText.match); - var valueItems = findingValue.find.concat(findingValue.match); - return this._fillTreeStructure4Search(BI.uniqBy(textItems.concat(valueItems), "id")); + // 把数组搜索换成用BI.tree搜索节点, 搜到了就不再往下搜索 + var items = []; + this.tree.traverse(function (node) { + var find = BI.Func.getSearchResult([node.text || (o.allowSearchValue && node.value) || ""], keyword); + if(find.find.length > 0 || find.match.length > 0) { + items.push(node); + return true; + } + }); + return this._fillTreeStructure4Search(items, "id"); }, _createJson: function(node, open) { diff --git a/dist/bundle.js b/dist/bundle.js index 1492ee320..9bc68ae6c 100644 --- a/dist/bundle.js +++ b/dist/bundle.js @@ -69648,11 +69648,16 @@ BI.MultiLayerSelectTreeTrigger = BI.inherit(BI.Trigger, { _getSearchItems: function(keyword) { var o = this.options; - var findingText = BI.Func.getSearchResult(this.nodes, keyword, "text"); - var findingValue = o.allowSearchValue ? BI.Func.getSearchResult(this.nodes, keyword, "value") : {find: [], match: []}; - var textItems = findingText.find.concat(findingText.match); - var valueItems = findingValue.find.concat(findingValue.match); - return this._fillTreeStructure4Search(BI.uniqBy(textItems.concat(valueItems), "id")); + // 把数组搜索换成用BI.tree搜索节点, 搜到了就不再往下搜索 + var items = []; + this.tree.traverse(function (node) { + var find = BI.Func.getSearchResult([node.text || (o.allowSearchValue && node.value) || ""], keyword); + if(find.find.length > 0 || find.match.length > 0) { + items.push(node); + return true; + } + }); + return this._fillTreeStructure4Search(items, "id"); }, _createJson: function(node, open) { @@ -70819,11 +70824,16 @@ BI.MultiLayerSingleTreeTrigger = BI.inherit(BI.Trigger, { _getSearchItems: function(keyword) { var o = this.options; - var findingText = BI.Func.getSearchResult(this.nodes, keyword, "text"); - var findingValue = o.allowSearchValue ? BI.Func.getSearchResult(this.nodes, keyword, "value") : {find: [], match: []}; - var textItems = findingText.find.concat(findingText.match); - var valueItems = findingValue.find.concat(findingValue.match); - return this._fillTreeStructure4Search(BI.uniqBy(textItems.concat(valueItems), "id")); + // 把数组搜索换成用BI.tree搜索节点, 搜到了就不再往下搜索 + var items = []; + this.tree.traverse(function (node) { + var find = BI.Func.getSearchResult([node.text || (o.allowSearchValue && node.value) || ""], keyword); + if(find.find.length > 0 || find.match.length > 0) { + items.push(node); + return true; + } + }); + return this._fillTreeStructure4Search(items, "id"); }, _createJson: function(node, open) { diff --git a/dist/fineui.ie.js b/dist/fineui.ie.js index 394d8c838..efc058a9d 100644 --- a/dist/fineui.ie.js +++ b/dist/fineui.ie.js @@ -69489,11 +69489,16 @@ BI.MultiLayerSelectTreeTrigger = BI.inherit(BI.Trigger, { _getSearchItems: function(keyword) { var o = this.options; - var findingText = BI.Func.getSearchResult(this.nodes, keyword, "text"); - var findingValue = o.allowSearchValue ? BI.Func.getSearchResult(this.nodes, keyword, "value") : {find: [], match: []}; - var textItems = findingText.find.concat(findingText.match); - var valueItems = findingValue.find.concat(findingValue.match); - return this._fillTreeStructure4Search(BI.uniqBy(textItems.concat(valueItems), "id")); + // 把数组搜索换成用BI.tree搜索节点, 搜到了就不再往下搜索 + var items = []; + this.tree.traverse(function (node) { + var find = BI.Func.getSearchResult([node.text || (o.allowSearchValue && node.value) || ""], keyword); + if(find.find.length > 0 || find.match.length > 0) { + items.push(node); + return true; + } + }); + return this._fillTreeStructure4Search(items, "id"); }, _createJson: function(node, open) { @@ -70660,11 +70665,16 @@ BI.MultiLayerSingleTreeTrigger = BI.inherit(BI.Trigger, { _getSearchItems: function(keyword) { var o = this.options; - var findingText = BI.Func.getSearchResult(this.nodes, keyword, "text"); - var findingValue = o.allowSearchValue ? BI.Func.getSearchResult(this.nodes, keyword, "value") : {find: [], match: []}; - var textItems = findingText.find.concat(findingText.match); - var valueItems = findingValue.find.concat(findingValue.match); - return this._fillTreeStructure4Search(BI.uniqBy(textItems.concat(valueItems), "id")); + // 把数组搜索换成用BI.tree搜索节点, 搜到了就不再往下搜索 + var items = []; + this.tree.traverse(function (node) { + var find = BI.Func.getSearchResult([node.text || (o.allowSearchValue && node.value) || ""], keyword); + if(find.find.length > 0 || find.match.length > 0) { + items.push(node); + return true; + } + }); + return this._fillTreeStructure4Search(items, "id"); }, _createJson: function(node, open) { diff --git a/dist/fineui.js b/dist/fineui.js index 673357db9..da2d9cb01 100644 --- a/dist/fineui.js +++ b/dist/fineui.js @@ -69893,11 +69893,16 @@ BI.MultiLayerSelectTreeTrigger = BI.inherit(BI.Trigger, { _getSearchItems: function(keyword) { var o = this.options; - var findingText = BI.Func.getSearchResult(this.nodes, keyword, "text"); - var findingValue = o.allowSearchValue ? BI.Func.getSearchResult(this.nodes, keyword, "value") : {find: [], match: []}; - var textItems = findingText.find.concat(findingText.match); - var valueItems = findingValue.find.concat(findingValue.match); - return this._fillTreeStructure4Search(BI.uniqBy(textItems.concat(valueItems), "id")); + // 把数组搜索换成用BI.tree搜索节点, 搜到了就不再往下搜索 + var items = []; + this.tree.traverse(function (node) { + var find = BI.Func.getSearchResult([node.text || (o.allowSearchValue && node.value) || ""], keyword); + if(find.find.length > 0 || find.match.length > 0) { + items.push(node); + return true; + } + }); + return this._fillTreeStructure4Search(items, "id"); }, _createJson: function(node, open) { @@ -71064,11 +71069,16 @@ BI.MultiLayerSingleTreeTrigger = BI.inherit(BI.Trigger, { _getSearchItems: function(keyword) { var o = this.options; - var findingText = BI.Func.getSearchResult(this.nodes, keyword, "text"); - var findingValue = o.allowSearchValue ? BI.Func.getSearchResult(this.nodes, keyword, "value") : {find: [], match: []}; - var textItems = findingText.find.concat(findingText.match); - var valueItems = findingValue.find.concat(findingValue.match); - return this._fillTreeStructure4Search(BI.uniqBy(textItems.concat(valueItems), "id")); + // 把数组搜索换成用BI.tree搜索节点, 搜到了就不再往下搜索 + var items = []; + this.tree.traverse(function (node) { + var find = BI.Func.getSearchResult([node.text || (o.allowSearchValue && node.value) || ""], keyword); + if(find.find.length > 0 || find.match.length > 0) { + items.push(node); + return true; + } + }); + return this._fillTreeStructure4Search(items, "id"); }, _createJson: function(node, open) { diff --git a/dist/fineui_without_jquery_polyfill.js b/dist/fineui_without_jquery_polyfill.js index e1a3d7fee..61e8bb8e1 100644 --- a/dist/fineui_without_jquery_polyfill.js +++ b/dist/fineui_without_jquery_polyfill.js @@ -52192,11 +52192,16 @@ BI.MultiLayerSelectTreeTrigger = BI.inherit(BI.Trigger, { _getSearchItems: function(keyword) { var o = this.options; - var findingText = BI.Func.getSearchResult(this.nodes, keyword, "text"); - var findingValue = o.allowSearchValue ? BI.Func.getSearchResult(this.nodes, keyword, "value") : {find: [], match: []}; - var textItems = findingText.find.concat(findingText.match); - var valueItems = findingValue.find.concat(findingValue.match); - return this._fillTreeStructure4Search(BI.uniqBy(textItems.concat(valueItems), "id")); + // 把数组搜索换成用BI.tree搜索节点, 搜到了就不再往下搜索 + var items = []; + this.tree.traverse(function (node) { + var find = BI.Func.getSearchResult([node.text || (o.allowSearchValue && node.value) || ""], keyword); + if(find.find.length > 0 || find.match.length > 0) { + items.push(node); + return true; + } + }); + return this._fillTreeStructure4Search(items, "id"); }, _createJson: function(node, open) { @@ -53363,11 +53368,16 @@ BI.MultiLayerSingleTreeTrigger = BI.inherit(BI.Trigger, { _getSearchItems: function(keyword) { var o = this.options; - var findingText = BI.Func.getSearchResult(this.nodes, keyword, "text"); - var findingValue = o.allowSearchValue ? BI.Func.getSearchResult(this.nodes, keyword, "value") : {find: [], match: []}; - var textItems = findingText.find.concat(findingText.match); - var valueItems = findingValue.find.concat(findingValue.match); - return this._fillTreeStructure4Search(BI.uniqBy(textItems.concat(valueItems), "id")); + // 把数组搜索换成用BI.tree搜索节点, 搜到了就不再往下搜索 + var items = []; + this.tree.traverse(function (node) { + var find = BI.Func.getSearchResult([node.text || (o.allowSearchValue && node.value) || ""], keyword); + if(find.find.length > 0 || find.match.length > 0) { + items.push(node); + return true; + } + }); + return this._fillTreeStructure4Search(items, "id"); }, _createJson: function(node, open) { diff --git a/dist/widget.js b/dist/widget.js index 4b3828e12..12b2ce018 100644 --- a/dist/widget.js +++ b/dist/widget.js @@ -7303,11 +7303,16 @@ BI.MultiLayerSelectTreeTrigger = BI.inherit(BI.Trigger, { _getSearchItems: function(keyword) { var o = this.options; - var findingText = BI.Func.getSearchResult(this.nodes, keyword, "text"); - var findingValue = o.allowSearchValue ? BI.Func.getSearchResult(this.nodes, keyword, "value") : {find: [], match: []}; - var textItems = findingText.find.concat(findingText.match); - var valueItems = findingValue.find.concat(findingValue.match); - return this._fillTreeStructure4Search(BI.uniqBy(textItems.concat(valueItems), "id")); + // 把数组搜索换成用BI.tree搜索节点, 搜到了就不再往下搜索 + var items = []; + this.tree.traverse(function (node) { + var find = BI.Func.getSearchResult([node.text || (o.allowSearchValue && node.value) || ""], keyword); + if(find.find.length > 0 || find.match.length > 0) { + items.push(node); + return true; + } + }); + return this._fillTreeStructure4Search(items, "id"); }, _createJson: function(node, open) { @@ -8474,11 +8479,16 @@ BI.MultiLayerSingleTreeTrigger = BI.inherit(BI.Trigger, { _getSearchItems: function(keyword) { var o = this.options; - var findingText = BI.Func.getSearchResult(this.nodes, keyword, "text"); - var findingValue = o.allowSearchValue ? BI.Func.getSearchResult(this.nodes, keyword, "value") : {find: [], match: []}; - var textItems = findingText.find.concat(findingText.match); - var valueItems = findingValue.find.concat(findingValue.match); - return this._fillTreeStructure4Search(BI.uniqBy(textItems.concat(valueItems), "id")); + // 把数组搜索换成用BI.tree搜索节点, 搜到了就不再往下搜索 + var items = []; + this.tree.traverse(function (node) { + var find = BI.Func.getSearchResult([node.text || (o.allowSearchValue && node.value) || ""], keyword); + if(find.find.length > 0 || find.match.length > 0) { + items.push(node); + return true; + } + }); + return this._fillTreeStructure4Search(items, "id"); }, _createJson: function(node, open) { diff --git a/src/widget/multilayerselecttree/multilayerselecttree.trigger.js b/src/widget/multilayerselecttree/multilayerselecttree.trigger.js index 90cab85f4..f9312e384 100644 --- a/src/widget/multilayerselecttree/multilayerselecttree.trigger.js +++ b/src/widget/multilayerselecttree/multilayerselecttree.trigger.js @@ -130,11 +130,16 @@ BI.MultiLayerSelectTreeTrigger = BI.inherit(BI.Trigger, { _getSearchItems: function(keyword) { var o = this.options; - var findingText = BI.Func.getSearchResult(this.nodes, keyword, "text"); - var findingValue = o.allowSearchValue ? BI.Func.getSearchResult(this.nodes, keyword, "value") : {find: [], match: []}; - var textItems = findingText.find.concat(findingText.match); - var valueItems = findingValue.find.concat(findingValue.match); - return this._fillTreeStructure4Search(BI.uniqBy(textItems.concat(valueItems), "id")); + // 把数组搜索换成用BI.tree搜索节点, 搜到了就不再往下搜索 + var items = []; + this.tree.traverse(function (node) { + var find = BI.Func.getSearchResult([node.text || (o.allowSearchValue && node.value) || ""], keyword); + if(find.find.length > 0 || find.match.length > 0) { + items.push(node); + return true; + } + }); + return this._fillTreeStructure4Search(items, "id"); }, _createJson: function(node, open) { diff --git a/src/widget/multilayersingletree/multilayersingletree.trigger.js b/src/widget/multilayersingletree/multilayersingletree.trigger.js index 4ff540e96..819986c59 100644 --- a/src/widget/multilayersingletree/multilayersingletree.trigger.js +++ b/src/widget/multilayersingletree/multilayersingletree.trigger.js @@ -130,11 +130,16 @@ BI.MultiLayerSingleTreeTrigger = BI.inherit(BI.Trigger, { _getSearchItems: function(keyword) { var o = this.options; - var findingText = BI.Func.getSearchResult(this.nodes, keyword, "text"); - var findingValue = o.allowSearchValue ? BI.Func.getSearchResult(this.nodes, keyword, "value") : {find: [], match: []}; - var textItems = findingText.find.concat(findingText.match); - var valueItems = findingValue.find.concat(findingValue.match); - return this._fillTreeStructure4Search(BI.uniqBy(textItems.concat(valueItems), "id")); + // 把数组搜索换成用BI.tree搜索节点, 搜到了就不再往下搜索 + var items = []; + this.tree.traverse(function (node) { + var find = BI.Func.getSearchResult([node.text || (o.allowSearchValue && node.value) || ""], keyword); + if(find.find.length > 0 || find.match.length > 0) { + items.push(node); + return true; + } + }); + return this._fillTreeStructure4Search(items, "id"); }, _createJson: function(node, open) {