From 6dd965723be9dc245105296198c25a80cfe51b54 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期四, 27 四月 2023 10:51:50 +0800 Subject: [PATCH] 2023-04-27 --- src/menu/components/table/edit-table/columns/editColumn/index.jsx | 27 ++++++++++++++++----------- 1 files changed, 16 insertions(+), 11 deletions(-) diff --git a/src/menu/components/table/edit-table/columns/editColumn/index.jsx b/src/menu/components/table/edit-table/columns/editColumn/index.jsx index e445b43..ba7f32b 100644 --- a/src/menu/components/table/edit-table/columns/editColumn/index.jsx +++ b/src/menu/components/table/edit-table/columns/editColumn/index.jsx @@ -16,7 +16,7 @@ text: ['label', 'field', 'type', 'Align', 'Hide', 'IsSort', 'Width', 'prefix', 'postfix', 'textFormat', 'editable', 'initval', 'blacklist'], number: ['label', 'field', 'type', 'Align', 'Hide', 'IsSort', 'Width', 'decimal', 'format', 'prefix', 'postfix', 'editable', 'initval', 'sum', 'blacklist'], textarea: ['label', 'field', 'type', 'Align', 'Hide', 'Width', 'prefix', 'initval', 'postfix', 'blacklist'], - custom: ['label', 'type', 'Align', 'Hide', 'Width', 'blacklist'], + custom: ['label', 'type', 'Align', 'Width', 'blacklist'], colspan: ['label', 'type', 'Align', 'Hide', 'blacklist'], action: ['label', 'type', 'Align', 'Width'], formula: ['label', 'type', 'Align', 'Hide', 'Width', 'prefix', 'postfix', 'eval', 'formula', 'blacklist'], @@ -60,6 +60,10 @@ let _options = fromJS(columnTypeOptions[this.column.type]).toJS() if (this.column.editable === 'true') { + _options.push('ctrlField') + if (this.column.ctrlField) { + _options.push('ctrlValue') + } if (this.column.type === 'text') { _options.push('editType') @@ -170,7 +174,7 @@ } } else if (key === 'format' && value === 'percent') { this.props.form.setFieldsValue({postfix: '%'}) - } else if (key === 'editable' || key === 'editType' || key === 'resourceType') { + } else if (key === 'editable' || key === 'editType' || key === 'resourceType' || key === 'ctrlField') { let _options = this.getOptions() this.setState({ @@ -350,18 +354,19 @@ } handleSubmit = () => { - // const { columns } = this.props // 琛ㄥ崟鎻愪氦鏃舵鏌ヨ緭鍏ュ�兼槸鍚︽纭� this.props.form.validateFieldsAndScroll((err, values) => { if (!err) { - // if (values.field && columns.filter(col => col.field && col.uuid !== values.uuid && col.field === values.field).length > 0) { - // notification.warning({ - // top: 92, - // message: '瀛楁宸叉坊鍔狅紒', - // duration: 5 - // }) - // return - // } + if (values.type === 'number' && values.editable === 'true') { + if (typeof(values.max) === 'number' && typeof(values.min) === 'number' && values.max < values.min) { + notification.warning({ + top: 92, + message: '鏈�澶у�间笉鍙皬浜庢渶灏忓�硷紒', + duration: 5 + }) + return + } + } this.setState({visible: false, formlist: null}) this.props.submitCol(values) -- Gitblit v1.8.0