From 0186895bdbf2d40fb4e61b86bbcf2d2c11c4ca0f Mon Sep 17 00:00:00 2001 From: Argo Zhang Date: Mon, 29 Apr 2019 00:30:10 +0800 Subject: [PATCH] =?UTF-8?q?fix(#IW0RV):=20=E8=A7=92=E8=89=B2=E7=AE=A1?= =?UTF-8?q?=E7=90=86=E5=88=86=E9=85=8D=E8=8F=9C=E5=8D=95=E5=BC=B9=E7=AA=97?= =?UTF-8?q?=E4=B8=8D=E8=83=BD=E6=98=BE=E7=A4=BA=E4=B8=89=E5=B1=82=E4=BB=A5?= =?UTF-8?q?=E4=B8=8A=E8=8F=9C=E5=8D=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit #Comment comment #IW0RV #Issue close https://gitee.com/LongbowEnterprise/dashboard/issues?id=IW0RV --- Bootstrap.Admin/wwwroot/js/common-scripts.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/Bootstrap.Admin/wwwroot/js/common-scripts.js b/Bootstrap.Admin/wwwroot/js/common-scripts.js index 4f72f523..a99712fd 100644 --- a/Bootstrap.Admin/wwwroot/js/common-scripts.js +++ b/Bootstrap.Admin/wwwroot/js/common-scripts.js @@ -1,5 +1,5 @@ (function ($) { - var formatCategoryName = function(menu) { + var formatCategoryName = function (menu) { var ret = ""; if (menu.IsResource === 2) ret = "按钮"; else if (menu.IsResource === 1) ret = "资源"; @@ -23,7 +23,12 @@ var cascadeSubMenu = function (menus) { var html = ""; $.each(menus, function (index, menu) { - html += $.format('
  • {5}{4}
  • ', menu.Id, menu.Icon, menu.Name, menu.Category, menu.Order, formatCategoryName(menu)); + if (menu.Menus.length === 0) { + html += $.format('
  • {5}{4}
  • ', menu.Id, menu.Icon, menu.Name, menu.Category, menu.Order, formatCategoryName(menu)); + } + else { + html += $.format('
  • {6}{5}
      {4}
  • ', menu.Id, menu.Icon, menu.Name, menu.Category, cascadeSubMenu(menu.Menus), menu.Order, formatCategoryName(menu)); + } }); return html; }; @@ -51,6 +56,7 @@ id: 0, url: Menu.url, query: { type: "user" }, method: "post", callback: function (result) { var html = ""; + debugger; if ($.isArray(result)) html = cascadeMenu(result); $this.find('ol:first').html(html); $this.nestable();