From 162440a345abe2432df48b933bb858e6f1b56449 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期四, 18 一月 2024 11:26:38 +0800
Subject: [PATCH] 2024-01-18

---
 src/tabviews/custom/components/table/base-table/index.jsx |   29 ++++++++++++++++++++++++++---
 1 files changed, 26 insertions(+), 3 deletions(-)

diff --git a/src/tabviews/custom/components/table/base-table/index.jsx b/src/tabviews/custom/components/table/base-table/index.jsx
index 0693483..7c86fca 100644
--- a/src/tabviews/custom/components/table/base-table/index.jsx
+++ b/src/tabviews/custom/components/table/base-table/index.jsx
@@ -137,7 +137,7 @@
     let _orderBy = orderBy || setting.order
     let param = UtilsDM.getQueryDataParams(setting, searches, _orderBy, pageIndex, pageSize, BID)
 
-    let result = await Api.genericInterface(param)
+    let result = await Api.genericInterface(param, setting.js_script)
     if (result.status) {
       if (repage === 'false' && result.data && result.data.length === 0 && result.total > 0 && pageIndex > 1) {
         let _pageIndex = Math.ceil(result.total / pageSize)
@@ -566,8 +566,10 @@
         BID: id,
         BData: data
       }, () => {
-        this.loadmaindata(true, 'true')
-        this.getStatFieldsValue()
+        if (!setting.checkBid) {
+          this.loadmaindata(true, 'true')
+          this.getStatFieldsValue()
+        }
       })
     }
   }
@@ -606,6 +608,25 @@
     })
   }
 
+  autoExec = (times) => {
+    const { config } = this.state
+
+    if (!config.wrap.autoExec) return
+
+    let btn = document.getElementById('button' + config.wrap.autoExec)
+
+    this.autoTimer && clearTimeout(this.autoTimer)
+
+    if (btn) {
+      MKEmitter.emit('triggerBtnId', config.wrap.autoExec, [])
+    } else if (!times || times < 20) {
+      times = times ? times + 1 : 1
+      this.autoTimer = setTimeout(() => {
+        this.autoExec(times)
+      }, 1000)
+    }
+  }
+
   shouldComponentUpdate (nextProps, nextState) {
     return !is(fromJS(this.props), fromJS(nextProps)) || !is(fromJS(this.state), fromJS(nextState))
   }
@@ -621,6 +642,8 @@
     if (config.setting.useMSearch) {
       MKEmitter.addListener('searchRefresh', this.searchRefresh)
     }
+
+    this.autoExec()
   }
 
   /**

--
Gitblit v1.8.0