From ea06034e06a30d3e97838c7885ae7694273a8ca1 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期四, 05 十二月 2024 20:03:51 +0800
Subject: [PATCH] Merge branch 'develop'

---
 src/tabviews/custom/components/card/cardcellList/index.jsx |   33 +++++++++++++++++++++++++++------
 1 files changed, 27 insertions(+), 6 deletions(-)

diff --git a/src/tabviews/custom/components/card/cardcellList/index.jsx b/src/tabviews/custom/components/card/cardcellList/index.jsx
index 3a130e8..c550596 100644
--- a/src/tabviews/custom/components/card/cardcellList/index.jsx
+++ b/src/tabviews/custom/components/card/cardcellList/index.jsx
@@ -224,9 +224,17 @@
     //   })
     //   return
     // }
-    
-    if (/^http.+(.txt|.doc|.docx|.pdf|.xlsx|.xls|.zip|.rar|.ppt)$/i.test(url)) {
-      let name = url.replace(/.+\//g, '').replace(/\.{1}[^.]*$/g, '')
+
+    if (/^http.+(.txt|.doc|.docx|.pdf|.xlsx|.xls|.zip|.rar|.ppt)$/i.test(url) || card.linkType === 'download') {
+      let name = ''
+      if (card.datatype === 'static') {
+        name = card.value || ''
+      } else if (data.hasOwnProperty(card.field)) {
+        name = data[card.field] + ''
+      }
+      name = name.replace(/\.{1}[^.]*$/g, '')
+      name = name ? name + url.replace(/.+\./g, '.') : ''
+
       let d = document.createElement('a')
       d.href = url
       d.setAttribute('download', name)
@@ -649,10 +657,21 @@
           }
         }
 
+        let _style = {...card.style}
+
+        if (card.marks) {
+          let _s = {}
+          getMark(card.marks, data, _s)
+
+          if (_s.color) {
+            _style.color = _s.color
+          }
+        }
+
         if (card.tipType === 'text') {
           contents.push(
             <div className={'ant-col ant-col-' + card.width} key={card.uuid} style={_style_} span={card.width}>
-              <div style={card.style}>
+              <div style={_style}>
                 {val ? <Tooltip title={val}>
                   <div className={'ant-mk-text line' + (card.height || '')} style={{height: card.innerHeight}}>{icon}</div>
                 </Tooltip> : <div className={'ant-mk-text line' + (card.height || '')} style={{height: card.innerHeight}}>{icon}</div>}
@@ -662,7 +681,7 @@
         } else {
           contents.push(
             <div className={'ant-col ant-col-' + card.width} key={card.uuid} style={_style_} span={card.width}>
-              <div style={card.style}>
+              <div style={_style}>
                 {val ? <Tooltip title={val}>
                   <MkIcon className="ant-mk-icon" style={{height: card.innerHeight}} type={icon}/>
                 </Tooltip> : <MkIcon className="ant-mk-icon" style={{height: card.innerHeight}} type={icon}/>}
@@ -968,6 +987,8 @@
             if (key === 'children') return
             if (/^1949-10-01/.test(data[key])) {
               _data[key.toLowerCase()] = ''
+            } else if (/\d{4}-\d{2}-\d{2}\s00:00:00/.test(data[key])) {
+              _data[key.toLowerCase()] = data[key].replace(/\s00:00:00/g, '')
             } else {
               _data[key.toLowerCase()] = data[key]
             }
@@ -1031,7 +1052,7 @@
         if (val !== '') {
           if (val && typeof(val) === 'string') {
             if (!card.evalchars || card.evalchars.includes('enter')) {
-              val = val.replace(/\n/ig, '<br/>')
+              val = val.replace(/\\n|\n/ig, '<br/>')
             }
             if ((!card.evalchars || card.evalchars.includes('space')) && !/<(span|div|p|a|img)\s/g.test(val)) {
               val = val.replace(/\s/ig, '&nbsp;')

--
Gitblit v1.8.0