diff --git a/public/admin/static/js/template.js b/public/admin/static/js/template.js index 7461904..26f5dc2 100644 --- a/public/admin/static/js/template.js +++ b/public/admin/static/js/template.js @@ -90,6 +90,7 @@ function refresh( url ) { if( data.data.tempType == 'table' ){ $.getScript('/static/js/template/table.js', function (){ $('#content').html($.buildTable(data.data)); + $('#tableBox').hide().fadeIn(800); }); } }else{ diff --git a/public/admin/static/js/template/table.js b/public/admin/static/js/template/table.js index ac3cf74..867e7cc 100644 --- a/public/admin/static/js/template/table.js +++ b/public/admin/static/js/template/table.js @@ -3,7 +3,7 @@ */ (function ($) { $.buildTable = function ( tableObj ) { - var tableHtml = '
'; + var tableHtml = '
'; if( tableObj.rightButton && tableObj.rightButton.length ){ tableObj.header.push({field:"action",info:"操作"}); } @@ -22,7 +22,12 @@ tableHtml += '
'; return tableHtml; }; - + + /** + * 创建表格头部分 + * @param tableObj + * @returns {string} + */ function buildHeader( tableObj ) { var headerHtml = ''; $.each(tableObj.header, function (index, value) { @@ -31,7 +36,12 @@ headerHtml += ''; return headerHtml; } - + + /** + * 创建顶部功能按钮 + * @param tableObj + * @returns {string} + */ function buildTopButton( tableObj ) { var topHtml = '
'; if( tableObj.topButton ){ @@ -50,6 +60,11 @@ return topHtml; } + /** + * 创建数据部分 + * @param tableObj + * @returns {string} + */ function buildDataList( tableObj ) { var dataListHtml = ''; $.each(tableObj.data, function (index, value) { @@ -58,7 +73,12 @@ dataListHtml += ''; return dataListHtml; } - + + /** + * 创建空数据表 + * @param tableObj + * @returns {string} + */ function buildEmptyTable( tableObj ) { var emptyHtml = ''; var spanNum = tableObj.header.length + 1;