import _extends from "@babel/runtime/helpers/extends";
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/objectWithoutPropertiesLoose";
import _inheritsLoose from "@babel/runtime/helpers/inheritsLoose";
import _Form from "@alifd/next/es/form";
var _excluded = ["displayName", "isRequired", "fieldName", "style", "formField"];
//这是过滤器字段
import React from 'react';
import RenderChild from "../common-table/components/render-child";
import { bizCssPrefix } from "../../variables";
import "./index.scss";
// import BizItem from '../field/biz-item';
var FormItem = _Form.Item;
var FilterField = /*#__PURE__*/function (_React$Component) {
  _inheritsLoose(FilterField, _React$Component);
  function FilterField(props) {
    var _this;
    _this = _React$Component.call(this, props) || this;
    _this.onChange = function (value) {
      console.log(value);
    };
    _this.state = {
      value: ''
    };
    return _this;
  }
  var _proto = FilterField.prototype;
  _proto.render = function render() {
    var _this$props = this.props,
      displayName = _this$props.displayName,
      isRequired = _this$props.isRequired,
      fieldName = _this$props.fieldName,
      style = _this$props.style,
      formField = _this$props.formField,
      otherProps = _objectWithoutPropertiesLoose(_this$props, _excluded);
    // console.log(formField)
    var init = formField.init,
      getValue = formField.getValue;
    var formItemLayout = {
      labelCol: {
        span: 8
      },
      wrapperCol: {
        span: 14
      }
    };
    var labelAlign = 'left';
    return /*#__PURE__*/React.createElement(FormItem, _extends({
      className: bizCssPrefix + '-filter-field',
      style: style,
      colon: true,
      hasFeedback: true,
      name: fieldName
    }, formItemLayout, {
      labelAlign: labelAlign,
      label: displayName,
      required: isRequired,
      requiredMessage: "\u8BF7\u8F93\u5165" + displayName
    }), /*#__PURE__*/React.createElement(RenderChild, _extends({}, init(fieldName, {
      rules: {
        required: isRequired,
        message: "\u8BF7\u8F93\u5165" + displayName
      }
    }), {
      value: getValue(fieldName)
    }, otherProps)));
  };
  return FilterField;
}(React.Component);
FilterField.displayName = 'FilterField';
export default FilterField;