From 4a424436ea1110a8423b699ea7b67150bc699fda Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期四, 29 二月 2024 18:08:25 +0800
Subject: [PATCH] 2024-02-29

---
 src/menu/components/card/cardcellcomponent/dragaction/card.jsx   |    2 
 src/tabviews/custom/components/card/cardcellList/index.jsx       |    2 
 src/views/printTemplate/index.jsx                                |   53 ++++++++++++++++++++++++++
 src/tabviews/zshare/actionList/newpagebutton/index.jsx           |    2 
 src/views/printTemplate/index.scss                               |    7 +++
 src/templates/zshare/verifycard/index.jsx                        |    2 
 src/menu/components/card/cardcellcomponent/elementform/index.jsx |    2 
 src/menu/urlfieldcomponent/index.jsx                             |    2 
 8 files changed, 65 insertions(+), 7 deletions(-)

diff --git a/src/menu/components/card/cardcellcomponent/dragaction/card.jsx b/src/menu/components/card/cardcellcomponent/dragaction/card.jsx
index 7e4b3aa..7395d2a 100644
--- a/src/menu/components/card/cardcellcomponent/dragaction/card.jsx
+++ b/src/menu/components/card/cardcellcomponent/dragaction/card.jsx
@@ -83,7 +83,7 @@
   const getContent = () => {
     if (card.eleType === 'sequence') {
       return (
-        <div style={{height: card.innerHeight || 'auto'}} className="ant-mk-text">1</div>
+        <div style={{height: card.innerHeight || 'auto'}} className="ant-mk-text">{card.prefix || ''}1{card.postfix || ''}</div>
       )
     } else if (card.eleType === 'text' || card.eleType === 'number') {
       let val = `${card.prefix || ''}${card.datatype === 'static' ? (card.value || '') : (card.field || '')}${card.postfix || ''}`
diff --git a/src/menu/components/card/cardcellcomponent/elementform/index.jsx b/src/menu/components/card/cardcellcomponent/elementform/index.jsx
index 1a96928..8488fd1 100644
--- a/src/menu/components/card/cardcellcomponent/elementform/index.jsx
+++ b/src/menu/components/card/cardcellcomponent/elementform/index.jsx
@@ -14,7 +14,7 @@
 const MkEditIcon = asyncComponent(() => import('@/components/mkIcon'))
 
 const cardTypeOptions = {
-  sequence: ['eleType', 'width'],
+  sequence: ['eleType', 'width', 'prefix', 'postfix'],
   text: ['eleType', 'datatype', 'format', 'width', 'height', 'prefix', 'postfix', 'link', 'anchors', 'noValue', 'bgImage', 'fixStyle', 'copyable', 'alignItems', 'sortField'],
   number: ['eleType', 'datatype', 'width', 'height', 'prefix', 'postfix', 'noValue', 'fixStyle', 'alignItems'],
   picture: ['eleType', 'datatype', 'width', 'lenWidRadio', 'maxWidth', 'link', 'noValue'],
diff --git a/src/menu/urlfieldcomponent/index.jsx b/src/menu/urlfieldcomponent/index.jsx
index 69625a0..a25488e 100644
--- a/src/menu/urlfieldcomponent/index.jsx
+++ b/src/menu/urlfieldcomponent/index.jsx
@@ -63,7 +63,7 @@
     let config = JSON.stringify(this.props.config)
     const _this = this
 
-    if (new RegExp(field, 'ig').test(config)) {
+    if (new RegExp('@' + field + '@', 'ig').test(config)) {
       confirm({
         title: `閰嶇疆涓瓨鍦ˊ${field}@锛岀‘瀹氬垹闄ゅ悧锛焋,
         content: '',
diff --git a/src/tabviews/custom/components/card/cardcellList/index.jsx b/src/tabviews/custom/components/card/cardcellList/index.jsx
index 84fb9b8..c9c2579 100644
--- a/src/tabviews/custom/components/card/cardcellList/index.jsx
+++ b/src/tabviews/custom/components/card/cardcellList/index.jsx
@@ -297,7 +297,7 @@
         contents.push(
           <div className={'ant-col ant-col-' + card.width} key={card.uuid} style={_style_} span={card.width}>
             <div style={card.style}>
-              <div className={'ant-mk-text line1' + className} style={{height: card.innerHeight || 'auto'}}><span className="sequence-wrap" style={_style}>{data.$Index || ''}</span></div>
+              <div className={'ant-mk-text line1' + className} style={{height: card.innerHeight || 'auto'}}><span className="sequence-wrap" style={_style}>{card.prefix || ''}{data.$Index || ''}{card.postfix || ''}</span></div>
             </div>
           </div>
         )
diff --git a/src/tabviews/zshare/actionList/newpagebutton/index.jsx b/src/tabviews/zshare/actionList/newpagebutton/index.jsx
index a3fafce..01d678e 100644
--- a/src/tabviews/zshare/actionList/newpagebutton/index.jsx
+++ b/src/tabviews/zshare/actionList/newpagebutton/index.jsx
@@ -193,7 +193,7 @@
         cancelText: '鏀粯閬囧埌闂',
         onOk() {
           // 鏀粯鍚庡埛鏂扮晫闈�
-          MKEmitter.emit('refreshByButtonResult', btn.$menuId, 'grid', btn)
+          MKEmitter.emit('reloadMenuView', btn.$MenuID)
         },
         onCancel() {
           MKEmitter.emit('refreshByButtonResult', btn.$menuId, 'grid', btn)
diff --git a/src/templates/zshare/verifycard/index.jsx b/src/templates/zshare/verifycard/index.jsx
index 1b7d9be..a824e90 100644
--- a/src/templates/zshare/verifycard/index.jsx
+++ b/src/templates/zshare/verifycard/index.jsx
@@ -1261,7 +1261,7 @@
       verify.scripts.push(values)
     }
 
-    if (/@bvoucher(\s|\))/ig.test(values.sql)) {
+    if (/@bvoucher(\s|\))/ig.test(values.sql) && !/s_BVoucher_Create/ig.test(values.sql)) {
       if (verify.voucher && verify.voucher.enabled) {
 
       } else if (card.Ot !== 'notRequired' && columns) {
diff --git a/src/views/printTemplate/index.jsx b/src/views/printTemplate/index.jsx
index 39c625f..dcb5d22 100644
--- a/src/views/printTemplate/index.jsx
+++ b/src/views/printTemplate/index.jsx
@@ -320,6 +320,9 @@
       if (keyCode === 46 && editItemId && editItemType !== 'Template') {
         this.deleteItem()
       }
+      if (e.ctrlKey && keyCode === 81 && editItemId && editItemType !== 'Template') {
+        this.copyItem()
+      }
     }
   }
 
@@ -706,6 +709,51 @@
     })
   }
 
+  copyItem = () => {
+    const { editItemId, config, fields } = this.state
+
+    let cell = config.elements.filter(item => item.uuid === editItemId)[0]
+
+    if (!cell) return
+
+    let item = {...cell}
+
+    item.left = item.left + parseInt(item.width / 4)
+    item.top = item.top + parseInt(item.height / 4)
+    item.uuid = Utils.getuuid()
+
+    if (item.left + item.width > config.width) {
+      item.left = config.width - item.width
+    }
+    if (item.top + item.height > config.height) {
+      item.top = config.height - item.height
+    }
+
+    let _config = fromJS(config).toJS()
+    
+    _config.elements.push(item)
+
+    let _formlist = []
+    if (item.type === 'text') {
+      _formlist = getTextForm(item, fields)
+    } else if (item.type === 'barcode') {
+      _formlist = getBarcodeForm(item, fields)
+    } else if (item.type === 'qrcode') {
+      _formlist = getQrcodeForm(item, fields)
+    } else if (item.type === 'image') {
+      _formlist = getImageForm(item, fields)
+    }
+
+    this.setState({
+      config: _config,
+      editItemId: item.uuid,
+      editItemType: item.type,
+      formlist: _formlist
+    }, () => {
+      this.resetview()
+    })
+  }
+
   deleteItem = () => {
     const _this = this
     const { editItemId, config } = this.state
@@ -896,7 +944,10 @@
     return (
       <div className="print-template">
         <DndProvider backend={HTML5Backend}>
-          <header className="print-header-container ant-menu-dark">妯℃澘鍒朵綔</header>
+          <header className="print-header-container ant-menu-dark">
+            妯℃澘鍒朵綔
+            <div>蹇嵎閿細Delete锛堝垹闄ゅ厓绱狅級銆乧trl + q锛堝鍒跺厓绱狅級</div>
+          </header>
           <aside className="tools">
             <Card className="tool-bar" title="宸ュ叿鏍�">
               {printItems.map((item, index) => {
diff --git a/src/views/printTemplate/index.scss b/src/views/printTemplate/index.scss
index cd65a0b..0ca8cae 100644
--- a/src/views/printTemplate/index.scss
+++ b/src/views/printTemplate/index.scss
@@ -20,6 +20,13 @@
     text-align: center;
     color: #fff;
     background: #001529;
+
+    div {
+      position: absolute;
+      top: 0px;
+      right: 30px;
+      font-size: 14px;
+    }
   }
   .tools {
     width: 240px;

--
Gitblit v1.8.0