king
2020-04-14 5e10a7ee4a5ef882d6b0d92b19b1a888ffcc6f7f
src/templates/zshare/tabform/index.jsx
@@ -113,9 +113,23 @@
      if (item.hidden) return
      if (item.type === 'text') { // 文本搜索
        let rules = []
        if (item.key === 'foreignKey') {
          rules.push({
            pattern: /^[a-zA-Z_]*$/ig,
            message: item.label + '字段只允许包含字母及下划线!'
          })
        }
        fields.push(
          <Col span={12} key={index}>
            <Form.Item label={item.label}>
            <Form.Item label={
              item.tooltip ?
              <Tooltip placement="topLeft" title={item.tooltip}>
                <Icon type="question-circle" />
                {item.label}
              </Tooltip> : item.label
            }>
              {getFieldDecorator(item.key, {
                initialValue: item.initVal,
                rules: [
@@ -126,7 +140,8 @@
                  {
                    max: formRule.input.max,
                    message: formRule.input.message
                  }
                  },
                  ...rules
                ]
              })(<Input placeholder="" autoComplete="off" disabled={item.readonly} onPressEnter={this.handleSubmit} />)}
            </Form.Item>
@@ -164,10 +179,11 @@
        fields.push(
          <Col span={12} key={index}>
            <Form.Item label={
              <Tooltip placement="topLeft" title="标签添加同级标签后,标签中按钮刷新主表时,添加的同级标签会刷新。">
              item.tooltip ?
              <Tooltip placement="topLeft" title={item.tooltip}>
                <Icon type="question-circle" />
                {item.label}
              </Tooltip>
              </Tooltip> : item.label
            }>
              {getFieldDecorator(item.key, {
                initialValue: item.initVal