"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports["default"] = void 0;
var _default = exports["default"] = {
  // 获取下拉树选中数据集合
  getTreeCheckInfo: function getTreeCheckInfo() {
    var dataList = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
    var value = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
    var checkedItem = {};
    var renderTree = function renderTree() {
      var _data$children;
      var data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
      if ((data === null || data === void 0 ? void 0 : data.value) === value) {
        checkedItem = data;
      } else if (data !== null && data !== void 0 && (_data$children = data.children) !== null && _data$children !== void 0 && _data$children.length) {
        data === null || data === void 0 || data.children.map(function (val) {
          renderTree(val);
        });
      }
    };
    if (dataList !== null && dataList !== void 0 && dataList.length) {
      dataList.map(function (item) {
        renderTree(item);
      });
    }
    return checkedItem;
  },
  // 表单联动清空数据
  clearFormData: function clearFormData(myForm) {
    var _myForm$current;
    var formParams = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
    (myForm === null || myForm === void 0 || (_myForm$current = myForm.current) === null || _myForm$current === void 0 || (_myForm$current = _myForm$current.form) === null || _myForm$current === void 0 ? void 0 : _myForm$current.setFieldsValue) && myForm.current.form.setFieldsValue(formParams);
  }
};
//# sourceMappingURL=config.js.map
