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 |   35 ++++++++++++++++++++++++++++++++---
 1 files changed, 32 insertions(+), 3 deletions(-)

diff --git a/src/utils/utils-custom.js b/src/utils/utils-custom.js
index a29a1a9..9053815 100644
--- a/src/utils/utils-custom.js
+++ b/src/utils/utils-custom.js
@@ -274,7 +274,7 @@
           uuids.push(act.uuid)
         })
 
-        if (item.type === 'card' || item.type === 'carousel' || (item.type === 'table' && item.subtype === 'tablecard')) {
+        if (['card', 'carousel', 'timeline'].includes(item.type) || (item.type === 'table' && item.subtype === 'tablecard')) {
           item.subcards.forEach(_card => {
             _card.elements && _card.elements.forEach(cell => {
               if (cell.eleType !== 'button') return
@@ -365,7 +365,7 @@
           cell.uuid = this.getuuid()
           return cell
         })
-      } else if (item.type === 'card' || item.type === 'carousel' || (item.type === 'table' && item.subtype === 'tablecard')) {
+      } else if (['card', 'carousel', 'timeline'].includes(item.type) || (item.type === 'table' && item.subtype === 'tablecard')) {
         item.subcards.forEach(card => {
           card.uuid = this.getuuid()
           if (card.elements) {
@@ -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
    */
@@ -561,7 +590,7 @@
         cell.uuid = this.getuuid()
         return cell
       })
-    } else if (item.type === 'card' || item.type === 'carousel' || (item.type === 'table' && item.subtype === 'tablecard')) {
+    } else if (['card', 'carousel', 'timeline'].includes(item.type) || (item.type === 'table' && item.subtype === 'tablecard')) {
       item.subcards.forEach(card => {
         card.uuid = this.getuuid()
         if (card.elements) {

--
Gitblit v1.8.0