"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports["default"] = void 0;
var _react = _interopRequireDefault(require("react"));
var _moment = _interopRequireDefault(require("moment"));
var _echartsForReact = _interopRequireDefault(require("echarts-for-react"));
var _vmSubTitle = _interopRequireDefault(require("../../../vm-sub-title"));
var _api = require("../../api");
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
/**
 * 监测-报警信息-报警信息汇总
 */

var MonthTrend = function MonthTrend(_ref) {
  var id = _ref.id;
  var _AlarmService$useAlar = _api.AlarmService.useAlarmTrend(id, (0, _moment["default"])().subtract(6, 'M').format('YYYY-MM-DD'), (0, _moment["default"])().format('YYYY-MM-DD')),
    alarmTrend = _AlarmService$useAlar.alarmTrend;
  var legends = alarmTrend.legends,
    names = alarmTrend.names,
    values = alarmTrend.values;
  var option = {
    color: ['#4195FF', '#FFE25D'],
    tooltip: {
      trigger: 'axis'
    },
    legend: {
      show: true,
      itemWith: 6,
      itemHeight: 6,
      top: 20,
      textStyle: {
        color: '#fff',
        fontSize: 12
      },
      data: legends || []
    },
    grid: {
      top: 58,
      left: 24,
      bottom: 12,
      right: 24,
      containLabel: true
    },
    xAxis: {
      type: 'category',
      boundaryGap: false,
      axisTick: {
        show: false
      },
      axisLabel: {
        color: '#fff'
      },
      data: names || []
    },
    yAxis: [{
      name: '单位（人次）',
      type: 'value',
      nameTextStyle: {
        color: '#fff'
      },
      axisTick: {
        show: false
      },
      axisLabel: {
        color: '#fff'
      },
      axisLine: {
        show: true
      },
      splitLine: {
        lineStyle: {
          type: 'dashed',
          color: 'rgba(151,151,151,0.28)'
        }
      }
    }],
    series: [{
      name: '次数',
      type: 'line',
      data: values || []
    }]
  };
  return /*#__PURE__*/_react["default"].createElement("div", {
    className: "alarm-trend"
  }, /*#__PURE__*/_react["default"].createElement(_vmSubTitle["default"], {
    title: "\u7C7B\u578B\u5206\u6790"
  }), /*#__PURE__*/_react["default"].createElement(_echartsForReact["default"], {
    option: option,
    notMerge: true,
    lazyUpdate: true,
    style: {
      height: '300px',
      width: '100%'
    }
  }));
};
var _default = MonthTrend;
exports["default"] = _default;
//# sourceMappingURL=MonthTrend.js.map
