import _, { isEmpty } from 'lodash';
import { useContext } from 'react';
import { VmEmpty, VmLineCharts } from "../../../_components";
import { ExceptionService } from "../../api";
import { CcCpContext } from "../../index";
import { jsx as _jsx } from "react/jsx-runtime";
var ExceptionTrend = function ExceptionTrend(_ref) {
  var startDate = _ref.startDate,
    endDate = _ref.endDate;
  var _useContext = useContext(CcCpContext),
    id = _useContext.id;
  var _ExceptionService$use = ExceptionService.useGetSyPointErrorReportMonthNums(id, startDate, endDate),
    data = _ExceptionService$use.data,
    loading = _ExceptionService$use.loading;
  return !loading && isEmpty(data) ? /*#__PURE__*/_jsx(VmEmpty, {}) : /*#__PURE__*/_jsx(VmLineCharts, {
    xAxis: _.map(data, 'labelName'),
    dataList: _.map(data, 'labelValue'),
    unit: "\u6B21",
    legendOption: {
      width: '95%'
    },
    gridOption: {
      top: 70
    }
  });
};
export default ExceptionTrend;