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 | 17 ++++++++++++----- 1 files changed, 12 insertions(+), 5 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..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,10 +9,10 @@ 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'], + 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'], + 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