import { Col, Row } from 'antd';
import dayjs from 'dayjs';
import { VmInfoCollection, VmTitle, VmWrapper } from "../../../_components";
import useSettings from "../../../_hooks/useSettings";
import { BaseService } from "../../api";
import CarWork from "./CarWork";
import "./index.less";
import Rules from "./Rules";
import TodayWork from "./TodayWork";
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
var BaseInfo = function BaseInfo(props) {
  var id = props.id,
    baseInfo = props.baseInfo,
    info = props.info;
  var _useSettings = useSettings(),
    theme = _useSettings.theme,
    isDark = _useSettings.isDark;
  var nowDate = dayjs().format('YYYY-MM-DD');
  var _BaseService$useBaseI = BaseService.useBaseInfo(id, nowDate, nowDate),
    todayWorkRes = _BaseService$useBaseI.todayWorkRes,
    dataSource = _BaseService$useBaseI.dataSource;
  var _BaseService$useConfi = BaseService.useConfig(),
    paramConfigsList = _BaseService$useConfi.paramConfigsList,
    productTypes = _BaseService$useConfi.productTypes;
  var mapStyle = {
    type: 'Marker',
    style: {
      icon: 'CP',
      color: '#52C41A'
    }
  };
  return /*#__PURE__*/_jsx("div", {
    className: "cp-wrapper",
    children: /*#__PURE__*/_jsxs(Row, {
      gutter: 16,
      style: {
        height: '100%'
      },
      children: [/*#__PURE__*/_jsx(Col, {
        span: 8,
        style: {
          height: '100%'
        },
        children: /*#__PURE__*/_jsxs(VmWrapper, {
          title: "\u57FA\u672C\u4FE1\u606F",
          children: [/*#__PURE__*/_jsx(VmInfoCollection, {
            data: baseInfo,
            horizontal: true,
            gap: 16
          }), /*#__PURE__*/_jsx(VmTitle, {
            title: "\u6536\u8FD0\u89C4\u5219"
          }), /*#__PURE__*/_jsx(Rules, {
            id: id,
            paramConfigsList: paramConfigsList
          })]
        })
      }), /*#__PURE__*/_jsx(Col, {
        span: 16,
        children: /*#__PURE__*/_jsxs(Row, {
          gutter: [10, 10],
          children: [/*#__PURE__*/_jsx(Col, {
            span: 24,
            children: /*#__PURE__*/_jsx("div", {
              className: "cp-wrapper-twork",
              children: /*#__PURE__*/_jsx(VmWrapper, {
                title: "\u4ECA\u65E5\u4F5C\u4E1A\u6C47\u603B",
                children: /*#__PURE__*/_jsx(TodayWork, {
                  data: todayWorkRes,
                  paramConfigsList: paramConfigsList,
                  productTypes: productTypes
                })
              })
            })
          }), /*#__PURE__*/_jsx(Col, {
            span: 24,
            children: /*#__PURE__*/_jsx("div", {
              className: "cp-wrapper-table",
              children: /*#__PURE__*/_jsxs(VmWrapper, {
                title: "\u4ECA\u65E5\u4F5C\u4E1A\u660E\u7EC6",
                contentStyle: {
                  overflowY: 'hidden'
                },
                children: [/*#__PURE__*/_jsx(CarWork, {
                  dataSource: dataSource,
                  isDark: isDark,
                  paramConfigsList: paramConfigsList
                }), ' ']
              })
            })
          })]
        })
      })]
    })
  });
};
export default BaseInfo;