"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports["default"] = void 0;
var _vmInfoCollection = _interopRequireDefault(require("../../../vm-info-collection"));
var _react = _interopRequireDefault(require("react"));
var _api = require("../../../vtx-cc-cp-modal/api");
require("./index.less");
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
var dayObj = {
  '1': '一',
  '2': '二',
  '3': '三',
  '4': '四',
  '5': '五',
  '6': '六',
  '7': '日'
};
var Rules = function Rules(_ref) {
  var data = _ref.data,
    id = _ref.id;
  var carRouteList = _api.BasicService.getCarRouteList(id);
  var baseInfo = [{
    key: 'setTypeStr',
    label: '服务时段',
    value: "".concat((data === null || data === void 0 ? void 0 : data.setTypeStr) || '').concat((data === null || data === void 0 ? void 0 : data.setTypeStr) ? data.setType === 'fix_day' ? "\uFF0C\u6BCF".concat(data.setValue, "\u5929\u751F\u6210\u4E00\u6B21\u6536\u8FD0\u4EFB\u52A1") : "\uFF0C\u6BCF\u4E2A\u661F\u671F".concat(data.setValue.split(',').map(function (day) {
      return dayObj[day];
    }).join('、'), "\u6536\u8FD0") : '')
  }];
  return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement(_vmInfoCollection["default"], {
    data: baseInfo,
    gap: 8,
    horizontal: true,
    width: "100%"
  }), /*#__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
    }, {
      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
