From a9ac16fecc0cf9bc66dfaefe4e9b35fa3c722812 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期二, 10 十一月 2020 16:58:43 +0800
Subject: [PATCH] 2020-11-10

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

diff --git a/src/tabviews/custom/components/card/cardcellList/index.jsx b/src/tabviews/custom/components/card/cardcellList/index.jsx
index ab52d69..05728a2 100644
--- a/src/tabviews/custom/components/card/cardcellList/index.jsx
+++ b/src/tabviews/custom/components/card/cardcellList/index.jsx
@@ -2,10 +2,12 @@
 import PropTypes from 'prop-types'
 import { is, fromJS } from 'immutable'
 import { Icon, Col, Tooltip, notification } from 'antd'
+import moment from 'moment'
 
 import zhCN from '@/locales/zh-CN/model.js'
 import enUS from '@/locales/en-US/model.js'
 import asyncComponent from './asyncButtonComponent'
+import asyncElementComponent from '@/utils/asyncComponent'
 
 import './index.scss'
 
@@ -17,6 +19,8 @@
 const NewPageButton = asyncComponent(() => import('@/tabviews/zshare/actionList/newpagebutton'))
 const ChangeUserButton = asyncComponent(() => import('@/tabviews/zshare/actionList/changeuserbutton'))
 const PrintButton = asyncComponent(() => import('@/tabviews/zshare/actionList/printbutton'))
+const BarCode = asyncElementComponent(() => import('@/components/barcode'))
+const QrCode = asyncElementComponent(() => import('@/components/qrcode'))
 
 class CardCellComponent extends Component {
   static propTpyes = {
@@ -266,10 +270,55 @@
         </Col>
       )
     } else if (card.eleType === 'splitline') {
+      let _borderWidth = card.borderWidth === undefined ? 1 : card.borderWidth
       return (
         <Col key={card.uuid} span={card.width}>
           <div style={card.style}>
-            <div className="ant-mk-splitline" style={{borderColor: card.color}}></div>
+            <div className="ant-mk-splitline" style={{borderColor: card.color, borderWidth: _borderWidth}}></div>
+          </div>
+        </Col>
+      )
+    } else if (card.eleType === 'barcode') {
+      let val = ''
+
+      if (card.datatype === 'static') {
+        val = card.value
+      } else if (data.hasOwnProperty(card.field)) {
+        val = data[card.field]
+      }
+
+      return (
+        <Col key={card.uuid} span={card.width}>
+          <div style={card.style}>
+            <div style={{height: card.innerHeight || 25}}>
+              {val ? <BarCode card={card} value={val}/> : null}
+            </div>
+          </div>
+        </Col>
+      )
+    } else if (card.eleType === 'qrcode') {
+      let val = ''
+
+      if (card.datatype === 'static') {
+        val = card.value
+      } else if (data.hasOwnProperty(card.field)) {
+        val = data[card.field]
+      }
+
+      return (
+        <Col key={card.uuid} span={card.width}>
+          <div style={card.style}>
+            <div style={{minHeight: card.qrWidth || 50}}>
+              {val ? <QrCode card={card} value={val}/> : null}
+            </div>
+          </div>
+        </Col>
+      )
+    } else if (card.eleType === 'currentDate') {
+      return (
+        <Col key={card.uuid} span={card.width}>
+          <div className="ant-mk-date" style={card.style}>
+            {card.dateFormat ? `${card.prefix || ''}${moment().format(card.dateFormat)}${card.postfix || ''}` : null}
           </div>
         </Col>
       )

--
Gitblit v1.8.0