From 4f29ad0f9800313ea239064a1b5aab663a794674 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期三, 22 五月 2024 17:55:43 +0800
Subject: [PATCH] 2024-05-22

---
 src/templates/modalconfig/index.jsx                    |   22 ----------
 src/menu/modalconfig/index.scss                        |    6 ---
 src/menu/modalconfig/index.jsx                         |   20 ----------
 src/mob/modalconfig/index.jsx                          |   20 ----------
 src/templates/modalconfig/settingform/index.jsx        |   12 -----
 src/mob/modalconfig/index.scss                         |    6 ---
 src/mob/searchconfig/index.scss                        |    6 ---
 src/templates/modalconfig/dragelement/index.scss       |    6 ---
 src/utils/utils.js                                     |   14 +++++--
 src/menu/components/table/edit-table/columns/index.jsx |    5 --
 10 files changed, 12 insertions(+), 105 deletions(-)

diff --git a/src/menu/components/table/edit-table/columns/index.jsx b/src/menu/components/table/edit-table/columns/index.jsx
index b410cc8..120c12b 100644
--- a/src/menu/components/table/edit-table/columns/index.jsx
+++ b/src/menu/components/table/edit-table/columns/index.jsx
@@ -637,10 +637,6 @@
     })
   }
 
-  componentDidMount () {
-    MKEmitter.addListener('submitStyle', this.getStyle)
-  }
-
   /**
    * @description 缁勪欢閿�姣侊紝娓呴櫎state鏇存柊锛屾竻闄ゅ揩鎹烽敭璁剧疆
    */
@@ -648,7 +644,6 @@
     this.setState = () => {
       return
     }
-    MKEmitter.removeListener('submitStyle', this.getStyle)
   }
 
   handlecolumns = (columns, fields, config, pId) => {
diff --git a/src/menu/modalconfig/index.jsx b/src/menu/modalconfig/index.jsx
index 6388269..3ffa871 100644
--- a/src/menu/modalconfig/index.jsx
+++ b/src/menu/modalconfig/index.jsx
@@ -61,7 +61,6 @@
 
   componentDidMount () {
     MKEmitter.addListener('completeSave', this.completeSave)
-    MKEmitter.addListener('submitStyle', this.getStyle)
   }
 
   /**
@@ -72,7 +71,6 @@
       return
     }
     MKEmitter.removeListener('completeSave', this.completeSave)
-    MKEmitter.removeListener('submitStyle', this.getStyle)
   }
 
   /**
@@ -197,24 +195,6 @@
       visible: true,
       card: card,
       formlist: getModalForm(card, _inputfields, _tabfields, _linkableFields, _linksupFields, columns)
-    })
-  }
-
-  getStyle = (comIds, style) => {
-    const { config } = this.state
-
-    if (comIds[0] !== 'form') return
-
-    let Index = config.fields.findIndex(n => n.uuid === comIds[1])
-
-    if (Index === -1) return
-    
-    let _config = fromJS(config).toJS()
-
-    _config.fields[Index].style = style
-
-    this.setState({
-      config: _config
     })
   }
 
diff --git a/src/menu/modalconfig/index.scss b/src/menu/modalconfig/index.scss
index 3de73e1..af280fa 100644
--- a/src/menu/modalconfig/index.scss
+++ b/src/menu/modalconfig/index.scss
@@ -254,12 +254,6 @@
               opacity: 0;
               z-index: 1;
             }
-            .ant-col-cuslabel {
-              width: 10.5%;
-            }
-            .ant-col-cuswrap {
-              width: 89.5%;
-            }
           }
         }
         .ant-calendar-picker {
diff --git a/src/mob/modalconfig/index.jsx b/src/mob/modalconfig/index.jsx
index 803af96..1fe5aaf 100644
--- a/src/mob/modalconfig/index.jsx
+++ b/src/mob/modalconfig/index.jsx
@@ -59,7 +59,6 @@
 
   componentDidMount () {
     window.GLOB.formId = ''
-    MKEmitter.addListener('submitStyle', this.getStyle)
     MKEmitter.addListener('completeSave', this.completeSave)
   }
 
@@ -70,30 +69,11 @@
     this.setState = () => {
       return
     }
-    MKEmitter.removeListener('submitStyle', this.getStyle)
     MKEmitter.removeListener('completeSave', this.completeSave)
   }
 
   completeSave = () => {
     this.setState({saving: false})
-  }
-
-  getStyle = (comIds, style) => {
-    const { config } = this.state
-
-    if (comIds[0] !== 'form') return
-
-    let Index = config.fields.findIndex(n => n.uuid === comIds[1])
-
-    if (Index === -1) return
-    
-    let _config = fromJS(config).toJS()
-
-    _config.fields[Index].style = style
-
-    this.setState({
-      config: _config
-    })
   }
 
   /**
diff --git a/src/mob/modalconfig/index.scss b/src/mob/modalconfig/index.scss
index d4fbaa9..67a0528 100644
--- a/src/mob/modalconfig/index.scss
+++ b/src/mob/modalconfig/index.scss
@@ -233,12 +233,6 @@
               opacity: 0;
               z-index: 1;
             }
-            .ant-col-cuslabel {
-              width: 10.5%;
-            }
-            .ant-col-cuswrap {
-              width: 89.5%;
-            }
           }
         }
         .ant-calendar-picker {
diff --git a/src/mob/searchconfig/index.scss b/src/mob/searchconfig/index.scss
index de9d1a3..659c627 100644
--- a/src/mob/searchconfig/index.scss
+++ b/src/mob/searchconfig/index.scss
@@ -258,12 +258,6 @@
               opacity: 0;
               z-index: 1;
             }
-            .ant-col-cuslabel {
-              width: 10.5%;
-            }
-            .ant-col-cuswrap {
-              width: 89.5%;
-            }
           }
         }
         .ant-calendar-picker {
diff --git a/src/templates/modalconfig/dragelement/index.scss b/src/templates/modalconfig/dragelement/index.scss
index 742699b..e19cce3 100644
--- a/src/templates/modalconfig/dragelement/index.scss
+++ b/src/templates/modalconfig/dragelement/index.scss
@@ -128,12 +128,6 @@
       opacity: 0;
       z-index: 1;
     }
-    .ant-col-cuslabel {
-      width: 10.5%;
-    }
-    .ant-col-cuswrap {
-      width: 89.5%;
-    }
   }
   .ant-form-item label > .anticon {
     vertical-align: middle;
diff --git a/src/templates/modalconfig/index.jsx b/src/templates/modalconfig/index.jsx
index 3f2571f..6887eca 100644
--- a/src/templates/modalconfig/index.jsx
+++ b/src/templates/modalconfig/index.jsx
@@ -14,7 +14,6 @@
 import asyncComponent from '@/utils/asyncComponent'
 import { BaseConfig, SearchItems } from './source'
 import { updateForm } from '@/utils/utils-update.js'
-import MKEmitter from '@/utils/events.js'
 import './index.scss'
 
 const { Panel } = Collapse
@@ -124,7 +123,7 @@
 
   componentDidMount() {
     window.GLOB.formId = ''
-    MKEmitter.addListener('submitStyle', this.getStyle)
+
     document.onkeydown = (event) => {
       let e = event || window.event
       let keyCode = e.keyCode || e.which || e.charCode
@@ -157,7 +156,6 @@
    * @description 缁勪欢閿�姣侊紝娓呴櫎state鏇存柊
    */
   componentWillUnmount () {
-    MKEmitter.removeListener('submitStyle', this.getStyle)
     this.setState = () => {
       return
     }
@@ -184,24 +182,6 @@
     }
 
     this.props.handleView(param)
-  }
-
-  getStyle = (comIds, style) => {
-    const { config } = this.state
-
-    if (comIds[0] !== 'form') return
-
-    let Index = config.fields.findIndex(n => n.uuid === comIds[1])
-
-    if (Index === -1) return
-    
-    let _config = fromJS(config).toJS()
-
-    _config.fields[Index].style = style
-
-    this.setState({
-      config: _config
-    })
   }
 
   /**
diff --git a/src/templates/modalconfig/settingform/index.jsx b/src/templates/modalconfig/settingform/index.jsx
index 7baf400..9d141c3 100644
--- a/src/templates/modalconfig/settingform/index.jsx
+++ b/src/templates/modalconfig/settingform/index.jsx
@@ -25,25 +25,16 @@
     icon: this.props.config.setting.icon || '',
     appType: sessionStorage.getItem('appType'),
     viewType: sessionStorage.getItem('editMenuType') || '',
-    dialogInput: false
   }
 
   UNSAFE_componentWillMount () {
     const { config } = this.props
     const { appType, display } = this.state
     let fields = []
-    let dialogInput = null
 
     config.fields.forEach(f => {
       if (f.field && ['select', 'link', 'text', 'number', 'textarea'].includes(f.type) && f.hidden !== 'true' && f.readonly !== 'true') {
         fields.push(f)
-      }
-      if (f.field && f.hidden !== 'true' && f.readonly !== 'true') {
-        if (dialogInput === null) {
-          dialogInput = ['text', 'number'].includes(f.type)
-        } else {
-          dialogInput = false
-        }
       }
     })
 
@@ -56,8 +47,7 @@
 
     this.setState({
       fields: fields,
-      display: _display,
-      dialogInput
+      display: _display
     })
   }
 
diff --git a/src/utils/utils.js b/src/utils/utils.js
index be865dc..02050a4 100644
--- a/src/utils/utils.js
+++ b/src/utils/utils.js
@@ -1048,12 +1048,18 @@
           }
         } else if (typeof(val) === 'string') {
           val = val.replace(/(^\s+$)|\t+|\v+/ig, '')
-          if (!val && col.required === 'true') {           // 鏃堕棿蹇呭~鏍¢獙
-            errors.push(_position + '鍐呭涓嶅彲涓虹┖')
-          } else if (val && !/^[1-9][0-9]{3}/.test(val)) { // 鏃堕棿姝e垯鏍¢獙
+          if (!val) {
+            if (col.required === 'true') {         // 鏃堕棿蹇呭~鏍¢獙
+              errors.push(_position + '鍐呭涓嶅彲涓虹┖')
+            } else if (col.type === 'date') {
+              val = '1949-10-01'
+            } else if (col.type === 'datetime') {
+              val = '1949-10-01 00:00:00'
+            }
+          } else if (!/^[1-9][0-9]{3}/.test(val)) { // 鏃堕棿姝e垯鏍¢獙
             errors.push(_position + '鏃堕棿鏍煎紡閿欒')
           }
-        } else {                                           // 鏃堕棿鏍煎紡閿欒
+        } else {                                    // 鏃堕棿鏍煎紡閿欒
           errors.push(_position + '鏃堕棿鏍煎紡閿欒')
         }
       }

--
Gitblit v1.8.0