"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 _useSettings2 = _interopRequireDefault(require("../vm-hooks/useSettings"));
var _vmSubTitle = _interopRequireDefault(require("../vm-sub-title"));
var _vmNodata = _interopRequireDefault(require("../vm-nodata"));
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
var Wtlx = function Wtlx(props) {
  var orderCategory = props.orderCategory;
  var _useSettings = (0, _useSettings2["default"])(),
    isDark = _useSettings.isDark,
    chartColor = _useSettings.chartColor,
    chartFontColor = _useSettings.chartFontColor,
    theme = _useSettings.theme;
  var option = {
    color: chartColor,
    backgroundColor: 'transparent',
    tooltip: {
      show: true,
      trigger: 'item',
      formatter: '{b}: {c0}次'
    },
    legend: {
      orient: 'vertical',
      left: '45%',
      top: 'middle',
      align: 'left',
      itemGap: 12,
      itemWidth: 10,
      itemHeight: 10,
      formatter: function formatter(name) {
        var value = orderCategory.find(function (item) {
          return item.name === name;
        });
        if (value) {
          return "\t\t".concat(name, "\t\t").concat(value.value, "\u6B21\t\t");
        } else {
          return '';
        }
      },
      textStyle: {
        fontSize: 14,
        color: theme === 'blue' ? '#fff' : chartFontColor
      },
      pageIconColor: chartFontColor,
      pageIconInactiveColor: chartFontColor,
      pageTextStyle: {
        color: theme === 'blue' ? '#fff' : chartFontColor
      }
    },
    series: [{
      type: 'pie',
      radius: ['55%', '75%'],
      center: ['20%', '50%'],
      hoverAnimation: true,
      z: 10,
      itemStyle: {
        normal: {
          borderWidth: 2,
          borderColor: isDark ? '#003359' : '#ffffff'
        }
      },
      label: {
        show: false
      },
      data: orderCategory,
      labelLine: {
        show: false
      }
    }]
  };
  return /*#__PURE__*/_react["default"].createElement("div", {
    className: "appraisal-content-zg-wt"
  }, /*#__PURE__*/_react["default"].createElement(_vmSubTitle["default"], {
    title: "\u95EE\u9898\u7C7B\u578B\u5206\u6790"
  }), (orderCategory === null || orderCategory === void 0 ? void 0 : orderCategory.length) ? (/*#__PURE__*/_react["default"].createElement(_echartsForReact["default"], {
    option: option,
    notMerge: true,
    lazyUpdate: true,
    style: {
      height: '200px',
      width: '100%'
    }
  })) : (/*#__PURE__*/_react["default"].createElement(_vmNodata["default"], {
    style: {
      height: '100%',
      width: '100%'
    }
  })));
};
var _default = exports["default"] = Wtlx;
//# sourceMappingURL=Wtlx.js.map
