From 2ccd33975abf91f9a7929ca8ed6fc03d74ee424d Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期六, 08 十月 2022 10:10:07 +0800 Subject: [PATCH] 2022-10-08 --- src/menu/components/table/normal-table/columns/editColumn/index.jsx | 30 +++++++++++++++++++----------- 1 files changed, 19 insertions(+), 11 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 b360aaa..907ebb2 100644 --- a/src/menu/components/table/normal-table/columns/editColumn/index.jsx +++ b/src/menu/components/table/normal-table/columns/editColumn/index.jsx @@ -14,7 +14,7 @@ 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'], + picture: ['label', 'field', 'type', 'Align', 'Hide', 'IsSort', 'Width', 'blacklist', 'scale', 'lenWidRadio', 'span'], colspan: ['label', 'type', 'Align', 'Hide', 'blacklist'], custom: ['label', 'type', 'Align', 'Hide', 'Width', 'blacklist'], action: ['label', 'type', 'Align', 'Width'], @@ -44,7 +44,14 @@ } editColumn = (column) => { - let formlist = getColumnForm(column, this.props.fields) + let fields = fromJS(this.props.fields).toJS().map(item => { + if (item.label.toLowerCase() !== item.field.toLowerCase()) { + item.text = item.label + '锛�' + item.field + '锛�' + } + return item + }) + + let formlist = getColumnForm(column, fields) let _options = fromJS(columnTypeOptions[column.type]).toJS() if (column.type === 'text' || column.type === 'number') { if (column.perspective === 'linkmenu') { @@ -62,16 +69,17 @@ return item }) - }, () => { - if (column.focus) { + }) + if (column.focus) { + setTimeout(() => { try { let _form = document.getElementById('label') _form && _form.select() } catch (e) { console.warn('琛ㄥ崟focus澶辫触锛�') } - } - }) + }, 200) + } } typeChange = (key, value, option) => { @@ -95,7 +103,7 @@ } }) } else if (key === 'field') { - let values = {label: option.props.children} + let values = {label: option.props.label || option.props.children} if (/Decimal|int/ig.test(option.props.datatype)) { let decimal = 0 if (/Decimal/ig.test(option.props.datatype)) { @@ -159,7 +167,7 @@ formlist.forEach((item, index) => { if (item.hidden || item.forbidden) return - if (item.type === 'text') { // 鏂囨湰鎼滅储 + if (item.type === 'text') { let rules = [] if (item.key !== 'linkurl') { rules = [{ @@ -230,7 +238,7 @@ getPopupContainer={() => document.getElementById('columnwinter')} > {item.options.map((option, index) => - <Select.Option key={index} datatype={option.datatype || ''} value={(option.value || option.field || option.MenuID)}> + <Select.Option key={index} datatype={option.datatype || ''} label={option.label || ''} value={(option.value || option.field || option.MenuID)}> {(option.text || option.label || option.MenuName)} </Select.Option> )} @@ -312,7 +320,7 @@ </Form.Item> </Col> ) - } else if (item.type === 'textarea') { // 鏂囨湰鎼滅储 + } else if (item.type === 'textarea') { fields.push( <Col span={24} key={index} className="textarea"> <Form.Item label={item.tooltip ? @@ -372,7 +380,7 @@ <Modal title="鏄剧ず鍒楃紪杈�" visible={visible} - width={800} + width={850} maskClosable={false} onOk={this.handleSubmit} onCancel={this.editModalCancel} -- Gitblit v1.8.0