"use strict";

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); }
Object.defineProperty(exports, "__esModule", {
  value: true
});
exports["default"] = void 0;
var _react = _interopRequireWildcard(require("react"));
require("../index.less");
var _classnames = _interopRequireDefault(require("classnames"));
var _dswsj = _interopRequireDefault(require("../../../imgs/2/dswsj.png"));
var _mys = _interopRequireDefault(require("../../../imgs/2/mys.png"));
var _zsp = _interopRequireDefault(require("../../../imgs/2/zsp.png"));
var _male = _interopRequireDefault(require("../../../imgs/2/male.png"));
var _female = _interopRequireDefault(require("../../../imgs/2/female.png"));
var _xbd = _interopRequireDefault(require("../../../imgs/2/xbd.png"));
var _dws = _interopRequireDefault(require("../../../imgs/2/dws.png"));
var _zws = _interopRequireDefault(require("../../../imgs/2/zws.png"));
var _wza = _interopRequireDefault(require("../../../imgs/2/wza.png"));
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n["default"] = e, t && t.set(e, n), n; }
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _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(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
var PTSS = function PTSS(props) {
  var _a, _b, _c, _d, _e, _f, _g, _h, _j;
  var fields = props.fields,
    detail = props.detail;
  var _useState = (0, _react.useState)([]),
    _useState2 = _slicedToArray(_useState, 2),
    config = _useState2[0],
    setConfig = _useState2[1];
  (0, _react.useEffect)(function () {
    if (fields.length) {
      setConfig(fields.map(function (item) {
        return item.showKey;
      }));
    }
  }, [fields]);
  var summaryList = [{
    key: 'dswsj',
    name: '第三卫生间',
    img: _dswsj["default"],
    value: 'hasThird'
  }, {
    key: 'mys',
    name: '母婴室',
    img: _mys["default"],
    value: 'hasNursery'
  }, {
    key: 'zsp',
    name: '指示牌',
    img: _zsp["default"],
    value: 'hasSign'
  }];
  return /*#__PURE__*/_react["default"].createElement("div", {
    className: "ptss"
  }, /*#__PURE__*/_react["default"].createElement("div", {
    className: "wrTitle"
  }, "\u914D\u5957\u8BBE\u65BD"), /*#__PURE__*/_react["default"].createElement("div", {
    className: "wrContent"
  }, /*#__PURE__*/_react["default"].createElement("div", {
    className: "summary"
  }, summaryList.map(function (item, index) {
    return /*#__PURE__*/_react["default"].createElement("div", {
      key: item.key,
      className: "summaryItem",
      style: {
        width: index === 0 ? '36%' : '32%',
        borderLeft: index === 1 ? '1px solid #e8e8e8' : 'none',
        borderRight: index === 1 ? '1px solid #e8e8e8' : 'none'
      }
    }, /*#__PURE__*/_react["default"].createElement("span", null, /*#__PURE__*/_react["default"].createElement("img", {
      src: item.img,
      alt: item.key
    }), item.name), /*#__PURE__*/_react["default"].createElement("span", {
      className: (0, _classnames["default"])('has', {
        'hasNo': !detail[item.value]
      })
    }, detail[item.value] ? '有' : '无'));
  })), /*#__PURE__*/_react["default"].createElement("div", {
    className: "genderNum"
  }, /*#__PURE__*/_react["default"].createElement("div", {
    className: "genderItem"
  }, /*#__PURE__*/_react["default"].createElement("div", {
    className: "totalNum"
  }, /*#__PURE__*/_react["default"].createElement("span", {
    className: "gender"
  }, /*#__PURE__*/_react["default"].createElement("img", {
    src: _male["default"],
    alt: "male"
  }), /*#__PURE__*/_react["default"].createElement("div", null, /*#__PURE__*/_react["default"].createElement("div", null, "\u7537\u5395"), /*#__PURE__*/_react["default"].createElement("div", {
    style: {
      color: '#8c8c8c'
    }
  }, "MALE"))), config.includes('manPitNum') && /*#__PURE__*/_react["default"].createElement("div", null, /*#__PURE__*/_react["default"].createElement("div", {
    style: {
      fontSize: '24px',
      fontWeight: 700
    }
  }, (_a = detail.pitTotalMale) !== null && _a !== void 0 ? _a : '-'), /*#__PURE__*/_react["default"].createElement("div", {
    style: {
      color: '#8c8c8c'
    }
  }, "\u5751\u4F4D\u603B\u6570"))), /*#__PURE__*/_react["default"].createElement("div", {
    className: "eachType"
  }, config.includes('urinalNums') && /*#__PURE__*/_react["default"].createElement("div", null, /*#__PURE__*/_react["default"].createElement("img", {
    src: _xbd["default"],
    alt: "xbd"
  }), /*#__PURE__*/_react["default"].createElement("div", {
    style: {
      fontSize: '24px',
      fontWeight: 700
    }
  }, (_b = detail.urinalNums) !== null && _b !== void 0 ? _b : '-'), /*#__PURE__*/_react["default"].createElement("div", null, "\u5C0F\u4FBF\u6597")), config.includes('manSquatNums') && /*#__PURE__*/_react["default"].createElement("div", null, /*#__PURE__*/_react["default"].createElement("img", {
    src: _dws["default"],
    alt: "dws"
  }), /*#__PURE__*/_react["default"].createElement("div", {
    style: {
      fontSize: '24px',
      fontWeight: 700
    }
  }, (_c = detail.squatNumMale) !== null && _c !== void 0 ? _c : '-'), /*#__PURE__*/_react["default"].createElement("div", null, "\u8E72\u4F4D\u6570")), config.includes('manSitNums') && /*#__PURE__*/_react["default"].createElement("div", null, /*#__PURE__*/_react["default"].createElement("img", {
    src: _zws["default"],
    alt: "zws"
  }), /*#__PURE__*/_react["default"].createElement("div", {
    style: {
      fontSize: '24px',
      fontWeight: 700
    }
  }, (_d = detail.seatNumMale) !== null && _d !== void 0 ? _d : '-'), /*#__PURE__*/_react["default"].createElement("div", null, "\u5EA7\u4F4D\u6570")), config.includes('manAccessibilityNums') && /*#__PURE__*/_react["default"].createElement("div", null, /*#__PURE__*/_react["default"].createElement("img", {
    src: _wza["default"],
    alt: "wza"
  }), /*#__PURE__*/_react["default"].createElement("div", {
    style: {
      fontSize: '24px',
      fontWeight: 700
    }
  }, (_e = detail.manAccessibilityNumsMale) !== null && _e !== void 0 ? _e : '-'), /*#__PURE__*/_react["default"].createElement("div", null, "\u65E0\u969C\u788D")))), /*#__PURE__*/_react["default"].createElement("div", {
    className: "genderItem"
  }, /*#__PURE__*/_react["default"].createElement("div", {
    className: "totalNum"
  }, /*#__PURE__*/_react["default"].createElement("span", {
    className: "gender"
  }, /*#__PURE__*/_react["default"].createElement("img", {
    src: _female["default"],
    alt: "female"
  }), /*#__PURE__*/_react["default"].createElement("div", null, /*#__PURE__*/_react["default"].createElement("div", null, "\u5973\u5395"), /*#__PURE__*/_react["default"].createElement("div", {
    style: {
      color: '#8c8c8c'
    }
  }, "FEMALE"))), config.includes('womanPitNum') && /*#__PURE__*/_react["default"].createElement("div", null, /*#__PURE__*/_react["default"].createElement("div", {
    style: {
      fontSize: '24px',
      fontWeight: 700
    }
  }, (_f = detail.pitTotalFemale) !== null && _f !== void 0 ? _f : '-'), /*#__PURE__*/_react["default"].createElement("div", {
    style: {
      color: '#8c8c8c'
    }
  }, "\u5751\u4F4D\u603B\u6570"))), /*#__PURE__*/_react["default"].createElement("div", {
    className: "eachType",
    style: {
      justifyContent: 'space-around'
    }
  }, config.includes('womanSquatNums') && /*#__PURE__*/_react["default"].createElement("div", null, /*#__PURE__*/_react["default"].createElement("img", {
    src: _dws["default"],
    alt: "dws"
  }), /*#__PURE__*/_react["default"].createElement("div", {
    style: {
      fontSize: '24px',
      fontWeight: 700
    }
  }, (_g = detail.squatNumFemale) !== null && _g !== void 0 ? _g : '-'), /*#__PURE__*/_react["default"].createElement("div", null, "\u8E72\u4F4D\u6570")), config.includes('womanSitNums') && /*#__PURE__*/_react["default"].createElement("div", null, /*#__PURE__*/_react["default"].createElement("img", {
    src: _zws["default"],
    alt: "zws"
  }), /*#__PURE__*/_react["default"].createElement("div", {
    style: {
      fontSize: '24px',
      fontWeight: 700
    }
  }, (_h = detail.seatNumFemale) !== null && _h !== void 0 ? _h : '-'), /*#__PURE__*/_react["default"].createElement("div", null, "\u5EA7\u4F4D\u6570")), config.includes('womanAccessibilityNums') && /*#__PURE__*/_react["default"].createElement("div", null, /*#__PURE__*/_react["default"].createElement("img", {
    src: _wza["default"],
    alt: "wza"
  }), /*#__PURE__*/_react["default"].createElement("div", {
    style: {
      fontSize: '24px',
      fontWeight: 700
    }
  }, (_j = detail.womanAccessibilityNumsFemale) !== null && _j !== void 0 ? _j : '-'), /*#__PURE__*/_react["default"].createElement("div", null, "\u65E0\u969C\u788D")))))));
};
var _default = exports["default"] = PTSS;
//# sourceMappingURL=Ptss.js.map
