From 91d2405afa62d2a7d32c6777d41e0e137cbbba81 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期一, 08 一月 2024 16:08:23 +0800
Subject: [PATCH] 2024-01-08

---
 src/tabviews/custom/components/table/edit-table/normalTable/mkPopSelect/index.jsx |    2 +-
 src/menu/components/table/edit-table/columns/editColumn/index.jsx                 |   23 ++++++++++++++++++++++-
 src/menu/components/table/edit-table/columns/editColumn/formconfig.jsx            |   10 ++++++++++
 src/tabviews/custom/components/table/edit-table/normalTable/index.jsx             |   12 +++++++-----
 4 files changed, 40 insertions(+), 7 deletions(-)

diff --git a/src/menu/components/table/edit-table/columns/editColumn/formconfig.jsx b/src/menu/components/table/edit-table/columns/editColumn/formconfig.jsx
index 9f4eb5c..48a01c1 100644
--- a/src/menu/components/table/edit-table/columns/editColumn/formconfig.jsx
+++ b/src/menu/components/table/edit-table/columns/editColumn/formconfig.jsx
@@ -93,6 +93,16 @@
     label: card.label + '锛堜笅涓�琛岋級'
   })
 
+  if (wrap.commit === 'change') {
+    editCols.push({
+      field: '$noActX',
+      label: '鏃犲姩浣�',
+      disabled: card.editType !== 'select'
+    })
+  } else if (card.enter === '$noActX') {
+    card.enter = '$noAct'
+  }
+
   return [
     {
       type: 'text',
diff --git a/src/menu/components/table/edit-table/columns/editColumn/index.jsx b/src/menu/components/table/edit-table/columns/editColumn/index.jsx
index 1077a06..7458ba3 100644
--- a/src/menu/components/table/edit-table/columns/editColumn/index.jsx
+++ b/src/menu/components/table/edit-table/columns/editColumn/index.jsx
@@ -217,6 +217,21 @@
       }
     } else if (key === 'format' && value === 'percent') {
       this.props.form.setFieldsValue({postfix: '%'})
+    } else if (key === 'editType') {
+      let _options = this.getOptions()
+
+      this.setState({
+        formlist: this.state.formlist.map(item => {
+          if (item.key === 'enter' && item.options && item.options[item.options.length - 1].field === '$noActX') {
+            item.options[item.options.length - 1].disabled = value !== 'select'
+          }
+
+          item.initVal = this.record[item.key]
+          item.hidden = !_options.includes(item.key)
+
+          return item
+        })
+      })
     } else if (['editable', 'editType', 'resourceType', 'ctrlField', 'eval', 'Hide', 'IsSort'].includes(key)) {
       let _options = this.getOptions()
 
@@ -331,7 +346,7 @@
           getPopupContainer={() => document.getElementById('edit-table-column-winter')}
         >
           {options.map((option, i) =>
-            <Select.Option key={i} datatype={option.datatype || ''} label={option.label || ''} value={(option.value || option.field || option.MenuID)}>
+            <Select.Option key={i} disabled={option.disabled === true} datatype={option.datatype || ''} label={option.label || ''} value={(option.value || option.field || option.MenuID)}>
               {(option.text || option.label || option.MenuName)}
             </Select.Option>
           )}
@@ -521,6 +536,12 @@
           }
         }
 
+        if (values.type === 'text' && values.editable === 'true') {
+          if (values.editType !== 'select' && values.enter === '$noActX') {
+            values.enter = '$noAct'
+          }
+        }
+
         if (values.dataSource) {
           let pass = checkSQL(values.dataSource)
 
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 3a725fa..0591bea 100644
--- a/src/tabviews/custom/components/table/edit-table/normalTable/index.jsx
+++ b/src/tabviews/custom/components/table/edit-table/normalTable/index.jsx
@@ -55,7 +55,7 @@
 
     this.node.blur()
     
-    if (config.enter === '$noAct') return
+    if (/\$noAct/.test(config.enter)) return
 
     if (/\$next/.test(config.enter)) {
       MKEmitter.emit('nextLine' + config.tableId, lineId, config.enter.replace('$next_', ''))
@@ -191,7 +191,7 @@
 
     this.props.onChange(values)
 
-    if (config.enter === '$noAct') return
+    if (/\$noAct/.test(config.enter)) return
 
     if (/\$next/.test(config.enter)) {
       MKEmitter.emit('nextLine' + config.tableId, lineId, config.enter.replace('$next_', ''))
@@ -283,9 +283,11 @@
 
     this.props.onChange(values, val)
 
+    if (config.enter === '$noActX') return
+
     this.node.blur()
     
-    if (config.enter === '$noAct') return
+    if (/\$noAct/.test(config.enter)) return
 
     setTimeout(() => {
       if (/\$next/.test(config.enter)) {
@@ -408,7 +410,7 @@
 
     this.node.blur()
     
-    if (config.enter === '$noAct') return
+    if (/\$noAct/.test(config.enter)) return
 
     if (/\$next/.test(config.enter)) {
       MKEmitter.emit('nextLine' + config.tableId, lineId, config.enter.replace('$next_', ''))
@@ -536,7 +538,7 @@
 
     this.node.blur()
     
-    if (config.enter === '$noAct') return
+    if (/\$noAct/.test(config.enter)) return
 
     setTimeout(() => {
       if (/\$next/.test(config.enter)) {
diff --git a/src/tabviews/custom/components/table/edit-table/normalTable/mkPopSelect/index.jsx b/src/tabviews/custom/components/table/edit-table/normalTable/mkPopSelect/index.jsx
index 47eb46b..4428a97 100644
--- a/src/tabviews/custom/components/table/edit-table/normalTable/mkPopSelect/index.jsx
+++ b/src/tabviews/custom/components/table/edit-table/normalTable/mkPopSelect/index.jsx
@@ -292,7 +292,7 @@
 
     this.props.onBlur && this.props.onBlur()
 
-    if (config.enter === '$noAct') return
+    if (/\$noAct/.test(config.enter)) return
 
     setTimeout(() => {
       if (/\$next/.test(config.enter)) {

--
Gitblit v1.8.0