From 34e7681fd12b1c4e4994d3bea1a553870e10bc50 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期六, 11 三月 2023 17:58:54 +0800
Subject: [PATCH] 2023-03-11

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

diff --git a/src/tabviews/custom/components/carousel/data-card/index.jsx b/src/tabviews/custom/components/carousel/data-card/index.jsx
index 90e9116..4dbe6e2 100644
--- a/src/tabviews/custom/components/carousel/data-card/index.jsx
+++ b/src/tabviews/custom/components/carousel/data-card/index.jsx
@@ -38,7 +38,6 @@
     const { data, initdata } = this.props
     let _config = fromJS(this.props.config).toJS()
     let _card = _config.subcards[0]
-    let _cols = new Map()
 
     let _data = null
     let _sync = _config.setting.sync === 'true'
@@ -75,21 +74,9 @@
       })
     }
 
-    _config.columns.forEach(item => {
-      if (item.type !== 'number') return
-      _cols.set(item.field, item)
-    })
-
     if (_card.setting.click) {
       _card.style.cursor = 'pointer'
     }
-
-    _card.elements = _card.elements.map(item => {
-      if (item.eleType === 'number' && item.field && _cols.has(item.field) && typeof(item.decimal) !== 'number') {
-        item.decimal = _cols.get(item.field).decimal || 0
-      }
-      return item
-    })
 
     if (!_config.wrap.height) { // 鍏煎
       _config.wrap.height = _config.style.height || '300px'
@@ -194,7 +181,7 @@
     this.timer && this.timer.stop()
   }
 
-  openModal = () => {
+  openModal = (ErrCode) => {
     const { config, data } = this.state
     
     if (config.wrap.display !== 'modal' || !data || data.length === 0) return
@@ -208,6 +195,10 @@
       localStorage.setItem(code, data[0].$$uuid + data.length)
 
       Api.getAppVersion(true)
+
+      if (ErrCode === '-1') {
+        return
+      }
     }
 
     setTimeout(() => {
@@ -299,7 +290,7 @@
     let result = await Api.genericInterface(param)
     if (result.status) {
       this.loaded = true
-      if (config.$cache) {
+      if (config.$cache && config.setting.onload !== 'false') {
         Api.writeCacheConfig(config.uuid, result.data || '')
       }
 
@@ -314,7 +305,7 @@
         }),
         loading: false
       }, () => {
-        this.openModal()
+        this.openModal(result.ErrCode)
       })
     } else {
       this.setState({

--
Gitblit v1.8.0