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); }
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
import React from 'react';
import { JzljYsqyContext } from "../..";
import { VmInfoCollection, VmTable, VmWrapper } from "../../../_components";
import { overviewApis } from "../../api";
import "./index.less";
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
export default function Overview() {
  var _React$useContext = React.useContext(JzljYsqyContext),
    id = _React$useContext.id,
    _React$useContext$inf = _React$useContext.info,
    info = _React$useContext$inf === void 0 ? {} : _React$useContext$inf;
  var infoData = [{
    label: '企业名称',
    value: info === null || info === void 0 ? void 0 : info.name
  }, {
    label: '注册地所在行政区划',
    value: info === null || info === void 0 ? void 0 : info.divisionName
  }, {
    label: '联系人',
    value: info === null || info === void 0 ? void 0 : info.lxMan
  }, {
    label: '联系电话',
    value: info === null || info === void 0 ? void 0 : info.lxPhone
  }, {
    label: '营业执照编号',
    value: info === null || info === void 0 ? void 0 : info.yyzzCode
  }, {
    label: '运输垃圾类型',
    value: info === null || info === void 0 ? void 0 : info.rubbishTypeChs
  }, {
    label: '营业执照',
    value: info === null || info === void 0 ? void 0 : info.file,
    componentType: 'ATTACHS'
  }];
  var _overviewApis$useCarI = overviewApis.useCarInfo(id),
    _overviewApis$useCarI2 = _overviewApis$useCarI.carInfoData,
    carInfoData = _overviewApis$useCarI2 === void 0 ? [] : _overviewApis$useCarI2;
  var columns = [['车牌号', 'carCode', {}], ['车辆种类', 'carGradeName', {}], ['核定载重(吨)', 'regulationWeight', {
    align: 'right'
  }]].map(function (item) {
    return _objectSpread({
      title: item[0],
      dataIndex: item[1],
      key: item[1]
    }, item[2]);
  });
  var myTableProps = {
    dataSource: carInfoData,
    rowKey: 'id',
    columns: columns,
    indexFixed: true
  };
  return /*#__PURE__*/_jsxs("div", {
    className: "ysqy-overview",
    children: [/*#__PURE__*/_jsx("div", {
      className: "ysqy-overview-top",
      children: /*#__PURE__*/_jsx(VmWrapper, {
        title: "\u57FA\u672C\u4FE1\u606F",
        children: /*#__PURE__*/_jsx(VmInfoCollection, {
          data: infoData,
          width: '33.33%',
          horizontal: true
        })
      })
    }), /*#__PURE__*/_jsx("div", {
      className: "ysqy-overview-bottom",
      children: /*#__PURE__*/_jsx(VmWrapper, {
        title: "\u8F66\u8F86\u4FE1\u606F",
        children: /*#__PURE__*/_jsx(VmTable, _objectSpread({}, myTableProps))
      })
    })]
  });
}