From c18f79e01a2705d34d5ac2923a26913dba07ea14 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期六, 03 八月 2024 16:04:18 +0800
Subject: [PATCH] 2024-08-03

---
 src/tabviews/custom/components/card/cardcellList/index.jsx |  131 +++++++++++++++++++++++++++++++------------
 1 files changed, 94 insertions(+), 37 deletions(-)

diff --git a/src/tabviews/custom/components/card/cardcellList/index.jsx b/src/tabviews/custom/components/card/cardcellList/index.jsx
index d092bd8..f585b93 100644
--- a/src/tabviews/custom/components/card/cardcellList/index.jsx
+++ b/src/tabviews/custom/components/card/cardcellList/index.jsx
@@ -25,7 +25,7 @@
 const FuncMegvii = asyncComponent(() => import('@/tabviews/zshare/actionList/funcMegvii'))
 const FuncZip = asyncComponent(() => import('@/tabviews/zshare/actionList/funczip'))
 const ExportPdf = asyncComponent(() => import('@/tabviews/zshare/actionList/exportPdf'))
-const ShareLink = asyncComponent(() => import('@/tabviews/zshare/actionList/shareLink'))
+const FuncButton = asyncComponent(() => import('@/tabviews/zshare/actionList/funcbutton'))
 const EditLine = asyncComponent(() => import('@/tabviews/zshare/actionList/editLine'))
 const BarCode = asyncComponent(() => import('@/components/barcode'))
 const QrCode = asyncComponent(() => import('@/components/qrcode'))
@@ -106,7 +106,7 @@
     if (card.linkType === 'linkmenu') {
       if (card.linkThdMenu) {
         let __param = {
-          $BID: data.$$uuid
+          $BID: data.$$uuid || ''
         }
   
         if (card.field) {
@@ -114,16 +114,11 @@
           __param.$searchval = data[card.field] || ''
         }
       
-        if (card.joint === 'true' && card.linkThdMenu.urlFields) {
-          let lower = {}
-          Object.keys(data).forEach(key => {
-            lower[key.toLowerCase()] = data[key]
-          })
-
-          card.linkThdMenu.urlFields.split(',').forEach(field => {
-            __param[field] = lower[field.toLowerCase()] || ''
-          })
-        }
+        Object.keys(data).forEach(key => {
+          if (/^\$/.test(key)) return
+          if (key === 'children') return
+          __param[key] = data[key]
+        })
 
         let tabmenu = card.linkThdMenu
     
@@ -240,15 +235,13 @@
       d.click()
       d.remove()
     } else {
+      let Id = data.$$uuid || ''
+
+      if (cards.subtype === 'propcard' && cardCell) {
+        Id = cardCell.setting.primaryId || ''
+      }
+
       if (card.joint === 'true') {
-        let Id = ''
-  
-        if (cards.subtype === 'propcard' && cardCell) {
-          Id = cardCell.setting.primaryId || ''
-        } else {
-          Id = data[cards.setting.primaryKey] || ''
-        }
-  
         let con = '?'
   
         if (/\?/ig.test(url)) {
@@ -256,6 +249,17 @@
         }
   
         url = url + `${con}id=${Id}&appkey=${window.GLOB.appkey}&userid=${sessionStorage.getItem('UserID')}&LoginUID=${sessionStorage.getItem('LoginUID') || ''}`
+      } else if (/@/.test(url)) {
+        url = url.replace(/@id@/ig, Id)
+        url = url.replace(/@appkey@/ig, window.GLOB.appkey)
+        url = url.replace(/@userid@/ig, sessionStorage.getItem('UserID'))
+        url = url.replace(/@LoginUID@/ig, sessionStorage.getItem('LoginUID'))
+
+        Object.keys(data).forEach(key => {
+          if (/^\$/.test(key)) return
+          let reg = new RegExp('@' + key + '@', 'ig')
+          url = url.replace(reg, data[key])
+        })
       }
   
       window.open(url)
@@ -940,7 +944,7 @@
                 // eslint-disable-next-line
                 _val = eval(_val)
               } catch (e) {
-                console.info(_val)
+                window.mkInfo(_val)
                 console.warn(e)
                 _val = 0
               }
@@ -954,6 +958,29 @@
           val = ''
         } else if (data) {
           let _val = card.formula
+
+          if (card.$keys && card.noValue === 'hide') { // 绌哄�奸殣钘�
+            let _data = {}
+            let empty = true
+
+            Object.keys(data).forEach(key => {
+              _data[key.toLowerCase()] = data[key]
+            })
+            _data.username = sessionStorage.getItem('User_Name') || ''
+            _data.fullname = sessionStorage.getItem('Full_Name') || ''
+            _data.bid = data.$$BID || ''
+
+            card.$keys.forEach(key => {
+              if (!_data.hasOwnProperty(key)) {
+                empty = false
+              } else if (_data[key] && !/^1949-10-01/.test(_data[key])) {
+                empty = false
+              }
+            })
+
+            if (empty) return null
+          }
+
           if (/@username@|@fullName@|@bid@/ig.test(_val)) {
             _val = _val.replace(/@username@/ig, sessionStorage.getItem('User_Name') || '').replace(/@fullName@/ig, sessionStorage.getItem('Full_Name') || '').replace(/@bid@/ig, data.$$BID || '')
           }
@@ -967,7 +994,7 @@
               // eslint-disable-next-line
               _val = eval(_val)
             } catch (e) {
-              console.info(_val)
+              window.mkInfo(_val)
               console.warn(e)
               _val = ''
             }
@@ -987,8 +1014,10 @@
   
         if (val !== '') {
           if (val && typeof(val) === 'string') {
-            val = val.replace(/\n/ig, '<br/>')
-            if (!/<(span|div|p|a|img)\s/g.test(val)) {
+            if (!card.evalchars || card.evalchars.includes('enter')) {
+              val = val.replace(/\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;')
             }
 
@@ -1028,14 +1057,26 @@
           className = mark.signType
         }
 
-        contents.push(
-          <div className={'ant-col ant-col-' + card.width} key={card.uuid} style={_style_} span={card.width}>
-            <div style={_style}>
-              {card.alignItems ? <TextCell card={card} className={'ant-mk-text line' + (card.height || '') + className} value={val}/> : 
-              <div className={'ant-mk-text line' + (card.height || '') + className} style={{height: card.innerHeight}}>{val}</div>}
+        if (card.link && !data.$disabled) {
+          _style.cursor = 'pointer'
+          contents.push(
+            <div className={'ant-col ant-col-' + card.width} key={card.uuid} style={_style_} span={card.width}>
+              <div style={_style} onClick={(e) => {this.openNewView(e, card)}}>
+                {card.alignItems ? <TextCell card={card} className={'ant-mk-text line' + (card.height || '') + className} value={val}/> : 
+                <div className={'ant-mk-text line' + (card.height || '') + className} style={{height: card.innerHeight}}>{val}</div>}
+              </div>
             </div>
-          </div>
-        )
+          )
+        } else {
+          contents.push(
+            <div className={'ant-col ant-col-' + card.width} key={card.uuid} style={_style_} span={card.width}>
+              <div style={_style}>
+                {card.alignItems ? <TextCell card={card} className={'ant-mk-text line' + (card.height || '') + className} value={val}/> : 
+                <div className={'ant-mk-text line' + (card.height || '') + className} style={{height: card.innerHeight}}>{val}</div>}
+              </div>
+            </div>
+          )
+        }
       } else if (card.eleType === 'tag') {
         let vals = ''
   
@@ -1156,12 +1197,14 @@
         }
 
         let MkButton = null
+        let lid = (data.$$uuid || '') + (data.$Index || '')
   
         if (['exec', 'prompt', 'pop', 'form'].includes(card.OpenType)) {
           MkButton = <NormalButton
             btn={card}
             name={name}
             BID={data.$$BID}
+            LID={lid}
             BData={data.$$BData || ''}
             disabled={_disabled}
             setting={cards.setting}
@@ -1172,6 +1215,7 @@
           MkButton = <ExcelInButton
             btn={card}
             BID={data.$$BID}
+            LID={lid}
             BData={data.$$BData || ''}
             disabled={_disabled}
             setting={cards.setting}
@@ -1181,6 +1225,7 @@
           MkButton = <ExcelOutButton
             btn={card}
             BID={data.$$BID}
+            LID={lid}
             BData={data.$$BData || ''}
             disabled={_disabled}
             setting={cards.setting}
@@ -1191,6 +1236,7 @@
             btn={card}
             name={name}
             BID={data.$$BID}
+            LID={lid}
             BData={data.$$BData || ''}
             disabled={_disabled}
             setting={cards.setting}
@@ -1201,6 +1247,7 @@
             btn={card}
             name={name}
             BID={data.$$BID}
+            LID={lid}
             BData={data.$$BData || ''}
             disabled={_disabled}
             selectedData={_data}
@@ -1210,6 +1257,8 @@
             btn={card}
             name={name}
             BID={data.$$BID}
+            LID={lid}
+            columns={cards.columns}
             BData={data.$$BData || ''}
             disabled={_disabled}
             selectedData={_data}
@@ -1219,6 +1268,7 @@
             MkButton = <ChangeUserButton
               btn={card}
               BID={data.$$BID}
+              LID={lid}
               BData={data.$$BData || ''}
               disabled={_disabled}
               setting={cards.setting}
@@ -1228,6 +1278,7 @@
             MkButton = <PrintButton
               btn={card}
               BID={data.$$BID}
+              LID={lid}
               BData={data.$$BData || ''}
               disabled={_disabled}
               setting={cards.setting}
@@ -1238,6 +1289,7 @@
             MkButton = <FuncMegvii
               btn={card}
               BID={data.$$BID}
+              LID={lid}
               disabled={_disabled}
               setting={cards.setting}
               selectedData={_data}
@@ -1246,6 +1298,7 @@
             MkButton = <FuncZip
               btn={card}
               BID={data.$$BID}
+              LID={lid}
               BData={data.$$BData || ''}
               disabled={_disabled}
               setting={cards.setting}
@@ -1254,12 +1307,7 @@
           } else if (card.funcType === 'expPdf') {
             MkButton = <ExportPdf
               btn={card}
-            />
-          } else if (card.funcType === 'shareLink') {
-            MkButton = <ShareLink
-              BID={data.$$BID}
-              btn={card}
-              selectedData={_data}
+              LID={lid}
             />
           } else if (card.funcType === 'addline' || card.funcType === 'delline') {
             MkButton = <EditLine
@@ -1267,6 +1315,15 @@
               disabled={_disabled}
               selectedData={_data}
             />
+          } else {
+            MkButton = <FuncButton
+              BID={data.$$BID}
+              disabled={_disabled}
+              LID={lid}
+              btn={card}
+              columns={cards.columns}
+              selectedData={_data}
+            />
           }
         }
 

--
Gitblit v1.8.0