"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports["default"] = void 0;
var _react = _interopRequireDefault(require("react"));
var _components = require("@vtx/components");
var _utils = require("@vtx/utils");
var _vmNodata = _interopRequireDefault(require("../../../vm-nodata"));
var _api = require("../../api");
require("./index.less");
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
var WGGSContent = function WGGSContent(_ref) {
  var _ref$classPrefix = _ref.classPrefix,
    classPrefix = _ref$classPrefix === void 0 ? '' : _ref$classPrefix,
    id = _ref.id,
    startTime = _ref.startTime,
    endTime = _ref.endTime;
  var data = _api.throwFailPersonService.list({
    beginTime: startTime,
    endTime: endTime,
    throwPointId: id
  });
  var _ref2 = data || {},
    _ref2$rows = _ref2.rows,
    rows = _ref2$rows === void 0 ? [] : _ref2$rows;
  return !rows.length ? (/*#__PURE__*/_react["default"].createElement("div", {
    style: {
      height: 500,
      display: 'flex',
      justifyContent: 'center',
      alignItems: 'center'
    }
  }, /*#__PURE__*/_react["default"].createElement(_vmNodata["default"], null))) : (/*#__PURE__*/_react["default"].createElement("div", {
    className: "".concat(classPrefix, "-content")
  }, rows.map(function (item) {
    var _a, _b;
    var photoId = (_a = JSON.parse(item.personPhoto2 || '[]')[0]) === null || _a === void 0 ? void 0 : _a.id;
    var tempDetectObjects = JSON.parse(item.detectObjects || '[]');
    var photoAfterArr = (_b = tempDetectObjects.find(function (item) {
      return item.pic === 'dropPic2';
    })) === null || _b === void 0 ? void 0 : _b.info;
    var str = "/cloud/sdyd/markBox?fileId=".concat(photoId, "&detectObjects=").concat(photoAfterArr ? JSON.stringify(photoAfterArr) : '', "&token=").concat((0, _utils.getVtxToken)('token'));
    return /*#__PURE__*/_react["default"].createElement("div", {
      key: item.throwFailId,
      className: "".concat(classPrefix, "-content-item")
    }, /*#__PURE__*/_react["default"].createElement("div", {
      className: "".concat(classPrefix, "-content-item-img")
    }, /*#__PURE__*/_react["default"].createElement(_components.VtxImage, {
      src: str
    })), /*#__PURE__*/_react["default"].createElement("p", null, item.throwPointName));
  })));
};
var _default = exports["default"] = WGGSContent;
//# sourceMappingURL=Content.js.map
