"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports["default"] = void 0;
var _react = _interopRequireDefault(require("react"));
var _ahooks = require("ahooks");
var _api = require("../../api");
require("./index.less");
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
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;
  var _a;
  var getTableData = function getTableData(_ref2) {
    var current = _ref2.current,
      pageSize = _ref2.pageSize;
    return (0, _api.queryPage)('/cloud/sdyd/throwFail/page', {
      page: current - 1,
      size: pageSize,
      housingEstateId: id,
      throwAberrantCode: throwAberrantCode === 'all' ? '' : throwAberrantCode
      // startDatetime: startTime,
      // endDatetime: startTime
    });
  };

  var _useAntdTable = (0, _ahooks.useAntdTable)(getTableData, {
      defaultPageSize: 1000000,
      refreshDeps: [id, endTime, startTime]
    }),
    tableProps = _useAntdTable.tableProps;
  var dataSource = tableProps.dataSource;
  return /*#__PURE__*/_react["default"].createElement("div", {
    className: "".concat(classPrefix, "-content")
  }, (_a = dataSource === null || dataSource === void 0 ? void 0 : dataSource.map) === null || _a === void 0 ? void 0 : _a.call(dataSource, function (item, index) {
    var _a;
    var photoId = (_a = JSON.parse(item.photoAfter || '[]')[0]) === null || _a === void 0 ? void 0 : _a.id;
    return /*#__PURE__*/_react["default"].createElement("div", {
      key: index,
      className: "".concat(classPrefix, "-content-item")
    }, /*#__PURE__*/_react["default"].createElement("div", {
      className: "".concat(classPrefix, "-content-item-img")
    }, /*#__PURE__*/_react["default"].createElement("img", {
      src: "/aiFile/vortex/rest/cloud/np/file/downloadFileThumbnail?id=".concat(photoId, "&outputQuality=0.3&scale=0.3")
    })), /*#__PURE__*/_react["default"].createElement("div", {
      className: "".concat(classPrefix, "-content-item-info1")
    }, /*#__PURE__*/_react["default"].createElement("span", null, item.throwPointName), /*#__PURE__*/_react["default"].createElement("span", null, "\u5DF2\u5FFD\u7565")), /*#__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 = WGGSContent;
exports["default"] = _default;
//# sourceMappingURL=Content.js.map
