* Code for add js to module/langItem .

This commit is contained in:
guofeilong
2023-02-20 10:00:43 +08:00
parent b0aef0569a
commit 6da9c01104
3 changed files with 20 additions and 5 deletions
+1 -1
View File
@@ -204,4 +204,4 @@ $(function()
initPreference();
})
</script>
</script>
+3 -2
View File
@@ -12,10 +12,11 @@
/* menu-tree */
.menu-tree {flex: 0 0 200px; background: #fff; padding: 10px 10px;}
.menu-tree > .tree {padding-top: 20px;}
.menu-tree li {padding: 5px 25px;}
li.has-list > ul > li {padding-left: 10px;}
.tree ul {margin-bottom: 0;}
/* side-left */
.main-content > .side-left {flex: 0 0 160px; margin-left: 64px;}
.main-content > .side-left {flex: 0 0 160px; margin-left: 44px;}
.label-list {background: #F8F8F8; padding: 5px 0;}
.label-list > .input-label {display: flex; align-items: center; cursor: pointer; padding-left: 40px;}
+16 -2
View File
@@ -48,9 +48,14 @@ $(function()
{
$('#menuTree').tree(
{
data: menuTree
data: menuTree,
itemCreator: function($li, item)
{
$li.append($('<a data-module="' + item.module + '"data-method="' + item.method + '"data-has-children="' + !!item.children + '" />', {href: item.url}).text(item.title));
}
});
}
$('.menu-tree .search-input').on('input', function()
{
var val = $(this).val();
@@ -77,10 +82,19 @@ $(function()
}
item.children = children;
}
updateData.push(item);
if (item.children.length || item.title.includes(val) ||(item.key && item.key.includes(val)) )
{
updateData.push(item);
}
}
}
$('#menuTree').data('zui.tree').reload(updateData);
})
$('#menuTree').on('click', 'a', function(e)
{
var clickTarget = e.target;
debugger;
})
}
})