From 08cce3334a2dc81d690b518136b0aaea64e48b0b Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期三, 14 六月 2023 09:55:50 +0800
Subject: [PATCH] 2023-06-14

---
 src/tabviews/custom/components/card/cardcellList/index.jsx |  142 ++++++++++++++++++++++++----------------------
 1 files changed, 74 insertions(+), 68 deletions(-)

diff --git a/src/tabviews/custom/components/card/cardcellList/index.jsx b/src/tabviews/custom/components/card/cardcellList/index.jsx
index 4c7985a..030841b 100644
--- a/src/tabviews/custom/components/card/cardcellList/index.jsx
+++ b/src/tabviews/custom/components/card/cardcellList/index.jsx
@@ -4,7 +4,7 @@
 import { Col, Tooltip, notification, Typography, message } from 'antd'
 import moment from 'moment'
 
-// import Api from '@/api'
+import Api from '@/api'
 import asyncComponent from './asyncButtonComponent'
 import asyncElementComponent from '@/utils/asyncComponent'
 import { getMark } from '@/utils/utils.js'
@@ -76,10 +76,8 @@
     elements: PropTypes.array,       // 鍏冪礌闆�
   }
 
-  state = {}
-
   shouldComponentUpdate (nextProps, nextState) {
-    return !is(fromJS(this.state), fromJS(nextState)) || !is(fromJS(this.props), fromJS(nextProps))
+    return !is(fromJS(this.props), fromJS(nextProps))
   }
 
   /**
@@ -102,7 +100,7 @@
       node && node.scrollIntoView({behavior: 'smooth', block: 'center', inline: 'nearest'})
     }
 
-    if (!card.link) return
+    if (!card.link || (card.linkType === 'qywx' || card.linkType === 'linkmenu')) return
     e.stopPropagation()
     
     let url = ''
@@ -133,78 +131,73 @@
       }
       window.open(_url)
       return
-    } else if (card.linkType === 'qywx') {
-      notification.warning({
-        top: 92,
-        message: 'PC涓嶆敮鎸佹墦寮�浼佷笟寰俊锛�',
-        duration: 5
-      })
+    } else if (card.linkType === 'other' && /^@menuid@/ig.test(url)) {
       return
     }
 
     // positecgroup
-    // if (/^sso$/ig.test(url)) {
-    //   if (!data.LinkUrl1) {
-    //     notification.warning({
-    //       top: 92,
-    //       message: '閾炬帴鍦板潃涓嶅瓨鍦紒',
-    //       duration: 5
-    //     })
-    //     return
-    //   }
+    if (/^sso$/ig.test(url)) {
+      if (!data.LinkUrl1) {
+        notification.warning({
+          top: 92,
+          message: '閾炬帴鍦板潃涓嶅瓨鍦紒',
+          duration: 5
+        })
+        return
+      }
 
-    //   let _url = data.LinkUrl1
-    //   if (/index\.html/ig.test(_url)) {
-    //     _url = _url.replace(/index\.html.*/ig, '')
-    //   } else if (!/\/$/ig.test(_url)) {
-    //     _url = _url + '/'
-    //   }
+      let _url = data.LinkUrl1
+      if (/index\.html/ig.test(_url)) {
+        _url = _url.replace(/index\.html.*/ig, '')
+      } else if (!/\/$/ig.test(_url)) {
+        _url = _url + '/'
+      }
 
-    //   let key = (() => {
-    //     let uuid = []
-    //     let timestamp = new Date().getTime()
-    //     let _options = '0123456789abcdefghigklmnopqrstuv'
-    //     for (let i = 0; i < 19; i++) {
-    //       uuid.push(_options.substr(Math.floor(Math.random() * 0x20), 1))
-    //     }
-    //     uuid = timestamp + uuid.join('')
-    //     return uuid
-    //   })()
+      let key = (() => {
+        let uuid = []
+        let timestamp = new Date().getTime()
+        let _options = '0123456789abcdefghigklmnopqrstuv'
+        for (let i = 0; i < 19; i++) {
+          uuid.push(_options.substr(Math.floor(Math.random() * 0x20), 1))
+        }
+        uuid = timestamp + uuid.join('')
+        return uuid
+      })()
 
-    //   let _param = {
-    //     func: 'webapi_scan_binding_key',
-    //     binding_type: 'mk',
-    //     scan_type: 'toggle',
-    //     scan_appkey: data.scan_appkey || '',
-    //     id: key
-    //   }
+      let _param = {
+        func: 'webapi_scan_binding_key',
+        binding_type: 'mk',
+        scan_type: 'toggle',
+        scan_appkey: data.scan_appkey || '',
+        id: key
+      }
   
-    //   Api.getSystemConfig(_param).then(res => {
-    //     if (!res.status) {
-    //       notification.warning({
-    //         top: 92,
-    //         message: res.message,
-    //         duration: 5
-    //       })
-    //     } else if (res.thd_party_appid && res.thd_party_member_id && res.thd_party_openid) {
-    //       let href = _url + 'admin/index.html#/ssologin/' + window.btoa(window.encodeURIComponent(JSON.stringify({
-    //         appid: res.thd_party_appid,
-    //         memberId: res.thd_party_member_id,
-    //         openid: res.thd_party_openid,
-    //         key: key
-    //       })))
+      Api.getSystemConfig(_param).then(res => {
+        if (!res.status) {
+          notification.warning({
+            top: 92,
+            message: res.message,
+            duration: 5
+          })
+        } else if (res.thd_party_appid && res.thd_party_member_id && res.thd_party_openid) {
+          let href = _url + 'admin/index.html#/ssologin/' + window.btoa(window.encodeURIComponent(JSON.stringify({
+            appid: res.thd_party_appid,
+            memberId: res.thd_party_member_id,
+            openid: res.thd_party_openid,
+            key: key
+          })))
   
-    //       window.open(href)
-    //     } else {
-    //       notification.warning({
-    //         top: 92,
-    //         message: '淇℃伅缂哄け锛岃鑱旂郴绠$悊鍛橈紒',
-    //         duration: 5
-    //       })
-    //     }
-    //   })
-    //   return
-    // }
+          window.open(href)
+        } else {
+          notification.warning({
+            top: 92,
+            message: '淇℃伅缂哄け锛岃鑱旂郴绠$悊鍛橈紒',
+            duration: 5
+          })
+        }
+      })
+      return
+    }
 
     let Id = ''
     let con = '?'
@@ -757,6 +750,10 @@
                 // eslint-disable-next-line
                 _val = eval(_val)
               } catch (e) {
+                if (window.debugger) {
+                  console.info(_val)
+                  console.warn(e)
+                }
                 _val = 0
               }
             }
@@ -779,6 +776,10 @@
               // eslint-disable-next-line
               _val = eval(_val)
             } catch (e) {
+              if (window.debugger) {
+                console.info(_val)
+                console.warn(e)
+              }
               _val = ''
             }
           }
@@ -789,6 +790,11 @@
         if (!val && card.noValue === 'hide') { // 绌哄�奸殣钘�
           return null
         }
+
+        if (card.round && typeof(val) === 'number') {
+          val = Math.round(val * card.round) / card.round
+          val = val.toFixed(card.decimal)
+        }
   
         if (val !== '') {
           if (val && typeof(val) === 'string') {

--
Gitblit v1.8.0