From 4fcad7ab9334897449360194848cec1c998973df Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期一, 18 一月 2021 17:49:16 +0800
Subject: [PATCH] 2021-01-18

---
 src/tabviews/zshare/mutilform/index.jsx |   56 ++++++++++++--------------------------------------------
 1 files changed, 12 insertions(+), 44 deletions(-)

diff --git a/src/tabviews/zshare/mutilform/index.jsx b/src/tabviews/zshare/mutilform/index.jsx
index ba0cddb..9f9e96c 100644
--- a/src/tabviews/zshare/mutilform/index.jsx
+++ b/src/tabviews/zshare/mutilform/index.jsx
@@ -12,10 +12,10 @@
 import './index.scss'
 
 const { MonthPicker } = DatePicker
-const { TextArea } = Input
 
 const CheckCard = asyncComponent(() => import('./checkCard'))
 const CustomSwitch = asyncComponent(() => import('./customSwitch'))
+const CustomTextArea = asyncComponent(() => import('./customTextArea'))
 const FileUpload = asyncComponent(() => import('../fileupload'))
 const ColorSketch = asyncComponent(() => import('@/mob/colorsketch'))
 const Editor = asyncComponent(() => import('@/components/editor'))
@@ -39,7 +39,6 @@
     writein: null,   // 鎵ц鏃舵槸鍚﹀~鍏ラ粯璁ql
     fieldlen: null,  // 瀛楁闀垮害
     formlist: [],    // 琛ㄥ崟椤�
-    encrypts: [],    // 鍔犲瘑瀛楁
     intercepts: [],  // 鎴彇瀛楁
     record: {}       // 璁板綍涓嬫媺琛ㄥ崟鍏宠仈瀛楁锛岀敤浜庢暟鎹啓鍏�
   }
@@ -68,7 +67,6 @@
     let writein = {}
     let fieldlen = {}
     let formlist = []
-    let encrypts = []
     let intercepts = []
     let _inputfields = []
 
@@ -99,9 +97,6 @@
         _inputfields.push(item.field)
       } else if (item.type === 'textarea') {
         _inputfields.push(item.field)
-        if (item.encryption === 'true') {                                // 鍔犲瘑瀛楁
-          encrypts.push(item.field)
-        }
       } else if (item.type === 'link') {
         linkFields[item.linkField] = linkFields[item.linkField] || []
         linkFields[item.linkField].push(item.field)
@@ -200,14 +195,7 @@
         }
       }
 
-      // 鍔犲瘑瀛楁锛岃В瀵嗗鐞�
-      if (item.type === 'textarea' && item.encryption === 'true' && newval !== '') {
-        try {
-          newval = window.decodeURIComponent(window.atob(newval))
-        } catch (e) {
-          console.warn(e)
-        }
-      } else if (item.type === 'switch' && newval !== '') { // 寮�鍏冲彧鎺ユ敹鍥哄畾鍊�
+      if (item.type === 'switch' && newval !== '') { // 寮�鍏冲彧鎺ユ敹鍥哄畾鍊�
         if (newval !== item.closeVal && newval !== item.openVal) {
           newval = ''
         } else if (newval === item.openVal) {
@@ -260,14 +248,13 @@
     })
 
     this.setState({
-      readtype: readtype,
-      datatype: datatype,
-      readin: readin,
-      writein: writein,
-      fieldlen: fieldlen,
-      encrypts: encrypts,
-      intercepts: intercepts,
-      formlist: formlist
+      readin,
+      writein,
+      readtype,
+      datatype,
+      fieldlen,
+      intercepts,
+      formlist
     }, () => {
       if (action.setting && action.setting.focus) {
         this.selectInput(action.setting.focus, 'init')
@@ -1182,7 +1169,7 @@
                   },
                   ..._rules
                 ]
-              })(<TextArea autoSize={{ minRows: 2, maxRows: item.maxRows || 6 }} disabled={item.readonly === 'true'} />)}
+              })(<CustomTextArea Item={item} />)}
             </Form.Item>
           </Col>
         )
@@ -1198,7 +1185,7 @@
               </Tooltip> : item.label
             }>
               {getFieldDecorator(item.field, {
-                initialValue: item.initval || null,
+                initialValue: item.initval || '',
                 rules: [
                   {
                     required: item.required === 'true',
@@ -1209,7 +1196,7 @@
                     message: formRule.input.formMessage.replace('@max', _max)
                   }
                 ]
-              })(<Editor />)}
+              })(<Editor Item={item}/>)}
             </Form.Item>
           </Col>
         )
@@ -1221,7 +1208,6 @@
 
   handleConfirm = () => {
     const { record, intercepts, writein } = this.state
-    let _encrypts = fromJS(this.state.encrypts).toJS()
     let _format = {
       date: 'YYYY-MM-DD',
       datemonth: 'YYYY-MM',
@@ -1252,7 +1238,6 @@
               let _val = item.initval
               if (record.hasOwnProperty(item.field)) {
                 _val = record[item.field]
-                _encrypts = _encrypts.filter(_field => _field !== item.field) // 闅愯棌瀛楁锛屼笉鍙備笌鍔犲瘑澶勭悊
               }
               
               _item = {
@@ -1353,23 +1338,6 @@
               value: _value
             })
           })
-
-          // 鍚湁鍔犲瘑瀛楁鏃讹紝瀵硅〃鍗曞�艰繘琛屽姞瀵�
-          if (_encrypts && _encrypts.length > 0) {
-            search = search.map(item => {
-              let _value = item.value
-              if (_encrypts.includes(item.key)) {
-                try {
-                  _value = window.btoa(window.encodeURIComponent(_value))
-                } catch (e) {
-                  console.warn(e)
-                }
-              }
-              item.value = _value
-
-              return item
-            })
-          }
 
           resolve(search)
         } else {

--
Gitblit v1.8.0