From 5b75a82df7876f7c2c3e1f9da48752e2b2008ff8 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期一, 20 三月 2023 15:41:41 +0800
Subject: [PATCH] 2023-03-20

---
 src/views/pcdesign/index.jsx |   33 +++++++++++++++++++++++++++++++++
 1 files changed, 33 insertions(+), 0 deletions(-)

diff --git a/src/views/pcdesign/index.jsx b/src/views/pcdesign/index.jsx
index c69a756..1f071f1 100644
--- a/src/views/pcdesign/index.jsx
+++ b/src/views/pcdesign/index.jsx
@@ -1084,6 +1084,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 = () => {
     let config = fromJS(this.state.config).toJS()
 
@@ -1100,6 +1129,10 @@
         config.enabled = false
       }
 
+      if (config.cacheUseful !== 'true') {
+        config.components = this.resetSyncQuery(config.components)
+      }
+
       let tbs = []
       let roleParam = this.getMenuMessage(tbs)
 

--
Gitblit v1.8.0