"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 _vmCard = _interopRequireDefault(require("../../../vm-card"));
var _react = _interopRequireWildcard(require("react"));
var _vmInfoCollection = _interopRequireDefault(require("../../../vm-info-collection"));
var _index = require("../../index");
var _antd = require("antd");
var _QdContract = _interopRequireDefault(require("../QdContract"));
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, "default": e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
function _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); }
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread 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 _iterableToArray(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); }
function _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); }
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; }
var signColorMap = {
  0: 'blue',
  1: 'green',
  2: 'orange',
  3: 'gray'
};
var QdSign = function QdSign() {
  var _useContext = (0, _react.useContext)(_index.RestaurantContext),
    info = _useContext.info;
  var ccSignStatusStr = info.ccSignStatusStr,
    ccSignStatus = info.ccSignStatus,
    ccSignUnitName = info.ccSignUnitName,
    wasteGrease = info.wasteGrease,
    syPointName = info.syPointName,
    collectStatusStr = info.collectStatusStr,
    fqyzSignStatusStr = info.fqyzSignStatusStr,
    fqyzSignUnitName = info.fqyzSignUnitName,
    fqyzSignStatus = info.fqyzSignStatus;
  var dataSource = [{
    label: '餐厨垃圾签约状态',
    value: ccSignStatusStr,
    key: 'ccSignStatusStr',
    render: function render() {
      return /*#__PURE__*/_react["default"].createElement(_antd.Space, {
        style: {
          height: '100%'
        }
      }, /*#__PURE__*/_react["default"].createElement(_antd.Badge, {
        color: signColorMap[ccSignStatus]
      }), ccSignStatusStr);
    }
  }].concat(_toConsumableArray(ccSignStatus === 1 ? [{
    label: '收运单位',
    value: ccSignUnitName,
    key: 'ccSignUnitName'
  }, {
    label: '收集类型',
    value: collectStatusStr,
    key: 'collectStatusStr'
  }, {
    label: '收集点',
    value: syPointName,
    key: 'syPointName'
  }] : []));
  var dataSource2 = [{
    label: '废弃油脂签约状态',
    value: fqyzSignStatusStr,
    key: 'fqyzSignStatusStr',
    render: function render() {
      return /*#__PURE__*/_react["default"].createElement(_antd.Space, {
        style: {
          height: '100%'
        }
      }, /*#__PURE__*/_react["default"].createElement(_antd.Badge, {
        color: signColorMap[fqyzSignStatus]
      }), fqyzSignStatusStr);
    }
  }].concat(_toConsumableArray(fqyzSignStatus === 1 ? [{
    label: '收运单位',
    value: fqyzSignUnitName,
    key: 'fqyzSignUnitName'
  }] : []));
  return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement(_antd.Row, {
    style: {
      padding: 10
    },
    gutter: [10, 10]
  }, /*#__PURE__*/_react["default"].createElement(_antd.Col, {
    span: 24
  }, /*#__PURE__*/_react["default"].createElement(_vmCard["default"], null, /*#__PURE__*/_react["default"].createElement(_vmInfoCollection["default"], {
    data: dataSource,
    horizontal: true,
    width: '33%',
    ellipsis: true
  }))), wasteGrease && (/*#__PURE__*/_react["default"].createElement(_antd.Col, {
    span: 24
  }, /*#__PURE__*/_react["default"].createElement(_vmCard["default"], null, /*#__PURE__*/_react["default"].createElement(_vmInfoCollection["default"], {
    data: dataSource2,
    horizontal: true,
    width: '33%',
    ellipsis: true
  }))))), /*#__PURE__*/_react["default"].createElement(_QdContract["default"], null));
};
var _default = exports["default"] = QdSign;
//# sourceMappingURL=index.js.map
