"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,
    throwAberrantCode = _ref.throwAberrantCode,
    startTime = _ref.startTime,
    endTime = _ref.endTime,
    throwPointId = _ref.throwPointId;
  var _a;
  var data = _api.throwFailBehaviorService.list({
    housingEstateId: id,
    startDatetime: startTime,
    endDatetime: endTime,
    throwPointId: throwPointId,
    throwAberrantCode: throwAberrantCode === 'all' ? '' : throwAberrantCode
  });
  return !(data === null || data === void 0 ? void 0 : data.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")
  }, (_a = data === null || data === void 0 ? void 0 : data.map) === null || _a === void 0 ? void 0 : _a.call(data, function (item) {
    var _a, _b;
    var photoId = (_a = JSON.parse(item.photoAfter || '[]')[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.id,
      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("div", {
      className: "".concat(classPrefix, "-content-item-info1")
    }, /*#__PURE__*/_react["default"].createElement("span", null, item.throwPointName), /*#__PURE__*/_react["default"].createElement("span", {
      className: "".concat(classPrefix, "-content-item-").concat(item.rectificationStatus)
    }, item.rectificationStatusDesc)), /*#__PURE__*/_react["default"].createElement("div", {
      className: "".concat(classPrefix, "-content-item-info2")
    }, /*#__PURE__*/_react["default"].createElement("span", null, item.datetime), /*#__PURE__*/_react["default"].createElement("div", null, item.aberrantName)), /*#__PURE__*/_react["default"].createElement("div", {
      className: "".concat(classPrefix, "-content-item-info3")
    }, /*#__PURE__*/_react["default"].createElement("img", {
      src: require('../../imgs/avatar_empty.png')
    }), item.personName || '暂无关联用户'));
  })));
};
var _default = exports["default"] = WGGSContent;
//# sourceMappingURL=Content.js.map
