From eebe63a6727e6495321d1433ebd2779b5a36d45a Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期四, 31 十二月 2020 22:08:14 +0800
Subject: [PATCH] 2020-12-31

---
 src/menu/components/table/normal-table/columns/editColumn/index.jsx |   15 +++++++++++----
 1 files changed, 11 insertions(+), 4 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 2c86c2c..6725e03 100644
--- a/src/menu/components/table/normal-table/columns/editColumn/index.jsx
+++ b/src/menu/components/table/normal-table/columns/editColumn/index.jsx
@@ -10,9 +10,9 @@
 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'],
-  link: ['label', 'field', 'type', 'Align', 'Hide', 'IsSort', 'joint', 'Width', 'blacklist'],
+  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'],
+  picture: ['label', 'field', 'type', 'Align', 'Hide', 'IsSort', 'Width', 'blacklist', 'scale', 'lenWidRadio', 'picSort'],
   colspan: ['label', 'type', 'Align', 'Hide', 'blacklist'],
   custom: ['label', 'type', 'Align', 'Hide', 'Width', 'blacklist'],
   action: ['label', 'type', 'Align', 'Width']
@@ -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={`${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