From c6d0dcdccdb898e1abcdb7fb8312d3b7b653743f Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期二, 16 八月 2022 01:34:18 +0800
Subject: [PATCH] 2022-08-16

---
 src/tabviews/zshare/mutilform/index.jsx                           |   31 +++++++++++----
 src/tabviews/zshare/actionList/normalbutton/index.jsx             |   42 ++++++++++++++++----
 src/tabviews/custom/components/timeline/normal-timeline/index.jsx |    9 +++-
 src/tabviews/zshare/actionList/printbutton/index.jsx              |   33 +++++++++++++---
 4 files changed, 88 insertions(+), 27 deletions(-)

diff --git a/src/tabviews/custom/components/timeline/normal-timeline/index.jsx b/src/tabviews/custom/components/timeline/normal-timeline/index.jsx
index 51dcbef..2cd51ef 100644
--- a/src/tabviews/custom/components/timeline/normal-timeline/index.jsx
+++ b/src/tabviews/custom/components/timeline/normal-timeline/index.jsx
@@ -27,7 +27,8 @@
     sync: false,               // 鏄惁缁熶竴璇锋眰鏁版嵁
     data: null,                // 鏁版嵁
     BData: '',
-    card: null
+    card: null,
+    description: false
   }
 
   /**
@@ -322,6 +323,8 @@
           message: '鏈幏鍙栧埌蹇�掍俊鎭�',
           duration: 10
         })
+      } else if (/鏌ヨ鏃犵粨鏋�/.test(res)) {
+        this.setState({description: res, data: [], loading: false})
       } else {
         let data = res.split(/\n/).filter(Boolean)
 
@@ -429,7 +432,7 @@
   }
 
   render() {
-    const { config, loading, data } = this.state
+    const { config, loading, data, description } = this.state
 
     return (
       <div className="normal-timeline-box" id={'anchor' + config.uuid} style={{...config.style}}>
@@ -447,7 +450,7 @@
           {data.map(item => this.getMknodes(item))}
         </div> : null}
         {data && data.length === 0 ? <div className="card-row-list" style={{height: config.wrap.contentHeight}}>
-          <Empty description={false}/>
+          <Empty description={description}/>
         </div> : null}
       </div>
     )
diff --git a/src/tabviews/zshare/actionList/normalbutton/index.jsx b/src/tabviews/zshare/actionList/normalbutton/index.jsx
index d58c19e..087de55 100644
--- a/src/tabviews/zshare/actionList/normalbutton/index.jsx
+++ b/src/tabviews/zshare/actionList/normalbutton/index.jsx
@@ -606,9 +606,13 @@
           param.LText = Utils.formatOptions(param.LText)
         } else if (btn.OpenType === 'pop') { // 琛ㄥ崟
           if (index !== 0) {
+            let _cell = {}
+            Object.keys(cell).forEach(key => {
+              _cell[key.toLowerCase()] = cell[key]
+            })
             formdata = formdata.map(_data => {
-              if (_data.readin && cell.hasOwnProperty(_data.key)) {
-                _data.value = cell[_data.key]
+              if (_data.readin && _cell.hasOwnProperty(_data.key.toLowerCase())) {
+                _data.value = _cell[_data.key.toLowerCase()]
               }
               return _data
             })
@@ -741,9 +745,13 @@
 
         if (btn.OpenType === 'pop') { // 琛ㄥ崟
           if (index !== 0) {
+            let _cell = {}
+            Object.keys(cell).forEach(key => {
+              _cell[key.toLowerCase()] = cell[key]
+            })
             formdata = formdata.map(_data => {
-              if (_data.readin && cell.hasOwnProperty(_data.key)) {
-                _data.value = cell[_data.key]
+              if (_data.readin && _cell.hasOwnProperty(_data.key.toLowerCase())) {
+                _data.value = _cell[_data.key.toLowerCase()]
               }
               return _data
             })
@@ -2237,11 +2245,25 @@
   }
 
   modelconfirm = () => {
-    const { BData, btn } = this.props
+    const { btn } = this.props
     const { btnconfig, selines } = this.state
     let _this = this
 
     let result = []
+    let _data = {}
+    let BData = {}
+
+    if (selines[0]) {
+      Object.keys(selines[0]).forEach(key => {
+        _data[key.toLowerCase()] = selines[0][key]
+      })
+    }
+    if (this.props.BData) {
+      Object.keys(this.props.BData).forEach(key => {
+        BData[key.toLowerCase()] = this.props.BData[key]
+      })
+    }
+
     btnconfig.fields.forEach(item => {
       if (!item.field) return
       let _readin = item.readin !== 'false'
@@ -2251,10 +2273,12 @@
         _readin = false
       }
 
-      if (item.type === 'linkMain' && BData && BData.hasOwnProperty(item.field)) {
-        _initval = BData[item.field]
-      } else if (_readin && selines[0] && selines[0].hasOwnProperty(item.field)) {
-        _initval = selines[0][item.field]
+      let key = item.field.toLowerCase()
+
+      if (item.type === 'linkMain' && BData.hasOwnProperty(key)) {
+        _initval = BData[key]
+      } else if (_readin && _data.hasOwnProperty(key)) {
+        _initval = _data[key]
       } else if (item.type === 'date' && _initval) {
         _initval = moment().subtract(_initval, 'days').format('YYYY-MM-DD')
       } else if (item.type === 'datemonth' && _initval) {
diff --git a/src/tabviews/zshare/actionList/printbutton/index.jsx b/src/tabviews/zshare/actionList/printbutton/index.jsx
index ff0cd12..8eeb0c5 100644
--- a/src/tabviews/zshare/actionList/printbutton/index.jsx
+++ b/src/tabviews/zshare/actionList/printbutton/index.jsx
@@ -726,9 +726,16 @@
             _param[setting.primaryKey] = cell[setting.primaryKey]
           }
 
+          let _cell = {}
+          if (index !== 0) {
+            Object.keys(cell).forEach(key => {
+              _cell[key.toLowerCase()] = cell[key]
+            })
+          }
+
           formlist.forEach(_data => {
-            if (index !== 0 && _data.readin && cell.hasOwnProperty(_data.key)) {
-              _param[_data.key] = cell[_data.key]
+            if (index !== 0 && _data.readin && _cell.hasOwnProperty(_data.key.toLowerCase())) {
+              _param[_data.key] = _cell[_data.key.toLowerCase()]
             } else {
               _param[_data.key] = _data.value
             }
@@ -1519,10 +1526,22 @@
   }
 
   modelconfirm = () => {
-    const { BData } = this.props
     const { btnconfig, selines } = this.state
     let _this = this
     let result = []
+    let _data = {}
+    let BData = {}
+
+    if (selines[0]) {
+      Object.keys(selines[0]).forEach(key => {
+        _data[key.toLowerCase()] = selines[0][key]
+      })
+    }
+    if (this.props.BData) {
+      Object.keys(this.props.BData).forEach(key => {
+        BData[key.toLowerCase()] = this.props.BData[key]
+      })
+    }
     
     btnconfig.fields.forEach(item => {
       if (!item.field) return
@@ -1533,10 +1552,10 @@
         _readin = false
       }
 
-      if (item.type === 'linkMain' && BData && BData.hasOwnProperty(item.field)) {
-        _initval = BData[item.field]
-      } else if (_readin && selines[0] && selines[0].hasOwnProperty(item.field)) {
-        _initval = selines[0][item.field]
+      if (item.type === 'linkMain' && BData.hasOwnProperty(item.field.toLowerCase())) {
+        _initval = BData[item.field.toLowerCase()]
+      } else if (_readin && _data.hasOwnProperty(item.field.toLowerCase())) {
+        _initval = _data[item.field.toLowerCase()]
       } else if (item.type === 'date' && _initval) {
         _initval = moment().subtract(_initval, 'days').format('YYYY-MM-DD')
       } else if (item.type === 'datemonth' && _initval) {
diff --git a/src/tabviews/zshare/mutilform/index.jsx b/src/tabviews/zshare/mutilform/index.jsx
index ffb77bc..c2b9648 100644
--- a/src/tabviews/zshare/mutilform/index.jsx
+++ b/src/tabviews/zshare/mutilform/index.jsx
@@ -45,8 +45,10 @@
   record = {}
 
   componentDidMount () {
-    const { data, BData, action } = this.props
+    const { action } = this.props
 
+    let data = {}
+    let BData = {}
     let linkFields = {} // 鍏宠仈鑿滃崟
     let controlFields = {} // 鎺у埗琛ㄥ崟
     let deForms = []    // 闇�瑕佸姩鎬佽幏鍙栦笅鎷夎彍鍗曠殑琛ㄥ崟
@@ -55,6 +57,17 @@
     let formlist = fromJS(action.fields).toJS()
     let fieldMap = new Map()
     let check = action.setting.formType === 'check'
+
+    if (this.props.data) {
+      Object.keys(this.props.data).forEach(key => {
+        data[key.toLowerCase()] = this.props.data[key]
+      })
+    }
+    if (this.props.BData) {
+      Object.keys(this.props.BData).forEach(key => {
+        BData[key.toLowerCase()] = this.props.BData[key]
+      })
+    }
 
     formlist = formlist.filter(item => {
       if (item.supField) { // 澶氬眰琛ㄥ崟鎺у埗
@@ -87,8 +100,8 @@
 
       if (item.type === 'split' || item.type === 'formula') return true
       if (item.type === 'hint') {
-        if (item.field && data && data[item.field]) {
-          item.message = data[item.field]
+        if (item.field && data[item.field.toLowerCase()]) {
+          item.message = data[item.field.toLowerCase()]
         }
         delete item.field
         return true
@@ -113,6 +126,8 @@
       item.writein = item.writein !== 'false'
       item.hidden = item.hidden === 'true'
       item.fieldlength = item.fieldlength || 50
+
+      let key = item.field.toLowerCase()
 
       if (item.type === 'funcvar') {
         readin = false
@@ -145,11 +160,11 @@
 
       let newval = '$empty'
 
-      if (readin && data && data.hasOwnProperty(item.field)) {
-        newval = data[item.field]
+      if (readin && data.hasOwnProperty(key)) {
+        newval = data[key]
       }
       if (item.type === 'linkMain') {
-        newval = BData && BData[item.field] ? BData[item.field] : '$empty'
+        newval = BData[key] || '$empty'
       } else if (item.type === 'date') { // 鏃堕棿鎼滅储
         let format = 'YYYY-MM-DD'
         let _format = 'YYYY-MM-DD HH:mm:ss'
@@ -423,8 +438,8 @@
 
         if (fieldMap.has(item.linkField)) {
           item.supInitVal = fieldMap.get(item.linkField).initval || ''
-        } else if (data && data.hasOwnProperty(item.linkField)) {
-          item.supInitVal = data[item.linkField]
+        } else if (data.hasOwnProperty(item.linkField.toLowerCase())) {
+          item.supInitVal = data[item.linkField.toLowerCase()]
         }
         
         item.options = item.oriOptions.filter(option => option.ParentID === item.supInitVal || option.value === '')

--
Gitblit v1.8.0