"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 _all_rate = _interopRequireDefault(require("../../../vtx-cp-modal/imgs/all_rate.png"));
var _all_rate_light = _interopRequireDefault(require("../../../vtx-cp-modal/imgs/all_rate_light.png"));
var _antd = require("antd");
var _vtxCcCpModal = require("../../../vtx-cc-cp-modal");
var _api = require("../../../vtx-cc-cp-modal/api");
var _vmCard = _interopRequireDefault(require("../../../vm-card"));
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, "default": e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
var AllWork = function AllWork() {
  var _useSettings = (0, _useSettings2["default"])(),
    isDark = _useSettings.isDark;
  var _useContext = (0, _react.useContext)(_vtxCcCpModal.CcCpContext),
    id = _useContext.id;
  var data = _api.BasicService.getSyPointDaySummary(id);
  var blockItem = function blockItem(title, value, unit) {
    return /*#__PURE__*/_react["default"].createElement("div", {
      className: "vtx-cc-cp-task-item-block-item"
    }, /*#__PURE__*/_react["default"].createElement("div", null, title), /*#__PURE__*/_react["default"].createElement("div", {
      className: "vtx-cc-cp-task-item-block-item-value"
    }, /*#__PURE__*/_react["default"].createElement("span", null, value || 0), unit));
  };
  var percent = (data === null || data === void 0 ? void 0 : data.taskShouldCollectTimes) ? parseFloat((((data === null || data === void 0 ? void 0 : data.taskCollectNum) || 0) / ((data === null || data === void 0 ? void 0 : data.taskShouldCollectTimes) || 0) * 100).toFixed(2)) : 0;
  return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement(_antd.Col, {
    span: 24
  }, /*#__PURE__*/_react["default"].createElement(_vmCard["default"], {
    title: "\u6574\u4F53\u4F5C\u4E1A"
  }, /*#__PURE__*/_react["default"].createElement("div", {
    className: "vtx-cc-cp-work"
  }, /*#__PURE__*/_react["default"].createElement("div", {
    className: "vtx-cc-cp-work-item"
  }, /*#__PURE__*/_react["default"].createElement("div", null, "\u603B\u5B9E\u6536\u6B21\u6570"), /*#__PURE__*/_react["default"].createElement("div", {
    className: "vtx-cc-cp-work-item-num"
  }, data === null || data === void 0 ? void 0 : data.collectTimes, /*#__PURE__*/_react["default"].createElement("span", null, "\u6B21"))), /*#__PURE__*/_react["default"].createElement("div", {
    className: "vtx-cc-cp-work-item"
  }, /*#__PURE__*/_react["default"].createElement("div", null, "\u603B\u6536\u96C6\u6876\u6570"), /*#__PURE__*/_react["default"].createElement("div", {
    className: "vtx-cc-cp-work-item-num"
  }, data === null || data === void 0 ? void 0 : data.actCollectNum, /*#__PURE__*/_react["default"].createElement("span", null, "\u6876"))), /*#__PURE__*/_react["default"].createElement("div", {
    className: "vtx-cc-cp-work-item"
  }, /*#__PURE__*/_react["default"].createElement("div", null, "\u603B\u6536\u96C6\u91CD\u91CF"), /*#__PURE__*/_react["default"].createElement("div", {
    className: "vtx-cc-cp-work-item-num"
  }, data === null || data === void 0 ? void 0 : data.collectWeight, /*#__PURE__*/_react["default"].createElement("span", null, "kg")))))), /*#__PURE__*/_react["default"].createElement(_antd.Col, {
    span: 24
  }, /*#__PURE__*/_react["default"].createElement(_vmCard["default"], {
    title: "\u4EFB\u52A1\u60C5\u51B5"
  }, /*#__PURE__*/_react["default"].createElement("div", {
    className: "vtx-cc-cp-task"
  }, /*#__PURE__*/_react["default"].createElement("div", {
    className: "vtx-cc-cp-task-item"
  }, /*#__PURE__*/_react["default"].createElement("img", {
    src: isDark ? _all_rate["default"] : _all_rate_light["default"]
  }), /*#__PURE__*/_react["default"].createElement("div", {
    className: "vtx-cc-cp-task-item-progress"
  }, /*#__PURE__*/_react["default"].createElement("div", null, "\u5B8C\u6210\u7387\uFF1A", percent, "%"), /*#__PURE__*/_react["default"].createElement("div", {
    className: "vtx-cc-cp-task-item-progress-bg"
  }, /*#__PURE__*/_react["default"].createElement(_antd.Progress, {
    strokeLinecap: "butt",
    percent: percent,
    strokeColor: isDark ? {
      '0%': '#BFFFE8',
      '100%': '#37D3B0'
    } : '#00AA64',
    trailColor: isDark ? '#444B59' : '#D2D2D2',
    strokeWidth: 6,
    showInfo: false
  }))), /*#__PURE__*/_react["default"].createElement("div", {
    className: "vtx-cc-cp-task-item-block"
  }, blockItem('任务内实收次数', (data === null || data === void 0 ? void 0 : data.taskCollectTimes) || 0, '次'), blockItem('任务内应收次数', (data === null || data === void 0 ? void 0 : data.taskShouldCollectTimes) || 0, '次'), blockItem('任务内收集桶数', (data === null || data === void 0 ? void 0 : data.taskCollectNum) || 0, '桶')))))));
};
var _default = exports["default"] = AllWork;
//# sourceMappingURL=AllWork.js.map
