From 0227c25e4ed573d3095ada3f9c9a4ba5f18b0de5 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期三, 20 一月 2021 10:53:01 +0800
Subject: [PATCH] 2021-01-20

---
 src/menu/components/table/normal-table/columns/editColumn/index.jsx |   13 ++++++++++---
 1 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/src/menu/components/table/normal-table/columns/editColumn/index.jsx b/src/menu/components/table/normal-table/columns/editColumn/index.jsx
index d3f4fcd..4d355d9 100644
--- a/src/menu/components/table/normal-table/columns/editColumn/index.jsx
+++ b/src/menu/components/table/normal-table/columns/editColumn/index.jsx
@@ -9,7 +9,7 @@
 
 const columnTypeOptions = {
   text: ['label', 'field', 'type', 'Align', 'Hide', 'IsSort', 'Width', 'prefix', 'postfix', 'textFormat', 'blacklist', 'perspective', 'rowspan'],
-  number: ['label', 'field', 'type', 'Align', 'Hide', 'IsSort', 'Width', 'decimal', 'format', 'prefix', 'postfix', 'blacklist', 'perspective', 'sum'],
+  number: ['label', 'field', 'type', 'Align', 'Hide', 'IsSort', 'Width', 'decimal', 'format', 'prefix', 'postfix', 'blacklist', 'perspective', 'sum', 'rowspan'],
   link: ['label', 'field', 'type', 'Align', 'Hide', 'IsSort', 'joint', 'Width', 'blacklist', 'nameField'],
   textarea: ['label', 'field', 'type', 'Align', 'Hide', 'IsSort', 'Width', 'prefix', 'postfix', 'blacklist'],
   picture: ['label', 'field', 'type', 'Align', 'Hide', 'IsSort', 'Width', 'blacklist', 'scale', 'lenWidRadio', 'picSort'],
@@ -107,6 +107,13 @@
       })
     } else if (key === 'field') {
       this.props.form.setFieldsValue({label: option.props.children})
+      if (this.state.type === 'number') {
+        let decimal = 0
+        if (/Decimal/ig.test(option.props.datatype)) {
+          decimal = +option.props.datatype.replace(/Decimal\(18,/ig, '').replace(')', '')
+        }
+        this.props.form.setFieldsValue({decimal})
+      }
     } else if (key === 'format' && value === 'percent') {
       this.props.form.setFieldsValue({postfix: '%'})
     }
@@ -140,7 +147,7 @@
     if (!formlist) return null
 
     formlist.forEach((item, index) => {
-      if (item.hidden) return
+      if (item.hidden || item.forbidden) return
 
       if (item.type === 'text') { // 鏂囨湰鎼滅储
         let rules = []
@@ -213,7 +220,7 @@
                   getPopupContainer={() => document.getElementById('columnwinter')}
                 >
                   {item.options.map((option, index) =>
-                    <Select.Option key={`${option.value || option.field}${index}`} value={option.value || option.field}>
+                    <Select.Option key={`${option.value || option.field}${index}`} datatype={option.datatype || ''} value={option.value || option.field}>
                       {option.text || option.label}
                     </Select.Option>
                   )}

--
Gitblit v1.8.0