From 50b49c1b760489c3430fc382656d57c5fbbab07c Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期一, 29 四月 2024 16:07:24 +0800
Subject: [PATCH] 2024-04-29

---
 src/utils/utils-custom.js |   63 +++++++++++++++++++++++++++----
 1 files changed, 54 insertions(+), 9 deletions(-)

diff --git a/src/utils/utils-custom.js b/src/utils/utils-custom.js
index 9390ede..841817d 100644
--- a/src/utils/utils-custom.js
+++ b/src/utils/utils-custom.js
@@ -193,6 +193,42 @@
   }
 
   /**
+   * @description 鑾峰彇鎸囧畾缁勪欢
+   * @return {String}  缁勪欢id
+   */
+  static getComponent (Id) {
+    let interfaces = window.GLOB.customMenu.interfaces
+    let components = window.GLOB.customMenu.components
+    let cell = null
+
+    let mapComponents = (components = []) => {
+      components.forEach(item => {
+        if (item.uuid === Id) {
+          cell = item
+        }else if (item.type === 'tabs') {
+          item.subtabs.forEach(f_tab => {
+            mapComponents(f_tab.components)
+          })
+        } else if (item.type === 'group') {
+          mapComponents(item.components)
+        }
+      })
+    }
+
+    mapComponents(components)
+
+    if (!cell && interfaces) {
+      interfaces.forEach(m => {
+        if (m.uuid === Id && m.status === 'true') {
+          cell = m
+        }
+      })
+    }
+    
+    return cell
+  }
+
+  /**
    * @description 鑾峰彇涓婄骇妯″潡
    * @return {String}  selfId  褰撳墠缁勪欢id
    */
@@ -540,7 +576,16 @@
             return cell
           })
         }
-      } else if (item.type === 'table' && item.cols) {
+      } else if (item.type === 'table') {
+        if (item.supNodes && item.supNodes.length > 0) {
+          item.supNodes = item.supNodes.map(cell => {
+            cell.nodes = cell.nodes.map(n => md5(commonId + n))
+            cell.componentId = cell.nodes[cell.nodes.length - 1]
+
+            return cell
+          })
+        }
+
         let loopCol = (cols) => {
           return cols.map(col => {
             if (col.type === 'action') {
@@ -578,7 +623,7 @@
           })
         }
 
-        item.cols = loopCol(item.cols)
+        item.cols = loopCol(item.cols || [])
 
         if (item.colsCtrls) {
           item.colsCtrls = item.colsCtrls.map(col => {
@@ -846,7 +891,7 @@
           return cell
         })
       }
-    } else if (item.type === 'table' && item.cols) {
+    } else if (item.type === 'table') {
       let loopCol = (cols) => {
         return cols.map(col => {
           if (col.type === 'action') {
@@ -887,7 +932,7 @@
         })
       }
 
-      item.cols = loopCol(item.cols)
+      item.cols = loopCol(item.cols || [])
 
       if (item.colsCtrls) {
         item.colsCtrls = item.colsCtrls.map(col => {
@@ -1009,7 +1054,7 @@
       } else if (item.type === 'daterange') {
         value = '1949-10-01 00:00:00.000,1949-10-02 00:00:00.000'
       } else if (item.type === 'range') {
-        value = item.initval || `${item.minValue || '-999999'},${item.maxValue || '999999'}`
+        value = item.initval || `${item.minValue || '-999999999'},${item.maxValue || '999999999'}`
       } else if (item.type === 'multiselect' || (item.type === 'checkcard' && item.multiple === 'true')) {
         type = 'multi'
       }
@@ -1058,7 +1103,7 @@
       searchText.push('(' + item.key + ' >= \'' + val[0] + '\' AND ' + item.key + ' < \'' + val[1] + '\')')
     } else if (item.type === 'range') {
       let val = item.value.split(',')
-      searchText.push('(' + item.key + ' >= ' + (val[0] || -999999) + ' AND ' + item.key + ' < ' + (val[1] || 999999) + ')')
+      searchText.push('(' + item.key + ' >= ' + (val[0] || -999999999) + ' AND ' + item.key + ' <= ' + (val[1] || 999999999) + ')')
     } else if (item.type === 'datemonth') {
       if (item.match === '=') {
         searchText.push('(' + item.key + ' = \'' + item.value + '\')')
@@ -1122,10 +1167,10 @@
       let val = item.value.split(',')
       options.push({
         reg: new RegExp('@' + item.key + '@', 'ig'),
-        value: `${val[0] || -999999}`
+        value: `${val[0] || -999999999}`
       }, {
         reg: new RegExp('@' + item.key + '1@', 'ig'),
-        value: `${val[1] || 999999}`
+        value: `${val[1] || 999999999}`
       })
     } else if (item.type === 'datemonth') {
       if (item.match === '=') {
@@ -1675,7 +1720,7 @@
       } else if (!card.setting.supModule) {
         errors.push({ level: 0, detail: '鏈缃笂绾х粍浠讹紒'})
       }
-    } else if (card.type === 'card' && card.subtype === 'datacard') { // 鏁版嵁鍗★紝鍙兘鏈夊涓婄骇
+    } else if ((card.type === 'card' && card.subtype === 'datacard') || card.subtype === 'normaltable') { // 鏁版嵁鍗°�乼able锛屽彲鑳芥湁澶氫笂绾�
       if (card.wrap.supType !== 'multi' && !card.setting.supModule) {
         errors.push({ level: 0, detail: '鏈缃笂绾х粍浠讹紒'})
       }

--
Gitblit v1.8.0