From 0eb129a9beddbb86ae74d7106a8e60823206b8d5 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期四, 14 十二月 2023 11:29:15 +0800
Subject: [PATCH] 2023-12-14

---
 src/tabviews/custom/components/card/data-card/index.jsx |   25 ++++++++++++++++++-------
 1 files changed, 18 insertions(+), 7 deletions(-)

diff --git a/src/tabviews/custom/components/card/data-card/index.jsx b/src/tabviews/custom/components/card/data-card/index.jsx
index 9cc9fcd..1e3d074 100644
--- a/src/tabviews/custom/components/card/data-card/index.jsx
+++ b/src/tabviews/custom/components/card/data-card/index.jsx
@@ -38,7 +38,7 @@
     loading: false,
     card: null,
     data: [],
-    total: null,
+    total: 0,
     precards: [],
     nextcards: [],
     selected: 'false',
@@ -135,6 +135,12 @@
     _config.wrap.layout = (_config.wrap.layout || 'grid') + '-layout float-' + (_config.wrap.cardFloat || 'left')
 
     _config.wrap.wrapClass = `${_config.wrap.selStyle} ${_config.wrap.cardType || ''} ${_config.wrap.scale}`
+
+    if (_config.wrap.shifting === 'true') {
+      _config.wrap.shifting = 'shifting'
+    } else {
+      _config.wrap.shifting = ''
+    }
 
     let pageOptions = ['10', '25', '50', '100', '500', '1000']
 
@@ -398,9 +404,9 @@
           }, i * 10)
         })
       } else {
-        if (position === 'line') {
+        if (position === 'line' || position === 'line_grid') {
           if (lines && lines.length === 1) {
-            this.loadLinedata(lines[0].$$uuid)
+            this.loadLinedata(lines[0].$$uuid, position)
           } else {
             this.loadData(id)
           }
@@ -417,9 +423,9 @@
     } else {
       let supModule = config.setting.supModule
 
-      if (position === 'line') {
+      if (position === 'line' || position === 'line_grid') {
         if (lines && lines.length === 1) {
-          this.loadLinedata(lines[0].$$uuid)
+          this.loadLinedata(lines[0].$$uuid, position)
         } else {
           this.loadData(id)
         }
@@ -870,7 +876,7 @@
   /**
    * @description 鑾峰彇鍗曡鏁版嵁
    */ 
-  async loadLinedata (id) {
+  async loadLinedata (id, position) {
     const { config, pageIndex, pageSize, search, BID, BData, orderBy } = this.state
 
     if (config.forbidLine) {
@@ -902,6 +908,11 @@
 
     let result = await Api.genericInterface(param)
     if (result.status) {
+      if (position === 'line_grid' && (!result.data || !result.data[0])) {
+        this.loadData()
+        return
+      }
+
       let data = fromJS(this.state.data).toJS()
       let selectedData = fromJS(this.state.selectedData).toJS()
       let selectKeys = fromJS(this.state.selectKeys).toJS()
@@ -1173,7 +1184,7 @@
     }
 
     return (
-      <div className="custom-data-card-box" id={'anchor' + config.uuid} style={config.style}>
+      <div className={'custom-data-card-box ' + config.wrap.shifting} id={'anchor' + config.uuid} style={config.style}>
         {loading ?
           <div className="loading-mask">
             {data.length ? <div className="ant-spin-blur"></div> : null}

--
Gitblit v1.8.0