king
2021-04-07 f3167f8371d19d0ea8fe7d0e7af5517ff0b08cd2
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') {
      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'