"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports["default"] = Charts;
var _react = _interopRequireDefault(require("react"));
var _useSettings2 = _interopRequireDefault(require("../../../vm-hooks/useSettings"));
var _api = require("../../api");
var _dqsd = _interopRequireDefault(require("../../imgs/dqsd.png"));
var _jrxs = _interopRequireDefault(require("../../imgs/jrxs.png"));
var _dqsd_light = _interopRequireDefault(require("../../imgs/dqsd_light.png"));
var _jrxs_light = _interopRequireDefault(require("../../imgs/jrxs_light.png"));
var _dqsd_blue = _interopRequireDefault(require("../../imgs/dqsd_blue.png"));
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
/**
 * 左侧统计图片
 */

// import syyl from '../../imgs/syyl.png';

// import syylLight from '../../imgs/syyl_light.png';

function Charts(_ref) {
  var id = _ref.id,
    mileage = _ref.mileage,
    gpsSpeed = _ref.gpsSpeed,
    date = _ref.date,
    service = _ref.service,
    isRow = _ref.isRow;
  var _a;
  var _useSettings = (0, _useSettings2["default"])(),
    _useSettings$theme = _useSettings.theme,
    theme = _useSettings$theme === void 0 ? 'light' : _useSettings$theme;
  var _BaseService$useDaily = _api.BaseService.useDailySummaryJxh(id, date, service),
    dailySummaryJxh = _BaseService$useDaily.dailySummaryJxh;
  var icons = {
    dqsd: {
      light: _dqsd_light["default"],
      dark: _dqsd["default"],
      blue: _dqsd_blue["default"]
    },
    jrxs: {
      light: _jrxs_light["default"],
      dark: _jrxs["default"],
      blue: _dqsd_blue["default"]
    }
  };
  return /*#__PURE__*/_react["default"].createElement("div", {
    style: {
      display: 'flex',
      flexDirection: isRow && !(dailySummaryJxh === null || dailySummaryJxh === void 0 ? void 0 : dailySummaryJxh.planMileage) ? 'row' : 'column'
    }
  }, /*#__PURE__*/_react["default"].createElement("div", {
    className: "car-base-left--charts"
  }, /*#__PURE__*/_react["default"].createElement("div", {
    className: "car-base-left--charts-item",
    style: {
      width: isRow ? '100%' : '50%',
      justifyContent: isRow && !(dailySummaryJxh === null || dailySummaryJxh === void 0 ? void 0 : dailySummaryJxh.planMileage) ? 'center' : 'flex-start'
    }
  }, /*#__PURE__*/_react["default"].createElement("div", {
    className: "car-base-left--charts-item-chart"
  }, /*#__PURE__*/_react["default"].createElement("img", {
    src: icons['dqsd'][theme]
  })), /*#__PURE__*/_react["default"].createElement("div", null, /*#__PURE__*/_react["default"].createElement("div", {
    className: "car-base-left--charts-item-name"
  }, "\u5F53\u524D\u901F\u5EA6"), /*#__PURE__*/_react["default"].createElement("div", {
    className: "car-base-left--charts-item-value"
  }, /*#__PURE__*/_react["default"].createElement("span", null, gpsSpeed || 0), "km/h")))), /*#__PURE__*/_react["default"].createElement("div", {
    className: "car-base-left-jrxs",
    style: {
      marginTop: isRow ? 0 : 24
    }
  }, /*#__PURE__*/_react["default"].createElement("div", {
    className: "jrxs-box"
  }, /*#__PURE__*/_react["default"].createElement("img", {
    src: icons['jrxs'][theme]
  })), /*#__PURE__*/_react["default"].createElement("div", {
    className: "car-base-left-jrxs-right"
  }, /*#__PURE__*/_react["default"].createElement("div", null, /*#__PURE__*/_react["default"].createElement("div", {
    className: "jrxs-name"
  }, "\u4ECA\u65E5\u884C\u9A76"), /*#__PURE__*/_react["default"].createElement("div", {
    className: "jrxs-value"
  }, /*#__PURE__*/_react["default"].createElement("span", null, mileage || 0), "km")), (dailySummaryJxh === null || dailySummaryJxh === void 0 ? void 0 : dailySummaryJxh.planMileage) && (/*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement("div", null, /*#__PURE__*/_react["default"].createElement("div", {
    className: "jrxs-name"
  }, "\u4ECA\u65E5\u4F5C\u4E1A"), /*#__PURE__*/_react["default"].createElement("div", {
    className: "jrxs-value"
  }, /*#__PURE__*/_react["default"].createElement("span", null, ((_a = dailySummaryJxh === null || dailySummaryJxh === void 0 ? void 0 : dailySummaryJxh.workMileage) === null || _a === void 0 ? void 0 : _a.toFixed(2)) || 0), "km")), /*#__PURE__*/_react["default"].createElement("div", null, /*#__PURE__*/_react["default"].createElement("div", {
    className: "jrxs-name"
  }, "\u4ECA\u65E5\u6392\u73ED"), /*#__PURE__*/_react["default"].createElement("div", {
    className: "jrxs-value"
  }, /*#__PURE__*/_react["default"].createElement("span", null, (dailySummaryJxh === null || dailySummaryJxh === void 0 ? void 0 : dailySummaryJxh.planMileage) || 0), "km")))))));
}
//# sourceMappingURL=Charts.js.map
