"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports["default"] = void 0;
var _react = _interopRequireDefault(require("react"));
var _vtxBaseModal = _interopRequireDefault(require("../vtx-base-modal"));
var _components = require("./components");
var _api = require("./api");
require("../style");
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } /**
 * 整改弹窗
 */
var TABS_BASE = 'zg-base';
var VtxZgModal = function VtxZgModal(props) {
  var id = props.id,
    title = props.title,
    visible = props.visible,
    theme = props.theme,
    onCancel = props.onCancel,
    mapCenter = props.mapCenter,
    customMapInfo = props.customMapInfo;
  // const [statusName, setStatusName] = useState(null);
  var _BaseService$useBaseI = _api.BaseService.useBaseInfo(id),
    baseInfo = _BaseService$useBaseI.baseInfo,
    photos = _BaseService$useBaseI.photos,
    feedbackPhotos = _BaseService$useBaseI.feedbackPhotos,
    logs = _BaseService$useBaseI.logs,
    baseInfoRes = _BaseService$useBaseI.baseInfoRes;
  var statusName = /*#__PURE__*/_react["default"].createElement("span", null);
  if (baseInfoRes) {
    var status = baseInfoRes === null || baseInfoRes === void 0 ? void 0 : baseInfoRes.orderStatus;
    var color = '',
      bg = '';
    switch (status) {
      case 'Zgtg':
        color = '#52C41A';
        bg = 'rgba(82, 196, 26, 0.2)';
        break;
      case 'Zgbtg':
        color = '#FF4D4F';
        bg = 'rgba(255, 77, 79, 0.2)';
        break;
      case 'Dzgz':
        color = '#1890FF';
        bg = 'rgba(24, 144, 255, 0.2)';
        break;
      case 'Bzg':
        color = '#999999';
        bg = 'rgba(153, 153, 153, 0.2)';
        break;
      default:
        color = '#FAAD14';
        bg = 'rgba(250, 173, 20, 0.2)';
        break;
    }
    if (color) {
      statusName = /*#__PURE__*/_react["default"].createElement("div", {
        className: "zg-status-subtitle",
        style: {
          color: color,
          borderColor: color,
          background: bg
        }
      }, "".concat(baseInfoRes.orderStatusStr));
    }
  }
  return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, visible && (/*#__PURE__*/_react["default"].createElement(_vtxBaseModal["default"], {
    id: id,
    type: "facility",
    title: title,
    subTitle: statusName,
    width: 1238,
    theme: theme,
    visible: visible,
    onCancel: onCancel,
    tabs: [{
      key: TABS_BASE,
      title: '总览信息'
    }],
    contents: _defineProperty({}, TABS_BASE, /*#__PURE__*/_react["default"].createElement(_components.BaseInfo, {
      id: id,
      mapCenter: mapCenter,
      baseInfo: baseInfo,
      photos: photos,
      feedbackPhotos: feedbackPhotos,
      logs: logs,
      customMapInfo: customMapInfo
    }))
  })));
};
var _default = exports["default"] = VtxZgModal;
//# sourceMappingURL=index.js.map
