From 63d9a9c62fd34f4b48a157e0bc57dd82ee09a197 Mon Sep 17 00:00:00 2001
From: riku <risaku@163.com>
Date: 星期四, 27 十一月 2025 17:36:12 +0800
Subject: [PATCH] 2025.11.27
---
src/constants/menu.js | 33 +++++++++++++++++++++++++++++++--
1 files changed, 31 insertions(+), 2 deletions(-)
diff --git a/src/constants/menu.js b/src/constants/menu.js
index 64ea2ac..4e498bc 100644
--- a/src/constants/menu.js
+++ b/src/constants/menu.js
@@ -13,7 +13,7 @@
});
}
-const MENU_FYSP = [
+const _MENU_FYSP = [
// {
// icon: 'Search',
// name: '宸℃煡瀹℃牳',
@@ -164,7 +164,8 @@
{
path: '/fysp/config/domainCatalog',
icon: 'List',
- name: '鍊煎煙鐩綍'
+ name: '鍊煎煙鐩綍',
+ debug: true
}
]
},
@@ -259,4 +260,32 @@
}
];
+
+const MENU_FYSP = () => {
+ // 娣辨嫹璐濆師濮嬭彍鍗曟暟缁勶紝閬垮厤淇敼鍘熸暟鎹�
+ const menuCopy = JSON.parse(JSON.stringify(_MENU_FYSP));
+
+ // 閫掑綊澶勭悊鑿滃崟椤�
+ const processMenuItem = (item) => {
+ // 濡傛灉褰撳墠椤规湁children灞炴��
+ if (item.children && Array.isArray(item.children)) {
+ // 鏍规嵁鐜杩囨护children鏁扮粍
+ item.children = item.children.filter(child => {
+ // 閫掑綊澶勭悊瀛愰」鐨刢hildren
+ processMenuItem(child);
+
+ // 寮�鍙戠幆澧冧繚鐣欐墍鏈夐」锛堝寘鎷琩ebug: true鐨勶級锛岀敓浜х幆澧冭繃婊ゆ帀debug: true鐨勯」
+ // 娉ㄦ剰锛氬彧鏈夎缃簡debug: true鐨勯」鎵嶉渶瑕佸湪闈炲紑鍙戠幆澧冭繃婊�
+ // 濡傛灉娌℃湁debug灞炴�э紝搴旇淇濈暀
+ return import.meta.env.DEV || child.debug !== true;
+ });
+ }
+ return item;
+ };
+
+ // 澶勭悊鏁翠釜鑿滃崟鏁扮粍
+ return menuCopy.map(processMenuItem);
+};
+
+
export { MENU_FYSP, MENU_FYTZ, MENU_FYPW, MENU_COMMON };
--
Gitblit v1.9.3