Commit caa8c69b authored by ibuler's avatar ibuler

[Update]搜索不区分大小写

parent e769c99a
...@@ -268,7 +268,7 @@ export class ElementAssetTreeComponent implements OnInit, OnChanges { ...@@ -268,7 +268,7 @@ export class ElementAssetTreeComponent implements OnInit, OnChanges {
if (!zTreeObj) { if (!zTreeObj) {
return null; return null;
} }
const _keywords = this.query; const _keywords = this.query.toLowerCase();
const nodes = zTreeObj.transformToArray(zTreeObj.getNodes()); const nodes = zTreeObj.transformToArray(zTreeObj.getNodes());
if (!_keywords) { if (!_keywords) {
if (this.hiddenNodes) { if (this.hiddenNodes) {
...@@ -289,9 +289,9 @@ export class ElementAssetTreeComponent implements OnInit, OnChanges { ...@@ -289,9 +289,9 @@ export class ElementAssetTreeComponent implements OnInit, OnChanges {
const matchedNodes = zTreeObj.getNodesByFilter(function(node) { const matchedNodes = zTreeObj.getNodesByFilter(function(node) {
if (node.meta.type === 'asset') { if (node.meta.type === 'asset') {
const host = node.meta.asset; const host = node.meta.asset;
return host.hostname.indexOf(_keywords) !== -1 || host.ip.indexOf(_keywords) !== -1; return host.hostname.toLowerCase().indexOf(_keywords) !== -1 || host.ip.indexOf(_keywords) !== -1;
} else { } else {
return node.name.indexOf(_keywords) !== -1; return node.name.toLowerCase().indexOf(_keywords) !== -1;
} }
}); });
matchedNodes.forEach((node) => { matchedNodes.forEach((node) => {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment