import * as echarts from 'echarts';
import _ from 'lodash';
import { useContext } from 'react';
import { VmEmpty, VmLineCharts } from "../../../_components";
import { BasicService } from "../../api";
import { CcCpContext } from "../../index";
import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
var Ljcsl = function Ljcsl(_ref) {
  var startDay = _ref.startDay,
    endDay = _ref.endDay;
  var _useContext = useContext(CcCpContext),
    id = _useContext.id;
  var data = BasicService.useGetSyPointCollectLine(id, startDay, endDay);
  var names = _.map(data, 'labelName');
  var values = _.map(data, 'labelValue');
  return /*#__PURE__*/_jsx(_Fragment, {
    children: (values === null || values === void 0 ? void 0 : values.length) > 0 ? /*#__PURE__*/_jsx(VmLineCharts, {
      dataList: [{
        name: '垃圾产生量',
        data: (values === null || values === void 0 ? void 0 : values.length) > 0 ? values : [],
        color: '#0FB964',
        smooth: true,
        symbol: 'none',
        areaStyle: {
          color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
            offset: 0,
            color: 'rgba(15, 185, 100, 0.30)'
          },
          // 半透明
          {
            offset: 1,
            color: 'rgba(15, 185, 100, 0)'
          } // 更透明
          ])
        }
      }],
      xAxis: names,
      unit: '%',
      showLegend: true,
      gridOption: {
        top: 30
      }
    }) : /*#__PURE__*/_jsx(VmEmpty, {})
  });
};
export default Ljcsl;