"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports["default"] = void 0;
var _react = _interopRequireDefault(require("react"));
var _echartsForReact = _interopRequireDefault(require("echarts-for-react"));
var _vmSubTitle = _interopRequireDefault(require("../vm-sub-title"));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
/**
 * 月度趋势分析
 */

var RmMonthTrend = function RmMonthTrend(_ref) {
  var data = _ref.data;
  var legends = data.legends,
    names = data.names,
    values = data.values;
  var option = {
    color: ['#4195FF', '#FFE25D'],
    tooltip: {
      trigger: 'axis'
    },
    legend: {
      show: true,
      itemWith: 6,
      itemHeight: 6,
      textStyle: {
        color: '#fff',
        fontSize: 12
      },
      data: legends || []
    },
    grid: {
      top: 28,
      left: 24,
      bottom: 24,
      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)'
        }
      }
    }
    // {
    //     name: '金额(元)',
    //     type: 'value',
    //     nameTextStyle: {
    //         color: '#fff',
    //     },
    //     axisTick: {
    //         show: false,
    //     },
    //     axisLabel: {
    //         color: '#fff',
    //     },
    //     axisLine: {
    //         show: true,
    //     },
    //     splitLine: {
    //         show: false,
    //     },
    // },
    ],

    series: [{
      name: '维保次数',
      type: 'line',
      yAxisIndex: 0,
      data: values[0] || []
    }
    // {
    //     name: '维保金额',
    //     type: 'line',
    //     yAxisIndex: 1,
    //     data: [140, 150, 160, 170, 110, 50, 90],
    // },
    ]
  };

  return /*#__PURE__*/_react["default"].createElement("div", {
    className: "rm-month-trend"
  }, /*#__PURE__*/_react["default"].createElement(_vmSubTitle["default"], {
    title: "\u6708\u5EA6\u8D8B\u52BF\u5206\u6790"
  }), /*#__PURE__*/_react["default"].createElement("div", {
    className: "rm-month-trend-chart"
  }, /*#__PURE__*/_react["default"].createElement(_echartsForReact["default"], {
    option: option,
    notMerge: true,
    lazyUpdate: true,
    style: {
      height: '100%',
      width: '100%'
    }
  })));
};
var _default = RmMonthTrend;
exports["default"] = _default;
//# sourceMappingURL=RmMonthTrend.js.map
