From 9282e645d0205f85bf0d424a0b2f5c42c2aae1d9 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期三, 21 五月 2025 11:40:32 +0800
Subject: [PATCH] 2025-05-21

---
 src/tabviews/custom/components/table/edit-table/normalTable/index.jsx |   67 +++++++++++++++++++++++----------
 1 files changed, 46 insertions(+), 21 deletions(-)

diff --git a/src/tabviews/custom/components/table/edit-table/normalTable/index.jsx b/src/tabviews/custom/components/table/edit-table/normalTable/index.jsx
index 03add13..8415ed3 100644
--- a/src/tabviews/custom/components/table/edit-table/normalTable/index.jsx
+++ b/src/tabviews/custom/components/table/edit-table/normalTable/index.jsx
@@ -20,7 +20,6 @@
 
 class MkSwitch extends Component {
   static propTpyes = {
-    autoFocus: PropTypes.bool,
     defaultValue: PropTypes.any,
     config: PropTypes.object,
     onChange: PropTypes.func
@@ -78,12 +77,10 @@
     if (config.$ctrl) {
       MKEmitter.emit('colBlur' + config.tableId, lineId, config.uuid)
     }
-
-    this.props.onBlur && this.props.onBlur()
   }
 
   render() {
-    const { config, autoFocus } = this.props
+    const { config } = this.props
     const { status } = this.state
 
     return (
@@ -91,7 +88,6 @@
         ref={ref => this.node = ref}
         checkedChildren={config.openText}
         checked={status}
-        autoFocus={autoFocus}
         onFocus={this.onFocus}
         onBlur={this.onBlur}
         unCheckedChildren={config.closeText}
@@ -763,7 +759,7 @@
         content = `${record[col.field]}`
       }
 
-      if (col.editType === 'select' && col.options.length > 0) {
+      if (col.editType === 'select' && col.showValue !== 'value' && col.options.length > 0) {
         content = col.map.get(content) || content
       } else if (col.editType === 'switch') {
         if (content === col.openVal) {
@@ -820,16 +816,17 @@
       }
 
       if (col.editable === 'true' && !disabled) {
-        if (editing) {
+        if (col.editType === 'switch') {
+          let _value = record[col.field] !== undefined ? record[col.field] : ''
+          return (<td onClick={(e) => e.stopPropagation()} className="editing_table_cell">
+            <MkSwitch config={col} lineId={record.$$uuid} defaultValue={_value} onChange={this.onColChange}/>
+          </td>)
+        } else if (editing) {
           let _value = record[col.field] !== undefined ? record[col.field] : ''
 
           if (!col.editType || col.editType === 'text') {
             return (<td onClick={(e) => e.stopPropagation()} className="editing_table_cell">
               <MkInput config={col} lineId={record.$$uuid} defaultValue={_value} autoFocus={true} onChange={this.onColChange} onBlur={() => this.setState({editing: false})}/>
-            </td>)
-          } else if (col.editType === 'switch') {
-            return (<td onClick={(e) => e.stopPropagation()} className="editing_table_cell">
-              <MkSwitch config={col} lineId={record.$$uuid} defaultValue={_value} autoFocus={true} onChange={this.onColChange} onBlur={() => this.setState({editing: false})}/>
             </td>)
           } else if (col.editType === 'date') {
             return (<td onClick={(e) => e.stopPropagation()} className="editing_table_cell">
@@ -964,6 +961,15 @@
           content = ''
         }
       } else {
+        if (col.eval === 'false' && col.noValue === 'hide') { // 绌哄�奸殣钘�
+          Object.keys(record).forEach(key => {
+            if (/^\$/.test(key)) return
+            if (record[key]) return
+
+            content = content.replace(new RegExp('[^@]*@' + key + '@', 'ig'), '')
+          })
+        }
+
         Object.keys(record).forEach(key => {
           let reg = new RegExp('@' + key + '@', 'ig')
           content = content.replace(reg, record[key])
@@ -1090,7 +1096,7 @@
           )
         } else if (col.editType === 'switch') {
           children = (
-            <MkSwitch config={col} lineId={record.$$uuid} defaultValue={_value} autoFocus={false} onChange={this.onColChange}/>
+            <MkSwitch config={col} lineId={record.$$uuid} defaultValue={_value} onChange={this.onColChange}/>
           )
         } else if (col.editType === 'date') {
           children = (
@@ -1116,7 +1122,7 @@
           content = `${record[col.field]}`
         }
 
-        if (col.editType === 'select' && col.options.length > 0) {
+        if (col.editType === 'select' && col.showValue !== 'value' && col.options.length > 0) {
           content = col.map.get(content) || content
         } else if (col.editType === 'switch') {
           if (content === col.openVal) {
@@ -1286,6 +1292,15 @@
           content = ''
         }
       } else {
+        if (col.eval === 'false' && col.noValue === 'hide') { // 绌哄�奸殣钘�
+          Object.keys(record).forEach(key => {
+            if (/^\$/.test(key)) return
+            if (record[key]) return
+
+            content = content.replace(new RegExp('[^@]*@' + key + '@', 'ig'), '')
+          })
+        }
+        
         Object.keys(record).forEach(key => {
           let reg = new RegExp('@' + key + '@', 'ig')
           content = content.replace(reg, record[key])
@@ -1968,7 +1983,7 @@
       deffers.push(
         new Promise(resolve => {
           Api.getSystemCacheConfig(param, false).then(res => {
-            if (!res.status) {
+            if (!res.status && res.ErrCode !== '-2') {
               notification.warning({
                 top: 92,
                 message: res.message,
@@ -2007,7 +2022,7 @@
       deffers.push(
         new Promise(resolve => {
           Api.getSystemCacheConfig(mainparam, false).then(res => {
-            if (!res.status) {
+            if (!res.status && res.ErrCode !== '-2') {
               notification.warning({
                 top: 92,
                 message: res.message,
@@ -2102,7 +2117,7 @@
     deffers = deffers.map(item => {
       return new Promise(resolve => {
         Api.getSystemCacheConfig(item, false).then(res => {
-          if (!res.status) {
+          if (!res.status && res.ErrCode !== '-2') {
             notification.warning({
               top: 92,
               message: res.message,
@@ -2121,6 +2136,12 @@
       delete result.ErrMesg
       delete result.message
       delete result.status
+
+      this.props.columns.forEach(item => {
+        if (item.arr_field && result[item.field]) {
+          result[item.uuid] = result[item.field]
+        }
+      })
 
       this.resetFormList(result)
     })
@@ -2487,7 +2508,7 @@
     if (setting.supModule && !BID) {
       notification.warning({
         top: 92,
-        message: dict['sup_key_req'] || '闇�瑕佷笂绾т富閿�硷紒',
+        message: setting.supModTip || dict['sup_key_req'] || '闇�瑕佷笂绾т富閿�硷紒',
         duration: 5
       })
 
@@ -2523,7 +2544,7 @@
         this.execError({})
       })
     } else if (submit.intertype === 'system') { // 绯荤粺瀛樺偍杩囩▼
-      let result = getEditTableSql(submit, data, forms)
+      let result = getEditTableSql(submit, data, forms, setting)
       let param = {}
 
       param.func = 'sPC_TableData_InUpDe'
@@ -2552,7 +2573,7 @@
         this.execError({})
       })
     } else if (submit.intertype === 'inner' && submit.innerFunc) { // 鑷畾涔夊瓨鍌ㄨ繃绋�
-      let result = getEditTableSql(submit, data, forms)
+      let result = getEditTableSql(submit, data, forms, setting)
       let param = {}
 
       param.func = submit.innerFunc
@@ -2607,7 +2628,11 @@
     let lines = data.map(item => {
       let vals = []
       forms.forEach(col => {
-        vals.push(item[col.field])
+        if (typeof(item[col.field]) === 'number') {
+          vals.push(item[col.field] + '')
+        } else {
+          vals.push(item[col.field])
+        }
       })
   
       vals.push(item.$$uuid)
@@ -2902,7 +2927,7 @@
         {setting.hasSubmit && edData.length > 0 ? <div className="edit-custom-table-btn-wrap" style={submit.wrapStyle}>
           <Button style={submit.style} onClick={() => setTimeout(() => {this.submit()}, 10)} loading={loading} className="submit-table" type="link">{dict['submit'] || '鎻愪氦'}</Button>
         </div> : null}
-        <div className={`edit-custom-table ${setting.tableHeader || ''} ${setting.parity === 'true' ? 'mk-parity' : ''} ${height ? 'fixed-table-height' : ''} ${setting.mode || ''} table-vertical-${setting.vertical || ''} mk-edit-${setting.editType || 'simple'}`} style={style}>
+        <div className={`edit-custom-table ${setting.tableHeader || ''} ${setting.parity === 'true' ? 'mk-parity' : ''} ${height ? 'fixed-table-height' : ''} ${setting.mode || ''} table-vertical-${setting.vertical || ''} mk-edit-${setting.editType || 'simple'} ${setting.empSign === 'hidden' ? 'mk-empty-hide' : ''}`} style={style}>
           <Table
             rowKey="$$uuid"
             components={components}

--
Gitblit v1.8.0