From 0a9e69c47dd88f7f2b551ab5b0507d46cb5dc252 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期五, 28 十月 2022 15:44:21 +0800
Subject: [PATCH] 2022-10-28

---
 src/tabviews/custom/components/card/cardcellList/index.jsx |   17 ++++++++++++-----
 1 files changed, 12 insertions(+), 5 deletions(-)

diff --git a/src/tabviews/custom/components/card/cardcellList/index.jsx b/src/tabviews/custom/components/card/cardcellList/index.jsx
index 94cf90b..0fa2b24 100644
--- a/src/tabviews/custom/components/card/cardcellList/index.jsx
+++ b/src/tabviews/custom/components/card/cardcellList/index.jsx
@@ -454,7 +454,14 @@
         )
       } else if (card.eleType === 'icon') {
         let val = ''
+        let icon = ''
         let height = card.innerHeight
+
+        if (card.datatype === 'dynamic') {
+          icon = data[card.field] || ''
+        } else {
+          icon = card.icon
+        }
 
         if (!height) { // 鍏煎
           let fontSize = 14
@@ -470,18 +477,18 @@
           height = fontSize * lineHeight
         }
   
-        if (card.datatype === 'static') {
+        if (data.hasOwnProperty(card.tooltip)) {
+          val = data[card.tooltip]
+        } else {
           val = card.tooltip
-        } else if (data.hasOwnProperty(card.field)) {
-          val = data[card.field]
         }
   
         contents.push(
           <Col key={card.uuid} span={card.width}>
             <div style={card.style}>
               {val ? <Tooltip title={val}>
-                <MkIcon className="ant-mk-icon" style={{height: height}} type={card.icon}/>
-              </Tooltip> : <MkIcon className="ant-mk-icon" style={{height: height}} type={card.icon}/>}
+                <MkIcon className="ant-mk-icon" style={{height: height}} type={icon}/>
+              </Tooltip> : <MkIcon className="ant-mk-icon" style={{height: height}} type={icon}/>}
             </div>
           </Col>
         )

--
Gitblit v1.8.0