king
2021-11-08 0225695d43c773d16f4d0743ad205590eed58cec
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>
    )