"use strict";

function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
Object.defineProperty(exports, "__esModule", {
  value: true
});
exports["default"] = void 0;
var _useSettings2 = _interopRequireDefault(require("../../../vm-hooks/useSettings"));
var _react = _interopRequireWildcard(require("react"));
var _sjsj = _interopRequireDefault(require("../../../vtx-cp-modal/imgs/sjsj.png"));
var _sjts = _interopRequireDefault(require("../../../vtx-cp-modal/imgs/sjts.png"));
var _sjzl = _interopRequireDefault(require("../../../vtx-cp-modal/imgs/sjzl.png"));
var _sjsj_light = _interopRequireDefault(require("../../../vtx-cp-modal/imgs/sjsj_light.png"));
var _sjts_light = _interopRequireDefault(require("../../../vtx-cp-modal/imgs/sjts_light.png"));
var _sjzl_light = _interopRequireDefault(require("../../../vtx-cp-modal/imgs/sjzl_light.png"));
var _vmImageText = _interopRequireDefault(require("../../../vm-image-text"));
var _index = require("../../index");
var _api = require("../../api");
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n["default"] = e, t && t.set(e, n), n; }
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
var SummaryInfo = function SummaryInfo(_ref) {
  var startDay = _ref.startDay,
    endDay = _ref.endDay;
  var _useSettings = (0, _useSettings2["default"])(),
    isDark = _useSettings.isDark;
  var _useContext = (0, _react.useContext)(_index.CcCpContext),
    id = _useContext.id;
  var data = _api.BasicService.getSyPointDaysSummary(id, startDay, endDay);
  var getSrc = function getSrc(code) {
    var obj = {
      sjsj: _sjsj["default"],
      sjts: _sjts["default"],
      sjzl: _sjzl["default"]
    };
    var obj2 = {
      sjsj: _sjsj_light["default"],
      sjts: _sjts_light["default"],
      sjzl: _sjzl_light["default"]
    };
    if (isDark) {
      return obj[code];
    }
    return obj2[code];
  };
  return /*#__PURE__*/_react["default"].createElement("div", {
    className: "cc-cp-syinfo-base-weight-item"
  }, /*#__PURE__*/_react["default"].createElement(_vmImageText["default"], {
    src: getSrc('sjsj'),
    name: "\u603B\u5B9E\u6536\u6B21\u6570",
    value: data === null || data === void 0 ? void 0 : data.collectTimes,
    unit: "\u6B21",
    color: "active",
    style: {
      marginRight: '0',
      width: '33%',
      marginBottom: '24px'
    }
  }), /*#__PURE__*/_react["default"].createElement(_vmImageText["default"], {
    src: getSrc('sjts'),
    name: "\u603B\u6536\u96C6\u6876\u6570",
    value: data === null || data === void 0 ? void 0 : data.actCollectNum,
    unit: "\u6876",
    color: "active",
    style: {
      marginRight: '0',
      width: '33%',
      marginBottom: '24px'
    }
  }), /*#__PURE__*/_react["default"].createElement(_vmImageText["default"], {
    src: getSrc('sjzl'),
    name: "\u603B\u6536\u96C6\u91CD\u91CF",
    value: data === null || data === void 0 ? void 0 : data.collectWeight,
    unit: "kg",
    color: "active",
    style: {
      marginRight: '0',
      width: '33%',
      marginBottom: '24px'
    }
  }), /*#__PURE__*/_react["default"].createElement(_vmImageText["default"], {
    src: getSrc('sjsj'),
    name: "\u4EFB\u52A1\u5185\u5B9E\u6536/\u5E94\u6536\u6B21\u6570",
    values: [(data === null || data === void 0 ? void 0 : data.taskCollectTimes) || 0, (data === null || data === void 0 ? void 0 : data.taskShouldCollectTimes) || 0],
    units: ['次', '次'],
    color: "active",
    style: {
      marginRight: '0',
      width: '33%',
      marginBottom: '24px'
    }
  }), /*#__PURE__*/_react["default"].createElement(_vmImageText["default"], {
    src: getSrc('sjts'),
    name: "\u4EFB\u52A1\u5185\u6536\u96C6\u6876\u6570",
    value: data === null || data === void 0 ? void 0 : data.taskCollectNum,
    unit: "\u6876",
    color: "active",
    style: {
      marginRight: '0',
      width: '33%',
      marginBottom: '24px'
    }
  }), /*#__PURE__*/_react["default"].createElement(_vmImageText["default"], {
    src: getSrc('sjzl'),
    name: "\u4EFB\u52A1\u5185\u6536\u96C6\u91CD\u91CF",
    value: data === null || data === void 0 ? void 0 : data.taskCollectWeight,
    unit: "kg",
    color: "active",
    style: {
      marginRight: '0',
      width: '33%',
      marginBottom: '24px'
    }
  }));
};
var _default = exports["default"] = SummaryInfo;
//# sourceMappingURL=SummaryInfo.js.map
