"use strict";

function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }

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

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

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

var _api = require("./api");

var _antd = require("antd");

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

var _index = _interopRequireDefault(require("./style/index.less"));

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

var _vtxGasSupplyStationModal = _interopRequireDefault(require("../vtx-gas-supply-station-modal"));

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

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

function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }

function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }

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(_ref) {
  var id = _ref.id;

  var _useState = (0, _react.useState)({}),
      _useState2 = _slicedToArray(_useState, 2),
      info = _useState2[0],
      setInfo = _useState2[1];

  (0, _react.useEffect)(function () {
    if (id) {
      (0, _api.getInfo)(id).then(function (data) {
        setInfo(data);
      });
    }
  }, [id]);
  return /*#__PURE__*/_react["default"].createElement(_antd.Form, {
    layout: "inline"
  }, /*#__PURE__*/_react["default"].createElement(_components.VtxFormLayout, {
    mode: "view",
    cols: 3,
    card: true
  }, /*#__PURE__*/_react["default"].createElement(_components.VtxFormLayout.Card, {
    title: "\u5236\u9020\u4FE1\u606F"
  }, /*#__PURE__*/_react["default"].createElement(_components.VtxFormLayout.FormItem, {
    label: "\u89C4\u683C\uFF08kg\uFF09",
    name: "specification"
  }, info.specification ? info.specification.value : '--'), /*#__PURE__*/_react["default"].createElement(_components.VtxFormLayout.FormItem, {
    label: "\u5145\u88C5\u4ECB\u8D28",
    name: "fillingMedium"
  }, info.fillingMedium ? info.fillingMedium.value : '--'), /*#__PURE__*/_react["default"].createElement(_components.VtxFormLayout.FormItem, {
    label: "\u5236\u9020\u5355\u4F4D",
    name: "manufacturingCompany"
  }, info.manufacturingCompany || '--'), /*#__PURE__*/_react["default"].createElement(_components.VtxFormLayout.FormItem, {
    label: "\u5236\u9020\u5E74\u6708",
    name: "manufacturingDate"
  }, info.manufacturingDate || '--'), /*#__PURE__*/_react["default"].createElement(_components.VtxFormLayout.FormItem, {
    label: "\u51FA\u5382\u7F16\u53F7",
    name: "productNo"
  }, info.productNo || '--'), /*#__PURE__*/_react["default"].createElement(_components.VtxFormLayout.FormItem, {
    label: "\u516C\u79F0\u538B\u529B\uFF08MPa\uFF09",
    name: "nominalPressure"
  }, info.nominalPressure || '--'), /*#__PURE__*/_react["default"].createElement(_components.VtxFormLayout.FormItem, {
    label: "\u5BB9\u79EF\uFF08L\uFF09",
    name: "volume"
  }, info.volume ? info.volume.value : '--'), /*#__PURE__*/_react["default"].createElement(_components.VtxFormLayout.FormItem, {
    label: "\u58C1\u539A\uFF08mm\uFF09",
    name: "wallThickness"
  }, info.wallThickness || '--'), /*#__PURE__*/_react["default"].createElement(_components.VtxFormLayout.FormItem, {
    label: "\u76AE\u91CD\uFF08kg\uFF09",
    name: "outWeight"
  }, info.outWeight || '--'), /*#__PURE__*/_react["default"].createElement(_components.VtxFormLayout.FormItem, {
    label: "\u79CD\u7C7B",
    name: "bottleType"
  }, info.bottleType ? info.bottleType.value : '--'), /*#__PURE__*/_react["default"].createElement(_components.VtxFormLayout.FormItem, {
    label: "\u6C14\u74F6\u7C7B\u578B",
    name: "bottleStyle"
  }, info.bottleStyle ? info.bottleStyle.value : '--')), /*#__PURE__*/_react["default"].createElement(_components.VtxFormLayout.Card, {
    title: "\u68C0\u9A8C\u4FE1\u606F"
  }, /*#__PURE__*/_react["default"].createElement(_components.VtxFormLayout.FormItem, {
    label: "\u672B\u68C0\u5E74\u6708",
    name: "checkDate"
  }, info.checkDate || '--'), /*#__PURE__*/_react["default"].createElement(_components.VtxFormLayout.FormItem, {
    label: "\u4E0B\u68C0\u5E74\u6708",
    name: "nextCheckDate"
  }, info.nextCheckDate || '--'), /*#__PURE__*/_react["default"].createElement(_components.VtxFormLayout.FormItem, {
    label: "\u62A5\u5E9F\u5E74\u6708",
    name: "scrapDate"
  }, info.scrapDate || '--')), /*#__PURE__*/_react["default"].createElement(_components.VtxFormLayout.Card, {
    title: "\u4F7F\u7528\u767B\u8BB0\u4FE1\u606F"
  }, /*#__PURE__*/_react["default"].createElement(_components.VtxFormLayout.FormItem, {
    label: "\u76D1\u7BA1\u90E8\u95E8",
    name: "supervisionOrg"
  }, info.supervisionOrg || '--'), /*#__PURE__*/_react["default"].createElement(_components.VtxFormLayout.FormItem, {
    label: "\u71C3\u6C14\u4F01\u4E1A",
    name: "gasCompanyName"
  }, /*#__PURE__*/_react["default"].createElement(_vtxGasEnterpriseModal["default"], {
    id: info.gasCompanyId,
    label: info.gasCompanyName
  })), (0, _utils.getUrlParam)().carqFlag == 'true' ? '' : /*#__PURE__*/_react["default"].createElement(_components.VtxFormLayout.FormItem, {
    label: "\u50A8\u914D\u7AD9",
    name: "stationName"
  }, /*#__PURE__*/_react["default"].createElement(_vtxGasSupplyStationModal["default"], {
    id: info.stationId,
    label: info.stationName
  })), /*#__PURE__*/_react["default"].createElement(_components.VtxFormLayout.FormItem, {
    label: "\u6C14\u74F6\u6761\u7801\u53F7",
    name: "bottleNo"
  }, info.bottleNo || '--'), /*#__PURE__*/_react["default"].createElement(_components.VtxFormLayout.FormItem, {
    label: "\u81EA\u6709\u7F16\u53F7",
    name: "selfNo"
  }, info.selfNo || '--'), /*#__PURE__*/_react["default"].createElement(_components.VtxFormLayout.FormItem, {
    label: "\u4F7F\u7528\u767B\u8BB0\u4EE3\u7801",
    name: "registerNo"
  }, info.registerNo || '--'), /*#__PURE__*/_react["default"].createElement(_components.VtxFormLayout.FormItem, {
    label: "\u767B\u8BB0\u65F6\u95F4",
    name: "registerTime"
  }, info.registerTime || '--'), /*#__PURE__*/_react["default"].createElement(_components.VtxFormLayout.FormItem, {
    label: "\u5907\u6CE8\u8BF4\u660E",
    name: "remark"
  }, info.remark || '--'), /*#__PURE__*/_react["default"].createElement(_components.VtxFormLayout.FormItem, {
    label: "\u8FC7\u671F\u62A5\u5E9F\u72B6\u6001",
    name: "bottleStatus"
  }, info.bottleStatus ? info.bottleStatus.value : '--'), /*#__PURE__*/_react["default"].createElement(_components.VtxFormLayout.FormItem, {
    label: "\u4F7F\u7528\u72B6\u6001",
    name: "bottleUseStatus"
  }, info.bottleUseStatus ? info.bottleUseStatus.value : '--'), /*#__PURE__*/_react["default"].createElement(_components.VtxFormLayout.FormItem, {
    label: "\u521B\u5EFA\u65F6\u95F4",
    name: "createDate"
  }, info.createDate || '--'), /*#__PURE__*/_react["default"].createElement(_components.VtxFormLayout.FormItem, {
    label: "\u66F4\u65B0\u65E5\u671F",
    name: "updateDate"
  }, info.updateDate || '--')), /*#__PURE__*/_react["default"].createElement(_components.VtxFormLayout.Card, {
    title: "\u5EFA\u6863\u56FE\u7247"
  }, /*#__PURE__*/_react["default"].createElement(_components.VtxFormLayout.FormItem, {
    label: "\u6C14\u74F6\u56FE\u7247",
    name: "bottlePictureFileId",
    weights: 3
  }, /*#__PURE__*/_react["default"].createElement("div", {
    className: _index["default"].img
  }, info.bottlePictureFileId ? JSON.parse(info.bottlePictureFileId).map(function (item, i) {
    return /*#__PURE__*/_react["default"].createElement(_antd.Image, {
      width: 100,
      key: i,
      src: "/cloudFile/common/downloadFile?id=".concat(item.id)
    });
  }) : '--')))));
};

BaseContent.propTypes = {
  id: _propTypes["default"].string.isRequired
};
var _default = BaseContent;
exports["default"] = _default;
//# sourceMappingURL=baseContent.js.map
