* Modify the module tree on the left of the data dictionary.

This commit is contained in:
tianshujie
2023-03-10 16:54:01 +08:00
parent 2a728e1b87
commit 10e304792e
7 changed files with 54 additions and 36 deletions
+1 -1
View File
@@ -16,6 +16,7 @@ function setHeight()
var paneHeight = $(window).height() - 90;
$('#sidebar .module-tree,#mainContent .module-content').css('height', paneHeight);
}
/**
* Init module tree by zui.
*
@@ -30,7 +31,6 @@ function initModule()
initialState: 'active',
itemCreator: function($li, item)
{
console.log(item);
$li.append('<a data-module="' + item.key + '" data-has-children="' + (item.children ? !!item.children.length : false) + '" href=# title="' + item.title + '">' + item.title + '</a>');
if (item.active) $li.addClass('active open in');
}
+28
View File
@@ -1,5 +1,6 @@
$(function()
{
initTable();
setHeight();
$(window).resize(setHeight);
});
@@ -15,3 +16,30 @@ function setHeight()
var paneHeight = $(window).height() - 90;
$('#sidebar .module-tree,#mainContent .module-content').css('height', paneHeight);
}
/**
* Init table tree by zui.
*
* @access public
* @return void
*/
function initTable()
{
$('#tableTree').tree(
{
data: tableTree,
initialState: 'active',
itemCreator: function($li, item)
{
$li.append('<a data-module="' + item.key + '" data-has-children="' + (item.children ? !!item.children.length : false) + '" href=# title="' + item.title + '">' + item.title + '</a>');
if (item.active) $li.addClass('active open in');
}
});
$('#tableTree').on('click', 'a', function(e)
{
var target = $(e.target);
if (target.attr('data-has-children') === 'true') return;
self.location.href = createLink('dev', 'db', 'module=' + target.attr('data-module'));
})
}