"use strict";

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

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

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

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

var _vtxGasEnterpriseModal = _interopRequireDefault(require("../vtx-gas-enterprise-modal"));

var _antd = require("antd");

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

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

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

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 UserJMBaseContent = function UserJMBaseContent(_ref) {
  var _info$location, _info$location$lngLat, _info$supplyProtocolS;

  var info = _ref.info;

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

  var _ref2 = (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(',')) || [],
      _ref3 = _slicedToArray(_ref2, 2),
      lng = _ref3[0],
      lat = _ref3[1];

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

  return /*#__PURE__*/_react["default"].createElement(_components.VtxFormLayout, {
    cols: 2,
    mode: "view"
  }, /*#__PURE__*/_react["default"].createElement(_components.VtxFormLayout.FormItem, {
    label: "\u7528\u6237\u59D3\u540D"
  }, info.name || '--'), /*#__PURE__*/_react["default"].createElement(_components.VtxFormLayout.FormItem, {
    label: "\u8054\u7CFB\u7535\u8BDD"
  }, info.phone || '--'), /*#__PURE__*/_react["default"].createElement(_components.VtxFormLayout.FormItem, {
    label: "\u884C\u653F\u533A\u5212"
  }, info.regionName || '--'), /*#__PURE__*/_react["default"].createElement(_components.VtxFormLayout.FormItem, {
    label: "\u8BE6\u7EC6\u5730\u5740"
  }, info.address || '--'), /*#__PURE__*/_react["default"].createElement(_components.VtxFormLayout.FormItem, {
    label: "\u4F9B\u6C14\u4F01\u4E1A"
  }, /*#__PURE__*/_react["default"].createElement(_vtxGasEnterpriseModal["default"], {
    id: info.supplyCompanyId,
    label: info.supplyCompanyName
  })), /*#__PURE__*/_react["default"].createElement(_components.VtxFormLayout.FormItem, {
    label: "\u6240\u5C5E\u5C0F\u533A"
  }, info.villageName || '--'), /*#__PURE__*/_react["default"].createElement(_components.VtxFormLayout.FormItem, {
    label: "\u4F9B\u6C14\u534F\u8BAE\u7B7E\u8BA2\u65F6\u95F4"
  }, info.supplyProtocolSignDate || '--'), /*#__PURE__*/_react["default"].createElement(_components.VtxFormLayout.FormItem, {
    label: "\u4F9B\u6C14\u534F\u8BAE\u5230\u671F\u65F6\u95F4"
  }, info.supplyProtocolExpireDate || '--'), /*#__PURE__*/_react["default"].createElement(_components.VtxFormLayout.FormItem, {
    label: "\u4F9B\u6C14\u534F\u8BAE"
  }, info.supplyProtocolFileId ? JSON.parse(info.supplyProtocolFileId).map(function (item, i) {
    return /*#__PURE__*/_react["default"].createElement(_antd.Image, {
      width: 100,
      key: i,
      src: "/cloudFile/common/downloadFile?id=".concat(item.id)
    });
  }) : '--'), lng && lat && /*#__PURE__*/_react["default"].createElement("div", {
    style: {
      width: '100%',
      height: 200
    }
  }, /*#__PURE__*/_react["default"].createElement(_map.VtxMap, {
    mapId: "userJM",
    mapType: mapInfo.mapType,
    mapCenter: [lng, lat],
    mapZoomLevel: 15,
    mapPoints: [{
      id: '1',
      longitude: lng,
      latitude: lat
    }],
    mapStyle: theme === 'dark' ? theme : ''
  })), /*#__PURE__*/_react["default"].createElement("div", {
    style: {
      width: '100%',
      marginTop: '20px',
      padding: '20px'
    }
  }, /*#__PURE__*/_react["default"].createElement(_antd.Descriptions, {
    bordered: true,
    column: 2
  }, /*#__PURE__*/_react["default"].createElement(_antd.Descriptions.Item, {
    label: "\u6240\u5C5E\u95E8\u5E97"
  }, info.storeId || '--'), /*#__PURE__*/_react["default"].createElement(_antd.Descriptions.Item, {
    label: "\u662F\u5426\u4E3A\u79DF\u6237"
  }, info.whetherTenant === true ? '是' : '否'), /*#__PURE__*/_react["default"].createElement(_antd.Descriptions.Item, {
    label: "\u6237\u53F7"
  }, info.enterpriseNo || '--'), /*#__PURE__*/_react["default"].createElement(_antd.Descriptions.Item, {
    label: "\u8EAB\u4EFD\u8BC1\u53F7"
  }, info.idCard || '--'), /*#__PURE__*/_react["default"].createElement(_antd.Descriptions.Item, {
    label: "\u4F9B\u6C14\u534F\u8BAE\u72B6\u6001"
  }, ((_info$supplyProtocolS = info.supplyProtocolStatus) === null || _info$supplyProtocolS === void 0 ? void 0 : _info$supplyProtocolS.value) || '--'), /*#__PURE__*/_react["default"].createElement(_antd.Descriptions.Item, {
    label: "\u5907\u6CE8"
  }, info.remark || '--'))));
};

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