From 0225695d43c773d16f4d0743ad205590eed58cec Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期一, 08 十一月 2021 21:17:53 +0800 Subject: [PATCH] 2021-11-08 --- src/templates/modalconfig/settingform/index.jsx | 91 +++++++++++++++++++++++++++++++++++++++++---- 1 files changed, 82 insertions(+), 9 deletions(-) diff --git a/src/templates/modalconfig/settingform/index.jsx b/src/templates/modalconfig/settingform/index.jsx index a4ff109..9eea507 100644 --- a/src/templates/modalconfig/settingform/index.jsx +++ b/src/templates/modalconfig/settingform/index.jsx @@ -7,7 +7,6 @@ class SettingForm extends Component { static propTpyes = { - dict: PropTypes.object, // 瀛楀吀椤� config: PropTypes.object, // 琛ㄥ崟閰嶇疆淇℃伅 isSubTab: PropTypes.bool, // 鏄惁涓哄瓙鏍囩 inputSubmit: PropTypes.any // 鍥炶溅鎻愪氦浜嬩欢 @@ -25,7 +24,7 @@ let fields = [] config.fields.forEach(f => { - if (f.field && ['select', 'link', 'text', 'number'].includes(f.type) && f.hidden !== 'true' && f.readonly !== 'true') { + if (f.field && ['select', 'link', 'text', 'number', 'textarea'].includes(f.type) && f.hidden !== 'true' && f.readonly !== 'true') { fields.push(f) } }) @@ -64,7 +63,7 @@ } render() { - const { config, dict } = this.props + const { config } = this.props const { fields, appType, display } = this.state const { getFieldDecorator } = this.props.form @@ -115,19 +114,41 @@ </Form.Item> </Col> : null} <Col span={12}> - <Form.Item label="鐒︾偣"> + <Form.Item label="鍒濆鐒︾偣"> {getFieldDecorator('focus', { initialValue: config.setting.focus || '' })( <Select showSearch + allowClear filterOption={(input, option) => option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0} > - <Select.Option value=""> - {dict['model.empty']} - </Select.Option> {fields.map(option => <Select.Option id={option.uuid} title={option.label} key={option.uuid} value={option.field}> + {option.label} + </Select.Option> + )} + </Select> + )} + </Form.Item> + </Col> + <Col span={12}> + <Form.Item label={ + <Tooltip placement="topLeft" title="鎵ц澶辫触鏃堕渶瑕佽仛鐒︾殑琛ㄥ崟銆�"> + <Icon type="question-circle" /> + 澶辫触鐒︾偣 + </Tooltip> + }> + {getFieldDecorator('errFocus', { + initialValue: config.setting.errFocus || '' + })( + <Select + showSearch + allowClear + filterOption={(input, option) => option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0} + > + {fields.map(option => + <Select.Option key={option.uuid} value={option.uuid}> {option.label} </Select.Option> )} @@ -159,7 +180,7 @@ )} </Form.Item> </Col> - <Col span={12}> + {appType !== 'mob' ? <Col span={12}> <Form.Item label="鐐瑰嚮绌虹櫧澶�"> {getFieldDecorator('clickouter', { initialValue: config.setting.clickouter || 'unclose' @@ -170,9 +191,31 @@ </Radio.Group> )} </Form.Item> + </Col> : null} + <Col span={12}> + <Form.Item label={ + <Tooltip placement="topLeft" title="闇�瑕侀�氳繃鏁版嵁婧愭煡璇㈢殑閫夐」锛屾槸鍚︿娇鐢ㄧ紦瀛樸��"> + <Icon type="question-circle" /> + 閫夐」鏌ヨ + </Tooltip> + }> + {getFieldDecorator('cache', { + initialValue: config.setting.cache || 'true' + })( + <Radio.Group> + <Radio value="true">缂撳瓨</Radio> + <Radio value="false">瀹炴椂</Radio> + </Radio.Group> + )} + </Form.Item> </Col> <Col span={12}> - <Form.Item label="鏄剧ず鏂瑰紡"> + <Form.Item label={ + <Tooltip placement="topLeft" title="鎵撳嵃鎸夐挳涓棤鏁堛��"> + <Icon type="question-circle" /> + 鏄剧ず鏂瑰紡 + </Tooltip> + }> {getFieldDecorator('display', { initialValue: display || 'modal' })( @@ -210,6 +253,18 @@ )} </Form.Item> </Col> : null} + {display === 'drawer' && appType !== 'mob' ? <Col span={12}> + <Form.Item label="琛ㄥ崟绫诲瀷"> + {getFieldDecorator('formType', { + initialValue: config.setting.formType || 'edit' + })( + <Radio.Group style={{whiteSpace: 'nowrap'}}> + <Radio value="edit">缂栬緫</Radio> + <Radio value="check">鏌ョ湅</Radio> + </Radio.Group> + )} + </Form.Item> + </Col> : null} {appType === 'mob' ? <Col span={12}> <Form.Item label="宸﹁竟璺�"> {getFieldDecorator('paddingLeft', { @@ -228,6 +283,24 @@ )} </Form.Item> </Col> : null} + {appType === 'mob' ? <Col span={12}> + <Form.Item label="鎸夐挳鍚嶇О"> + {getFieldDecorator('btnName', { + initialValue: config.setting.btnName || '纭畾' + })(<Input placeholder="" autoComplete="off" onPressEnter={this.handleSubmit} />)} + </Form.Item> + </Col> : null} + {appType === 'mob' ? <Col span={12}> + <Form.Item label="鎸夐挳浣嶇疆"> + {getFieldDecorator('btnPosition', { + initialValue: config.setting.btnPosition || 'bottom' + })( + <Radio.Group style={{whiteSpace: 'nowrap'}}> + <Radio value="bottom">涓嬩晶</Radio> + <Radio value="top">涓婁晶</Radio> + </Radio.Group>)} + </Form.Item> + </Col> : null} </Row> </Form> ) -- Gitblit v1.8.0