"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports["default"] = void 0;

var _components = require("@vtx/components");

var _antd = require("antd");

var _react = _interopRequireDefault(require("react"));

var _propTypes = _interopRequireDefault(require("prop-types"));

var _map = require("@vtx/map");

var _useMapInfo2 = _interopRequireDefault(require("../vm-hooks/useMapInfo"));

var _useSettings2 = _interopRequireDefault(require("../vm-hooks/useSettings"));

var _utils = require("@vtx/utils");

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }

function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }

function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }

function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }

function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }

function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }

function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }

var BaseContent = function BaseContent(props) {
  var _info$location, _info$location$lngLat;

  var info = props.info;

  var _useMapInfo = (0, _useMapInfo2["default"])(),
      mapInfo = _useMapInfo.mapInfo;

  var _ref = (info === null || info === void 0 ? void 0 : (_info$location = info.location) === null || _info$location === void 0 ? void 0 : (_info$location$lngLat = _info$location.lngLats) === null || _info$location$lngLat === void 0 ? void 0 : _info$location$lngLat.split(',')) || [],
      _ref2 = _slicedToArray(_ref, 2),
      lng = _ref2[0],
      lat = _ref2[1];

  var name = info.name,
      address = info.address,
      creditCode = info.creditCode,
      regionStr = info.regionStr,
      remark = info.remark,
      legalPersonName = info.legalPersonName,
      legalPersonPhone = info.legalPersonPhone,
      contactPersonName = info.contactPersonName,
      legalPersonIdCard = info.legalPersonIdCard,
      contactPersonIdCard = info.contactPersonIdCard,
      safeHeader = info.safeHeader,
      safeHeaderPhone = info.safeHeaderPhone,
      safeHeaderIdCard = info.safeHeaderIdCard,
      techHeader = info.techHeader,
      techHeaderPhone = info.techHeaderPhone,
      techHeaderIdCard = info.techHeaderIdCard,
      license = info.license,
      licenseValidityPeriodStart = info.licenseValidityPeriodStart,
      contactPersonPhone = info.contactPersonPhone,
      licenseValidityPeriodEnd = info.licenseValidityPeriodEnd,
      gasStaffCount = info.gasStaffCount,
      companyTypeStr = info.companyTypeStr,
      gasBottleCount = info.gasBottleCount,
      storageAndDistributionStationsCount = info.storageAndDistributionStationsCount,
      supplyStationCount = info.supplyStationCount,
      gasUserCount = info.gasUserCount,
      stationCount = info.stationCount;

  var _useSettings = (0, _useSettings2["default"])(),
      theme = _useSettings.theme;

  return /*#__PURE__*/_react["default"].createElement(_antd.Form, {
    layout: "inline"
  }, /*#__PURE__*/_react["default"].createElement(_components.VtxFormLayout, {
    mode: "view"
  }, /*#__PURE__*/_react["default"].createElement(_components.VtxFormLayout.Pane, {
    title: "\u57FA\u672C\u4FE1\u606F"
  }, /*#__PURE__*/_react["default"].createElement(_components.VtxFormLayout.FormItem, {
    label: "\u4F01\u4E1A\u540D\u79F0"
  }, name || '--'), /*#__PURE__*/_react["default"].createElement(_components.VtxFormLayout.FormItem, {
    label: "\u4F01\u4E1A\u7C7B\u578B"
  }, companyTypeStr || '--'), /*#__PURE__*/_react["default"].createElement(_components.VtxFormLayout.FormItem, {
    label: "\u6240\u5728\u533A\u5212",
    name: "workCode"
  }, regionStr || '--'), ' ', /*#__PURE__*/_react["default"].createElement(_components.VtxFormLayout.FormItem, {
    label: "\u8BE6\u7EC6\u5730\u5740"
  }, address || '--'), /*#__PURE__*/_react["default"].createElement(_components.VtxFormLayout.FormItem, {
    label: "\u7EDF\u4E00\u793E\u4F1A\u4FE1\u7528\u4EE3\u7801"
  }, creditCode || '--'), /*#__PURE__*/_react["default"].createElement(_components.VtxFormLayout.FormItem, {
    label: "\u6CD5\u4EBA\u4EE3\u8868",
    name: "storageAndDistributionStationName"
  }, legalPersonName || '--'), /*#__PURE__*/_react["default"].createElement(_components.VtxFormLayout.FormItem, {
    label: "\u6CD5\u4EBA\u8054\u7CFB\u7535\u8BDD"
  }, legalPersonPhone || '--'), /*#__PURE__*/_react["default"].createElement(_components.VtxFormLayout.FormItem, {
    label: "\u6CD5\u4EBA\u4EE3\u8868\u8EAB\u4EFD\u8BC1\u53F7\u7801"
  }, legalPersonIdCard || '--'), /*#__PURE__*/_react["default"].createElement(_components.VtxFormLayout.FormItem, {
    label: "\u8054\u7CFB\u4EBA"
  }, contactPersonName || '--'), /*#__PURE__*/_react["default"].createElement(_components.VtxFormLayout.FormItem, {
    label: "\u8054\u7CFB\u4EBA\u7535\u8BDD"
  }, contactPersonPhone || '--'), /*#__PURE__*/_react["default"].createElement(_components.VtxFormLayout.FormItem, {
    label: "\u8054\u7CFB\u4EBA\u8EAB\u4EFD\u8BC1\u53F7\u7801"
  }, contactPersonIdCard || '--'), (0, _utils.getUrlParam)().carqFlag == 'true' ? /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement(_components.VtxFormLayout.FormItem, {
    label: "\u5B89\u5168\u8D1F\u8D23\u4EBA"
  }, safeHeader || '--'), /*#__PURE__*/_react["default"].createElement(_components.VtxFormLayout.FormItem, {
    label: "\u5B89\u5168\u8D1F\u8D23\u4EBA\u7535\u8BDD"
  }, safeHeaderPhone || '--'), /*#__PURE__*/_react["default"].createElement(_components.VtxFormLayout.FormItem, {
    label: "\u5B89\u5168\u8D1F\u8D23\u4EBA\u8EAB\u4EFD\u8BC1\u53F7"
  }, safeHeaderIdCard || '--'), /*#__PURE__*/_react["default"].createElement(_components.VtxFormLayout.FormItem, {
    label: "\u6280\u672F\u8D1F\u8D23\u4EBA"
  }, techHeader || '--'), /*#__PURE__*/_react["default"].createElement(_components.VtxFormLayout.FormItem, {
    label: "\u6280\u672F\u8D1F\u8D23\u4EBA\u7535\u8BDD"
  }, techHeaderPhone || '--'), /*#__PURE__*/_react["default"].createElement(_components.VtxFormLayout.FormItem, {
    label: "\u6280\u672F\u8D1F\u8D23\u4EBA\u8EAB\u4EFD\u8BC1\u53F7"
  }, techHeaderIdCard || '--')) : '', /*#__PURE__*/_react["default"].createElement(_components.VtxFormLayout.FormItem, {
    label: "\u8BB8\u53EF\u8BC1\u7F16\u53F7"
  }, license || '--'), /*#__PURE__*/_react["default"].createElement(_components.VtxFormLayout.FormItem, {
    label: "\u8BB8\u53EF\u8BC1\u6709\u6548\u671F"
  }, licenseValidityPeriodStart && licenseValidityPeriodEnd ? "".concat(licenseValidityPeriodStart, "~").concat(licenseValidityPeriodEnd) : '--'), /*#__PURE__*/_react["default"].createElement(_components.VtxFormLayout.FormItem, {
    label: "\u5907\u6CE8",
    weights: 2
  }, remark || '--'), lng && lat && /*#__PURE__*/_react["default"].createElement("div", {
    style: {
      width: '100%',
      height: 200
    }
  }, /*#__PURE__*/_react["default"].createElement(_map.VtxMap, {
    mapId: "enterprise",
    mapType: mapInfo.mapType,
    mapCenter: [lng, lat],
    mapZoomLevel: 15,
    mapPoints: [{
      id: '1',
      longitude: lng,
      latitude: lat
    }],
    mapStyle: theme === 'dark' ? theme : ''
  }))), /*#__PURE__*/_react["default"].createElement(_components.VtxFormLayout.Divider, null), /*#__PURE__*/_react["default"].createElement(_components.VtxFormLayout.Pane, {
    title: "\u6863\u6848\u4FE1\u606F"
  }, /*#__PURE__*/_react["default"].createElement(_components.VtxFormLayout.FormItem, {
    label: "\u6C14\u74F6\u6570\u91CF"
  }, gasBottleCount), /*#__PURE__*/_react["default"].createElement(_components.VtxFormLayout.FormItem, {
    label: "\u4ECE\u4E1A\u4EBA\u5458\u6570\u91CF"
  }, gasStaffCount), /*#__PURE__*/_react["default"].createElement(_components.VtxFormLayout.FormItem, {
    label: "\u573A\u7AD9\u6570\u91CF"
  }, stationCount), /*#__PURE__*/_react["default"].createElement(_components.VtxFormLayout.FormItem, {
    label: "\u50A8\u914D\u7AD9\u6570\u91CF"
  }, storageAndDistributionStationsCount), /*#__PURE__*/_react["default"].createElement(_components.VtxFormLayout.FormItem, {
    label: "\u4F9B\u5E94\u7AD9\u6570\u91CF"
  }, supplyStationCount), /*#__PURE__*/_react["default"].createElement(_components.VtxFormLayout.FormItem, {
    label: "\u7528\u6237\u6570\u91CF"
  }, gasUserCount))));
};

BaseContent.propTypes = {
  info: _propTypes["default"].object.isRequired
};
var _default = BaseContent;
exports["default"] = _default;
//# sourceMappingURL=base.js.map
