From 063b983daaf51a7f1e8677bde1e9c0e618866c91 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期五, 21 二月 2020 10:30:19 +0800
Subject: [PATCH] 2020-02-21

---
 src/tabviews/formtab/index.jsx |   35 ++++++++++++++++++++++++++++++-----
 1 files changed, 30 insertions(+), 5 deletions(-)

diff --git a/src/tabviews/formtab/index.jsx b/src/tabviews/formtab/index.jsx
index 7e20e0a..e0a108c 100644
--- a/src/tabviews/formtab/index.jsx
+++ b/src/tabviews/formtab/index.jsx
@@ -258,9 +258,16 @@
    * @description 涓昏〃鏁版嵁鍔犺浇
    */ 
   async loadmaindata () {
-    const { setting } = this.state
+    const { setting, BIDs } = this.state
 
-    if (setting.datatype !== 'query') return
+    if (setting.datatype !== 'query') {
+      notification.warning({
+        top: 92,
+        message: '鏈缃暟鎹煡璇㈤厤缃紒',
+        duration: 10
+      })
+      return
+    }
 
     let param = null
 
@@ -285,6 +292,7 @@
         data: _data,
         primaryId: _primaryId,
         BIDs: {
+          ...BIDs,
           mainTable: _primaryId,
           mainTabledata: _data
         }
@@ -376,13 +384,31 @@
   /**
    * @description 鎸夐挳鎿嶄綔瀹屾垚鍚庯紙鎴愬姛鎴栧け璐ワ級锛岄〉闈㈠埛鏂帮紝閲嶇疆椤电爜鍙婇�夋嫨椤�
    */
-  refreshbyaction = (btn, type, primaryId) => {
+  refreshbyaction = (btn, type, primaryId, formdata) => {
+    const { BIDs } = this.state
+
     if (type === 'success' && btn.afterExecSuccess === 'notclose') {
       this.setState({
         primaryId: primaryId
       }, () => {
         if (btn.execSuccess === 'refresh') {
           this.loadmaindata()
+        } else {
+          let data = {}
+
+          if (formdata && formdata.length > 0) {
+            formdata.forEach(item => {
+              data[item.key] = item.value
+            })
+          }
+
+          this.setState({
+            BIDs: {
+              ...BIDs,
+              mainTable: primaryId,
+              mainTabledata: data
+            }
+          })
         }
       })
     } else if (type === 'success' && btn.afterExecSuccess === 'close') {
@@ -536,8 +562,7 @@
             refreshdata={this.refreshbyaction}
           /> : null
         }
-        {setting && setting.onload !== 'false' &&
-          config.tabgroups.map(group => {
+        {!loadingview && !viewlost && config.tabgroups.map(group => {
             if (config[group].length === 0) return null
 
             return (

--
Gitblit v1.8.0