From bd06958321afa706f32287c71bd219eb0622c86c Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期二, 10 十二月 2019 16:31:45 +0800
Subject: [PATCH] 2019-12-10

---
 src/tabviews/commontable/index.jsx |   49 +++++++++++++++++++++++++++++++++++++++++--------
 1 files changed, 41 insertions(+), 8 deletions(-)

diff --git a/src/tabviews/commontable/index.jsx b/src/tabviews/commontable/index.jsx
index f64d0d2..fded058 100644
--- a/src/tabviews/commontable/index.jsx
+++ b/src/tabviews/commontable/index.jsx
@@ -38,17 +38,16 @@
     orderColumn: '',
     orderType: 'asc',
     search: '',
-    fixed: {}
+    configMap: {}
   }
 
   async loadconfig () {
     // 鑾峰彇涓昏彍鍗�
     let param = {
       func: 'sPC_Get_LongParam',
-      MenuID: this.props.MenuID,
-      isCache: true
+      MenuID: this.props.MenuID
     }
-    let result = await Api.getSystemConfig(param)
+    let result = await Api.getSystemCacheConfig(param)
     if (result.status && result.LongParam) {
       let config = window.decodeURIComponent(window.atob(result.LongParam))
 
@@ -132,6 +131,7 @@
         loading: true
       }, () => {
         this.improveSearch()
+        this.improveAction()
         this.loadmaindata()
       })
     } else {
@@ -153,8 +153,6 @@
     searchlist.forEach(item => {
       if (item.type !== 'select' && item.type !== 'link') return
 
-      let unloaded = item.options.length === 0
-
       if (item.setAll === 'true') {
         item.options.unshift({
           key: Utils.getuuid(),
@@ -163,7 +161,7 @@
         })
       }
 
-      if (item.resourceType === '1' && item.dataSource && unloaded) {
+      if (item.resourceType === '1' && item.dataSource) {
         let param = {
           func: 'sPC_Get_SelectedList',
           LText: item.dataSourceSql,
@@ -175,7 +173,7 @@
         param.secretkey = Utils.encrypt(param.LText, param.timestamp)
 
         let defer = new Promise(resolve => {
-          Api.getSystemConfig(param).then(res => {
+          Api.getSystemCacheConfig(param).then(res => {
             res.search = item
             resolve(res)
           })
@@ -218,6 +216,40 @@
         }
       })
       this.setState({searchlist})
+    })
+  }
+
+  improveAction = () => {
+    const { config } = this.state
+    config.action.forEach(item => {
+      if (item.OpenType !== 'pop' && item.OpenType !== 'tab' && item.OpenType !== 'blank') return
+
+      Api.getSystemCacheConfig({
+        func: 'sPC_Get_LongParam',
+        MenuID: item.uuid
+      }).then(res => {
+        if (res.status) {
+          let _LongParam = ''
+          if (res.LongParam) {
+            _LongParam = window.decodeURIComponent(window.atob(res.LongParam))
+            try {
+              _LongParam = JSON.parse(_LongParam)
+            } catch (e) {
+              _LongParam = ''
+            }
+          }
+
+          this.setState({
+            configMap: {...this.state.configMap, [item.uuid]: _LongParam}
+          })
+        } else {
+          notification.warning({
+            top: 92,
+            message: res.message,
+            duration: 10
+          })
+        }
+      })
     })
   }
 
@@ -350,6 +382,7 @@
           <MainAction
             MenuID={this.props.MenuID}
             setting={setting}
+            configMap={this.state.configMap}
             refreshdata={this.refreshbyaction}
             gettableselected={this.gettableselected}
             actions={actions}

--
Gitblit v1.8.0