import dayjs from 'dayjs';
import { VmEmpty, VmLineCharts, VmWrapper } from "../../../_components";
import { ExeceptionService } from "../../api";
import { jsx as _jsx } from "react/jsx-runtime";
var MonthTrend = function MonthTrend(_ref) {
  var id = _ref.id;
  var _ExeceptionService$us = ExeceptionService.useAlarmMonthTrend(id, dayjs().subtract(6, 'M').format('YYYY-MM-DD'), dayjs().format('YYYY-MM-DD')),
    alarmMonthTrend = _ExeceptionService$us.alarmMonthTrend;
  var names = alarmMonthTrend.names,
    values = alarmMonthTrend.values;
  return /*#__PURE__*/_jsx("div", {
    className: "alarm-trend",
    children: /*#__PURE__*/_jsx(VmWrapper, {
      title: "\u6708\u5EA6\u8D8B\u52BF\u5206\u6790",
      children: values !== null && values !== void 0 && values.length ? /*#__PURE__*/_jsx(VmLineCharts, {
        xAxis: names,
        dataList: [{
          name: '次数',
          type: 'line',
          data: values[0] || []
        }],
        unit: "\u6B21",
        legendOption: {
          width: '95%'
        },
        gridOption: {
          top: 70
        }
      }) : /*#__PURE__*/_jsx(VmEmpty, {
        type: "NO_CHART"
      })
    })
  });
};
export default MonthTrend;