"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports["default"] = void 0;
var _react = _interopRequireDefault(require("react"));
var _antd = require("antd");
var _utils = require("@vtx/utils");
var _components = require("@vtx/components");
var _useSettings2 = _interopRequireDefault(require("../../../vm-hooks/useSettings"));
var _vmInfoCollection = _interopRequireDefault(require("../../../vm-info-collection"));
var _vmSubTitle = _interopRequireDefault(require("../../../vm-sub-title"));
var _vmMap = _interopRequireDefault(require("../../../vm-map"));
var _vmNodata = _interopRequireDefault(require("../../../vm-nodata"));
var _util = require("../../../util");
require("./index.less");
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
var BaseInfo = function BaseInfo(props) {
  var _a, _b, _c, _d;
  var mapCenter = props.mapCenter,
    baseInfo = props.baseInfo,
    photos = props.photos,
    feedbackPhotos = props.feedbackPhotos,
    logs = props.logs,
    _props$customMapInfo = props.customMapInfo,
    customMapInfo = _props$customMapInfo === void 0 ? {} : _props$customMapInfo;
  var _useSettings = (0, _useSettings2["default"])(),
    theme = _useSettings.theme;
  var timelineColor = '#24F2FF';
  return /*#__PURE__*/_react["default"].createElement("div", {
    className: "zg-baseContent ".concat(theme)
  }, /*#__PURE__*/_react["default"].createElement("div", {
    className: "zg-base"
  }, /*#__PURE__*/_react["default"].createElement(_vmSubTitle["default"], null), /*#__PURE__*/_react["default"].createElement(_vmInfoCollection["default"], {
    data: baseInfo,
    gap: 10,
    ellipsis: true
  }), /*#__PURE__*/_react["default"].createElement("div", {
    className: "zg-base-map"
  }, /*#__PURE__*/_react["default"].createElement(_vmMap["default"], Object.assign({
    mapCenter: mapCenter
  }, customMapInfo)))), /*#__PURE__*/_react["default"].createElement("div", {
    className: "zg-right"
  }, /*#__PURE__*/_react["default"].createElement("div", {
    className: "zg-right-photo"
  }, /*#__PURE__*/_react["default"].createElement(_vmSubTitle["default"], {
    title: "\u6574\u6539\u56FE\u7247"
  }), /*#__PURE__*/_react["default"].createElement("div", {
    className: "zg-right-photo-wrap"
  }, /*#__PURE__*/_react["default"].createElement("div", {
    className: "zg-right-photo1"
  }, /*#__PURE__*/_react["default"].createElement(_components.VtxImage, {
    src: "/cloudFile/common/downloadFile?id=".concat((_a = photos === null || photos === void 0 ? void 0 : photos[0]) === null || _a === void 0 ? void 0 : _a.id, "&token=").concat((0, _utils.getVtxToken)('token')),
    aspectFit: true,
    emptyText: "\u6682\u65E0\u56FE\u7247",
    errorText: "\u6682\u65E0\u56FE\u7247",
    alt: (_b = photos === null || photos === void 0 ? void 0 : photos[0]) === null || _b === void 0 ? void 0 : _b.name,
    style: {
      width: '100%',
      height: '100%'
    },
    isDark: true
  }), /*#__PURE__*/_react["default"].createElement("span", null, "\u6574\u6539\u524D")), /*#__PURE__*/_react["default"].createElement("div", {
    className: "zg-right-photo1"
  }, /*#__PURE__*/_react["default"].createElement(_components.VtxImage, {
    src: "/cloudFile/common/downloadFile?id=".concat((_c = feedbackPhotos === null || feedbackPhotos === void 0 ? void 0 : feedbackPhotos[0]) === null || _c === void 0 ? void 0 : _c.id, "&token=").concat((0, _utils.getVtxToken)('token')),
    aspectFit: true,
    emptyText: "\u6682\u65E0\u56FE\u7247",
    errorText: "\u6682\u65E0\u56FE\u7247",
    alt: (_d = feedbackPhotos === null || feedbackPhotos === void 0 ? void 0 : feedbackPhotos[0]) === null || _d === void 0 ? void 0 : _d.name,
    style: {
      width: '100%',
      height: '100%'
    },
    isDark: true
  }), /*#__PURE__*/_react["default"].createElement("span", null, "\u6574\u6539\u540E")))), /*#__PURE__*/_react["default"].createElement("div", {
    className: "zg-right-czlc"
  }, /*#__PURE__*/_react["default"].createElement(_vmSubTitle["default"], {
    title: "\u5904\u7F6E\u6D41\u7A0B"
  }), /*#__PURE__*/_react["default"].createElement("div", {
    className: "zg-right-czlc-main"
  }, (logs === null || logs === void 0 ? void 0 : logs.length) > 0 ? (/*#__PURE__*/_react["default"].createElement(_antd.Timeline, null, logs.map(function (item, index) {
    var _a, _b;
    var detail;
    var pf;
    var pic;
    if (item === null || item === void 0 ? void 0 : item.processDetail) {
      detail = JSON.parse(item.processDetail);
      pf = [{
        label: '责任单位',
        key: 'thirdResponsibleUnitName',
        value: detail === null || detail === void 0 ? void 0 : detail.thirdResponsibleUnitName
      }, {
        label: '整改时限',
        key: 'reformTimeLimit',
        value: (0, _util.secondToFormatTime)(detail === null || detail === void 0 ? void 0 : detail.reformTimeLimit)
      }, {
        label: '责任人',
        key: 'thirdResponsibleStaffNames',
        value: detail === null || detail === void 0 ? void 0 : detail.thirdResponsibleStaffNames
      }, {
        label: '截止时间',
        key: 'endDateTime',
        value: detail === null || detail === void 0 ? void 0 : detail.endDateTime
      }];
      pic = (detail === null || detail === void 0 ? void 0 : detail.photos) ? JSON.parse(detail.photos) : [];
    }
    return /*#__PURE__*/_react["default"].createElement(_antd.Timeline.Item, {
      color: timelineColor,
      key: index
    }, /*#__PURE__*/_react["default"].createElement("div", {
      className: "timeline"
    }, /*#__PURE__*/_react["default"].createElement("div", {
      className: "timeline-title"
    }, item === null || item === void 0 ? void 0 : item.processTypeStr), /*#__PURE__*/_react["default"].createElement("div", {
      className: "timeline-time"
    }, item === null || item === void 0 ? void 0 : item.processTimeStr)), /*#__PURE__*/_react["default"].createElement("div", {
      className: "timeline-main"
    }, item === null || item === void 0 ? void 0 : item.processContent, /*#__PURE__*/_react["default"].createElement("div", {
      className: "timeline-main-extra"
    }, item.processType == 'Cs' && "\u7ED3\u679C\uFF1A".concat(item.processResultStr, "\uFF1B\u539F\u56E0:").concat(detail === null || detail === void 0 ? void 0 : detail.rejectReason), (item.processType == 'pf' || item.processType == 'Dzg') && (/*#__PURE__*/_react["default"].createElement(_vmInfoCollection["default"], {
      data: pf || [],
      gap: 10,
      width: "48%",
      horizontal: true
    })), (item.processType == 'Tjfk' || item.processType == 'Dzgtjfk') && (/*#__PURE__*/_react["default"].createElement("div", {
      style: {
        color: '#64FFC9',
        display: 'flex',
        justifyContent: 'start'
      }
    }, (pic === null || pic === void 0 ? void 0 : pic.length) > 0 && (/*#__PURE__*/_react["default"].createElement("div", {
      style: {
        width: '80px',
        height: '80px',
        marginRight: '12px'
      }
    }, /*#__PURE__*/_react["default"].createElement(_components.VtxImage, {
      src: "/cloudFile/common/downloadFile?id=".concat((_a = pic[0]) === null || _a === void 0 ? void 0 : _a.id, "&token=").concat((0, _utils.getVtxToken)('token')),
      aspectFit: true,
      emptyText: "\u6682\u65E0\u56FE\u7247",
      errorText: "\u6682\u65E0\u56FE\u7247",
      alt: pic[0].name,
      style: {
        width: '100%',
        height: '100%'
      },
      isDark: true
    }))), /*#__PURE__*/_react["default"].createElement(_vmInfoCollection["default"], {
      data: [{
        key: 'feedbackContent',
        label: '反馈内容',
        value: detail === null || detail === void 0 ? void 0 : detail.feedbackContent
      }]
    }))), item.processType == 'Jgsh' && (/*#__PURE__*/_react["default"].createElement("div", {
      style: {
        color: '#64FFC9',
        display: 'flex',
        justifyContent: 'start'
      }
    }, (pic === null || pic === void 0 ? void 0 : pic.length) > 0 && (/*#__PURE__*/_react["default"].createElement(_components.VtxImage, {
      src: "/cloudFile/common/downloadFile?id=".concat((_b = pic[0]) === null || _b === void 0 ? void 0 : _b.id, "&token=").concat((0, _utils.getVtxToken)('token')),
      style: {
        width: '80px',
        height: '80px',
        marginRight: '12px'
      },
      aspectFit: true,
      emptyText: "\u6682\u65E0\u56FE\u7247",
      errorText: "\u6682\u65E0\u56FE\u7247",
      alt: pic[0].name,
      isDark: true
    })), /*#__PURE__*/_react["default"].createElement(_vmInfoCollection["default"], {
      data: [{
        key: 'processResultStr',
        label: '审批结果',
        value: item === null || item === void 0 ? void 0 : item.processResultStr
      }, {
        key: 'auditOpinion',
        label: '审批意见',
        value: detail === null || detail === void 0 ? void 0 : detail.auditOpinion
      }]
    }))))));
  }))) : (/*#__PURE__*/_react["default"].createElement(_vmNodata["default"], {
    style: {
      marginLeft: '50%',
      transform: 'translateX(-50%)'
    }
  }))))));
};
var _default = exports["default"] = BaseInfo;
//# sourceMappingURL=index.js.map
