From c8804ceb1fe2dea76f9949c5ea04423876ee2c81 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期五, 28 六月 2024 14:02:47 +0800
Subject: [PATCH] 2024-06-28

---
 src/menu/transfer/index.jsx |  136 ++++++++++++++++++++++++++------------------
 1 files changed, 80 insertions(+), 56 deletions(-)

diff --git a/src/menu/transfer/index.jsx b/src/menu/transfer/index.jsx
index b766970..f4fa0e0 100644
--- a/src/menu/transfer/index.jsx
+++ b/src/menu/transfer/index.jsx
@@ -29,6 +29,22 @@
     const _this = this
 
     if (!config.enabled) {
+      let tb = config.components[0]
+      if (config.components.length === 1 && tb.setting.interType === 'system' && !tb.setting.dataresource) {
+        confirm({
+          title: '褰撳墠椤甸潰灏嗘竻绌猴紝纭畾鍒囨崲涓鸿嚜瀹氫箟椤甸潰鍚楋紵',
+          content: '',
+          onOk() {
+            return new Promise(resolve => {
+              _this.execUpdate(resolve, true)
+            })
+          },
+          onCancel() {}
+        })
+
+        return
+      }
+
       notification.warning({
         top: 92,
         message: '鏈惎鐢ㄨ彍鍗曚笉鍙崌绾э紒',
@@ -49,7 +65,7 @@
     })
   }
 
-  execUpdate = (_resolve) => {
+  execUpdate = (_resolve, clear) => {
     let _config = fromJS(this.props.config).toJS()
     _config.permission = 'true'
     _config.Template = 'CustomPage'
@@ -59,23 +75,53 @@
     delete _config.autoMatic
 
     let useMSearch = false
-    _config.components.forEach((item, i) => {
-      if (item.type === 'tabs') {
-        item.name = '鏍囩缁�' + i
-        item.width = 24
-        item.subtype = 'tabs'
-        item.setting = {autoSwitch: 'false', blacklist: [], name: item.name, position: 'top', supModule: [], tabStyle: 'line', width: 24}
 
-        item.subtabs.forEach(tab => {
-          tab.components[0].subtype = 'normaltable'
-          tab.components[0].width = 24
-          tab.components[0].wrap.width = 24
-          tab.components[0].wrap.name = tab.components[0].name
-          if (tab.components[0].setting.useMSearch === 'true') {
-            useMSearch = true
-          }
-
-          tab.components[0].action.forEach(btn => {
+    if (clear) {
+      _config.components = []
+    } else {
+      _config.components.forEach((item, i) => {
+        if (item.type === 'tabs') {
+          item.name = '鏍囩缁�' + i
+          item.width = 24
+          item.subtype = 'tabs'
+          item.setting = {autoSwitch: 'false', blacklist: [], name: item.name, position: 'top', supModule: [], tabStyle: 'line', width: 24}
+  
+          item.subtabs.forEach(tab => {
+            tab.components[0].subtype = 'normaltable'
+            tab.components[0].width = 24
+            tab.components[0].wrap.width = 24
+            tab.components[0].wrap.name = tab.components[0].name
+            if (tab.components[0].setting.useMSearch === 'true') {
+              useMSearch = true
+            }
+  
+            tab.components[0].action.forEach(btn => {
+              if (btn.OpenType === 'popview' && btn.config) {
+                btn.config.Template = 'CustomPage'
+                if (btn.config.components[0]) {
+                  btn.config.components[0].subtype = 'normaltable'
+                }
+              }
+            })
+            tab.components[0].cols = tab.components[0].cols.filter(col => !(col.field && col.Hide === 'true'))
+            tab.components[0].cols.forEach(col => {
+              if (col.type !== 'custom') return
+              col.elements.forEach(btn => {
+                if (btn.OpenType === 'popview' && btn.config) {
+                  btn.config.Template = 'CustomPage'
+                  if (btn.config.components[0]) {
+                    btn.config.components[0].subtype = 'normaltable'
+                  }
+                }
+              })
+            })
+          })
+        } else {
+          item.subtype = 'normaltable'
+          item.width = 24
+          item.wrap.width = 24
+          item.wrap.name = item.name
+          item.action.forEach(btn => {
             if (btn.OpenType === 'popview' && btn.config) {
               btn.config.Template = 'CustomPage'
               if (btn.config.components[0]) {
@@ -83,8 +129,9 @@
               }
             }
           })
-          tab.components[0].cols.forEach(col => {
-            if (col.type !== 'action') return
+          item.cols = item.cols.filter(col => !(col.field && col.Hide === 'true'))
+          item.cols.forEach(col => {
+            if (col.type !== 'custom') return
             col.elements.forEach(btn => {
               if (btn.OpenType === 'popview' && btn.config) {
                 btn.config.Template = 'CustomPage'
@@ -94,33 +141,9 @@
               }
             })
           })
-        })
-      } else {
-        item.subtype = 'normaltable'
-        item.width = 24
-        item.wrap.width = 24
-        item.wrap.name = item.name
-        item.action.forEach(btn => {
-          if (btn.OpenType === 'popview' && btn.config) {
-            btn.config.Template = 'CustomPage'
-            if (btn.config.components[0]) {
-              btn.config.components[0].subtype = 'normaltable'
-            }
-          }
-        })
-        item.cols.forEach(col => {
-          if (col.type !== 'action') return
-          col.elements.forEach(btn => {
-            if (btn.OpenType === 'popview' && btn.config) {
-              btn.config.Template = 'CustomPage'
-              if (btn.config.components[0]) {
-                btn.config.components[0].subtype = 'normaltable'
-              }
-            }
-          })
-        })
-      }
-    })
+        }
+      })
+    }
 
     if (useMSearch) {
       let cell = {
@@ -138,6 +161,7 @@
       cell.wrap.advanceWidth = _config.components[0].wrap.advanceWidth || 1000
       cell.wrap.searchLwidth = _config.components[0].wrap.searchLwidth || 33.3
       cell.wrap.searchRatio = _config.components[0].wrap.searchRatio || 6
+      cell.wrap.resetContrl = _config.components[0].wrap.resetContrl || 'init'
       cell.wrap.show = _config.components[0].wrap.show || 'true'
       
       if (cell.wrap.advanceType === 'drawer') {
@@ -194,7 +218,8 @@
       type: 'admin',
       OpenType: _config.OpenType,
       PageParam: {Template: 'CustomPage', OpenType: 'newtab', hidden: _config.hidden},
-      MenuType: 'custom'
+      MenuType: 'custom',
+      lang: sessionStorage.getItem('lang')
     }
 
     let url = window.btoa(window.encodeURIComponent(JSON.stringify(urlparam)))
@@ -215,25 +240,24 @@
       debug_md5: key,
       debug_url: url,
       debug_list: window.btoa(tbs),
-      LongParam: window.btoa(window.encodeURIComponent(JSON.stringify(_config)))
+      LongParam: window.btoa(window.encodeURIComponent(JSON.stringify(_config))),
+      LText: ''
     }
 
-    param.LText = Utils.formatOptions(param.LText)
     param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss')
-    param.secretkey = Utils.encrypt(param.LText, param.timestamp)
+    param.secretkey = Utils.encrypt('', param.timestamp)
 
-    Api.getSystemConfig(param).then(res => {
+    Api.getCloudConfig(param).then(res => {
       _resolve()
       if (!res.status) {
-        notification.warning({
-          top: 92,
-          message: res.message,
-          duration: 5
+        Modal.warning({
+          title: res.message,
+          okText: '鐭ラ亾浜�'
         })
         return
       }
 
-      localStorage.setItem('menuUpdate', new Date().getTime())
+      localStorage.setItem('menuUpdate', new Date().getTime() + ',' + _config.uuid)
       notification.success({
         top: 92,
         message: '鍒囨崲鎴愬姛銆�',

--
Gitblit v1.8.0