"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports["default"] = TodayWork;
var _react = _interopRequireDefault(require("react"));
var _progress = _interopRequireDefault(require("antd/es/progress"));
var _vmNodata = _interopRequireDefault(require("../../../vm-nodata"));
var _vmSubTitle = _interopRequireDefault(require("../../../vm-sub-title"));
var _TodayWorkTable = _interopRequireDefault(require("./TodayWorkTable"));
require("./index.less");
var _all_rate = _interopRequireDefault(require("../../imgs/all_rate.png"));
var _cx_rate = _interopRequireDefault(require("../../imgs/cx_rate.png"));
var _xs_rate = _interopRequireDefault(require("../../imgs/xs_rate.png"));
var _ss_rate = _interopRequireDefault(require("../../imgs/ss_rate.png"));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
/**
 * 收集点-总览信息-收运规则
 */

function TodayWork(props) {
  var data = props.data;
  var getValue = function getValue(name) {
    var strokeColor = {
      '0%': '#BFFFE8',
      '100%': '#37D3B0'
    };
    var src = _all_rate["default"];
    switch (name) {
      case '全部':
        strokeColor = {
          '0%': '#BFFFE8',
          '100%': '#37D3B0'
        };
        src = _all_rate["default"];
        break;
      case '冲洗':
        strokeColor = {
          '0%': '#EC982B',
          '100%': '#FFE49A'
        };
        src = _cx_rate["default"];
        break;
      case '洗扫':
        strokeColor = {
          '0%': '#62C1FD',
          '100%': '#3E9DF9'
        };
        src = _xs_rate["default"];
        break;
      case '洒水':
        strokeColor = {
          '0%': '#FFA793',
          '100%': '#FF6770'
        };
        src = _ss_rate["default"];
        break;
      default:
        strokeColor = {
          '0%': '#EC982B',
          '100%': '#FFE49A'
        };
        src = _all_rate["default"];
        break;
    }
    return {
      strokeColor: strokeColor,
      src: src
    };
  };
  return /*#__PURE__*/_react["default"].createElement("div", {
    className: "base-right-twork"
  }, /*#__PURE__*/_react["default"].createElement(_vmSubTitle["default"], {
    title: "\u4ECA\u65E5\u4F5C\u4E1A"
  }), /*#__PURE__*/_react["default"].createElement("div", {
    className: "twork"
  }, /*#__PURE__*/_react["default"].createElement("div", {
    className: "twork--head"
  }, /*#__PURE__*/_react["default"].createElement("div", {
    className: "twork--head-img"
  }), /*#__PURE__*/_react["default"].createElement("div", {
    className: "twork--head-carType"
  }, "\u8F66\u8F86\u7C7B\u578B"), /*#__PURE__*/_react["default"].createElement("div", {
    className: "twork--head-block"
  }, "\u8BA1\u5212\u91CC\u7A0B"), /*#__PURE__*/_react["default"].createElement("div", {
    className: "twork--head-block"
  }, "\u6709\u6548\u91CC\u7A0B"), /*#__PURE__*/_react["default"].createElement("div", {
    className: "twork--head-block"
  }, "\u8BA1\u5212\u8D9F\u6570"), /*#__PURE__*/_react["default"].createElement("div", {
    className: "twork--head-block"
  }, "\u6709\u6548\u8D9F\u6570")), Array.isArray(data) ? data.map(function (item, index) {
    var _getValue = getValue(item === null || item === void 0 ? void 0 : item.workTypeName),
      strokeColor = _getValue.strokeColor,
      src = _getValue.src;
    return /*#__PURE__*/_react["default"].createElement("div", {
      className: "twork--item",
      key: index
    }, /*#__PURE__*/_react["default"].createElement("div", null, /*#__PURE__*/_react["default"].createElement("img", {
      src: src
    })), /*#__PURE__*/_react["default"].createElement("div", {
      className: "twork--item-progress"
    }, /*#__PURE__*/_react["default"].createElement("div", null, item === null || item === void 0 ? void 0 : item.productTypeName, "\u5B8C\u6210\u7387\uFF1A", item.rate * 100 || 0, "%"), /*#__PURE__*/_react["default"].createElement("div", {
      className: "twork--item-progress-bg"
    }, /*#__PURE__*/_react["default"].createElement(_progress["default"], {
      strokeLinecap: "butt",
      percent: 20,
      strokeColor: strokeColor,
      trailColor: "#444B59",
      strokeWidth: 6,
      showInfo: false
    }))), /*#__PURE__*/_react["default"].createElement("div", {
      className: "twork--item-block"
    }, /*#__PURE__*/_react["default"].createElement("span", null, "22"), "\u516C\u91CC"), /*#__PURE__*/_react["default"].createElement("div", {
      className: "twork--item-block"
    }, /*#__PURE__*/_react["default"].createElement("span", null, "22"), "\u516C\u91CC"), /*#__PURE__*/_react["default"].createElement("div", {
      className: "twork--item-block"
    }, /*#__PURE__*/_react["default"].createElement("span", null, "5"), "\u8D9F"), /*#__PURE__*/_react["default"].createElement("div", {
      className: "twork--item-block"
    }, /*#__PURE__*/_react["default"].createElement("span", null, "22"), "\u8D9F"));
  }) : /*#__PURE__*/_react["default"].createElement(_vmNodata["default"], null)), /*#__PURE__*/_react["default"].createElement("div", {
    className: "twotk-tabel"
  }, /*#__PURE__*/_react["default"].createElement(_TodayWorkTable["default"], null)));
}
//# sourceMappingURL=TodayWork.js.map
