"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports["default"] = void 0;
var _react = _interopRequireDefault(require("react"));
var _vtxFormLayout = _interopRequireDefault(require("@vtx/components/lib/vtx-form-layout"));
var _input = _interopRequireDefault(require("antd/lib/input"));
var _inputNumber = _interopRequireDefault(require("antd/lib/input-number"));
var _vtxSelect = _interopRequireDefault(require("@vtx/components/lib/vtx-select"));
var _lodash = _interopRequireDefault(require("lodash"));
var _form = _interopRequireDefault(require("antd/lib/form"));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
var Option = _vtxSelect["default"].Option;
var facilityTypeMap = {
  manhole: '污水窨井',
  line: '污水管线',
  pump_station: '污水泵站',
  sewage_plant: '污水厂'
};
var Sunnyrainratio = function Sunnyrainratio(_ref) {
  var form = _ref.form;
  var facilityTypes = _form["default"].useWatch('facilityTypes', form) || [];
  return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement(_vtxFormLayout["default"].FormItem, {
    name: "facilityTypes",
    label: "\u6674\u96E8\u6BD4\u5206\u6790\u8BBE\u65BD",
    rules: [{
      required: true,
      message: '请填写晴天配置'
    }],
    getValueFromEvent: function getValueFromEvent(value, option) {
      form.setFieldsValue({
        facilityTypeNames: _lodash["default"].map(option, 'children')
      });
      return value;
    }
  }, /*#__PURE__*/_react["default"].createElement(_vtxSelect["default"], {
    mode: 'multiple',
    maxTagCount: 4
  }, Object.keys(facilityTypeMap).map(function (key) {
    return /*#__PURE__*/_react["default"].createElement(Option, {
      key: key
    }, facilityTypeMap[key]);
  }))), /*#__PURE__*/_react["default"].createElement(_vtxFormLayout["default"].FormItem, {
    name: "sunnyCount",
    label: "\u6674\u5929\u57FA\u51C6\u5929\u6570\uFF08\u6392\u9664\u964D\u96E8\u5F71\u54CD\u7684\u8FDE\u7EED\u6674\u5929\u5929\u6570\uFF09",
    rules: [{
      required: true,
      message: '请填写雨天判定'
    }]
  }, /*#__PURE__*/_react["default"].createElement(_inputNumber["default"], {
    min: 1,
    precision: 0
  })), /*#__PURE__*/_react["default"].createElement(_vtxFormLayout["default"].FormItem, {
    name: "ratio",
    label: "\u6674\u96E8\u6BD4\u9608\u503C",
    rules: [{
      required: true,
      message: '请填写晴雨比异常比例'
    }]
  }, /*#__PURE__*/_react["default"].createElement(_inputNumber["default"], {
    precision: 1
  })), facilityTypes.map(function (type) {
    return /*#__PURE__*/_react["default"].createElement(_vtxFormLayout["default"].FormItem, {
      name: ['handleMeasure', type],
      label: "".concat(facilityTypeMap[type], "\u6674\u96E8\u6BD4\u5F02\u5E38\u5904\u7406\u63AA\u65BD"),
      key: type,
      rules: [{
        required: true,
        message: '请填写'
      }]
    }, /*#__PURE__*/_react["default"].createElement(_input["default"].TextArea, {
      maxLength: 100,
      showCount: true,
      placeholder: "\u8BF7\u8F93\u5165"
    }));
  }), /*#__PURE__*/_react["default"].createElement(_vtxFormLayout["default"].FormItem, {
    name: "facilityTypeNames",
    hidden: true
  }, /*#__PURE__*/_react["default"].createElement(_inputNumber["default"], null)));
};
var _default = exports["default"] = Sunnyrainratio;
//# sourceMappingURL=sunnyrainratio.js.map
