/**
 * 区域进场量分析
 */

import { sumBy } from 'lodash';
import { VmEmpty, VmPieCharts } from "../../../_components";
import { BaseService } from "../../api-zd-reborn";
import "./index.less";
import { jsx as _jsx } from "react/jsx-runtime";
function Qyjcl(props) {
  var deviceId = props.deviceId,
    startDate = props.startDate,
    endDate = props.endDate;
  var _BaseService$useQyjcl = BaseService.useQyjcl(deviceId, startDate, endDate),
    areaSumData = _BaseService$useQyjcl.areaSumData;
  var total = sumBy(areaSumData || [], 'netWeight') || 0;
  return /*#__PURE__*/_jsx("div", {
    className: "df-qyjcl",
    children: areaSumData !== null && areaSumData !== void 0 && areaSumData.length ? /*#__PURE__*/_jsx(VmPieCharts, {
      height: 216,
      total: total === null || total === void 0 ? void 0 : total.toFixed(2),
      title: "\u5428",
      unit: "\u5428",
      name: "\u533A\u57DF\u8FDB\u573A\u91CF",
      innerRadius: ['50%', '65%'],
      outerRadius: ['65%', '70%'],
      dataList: (areaSumData === null || areaSumData === void 0 ? void 0 : areaSumData.map(function (ele) {
        return {
          name: ele.groupName,
          value: ele.netWeight
        };
      })) || [],
      legendConfig: {
        right: 16
      }
    }) : /*#__PURE__*/_jsx(VmEmpty, {
      type: "NO_CHART"
    })
  });
}
export default Qyjcl;