king
2023-09-07 4b467effbc0e3a9199146573c0ceedf404bd07c5
src/menu/components/share/markcomponent/markform/index.jsx
@@ -8,7 +8,7 @@
class UniqueForm extends Component {
  static propTpyes = {
    dict: PropTypes.object,         // 字典项
    field: PropTypes.any,
    columns: PropTypes.array,       // 列名集合
    signs: PropTypes.array,         // 标记类型
    markChange: PropTypes.func      // 修改函数
@@ -18,13 +18,16 @@
    // 表单提交时检查输入值是否正确
    this.props.form.validateFieldsAndScroll((err, values) => {
      if (!err) {
        if (values.contrastValue) {
          values.contrastValue = values.contrastValue.replace(/\t+|\v+|\s+/g, '')
        }
        this.props.markChange(values)
      }
    })
  }
  render() {
    const { columns, signs } = this.props
    const { columns, signs, field } = this.props
    const { getFieldDecorator } = this.props.form
    const formItemLayout = {
      labelCol: {
@@ -37,17 +40,31 @@
      }
    }
    let initVal = []
    if (field) {
      initVal = [field, 'static']
    }
    return (
      <Form {...formItemLayout} className="normal-table-mark-form">
        <Row gutter={24}>
          <Col span={6}>
            <Form.Item label={'对比字段'}>
              {getFieldDecorator('field', {
                initialValue: [],
                initialValue: initVal,
                rules: [
                  {
                    required: true,
                    message: this.props.dict['form.required.select'] + '对比字段!'
                    message: '请选择对比字段!'
                  },
                  {
                    validator: (rule, value, callback) => {
                      if (value[1] === 'dynamic' && value[0] === value[2]) {
                        callback('对比字段不可相同!')
                      } else {
                        callback()
                      }
                    }
                  }
                ]
              })(
@@ -62,7 +79,7 @@
                rules: [
                  {
                    required: true,
                    message: this.props.dict['form.required.select'] + '对比方式!'
                    message: '请选择对比方式!'
                  }
                ]
              })(
@@ -94,7 +111,7 @@
                rules: [
                  {
                    required: true,
                    message: this.props.dict['form.required.select'] + '颜色!'
                    message: '请选择颜色!'
                  }
                ]
              })(
@@ -109,7 +126,7 @@
                rules: [
                  {
                    required: true,
                    message: this.props.dict['form.required.select'] + '标记方式!'
                    message: '请选择标记方式!'
                  }
                ]
              })(