* Adjust code .

This commit is contained in:
guofeilong
2023-03-29 15:09:22 +08:00
parent 43e7da673e
commit 566afbdd42
+2 -1
View File
@@ -23,6 +23,7 @@ $(function()
'api': 'interface'
}
console.log(treeData, 'treeData');
$('#fileTree').tree(
{
initialState: 'active',
@@ -32,7 +33,7 @@ $(function()
var libClass = ['lib', 'annex', 'api', 'execution'].indexOf(item.type) !== -1 ? 'lib' : '';
var hasChild = item.children ? !!item.children.length : false;
var link = item.hasAction ? '###' : '#';
var $item = '<a href="' + link + '" style="position: relative" data-has-children="' + hasChild + '" title="' + item.name + '" data-id="' + item.id + '" class="' + libClass + '" data-type="' + item.type + '" data-action="' + item.hasAction + '">';
var $item = '<a href="' + link + '" style="position: relative" data-has-children="' + hasChild + '" title="' + item.name + '" data-id="' (item.type || 'lib') + item.id + '" class="' + libClass + '" data-type="' + item.type + '" data-action="' + item.hasAction + '">';
$item += '<div class="text h-full w-full flex-start overflow-hidden">';
if(libClass == 'lib' && item.type != 'execution') $item += '<div class="img-lib" style="background-image:url(static/svg/' + imgObj[item.type || 'lib'] + '.svg)"></div>';