From e5641f8d70ce78589cf956215f3bfcc15e28252f Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期一, 26 二月 2024 20:53:12 +0800
Subject: [PATCH] 2024-02-26

---
 src/tabviews/custom/components/table/edit-table/index.jsx      |    8 ++++++++
 src/utils/utils-datamanage.js                                  |    2 +-
 src/tabviews/custom/components/table/base-table/index.jsx      |    8 ++++++++
 src/tabviews/custom/components/card/double-data-card/index.jsx |    7 +++++++
 src/tabviews/custom/components/table/normal-table/index.jsx    |    7 +++++++
 src/tabviews/custom/components/card/data-card/index.jsx        |    7 +++++++
 6 files changed, 38 insertions(+), 1 deletions(-)

diff --git a/src/tabviews/custom/components/card/data-card/index.jsx b/src/tabviews/custom/components/card/data-card/index.jsx
index 1955b65..d11af8d 100644
--- a/src/tabviews/custom/components/card/data-card/index.jsx
+++ b/src/tabviews/custom/components/card/data-card/index.jsx
@@ -743,6 +743,7 @@
 
     if (config.setting.supModule && !BID && config.wrap.supKey !== 'false') { // BID 涓嶅瓨鍦ㄦ椂锛屼笉鍋氭煡璇�
       this.loaded = true
+      this.requestId = ''
 
       this.setState({
         activeKey: '',
@@ -789,8 +790,14 @@
     let _orderBy = orderBy || config.setting.order || ''
     let param = UtilsDM.getQueryDataParams(config.setting, searches, _orderBy, pageIndex, pageSize, BID)
 
+    if (param.func === 'sPC_Get_TableData') {
+      this.requestId = param.timestamp
+    }
+
     let result = await Api.genericInterface(param)
     if (result.status) {
+      if (result.timestamp_back && this.requestId !== result.timestamp_back) return
+
       let start = 1
       if (config.setting.laypage) {
         start = pageSize * (pageIndex - 1) + 1
diff --git a/src/tabviews/custom/components/card/double-data-card/index.jsx b/src/tabviews/custom/components/card/double-data-card/index.jsx
index 6ae8f77..57af326 100644
--- a/src/tabviews/custom/components/card/double-data-card/index.jsx
+++ b/src/tabviews/custom/components/card/double-data-card/index.jsx
@@ -583,6 +583,7 @@
 
     if (config.setting.supModule && !BID && config.wrap.supKey !== 'false') { // BID 涓嶅瓨鍦ㄦ椂锛屼笉鍋氭煡璇�
       this.loaded = true
+      this.requestId = ''
 
       this.setState({
         activeKey: '',
@@ -632,8 +633,14 @@
     let _orderBy = orderBy || config.setting.order || ''
     let param = UtilsDM.getQueryDataParams(config.setting, searches, _orderBy, pageIndex, pageSize, BID)
 
+    if (param.func === 'sPC_Get_TableData') {
+      this.requestId = param.timestamp
+    }
+
     let result = await Api.genericInterface(param)
     if (result.status) {
+      if (result.timestamp_back && this.requestId !== result.timestamp_back) return
+
       let start = 1
       if (config.setting.laypage) {
         start = pageSize * (pageIndex - 1) + 1
diff --git a/src/tabviews/custom/components/table/base-table/index.jsx b/src/tabviews/custom/components/table/base-table/index.jsx
index 7c86fca..2cc683f 100644
--- a/src/tabviews/custom/components/table/base-table/index.jsx
+++ b/src/tabviews/custom/components/table/base-table/index.jsx
@@ -112,6 +112,8 @@
       if (setting.$hasSyncModule) {
         MKEmitter.emit('syncBalconyData', config.uuid, [], false)
       }
+
+      this.requestId = ''
       return
     }
 
@@ -137,8 +139,14 @@
     let _orderBy = orderBy || setting.order
     let param = UtilsDM.getQueryDataParams(setting, searches, _orderBy, pageIndex, pageSize, BID)
 
+    if (param.func === 'sPC_Get_TableData') {
+      this.requestId = param.timestamp
+    }
+
     let result = await Api.genericInterface(param, setting.js_script)
     if (result.status) {
+      if (result.timestamp_back && this.requestId !== result.timestamp_back) return
+
       if (repage === 'false' && result.data && result.data.length === 0 && result.total > 0 && pageIndex > 1) {
         let _pageIndex = Math.ceil(result.total / pageSize)
 
diff --git a/src/tabviews/custom/components/table/edit-table/index.jsx b/src/tabviews/custom/components/table/edit-table/index.jsx
index 77c9061..4d2a761 100644
--- a/src/tabviews/custom/components/table/edit-table/index.jsx
+++ b/src/tabviews/custom/components/table/edit-table/index.jsx
@@ -274,6 +274,8 @@
         total: 0
       })
       reset && MKEmitter.emit('resetTable', config.uuid, 'true') // 鍒楄〃閲嶇疆
+
+      this.requestId = ''
       return
     }
 
@@ -299,8 +301,14 @@
     let _orderBy = orderBy || setting.order
     let param = UtilsDM.getQueryDataParams(setting, searches, _orderBy, pageIndex, pageSize, BID)
 
+    if (param.func === 'sPC_Get_TableData') {
+      this.requestId = param.timestamp
+    }
+
     let result = await Api.genericInterface(param)
     if (result.status) {
+      if (result.timestamp_back && this.requestId !== result.timestamp_back) return
+      
       reset && MKEmitter.emit('resetTable', config.uuid, repage) // 鍒楄〃閲嶇疆
 
       let start = 1
diff --git a/src/tabviews/custom/components/table/normal-table/index.jsx b/src/tabviews/custom/components/table/normal-table/index.jsx
index 676488a..498c717 100644
--- a/src/tabviews/custom/components/table/normal-table/index.jsx
+++ b/src/tabviews/custom/components/table/normal-table/index.jsx
@@ -400,6 +400,7 @@
       }
 
       this.loaded = true
+      this.requestId = ''
       return
     }
 
@@ -427,8 +428,14 @@
     let _orderBy = orderBy || setting.order
     let param = UtilsDM.getQueryDataParams(setting, searches, _orderBy, pageIndex, pageSize, BID)
 
+    if (param.func === 'sPC_Get_TableData') {
+      this.requestId = param.timestamp
+    }
+
     let result = await Api.genericInterface(param)
     if (result.status) {
+      if (result.timestamp_back && this.requestId !== result.timestamp_back) return
+      
       this.loaded = true
       if (config.$cache && type === 'init') {
         Api.writeCacheConfig(config.uuid, result.data || [], BID)
diff --git a/src/utils/utils-datamanage.js b/src/utils/utils-datamanage.js
index 91e58db..11c38b3 100644
--- a/src/utils/utils-datamanage.js
+++ b/src/utils/utils-datamanage.js
@@ -297,7 +297,7 @@
 
     // exec_type 瑙g爜瀛楁锛歀Text銆丩Text1銆丩Text2銆乧ustom_script銆丏ateCount
 
-    param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss')
+    param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss.SSS')
     param.secretkey = Utils.encrypt('', param.timestamp)
 
     param.username = userName

--
Gitblit v1.8.0