"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports["default"] = void 0;
var _api = require("../../api");
var _vmCard = _interopRequireDefault(require("../../../vm-card"));
var _antd = require("antd");
var _react = _interopRequireDefault(require("react"));
var _vmFilter = require("../../../vm-filter");
var _vmTable = _interopRequireDefault(require("../../../vm-table"));
var _ahooks = require("ahooks");
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
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 CarList = function CarList(_ref) {
  var id = _ref.id;
  var _useSetState = (0, _ahooks.useSetState)({
      carCode: ''
    }),
    _useSetState2 = _slicedToArray(_useSetState, 2),
    search = _useSetState2[0],
    setSearch = _useSetState2[1];
  var tableProps = _api.BasicService.carList({
    carCode: search.carCode,
    id: id
  });
  var columns = [{
    title: '车牌号',
    dataIndex: 'carCode',
    width: 140,
    ellipsis: true,
    fixed: 'left'
  }, {
    title: '所属收运单位',
    dataIndex: 'manageUnitName',
    width: 160,
    ellipsis: true
  }, {
    title: '车辆类别',
    dataIndex: 'carClassName',
    width: 140,
    ellipsis: true
  }, {
    title: '车辆种类',
    dataIndex: 'carGradeName',
    width: 140,
    ellipsis: true
  }, {
    title: '车辆型号',
    dataIndex: 'carType',
    width: 140,
    ellipsis: true,
    render: function render(text) {
      return text || '-';
    }
  }, {
    title: '购买时间',
    dataIndex: 'procurementTime',
    width: 140,
    ellipsis: true,
    sorter: true
  }, {
    title: '司机姓名',
    dataIndex: 'driverName',
    width: 140,
    ellipsis: true,
    render: function render(text) {
      return text || '-';
    }
  }];
  return /*#__PURE__*/_react["default"].createElement(_antd.Row, {
    gutter: [10, 10],
    style: {
      padding: 10
    }
  }, /*#__PURE__*/_react["default"].createElement(_antd.Col, {
    span: 24
  }, /*#__PURE__*/_react["default"].createElement(_vmCard["default"], null, /*#__PURE__*/_react["default"].createElement(_vmFilter.VmFilterItem, {
    items: [{
      label: '车牌号',
      type: 'input',
      value: search.carCode,
      style: {
        width: 200
      },
      onChange: function onChange(e) {
        setSearch({
          carCode: e.target.value
        });
      }
    }]
  }))), /*#__PURE__*/_react["default"].createElement(_antd.Col, {
    span: 24
  }, /*#__PURE__*/_react["default"].createElement(_vmCard["default"], null, /*#__PURE__*/_react["default"].createElement(_vmTable["default"], Object.assign({}, tableProps, {
    columns: columns
  })))));
};
var _default = exports["default"] = CarList;
//# sourceMappingURL=index.js.map
