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/menudesign/index.jsx | 33 +++++++++++++++++++++++++++++++++ 1 files changed, 33 insertions(+), 0 deletions(-) diff --git a/src/views/menudesign/index.jsx b/src/views/menudesign/index.jsx index 3645483..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() @@ -780,6 +809,10 @@ config.enabled = false } + if (config.cacheUseful !== 'true') { + config.components = this.resetSyncQuery(config.components) + } + let tbs = [] let btns = this.getMenuMessage(config, tbs) let arr = [] -- Gitblit v1.8.0