"use strict";
Object.defineProperty(exports, "__esModule", {
  value: !0
}), exports.renderLongTime = exports.renderSimpleTime = exports.undefined2default = exports.isEmptyObject = exports.generateTableFilterOrLike = exports.convertTree = exports.generateTableFilter = exports.filterPayload = exports.asyncAction = void 0;
var _moment = _interopRequireDefault(require("moment"));

function _interopRequireDefault(e) {
  return e && e.__esModule ? e : {
    default: e
  }
}

function _typeof(e) {
  return (_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(e) {
    return typeof e
  } : function(e) {
    return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e
  })(e)
}
var asyncAction = function(t) {
  return function(e) {
    t && e(t())
  }
};
exports.asyncAction = asyncAction;
var filterPayload = function(e) {
  return null !== e && "object" === _typeof(e) && e.dataList || e
};
exports.filterPayload = filterPayload;
var generateTableFilter = function(e, n) {
  var o = [];
  return e.map(function(e) {
    var t = e.type,
      r = e.name,
      e = n[r];
    void 0 !== e && "" !== e && null !== e && o.push({
      name: r,
      type: t,
      value: e
    })
  }), o
};
exports.generateTableFilter = generateTableFilter;
var convertTree = function(e, t) {
  var e = 0 < arguments.length && void 0 !== e ? e : [],
    r = 1 < arguments.length && void 0 !== t ? t : [];
  return function e(t) {
    return t.map(function(t) {
      r.map(function(e) {
        t[e.newKey] = t[e.oldKey]
      }), t.children && e(t.children)
    })
  }(e), e
};
exports.convertTree = convertTree;
var generateTableFilterOrLike = function(e, n) {
  var o = [];
  return e.map(function(e) {
    var t = e.type,
      r = e.name,
      e = n.multipleLike;
    void 0 !== e && o.push({
      name: r,
      type: t,
      value: e
    })
  }), o
};
exports.generateTableFilterOrLike = generateTableFilterOrLike;
var isEmptyObject = function(e) {
  if (e)
    for (var t in e)
      if (t) return !1;
  return !0
};
exports.isEmptyObject = isEmptyObject;
var undefined2default = function(e) {
  Array.isArray(e)
};
exports.undefined2default = undefined2default;
var renderSimpleTime = function(e) {
  return e ? (0, _moment.default)(e).format("YYYY-MM-DD") : ""
};
exports.renderSimpleTime = renderSimpleTime;
var renderLongTime = function(e) {
  return e ? (0, _moment.default)(e).format("YYYY-MM-DD HH:mm:ss") : ""
};
exports.renderLongTime = renderLongTime;
