From 006470eb5cb7ef6110d30c25d8bbd52e62b8c5a2 Mon Sep 17 00:00:00 2001
From: 吴学文 <wuxuewen@wuxuewendeMacBook-Pro.local>
Date: 星期日, 26 五月 2019 04:49:04 +0800
Subject: [PATCH] 优化菜单显示顺序
---
WebService/src/main/resources/components/menu/menu.js | 13 +++++++++++++
1 files changed, 13 insertions(+), 0 deletions(-)
diff --git a/WebService/src/main/resources/components/menu/menu.js b/WebService/src/main/resources/components/menu/menu.js
index f657ab3..c6b79cb 100644
--- a/WebService/src/main/resources/components/menu/menu.js
+++ b/WebService/src/main/resources/components/menu/menu.js
@@ -42,6 +42,15 @@
},
refreshMenuActive:function(jsonArray,_id){
for(var menuIndex =0 ; menuIndex < jsonArray.length;menuIndex ++){
+
+ if(jsonArray[menuIndex].hasOwnProperty('childs')){
+ var _childs = jsonArray[menuIndex].childs;
+ _childs.sort(function(_child,_newChild){
+ return _child.seq - _newChild.seq
+ });
+ jsonArray[menuIndex].childs = _childs;
+ }
+
if(_id === jsonArray[menuIndex].id){
if(jsonArray[menuIndex].active === true){
//濡傛灉褰撳墠鏈韩鏄墦寮�鐘舵�侊紝璇存槑 闇�瑕佸叧闂�
@@ -54,6 +63,10 @@
jsonArray[menuIndex].active=false;
}
+ jsonArray.sort(function(a,b){
+ return a.seq - b.seq
+ });
+
return jsonArray;
},
switchMenu:function(_id){
--
Gitblit v1.8.0