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 ++++++++++++++++
 src/menu/datasource/verifycard/settingform/index.jsx |   10 +++-
 src/views/mobdesign/index.jsx                        |   33 ++++++++++++++++
 src/views/menudesign/index.jsx                       |   33 ++++++++++++++++
 4 files changed, 106 insertions(+), 3 deletions(-)

diff --git a/src/menu/datasource/verifycard/settingform/index.jsx b/src/menu/datasource/verifycard/settingform/index.jsx
index de02f21..5e24b17 100644
--- a/src/menu/datasource/verifycard/settingform/index.jsx
+++ b/src/menu/datasource/verifycard/settingform/index.jsx
@@ -97,6 +97,10 @@
             values.onload = 'true'
           }
 
+          if (values.interType === 'system' && values.onload === 'false') {
+            values.sync = 'false'
+          }
+
           // 鏁版嵁婧愬墠绔獙璇�
           if (values.interType === 'system' && values.execute !== 'false' && values.dataresource) {
             let _quot = values.dataresource.match(/'{1}/g)
@@ -460,9 +464,9 @@
               </Form.Item>
             </Col> : null}
             {/* 1銆佷笉鍒嗛〉涓斾笉瀛樺湪涓婄骇妯″潡 */}
-            {!['navbar', 'interface'].includes(config.type) && !['editable', 'basetable', 'dualdatacard'].includes(config.subtype) && (!config.pageable || (config.pageable && setting.laypage === 'false')) && (setting.supModule.length === 0 || setting.supModule[0] === 'empty') && setting.interType === 'system' ? <Col span={8}>
+            {!['navbar', 'interface'].includes(config.type) && !['editable', 'basetable', 'dualdatacard'].includes(config.subtype) && (!config.pageable || (config.pageable && setting.laypage === 'false')) && (setting.supModule.length === 0 || setting.supModule[0] === 'empty') && setting.interType === 'system' && setting.onload !== 'false' ? <Col span={8}>
               <Form.Item label={
-                <Tooltip placement="topLeft" title={'鍒濆鍖栧姞杞芥椂锛屾槸鍚︿笌鍏朵粬缁勪欢涓�鍚屽姞杞芥暟鎹紝娉細浠呭湪浣跨敤绯荤粺鍑芥暟锛屼笖鍒濆鍖栧姞杞芥暟鎹椂鏈夋晥锛屽垎椤佃姹傛椂鏃犳晥銆�'}>
+                <Tooltip placement="topLeft" title={'鍒濆鍖栧姞杞芥椂锛屾槸鍚︿笌鍏朵粬缁勪欢涓�鍚屽姞杞芥暟鎹紝娉細濡傝彍鍗曟湭浣跨敤鍚庣缂撳瓨锛屽垯鏌ヨ璇彞澶т簬8000瀛楃鏃舵棤鏁堛��'}>
                   <QuestionCircleOutlined className="mk-form-tip" />
                   鍚屾鏌ヨ
                 </Tooltip>
@@ -516,7 +520,7 @@
                 {getFieldDecorator('onload', {
                   initialValue: setting.onload || 'true'
                 })(
-                  <Radio.Group>
+                  <Radio.Group onChange={(e) => {this.onOptionChange(e.target.value, 'onload')}}>
                     <Radio value="true">鍔犺浇</Radio>
                     <Radio value="false">涓嶅姞杞�</Radio>
                   </Radio.Group>
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 = []
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)
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