"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 _vmInfoCollection = _interopRequireDefault(require("../../../vm-info-collection"));
var _react = _interopRequireWildcard(require("react"));
var _api = require("../../../vtx-cc-cp-modal/api");
require("./index.less");
var _index2 = require("../../index");
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 }; }
var Rules = function Rules(_ref) {
  var id = _ref.id;
  var carRouteList = _api.BasicService.getCarRouteList(id);
  var _useContext = (0, _react.useContext)(_index2.CcCpContext),
    openCar = _useContext.openCar;
  return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement("div", {
    className: "cc-cp-rules"
  }, (carRouteList || []).map(function (item) {
    var data = [{
      key: 'name',
      label: '路线名称',
      value: item.name,
      width: '100%'
    }, {
      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-cp-rules-item"
    }, /*#__PURE__*/_react["default"].createElement(_vmInfoCollection["default"], {
      data: data,
      gap: 8,
      horizontal: true,
      width: "50%"
    }));
  })));
};
var _default = exports["default"] = Rules;
//# sourceMappingURL=Rules.js.map
