"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports["default"] = void 0;
var _react = _interopRequireDefault(require("react"));
var _moment = _interopRequireDefault(require("moment"));
require("./index.less");
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
var SBZJContent = function SBZJContent(_ref) {
  var _ref$classPrefix = _ref.classPrefix,
    classPrefix = _ref$classPrefix === void 0 ? '' : _ref$classPrefix,
    _ref$rows = _ref.rows,
    rows = _ref$rows === void 0 ? [] : _ref$rows;
  var noDataTime = function noDataTime(time) {
    return (0, _moment["default"])((0, _moment["default"])().diff((0, _moment["default"])(time))).format('H小时mm分钟');
  };
  return /*#__PURE__*/_react["default"].createElement("div", {
    className: "".concat(classPrefix, "-items")
  }, rows.map(function (item) {
    return /*#__PURE__*/_react["default"].createElement("div", {
      key: item.id,
      className: "".concat(classPrefix, "-item")
    }, /*#__PURE__*/_react["default"].createElement("div", {
      className: "".concat(classPrefix, "-item-title")
    }, item.name), /*#__PURE__*/_react["default"].createElement("div", {
      className: "".concat(classPrefix, "-item-content")
    }, /*#__PURE__*/_react["default"].createElement("div", {
      className: "".concat(classPrefix, "-item-left")
    }, /*#__PURE__*/_react["default"].createElement("div", {
      className: "".concat(classPrefix, "-left")
    }, /*#__PURE__*/_react["default"].createElement("div", {
      className: "".concat(classPrefix, "-left-item")
    }, /*#__PURE__*/_react["default"].createElement("span", {
      className: "".concat(classPrefix, "-left-label")
    }, "\u7D2F\u8BA1\u5DE5\u4F5C\u65F6\u957F\uFF1A", /*#__PURE__*/_react["default"].createElement("span", {
      className: "".concat(classPrefix, "-left-value")
    }, item.cumulativeWorkingTimeStr))), /*#__PURE__*/_react["default"].createElement("div", {
      className: "".concat(classPrefix, "-left-item")
    }, /*#__PURE__*/_react["default"].createElement("span", {
      className: "".concat(classPrefix, "-left-label")
    }, "\u6700\u8FD1\u5FC3\u8DF3\u65F6\u95F4\uFF1A", /*#__PURE__*/_react["default"].createElement("span", {
      className: "".concat(classPrefix, "-left-value")
    }, item.lastHeartTime))), /*#__PURE__*/_react["default"].createElement("div", {
      className: "".concat(classPrefix, "-left-item")
    }, /*#__PURE__*/_react["default"].createElement("span", {
      className: "".concat(classPrefix, "-left-label")
    }, "\u6700\u540E\u4E0A\u4F20\u6570\u636E\u65F6\u95F4\uFF1A", /*#__PURE__*/_react["default"].createElement("span", {
      className: "".concat(classPrefix, "-left-value")
    }, item.lastDataTime))))), /*#__PURE__*/_react["default"].createElement("div", {
      className: "".concat(classPrefix, "-item-right")
    }, /*#__PURE__*/_react["default"].createElement("div", {
      className: "".concat(classPrefix, "-right-item")
    }, /*#__PURE__*/_react["default"].createElement("span", {
      className: "".concat(classPrefix, "-right-label")
    }, "\u53EF\u7528\u7387\uFF1A", /*#__PURE__*/_react["default"].createElement("span", {
      className: "".concat(classPrefix, "-right-value")
    }, (item.availability * 100).toFixed(2), "%"))), /*#__PURE__*/_react["default"].createElement("div", {
      className: "".concat(classPrefix, "-right-item")
    }, /*#__PURE__*/_react["default"].createElement("span", {
      className: "".concat(classPrefix, "-right-label")
    }, "\u5728\u7EBF\u72B6\u6001\uFF1A", /*#__PURE__*/_react["default"].createElement("span", {
      className: "".concat(classPrefix, "-right-value")
    }, /*#__PURE__*/_react["default"].createElement("span", {
      style: {
        color: item.status === 'online' ? '#34FFD2' : '#df273e'
      }
    }, !item.status ? '-' : item.status === 'online' ? '上线' : '下线')))), /*#__PURE__*/_react["default"].createElement("div", {
      className: "".concat(classPrefix, "-right-item")
    }, /*#__PURE__*/_react["default"].createElement("span", {
      className: "".concat(classPrefix, "-right-label")
    }, "\u65E0\u6570\u636E\u65F6\u957F\uFF1A", /*#__PURE__*/_react["default"].createElement("span", {
      className: "".concat(classPrefix, "-right-value")
    }, /*#__PURE__*/_react["default"].createElement("span", {
      style: {
        color: item.status === 'online' ? '#FFD928' : '#df273e'
      }
    }, item.lastDataTime && noDataTime(item.lastDataTime))))))));
  }));
};
var _default = exports["default"] = SBZJContent;
//# sourceMappingURL=Content.js.map
