From f3167f8371d19d0ea8fe7d0e7af5517ff0b08cd2 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期三, 07 四月 2021 23:25:29 +0800 Subject: [PATCH] 2021-04-07 --- src/templates/modalconfig/settingform/index.jsx | 43 ++++++++++++++++--------------------------- 1 files changed, 16 insertions(+), 27 deletions(-) diff --git a/src/templates/modalconfig/settingform/index.jsx b/src/templates/modalconfig/settingform/index.jsx index c5af7aa..14517aa 100644 --- a/src/templates/modalconfig/settingform/index.jsx +++ b/src/templates/modalconfig/settingform/index.jsx @@ -13,28 +13,19 @@ } state = { - fields: null + fields: null, + appType: sessionStorage.getItem('appType') } UNSAFE_componentWillMount () { const { config } = this.props let fields = [] - if (config.groups.length > 0) { - config.groups.forEach(group => { - group.sublist.forEach(item => { - if (item.field && (item.type === 'text' || item.type === 'number') && item.hidden !== 'true' && item.readonly !== 'true') { - fields.push(item) - } - }) - }) - } else if (config.fields.length > 0) { - config.fields.forEach(f => { - if (f.field && (f.type === 'text' || f.type === 'number') && f.hidden !== 'true' && f.readonly !== 'true') { - fields.push(f) - } - }) - } + config.fields.forEach(f => { + if (f.field && ['select', 'link', 'text', 'number'].includes(f.type) && f.hidden !== 'true' && f.readonly !== 'true') { + fields.push(f) + } + }) this.setState({ fields: fields @@ -65,7 +56,7 @@ render() { const { config, dict } = this.props - const { fields } = this.state + const { fields, appType } = this.state const { getFieldDecorator } = this.props.form const formItemLayout = { @@ -124,16 +115,14 @@ </Form.Item> </Col> <Col span={12}> - <Form.Item label="鍒楁暟"> - {getFieldDecorator('cols', { - initialValue: config.setting.cols || '2' + <Form.Item label="琛ㄥ崟鎺掑垪"> + {getFieldDecorator('align', { + initialValue: config.setting.align || 'left_right' })( - <Select> - <Select.Option value="1">1鍒�</Select.Option> - <Select.Option value="2">2鍒�</Select.Option> - <Select.Option value="3">3鍒�</Select.Option> - <Select.Option value="4">4鍒�</Select.Option> - </Select> + <Radio.Group> + <Radio value="left_right">宸﹀彸</Radio> + <Radio value="up_down">涓婁笅</Radio> + </Radio.Group> )} </Form.Item> </Col> @@ -161,7 +150,7 @@ )} </Form.Item> </Col> - {!this.props.isSubTab ? <Col span={12}> + {!this.props.isSubTab && appType !== 'pc' ? <Col span={12}> <Form.Item label="鎸傝浇瀵硅薄"> {getFieldDecorator('container', { initialValue: config.setting.container || 'tab' -- Gitblit v1.8.0