From d59f518f466274b2caeb2e01c10c92deafe7c93b Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期三, 09 二月 2022 11:48:29 +0800 Subject: [PATCH] 2022-02-09 --- src/utils/utils-custom.js | 29 +++++++++++++++++++++++++++++ 1 files changed, 29 insertions(+), 0 deletions(-) diff --git a/src/utils/utils-custom.js b/src/utils/utils-custom.js index 928c462..9053815 100644 --- a/src/utils/utils-custom.js +++ b/src/utils/utils-custom.js @@ -511,6 +511,35 @@ } /** + * @description 閲嶇疆鑿滃崟閰嶇疆锛岄〉闈㈡暣浣撳鍒� + * @return {String} components 閰嶇疆淇℃伅 + */ + static getFloor = (id) => { + let floor = 1 + let finish = false + + let reCheck = (components, f) => { + components.forEach(item => { + if (finish) return + if (item.type === 'tabs') { + if (item.uuid === id) { + floor = f + finish = true + } else { + item.subtabs.forEach(tab => { + reCheck(tab.components, f + 1) + }) + } + } + }) + } + + reCheck(window.GLOB.customMenu.components, 1) + + return floor + } + + /** * @description 鏁版嵁婧愬悕绉帮紝鐢ㄤ簬缁熶竴鏌ヨ * @return {String} name */ -- Gitblit v1.8.0