From 5c8860f3cd8921e7eb0da7749628e9dc669b3203 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期二, 17 三月 2020 10:19:16 +0800 Subject: [PATCH] 2020-03-17 --- src/templates/tableshare/columnform/index.jsx | 36 ++++++++++++++++++++++++++++-------- 1 files changed, 28 insertions(+), 8 deletions(-) diff --git a/src/templates/tableshare/columnform/index.jsx b/src/templates/tableshare/columnform/index.jsx index 16991dc..9ce8399 100644 --- a/src/templates/tableshare/columnform/index.jsx +++ b/src/templates/tableshare/columnform/index.jsx @@ -18,14 +18,14 @@ UNSAFE_componentWillMount () { let _type = this.props.formlist.filter(form => form.key === 'type')[0].initVal - let _options = ['label', 'field', 'type', 'Align', 'Hide', 'IsSort', 'Width', 'fieldlength'] + let _options = ['label', 'field', 'type', 'Align', 'Hide', 'IsSort', 'Width', 'fieldlength', 'blacklist'] if (_type === 'text') { - _options = ['label', 'field', 'type', 'Align', 'Hide', 'IsSort', 'Width', 'prefix', 'postfix', 'matchVal', 'color', 'fieldlength'] + _options = ['label', 'field', 'type', 'Align', 'Hide', 'IsSort', 'Width', 'prefix', 'postfix', 'matchVal', 'color', 'fieldlength', 'blacklist'] } else if (_type === 'number') { - _options = ['label', 'field', 'type', 'Align', 'Hide', 'IsSort', 'Width', 'decimal', 'format', 'prefix', 'postfix', 'match', 'matchVal', 'color'] + _options = ['label', 'field', 'type', 'Align', 'Hide', 'IsSort', 'Width', 'decimal', 'format', 'prefix', 'postfix', 'match', 'matchVal', 'color', 'blacklist'] } else if (_type === 'textarea') { - _options = ['label', 'field', 'type', 'Align', 'Hide', 'IsSort', 'Width', 'prefix', 'postfix', 'matchVal', 'color', 'fieldlength'] + _options = ['label', 'field', 'type', 'Align', 'Hide', 'IsSort', 'Width', 'prefix', 'postfix', 'matchVal', 'color', 'fieldlength', 'blacklist'] } this.setState({ @@ -56,14 +56,14 @@ typeChange = (key, value) => { if (key === 'type') { - let _options = ['label', 'field', 'type', 'Align', 'Hide', 'IsSort', 'Width', 'fieldlength'] + let _options = ['label', 'field', 'type', 'Align', 'Hide', 'IsSort', 'Width', 'fieldlength', 'blacklist'] if (value === 'text') { - _options = ['label', 'field', 'type', 'Align', 'Hide', 'IsSort', 'Width', 'prefix', 'postfix', 'matchVal', 'color', 'fieldlength'] + _options = ['label', 'field', 'type', 'Align', 'Hide', 'IsSort', 'Width', 'prefix', 'postfix', 'matchVal', 'color', 'fieldlength', 'blacklist'] } else if (value === 'number') { - _options = ['label', 'field', 'type', 'Align', 'Hide', 'IsSort', 'Width', 'decimal', 'format', 'prefix', 'postfix', 'match', 'matchVal', 'color'] + _options = ['label', 'field', 'type', 'Align', 'Hide', 'IsSort', 'Width', 'decimal', 'format', 'prefix', 'postfix', 'match', 'matchVal', 'color', 'blacklist'] } else if (value === 'textarea') { - _options = ['label', 'field', 'type', 'Align', 'Hide', 'IsSort', 'Width', 'prefix', 'postfix', 'matchVal', 'color', 'fieldlength'] + _options = ['label', 'field', 'type', 'Align', 'Hide', 'IsSort', 'Width', 'prefix', 'postfix', 'matchVal', 'color', 'fieldlength', 'blacklist'] } this.setState({ @@ -222,6 +222,26 @@ </Form.Item> </Col> ) + } else if (item.type === 'multiselect') { // 澶氶�� + fields.push( + <Col span={12} key={index}> + <Form.Item label={item.label}> + {getFieldDecorator(item.key, { + initialValue: item.initVal || [] + })( + <Select + showSearch + mode="multiple" + filterOption={(input, option) => option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0} + > + {item.options.map((option, i) => + <Select.Option id={i} key={i} value={option.value}>{option.text}</Select.Option> + )} + </Select> + )} + </Form.Item> + </Col> + ) } }) return fields -- Gitblit v1.8.0