"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"));
var _api = require("../../api");
var _vmCard = _interopRequireDefault(require("../../../vm-card"));
var _index = require("../../index");
var _vmInfoCollection = _interopRequireDefault(require("../../../vm-info-collection"));
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
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); }
var CollectRule = function CollectRule() {
  var _useContext = (0, _react.useContext)(_index.RestaurantContext),
    data = _useContext.info,
    openCar = _useContext.openCar,
    openSyPoint = _useContext.openSyPoint;
  var carRouteList = _api.BasicService.getCarRouteList(data.syPointId);
  return /*#__PURE__*/_react["default"].createElement(_vmCard["default"], {
    title: "\u6536\u8FD0\u89C4\u5219"
  }, /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement(_vmInfoCollection["default"], {
    data: [{
      key: 'syPointName',
      label: '收集点名称',
      value: data.syPointName,
      render: function render() {
        return /*#__PURE__*/_react["default"].createElement("a", {
          onClick: function onClick() {
            return openSyPoint && openSyPoint({
              id: data.syPointId,
              title: data.syPointName
            });
          }
        }, data.syPointName);
      }
    }],
    horizontal: true,
    width: '100%',
    ellipsis: true
  }), /*#__PURE__*/_react["default"].createElement("div", {
    className: "cc-restaurant-rules"
  }, (carRouteList || []).map(function (item) {
    var data = [{
      key: 'name',
      label: '路线名称',
      value: item.name,
      width: '100%',
      isAddress: true
    }, {
      key: 'carCode',
      label: '车牌号',
      value: item.carCode,
      render: function render() {
        return /*#__PURE__*/_react["default"].createElement("a", {
          onClick: function onClick() {
            return openCar && openCar({
              id: item.carId,
              title: item.carCode
            });
          }
        }, item.carCode);
      }
    }, {
      key: 'periodNames',
      label: '班次',
      value: item.periodNames
    }];
    return /*#__PURE__*/_react["default"].createElement("div", {
      key: item.id,
      className: "cc-restaurant-rules-item"
    }, /*#__PURE__*/_react["default"].createElement(_vmInfoCollection["default"], {
      data: data,
      gap: 8,
      horizontal: true,
      width: "50%"
    }));
  }))));
};
var _default = exports["default"] = CollectRule;
//# sourceMappingURL=CollectRule.js.map
