From 8040a18c4b2a848d252bf01838f06c7aec1be9f3 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期五, 07 六月 2024 15:16:11 +0800
Subject: [PATCH] 2024-06-07

---
 src/tabviews/custom/components/table/edit-table/normalTable/index.jsx |   24 +++++++++++++++++++-----
 1 files changed, 19 insertions(+), 5 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 5763bcc..916818a 100644
--- a/src/tabviews/custom/components/table/edit-table/normalTable/index.jsx
+++ b/src/tabviews/custom/components/table/edit-table/normalTable/index.jsx
@@ -562,6 +562,10 @@
 
       if (config.noValue === 'hide' && !value) {
         value = 0
+      }
+
+      if (config.required === 'true' && !value) {
+        err = `${config.label}涓嶅彲涓�${config.noValue === 'hide' ? '绌�' : '0'}`
       } else {
         if (typeof(config.max) === 'number' && value > config.max) {
           err = config.label + '鏈�澶т负' + config.max
@@ -1662,7 +1666,9 @@
       } else if (col.type === 'number') {
         let val = record[col.field]
 
-        if (col.noValue === 'hide' && !val) {
+        if (col.required === 'true' && !val) {
+          err = `${col.label}涓嶅彲涓�${col.noValue === 'hide' ? '绌�' : '0'}`
+        } else if (col.noValue === 'hide' && !val) {
           if (col.clearField && checkForms.includes(col.clearField) && !record[col.clearField]) {
             err = `璇峰~鍐� ${col.label} 鎴� ${col.clearName}`
           }
@@ -2279,7 +2285,9 @@
           item[col.field] = val
         } else if (col.type === 'number') {
           let val = item[col.field]
-          if (col.noValue === 'hide' && !val) {
+          if (col.required === 'true' && !val) {
+            err = `${col.label}涓嶅彲涓�${col.noValue === 'hide' ? '绌�' : '0'}`
+          } else if (col.noValue === 'hide' && !val) {
             if (col.clearField && checkForms.includes(col.clearField) && !item[col.clearField]) {
               let msg = `璇峰~鍐� ${col.label} 鎴� ${col.clearName}`
               if (!line.includes(msg)) {
@@ -2645,8 +2653,14 @@
     }
 
     let height = setting.height || false
-    if (height && height <= 100) {
-      height = height + 'vh'
+    if (height) {
+      if (height <= 100) {
+        if (height < 0) {
+          height = `calc(100vh - ${-height}px)`
+        } else {
+          height = height + 'vh'
+        }
+      }
     }
 
     let style = {
@@ -2661,7 +2675,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">鎻愪氦</Button>
         </div> : null}
-        <div className={`edit-custom-table ${setting.tableHeader || ''} ${setting.parity === 'true' ? 'mk-parity' : ''} ${height ? 'fixed-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'}`} style={style}>
           <Table
             rowKey="$$uuid"
             components={components}

--
Gitblit v1.8.0