"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports["default"] = void 0;
var _react = _interopRequireDefault(require("react"));
var _antd = require("antd");
require("./index.less");
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
function _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); }
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
function _iterableToArray(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); }
function _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); }
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
var CollectStatistics = function CollectStatistics(_ref) {
  var data = _ref.data,
    hideNetWeight = _ref.hideNetWeight;
  var list = [{
    label: '收运桶数',
    value: (data === null || data === void 0 ? void 0 : data.trashNums) || 0,
    unit: '桶'
  }, {
    label: '收运重量',
    value: (data === null || data === void 0 ? void 0 : data.collectWeightKg) > 10000 ? ((data.collectWeightKg || 0) / 1000).toFixed(2) : data === null || data === void 0 ? void 0 : data.collectWeightKg,
    unit: (data === null || data === void 0 ? void 0 : data.collectWeightKg) ? '吨' : 'kg'
  }].concat(_toConsumableArray(hideNetWeight ? [] : [{
    label: '进厂量',
    value: (data === null || data === void 0 ? void 0 : data.netWeightTotal) > 10000 ? ((data.netWeightTotal || 0) / 1000).toFixed(2) : data === null || data === void 0 ? void 0 : data.netWeightTotal,
    unit: (data === null || data === void 0 ? void 0 : data.netWeightTotal) ? '吨' : 'kg'
  }]));
  return /*#__PURE__*/_react["default"].createElement(_antd.Row, {
    justify: 'space-around'
  }, list.map(function (item) {
    return /*#__PURE__*/_react["default"].createElement("div", {
      key: item.label,
      className: "vtx-cc-unit-statistics"
    }, /*#__PURE__*/_react["default"].createElement("div", {
      className: "vtx-cc-unit-statistics__label"
    }, item.label), /*#__PURE__*/_react["default"].createElement("div", null, /*#__PURE__*/_react["default"].createElement("span", {
      className: "vtx-cc-unit-statistics__value"
    }, item.value), /*#__PURE__*/_react["default"].createElement("span", {
      className: "vtx-cc-unit-statistics__unit"
    }, item.unit)));
  }));
};
var _default = exports["default"] = CollectStatistics;
//# sourceMappingURL=CollectStatistics.js.map
