From f393af9623c26ae177a3f69b8676afc4e23bff8d Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期二, 08 二月 2022 14:48:51 +0800 Subject: [PATCH] 2022-02-08 --- 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