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/mobdesign/index.jsx |   33 +++++++++++++++++++++++++++++++++
 1 files changed, 33 insertions(+), 0 deletions(-)

diff --git a/src/views/mobdesign/index.jsx b/src/views/mobdesign/index.jsx
index d933964..dc5675f 100644
--- a/src/views/mobdesign/index.jsx
+++ b/src/views/mobdesign/index.jsx
@@ -1333,6 +1333,35 @@
     return _style
   }
 
+  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 { adapters } = this.state
     let config = fromJS(this.state.config).toJS()
@@ -1359,6 +1388,10 @@
         config.enabled = false
       }
 
+      if (config.cacheUseful !== 'true') {
+        config.components = this.resetSyncQuery(config.components)
+      }
+
       let tbs = []
       let roleParam = {type: 'view', version: '1.0', key: config.uuid, title: config.MenuName, children: []}
       roleParam.children = this.getMenuMessage(tbs)

--
Gitblit v1.8.0