From 01a88094eaa183714ed7490ca7b85fee1e7bb064 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期六, 20 五月 2023 23:03:41 +0800
Subject: [PATCH] 2023-05-20

---
 src/tabviews/zshare/mutilform/index.jsx               |    3 +
 src/templates/zshare/modalform/index.jsx              |    2 
 src/templates/zshare/formconfig.jsx                   |   14 +++++++
 src/templates/zshare/verifycard/baseform/index.jsx    |   38 +++++++++++++++---
 src/tabviews/zshare/actionList/normalbutton/index.jsx |   13 ++++--
 src/utils/utils.js                                    |    6 ++
 src/menu/components/share/actioncomponent/index.jsx   |    2 
 src/tabviews/zshare/actionList/printbutton/index.jsx  |    3 +
 8 files changed, 65 insertions(+), 16 deletions(-)

diff --git a/src/menu/components/share/actioncomponent/index.jsx b/src/menu/components/share/actioncomponent/index.jsx
index 9e48add..71fd65a 100644
--- a/src/menu/components/share/actioncomponent/index.jsx
+++ b/src/menu/components/share/actioncomponent/index.jsx
@@ -406,7 +406,7 @@
           } else {
             btn.style = item.style || {}
             if (btn.class) {
-              if (btn.class !== item.class || btn.show !== item.show || !btn.style.color || item.focus) {
+              if (btn.class !== item.class || btn.show !== item.show || !btn.style.color || (item.focus && !btn.style.color)) {
                 if (btn.show === 'icon') {
                   btn.style.color = color[btn.class]
                   btn.style.backgroundColor = 'transparent'
diff --git a/src/tabviews/zshare/actionList/normalbutton/index.jsx b/src/tabviews/zshare/actionList/normalbutton/index.jsx
index 457964c..8a351f8 100644
--- a/src/tabviews/zshare/actionList/normalbutton/index.jsx
+++ b/src/tabviews/zshare/actionList/normalbutton/index.jsx
@@ -868,7 +868,11 @@
           if (/'/.test(val)) {
             val = val.replace(/'/ig, '"')
           }
-          _initFormfields.push(`@${_key}='${val}'`)
+          if (form.isconst) {
+            _initFormfields.push(`@${_key}=N'${val}'`)
+          } else {
+            _initFormfields.push(`@${_key}='${val}'`)
+          }
         }
       }
       
@@ -2125,7 +2129,7 @@
     param.secretkey = Utils.encrypt(param.LText, param.timestamp)
 
     Api.genericInterface(param).then(res => {
-      // res.send_data = [{openid: 'o2E7gvoSFvQRG7I8_gZxf4y3ONkQ', send_id: '245dd33344', first: '鎮ㄧ殑缂磋垂淇℃伅濡備笅', p1: '010000000001', p2: '2022骞�07鏈�03鏃�', p3: '渚涙殩缂磋垂', p4: '20鍏�', p5: '鎴愬姛', remark: '鎰熻阿鎮ㄧ殑浣跨敤锛�'}]
+      res.send_data = [{openid: 'o2E7gvoSFvQRG7I8_gZxf4y3ONkQ', send_id: Utils.getuuid(), first: '鎮ㄧ殑缂磋垂淇℃伅濡備笅', p1: '010000000001', p2: '2022骞�07鏈�03鏃�', p3: '渚涙殩缂磋垂', p4: '20鍏�', p5: '鎴愬姛', remark: '鎰熻阿鎮ㄧ殑浣跨敤锛�'}]
       if (!res.status) {
         notification.warning({
           top: 92,
@@ -2162,7 +2166,7 @@
       }
       
       verify.wxNoteKeys.forEach(item => {
-        _param.data[item.key] = {value: '', color: '#000000'}
+        _param.data[item.key] = {value: ''}
       })
 
       let params = sends.map(item => {
@@ -2608,7 +2612,8 @@
         fieldlen: item.fieldlength || 50,
         writein: item.writein !== 'false',
         type: item.type,
-        value: item.initval
+        value: item.initval,
+        isconst: item.constant === 'true'
       }
 
       let key = item.field.toLowerCase()
diff --git a/src/tabviews/zshare/actionList/printbutton/index.jsx b/src/tabviews/zshare/actionList/printbutton/index.jsx
index 367bec1..2bbfe85 100644
--- a/src/tabviews/zshare/actionList/printbutton/index.jsx
+++ b/src/tabviews/zshare/actionList/printbutton/index.jsx
@@ -2127,7 +2127,8 @@
         fieldlen: item.fieldlength || 50,
         writein: item.writein !== 'false',
         type: item.type,
-        value: item.initval
+        value: item.initval,
+        isconst: item.constant === 'true'
       }
 
       let key = item.field.toLowerCase()
diff --git a/src/tabviews/zshare/mutilform/index.jsx b/src/tabviews/zshare/mutilform/index.jsx
index eec20bd..88e321e 100644
--- a/src/tabviews/zshare/mutilform/index.jsx
+++ b/src/tabviews/zshare/mutilform/index.jsx
@@ -1073,7 +1073,8 @@
             readin: item.readin,
             writein: item.writein,
             fieldlen: item.fieldlength,
-            key: item.field
+            key: item.field,
+            isconst: item.constant === 'true'
           }
     
           _item.value = record[item.field] !== undefined ? record[item.field] : ''
diff --git a/src/templates/zshare/formconfig.jsx b/src/templates/zshare/formconfig.jsx
index 750ad13..bd96bbb 100644
--- a/src/templates/zshare/formconfig.jsx
+++ b/src/templates/zshare/formconfig.jsx
@@ -3729,6 +3729,20 @@
     },
     {
       type: 'radio',
+      key: 'constant',
+      label: 'Unicode甯搁噺',
+      tooltip: '浣跨敤鏃跺皢鍦ㄦ彁浜ゅ唴瀹瑰墠鍔犱笂 N锛屼唬琛ㄥ瓨鍏ユ暟鎹簱鏃朵互 Unicode 鏍煎紡瀛樺偍銆�',
+      initVal: card.constant || 'false',
+      options: [{
+        value: 'true',
+        text: '浣跨敤'
+      }, {
+        value: 'false',
+        text: '涓嶄娇鐢�'
+      }]
+    },
+    {
+      type: 'radio',
       key: 'sendType',
       label: '鍙戦�佹柟寮�',
       initVal: card.sendType || 'local',
diff --git a/src/templates/zshare/modalform/index.jsx b/src/templates/zshare/modalform/index.jsx
index 4c6d8f7..335f222 100644
--- a/src/templates/zshare/modalform/index.jsx
+++ b/src/templates/zshare/modalform/index.jsx
@@ -19,7 +19,7 @@
 const MkEditIcon = asyncComponent(() => import('@/components/mkIcon'))
 
 const modalTypeOptions = {
-  text: ['initval', 'readonly', 'required', 'hidden', 'readin', 'fieldlength', 'regular', 'interception', 'span', 'labelwidth', 'encryption', 'tooltip', 'extra', 'enter', 'cursor', 'scan', 'splitline', 'placeholder', 'place', 'marginTop', 'marginBottom', 'lenControl', 'inputType'],
+  text: ['initval', 'readonly', 'required', 'hidden', 'readin', 'fieldlength', 'regular', 'interception', 'span', 'labelwidth', 'encryption', 'tooltip', 'extra', 'enter', 'cursor', 'scan', 'splitline', 'placeholder', 'place', 'marginTop', 'marginBottom', 'lenControl', 'inputType', 'constant'],
   number: ['initval', 'readonly', 'hidden', 'decimal', 'min', 'max', 'readin', 'span', 'labelwidth', 'tooltip', 'extra', 'enter', 'cursor', 'splitline', 'place', 'marginTop', 'marginBottom'],
   select: ['initval', 'readonly', 'required', 'hidden', 'readin', 'resourceType', 'declare', 'setAll', 'linkSubField', 'span', 'labelwidth', 'tooltip', 'extra', 'place', 'emptyText', 'enter', 'splitline', 'dropdown', 'marginTop', 'marginBottom', 'pickerMode'],
   checkbox: ['initval', 'readonly', 'required', 'hidden', 'readin', 'resourceType', 'fieldlength', 'span', 'labelwidth', 'tooltip', 'extra', 'place', 'splitline', 'arrange', 'marginTop', 'marginBottom'],
diff --git a/src/templates/zshare/verifycard/baseform/index.jsx b/src/templates/zshare/verifycard/baseform/index.jsx
index 7910852..606b0a8 100644
--- a/src/templates/zshare/verifycard/baseform/index.jsx
+++ b/src/templates/zshare/verifycard/baseform/index.jsx
@@ -7,6 +7,8 @@
 import Api from '@/api'
 import './index.scss'
 
+const sysTempsIds = ['8IFltwzyKcu15iA8fqSyb6m-pMa88a3ZTu0No3vDHgo', 'LOB-bbt9jVncGh7IOAUdESh1Sgzcbt62UwOqSqcK9ok']
+
 class BillCodeForm extends Component {
   static propTpyes = {
     card: PropTypes.object,
@@ -35,7 +37,7 @@
             let temps = []
             if (res.template_list) {
               temps = res.template_list.filter(item => {
-                if (!item.primary_industry) return false
+                if (!item.primary_industry || sysTempsIds.includes(item.template_id)) return false
                 if (item.content) {
                   item.content = item.content.replace('{{first.DATA}}\n', '').replace('\n{{remark.DATA}}', '')
                 }
@@ -79,10 +81,33 @@
   resetTemps = (wxTemps) => {
     const { verify } = this.props
 
-    let sysTemps = [{"template_id":"UdGBwbjFKnIBzW2TalsdJkwZ9R2LvaAozWZ-yo2Dn00","title":"缂磋垂閫氱煡","primary_industry":"IT绉戞妧","deputy_industry":"IT杞欢涓庢湇鍔�","content":"{{first.DATA}}\n鍙楃悊缂栧彿锛歿{keyword1.DATA}}\n缂磋垂鏃堕棿锛歿{keyword2.DATA}}\n缂磋垂绫诲埆锛歿{keyword3.DATA}}\n缂磋垂閲戦锛歿{keyword4.DATA}}\n缂磋垂缁撴灉锛歿{keyword5.DATA}}\n{{remark.DATA}}","example":"鎮ㄧ殑缂磋垂淇℃伅濡備笅\r\n鍙楃悊缂栧彿锛�010000000001\r\n缂磋垂鏃堕棿锛�2018骞�07鏈�23鏃r\n缂磋垂绫诲埆锛氫緵鏆栫即璐筡r\n缂磋垂閲戦锛�20鍏僜r\n缂磋垂缁撴灉锛氭垚鍔焅r\n鎰熻阿鎮ㄧ殑浣跨敤锛�"}]
+    let sysTemps = [
+      // {
+      //   template_id: '8IFltwzyKcu15iA8fqSyb6m-pMa88a3ZTu0No3vDHgo',
+      //   title: '璁㈠崟鍙楃悊閫氱煡锛堟槑绉戜簯锛�',
+      //   primary_industry: 'IT绉戞妧',
+      //   deputy_industry: 'IT杞欢涓庢湇鍔�',
+      //   content: '璁㈠崟鍙凤細{{keyword1.DATA}}\n璁㈠崟绫诲瀷锛歿{keyword2.DATA}}\n璁㈠崟鐘舵�侊細{{keyword3.DATA}}\n閫氱煡鏃堕棿锛歿{keyword4.DATA}}',
+      //   example: '璁㈠崟鍙凤細20190101001\r\n璁㈠崟绫诲瀷锛氳。鏌淺r\n璁㈠崟鐘舵�侊細璁捐瀹屾垚\r\n閫氱煡鏃堕棿锛�2019骞�1鏈�1鏃�12:30'
+      // },
+      // {
+      //   template_id: 'LOB-bbt9jVncGh7IOAUdESh1Sgzcbt62UwOqSqcK9ok',
+      //   title: '璁㈠崟杩涘害鎻愰啋锛堟槑绉戜簯锛�',
+      //   primary_industry: 'IT绉戞妧',
+      //   deputy_industry: 'IT杞欢涓庢湇鍔�',
+      //   content: '璁㈠崟绫诲瀷锛歿{keyword1.DATA}}\n璁㈠崟鍙凤細{{keyword2.DATA}}\n璁㈠崟鐘舵�侊細{{keyword3.DATA}}',
+      //   example: '璁㈠崟绫诲瀷锛氶��绉熺敵璇穃r\n璁㈠崟鍙凤細TZ16101909\r\n璁㈠崟鐘舵�侊細寰呭彇璐�'
+      // },
+      // {
+      //   template_id: 'mk_category_temp',
+      //   title: '绫荤洰妯℃澘',
+      //   primary_industry: '',
+      //   deputy_industry: '',
+      //   content: '',
+      //   example: ''
+      // }
+    ]
     
-    sysTemps = []
-
     let _wxTemps = [...wxTemps, ...sysTemps]
 
     let selectTemp = _wxTemps.filter(item => item.template_id === verify.wxTemplateId)[0]
@@ -109,7 +134,6 @@
       } else if (verify.wxNoteLink === 'url' && !verify.wxNoteLinkUrl) {
         error = '璇峰~鍐欑綉鍧�锛�'
       }
-
     }
 
     return error
@@ -164,7 +188,7 @@
     const { verify } = this.props
 
     let _verify = {...verify, wxTemplateId: val}
-    let selectTemp = {content: option.props.content.replace(/\r\n|\n/g, '<br/>'), example: option.props.example.replace(/\r\n|\n/g, '<br/>')}
+    let selectTemp = {template_id: val, content: option.props.content.replace(/\r\n|\n/g, '<br/>'), example: option.props.example.replace(/\r\n|\n/g, '<br/>')}
 
     let keys = []
     if (option.props.content) {
@@ -413,7 +437,7 @@
               </Select>
             </Form.Item>
           </Col>) : null}
-          {selectTemp && verify.wxNoteKeys ? <Col span={24} className="wx-note">
+          {selectTemp && selectTemp.template_id !== 'mk_category_temp' && verify.wxNoteKeys ? <Col span={24} className="wx-note">
             <div className="note-wrap">
               <div className="note">
                 <p>鍐呭绀轰緥</p>
diff --git a/src/utils/utils.js b/src/utils/utils.js
index ba54ce5..630fc57 100644
--- a/src/utils/utils.js
+++ b/src/utils/utils.js
@@ -1488,7 +1488,11 @@
         if (/'/.test(val)) {
           val = val.replace(/'/ig, '"')
         }
-        _initFormfields.push(`@${_key}='${val}'`)
+        if (form.isconst) {
+          _initFormfields.push(`@${_key}=N'${val}'`)
+        } else {
+          _initFormfields.push(`@${_key}='${val}'`)
+        }
       }
     }
     

--
Gitblit v1.8.0