From 2b46797c3a5868f7f26329da5834c13aae07ad69 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期一, 03 四月 2023 11:59:34 +0800
Subject: [PATCH] Merge branch 'develop'

---
 src/views/menudesign/index.jsx |   35 ++++++++++++++++++++++++++++++++++-
 1 files changed, 34 insertions(+), 1 deletions(-)

diff --git a/src/views/menudesign/index.jsx b/src/views/menudesign/index.jsx
index ce3e6e5..e816b50 100644
--- a/src/views/menudesign/index.jsx
+++ b/src/views/menudesign/index.jsx
@@ -758,6 +758,35 @@
     return true
   }
 
+  resetSyncQuery = (components) => {
+    return components.map(item => {
+      if (item.type === 'tabs') {
+        item.subtabs.forEach(tab => {
+          tab.components = this.resetSyncQuery(tab.components)
+        })
+      } else if (item.type === 'group') {
+        item.components = this.resetSyncQuery(item.components)
+      } else if (item.setting && item.setting.interType === 'system' && item.setting.sync === 'true') {
+        let sql = ''
+        if (item.setting.execute !== 'false' && item.setting.dataresource) {
+          sql = item.setting.dataresource
+        }
+
+        item.scripts && item.scripts.forEach(script => {
+          if (script.status === 'false') return
+
+          sql += script.sql
+        })
+
+        if (sql.length > 8000) {
+          item.setting.sync = 'false'
+        }
+      }
+
+      return item
+    })
+  }
+
   submitConfig = () => {
     const { MenuType } = this.state
     let config = fromJS(this.state.config).toJS()
@@ -778,6 +807,10 @@
     setTimeout(() => {
       if (config.enabled && this.verifyConfig()) {
         config.enabled = false
+      }
+
+      if (config.cacheUseful !== 'true') {
+        config.components = this.resetSyncQuery(config.components)
       }
 
       let tbs = []
@@ -1051,7 +1084,7 @@
         carousel: '杞挱',
         tree: '鏍戝舰鍒楄〃',
         chart: '鑷畾涔夊浘琛�',
-        editor: '瀵屾枃鏈�',
+        // editor: '瀵屾枃鏈�',
         group: '鍒嗙粍',
         iframe: 'iframe'
       }

--
Gitblit v1.8.0